ExDoppler.ServiceTokens (ExDoppler v1.0.0)
View SourceModule for interacting with ExDoppler.ServiceToken
๐ Resources
- ๐ Doppler docs
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Summary
Functions
Creates a new ExDoppler.ServiceToken
, given a Config, a name and optional modifications
Same as create_service_token/3
but won't wrap a successful response in {:ok, response}
Same as delete_service_token/1
but won't wrap a successful response in {:ok, response}
Same as list_service_tokens/1
but won't wrap a successful response in {:ok, response}
Functions
Creates a new ExDoppler.ServiceToken
, given a Config, a name and optional modifications
๐ท๏ธ Params
- config - Config associated with the tokens (e.g
%Config{name: "dev_personal", project: "example-project" ...}
) - service_token_name: Name of this token (e.g
"cli_token"
) - opts: Optional modifications to the list call
- expire_at - Unix timestamp of when token should expire. Default:
nil
- access - Token's capabilities.
"read"
or"read/write"
. Default:"read"
- expire_at - Unix timestamp of when token should expire. Default:
โคต๏ธ Returns
โ On Success
{:ok, %ExDoppler.ServiceToken{...}}
โ On Failure
{:err, err}
๐ป Examples
iex> alias ExDoppler.Config
iex> alias ExDoppler.ServiceToken
iex> alias ExDoppler.ServiceTokens
iex> config = %Config{name: "dev", project: "example-project"}
iex> token_slug = "my-service-token"
iex> _ = ServiceTokens.delete_service_token!(%ServiceToken{project: config.project, config: config.name, slug: token_slug})
iex> {:ok, service_token} = ServiceTokens.create_service_token(config, token_slug)
iex> :ok = ServiceTokens.delete_service_token!(service_token)
๐ Resources
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Same as create_service_token/3
but won't wrap a successful response in {:ok, response}
Deletes a ExDoppler.ServiceToken
๐ท๏ธ Params
- service_token: The token to delete (e.g
%ServiceToken{project: "example-project", config: "dev_personal", slug: "56c69f96-3045-11ea-978f-2e728ce8812"}
)
โคต๏ธ Returns
โ On Success
{:ok, {:success, true}}
โ On Failure
{:err, err}
๐ป Examples
iex> alias ExDoppler.Config
iex> alias ExDoppler.ServiceToken
iex> alias ExDoppler.ServiceTokens
iex> config = %Config{name: "dev", project: "example-project"}
iex> token_slug = "my-service-token"
iex> _ = ServiceTokens.delete_service_token!(%ServiceToken{project: config.project, config: config.name, slug: token_slug})
iex> {:ok, service_token} = ServiceTokens.create_service_token(config, token_slug)
iex> :ok = ServiceTokens.delete_service_token!(service_token)
๐ Resources
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Same as delete_service_token/1
but won't wrap a successful response in {:ok, response}
Lists ExDoppler.ServiceAccount
๐ท๏ธ Params
- config - Config associated with the tokens (e.g
%Config{name: "dev_personal", project: "example-project" ...}
)
โคต๏ธ Returns
โ On Success
{:ok, [%ExDoppler.ServiceToken{...} ...]}
โ On Failure
{:err, err}
๐ป Examples
iex> alias ExDoppler.Config
iex> alias ExDoppler.ServiceTokens
iex> config = %Config{name: "dev", project: "example-project"}
iex> {:ok, _tokens} = ServiceTokens.list_service_tokens(config)
๐ Resources
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Same as list_service_tokens/1
but won't wrap a successful response in {:ok, response}