session

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package session handles the login/register sessions of webauthn.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found in session store")

ErrNotFound happens when the session is not found in the store.

Functions

This section is empty.

Types

type Store

type Store interface {
	Save(ctx context.Context, session *webauthn.SessionData) error
	Get(ctx context.Context, userID []byte) (*webauthn.SessionData, error)
}

Store stores the login/registration session.

func NewInMemory

func NewInMemory() Store

NewInMemory instanciates a session store in memory.

type StoreInMemory

type StoreInMemory struct {
	// contains filtered or unexported fields
}

StoreInMemory stores the login/registration session in-memory.

In production, you should use a Redis or ETCD, or any distributed Key-Value database. Because of this, you cannot create replicas.

func (*StoreInMemory) Get

func (s *StoreInMemory) Get(_ context.Context, userID []byte) (*webauthn.SessionData, error)

Get the login or registration session.

func (*StoreInMemory) Save

func (s *StoreInMemory) Save(_ context.Context, session *webauthn.SessionData) error

Save the login or registration session.

Jump to

Keyboard shortcuts

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