server

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 31 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var VERSION string

Functions

func PrettyToken

func PrettyToken(t string) string

func RandomString

func RandomString(n int) string

func SetupRoutes

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

Types

type Config

type Config struct {
	StaticDir       string
	CookieSecret    string
	SessionLifetime time.Duration
	SessionManager  *SessionManager
}

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 {
	ID           string              `json:"id"`
	Expires      time.Time           `json:"expires"`
	Certificates []*cert.Certificate `json:"certificates"`

	Provider      *oidc.Provider          `json:"-"`
	Config        *oauth2.Config          `json:"-"`
	OIDCVerifier  *Verifier               `json:"-"`
	OAuthCodeOpts []oauth2.AuthCodeOption `json:"-"`
	SamlMw        *samlsp.Middleware      `json:"-"`
	SamlOpts      SamlOpts                `json:"-"`
	State         string                  `json:"-"`
	CsrfToken     string                  `json:"-"`
}

func (*Session) Valid

func (s *Session) Valid() bool

type SessionManager

type SessionManager struct {
	sync.Mutex

	Items map[string]*Session `json:"sessions"`
	// contains filtered or unexported fields
}

func LoadSessionManager added in v0.2.3

func LoadSessionManager(filepath string) (*SessionManager, error)

func (*SessionManager) Get

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

func (*SessionManager) New added in v0.2.3

func (m *SessionManager) New() (*Session, error)

func (*SessionManager) Remove

func (m *SessionManager) Remove(hash string)

func (*SessionManager) RunSessionCleanup added in v0.2.3

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

func (*SessionManager) Save added in v0.2.3

func (m *SessionManager) Save() error

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