From a086f5a09796539bc2a89bf03329ce0e104188ad Mon Sep 17 00:00:00 2001 From: laund Date: Mon, 29 May 2023 23:40:31 +0200 Subject: [PATCH 1/2] Specify Secrets.toml format in Docs. --- resources/shuttle-secrets.mdx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/resources/shuttle-secrets.mdx b/resources/shuttle-secrets.mdx index 3a6f6e5..96172a7 100644 --- a/resources/shuttle-secrets.mdx +++ b/resources/shuttle-secrets.mdx @@ -19,6 +19,15 @@ 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. +## Toml Format + + +The toml format is a key-value mapping with string values. + +```toml +MY_API_KEY = 'the contents of my API key' +``` + ## Example This snippet shows a Shuttle rocket main function that uses the `shuttle_secrets::Secrets` attribute to gain access to a `SecretStore`. From fb33e588daa24831c03c5d3491d4cf91fe4bf594 Mon Sep 17 00:00:00 2001 From: laund Date: Wed, 7 Jun 2023 23:45:21 +0200 Subject: [PATCH 2/2] Update shuttle-secrets.mdx --- resources/shuttle-secrets.mdx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/resources/shuttle-secrets.mdx b/resources/shuttle-secrets.mdx index 96172a7..d0a9cb0 100644 --- a/resources/shuttle-secrets.mdx +++ b/resources/shuttle-secrets.mdx @@ -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. @@ -19,14 +26,6 @@ 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. -## Toml Format - - -The toml format is a key-value mapping with string values. - -```toml -MY_API_KEY = 'the contents of my API key' -``` ## Example This snippet shows a Shuttle rocket main function that uses the `shuttle_secrets::Secrets` attribute to gain access to a `SecretStore`.