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

keystore

package
v2.9.2 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 16 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

func (s *Store) BuildClient(ctx context.Context, installation *ent.Integration, connection, client string, build types.ClientBuilderFunc, credential types.CredentialSet, force bool) (any, error)

BuildClient resolves one named client of a connection for an installation from its credential

func (*Store) DeleteCredential

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

DeleteCredential removes all credentials for one installation by identifier

func (*Store) DeleteCredentialSlots

func (s *Store) DeleteCredentialSlots(ctx context.Context, installation *ent.Integration, names ...string) error

DeleteCredentialSlots deletes the installation's credentials stored under the given secret names and drops its cached clients

func (*Store) InvalidateClients

func (s *Store) InvalidateClients(integrationID string)

InvalidateClients drops all pooled clients for one installation

func (*Store) LoadAllCredentials

func (s *Store) LoadAllCredentials(ctx context.Context, installation *ent.Integration) (map[string]types.CredentialSet, error)

LoadAllCredentials resolves every persisted credential for one installation record keyed by secret name

func (*Store) LoadCredential

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

LoadCredential resolves the persisted credential of the named connection for one installation record

func (*Store) ReplaceCredentials

func (s *Store) ReplaceCredentials(ctx context.Context, installation *ent.Integration, previous, next map[string]types.CredentialSet) error

ReplaceCredentials reconciles installation credentials keyed by secret name from previous to next

func (*Store) SaveCredential

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

SaveCredential upserts the credential of the named connection for one installation record

Jump to

Keyboard shortcuts

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