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, ...) (any, error)
- func (s *Store) DeleteCredential(ctx context.Context, integrationID string) error
- func (s *Store) InvalidateClients(integrationID string)
- func (s *Store) LoadCredential(ctx context.Context, installation *ent.Integration, ...) (types.CredentialSet, bool, error)
- func (s *Store) LoadCredentials(ctx context.Context, installation *ent.Integration, ...) (types.CredentialBindings, error)
- func (s *Store) SaveCredential(ctx context.Context, installation *ent.Integration, ...) error
- func (s *Store) SaveInstallationCredential(ctx context.Context, integrationID 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 ¶ 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
DeleteCredential removes all credentials for one installation by identifier
func (*Store) InvalidateClients ¶ added in v1.15.0
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