Versions in this module Expand all Collapse all v0 v0.4.0 Oct 20, 2026 Changes in this version type Health + CredentialExpiresAt *time.Time v0.3.0 Oct 14, 2026 Changes in this version + const CredentialPurpose + var ErrAccountMismatch = errors.New("connectforge: credential is for a different account") + var ErrConflict = errors.New("connectforge: version conflict") + var ErrCredentialUnavailable = errors.New("connectforge: credential unavailable") + var ErrDenied = errors.New("connectforge: denied") + var ErrExists = errors.New("connectforge: already exists") + var ErrInsufficientScope = errors.New("connectforge: insufficient scope") + var ErrInvalidCredential = errors.New("connectforge: invalid credential") + var ErrInvalidTransition = errors.New("connectforge: invalid state transition") + var ErrLeaseHeld = errors.New("connectforge: lease held") + var ErrNotFound = errors.New("connectforge: not found") + var ErrNotUsable = errors.New("connectforge: connection not usable") + var ErrRateLimited = errors.New("connectforge: rate limited") + var ErrTransient = errors.New("connectforge: transient failure") + func CredentialAAD(owner OwnerID, connectionID string, version int) []byte + func Permanent(err error) bool + type Action string + const ActionDisconnect + const ActionManage + const ActionShare + const ActionUse + const ActionView + type Auditor interface + Record func(ctx context.Context, e Event) error + type Authorizer interface + Allowed func(ctx context.Context, p Principal, a Action, c Connection) error + type Binding struct + ConnectionID string + Consumer Consumer + CreatedAt time.Time + Owner OwnerID + Purpose string + type BindingStore interface + ListBindings func(ctx context.Context, owner OwnerID, connectionID string) ([]Binding, error) + PutBinding func(ctx context.Context, b Binding) error + RemoveBinding func(ctx context.Context, owner OwnerID, connectionID string, c Consumer, ...) error + type Clock interface + Now func() time.Time + type Connection struct + AuthMethod string + CreatedAt time.Time + CreatedBy Principal + DisplayName string + ExternalAccountID string + ExternalLabel string + Health Health + ID string + Metadata map[string]string + Owner OwnerID + Provider string + Revision uint64 + Scopes []string + State State + UpdatedAt time.Time + func (c Connection) Clone() Connection + type ConnectionStore interface + CreateConnection func(ctx context.Context, c Connection) (Connection, error) + DeleteConnection func(ctx context.Context, owner OwnerID, id string) error + GetConnection func(ctx context.Context, owner OwnerID, id string) (Connection, error) + ListConnections func(ctx context.Context, owner OwnerID, f Filter) ([]Connection, error) + UpdateConnection func(ctx context.Context, c Connection) (Connection, error) + type Consumer struct + ID string + Kind string + type Credential struct + Ciphertext []byte + ConnectionID string + CreatedAt time.Time + ExpiresAt *time.Time + Kind string + Owner OwnerID + Version int + func (c Credential) Clone() Credential + type CredentialStore interface + ActiveCredential func(ctx context.Context, owner OwnerID, connectionID string) (Credential, error) + DestroyCredentials func(ctx context.Context, owner OwnerID, connectionID string) error + SwapCredential func(ctx context.Context, expectActive int, next Credential) error + type Cryptographer interface + Open func(ctx context.Context, purpose string, ciphertext, aad []byte) ([]byte, error) + Seal func(ctx context.Context, purpose string, plaintext, aad []byte) ([]byte, error) + type Event struct + Actor Principal + ConnectionID string + Details map[string]string + OnBehalfOf *Principal + Owner OwnerID + Provider string + Reason string + Success bool + Time time.Time + Type EventType + type EventType string + const EventAccessDenied + const EventBindingChanged + const EventConnectionCreated + const EventConnectionDeleted + const EventConnectionDisconnected + const EventConnectionStateChanged + const EventConnectionUpdated + const EventConnectionValidated + const EventCredentialRefreshed + const EventCredentialReplaced + const EventCredentialRevoked + const EventGrantChanged + type Filter struct + Provider string + State State + func (f Filter) Match(c Connection) bool + type Grant struct + Actions []Action + ConnectionID string + Owner OwnerID + Principal Principal + func (g Grant) Clone() Grant + type GrantStore interface + ListGrants func(ctx context.Context, owner OwnerID, connectionID string) ([]Grant, error) + PutGrant func(ctx context.Context, g Grant) error + RemoveGrant func(ctx context.Context, owner OwnerID, connectionID string, p Principal) error + type Health struct + ConsecutiveFails int + LastError string + LastValidatedAt time.Time + LastValidation Outcome + type Lease interface + Release func(ctx context.Context) error + type Leaser interface + Acquire func(ctx context.Context, key string, ttl time.Duration) (Lease, error) + type Outcome string + const OutcomeFailed + const OutcomeOK + const OutcomeUnknown + type OwnerID string + type Principal struct + ID string + Kind PrincipalKind + type PrincipalKind string + const PrincipalAgent + const PrincipalService + const PrincipalUser + type Secret struct + func NewSecret(b []byte) Secret + func SecretString(s string) Secret + func (Secret) Format(f fmt.State, _ rune) + func (Secret) GoString() string + func (Secret) LogValue() slog.Value + func (Secret) MarshalJSON() ([]byte, error) + func (Secret) MarshalText() ([]byte, error) + func (Secret) String() string + func (s Secret) Clear() + func (s Secret) IsZero() bool + func (s Secret) Reveal() []byte + type SecretSource interface + Secret func(ctx context.Context, ref string) (Secret, error) + type State string + const StateConnected + const StateDisconnected + const StateNeedsAttention + const StatePending + const StateRevoked + func States() []State + func (s State) CanTransition(next State) bool + func (s State) CheckTransition(next State) error + func (s State) Next() []State + func (s State) Usable() bool + func (s State) Valid() bool + type Store interface + type SystemClock struct + func (SystemClock) Now() time.Time + type Use struct + Consumer Consumer + OnBehalfOf *Principal + Purpose string