Documentation
¶
Overview ¶
Package keystore manages installation-scoped credential persistence and pooled client initialization for integrations.
Index ¶
- Variables
- type Store
- func (s *Store) BuildClient(ctx context.Context, installation *ent.Integration, connection, client string, ...) (any, error)
- func (s *Store) DeleteCredential(ctx context.Context, integrationID string) error
- func (s *Store) InvalidateClients(integrationID string)
- func (s *Store) LoadAllCredentials(ctx context.Context, installation *ent.Integration) (map[string]types.CredentialSet, error)
- func (s *Store) LoadCredential(ctx context.Context, installation *ent.Integration, name string) (types.CredentialSet, bool, error)
- func (s *Store) ReplaceCredentials(ctx context.Context, installation *ent.Integration, ...) error
- func (s *Store) SaveCredential(ctx context.Context, installation *ent.Integration, name string, ...) error
Constants ¶
This section is empty.
Variables ¶
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 (*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 ¶
DeleteCredential removes all credentials for one installation by identifier
func (*Store) InvalidateClients ¶
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