Skip to content

CredentialRef ​

Category: Credentials

Source: credential_ref.dart

Sealed reference to a credential source.

Separates where a secret comes from from what the secret is. Adapters receive a resolved string (via [CredentialStore.resolve]) and never read the environment or credentials file themselves.

Classes ​

sealed CredentialRef ​

Constructor ​

dart
const CredentialRef()

EnvCredential ​

The credential is read from an environment variable.

Constructor ​

dart
const EnvCredential(this.name)

Properties ​

PropertyTypeDescription
nameString
operatorbool
hashCodeint get
hashCodeint get

StoredCredential ​

The credential is stored under a provider id in ~/.glue/credentials.json.

Constructor ​

dart
const StoredCredential(this.key)

Properties ​

PropertyTypeDescription
keyString
operatorbool
hashCodeint get
hashCodeint get

InlineCredential ​

An inline secret parsed from a user-owned file (not recommended).

Constructor ​

dart
const InlineCredential(this.value)

Properties ​

PropertyTypeDescription
valueString
operatorbool
hashCodeint get
hashCodeint get

NoCredential ​

The provider needs no credential (e.g. Ollama with auth: api_key: none).

Constructor ​

dart
const NoCredential()

Properties ​

PropertyTypeDescription
operatorbool
hashCodeint get
hashCodeint get

Released under the MIT License.