session

package
v0.0.0-...-8419e78 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultEncryptionKeyLength = 32
	WebauthnSession            = "webauthn-session"
)

Variables

View Source
var (
	ErrInsufficientBytesRead = errors.New("insufficient bytes read")
	ErrMarshal               = errors.New("error unmarshaling data")
)

Functions

func GenerateSecureKey

func GenerateSecureKey(n int) ([]byte, error)

Types

type Store

type Store struct {
	*sessions.CookieStore
}

Store is a wrapper around sessions.CookieStore which provides some helper methods related to webauthn operations and encrypted cookies.

func New

func New(keyPairs ...[]byte) (*Store, error)

func (*Store) GetWebauthnSession

func (store *Store) GetWebauthnSession(key string, r *http.Request) (webauthn.SessionData, error)

func (*Store) SaveWebauthnSession

func (store *Store) SaveWebauthnSession(key string, data *webauthn.SessionData, r *http.Request, w http.ResponseWriter) error

func (*Store) Set

func (store *Store) Set(key string, value interface{}, r *http.Request, w http.ResponseWriter) error

Jump to

Keyboard shortcuts

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