oidc

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: MIT Imports: 16 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 oidc authenticates a request by a signed OIDC JWT from any issuer, and maps a claim of the JWT to the scope land on a repository with rules. An identity-aware proxy that signs a JWT with a key set is one configuration of it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

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

Authenticator verifies the JWT and applies the rules.

func New

func New(cfg Config) (*Authenticator, error)

New checks cfg. A human identity may only land: it reads no status, posts no check result and mints no token.

func (*Authenticator) Authenticate

func (a *Authenticator) Authenticate(r *http.Request, repo string) (token.Claims, error)

type Config

type Config struct {
	// Issuer is the exact value of the iss claim.
	Issuer string
	// Audience must be one of the aud claims.
	Audience string
	// KeysURL is the address of the key set. When it is empty, the key set is the jwks_uri of the discovery
	// document at <Issuer>/.well-known/openid-configuration.
	KeysURL string
	// Header names the header that carries the JWT. Default Authorization, as a Bearer token or the password of a
	// Basic credential. Any other header carries the bare JWT.
	Header string
	// Claim names the claim that holds the subject text that the rules match. Default email.
	Claim string
	// Algs lists the accepted signature algorithms: RS256, RS384, RS512, ES256 or ES384. Default RS256.
	Algs   []string
	Rules  []identity.Rule
	Client *http.Client
	Now    func() time.Time
}

Config is the deployment of one issuer.

Jump to

Keyboard shortcuts

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