Skip to content

Commit 2d04264

Browse files
authored
Merge pull request #347 from kirmar/docs/update-setup-instructions
docs: Update setup instructions Main updates: * Focus on v2 API keys with updated links * Note settings for v1 API key (currently required for automated tests) * Use existing `make` commands where possible * Remove references to unused environment variables (`TEST_CACHE_DEFAULT`, `TEST_CACHE_WITH_PROFILE`, `TEST_PROFILE`) and nonexistent test file (`configure_profile_test`)
2 parents df436cd + 2afbb2d commit 2d04264

File tree

4 files changed

+85
-56
lines changed

4 files changed

+85
-56
lines changed

CONTRIBUTING.ja.md

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
## ビルド
22

33
```
4-
cargo build
4+
make build
55
```
66

7-
## テスト
7+
## Manual Testing
88

99
`~/.momento/credentials``~/.momento/config` が以下のデータを含み、存在している事をご確認ください。
1010

1111
`~/.momento/credentials`
1212

1313
```
1414
[default]
15-
token=<YOUR_TOKEN>
15+
api_key_v2=<YOUR_TOKEN>
16+
endpoint=<YOUR_ENDPOINT_URL>
1617
[YOUR_TEST_PROFILE]
17-
token=<YOUR_TOKEN>
18+
api_key_v2=<YOUR_TOKEN>
19+
endpoint=<YOUR_ENDPOINT_URL>
1820
```
1921

22+
- If you prefer, create a legacy API key instead (as for [automated testing](#automated-testing)), then set a `token` instead of `api_key_v2`/`endpoint`.
23+
2024
`~/.momento/config`
2125

2226
```
@@ -28,25 +32,30 @@ cache=<YOUR_TEST_CACHE_WITH_PROFILE>
2832
ttl=700
2933
```
3034

31-
```
32-
export TEST_CACHE_DEFAULT=<YOUR_TEST_CACHE_DEFAULT>
33-
export TEST_CACHE_WITH_PROFILE=<YOUR_TEST_CACHE_WITH_PROFILE>
34-
export TEST_PROFILE=<YOUR_TEST_PROFILE>
35-
./run_test_sequentially.sh
36-
cargo clippy --all-targets --all-features -- -D warnings
35+
Follow the [README](./README.md#use-cli), using `./target/debug/momento` instead of `momento`, for example:
36+
37+
```bash
38+
./target/debug/momento cache create example-cache
3739
```
3840

39-
<br>
41+
## Automated Testing
4042

41-
:warning: `cargo test --test configure_profiles_test`を実行する上での注意事項
43+
For the automated tests, a [legacy API key](https://console.gomomento.com/api-keys) is required with the following settings:
44+
- **Type of key**: Super User Key
45+
- **Expiration**: highly recommended (Legacy keys do not support revocation.)
4246

47+
```bash
48+
read -s -p "API key: " TEST_AUTH_TOKEN
49+
# Paste your API key. (Note: You will not be able to see it in the shell.)
50+
export TEST_AUTH_TOKEN
51+
make test
4352
```
44-
export TEST_AUTH_TOKEN=<YOUR_TEST_AUTH_TOKEN>
45-
cargo test --test configure_profile_test
46-
```
4753

48-
- もし credentials と config ファイルがすでにローカル環境に存在する場合、`cargo test --test configure_profiles_test`を実行する事により`TEST_AUTH_TOKEN_DEFAULT`で指定されたトークンがご自身の`default`プロファイルで指定されたトークン値を上書きします。
49-
- `TEST_CACHE_DEFAULT`の値とご自身の`default`プロファルの`cache`値が同じである事、またその`cache`がすでに存在する事が必須条件です。しかし、このテストの実行が成功した場合、その`cache`は削除されます。
54+
### Formatting
55+
56+
```bash
57+
make lint
58+
```
5059

5160
## デプロイ
5261

CONTRIBUTING.md

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
### Building
22

33
```
4-
cargo build
4+
make build
55
```
66

7-
### Testing
7+
### Manual Testing
88

9-
Make sure you have `~/.momento/credentials` and `~/.momento/config` files with the following data.
9+
Make sure you have `~/.momento/credentials` and `~/.momento/config` files with your [API key(s)](https://console.gomomento.com/keys), [endpoint URL(s)](https://docs.momentohq.com/platform/regions), and [cache name(s)](https://console.gomomento.com/caches).
1010

1111
`~/.momento/credentials`
1212

1313
```
1414
[default]
15-
token=<YOUR_TOKEN>
15+
api_key_v2=<YOUR_TOKEN>
16+
endpoint=<YOUR_ENDPOINT_URL>
1617
[YOUR_TEST_PROFILE]
17-
token=<YOUR_TOKEN>
18+
api_key_v2=<YOUR_TOKEN>
19+
endpoint=<YOUR_ENDPOINT_URL>
1820
```
1921

22+
- If you prefer, create a legacy API key instead (as for [automated testing](#automated-testing)), then set a `token` instead of `api_key_v2`/`endpoint`.
23+
2024
`~/.momento/config`
2125

2226
```
@@ -28,25 +32,30 @@ cache=<YOUR_TEST_CACHE_WITH_PROFILE>
2832
ttl=700
2933
```
3034

31-
```
32-
export TEST_CACHE_DEFAULT=<YOUR_TEST_CACHE_DEFAULT>
33-
export TEST_CACHE_WITH_PROFILE=<YOUR_TEST_CACHE_WITH_PROFILE>
34-
export TEST_PROFILE=<YOUR_TEST_PROFILE>
35-
./run_test_sequentially.sh
36-
cargo clippy --all-targets --all-features -- -D warnings
35+
Follow the [README](./README.md#use-cli), using `./target/debug/momento` instead of `momento`, for example:
36+
37+
```bash
38+
./target/debug/momento cache create example-cache
3739
```
3840

39-
<br>
41+
### Automated Testing
4042

41-
:warning: Important notes on running `cargo test --test configure_profiles_test`
43+
For the automated tests, a [legacy API key](https://console.gomomento.com/api-keys) is required with the following settings:
44+
- **Type of key**: Super User Key
45+
- **Expiration**: highly recommended (Legacy keys do not support revocation.)
4246

47+
```bash
48+
read -s -p "API key: " TEST_AUTH_TOKEN
49+
# Paste your API key. (Note: You will not be able to see it in the shell.)
50+
export TEST_AUTH_TOKEN
51+
make test
4352
```
44-
export TEST_AUTH_TOKEN=<YOUR_TEST_AUTH_TOKEN>
45-
cargo test --test configure_profile_test
46-
```
4753

48-
- If you already have existing credentials and config files locally, running `cargo test --test configure_profiles_test` with provided `TEST_AUTH_TOKEN_DEFAULT` will overwrite the value for token in your `default` profile.
49-
- The value for `TEST_CACHE_DEFAULT` needs to match the cache value in your `default` profile and the cache needs to exist. However, this cache will be deleted after this test runs successfully.
54+
### Formatting
55+
56+
```bash
57+
make lint
58+
```
5059

5160
### Deploying
5261

CONTRIBUTING.pt.md

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
## Construindo
22

33
```
4-
cargo build
4+
make build
55
```
66

7-
## Testando
7+
## Manual Testing
88

99
Garanta que você tem os arquivos `~/.momento/credentials` e `~/.momento/config` com os seguintes dados.
1010

1111
`~/.momento/credentials`
1212

1313
```
1414
[default]
15-
token=<YOUR_TOKEN>
15+
api_key_v2=<YOUR_TOKEN>
16+
endpoint=<YOUR_ENDPOINT_URL>
1617
[YOUR_TEST_PROFILE]
17-
token=<YOUR_TOKEN>
18+
api_key_v2=<YOUR_TOKEN>
19+
endpoint=<YOUR_ENDPOINT_URL>
1820
```
1921

22+
- If you prefer, create a legacy API key instead (as for [automated testing](#automated-testing)), then set a `token` instead of `api_key_v2`/`endpoint`.
23+
2024
`~/.momento/config`
2125

2226
```
@@ -28,26 +32,31 @@ cache=<YOUR_TEST_CACHE_WITH_PROFILE>
2832
ttl=700
2933
```
3034

31-
```
32-
export TEST_CACHE_DEFAULT=<YOUR_TEST_CACHE_DEFAULT>
33-
export TEST_CACHE_WITH_PROFILE=<YOUR_TEST_CACHE_WITH_PROFILE>
34-
export TEST_PROFILE=<YOUR_TEST_PROFILE>
35-
./run_test_sequentially.sh
36-
cargo clippy --all-targets --all-features -- -D warnings
35+
Follow the [README](./README.md#use-cli), using `./target/debug/momento` instead of `momento`, for example:
36+
37+
```bash
38+
./target/debug/momento cache create example-cache
3739
```
3840

39-
<br>
41+
## Automated Testing
4042

41-
:warning: Observações importantes sobre a execução `cargo test --test configure_profiles_test`
43+
For the automated tests, a [legacy API key](https://console.gomomento.com/api-keys) is required with the following settings:
44+
- **Type of key**: Super User Key
45+
- **Expiration**: highly recommended (Legacy keys do not support revocation.)
4246

47+
```bash
48+
read -s -p "API key: " TEST_AUTH_TOKEN
49+
# Paste your API key. (Note: You will not be able to see it in the shell.)
50+
export TEST_AUTH_TOKEN
51+
make test
4352
```
44-
export TEST_AUTH_TOKEN=<YOUR_TEST_AUTH_TOKEN>
45-
cargo test --test configure_profile_test
53+
54+
### Formatting
55+
56+
```bash
57+
make lint
4658
```
4759

48-
- Se você já tem credenciais e arquivos de configuração existentes em ambiente local, executar `cargo test --test configure_profiles_test` com o token `TEST_AUTH_TOKEN_DEFAULT` disponibilizado vai sobrescrever o valor do token no seu perfil `default`.
49-
- O valor do `TEST_CACHE_DEFAULT` precisa coincidir com o valor do cache no seu perfil `default` e o cache deve existir. Entretanto, este cache será removido após o teste ser executado com sucesso.
50-
5160
### Implantação
5261

5362
Depois do merge, um pull request será criado no repositório https://github.com/momentohq/homebrew-tap. Depois que o pull request passar por todas as validações, aprove o PR e aplique nele a tag `pr-pull`. Ele será então automaticamente mergeado pelo bot do homebrew e uma versão será criada para ele.

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ Command-line tool for managing Momento Serverless Cache. Supports the following
1212

1313
## Prerequisites
1414

15-
First things first - go to the [Momento Console](https://console.gomomento.com) to sign up. Generate an auth token to use with the CLI in the tokens tab.
15+
First things first - go to the [Momento Console](https://console.gomomento.com) to sign up. In the keys tab, generate an API key/token to use with the CLI.
1616

17-
This token uniquely identifies cache interactions. The token should be treated like a sensitive password and all essential care must be taken to ensure its secrecy. We recommend that you store this token in a secret vault like AWS Secrets Manager. See the [docs](https://docs.momentohq.com/develop/guides/working-with-momento-auth-tokens) for more information on Momento auth tokens.
17+
This token uniquely identifies cache interactions. The token should be treated like a sensitive password and all essential care must be taken to ensure its secrecy. We recommend that you store this token in a secret vault like AWS Secrets Manager. See the [docs](https://docs.momentohq.com/topics/authentication/api-keys) for more information on Momento API keys.
18+
19+
You'll also need your [endpoint URL](https://docs.momentohq.com/platform/regions).
1820

1921
## Installation
2022

@@ -70,7 +72,7 @@ These instructions assume you have the `momento` executable on your path, after
7072
the appropriate installation steps above.
7173

7274
```
73-
# Configure your account with the auth token copied from the console
75+
# Configure your account with the API key and endpoint from above,
7476
# plus default cache name (`default-cache`) and TTL (600 seconds)
7577
# This will also create the cache `default-cache` in your account
7678
momento configure --quick
@@ -96,7 +98,7 @@ momento cache get key --cache example-cache
9698
momento configure
9799
```
98100

99-
This will prompt you for your Momento Auth Token, default cache name, default TTL, and save them to be reused as a part of your `default` profile.
101+
This will prompt you for your Momento API key (v2), endpoint, default cache name, default TTL, and save them to be reused as a part of your `default` profile.
100102

101103
```
102104
momento configure --profile new-profile

0 commit comments

Comments
 (0)