Skip to content

Commit

Permalink
Specify Secrets.toml format in Docs. (#114)
Browse files Browse the repository at this point in the history
* Specify Secrets.toml format in Docs.

* Update shuttle-secrets.mdx
  • Loading branch information
laundmo authored Jun 9, 2023
1 parent 0ecc113 commit 0ba5f1a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions resources/shuttle-secrets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ This plugin manages secrets on [Shuttle](https://www.shuttle.rs).
Add `shuttle-secrets` to the dependencies for your service, and add a `Secrets.toml` to the root of your project
with the secrets you'd like to store. Make sure to add `Secrets.toml` to a `.gitignore` to omit your secrets from version control.

The format of the Secrets.toml file is a key-value mapping with string values.

```toml
MY_API_KEY = 'the contents of my API key'
MY_OTHER_SECRET = 'some other secret'
```

Next, pass `#[shuttle_secrets::Secrets] secret_store: SecretStore` as an argument to your `shuttle_runtime::main` function.
`SecretStore::get` can now be called to retrieve your API keys and other secrets at runtime.

Expand All @@ -19,6 +26,7 @@ If you don't have a `Secrets.dev.toml` file, `Secrets.toml` will be used locally
both secret files with some of the same secrets for both local runs and deployments, you have to duplicate the secret across both
files.


## Example
This snippet shows a Shuttle rocket main function that uses the `shuttle_secrets::Secrets` attribute to gain access to a `SecretStore`.

Expand Down

0 comments on commit 0ba5f1a

Please sign in to comment.