kvs

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 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) keystore.KVS

Types

type Backend

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

Backend interface for key-value storage

type IdentityConfigurationsIterator

type IdentityConfigurationsIterator struct {
	kvs.Iterator
}

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 driver.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) GetAuditInfo

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

func (*IdentityStore) GetExistingSignerInfo

func (s *IdentityStore) GetExistingSignerInfo(ctx context.Context, identities ...driver2.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) IteratorConfigurations

func (s *IdentityStore) IteratorConfigurations(ctx context.Context, configurationType string) (driver3.IdentityConfigurationIterator, 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, 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 interface{}) error
	Get(ctx context.Context, id string, state interface{}) error
	GetByPartialCompositeID(ctx context.Context, prefix string, attrs []string) (kvs.Iterator, error)
}

func NewInMemory

func NewInMemory() (KVS, error)

type KeyValuePair

type KeyValuePair struct {
	Key   string
	Value interface{}
	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
}

TrackedKVS wraps a Backend and tracks operations

func NewTrackedMemory

func NewTrackedMemory() *TrackedKVS

func NewTrackedMemoryFrom

func NewTrackedMemoryFrom(backend Backend) *TrackedKVS

func (*TrackedKVS) Get

func (f *TrackedKVS) Get(id string, entry interface{}) error

func (*TrackedKVS) Put

func (f *TrackedKVS) Put(id string, entry interface{}) 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) (driver.WalletID, error)

func (*WalletStore) GetWalletIDs

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

func (*WalletStore) IdentityExists

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

func (*WalletStore) LoadMeta

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

func (*WalletStore) StoreIdentity

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

Directories

Path Synopsis
hashicorp module

Jump to

Keyboard shortcuts

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