access

package
v0.26.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: MIT Imports: 6 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

Overview

Package access turns the credential of a request into the claims of a grant.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	Authenticate(r *http.Request, repo string) (grant.Claims, error)
}

Authenticator reads the credential of r and returns the claims that it gives. repo is the repository text that the route names, empty for a route with none. A credential that is missing, forged, expired or not allowed for repo answers grant.ErrGrant and nothing else. The claims never hold a scope above what the credential gives.

func Chain

func Chain(auths ...Authenticator) Authenticator

Chain returns an Authenticator that answers with the first claims that one of auths gives, and grant.ErrGrant when none gives any.

type Grant

type Grant struct {
	Verifier *grant.Verifier
	Now      func() time.Time
	Token    func(*http.Request) string
}

Grant verifies the grant that Token reads from the request.

func (Grant) Authenticate

func (a Grant) Authenticate(r *http.Request, _ string) (grant.Claims, error)

type Human

type Human struct {
	Verifier identity.Verifier
	Rules    identity.Rules
}

Human gives the claims of the scope that Rules give the principal of Verifier on the repository.

func (Human) Authenticate

func (h Human) Authenticate(r *http.Request, repo string) (grant.Claims, error)

type UserToken

type UserToken struct{ Verifier usertoken.Verifier }

UserToken gives the claims of the scope and repositories that the record of a per-user token holds.

func (UserToken) Authenticate

func (u UserToken) Authenticate(r *http.Request, repo string) (grant.Claims, error)

Jump to

Keyboard shortcuts

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