auth

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidToken         = errors.New("invalid token")
	ErrMissingAuthorization = errors.New("authorization header missing or malformed")
	ErrMissingCacheScopes   = errors.New("token does not contain cache scopes")
	ErrInvalidCacheScopes   = errors.New("invalid JSON in cache scopes")
	ErrNoCacheScopes        = errors.New("token does not contain any cache scopes")
	ErrMissingRepositoryID  = errors.New("token does not contain repository id")
	// ErrKeyUnavailable marks server-side key resolution failures (degraded
	// JWKS), mapped to 503 instead of a client-fault 401.
	ErrKeyUnavailable = errors.New("verification key unavailable")
)

Functions

This section is empty.

Types

type CacheScope

type CacheScope struct {
	Scopes []Scope
	RepoID string
}

type Options

type Options struct {
	Issuer         string
	JWKSURL        string
	SkipValidation bool
	Logger         *zerolog.Logger
}

type Scope

type Scope struct {
	Scope      string `json:"Scope"`
	Permission int    `json:"Permission"`
}

type Verifier

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

func NewVerifier

func NewVerifier(ctx context.Context, options Options) (*Verifier, error)

func (*Verifier) CacheScope

func (v *Verifier) CacheScope(ctx context.Context, authorization string) (CacheScope, error)

Jump to

Keyboard shortcuts

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