memory

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package memory is the compatibility facade for the target-oriented process-local replay and revocation adapter.

Deprecated: use github.com/faustbrian/go-capability/adapters/memory. This package remains supported through the documented compatibility interval.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock interface {
	Now() time.Time
}

Clock supplies wall time for expiry decisions.

type ConsumptionStore

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

ConsumptionStore preserves the released compatibility-path type identity while delegating all behavior to the canonical adapter.

func NewConsumptionStore

func NewConsumptionStore(clock Clock) (*ConsumptionStore, error)

NewConsumptionStore constructs an empty process-local store.

func (*ConsumptionStore) Cleanup

func (store *ConsumptionStore) Cleanup(ctx context.Context, cutoff time.Time) (int, error)

Cleanup removes state expiring at or before cutoff and returns the number removed.

func (*ConsumptionStore) Consume

Consume atomically records one use or returns ErrReplayExhausted without incrementing.

type Revocations

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

Revocations preserves the released compatibility-path type identity while delegating all behavior to the canonical adapter.

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.

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.

Jump to

Keyboard shortcuts

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