web

package
v0.0.0-...-758381b Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadRsaPrivateKey

func ReadRsaPrivateKey(path string) (*rsa.PrivateKey, error)

Types

type OauthFlowConfig

type OauthFlowConfig struct {
	Oauth2            *oauth2.Config
	ClientCallbackUrl *url.URL
	MaxLoginWindow    time.Duration
	StateCookie       *cookies.Encrypted
}

func (*OauthFlowConfig) LoginCallbackHandle

func (f *OauthFlowConfig) LoginCallbackHandle(next http.HandlerFunc) http.HandlerFunc

func (*OauthFlowConfig) LoginInitHandle

func (f *OauthFlowConfig) LoginInitHandle() http.HandlerFunc

type SigningFlowConfig

type SigningFlowConfig struct {
	SigningAlgorithm jose.SignatureAlgorithm
	PrivateKey       *rsa.PrivateKey
	KeyId            string
	Audiences        []string
	Issuer           *url.URL
	ConfigDir        string
	StateCookie      *cookies.Encrypted
}

func (*SigningFlowConfig) IssueSurrogateToken

func (f *SigningFlowConfig) IssueSurrogateToken(expires time.Time, name, email, subject string) (string, error)

Creates a Surrogate token from parameters

func (*SigningFlowConfig) RenderJwksHandle

func (f *SigningFlowConfig) RenderJwksHandle() http.HandlerFunc

Renders the public key to validate the issued surrogate token

func (*SigningFlowConfig) RenderSurrogateJwtHandle

func (f *SigningFlowConfig) RenderSurrogateJwtHandle(expiryCalculator func() (time.Time, error)) http.HandlerFunc

Renders a Surrogate token from data stored within an http cookie

type StateCookieConfig

type StateCookieConfig struct {
	Name   string
	EncKey []byte
	Path   string
}

type SurrogateJwtClaims

type SurrogateJwtClaims struct {
	*jwt.Claims
	Email string `json:"email,omitempty"`
	Name  string `json:"name,omitempty"`
}

Jump to

Keyboard shortcuts

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