routes

package
v0.0.0-...-4ff1bda Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package routes is the optional HTTP adapter tier over the transport-free auth service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SecurityHeaders

func SecurityHeaders(next azugo.RequestHandler) azugo.RequestHandler

SecurityHeaders is a middleware that marks responses as non-cacheable (RFC 6749 §5.1) and disables content-type sniffing.

Types

type AuthorizeEndpoint

type AuthorizeEndpoint string

AuthorizeEndpoint overrides the authorization_endpoint URL reported by the discovery document.

type Group

type Group int

Group identifies a suppressible endpoint group for Bind.

const (
	// SessionGroup mounts /sessions and /session routes.
	SessionGroup Group = iota
)

type Handler

type Handler struct {
	OIDC    OIDCRoutes
	Session SessionRoutes
	// contains filtered or unexported fields
}

Handler exposes the HTTP adapters over a constructed *auth.Auth as grouped fields.

func Bind

func Bind(r azugo.Router, prefix string, a *auth.Auth, opts ...Option) *Handler

Bind mounts routes under prefix on router.

func New

func New(a *auth.Auth, opts ...Option) *Handler

New builds the grouped HTTP adapters.

type IntrospectEndpoint

type IntrospectEndpoint string

IntrospectEndpoint overrides the introspection_endpoint URL reported by the discovery document.

type JWKSEndpoint

type JWKSEndpoint string

JWKSEndpoint overrides the jwks_uri URL reported by the discovery document.

type MountPrefix

type MountPrefix string

MountPrefix sets the prefix used to derive the issuer and default endpoint URLs.

type OIDCRoutes

type OIDCRoutes struct {
	Authorize     azugo.RequestHandler // POST /authorize (portal silent re-auth)
	AuthorizeCode azugo.RequestHandler // GET /authorize (authorization-code flow)
	Token         azugo.RequestHandler // POST /token (password, authorization_code, client_credentials)
	Revoke        azugo.RequestHandler // POST /revoke (RFC 7009)
	Introspect    azugo.RequestHandler // POST /introspect (RFC 7662)
	Discovery     azugo.RequestHandler // GET /.well-known/openid-configuration
	UserInfo      azugo.RequestHandler // GET /userinfo
	JWKS          azugo.RequestHandler // GET /.well-known/jwks.json
}

OIDCRoutes holds the always-mounted protocol adapters.

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option to configure Bind.

func OIDC

func OIDC() Option

OIDC explicitly forces Bind to mount only OIDC routes.

type RevokeEndpoint

type RevokeEndpoint string

RevokeEndpoint overrides the revocation_endpoint URL reported by the discovery document.

type SessionRoutes

type SessionRoutes struct {
	Get    azugo.RequestHandler // GET /session
	Delete azugo.RequestHandler // DELETE /session
	List   azugo.RequestHandler // GET /sessions
	Revoke azugo.RequestHandler // DELETE /sessions/{id}
}

SessionRoutes holds the suppressible self-service session adapters.

type TokenEndpoint

type TokenEndpoint string

TokenEndpoint overrides the token_endpoint URL reported by the discovery document.

type UserinfoEndpoint

type UserinfoEndpoint string

UserinfoEndpoint overrides the userinfo_endpoint URL reported by the discovery document.

Jump to

Keyboard shortcuts

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