Versions in this module Expand all Collapse all v0 v0.3.0 Apr 5, 2020 Changes in this version + var ErrInvalidBrowserState = fmt.Errorf(`%w: browser state is invalid, not found or expired`, oidc.ErrInvalidRequest) + type BrowserState struct + Id string + New bool + OldHash string + Sessions []*Session + func MustBrowserState(ctx context.Context) *BrowserState + func (b *BrowserState) AddSession(s *Session) + func (b *BrowserState) Expired() bool + func (b *BrowserState) Expiry() time.Time + func (b *BrowserState) Hash() string + func (b *BrowserState) Sanitize() + func (b *BrowserState) ToLite() *BrowserStateLite + type BrowserStateController struct + CookieDomain string + CookieSecure bool + Logger *zerolog.Logger + Storage BrowserStateStorage + func (c *BrowserStateController) BrowserStateDefault(handlerFunc http.HandlerFunc) http.HandlerFunc + func (c *BrowserStateController) BrowserStateRequired(handlerFunc http.HandlerFunc) http.HandlerFunc + func (c *BrowserStateController) FlushBrowserState(ctx context.Context, rw http.ResponseWriter) + type BrowserStateKey struct + type BrowserStateLite struct + Id string + Sessions []string + type BrowserStateStorage interface + Get func(ctx context.Context, id string) (*BrowserState, error) + Save func(ctx context.Context, bs *BrowserState) error + func MemoryBrowserStateStorage() BrowserStateStorage + type Consent struct + Expiry time.Time + GrantedScopes []oidc.Scope + Id string + Subject string + func (c *Consent) Expired() bool + func (c *Consent) MarshalJSON() ([]byte, error) + func (c *Consent) UnmarshalJSON(raw []byte) error + type ConsentStorage interface + GetBySubject func(ctx context.Context, subject string) []*Consent + Save func(ctx context.Context, consent *Consent) error + func MemoryConsentStorage() ConsentStorage + type RedisBrowserStateStorage struct + Client redis.UniversalClient + Logger *zerolog.Logger + func (s *RedisBrowserStateStorage) Get(_ context.Context, id string) (*BrowserState, error) + func (s *RedisBrowserStateStorage) Save(ctx context.Context, bs *BrowserState) error + type RedisConsentStorage struct + Client redis.UniversalClient + Logger *zerolog.Logger + func (s *RedisConsentStorage) GetBySubject(_ context.Context, subject string) []*Consent + func (s *RedisConsentStorage) Save(ctx context.Context, consent *Consent) error + type Session struct + AuthTime time.Time + Claims map[string]interface{} + Id string + Lifespan time.Duration + Subject string + UIData json.RawMessage + func (s *Session) ExceededMaxAge(age oidc.MaxAge) bool + func (s *Session) Expired() bool + func (s *Session) MarshalJSON() ([]byte, error) + func (s *Session) UnmarshalJSON(raw []byte) error