auth

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
	Audience       []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