revocation

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package revocation implements the OAuth 2.0 Token Revocation endpoint plugin.

It handles POST /revoke (RFC 7009 §2), allowing clients to invalidate access tokens and refresh tokens.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidRefreshToken = errors.New("invalid refresh token")

ErrInvalidRefreshToken is a sentinel error for invalid refresh tokens.

Functions

This section is empty.

Types

type Config

type Config struct {
	Store       storm.RevocationStore
	ClientStore storm.ClientStore
	Crypto      storm.UniCrypto
	KeyStore    protocol.KeyStore
}

Config holds the dependencies for the Revocation plugin.

type Plugin

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

Plugin implements the Token Revocation endpoint.

func New

func New(ctx *storm.PluginContext) *Plugin

New creates a new Revocation plugin from a PluginContext.

func NewWithConfig

func NewWithConfig(cfg Config) *Plugin

NewWithConfig creates a new Revocation plugin with explicit config.

func (*Plugin) Category

func (p *Plugin) Category() storm.PluginCategory

Category returns CategoryStandard — revocation is optional but enabled by default.

func (*Plugin) Contribute

func (p *Plugin) Contribute(ctx context.Context, cfg *protocol.DiscoveryConfiguration)

Contribute returns the discovery fields for the revocation endpoint.

func (*Plugin) Name

func (p *Plugin) Name() string

Name returns the plugin name.

func (*Plugin) Register

func (p *Plugin) Register(r chi.Router)

Register installs the POST /revoke route.

OAuth 2.0 standard endpoint: POST /revoke (RFC 7009 §2)

func (*Plugin) Requires

func (p *Plugin) Requires() []string

Requires returns the storage dependencies.

Jump to

Keyboard shortcuts

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