revocation

package
v1.1.457 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 10 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 revocation provides a revocation service for JWT tokens. It implements jwt.Revocation interface and uses a cache.Provider to store the revoked tokens. Example:

func provideJwt(cfg *config.Configuration, dp dataprotection.Provider, cache cache.Provider) (jwt.Parser, jwt.Signer, error) {
	var provider jwt.Provider
	var err error
	if cfg.Auth.JWT != "" {
		provider, err = jwt.LoadProvider(cfg.Auth.JWT, nil)
		if err != nil {
			return nil, nil, err
		}
	}
	// we encrypt Personal Access Token (pat.),
	// the accesstoken provider handles both, encrypted PAT and plain JWT
	at := accesstoken.New(dp, provider)
	at.SetRevocation(revocation.New(cache))
	return at, at, nil
}

Index

Constants

This section is empty.

Variables

View Source
var (
	// TimeNowFn to override in unit tests
	TimeNowFn = time.Now
)

Functions

func New

func New(cache cache.Provider) jwt.Revocation

Types

This section is empty.

Jump to

Keyboard shortcuts

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