par

package
v2.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package par implements the OAuth 2.0 Pushed Authorization Requests plugin.

It handles POST /par (RFC 9126 §3), allowing clients to push authorization request parameters to the server and receive a request_uri in return.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Store       storm.PARStore
	ClientStore storm.ClientStore
	Decoder     *protocol.Decoder
	// Lifetime is the request_uri expiration duration (default: 5m).
	Lifetime time.Duration
	// SkipTLSCertVerify disables TLS certificate verification on outbound HTTP (testing only).
	SkipTLSCertVerify bool
	// AllowPrivateIPs disables SSRF protection for outbound HTTP (testing only).
	AllowPrivateIPs bool
	// EndpointResolver is an optional endpoint URL resolver for customizing endpoint URLs.
	EndpointResolver shared.EndpointResolver
}

Config holds the dependencies for the PAR plugin.

type Plugin

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

Plugin implements the Pushed Authorization Requests endpoint (RFC 9126).

func NewWithConfig

func NewWithConfig(cfg Config) *Plugin

NewWithConfig creates a new PAR plugin with explicit config.

func (*Plugin) Category

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

Category returns CategoryStandard — PAR is optional.

func (*Plugin) Contribute

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

Contribute returns the discovery fields for the PAR endpoint.

func (*Plugin) Name

func (p *Plugin) Name() string

Name returns the plugin name.

func (*Plugin) Register

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

OAuth 2.0 standard endpoint: POST /par (RFC 9126 §3) Register installs the POST /par route.

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