tokens

package
v0.0.0-...-da0a5c0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NONE       tokenState = 0
	REFRESHING tokenState = 1
	ACTIVE     tokenState = 2
)

Variables

View Source
var ErrNoSuchSession error = errors.New("no such session")
View Source
var ErrNoToken error = errors.New("session has no token")
View Source
var ErrRefreshTokenExpired error = errors.New("refresh token expired")

Functions

func WithAppRoot

func WithAppRoot(appRoot string) func(*phantomTokens)

func WithCookieName

func WithCookieName(name string) func(*phantomTokens)

func WithInsecureSkipVerify

func WithInsecureSkipVerify() func(*phantomTokens)

func WithLogger

func WithLogger(logger *slog.Logger) func(*phantomTokens)

func WithLoginLogoutEndpoints

func WithLoginLogoutEndpoints(loginEndpoint, logoutEndpoint string) func(*phantomTokens)

func WithProvider

func WithProvider(configURL, clientID, clientSecret string) func(*phantomTokens)

func WithSecretKey

func WithSecretKey(key []byte) func(*phantomTokens)

Types

type PhantomTokenExchange

type PhantomTokenExchange interface {
	Middleware() func(http.Handler) http.Handler
	InstallChiHandlers(r *chi.Mux)
	Shutdown()
}

func NewPhantomTokenExchange

func NewPhantomTokenExchange(opts ...func(*phantomTokens)) (PhantomTokenExchange, error)

Jump to

Keyboard shortcuts

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