session

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeCookie

func MakeCookie(req *http.Request, name string, value string, secure bool, expiration time.Duration) *http.Cookie

Types

type State

type State struct {
	Token       TokenInfo `msgpack:"tok,omitempty"`
	SessionID   string    `msgpack:"sid,omitempty"`
	ClusterID   string    `msgpack:"cl,omitempty"`
	RedirectURL string    `msgpack:"red,omitempty"`
}

State is the data stored on the clientside as a browser cookie. To be independent of the OIDC token sizes, it only stores the absolute minimum information required for this particular backend implementation. Especially when lots of groups and claims are involved, the tokens can grow to a size larger than allowed by browsers for cookies, and even compression would only be a small adhesive strip, not a solution.

func (*State) Encode

func (s *State) Encode() ([]byte, error)

type TokenInfo

type TokenInfo struct {
	Subject string `msgpack:"sub,omitempty"`
	Issuer  string `msgpack:"iss,omitempty"`
}

Jump to

Keyboard shortcuts

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