credentialmgr

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeAPIKey       = "api_key"
	TypeCLIAuthToken = "cliauth_token"

	CredentialScopeProviderTypePrefix = "type:"
	CredentialScopeProviderIDPrefix   = "id:"
)
View Source
const (
	MetadataRefreshNameKey        = "refresh_name"
	MetadataRefreshExpiryDeltaKey = "refresh_expiry_delta"
)

Variables

This section is empty.

Functions

func DecodeCredential

func DecodeCredential(data []byte) (any, error)

func ProviderIDCredentialScope

func ProviderIDCredentialScope(providerID string) string

func ProviderTypeCredentialScope

func ProviderTypeCredentialScope(providerType string) string

func WithSkipPersist

func WithSkipPersist(ctx context.Context) context.Context

Types

type Credential

type Credential = model.Credential

type CredentialLifecycleListener

type CredentialLifecycleListener interface {
	OnCredentialRegistered(ctx context.Context, cred *ManagedCredential)
	OnCredentialUpdated(ctx context.Context, cred *ManagedCredential)
	OnCredentialDeregistered(ctx context.Context, cred *ManagedCredential)
	OnCredentialsReplaced(ctx context.Context, creds []*ManagedCredential)
}

type Error

type Error = model.Error

type Filter

type Filter struct {
	Type         string
	ProviderType string
	ProviderID   string
	Model        string
}

Filter identifies credentials for manager-side listing and storage operations.

type ManagedCredential

type ManagedCredential = model.ManagedCredential

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(store configstore.ConfigStore) *Manager

func (*Manager) AddListener

func (m *Manager) AddListener(listener CredentialLifecycleListener)

func (*Manager) DeregisterCredential

func (m *Manager) DeregisterCredential(ctx context.Context, id string) error

func (*Manager) GetCredential

func (m *Manager) GetCredential(id string) *ManagedCredential

func (*Manager) ListCredentials

func (m *Manager) ListCredentials(filter Filter) []*ManagedCredential

func (*Manager) Load

func (m *Manager) Load(ctx context.Context) error

func (*Manager) ManualRefresher

func (m *Manager) ManualRefresher(manualRefreshName string) ManualRefresher

func (*Manager) RefreshCredentialIfNeeded

func (m *Manager) RefreshCredentialIfNeeded(ctx context.Context, credID string) (*ManagedCredential, error)

func (*Manager) RegisterCredential

func (m *Manager) RegisterCredential(ctx context.Context, cred *Credential) error

func (*Manager) ReloadFromStore

func (m *Manager) ReloadFromStore(ctx context.Context) error

func (*Manager) RemoveManualRefresher

func (m *Manager) RemoveManualRefresher(manualRefreshName string)

func (*Manager) SetManualRefresher

func (m *Manager) SetManualRefresher(manualRefreshName string, refresher ManualRefresher)

func (*Manager) UpdateCredential

func (m *Manager) UpdateCredential(ctx context.Context, cred *Credential) error

type ManualRefresher

type ManualRefresher interface {
	Refresh(ctx context.Context, cred *Credential) (*Credential, error)
}

type ModelState

type ModelState = model.ModelState

type QuotaState

type QuotaState = model.QuotaState

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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