server

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var VERSION string

Functions

func PrettyToken

func PrettyToken(t string) string

func RandomHash

func RandomHash() string

func RandomString

func RandomString(n int) string

func RunSessionCleanup

func RunSessionCleanup(shutdown <-chan struct{}, routines *sync.WaitGroup)

func SetupRoutes

func SetupRoutes(c *Config, shutdown <-chan struct{}, routines *sync.WaitGroup) http.Handler

Types

type Config

type Config struct {
	StaticDir    string
	CookieSecret string
	Certificate  *cert.Certificate
}

Config holds the servers configurtion parameters

type OidcWorkflow

type OidcWorkflow struct{}

type SamlOpts

type SamlOpts struct {
	MetadataURL             string
	MetadataFile            []byte
	SignRequest             bool
	SignAlgorithm           string
	NameIDFormat            string
	NoEncryptionCertificate bool
	AllowIDPInitiated       bool
}

type SamlWorkflow

type SamlWorkflow struct {
}

type Session

type Session struct {
	Expires       time.Time
	Provider      *oidc.Provider
	Config        *oauth2.Config
	OIDCVerifier  *Verifier
	OAuthCodeOpts []oauth2.AuthCodeOption
	SamlMw        *samlsp.Middleware
	SamlOpts      SamlOpts
	State         string
	CsrfToken     string
}

func GetSession

func GetSession(r *http.Request) *Session

func (*Session) Valid

func (s *Session) Valid() bool

type SessionManager

type SessionManager struct {
	sync.Mutex
	Lifetime time.Duration
	Items    map[string]*Session
}
var Sessions SessionManager = SessionManager{
	Lifetime: 12 * time.Hour,
	Items:    map[string]*Session{},
}

func (*SessionManager) Add

func (m *SessionManager) Add(s *Session, hash string)

func (*SessionManager) Get

func (m *SessionManager) Get(hash string) *Session

func (*SessionManager) Remove

func (m *SessionManager) Remove(hash string)

type Verifier

type Verifier struct {
	Value string
}

func NewVerifier

func NewVerifier(length int) *Verifier

func (Verifier) CodeSHA256Challenge

func (v Verifier) CodeSHA256Challenge() string

Jump to

Keyboard shortcuts

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