View Source ExAzureKeyVault.Url (ex_azure_key_vault v2.2.0)

Internal module for getting Azure Key Vault URL.

Link to this section Summary

Functions

Returns body for secret creation.

Returns Azure Key Vault URL for get secrets.

Returns Azure Key Vault URL for secret management.

Creates %ExAzureKeyVault.Url{} struct with vault name.

Link to this section Types

@type t() :: %ExAzureKeyVault.Url{secret_name: String.t(), vault_name: String.t()}

Link to this section Functions

@spec get_body(String.t()) :: String.t()

Returns body for secret creation.

examples

Examples

iex(1)> ExAzureKeyVault.Url.get_body("my-secret")
"{\"value\":\"my-secret\"}"
Link to this function

get_secrets_url(params, max_results \\ nil, api_version)

View Source
@spec get_secrets_url(t(), integer() | nil, String.t()) :: String.t()

Returns Azure Key Vault URL for get secrets.

examples

Examples

Passing a maximum number of 10 results in a page.

iex(1)> ExAzureKeyVault.Url.new("my-secret", "my-vault") |> ExAzureKeyVault.Url.get_secrets_url(10, "7.3")
"https://my-vault.vault.azure.net/secrets?api-version=7.3&maxresults=10"

Ignoring maximum number of results.

iex(1)> ExAzureKeyVault.Url.new("my-secret", "my-vault") |> ExAzureKeyVault.Url.get_secrets_url(nil, "7.3")
"https://my-vault.vault.azure.net/secrets?api-version=7.3"
Link to this function

get_url(params, version \\ nil, api_version)

View Source
@spec get_url(t(), String.t() | nil, String.t()) :: String.t()

Returns Azure Key Vault URL for secret management.

examples

Examples

Passing secret version.

iex(1)> ExAzureKeyVault.Url.new("my-secret", "my-vault") |> ExAzureKeyVault.Url.get_url("7ea98ee699b1...", "7.3")
"https://my-vault.vault.azure.net/secrets/my-secret/7ea98ee699b1...?api-version=7.3"

Ignoring secret version.

iex(1)> ExAzureKeyVault.Url.new("my-secret", "my-vault") |> ExAzureKeyVault.Url.get_url(nil, "7.3")
"https://my-vault.vault.azure.net/secrets/my-secret?api-version=7.3"
Link to this function

new(secret_name, vault_name)

View Source
@spec new(String.t() | nil, String.t()) :: t()

Creates %ExAzureKeyVault.Url{} struct with vault name.

examples

Examples

iex(1)> ExAzureKeyVault.Url.new("my-secret", "my-vault")
%ExAzureKeyVault.Url{secret_name: "my-secret", vault_name: "my-vault"}