authcache

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package authcache provides explicit advisory cache adapters for portable policy manifests. Cached manifests never replace repository verification.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrManifestTooLarge = errors.New("authorization cached manifest is too large")
	ErrInvalidRevision  = errors.New("authorization cached revision is invalid")
	ErrNilRepository    = errors.New("authorization cached repository is nil")
)

Functions

func RepositoryLoader

func RepositoryLoader(
	repository policy.Repository,
) (cache.Loader[authorization.Revision, policy.Manifest], error)

Types

type Config

type Config struct {
	Namespace  string
	Backend    cache.Backend
	TTL        cache.TTLPolicy
	Clock      cache.Clock
	Observer   cache.Observer
	MaxValue   int
	MaxBatch   int
	MaxKeySize int
}

type ManifestCodec

type ManifestCodec struct {
	MaxEncodedSize int
}

func (ManifestCodec) Decode

func (codec ManifestCodec) Decode(encoded []byte) (policy.Manifest, error)

func (ManifestCodec) Encode

func (codec ManifestCodec) Encode(manifest policy.Manifest) ([]byte, error)

type RevisionKeyEncoder

type RevisionKeyEncoder struct{}

func (RevisionKeyEncoder) EncodeKey

func (RevisionKeyEncoder) EncodeKey(revision authorization.Revision) ([]byte, error)

Jump to

Keyboard shortcuts

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