ExDoppler (ExDoppler v1.0.1)
View SourceConvenience functions for interacting with Doppler
๐ Resources
- ๐ Doppler docs
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Summary
Functions
Creates a new ExDoppler.Secret
Same as create_secret/5
but won't wrap a successful response in {:ok, response}
Same as delete_secret/3
but won't wrap a successful response in {:ok, response}
Retrieves multiple ExDoppler.Secret
and responds in a format ready to put into a file
Same as download_secrets/2
but won't wrap a successful response in {:ok, response}
Same as get_secret/3
but won't wrap a successful response in {:ok, response}
Retrieves the raw value of a ExDoppler.Secret
Same as get_secret_raw/3
but won't wrap a successful response in {:ok, response}
Lists the names of ExDoppler.Secret
Same as list_secret_names/3
but won't wrap a successful response in {:ok, response}
Same as list_secrets/3
but won't wrap a successful response in {:ok, response}
Same as update_secret/5
but won't wrap a successful response in {:ok, response}
Updates the note
field on a ExDoppler.Secret
Same as update_secret_note/3
but won't wrap a successful response in {:ok, response}
Functions
Creates a new ExDoppler.Secret
๐ท๏ธ Params
- project_name: Name of the project (e.g
"example-project"
) - config_name: Name of the config (e.g
"dev_personal"
) - new_secret_name - Name of this new secret
- value - Value of this new secret
- opts: Optional modifications
- visibility - how the secret should appear -
:masked
,:unmasked
, or:restricted
. Default::masked
- visibility - how the secret should appear -
โคต๏ธ Returns
โ On Success
{:ok, %ExDoppler.Secret{...}}
โ On Failure
{:error, err}
๐ป Examples
iex> _ = ExDoppler.delete_secret!("example-project", "dev_personal", "DOC_URL")
iex> {:ok, _secret} = ExDoppler.create_secret("example-project", "dev_personal", "DOC_URL", "example.com")
iex> {:ok, {:success, true}} = ExDoppler.delete_secret("example-project", "dev_personal", "DOC_URL")
๐ Resources
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Same as create_secret/5
but won't wrap a successful response in {:ok, response}
Deletes a ExDoppler.Secret
๐ท๏ธ Params
- project_name: Name of the project (e.g
"example-project"
) - config_name: Name of the config (e.g
"dev_personal"
) - secret_name - Name of secret to delete
โคต๏ธ Returns
โ On Success
{:ok, {:success, true}}
โ On Failure
{:error, err}
๐ป Examples
iex> _ = ExDoppler.delete_secret!("example-project", "dev_personal", "DOC_URL")
iex> {:ok, _secret} = ExDoppler.create_secret("example-project", "dev_personal", "DOC_URL", "example.com")
iex> {:ok, {:success, true}} = ExDoppler.delete_secret("example-project", "dev_personal", "DOC_URL")
๐ Resources
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Same as delete_secret/3
but won't wrap a successful response in {:ok, response}
Retrieves multiple ExDoppler.Secret
and responds in a format ready to put into a file
๐ท๏ธ Params
- project_name: Name of the project (e.g
"example-project"
) - config_name: Name of the config (e.g
"dev_personal"
) - opts: Optional modifications to the download call
- include_dynamic_secrets - whether to include dynamic secrets. Default:
false
- dynamic_secrets_ttl_sec - The number of seconds until dynamic leases expire. Must be used with include_dynamic_secrets. Defaults to 1800 (30 minutes). Default:
nil
- format - File format to use. (e.g
"dotnet-json"
,"env"
,"yaml"
,"docker"
,"env-no-quotes"
) Default:json
- name_transformer - Transform secret names to a different case (e.g
"camel"
,"upper-camel"
,"lower-snake"
,"tf-var"
,"dotnet"
,"dotnet-env"
,"lower-kebab"
). Default:nil
- secrets - Comma-delimited list of secrets to include in the download. Defaults to all secrets if left unspecified.
- include_dynamic_secrets - whether to include dynamic secrets. Default:
โคต๏ธ Returns
โ On Success
{:ok, requested_body}
โ On Failure
{:error, err}
๐ป Examples
iex> {:ok, _formatted_body} = ExDoppler.download_secrets("example-project", "dev_personal", format: :env, name_transformer: "lower-snake")
๐ Resources
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Same as download_secrets/2
but won't wrap a successful response in {:ok, response}
Retrieves a ExDoppler.Secret
๐ท๏ธ Params
- project_name: Name of the project (e.g
"example-project"
) - config_name: Name of the config (e.g
"dev_personal"
) - secret_name - Name of the secret to get (e.g
"API_KEY"
)
โคต๏ธ Returns
โ On Success
{:ok, %ExDoppler.Secret{...}}
โ On Failure
{:error, err}
๐ป Examples
iex> {:ok, _secret} = ExDoppler.get_secret("example-project", "dev_personal", "DB_URL")
๐ Resources
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Same as get_secret/3
but won't wrap a successful response in {:ok, response}
Retrieves the raw value of a ExDoppler.Secret
๐ท๏ธ Params
- project_name: Name of the project (e.g
"example-project"
) - config_name: Name of the config (e.g
"dev_personal"
) - secret_name - Name of the secret to get (e.g
"API_KEY"
)
โคต๏ธ Returns
โ On Success
{:ok, %ExDoppler.Secret{...}}
โ On Failure
{:error, err}
๐ป Examples
iex> {:ok, _raw_value} = ExDoppler.get_secret_raw("example-project", "dev_personal", "DB_URL")
๐ Resources
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Same as get_secret_raw/3
but won't wrap a successful response in {:ok, response}
Lists the names of ExDoppler.Secret
๐ท๏ธ Params
- project_name: Name of the project (e.g
"example-project"
) - config_name: Name of the config (e.g
"dev_personal"
) - opts: Optional modifications to the list call
- include_dynamic_secrets - whether to include dynamic secrets. Default:
false
- include_managed_secrets - whether to include managed secrets. Default:
true
- include_dynamic_secrets - whether to include dynamic secrets. Default:
โคต๏ธ Returns
โ On Success
{:ok, names}
โ On Failure
{:error, err}
๐ป Examples
iex> {:ok, _names} = ExDoppler.list_secret_names("example-project", "dev_personal")
๐ Resources
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Same as list_secret_names/3
but won't wrap a successful response in {:ok, response}
Lists ExDoppler.Secret
๐ท๏ธ Params
- project_name: Name of the project (e.g
"example-project"
) - config_name: Name of the config (e.g
"dev_personal"
) - opts: Optional modifications to the list call
- include_dynamic_secrets - whether to include dynamic secrets. Default:
false
- include_managed_secrets - whether to include dynamic secrets. Default:
true
- secrets - A comma-separated list of secrets to include in the response. Default:
nil
- include_dynamic_secrets - whether to include dynamic secrets. Default:
โคต๏ธ Returns
โ On Success
{:ok, [%ExDoppler.Secret{...} ...]}
โ On Failure
{:error, err}
๐ป Examples
iex> {:ok, _secrets} = ExDoppler.list_secrets("example-project", "dev_personal")
๐ Resources
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Same as list_secrets/3
but won't wrap a successful response in {:ok, response}
Updates a ExDoppler.Secret
๐ท๏ธ Params
- project_name: Name of the project (e.g
"example-project"
) - config_name: Name of the config (e.g
"dev_personal"
) - secret_name - Name of this secret
- value - Value of this secret
- opts: Optional modifications
- visibility - how the secret should appear -
:masked
,:unmasked
, or:restricted
. Default::masked
- should_promote - Defaults to false. Can only be set to true if the config being updated is a branch config. If set to true, the provided secret will be set in both the branch config as well as the root config in that environment.
- should_delete - Defaults to false. If set to true, will delete the secret matching the name field.
- should_converge - Defaults to false. Can only be set to true if the config being updated is a branch config and there is a secret with the same name in the root config. In this case, the branch secret will inherit the value and visibility type from the root secret.
- visibility - how the secret should appear -
โคต๏ธ Returns
โ On Success
{:ok, %ExDoppler.Secret{...}}
โ On Failure
{:error, err}
๐ป Examples
iex> _ = ExDoppler.delete_secret!("example-project", "dev_personal", "DOC_URL")
iex> {:ok, _secret} = ExDoppler.create_secret("example-project", "dev_personal", "DOC_URL", "example.com")
iex> {:ok, _secret} = ExDoppler.update_secret("example-project", "dev_personal", "DOC_URL", "example.com2", visibility: :unmasked)
iex> {:ok, {:success, true}} = ExDoppler.delete_secret("example-project", "dev_personal", "DOC_URL")
๐ Resources
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Same as update_secret/5
but won't wrap a successful response in {:ok, response}
Updates the note
field on a ExDoppler.Secret
๐ท๏ธ Params
- project_name - Name of the associated project (e.g
"example-project"
) - secret_name - Name of this secret
- note - Attached Note
โคต๏ธ Returns
โ On Success
{:ok, %{note: note secret: %ExDoppler.Secret{...}}}
โ On Failure
{:error, err}
๐ป Examples
iex> _ = ExDoppler.delete_secret!("example-project", "dev_personal", "DOC_URL")
iex> {:ok, _secret} = ExDoppler.create_secret("example-project", "dev_personal", "DOC_URL", "example.com")
iex> {:ok, _secret} = ExDoppler.update_secret_note("example-project", "DOC_URL", "a new note")
iex> {:ok, {:success, true}} = ExDoppler.delete_secret("example-project", "dev_personal", "DOC_URL")
๐ Resources
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Same as update_secret_note/3
but won't wrap a successful response in {:ok, response}