kvs

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IdentityDBPrefix              = "idb"
	IdentityDBConfigurationPrefix = "configuration"
	IdentityDBData                = "data"
	IdentityDBSigner              = "signer"
)

Variables

This section is empty.

Functions

func Keystore

func Keystore(kvs KVS) *kvsAdapter

Types

type Backend

type Backend interface {
	Put(ctx context.Context, id string, value any) error
	Get(ctx context.Context, id string, entry any) error
	Delete(ctx context.Context, id string) error
	Close() error
}

Backend interface for key-value storage

type IdentityConfigurationsIterator

type IdentityConfigurationsIterator struct {
	kvs.Iterator
}

func (*IdentityConfigurationsIterator) Close

func (w *IdentityConfigurationsIterator) Close()

func (*IdentityConfigurationsIterator) Next

type IdentityStore

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

func NewIdentityStore

func NewIdentityStore(kvs KVS, tmsID token.TMSID) *IdentityStore

func (*IdentityStore) AddConfiguration

func (s *IdentityStore) AddConfiguration(ctx context.Context, wp storage.IdentityConfiguration) error

func (*IdentityStore) Close

func (s *IdentityStore) Close() error

func (*IdentityStore) ConfigurationExists

func (s *IdentityStore) ConfigurationExists(ctx context.Context, id, configurationType, url string) (bool, error)

func (*IdentityStore) ConfigurationsByID added in v0.14.2

func (s *IdentityStore) ConfigurationsByID(ctx context.Context, id, configurationType string) ([]storage.IdentityConfiguration, error)

ConfigurationsByID returns all configurations with the given id and type, regardless of their url. The composite key encodes id and url together, so this implementation scans the type and filters by id.

func (*IdentityStore) GetAuditInfo

func (s *IdentityStore) GetAuditInfo(ctx context.Context, identity []byte) ([]byte, error)

func (*IdentityStore) GetConfiguration

func (s *IdentityStore) GetConfiguration(ctx context.Context, id, typ, url string) (*storage.IdentityConfiguration, error)

func (*IdentityStore) GetExistingSignerInfo

func (s *IdentityStore) GetExistingSignerInfo(ctx context.Context, identities ...tdriver.Identity) ([]string, error)

func (*IdentityStore) GetSignerInfo

func (s *IdentityStore) GetSignerInfo(ctx context.Context, identity []byte) ([]byte, error)

func (*IdentityStore) GetTokenInfo

func (s *IdentityStore) GetTokenInfo(ctx context.Context, identity []byte) ([]byte, []byte, error)

func (*IdentityStore) IterateSigners

func (s *IdentityStore) IterateSigners(_ context.Context, _, _ int) ([]idriver.SignerEntry, error)

IterateSigners is not supported by the KVS-backed identity store. It returns ErrNotSupported, consistent with other unsupported operations on this store.

func (*IdentityStore) IteratorConfigurations

func (s *IdentityStore) IteratorConfigurations(ctx context.Context, configurationType string) (idriver.IdentityConfigurationIterator, error)

func (*IdentityStore) Notifier

func (*IdentityStore) RegisterIdentityDescriptor

func (s *IdentityStore) RegisterIdentityDescriptor(ctx context.Context, descriptor *idriver.IdentityDescriptor, alias tdriver.Identity) error

func (*IdentityStore) SignerInfoExists

func (s *IdentityStore) SignerInfoExists(ctx context.Context, id []byte) (bool, error)

func (*IdentityStore) StoreIdentityData

func (s *IdentityStore) StoreIdentityData(ctx context.Context, id []byte, identityAudit []byte, tokenMetadata []byte, tokenMetadataAudit []byte) error

func (*IdentityStore) StoreSignerInfo

func (s *IdentityStore) StoreSignerInfo(ctx context.Context, id tdriver.Identity, info []byte) error

type KVS

type KVS interface {
	Exists(ctx context.Context, id string) bool
	GetExisting(ctx context.Context, ids ...string) []string
	Put(ctx context.Context, id string, state any) error
	Get(ctx context.Context, id string, state any) error
	GetByPartialCompositeID(ctx context.Context, prefix string, attrs []string) (kvs.Iterator, error)
	Close() error
	Delete(ctx context.Context, id string) error
}

func NewInMemory

func NewInMemory() (KVS, error)

type KeyValuePair

type KeyValuePair struct {
	Key   string
	Value any
	Error string
}

KeyValuePair stores tracking info

type RecipientData

type RecipientData struct {
	// AuditInfo contains private information Identity
	AuditInfo []byte
	// TokenMetadata contains public information related to the token to be assigned to this Recipient.
	TokenMetadata []byte
	// TokenMetadataAuditInfo contains private information TokenMetadata
	TokenMetadataAuditInfo []byte
}

RecipientData contains information about the identity of a token owner

type TrackedKVS

type TrackedKVS struct {
	Backend    Backend
	PutCounter int
	GetCounter int
	PutHistory []KeyValuePair
	GetHistory []KeyValuePair
	// contains filtered or unexported fields
}

TrackedKVS wraps a Backend and tracks operations

func NewTrackedMemory

func NewTrackedMemory() *TrackedKVS

func NewTrackedMemoryFrom

func NewTrackedMemoryFrom(backend Backend) *TrackedKVS

func (*TrackedKVS) Close

func (f *TrackedKVS) Close() error

func (*TrackedKVS) Delete

func (f *TrackedKVS) Delete(id string) error

func (*TrackedKVS) Get

func (f *TrackedKVS) Get(id string, entry any) error

func (*TrackedKVS) Put

func (f *TrackedKVS) Put(id string, entry any) error

type WalletStore

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

func NewWalletStore

func NewWalletStore(kvs KVS, tmsID token.TMSID) *WalletStore

func (*WalletStore) Close

func (s *WalletStore) Close() error

func (*WalletStore) GetWalletID

func (s *WalletStore) GetWalletID(ctx context.Context, identity driver2.Identity, roleID int) (storage.WalletID, error)

func (*WalletStore) GetWalletIDs

func (s *WalletStore) GetWalletIDs(ctx context.Context, roleID int) ([]storage.WalletID, error)

func (*WalletStore) IdentityExists

func (s *WalletStore) IdentityExists(ctx context.Context, identity driver2.Identity, wID storage.WalletID, roleID int) bool

func (*WalletStore) LoadMeta

func (s *WalletStore) LoadMeta(ctx context.Context, identity driver2.Identity, wID storage.WalletID, roleID int) ([]byte, error)

func (*WalletStore) StoreIdentity

func (s *WalletStore) StoreIdentity(ctx context.Context, identity driver2.Identity, eID string, wID storage.WalletID, roleID int, meta []byte) error

Jump to

Keyboard shortcuts

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