Wardrik.Secrets (wardrik_protocol v0.1.0-rc.1)

Copy Markdown

Operations on an owner's secrets: sealing one, listing them by name, and removing one.

Wardrik.Secrets.put(scope, "GITHUB_TOKEN", owner: "acme", value: "ghp_...")
#=> :ok

Wardrik.Secrets.list(scope, owner: "acme")
#=> {:ok, [%Wardrik.Secret{name: "GITHUB_TOKEN", kind: :secret}]}

The owner "deployment" holds the deployment's own secrets. ${NAME} in a daemon's config reads them. No agent can.

Summary

Functions

delete(scope, name, input \\ [])

@spec delete(Wardrik.Scope.t(), String.t() | struct(), term()) ::
  term() | :ok | {:error, Wardrik.Error.t()}

Remove a secret

Removes the owner's secret of that name. Removing none answers as removing one does.

DELETE /v1/secrets/{name}

list(scope, input \\ [])

@spec list(Wardrik.Scope.t(), term()) :: term() | :ok | {:error, Wardrik.Error.t()}

List an owner's secrets

The names of the secrets the owner holds, and whether each is one they sealed or an account they connected. Never a value.

GET /v1/secrets

put(scope, name, input \\ [])

@spec put(Wardrik.Scope.t(), String.t() | struct(), term()) ::
  term() | :ok | {:error, Wardrik.Error.t()}

Seal a secret

Seals the value as the owner's secret of that name, in place of any it held. owner deployment is the deployment's own, which ${NAME} in config reads and no agent reaches.

PUT /v1/secrets/{name}