middleware

package
v1.0.8-fixed Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewScope

func NewScope(reverseProxy bool, idHeader string) alice.Constructor

Types

type StoredSessionLoader

type StoredSessionLoader struct {
	RemoteKeySet  *oidc.KeySet
	NeedsVerifier bool
	// contains filtered or unexported fields
}

storedSessionLoader is responsible for loading sessions from cookie identified sessions in the session store.

func NewStoredSessionLoader

func NewStoredSessionLoader(opts *StoredSessionLoaderOptions) (*StoredSessionLoader, alice.Constructor)

NewStoredSessionLoader creates a new StoredSessionLoader which loads sessions from the session store. If no session is found, the request will be passed to the nex handler. If a session was loader by a previous handler, it will not be replaced.

type StoredSessionLoaderOptions

type StoredSessionLoaderOptions struct {
	// Session storage backend
	SessionStore sessionsapi.SessionStore

	// How often should sessions be refreshed
	RefreshPeriod time.Duration

	// Provider based session refreshing
	RefreshSession func(context.Context, *sessionsapi.SessionState, wrapper.HttpClient, func(args ...interface{}), uint32) (bool, error)

	// Provider based session validation.
	// If the session is older than `RefreshPeriod` but the provider doesn't
	// refresh it, we must re-validate using this validation.
	ValidateSession func(context.Context, *sessionsapi.SessionState) bool

	// Refresh request parameters
	RefreshClient         wrapper.HttpClient
	RefreshRequestTimeout uint32
}

StoredSessionLoaderOptions contains all the requirements to construct a stored session loader. All options must be provided.

Jump to

Keyboard shortcuts

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