Documentation
¶
Overview ¶
Package memory provides process-local replay and revocation adapters. State is not shared across processes and therefore cannot provide cluster-wide one-time or instant revocation semantics.
Index ¶
- type Clock
- type ConsumptionStore
- type Revocations
- func (store *Revocations) Check(ctx context.Context, query capability.RevocationQuery) (bool, error)
- func (store *Revocations) RevokeCapability(ctx context.Context, issuer, capabilityID string) error
- func (store *Revocations) RevokeIssuedBefore(ctx context.Context, issuer string, cutoff time.Time) error
- func (store *Revocations) RevokeKey(ctx context.Context, issuer, keyID string) error
- func (store *Revocations) RevokeResource(ctx context.Context, issuer, tenant, resource string) error
- func (store *Revocations) RevokeSubject(ctx context.Context, issuer, subject string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsumptionStore ¶
type ConsumptionStore struct {
// contains filtered or unexported fields
}
ConsumptionStore owns process-local atomic replay state.
func NewConsumptionStore ¶
func NewConsumptionStore(clock Clock) (*ConsumptionStore, error)
NewConsumptionStore constructs an empty process-local store.
func (*ConsumptionStore) Cleanup ¶
Cleanup removes state expiring at or before cutoff and returns the number removed.
func (*ConsumptionStore) Consume ¶
func (store *ConsumptionStore) Consume(ctx context.Context, request capability.Consumption) (capability.ConsumptionResult, error)
Consume atomically records one use or returns ErrReplayExhausted without incrementing.
type Revocations ¶
type Revocations struct {
// contains filtered or unexported fields
}
Revocations is a concurrency-safe process-local revocation set.
func NewRevocations ¶
func NewRevocations() *Revocations
NewRevocations constructs an empty process-local revocation set.
func (*Revocations) Check ¶
func (store *Revocations) Check(ctx context.Context, query capability.RevocationQuery) (bool, error)
Check reports whether any exact revocation boundary matches query.
func (*Revocations) RevokeCapability ¶
func (store *Revocations) RevokeCapability(ctx context.Context, issuer, capabilityID string) error
RevokeCapability revokes one capability ID within an issuer namespace.
func (*Revocations) RevokeIssuedBefore ¶
func (store *Revocations) RevokeIssuedBefore(ctx context.Context, issuer string, cutoff time.Time) error
RevokeIssuedBefore revokes capabilities issued strictly before cutoff. A later cutoff replaces an earlier one; the boundary never moves backward.
func (*Revocations) RevokeKey ¶
func (store *Revocations) RevokeKey(ctx context.Context, issuer, keyID string) error
RevokeKey revokes every capability signed by one key ID for an issuer.
func (*Revocations) RevokeResource ¶
func (store *Revocations) RevokeResource(ctx context.Context, issuer, tenant, resource string) error
RevokeResource revokes an exact issuer, tenant, and resource boundary.
func (*Revocations) RevokeSubject ¶
func (store *Revocations) RevokeSubject(ctx context.Context, issuer, subject string) error
RevokeSubject revokes every subject-bound capability for an issuer.