routerauth

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IssuerEnvironment    = "NEKIRO_AGENT_ROUTER_ISSUER"
	AudienceEnvironment  = "NEKIRO_AGENT_ROUTER_AUDIENCE"
	KeyIDEnvironment     = "NEKIRO_AGENT_ROUTER_KEY_ID"
	PublicKeyEnvironment = "NEKIRO_AGENT_ROUTER_PUBLIC_KEY_BASE64URL"
)

Variables

This section is empty.

Functions

Types

type Config

type Config struct {
	Issuer    string
	Audience  string
	KeyID     string
	PublicKey ed25519.PublicKey
}

func LoadConfig

func LoadConfig(lookup func(string) (string, bool)) (Config, error)

func (Config) Validate

func (config Config) Validate() error

type Middleware

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

func NewMiddleware

func NewMiddleware(config Config, now func() time.Time) (*Middleware, error)

func (*Middleware) Handler

func (middleware *Middleware) Handler(next http.Handler) http.Handler

type ReplayGuard

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

func NewReplayGuard

func NewReplayGuard(now func() time.Time) (*ReplayGuard, error)

func (*ReplayGuard) Accept

func (guard *ReplayGuard) Accept(jwtID string, expiresAt int64) bool

type Verifier

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

func NewVerifier

func NewVerifier(config Config, now func() time.Time) (*Verifier, error)

func (*Verifier) Verify

Jump to

Keyboard shortcuts

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