Skip to content

Commit

Permalink
Clarify that only custom API keys can be reused after migration (#3003)
Browse files Browse the repository at this point in the history
  • Loading branch information
guimachiavelli authored Oct 14, 2024
1 parent 9a66e2c commit d61a25b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions reference/api/keys.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,12 @@ Accessing the `/keys` route without setting a master key will throw a [`missing_

This value is also used as the `{key}` path variable to [update](#update-a-key), [delete](#delete-a-key), or [get](#get-one-key) a specific key.

<Capsule intent="note">
Since `key` is a hash of the `uid` and master key, `key` values are deterministic between instances sharing the same configuration. You can determine the value of an API key with the following command, replacing `HYPHENATED_UUID` and `MASTER_KEY` with the correct values for your key and instance:
If the master key changes, all `key` values are automatically changed.

```sh
echo -n $HYPHENATED_UUID | openssl dgst -sha256 -hmac $MASTER_KEY
```
<Capsule intent="note" title="Reusing API keys between instances">
Custom API keys are deterministic: `key` is a SHA256 hash of the `uid` and master key. To reuse custom API keys, launch the new instance with the same master key and recreate your API keys with the same `uid`.

This also means that, if the master key changes, all `key` values are automatically changed.
**You cannot reuse default API keys between instances.** Meilisearch automatically generates their `uid`s the first time you launch an instance.
</Capsule>

### `actions`
Expand Down

0 comments on commit d61a25b

Please sign in to comment.