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

keystore

package
v1.18.2 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package keystore manages installation-scoped credential persistence and pooled client initialization for integrations.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrCredentialNotFound indicates no credential exists for the supplied installation
	ErrCredentialNotFound = errors.New("keystore: credential not found")
	// ErrStoreNotInitialized indicates the store instance is nil
	ErrStoreNotInitialized = errors.New("keystore: store not initialized")
	// ErrInstallationIDRequired indicates the caller did not provide an installation identifier
	ErrInstallationIDRequired = errors.New("keystore: installation id required")
)

Functions

This section is empty.

Types

type Store

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

Store persists and retrieves installation credentials via Ent-backed hush secrets

func NewStore

func NewStore(db *ent.Client) (*Store, error)

NewStore constructs the credential store backed by the supplied Ent client

func (*Store) BuildClient added in v1.15.0

func (s *Store) BuildClient(ctx context.Context, installation *ent.Integration, registration types.ClientRegistration, credentials types.CredentialBindings, config json.RawMessage, force bool) (any, error)

BuildClient resolves one named client for an installation using explicit credential bundles

func (*Store) DeleteCredential added in v1.15.0

func (s *Store) DeleteCredential(ctx context.Context, integrationID string) error

DeleteCredential removes all credentials for one installation by identifier

func (*Store) InvalidateClients added in v1.15.0

func (s *Store) InvalidateClients(integrationID string)

InvalidateClients drops all pooled clients for one installation

func (*Store) LoadCredential

func (s *Store) LoadCredential(ctx context.Context, installation *ent.Integration, credentialRef types.CredentialSlotID) (types.CredentialSet, bool, error)

LoadCredential resolves one persisted credential slot for one installation record

func (*Store) LoadCredentials added in v1.15.0

func (s *Store) LoadCredentials(ctx context.Context, installation *ent.Integration, credentialRefs []types.CredentialSlotID) (types.CredentialBindings, error)

LoadCredentials resolves the requested credential slots for one installation record

func (*Store) SaveCredential

func (s *Store) SaveCredential(ctx context.Context, installation *ent.Integration, credentialRef types.CredentialSlotID, credential types.CredentialSet) error

SaveCredential upserts one credential slot for one installation record

func (*Store) SaveInstallationCredential added in v1.15.0

func (s *Store) SaveInstallationCredential(ctx context.Context, integrationID string, credentialRef types.CredentialSlotID, credential types.CredentialSet) error

SaveInstallationCredential loads the installation record by ID and upserts one credential slot

Jump to

Keyboard shortcuts

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