MingaAgent.Credentials.Snapshot (Minga v0.1.0)

Copy Markdown View Source

Secret-free local credential classification captured from one acquisition.

API key values and OAuth tokens never leave MingaAgent.Credentials. OAuth presence is represented by its exact provider/account identity when the local file supplies one; activation still pins and refreshes through ReqLLM.

Summary

Functions

Returns whether any local API-key or exact OAuth identity is configured.

Builds a secret-free credential snapshot from an exact OAuth identity.

Returns the exact local OAuth identity, if the snapshot contained one.

Returns the configured source for one API-key provider.

Types

source()

@type source() :: :env | :file

t()

@type t() :: %MingaAgent.Credentials.Snapshot{
  oauth_ref: MingaAgent.ModelSelection.Credential.OAuth.t() | nil,
  provider_sources: %{optional(String.t()) => source()}
}

Functions

locally_configured?(snapshot)

@spec locally_configured?(t()) :: boolean()

Returns whether any local API-key or exact OAuth identity is configured.

new(provider_sources, oauth_ref)

@spec new(
  %{optional(String.t()) => source()},
  MingaAgent.ModelSelection.Credential.OAuth.t() | nil
) ::
  t()

Builds a secret-free credential snapshot from an exact OAuth identity.

oauth_ref(snapshot)

@spec oauth_ref(t()) :: MingaAgent.ModelSelection.Credential.OAuth.t() | nil

Returns the exact local OAuth identity, if the snapshot contained one.

provider_source(snapshot, provider)

@spec provider_source(t(), String.t()) :: source() | nil

Returns the configured source for one API-key provider.