Sandbox-bound view of Miosa.Secrets.
Every call pre-populates resource_id with the sandbox's ID and sets
resource_type to "sandbox". This means you never have to repeat the
sandbox ID in each call.
Usage
{:ok, sandbox} = Miosa.Sandboxes.create(client, %{name: "my-box"})
# Bind a secret to this sandbox
{:ok, secret} = Miosa.Sandboxes.Secrets.set(sandbox, client, %{
name: "OPENAI_KEY",
value: "sk-...",
expose_as_env: "OPENAI_API_KEY"
})
{:ok, secrets} = Miosa.Sandboxes.Secrets.list(sandbox, client)
{:ok, flow} = Miosa.Sandboxes.Secrets.connect(sandbox, client, "github")The sandbox argument may be either a Miosa.Types.Computer.t() struct or
a plain binary sandbox ID string.
Summary
Functions
Start an OAuth Connect flow scoped to this sandbox.
Delete a secret by ID.
Fetch a single secret by ID.
List secrets scoped to this sandbox.
List bindings scoped to this sandbox.
Rotate a secret's value.
Create a secret scoped to this sandbox.
Functions
@spec connect(map() | String.t(), Miosa.Client.t(), String.t(), map()) :: Miosa.Client.result(Miosa.OauthFlow.t())
Start an OAuth Connect flow scoped to this sandbox.
@spec delete(map() | String.t(), Miosa.Client.t(), String.t()) :: :ok | {:error, Miosa.Error.t()}
Delete a secret by ID.
@spec get(map() | String.t(), Miosa.Client.t(), String.t()) :: Miosa.Client.result(map())
Fetch a single secret by ID.
@spec list(map() | String.t(), Miosa.Client.t(), map()) :: Miosa.Client.result([map()])
List secrets scoped to this sandbox.
@spec list_bindings(map() | String.t(), Miosa.Client.t(), map()) :: Miosa.Client.result([map()])
List bindings scoped to this sandbox.
@spec rotate(map() | String.t(), Miosa.Client.t(), String.t(), map()) :: Miosa.Client.result(map())
Rotate a secret's value.
@spec set(map() | String.t(), Miosa.Client.t(), map()) :: Miosa.Client.result(map())
Create a secret scoped to this sandbox.
Merges resource_id and resource_type="sandbox" into attrs unless
already present.