Documentation
¶
Overview ¶
Package memory provides an in-memory registry.Store for tests, examples and single-process use.
Nothing persists. It holds the whole registry under one mutex, so every operation is atomic by construction, which makes it the reference the SQL store is compared against by the shared conformance suite.
Index ¶
- type Store
- func (s *Store) ActiveKEK(ctx context.Context, purpose keyforge.Purpose) (keyforge.KEKVersion, error)
- func (s *Store) AddVersion(ctx context.Context, v registry.VersionRecord) error
- func (s *Store) AdvanceDEK(ctx context.Context, purpose keyforge.Purpose, subject string, from uint32, ...) (keyforge.DEKRecord, error)
- func (s *Store) Bootstrap(ctx context.Context, purpose keyforge.Purpose, ref provider.KeyRef, ...) error
- func (s *Store) CompleteShred(ctx context.Context, purpose keyforge.Purpose, subject string, at time.Time) (registry.ShredRecord, error)
- func (s *Store) CountDEKStates(ctx context.Context, purpose keyforge.Purpose) (map[keyforge.DEKState]int, error)
- func (s *Store) CountDEKs(ctx context.Context, kekID envelope.ID, version uint32) (int, error)
- func (s *Store) CreateKEK(ctx context.Context, k registry.KEK) error
- func (s *Store) CurrentDEK(ctx context.Context, purpose keyforge.Purpose, subject string) (keyforge.DEKRecord, error)
- func (s *Store) GetDEK(ctx context.Context, id envelope.ID) (keyforge.DEKRecord, error)
- func (s *Store) GetKEK(ctx context.Context, id envelope.ID) (registry.KEK, error)
- func (s *Store) GetSentinel(ctx context.Context, kekID envelope.ID, version uint32) (registry.Sentinel, error)
- func (s *Store) GetShred(ctx context.Context, purpose keyforge.Purpose, subject string) (registry.ShredRecord, error)
- func (s *Store) GetVersion(ctx context.Context, kekID envelope.ID, version uint32) (registry.VersionRecord, error)
- func (s *Store) KEK(ctx context.Context, id envelope.ID) (provider.KeyRef, error)
- func (s *Store) KEKForPurpose(ctx context.Context, purpose keyforge.Purpose) (registry.KEK, error)
- func (s *Store) KEKVersionUsable(ctx context.Context, id envelope.ID, version uint32) (bool, error)
- func (s *Store) ListDEKs(ctx context.Context, f registry.DEKFilter) ([]keyforge.DEKRecord, error)
- func (s *Store) ListKEKs(ctx context.Context) ([]registry.KEK, error)
- func (s *Store) ListSentinels(ctx context.Context, kekID envelope.ID) ([]registry.Sentinel, error)
- func (s *Store) ListShreds(ctx context.Context) ([]registry.ShredRecord, error)
- func (s *Store) ListVersions(ctx context.Context, kekID envelope.ID) ([]registry.VersionRecord, error)
- func (s *Store) MarkDEK(ctx context.Context, id envelope.ID, to keyforge.DEKState) error
- func (s *Store) PutSentinel(ctx context.Context, sn registry.Sentinel) error
- func (s *Store) ReserveEncryptions(ctx context.Context, id envelope.ID, n, limit uint64) (uint64, error)
- func (s *Store) RewrapDEK(ctx context.Context, r registry.Rewrap) error
- func (s *Store) ShredSubject(ctx context.Context, purpose keyforge.Purpose, subject string, at time.Time) (registry.ShredRecord, error)
- func (s *Store) TransitionVersion(ctx context.Context, kekID envelope.ID, version uint32, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is an in-memory registry. It is safe for concurrent use.
func (*Store) ActiveKEK ¶
func (s *Store) ActiveKEK(ctx context.Context, purpose keyforge.Purpose) (keyforge.KEKVersion, error)
ActiveKEK implements keyforge.Store.
func (*Store) AddVersion ¶
AddVersion implements registry.Store.
func (*Store) AdvanceDEK ¶
func (s *Store) AdvanceDEK(ctx context.Context, purpose keyforge.Purpose, subject string, from uint32, next keyforge.DEKRecord) (keyforge.DEKRecord, error)
AdvanceDEK implements keyforge.Store.
func (*Store) Bootstrap ¶
func (s *Store) Bootstrap(ctx context.Context, purpose keyforge.Purpose, ref provider.KeyRef, version uint32, at time.Time) error
Bootstrap registers a KEK for a purpose with its first version active, which is the usual starting point for a test or an example.
func (*Store) CompleteShred ¶
func (s *Store) CompleteShred(ctx context.Context, purpose keyforge.Purpose, subject string, at time.Time) (registry.ShredRecord, error)
CompleteShred implements registry.Store.
func (*Store) CountDEKStates ¶
func (s *Store) CountDEKStates(ctx context.Context, purpose keyforge.Purpose) (map[keyforge.DEKState]int, error)
CountDEKStates implements registry.Store.
func (*Store) CountDEKs ¶
CountDEKs implements registry.Store.
func (*Store) CreateKEK ¶
CreateKEK implements registry.Store.
func (*Store) CurrentDEK ¶
func (s *Store) CurrentDEK(ctx context.Context, purpose keyforge.Purpose, subject string) (keyforge.DEKRecord, error)
CurrentDEK implements keyforge.Store.
func (*Store) GetDEK ¶
GetDEK implements keyforge.Store.
func (*Store) GetKEK ¶
GetKEK implements registry.Store.
func (*Store) GetSentinel ¶
func (s *Store) GetSentinel(ctx context.Context, kekID envelope.ID, version uint32) (registry.Sentinel, error)
GetSentinel implements registry.Store.
func (*Store) GetShred ¶
func (s *Store) GetShred(ctx context.Context, purpose keyforge.Purpose, subject string) (registry.ShredRecord, error)
GetShred implements registry.Store.
func (*Store) GetVersion ¶
func (s *Store) GetVersion(ctx context.Context, kekID envelope.ID, version uint32) (registry.VersionRecord, error)
GetVersion implements registry.Store.
func (*Store) KEK ¶
KEK implements keyforge.Store.
func (*Store) KEKForPurpose ¶
KEKForPurpose implements registry.Store.
func (*Store) KEKVersionUsable ¶
KEKVersionUsable implements keyforge.Store.
func (*Store) ListDEKs ¶
ListDEKs implements registry.Store.
func (*Store) ListKEKs ¶
ListKEKs implements registry.Store.
func (*Store) ListSentinels ¶
ListSentinels implements registry.Store.
func (*Store) ListShreds ¶
ListShreds implements registry.Store.
func (*Store) ListVersions ¶
func (s *Store) ListVersions(ctx context.Context, kekID envelope.ID) ([]registry.VersionRecord, error)
ListVersions implements registry.Store.
func (*Store) MarkDEK ¶
MarkDEK implements registry.Store.
func (*Store) PutSentinel ¶
PutSentinel implements registry.Store.
func (*Store) ReserveEncryptions ¶
func (s *Store) ReserveEncryptions(ctx context.Context, id envelope.ID, n, limit uint64) (uint64, error)
ReserveEncryptions implements keyforge.Store.
func (*Store) RewrapDEK ¶
RewrapDEK implements registry.Store.
func (*Store) ShredSubject ¶
func (s *Store) ShredSubject(ctx context.Context, purpose keyforge.Purpose, subject string, at time.Time) (registry.ShredRecord, error)
ShredSubject implements registry.Store.
func (*Store) TransitionVersion ¶
func (s *Store) TransitionVersion(ctx context.Context, kekID envelope.ID, version uint32, to registry.VersionState, opts registry.TransitionOptions) error
TransitionVersion implements registry.Store.