Skip to content

Commit 4ae91c4

Browse files
author
Lucky
authored
Merge branch 'main' into patch-1
2 parents e1e0bde + b400bd2 commit 4ae91c4

424 files changed

Lines changed: 13489 additions & 7022 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/devcontainer.json

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,28 @@
33
"image": "mcr.microsoft.com/devcontainers/javascript-node:20-bullseye",
44
"features": {
55
"ghcr.io/devcontainers/features/github-cli:1": {}
6-
}
7-
8-
// Features to add to the dev container. More info: https://containers.dev/features.
9-
// "features": {},
10-
11-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
12-
// "forwardPorts": [],
13-
14-
// Use 'postCreateCommand' to run commands after the container is created.
15-
// "postCreateCommand": "yarn install",
16-
17-
// Configure tool-specific properties.
18-
// "customizations": {},
19-
20-
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
21-
// "remoteUser": "root"
6+
},
7+
"customizations": {
8+
"vscode": {
9+
"settings": {},
10+
"extensions": [
11+
"dbaeumer.vscode-eslint"
12+
]
13+
}
14+
},
15+
"updateContentCommand": "npm install",
16+
"remoteUser": "root",
17+
"forwardPorts": [
18+
3000
19+
],
20+
"portsAttributes": {
21+
"3000": {
22+
"label": "Docs Preview",
23+
"onAutoForward": "notify",
24+
"protocol": "http"
25+
}
26+
},
27+
"runArgs": [
28+
"--network=host"
29+
]
2230
}
Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,38 @@
1-
name: Create Issue for Pull Request
1+
# Commeting out for now since we are not actively translating to Japanese
2+
# name: Create Issue for Pull Request
23

3-
on:
4-
pull_request:
5-
types: [opened, reopened]
6-
branches:
7-
- main
8-
paths:
9-
- "docs/**/*.md"
10-
- "docs/**/*.mdx"
4+
# on:
5+
# pull_request:
6+
# types: [opened, reopened]
7+
# branches:
8+
# - main
9+
# paths:
10+
# - "docs/**/*.md"
11+
# - "docs/**/*.mdx"
1112

12-
jobs:
13-
ja:
14-
runs-on: ubuntu-latest
15-
# Do not run translation on PRs from forks since they don't have access to the SIMPLEEN secret
16-
if: ${{ !github.event.pull_request.head.repo.fork }}
17-
steps:
18-
- uses: actions/checkout@v4
19-
with:
20-
ref: ${{ github.event.pull_request.base.sha }}
21-
- uses: actions/checkout@v4
22-
with:
23-
ref: ${{ github.sha }}
24-
- name: Get Changed Files
25-
id: files
26-
run: |
27-
echo "::set-output name=list::$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})"
28-
- uses: actions/github-script@v3
29-
with:
30-
github-token: ${{secrets.GITHUB_TOKEN}}
31-
script: |
32-
const issue = await github.issues.create({
33-
owner: context.repo.owner,
34-
repo: context.repo.repo,
35-
title: `${{ github.event.pull_request.title }} [ja]`,
36-
body: `Changed Files:\n${{ github.event.pull_request.html_url }}/files \n cc: @MomentoBigFun @Yoshiitaka`
37-
})
13+
# jobs:
14+
# ja:
15+
# runs-on: ubuntu-latest
16+
# # Do not run translation on PRs from forks since they don't have access to the SIMPLEEN secret
17+
# if: ${{ !github.event.pull_request.head.repo.fork }}
18+
# steps:
19+
# - uses: actions/checkout@v4
20+
# with:
21+
# ref: ${{ github.event.pull_request.base.sha }}
22+
# - uses: actions/checkout@v4
23+
# with:
24+
# ref: ${{ github.sha }}
25+
# - name: Get Changed Files
26+
# id: files
27+
# run: |
28+
# echo "::set-output name=list::$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})"
29+
# - uses: actions/github-script@v3
30+
# with:
31+
# github-token: ${{secrets.GITHUB_TOKEN}}
32+
# script: |
33+
# const issue = await github.issues.create({
34+
# owner: context.repo.owner,
35+
# repo: context.repo.repo,
36+
# title: `${{ github.event.pull_request.title }} [ja]`,
37+
# body: `Changed Files:\n${{ github.event.pull_request.html_url }}/files \n cc: @MomentoBigFun @Yoshiitaka`
38+
# })

.gitpod/automations.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
services:
2+
docusaurus:
3+
name: Start Docusaurus Locally
4+
triggeredBy: [ 'manual', 'postDevcontainerStart']
5+
commands:
6+
start: |
7+
npm install
8+
npm start

docs/account-sharing/index.mdx

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
---
2+
sidebar_position: 1
3+
sidebar_label: Account Sharing
4+
title: Account Sharing
5+
description: Learn how to share your Momento account with other users.
6+
pagination_next: null
7+
hide_title: true
8+
keywords:
9+
- account sharing
10+
- sharing
11+
- collaboration
12+
- team
13+
- organization
14+
- resources
15+
- members
16+
- accounts
17+
- operator
18+
- owner
19+
- viewer
20+
- role
21+
- access
22+
- permissions
23+
---
24+
25+
26+
# What is Account Sharing?
27+
Momento's account sharing feature enables you to collaborate and manage access to your resources with ease. By sharing your account, you can grant other users access to your topics, caches, and other resources. You can also control the level of access each user has by assigning them roles.
28+
29+
## Using Roles to Control Access
30+
The resources an account owner may share include **account** resources (e.g., account membership management and role assignment, billing and payment), **auth** resources (e.g., generating API keys and access tokens), and **data** resources (e.g., creating/deleting caches, manipulating cache data, publishing and subscribing to topics).
31+
32+
You can control the level of access to these categories of resources for each account member you invite using the following roles:
33+
34+
- **Owner**: an owner has full access to view and modify all resources.
35+
- **Operator**: an operator has full access to view and modify all auth and data resources but has read-only access to account resources.
36+
- **Viewer**: a viewer has read-only access to all resources.
37+
38+
## **How to Use Account Sharing as an Owner**
39+
40+
Users with the **Owner** role enjoy full access to all of the resources in the account. These are the only users able to modify account resources-- only an **Owner** can invite other users to join an account, change other users' roles, and remove users from the account.
41+
42+
### **Invite a User**
43+
- Log in to the [Momento Console](https://console.gomomento.com).
44+
- In the upper-right corner, click on your account info dropdown and select **Manage Account**.
45+
46+
<img src="/img/account-sharing/manage-account.png" width="60%"/>
47+
- Click on the **Invite User** button.
48+
49+
<img src="/img/account-sharing/invite-user.png" width="90%"/>
50+
- Enter the email address of the user you wish to invite, choose the role you want to assign to them, and click **Invite**. They will receive an email invitation to join your account.
51+
52+
<img src="/img/account-sharing/invite-user-modal.png" width="60%"/>
53+
54+
### **View and Revoke Pending Account Invitations**
55+
- Log in to the [Momento Console](https://console.gomomento.com).
56+
- In the upper-right corner, click on your account info dropdown and select **Manage Account**.
57+
58+
<img src="/img/account-sharing/manage-account.png" width="60%"/>
59+
- Click on the **Pending Invitations** tab to view all outstanding user invitations. You can use the **Revoke** button to cancel a pending invitation.
60+
61+
<img src="/img/account-sharing/pending-account-invitations.png" width="90%"/>
62+
63+
### **Change a User's Role**
64+
- Log in to the [Momento Console](https://console.gomomento.com).
65+
- In the upper-right corner, click on your account info dropdown and select **Manage Account**.
66+
67+
<img src="/img/account-sharing/manage-account.png" width="60%"/>
68+
- On the **Account Members** tab, find the user you want to change the role for and click on the edit icon next to their role.
69+
70+
<img src="/img/account-sharing/change-role-edit-button.png" width="90%"/>
71+
- Select the new role you want to assign to the user and click **Save**.
72+
73+
<img src="/img/account-sharing/role-change-menu.png" width="90%"/>
74+
75+
### **Remove a User**
76+
- Log in to the [Momento Console](https://console.gomomento.com).
77+
- In the upper-right corner, click on your account info dropdown and select **Manage Account**.
78+
79+
<img src="/img/account-sharing/manage-account.png" width="60%"/>
80+
- Find the user you want to remove and click on the **Remove** button.
81+
82+
<img src="/img/account-sharing/remove-user.png" width="90%"/>
83+
- Confirm the removal by clicking **Remove** in the dialog box.
84+
85+
<img src="/img/account-sharing/confirm-remove-user.png" width="60%"/>
86+
87+
## **How to Use Account Sharing as an Account Member**
88+
89+
After being invited to join an account, you can accept the invitation and switch between your accounts in the Momento Console. You can also leave an account if you no longer need access to it.
90+
91+
### **Accept an Invitation**
92+
- When a Momento account owner invites you to join an account, you will receive an email notification.
93+
- Click on the **Join Account** button in the email to navigate to the Momento console.
94+
- Log in to the console using the email address that received the invitation.
95+
- After logging in, you will be presented with a modal dialog displaying a list of accounts you have been invited to.
96+
97+
<img src="/img/account-sharing/pending-user-invitations-modal.png" width="60%"/>
98+
99+
- Follow the link to the invitations page in the dialog or visit it later by clicking on your account info dropdown and selecting **Manage User**.
100+
101+
<img src="/img/account-sharing/account-menu-manage-user.png"/>
102+
103+
- Click on the **Pending Invitations** tab to view all of your outstanding invitations to accounts. You can use the **Accept** button to join an account or the **Decline** button to decline and remove the invitation.
104+
105+
<img src="/img/account-sharing/pending-user-invitations-list.png" width="90%"/>
106+
107+
108+
### **Switch Accounts**
109+
- If you are added to multiple accounts, you can switch between accounts inside the Momento Console.
110+
- Log in to the [Momento Console](https://console.gomomento.com).
111+
- In the upper-right corner, click on your account info dropdown and select **Switch Account**.
112+
113+
<img src="/img/account-sharing/switch-account.png" width="60%"/>
114+
- Select the account you want to switch to from the list.
115+
116+
<img src="/img/account-sharing/select-account.png" width="60%"/>
117+
118+
### **Leave an Account**
119+
120+
- If you no longer need access to an acount, you can leave it.
121+
- Log in to the [Momento Console](https://console.gomomento.com).
122+
- In the upper-right corner, click on your account info dropdown and select **Manage Account**.
123+
124+
<img src="/img/account-sharing/manage-account.png" width="60%"/>
125+
126+
- Click on the **Account Members** tab to view all members of the account.
127+
- Find your user entry and click on the **Leave** button.
128+
129+
<img src="/img/account-sharing/leave-account.png" width="90%"/>
130+
131+
- **Note**: users with the **Owner** role may not leave an account. If you are an account owner and wish to leave the account, you must have another **Owner** remove you or change your role so you can leave the account.
132+
133+
## **Roles and the Console Interface**
134+
135+
Depending on your role in an account, different pages and user interface elements may be inaccessible to you. For example, because only users with the **Owner** role are allowed to access account resources, the buttons and links that modify account data on the **Manage Account** page will be disabled for users with the **Operator** or **Viewer** roles. User interface elements highlighted in the image below are disabled for non-**Owner** users.
136+
137+
<img src="/img/account-sharing/disabled-actions.png" width="90%"/>
138+
139+
Hovering over any of the highlighted elements on that page will display a tooltip explaining that the element is disabled due to insufficient permissions.
140+
141+
<img src="/img/account-sharing/unauthorized-tooltip.png" width="60%"/>
142+
143+
Users with the **Viewer** role can view account, auth, and data resources but can not modify them. These users will encounter additional disabled elements throughout the console interface, for example the **Create Cache** button on the **Caches** page. Other console pages, such as the one for generating API keys and tokens, are inaccessible to **Viewer** users. Links to these pages are styled to signify that they are not clickable.
144+
145+
<img src="/img/account-sharing/landing-page-disabled-links.png" width="90%"/>
146+
147+
148+
## Important Notes
149+
- **Member Limit**: You can have up to 10 members in your account. If you reach this limit, you will need to remove an existing user before adding a new one, or you can also request a higher limit by contacting Momento at support@momentohq.com.
150+
- **Removing Owners**: Any **Owner** can remove any non-**Owner** account member. However, users with the **Owner** role cannot be removed from an account. To remove an account **Owner**, another **Owner** must first change their role.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"label": "Authentication",
3+
"position": 2,
4+
"collapsible": true,
5+
"collapsed": true,
6+
"link": {
7+
"description": "Discover the authentication and authorization measures of the Momento platform"
8+
}
9+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
id: api-keys
3+
title: API keys
4+
sidebar_label: API keys
5+
description: Learn what Momento API keys are, how to create them, and how they are used.
6+
---
7+
8+
# API keys
9+
10+
API keys are *long-lived values intended for programmatic use*. These keys grant integrating applications access to certain caches and topics.
11+
12+
When creating an API key, you are presented with two options via the [Momento console](https://console.gomomento.com/tokens):
13+
14+
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.
15+
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.
16+
17+
:::info
18+
19+
It is not possible to create "super-user" API keys via the Momento SDK; these may only be created in the console. However, you *can* use the SDK to create API keys with specific permissions via fine-grain access control.
20+
21+
:::
22+
23+
## Creating an API key
24+
25+
While it is possible to create API keys via the Momento SDK, the simplest way to create them is to use the [Momento console](https://console.gomomento.com/tokens).
26+
27+
### Step 1: Sign up or log into the Momento console
28+
29+
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.
30+
31+
![Image of Momento console landing page](@site/static/img/getting-started/console.png)
32+
33+
### Step 2: Generate your API key
34+
35+
In the console, select the [API Keys](https://console.gomomento.com/tokens) menu option.
36+
37+
Once on the API key page, select the information that matches where your caches live:
38+
39+
1. Cloud provider
40+
2. Region
41+
3. Key Type
42+
3. (Optional) Expiration date
43+
44+
![Image showing the fields to create a new API key](@site/static/img/getting-started/select-provider-region.png)
45+
46+
Once complete, click on the **Generate** button to create your API Key!
47+
48+
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.
49+
50+
### Step 3: Secure it!
51+
52+
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.
53+
54+
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).
55+
56+
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*!
57+
58+
## Expiration
59+
60+
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.
61+
62+
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!
63+
64+
Momento provides an example of an automatic API key rotation lambda for your convenience [here](https://github.com/momentohq/auth-token-refresh-lambda).
65+
66+
## Use cases
67+
68+
For shorter-lived authentication use cases, with targeted permission scopes, consider using [Momento tokens](./tokens.mdx).
69+
70+
API keys are a good choice for situations where:
71+
72+
* All usage is programmatic and server-side
73+
* You are okay with longer-lived keys that must be rotated on a monthly/yearly basis
74+
* The key needs relatively broad permissions
75+
76+
For more information on managing the permissions on either API Keys or Tokens via fine-grained access control, see the [permissions page](./permissions.mdx).
77+
78+
Ready to get started? Head on over to the [Momento console](https://console.gomomento.com/tokens) and get your API key!

0 commit comments

Comments
 (0)