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.
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.
Click to show internal directories.
Click to hide internal directories.