sessionSupport

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	EnvOidcEnabled = "HEXA_OIDC_ENABLED"
	KeyHexaState   = "hexa-state"
	KeyHexaNonce   = "hexa-nonce"
	KeyEmail       = "email"
	KeySubject     = "sub"
	KeyIdToken     = "idtoken"
	KeySessionId   = "session-id"
	HexaCookie     = "hexa-cookie"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SessionInfo

type SessionInfo struct {
	Email    string `json:"email"`
	Sub      string `json:"sub"`
	Session  string `json:"session"`
	RawToken string `json:"idtoken"`
}

type SessionManager

type SessionManager interface {
	StartLogin(state string, nonce string, r *http.Request) string
	Session(r *http.Request) (session *SessionInfo, err error)
	StoreLoginSession(rawToken string, email string, sub string, r *http.Request)
	Logout(r *http.Request) (err error)
	GetState(r *http.Request) (session string, state string, nonce string)
	ValidateSession(w http.ResponseWriter, r *http.Request) bool
	SetSessionMiddleware(router *mux.Router)
	GetScs() *scs.SessionManager
}

func NewSessionManager

func NewSessionManager() SessionManager

Jump to

Keyboard shortcuts

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