Versions in this module Expand all Collapse all v0 v0.12.0 Sep 12, 2026 Changes in this version + const DefaultCacheCapacity + var ErrConfigConflict = errors.New("configuration conflict") + var ErrCredentialAccessDenied = errors.New("credential access denied") + var ErrCredentialNotFound = errors.New("credential not found") + var ErrCredentialStoreLocked = errors.New("credential store is locked") + var ErrCredentialStoreReadOnly = errors.New("credential store is read-only") + var ErrCredentialStoreUnavailable = errors.New("credential store is unavailable") + var ErrInteractionRequired = errors.New("interaction required") + var ErrInvalidRef = errors.New("invalid credential reference") + var ErrJournalCorrupted = errors.New("credential recovery journal corrupted") + var ErrLockContended = errors.New("transaction lock contended") + var ErrSchemaValidation = errors.New("schema validation failed") + var ErrStoreAlreadyRegistered = errors.New("credential store already registered") + var ErrStoreNotFound = errors.New("credential store not found") + var ErrUnsupportedSchemaVersion = errors.New("unsupported schema version") + func GenerateItemID() string + func GenerateJournalID() string + func InteractionDisabled(ctx context.Context) bool + func WithoutInteraction(ctx context.Context) context.Context + type Cache struct + func NewCache(opts CacheOptions) *Cache + func (c *Cache) ActiveFetchesCount() int + func (c *Cache) CancelFetch(ref Ref, ft FetchToken) + func (c *Cache) Clear() + func (c *Cache) Get(ref Ref) (Secret, bool) + func (c *Cache) Invalidate(ref Ref) + func (c *Cache) Len() int + func (c *Cache) Put(ref Ref, secret Secret) + func (c *Cache) PutIfMatch(ref Ref, secret Secret, ft FetchToken) + func (c *Cache) StartFetch(ref Ref) FetchToken + type CacheOptions struct + Capacity int + DefaultTTL time.Duration + NowFunc func() time.Time + type CachedSource struct + func NewCachedSource(source Source, cache *Cache) *CachedSource + func (cs *CachedSource) Get(ctx context.Context, ref Ref) (Secret, error) + type CachedStore struct + func NewCachedStore(store Store, cache *Cache) *CachedStore + func (cs *CachedStore) Delete(ctx context.Context, ref Ref) error + func (cs *CachedStore) Put(ctx context.Context, ref Ref, secret Secret) error + type CleanupError struct + Err error + OldRef Ref + func (e *CleanupError) Error() string + func (e *CleanupError) Unwrap() error + type ConfigUpdater interface + ApplyCredentialRefAtVersion func(ctx context.Context, target Target, expectedVersion string, newRef *Ref) (outcome MutationOutcome, newVersion string, err error) + CheckRefUnreferenced func(ctx context.Context, ref Ref) (bool, error) + ConfirmRefDurable func(ctx context.Context, target Target, ref *Ref) (bool, error) + type CredentialRef = Ref + type EntryLock struct + func (l *EntryLock) Close() error + type FetchToken struct + type JournalEntry struct + AuthType string + BaseVersion string + ClearKeyPath bool + ClearLegacyLoginPassword bool + ClearLegacyPassphrase bool + CreatedAt time.Time + ID string + KeyFingerprint string + KeyPath string + NewRef *Ref + OldRef *Ref + Op OperationType + Stage Stage + TargetIdentity string + TargetKind Kind + TargetNode string + UpdatedAt time.Time + func (j *JournalEntry) Target() Target + func (j *JournalEntry) Validate() error + type JournalStore struct + func NewJournalStore(dir string) (*JournalStore, error) + func (s *JournalStore) AcquireEntryLock(id string) (*EntryLock, error) + func (s *JournalStore) Get(id string) (*JournalEntry, error) + func (s *JournalStore) ListPending() ([]JournalEntry, error) + func (s *JournalStore) MarkAppliedUncertain(id string) error + func (s *JournalStore) MarkCleanup(id string) error + func (s *JournalStore) MarkCommitted(id string) error + func (s *JournalStore) RecordIntent(entry *JournalEntry) error + func (s *JournalStore) Remove(id string) error + func (s *JournalStore) TryLockEntry(id string) (*EntryLock, error) + type Kind string + const KindLoginPassword + const KindPassphrase + const KindPrivilegePassword + func (k Kind) Validate() error + type MutationOutcome struct + Applied bool + Durable bool + type NoneStore struct + func NewNoneStore() *NoneStore + func (n *NoneStore) Delete(_ context.Context, _ Ref) error + func (n *NoneStore) Get(_ context.Context, _ Ref) (Secret, error) + func (n *NoneStore) Put(_ context.Context, _ Ref, _ Secret) error + type OperationType string + const OpAssetDelete + const OpCreate + const OpDelete + const OpRotate + type RecoveryAction string + const RecoveryActionCommittedCleaned + const RecoveryActionCompensatedNewRef + const RecoveryActionRemovedNoOp + const RecoveryActionScheduledForGC + const RecoveryActionSkippedActive + type RecoveryResult struct + Action RecoveryAction + EntryID string + Err error + Op OperationType + Stage Stage + type Ref struct + ItemID string + StoreID string + func (r *Ref) Clone() *Ref + func (r Ref) IsComplete() bool + func (r Ref) IsEmpty() bool + func (r Ref) String() string + func (r Ref) Validate() error + type Registry struct + func NewRegistry() *Registry + func (r *Registry) Get(storeID string) (Source, error) + func (r *Registry) GetStore(storeID string) (Store, error) + func (r *Registry) Has(storeID string) bool + func (r *Registry) List() []string + func (r *Registry) Register(storeID string, source Source) error + func (r *Registry) Resolve(ctx context.Context, ref Ref) (Secret, error) + func (r *Registry) Unregister(storeID string) + type Secret struct + ExpiresAt *time.Time + Value []byte + func NewSecret(val []byte) Secret + func NewSecretWithExpiry(val []byte, expiresAt time.Time) Secret + func (s *Secret) Zero() + func (s Secret) Clone() Secret + func (s Secret) IsExpired(now time.Time) bool + type Service struct + func NewService(registry *Registry, journal *JournalStore, config ConfigUpdater, cache *Cache) (*Service, error) + func (s *Service) Create(ctx context.Context, target Target, expectedVersion string, storeID string, ...) (*Ref, string, error) + func (s *Service) Delete(ctx context.Context, target Target, expectedVersion string, refToDelete Ref) (string, error) + func (s *Service) DeleteAssets(ctx context.Context, refs []Ref, ...) (outcome MutationOutcome, retErr error) + func (s *Service) GC(ctx context.Context) ([]RecoveryResult, error) + func (s *Service) Recover(ctx context.Context) ([]RecoveryResult, error) + func (s *Service) Rotate(ctx context.Context, target Target, expectedVersion string, oldRef *Ref, ...) (*Ref, string, error) + type Source interface + Get func(ctx context.Context, ref Ref) (Secret, error) + type Stage string + const StageAppliedUncertain + const StageCleanup + const StageCommitted + const StageIntent + type Store interface + Delete func(ctx context.Context, ref Ref) error + Put func(ctx context.Context, ref Ref, secret Secret) error + type Target struct + AuthType string + ClearKeyPath bool + ClearLegacyLoginPassword bool + ClearLegacyPassphrase bool + IdentityID string + KeyFingerprint string + KeyPath string + Kind Kind + NodeID string + func (t Target) TargetIdentifier() string + func (t Target) Validate() error