auth

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentBond added in v0.7.0

type AgentBond struct {
	Hash      [32]byte
	Device    uuid.UUID
	UpdatedAt time.Time
}

type AuthError added in v0.7.0

type AuthError struct {
	StatusCode   int
	Err          error
	RedirectPath string
}

type AuthProvider

type AuthProvider interface {
	Validate(w http.ResponseWriter, r *http.Request, token string) (*http.Request, *AuthError)
}

type B64EncodedAuthProvider

type B64EncodedAuthProvider struct{}

func NewB64EncodedAuthProvider

func NewB64EncodedAuthProvider() *B64EncodedAuthProvider

func (*B64EncodedAuthProvider) Validate

type BondingAuthProvider added in v0.7.0

type BondingAuthProvider interface {
	MaxDevices() uint16
	MinDeviceEvictionInterval() time.Duration
	MaxBondsPerSubject() uint16
	Cache() *otter.Cache[string, []AgentBond]
}

A BondingAuthProvider MUST set the BondingRecordContextKey in the request context.

type BondingData added in v0.7.0

type BondingData struct {
	Hash   [32]byte
	Device uuid.UUID
	Key    string
	Bonds  []AgentBond
}

func (*BondingData) Evict added in v0.7.0

func (b *BondingData) Evict(keep uint16)

type BondingEvictionProvider added in v0.7.0

type BondingEvictionProvider interface {
	Evict(excess uint16) error
}

type ContextKey added in v0.7.0

type ContextKey string
const BondingRecordContextKey ContextKey = "bondingRecord"
const ContextPathKey ContextKey = "path"

type JWKSAuthProvider

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

func NewJWKSAuthProvider

func NewJWKSAuthProvider(context context.Context, client *http.Client, jwksUrl string) (*JWKSAuthProvider, error)

func (*JWKSAuthProvider) Validate

func (j *JWKSAuthProvider) Validate(w http.ResponseWriter, r *http.Request, token string) (*http.Request, *AuthError)

type JWKSBondingAuthProvider added in v0.7.0

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

func NewJWKSBondingAuthProvider added in v0.7.0

func NewJWKSBondingAuthProvider(ctx context.Context, client *http.Client, jwksUrl string, bondingSecret []byte, defaultMaxDevices uint16, maxBondsPerSubject uint16, minDeviceEvictionInterval time.Duration, maxCacheSize uint, cookiePrefix, cookieSubfolder string) (*JWKSBondingAuthProvider, error)

func (JWKSBondingAuthProvider) Cache added in v0.7.0

func (b JWKSBondingAuthProvider) Cache() *otter.Cache[string, []AgentBond]

func (JWKSBondingAuthProvider) MaxBondsPerSubject added in v0.7.0

func (b JWKSBondingAuthProvider) MaxBondsPerSubject() uint16

func (JWKSBondingAuthProvider) MaxDevices added in v0.7.0

func (b JWKSBondingAuthProvider) MaxDevices() uint16

func (JWKSBondingAuthProvider) MinDeviceEvictionInterval added in v0.7.0

func (b JWKSBondingAuthProvider) MinDeviceEvictionInterval() time.Duration

func (*JWKSBondingAuthProvider) Validate added in v0.7.0

type JWTAuthProvider

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

func NewJWTAuthProvider

func NewJWTAuthProvider(sharedSecret []byte) (*JWTAuthProvider, error)

func (*JWTAuthProvider) Validate

func (j *JWTAuthProvider) Validate(w http.ResponseWriter, r *http.Request, token string) (*http.Request, *AuthError)

type JWTBondingAuthProvider added in v0.7.0

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

func NewJWTBondingAuthProvider added in v0.7.0

func NewJWTBondingAuthProvider(sharedSecret []byte, bondingSecret []byte, defaultMaxDevices uint16, maxBondsPerSubject uint16, minDeviceEvictionInterval time.Duration, maxCacheSize uint, cookiePrefix, cookieSubfolder string) (*JWTBondingAuthProvider, error)

func (JWTBondingAuthProvider) Cache added in v0.7.0

func (b JWTBondingAuthProvider) Cache() *otter.Cache[string, []AgentBond]

func (JWTBondingAuthProvider) MaxBondsPerSubject added in v0.7.0

func (b JWTBondingAuthProvider) MaxBondsPerSubject() uint16

func (JWTBondingAuthProvider) MaxDevices added in v0.7.0

func (b JWTBondingAuthProvider) MaxDevices() uint16

func (JWTBondingAuthProvider) MinDeviceEvictionInterval added in v0.7.0

func (b JWTBondingAuthProvider) MinDeviceEvictionInterval() time.Duration

func (*JWTBondingAuthProvider) Validate added in v0.7.0

Jump to

Keyboard shortcuts

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