Documentation
¶
Overview ¶
Package storage provides in-memory implementations of every store interface the issuer package defines (NonceStore, CredentialOfferStore, DeferredTransactionStore, NotificationStore, PreAuthorizedCodeStore, DPoPNonceStore, DPoPReplayChecker) — for local development and testing only. Never production.
Every type here is non-durable (an in-process map, gone on restart) and grows unboundedly for the life of the process — there is no expiry-driven garbage collection. That's fine for a short local development session; it is not fine for anything long-running.
Index ¶
- type CredentialOfferStore
- type DPoPNonceStore
- type DPoPReplayChecker
- type DeferredTransactionStore
- func (s *DeferredTransactionStore) Get(_ context.Context, transactionID string) (issuer.DeferredTransactionRecord, error)
- func (s *DeferredTransactionStore) Invalidate(_ context.Context, transactionID string) error
- func (s *DeferredTransactionStore) Put(_ context.Context, transactionID string, ...) error
- type NonceStore
- type NotificationStore
- type PreAuthorizedCodeStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CredentialOfferStore ¶
type CredentialOfferStore struct {
// contains filtered or unexported fields
}
CredentialOfferStore is an in-memory issuer.CredentialOfferStore. See the package doc comment for why this is development/testing only.
func NewCredentialOfferStore ¶
func NewCredentialOfferStore() *CredentialOfferStore
NewCredentialOfferStore builds an empty CredentialOfferStore.
func (*CredentialOfferStore) Get ¶
func (s *CredentialOfferStore) Get(_ context.Context, reference string) (issuer.CredentialOfferRecord, error)
Get implements issuer.CredentialOfferStore.
func (*CredentialOfferStore) Store ¶
func (s *CredentialOfferStore) Store(_ context.Context, record issuer.CredentialOfferRecord) error
Store implements issuer.CredentialOfferStore.
type DPoPNonceStore ¶
type DPoPNonceStore struct {
// contains filtered or unexported fields
}
DPoPNonceStore is an in-memory issuer.DPoPNonceStore. See the package doc comment for why this is development/testing only.
func NewDPoPNonceStore ¶
func NewDPoPNonceStore() *DPoPNonceStore
NewDPoPNonceStore builds an empty DPoPNonceStore.
func (*DPoPNonceStore) Consume ¶
func (s *DPoPNonceStore) Consume(_ context.Context, consumption issuer.DPoPNonceConsumption) (issuer.DPoPNonceRecord, error)
Consume implements issuer.DPoPNonceStore. Deleting the map entry on every call — whether or not it was present — is what makes this single-use: a second Consume of the same nonce always finds nothing.
func (*DPoPNonceStore) Issue ¶
func (s *DPoPNonceStore) Issue(_ context.Context, issuance issuer.DPoPNonceIssuance) error
Issue implements issuer.DPoPNonceStore.
type DPoPReplayChecker ¶
type DPoPReplayChecker struct {
// contains filtered or unexported fields
}
DPoPReplayChecker is an in-memory issuer.DPoPReplayChecker: it remembers every "jti" UseOnce has ever seen and rejects a repeat, per RFC 9449 §11.1's own "MUST reject any DPoP proof in which the jti has been seen before". expiresAt is accepted only to satisfy the interface — this store never evicts an entry, so a jti is rejected as reused indefinitely, past its own DPoP proof's validity window. See the package doc comment for why that's development/ testing only.
func NewDPoPReplayChecker ¶
func NewDPoPReplayChecker() *DPoPReplayChecker
NewDPoPReplayChecker builds an empty DPoPReplayChecker.
type DeferredTransactionStore ¶
type DeferredTransactionStore struct {
// contains filtered or unexported fields
}
DeferredTransactionStore is an in-memory issuer.DeferredTransactionStore. See the package doc comment for why this is development/testing only.
issuer.DeferredTransactionStore only defines Get/Invalidate — by design, issuer never creates or resolves a Deferred Issuance transaction itself (see issuer.DeferredTransactionRecord's own doc comment). Put is this store's own extra method, for whatever stands in here for that business process: call it once to create a transaction (ordinarily DeferredTransactionPending), and again, later, to move it to DeferredTransactionIssued or DeferredTransactionDenied.
func NewDeferredTransactionStore ¶
func NewDeferredTransactionStore() *DeferredTransactionStore
NewDeferredTransactionStore builds an empty DeferredTransactionStore.
func (*DeferredTransactionStore) Get ¶
func (s *DeferredTransactionStore) Get(_ context.Context, transactionID string) (issuer.DeferredTransactionRecord, error)
Get implements issuer.DeferredTransactionStore.
func (*DeferredTransactionStore) Invalidate ¶
func (s *DeferredTransactionStore) Invalidate(_ context.Context, transactionID string) error
Invalidate implements issuer.DeferredTransactionStore.
func (*DeferredTransactionStore) Put ¶
func (s *DeferredTransactionStore) Put(_ context.Context, transactionID string, record issuer.DeferredTransactionRecord) error
Put creates or replaces the transaction identified by transactionID. It also un-invalidates transactionID, so a caller can reuse an invalidated transaction_id for a fresh transaction, though in practice each transaction_id should be its own unique, unguessable value.
type NonceStore ¶
type NonceStore struct {
// contains filtered or unexported fields
}
NonceStore is an in-memory issuer.NonceStore. See the package doc comment for why this is development/testing only.
func (*NonceStore) Consume ¶
func (s *NonceStore) Consume(_ context.Context, consumption issuer.NonceConsumption) (issuer.NonceRecord, error)
Consume implements issuer.NonceStore. Deleting the map entry on every call — whether or not it was present — is what makes this single-use: a second Consume of the same nonce always finds nothing.
func (*NonceStore) Issue ¶
func (s *NonceStore) Issue(_ context.Context, issuance issuer.NonceIssuance) error
Issue implements issuer.NonceStore.
type NotificationStore ¶
type NotificationStore struct {
// contains filtered or unexported fields
}
NotificationStore is an in-memory issuer.NotificationStore. See the package doc comment for why this is development/testing only.
func NewNotificationStore ¶
func NewNotificationStore() *NotificationStore
NewNotificationStore builds an empty NotificationStore.
func (*NotificationStore) Get ¶
func (s *NotificationStore) Get(_ context.Context, notificationID string) (issuer.NotificationRecord, error)
Get implements issuer.NotificationStore.
func (*NotificationStore) Issue ¶
func (s *NotificationStore) Issue(_ context.Context, notificationID string, record issuer.NotificationRecord) error
Issue implements issuer.NotificationStore.
type PreAuthorizedCodeStore ¶
type PreAuthorizedCodeStore struct {
// contains filtered or unexported fields
}
PreAuthorizedCodeStore is an in-memory issuer.PreAuthorizedCodeStore. See the package doc comment for why this is development/testing only.
func NewPreAuthorizedCodeStore ¶
func NewPreAuthorizedCodeStore() *PreAuthorizedCodeStore
NewPreAuthorizedCodeStore builds an empty PreAuthorizedCodeStore.
func (*PreAuthorizedCodeStore) Consume ¶
func (s *PreAuthorizedCodeStore) Consume(_ context.Context, code string) (issuer.PreAuthorizedCodeRecord, error)
Consume implements issuer.PreAuthorizedCodeStore. Deleting the map entry on every call — whether or not it was present — is what makes this single-use: a second Consume of the same code always finds nothing, the same shape NonceStore.Consume already establishes.
func (*PreAuthorizedCodeStore) Issue ¶
func (s *PreAuthorizedCodeStore) Issue(_ context.Context, code string, record issuer.PreAuthorizedCodeRecord) error
Issue implements issuer.PreAuthorizedCodeStore.