Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split docs into seperate products and fix fallout. #431

Merged
merged 14 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Generates a new Momento auth token with the specified permissions and expiry.
- `expiresAt`: Timestamp - the timestamp at which the token will expire
* Error

See [response objects](./response-objects) for specific information.
See [response objects](./response-objects.md) for specific information.

</details>

Expand Down Expand Up @@ -67,7 +67,7 @@ Refreshes an existing, unexpired Momento auth token. Produces a new auth token
- `expiresAt`: Timestamp - the timestamp at which the token will expire
* Error

See [response objects](./response-objects) for specific information.
See [response objects](./response-objects.md) for specific information.

</details>

Expand Down Expand Up @@ -180,7 +180,7 @@ Disposable tokens differ from the usual Momento auth token in several key ways:
- `expiresAt`: Timestamp - the timestamp at which the token will expire
* Error

See [response objects](./response-objects) for specific information.
See [response objects](./response-objects.md) for specific information.

</details>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ sidebar_position: 10
sidebar_label: CollectionTTL object
title: CollectionTTL API reference
description: Learn how to interact with the CollectionTTL object in Momento Cache.
slug: /develop/api-reference/collections/collectionttl
---

# CollectionTTL object API reference
Expand All @@ -12,7 +11,7 @@ This object is passed into API methods to say whether a TTL should be updated an

This tries to make the process more intuitive by providing named constructors and copiers for various situations.

See [Expire Data with TTL](../../../learn/how-it-works/expire-data-with-ttl) for more information on how TTL works with Momento Cache.
See [Expire Data with TTL](./../../learn/how-it-works/expire-data-with-ttl.md) for more information on how TTL works with Momento Cache.

## Compatible data types

Expand Down Expand Up @@ -55,4 +54,4 @@ You cannot provide a CollectionTTL object when performing a read operation like
- refreshTtl(): boolean - Sets if the TTL should be refreshed when the item is modified
- withRefreshTtlOnUpdates(): CollectionTtl - a copy, but refresh is true
- withNoRefreshTtlOnUpdates(): CollectionTtl - a copy, but refresh is false
- toString(): displays the TTL in seconds and the refreshTtl configuration
- toString(): displays the TTL in seconds and the refreshTtl configuration
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ sidebar_position: 1
sidebar_label: Dictionary
title: Dictionary API reference
description: Learn how to interact with the API for dictionary collection data types in Momento Cache.
slug: /develop/api-reference/collections/dictionary
---

import { SdkExampleTabs } from "@site/src/components/SdkExampleTabs";
Expand All @@ -12,7 +11,7 @@ import { SdkExampleTabs } from "@site/src/components/SdkExampleTabs";
import { SdkExampleTabsImpl } from "@site/src/components/SdkExampleTabsImpl";

# Dictionary API reference for Momento Cache
This page details the Momento API methods for the [dictionary collection data type](./../datatypes.md#dictionary-collections).
This page details the Momento API methods for the [dictionary collection data type](./../basics/datatypes.md#dictionary-collections).

<img src="/img/dictionary-collections.jpg" width="90%" alt="a technical illustration of stacks of books. some dusty, so not. All collected into groups." />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description: Discover the HTTP API for edge computing services to access serverl

<img src="/img/http-api.jpg" width="90%" alt="a picture of abstract shapes as building and nodes of data connecting them at high speed" />

Momento provides an HTTP API interface for your applications that can’t use our [SDKs](/develop) or for ones that prefer to use things like curl or fetch. For example, when deploying to edge compute services like [Cloudflare Workers](https://workers.cloudflare.com/), [Fastly Compute@Edge](https://www.fastly.com/products/edge-compute), etm. this API is for you. Be aware that most other applications should likely use [Momento’s SDK clients](/develop).
Momento provides an HTTP API interface for your applications that can’t use our [SDKs](./../) or for ones that prefer to use things like curl or fetch. For example, when deploying to edge compute services like [Cloudflare Workers](https://workers.cloudflare.com/), [Fastly Compute@Edge](https://www.fastly.com/products/edge-compute), etm. this API is for you. Be aware that most other applications should likely use [Momento’s SDK clients](./../).

You can also view the Open API Specification in our [public workspace in Postman](https://www.postman.com/gomomento/workspace/http-api/api/662743a0-471a-41a1-b446-5db596164a00/definition/4765b18e-ba84-4802-9795-ecce9c408062?view=documentation).

Expand Down Expand Up @@ -129,12 +129,12 @@ Sets a scalar value in a cache.

##### Query Parameters

| Parameter&nbsp;name | Required? | Type | Description |
|---------------------|-----------|----------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
| key | no** | URL-safe&nbsp;string | The key to retrieve from the cache. |
| key_base64 | no** | Base64&nbsp;URL-encoded&nbsp;binary&nbsp;key | The key to retrieve from the cache. |
| token | no*** | URL-safe&nbsp;string | The Momento auth token, in string format, to be used for authentication/authorization of the request. |
| ttl_seconds | yes | Integer | The TTL to be set on the key, in seconds. For more on TTL, see [Expire Data with Time-to-Live](/learn/how-it-works/expire-data-with-ttl). |
| Parameter&nbsp;name | Required? | Type | Description |
|---------------------|-----------|----------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|
| key | no** | URL-safe&nbsp;string | The key to retrieve from the cache. |
| key_base64 | no** | Base64&nbsp;URL-encoded&nbsp;binary&nbsp;key | The key to retrieve from the cache. |
| token | no*** | URL-safe&nbsp;string | The Momento auth token, in string format, to be used for authentication/authorization of the request. |
| ttl_seconds | yes | Integer | The TTL to be set on the key, in seconds. For more on TTL, see [Expire Data with Time-to-Live](./../../learn/how-it-works/expire-data-with-ttl). |

** You must specify a key to be accessed in the cache. This may be either the key query parameter, which allows a URL-safe string, or the key_base64 parameter, which allows a Base64 URL-encoded key.

Expand Down Expand Up @@ -357,4 +357,4 @@ Token provided in query parameter:

Token provided as *Authorization* header:

`curl -X POST -H "Authorization: <token>" -d 'hello world!' "https://api.cache.cell-us-east-1-1.prod.a.momentohq.com/topics/my-cache/example"`
`curl -X POST -H "Authorization: <token>" -d 'hello world!' "https://api.cache.cell-us-east-1-1.prod.a.momentohq.com/topics/my-cache/example"`
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ Collections may contain different types of structures depending on your use case
* [Sets](./set-collections.md) are an unordered collection of unique elements in string format.
* [Sorted Sets](./sorted-set-collections.md) are an ordered collection of unique elements. Each element contains a value:score pair.

For more in-depth information on usage, see [collection data types](./../datatypes.md).
For more in-depth information on usage, see [collection data types](./../basics/datatypes.md).

## Current status of API support in SDKs

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ sidebar_position: 12
sidebar_label: Language Support
title: Language API Support Matrix
description: A reference as to which Momento SDK languages support each API
slug: /develop/api-reference/language-support
pagination_next: null
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ sidebar_position: 2
sidebar_label: Lists
title: List API reference
description: Learn how to interact with the API for list collection data types in Momento Cache.
slug: /develop/api-reference/collections/list
---

import { SdkExampleTabs } from "@site/src/components/SdkExampleTabs";
Expand All @@ -12,11 +11,11 @@ import { SdkExampleTabs } from "@site/src/components/SdkExampleTabs";
import { SdkExampleTabsImpl } from "@site/src/components/SdkExampleTabsImpl";

# List API reference for Momento Cache
This page details the Momento API methods for the [list collection data types](./../datatypes.md#list-collections).
This page details the Momento API methods for the [list collection data types](./../basics/datatypes.md#list-collections).

<br />

<img src="/img/list-collections.jpg" width="90%" alt="a technical illustration of a scroll with lists of information. All collected into groups." />
![a technical illustration of a scroll with lists of information. All collected into groups.](@site/static/img/list-collections.jpg)

## List methods

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ sidebar_label: Response objects
title: Response object API reference
pagination_next: null
description: Learn how to interact with the response object in the Momento API.
slug: /develop/api-reference/response-objects
---

# Response objects from Momento APIs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ sidebar_position: 3
sidebar_label: Sets
title: Set API reference
description: Learn how to interact with the API for set collection data types in Momento Cache.
slug: /develop/api-reference/collections/sets
---

import { SdkExampleTabs } from "@site/src/components/SdkExampleTabs";
Expand All @@ -15,11 +14,11 @@ import { SdkExampleTabsImpl } from "@site/src/components/SdkExampleTabsImpl";

A set is a collection of elements, but each element can appear only once and order is not guaranteed.

<img src="/img/sets.jpg" width="90%" alt="a diagram of luggage as sets, but in any old order and not organized at all." />
![a diagram of luggage as sets, but in any old order and not organized at all.](@site/static/img/sets.jpg)

Example: if your set contains `[1, 2, 3]` and you add 2, the set remains `[1, 2, 3].`

See [Sets](./../datatypes.md#set-collections) for more information on their usage.
See [Sets](./../basics/datatypes.md#set-collections) for more information on their usage.

## Set methods

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ sidebar_position: 4
sidebar_label: Sorted sets
title: Sorted set collections API reference
description: Learn how to interact with the API for sorted set collection data types in Momento Cache.
slug: /develop/api-reference/collections/sortedsets
---

import { SdkExampleTabs } from "@site/src/components/SdkExampleTabs";
Expand All @@ -15,7 +14,7 @@ import { SdkExampleTabsImpl } from "@site/src/components/SdkExampleTabsImpl";

A sorted set in Momento Cache is a collection of unique elements with a value (String, Byte[], etc.) and score (signed double 64-bit float) pair. The elements in the item are ordered by the score.

<img src="/img/sorted-sets.jpg" width="90%" alt="a diagram of luggage as sets, but organized and stacked nicely." />
![A diagram of luggage as sets, but organized and stacked nicely.](@site/static/img/sorted-sets.jpg)

## Sorted set methods

Expand Down
72 changes: 72 additions & 0 deletions docs/cache/develop/authentication/api-keys.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
sidebar_position: 10
title: API Keys
sidebar_label: API Keys
description: Learn what Momento API keys are, how to create them, and how they are used.
---

# Momento API keys

![a technical illustration of API keys and their use to secure your application.](@site/static/img/api-keys-page.jpg)

API keys are *long-lived values intended for programmatic use*. These keys grant integrating applications access to certain caches and topics. When creating an API key, you are presented with two options via the [Momento console](https://console.gomomento.com/tokens):

1. A "super-user" key that grants access to everything in your account, like creating and deleting caches, setting and getting cache items, and publishing and subscribing to topics.
2. A fine-grained access control (FGAC) key that is limited to data operations only, like setting and getting cache items or publishing and subscribing to topics.

:::info

You are not able to create "super-user" API keys via the Momento SDK. However, you *can* create fine-grain access controlled keys! Check out our [Auth API reference page](./../api-reference/auth.md) for more details.

:::

## Creating an API key

While you are certainly allowed to create API keys via our SDK, it is generally recommended to use the [Momento console](https://console.gomomento.com/tokens). This allows you to monitor and maintain your long-lived keys visually, making sure you don't accidentally open up a security hole in your account.

### Step 1: Sign up or log into the Momento console

Go to the [Momento console](https://console.gomomento.com/tokens) and follow the instructions to log in with your email address, Google account, or GitHub account.

![Image of Momento console landing page](@site/static/img/getting-started/console.png)

### Step 2: Generate your API key

In the console, select the [API Keys](https://console.gomomento.com/tokens) menu option.

Once on the API key page, select the information that matches where your caches live:

1. Cloud provider
2. Region
3. Key Type
3. (Optional) Expiration date

![Image showing the fields to create a new API key](@site/static/img/getting-started/select-provider-region.png)

Once complete, click on the **Generate** button to create your API Key!

You can copy the value of the key directly and store it in a secure location or you can click on the **Download JSON** button to download the key and expiration date to your machine.

### Step 3: Secure it!

API keys are long-lived and typically grant high levels of access to the holder. With this in mind, be sure to securely store your API key in a location that encrypts the value and prevents plain-text viewing.

If your application is hosted in the cloud, it is best practice to store your keys in and retrieve from services like [AWS Secrets Manager](https://aws.amazon.com/secrets-manager/), [Azure Key Vault](https://learn.microsoft.com/en-us/azure/key-vault/general/overview), or [GCP Secret Manager](https://cloud.google.com/secret-manager).

Storage of an API key is specific to your implementation and standard coding practices, but one thing is consistent across all applications - *keep it safe*!

## Expiration

When creating an API key, you have the option to create one that never expires and one that expires after a certain amount of time. We **do not recommend creating keys that never expire**. This ends up being a security risk if the key were ever to become compromised.

The Momento console offers several pre-configured options for expiration ranges or you can select your own date. Just remember to create a new API key and rotate it in your application before it expires to prevent outages!

## Use cases

There are many reasons to **not** use an API key for auth but there are also a few reasons to use one.

* All usage is programmatic and server-side
* You are okay with longer-lived keys that must be rotated on a monthly/yearly basis
* You need to create session tokens (must use a "super-user" token for this)

Ready to get started? Head on over to the [Momento console](https://console.gomomento.com/tokens) and get your API key!
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ sidebar_label: Authentication
description: Discover how to authenticate with Momento and control access to resources.
---

<img src="/img/authentication-page.jpg" width="90%" alt="a technical illustration of Momento authentication and access control." />
<img src="/img/authentication-page.jpg" width="95%" alt="a technical illustration of Momento authentication and access control." />

You've decided to try out Momento, yeehaw! Let's talk about how you're going to make your first call and subsequently allow your app users to make calls.

We have a bunch of different ways you can interact with our services:

* In your browser via the [Momento Console](https://console.gomomento.com)
* Long-term stored usage with [API keys](/develop/authentication/api-keys.md)
* Short-term and limited scope with [tokens](/develop/authentication/tokens.md)
* Long-term stored usage with [API keys](./api-keys.md)
* Short-term and limited scope with [tokens](./tokens.md)

Each one of these methods comes with their own range of use cases and varying implementations. Based on the type of application you're building, you might choose to issue a bunch of short-lived, limited scope tokens to your users. If that's the case, then check out our page on [tokens](/develop/authentication/tokens.md). Maybe you're interested in creating a key and forgetting about it for a year. Hop over to our [API keys](/develop/authentication/api-keys.md) page.
Each one of these methods comes with their own range of use cases and varying implementations. Based on the type of application you're building, you might choose to issue a bunch of short-lived, limited scope tokens to your users. If that's the case, then check out our page on [tokens](./tokens.md). Maybe you're interested in creating a key and forgetting about it for a year. Hop over to our [API keys](./api-keys.md) page.

Need help deciding which one is for you? We got you 👇

Expand Down
Loading
Loading