keystore

package
v2.4.13 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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, 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

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

DeleteCredential removes all credentials for one installation by identifier

func (*Store) InvalidateClients

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

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

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