Documentation
¶
Overview ¶
Package authcache provides the legacy authorization cache adapter.
Deprecated: use github.com/faustbrian/go-authorization/v3/adapters/cache. This package remains supported for the longer of 180 days after successor public availability and two subsequently published stable root-module minor releases.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrManifestTooLarge preserves the direct adapter error identity for errors.Is. ErrManifestTooLarge = adapter.ErrManifestTooLarge // ErrInvalidRevision preserves the direct adapter error identity for errors.Is. ErrInvalidRevision = adapter.ErrInvalidRevision // ErrNilRepository preserves the direct adapter error identity for errors.Is. ErrNilRepository = adapter.ErrNilRepository )
Functions ¶
func RepositoryLoader ¶
func RepositoryLoader( repository policy.Repository, ) (cache.Loader[authorization.Revision, policy.Manifest], error)
RepositoryLoader delegates fresh exact-revision reads, not cache-hit verification; direct calls retain raw repository error/callback semantics.
Types ¶
type Config ¶
type Config struct {
// Namespace separates application policy cache keys; callers own scope/uniqueness.
Namespace string
// Backend is borrowed; callers own its capacity, transport and shutdown policy.
Backend cache.Backend
// TTL is delegated cache expiration policy, not repository verification freshness.
TTL cache.TTLPolicy
// Clock is borrowed time policy and must be prompt/concurrency-safe; no lifecycle is owned.
Clock cache.Clock
// Observer is delegated borrowed cache observation; no ownership transfer occurs.
Observer cache.Observer
// MaxValue caps encoded cache bytes; zero selects 1 MiB.
MaxValue int
// MaxBatch is delegated to the cache multi-key admission policy.
MaxBatch int
// MaxKeySize is delegated key admission; zero selects 256.
MaxKeySize int
}
Config retains released composition fields; collaborators stay caller-owned.
type ManifestCodec ¶
type ManifestCodec struct {
// MaxEncodedSize caps admitted encoding; non-positive values select 1 MiB.
MaxEncodedSize int
}
ManifestCodec retains the released named codec and delegates size/profile policy.
type RevisionKeyEncoder ¶
type RevisionKeyEncoder struct{}
RevisionKeyEncoder retains the released nonzero decimal revision-key contract.
func (RevisionKeyEncoder) EncodeKey ¶
func (RevisionKeyEncoder) EncodeKey(revision authorization.Revision) ([]byte, error)
EncodeKey delegates exact nonzero decimal key encoding.