Help us shape the future of Go! Take the 2026 Go Developer Survey

credentials

package
v1.233.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// KeyringUser is the "account" used to store credentials in the keyring. Here we use atmos-auth to provide a consistent way to search for atmos credentials.
	KeyringUser = "atmos-auth"

	// KeyringRealmPrefix is the prefix used for realm-scoped keyring keys.
	KeyringRealmPrefix = "atmos"

	// KeyringSeparator is the separator used between key components.
	// Uses underscore instead of colon for Windows compatibility (colons not allowed in filenames).
	KeyringSeparator = "_"
)
View Source
const (
	// KeyringDirPermissions is the default permission for the keyring directory (owner-only).
	KeyringDirPermissions = 0o700
)

Variables

View Source
var (
	// ErrUnsupportedCredentialType indicates the credential type is not supported.
	ErrUnsupportedCredentialType = errors.New("unsupported credential type")
	// ErrUnknownCredentialType indicates an unknown credential type was encountered.
	ErrUnknownCredentialType = errors.New("unknown credential type")
	// ErrCredentialsNotFound indicates credentials were not found for the given key.
	ErrCredentialsNotFound = errors.New("credentials not found")
	// ErrDataNotFound indicates data was not found for the given key.
	ErrDataNotFound = errors.New("data not found")
	// ErrPasswordRequired indicates a password is required but not provided.
	ErrPasswordRequired = errors.New("keyring password required")
	// ErrPasswordTooShort indicates the password does not meet the minimum length requirement.
	ErrPasswordTooShort = errors.New("password must be at least 8 characters")
)
View Source
var ErrCredentialStore = errors.New("credential store")

ErrCredentialStore is the static sentinel for credential-store failures.

View Source
var ErrListNotSupported = errors.New("listing credentials is not supported with keyring backend")

ErrListNotSupported indicates that listing credentials is not supported with keyring backend.

View Source
var ErrNotSupported = errors.New("not supported")

ErrNotSupported indicates an unsupported operation for this backend.

Functions

func NewCredentialStore deprecated

func NewCredentialStore() types.CredentialStore

NewCredentialStore creates a new credential store instance based on configuration. It selects the appropriate backend (system, file, or memory) based on: 1. ATMOS_KEYRING_TYPE environment variable (highest priority). 2. AuthConfig.Keyring.Type configuration. 3. Default to "system" for backward compatibility.

Deprecated: this no-argument form cannot honor auth.keyring.type from atmos.yaml because it passes a nil config to NewCredentialStoreWithConfig. Production code MUST use NewCredentialStoreWithConfig(authConfig) so the configured keyring backend is selected (see issue #2544). This form remains only for tests and other call sites that genuinely have no auth config.

func NewCredentialStoreWithConfig added in v1.196.0

func NewCredentialStoreWithConfig(authConfig *schema.AuthConfig) types.CredentialStore

NewCredentialStoreWithConfig creates a credential store with explicit configuration.

func NewKeyringAuthStore

func NewKeyringAuthStore() types.CredentialStore

NewKeyringAuthStore creates a new system keyring-based auth store (for backward compatibility). Deprecated: Use NewCredentialStore() instead.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL