Documentation
¶
Overview ¶
Package passkeys adds WebAuthn / passkey (FIDO2) authentication to the togo auth family — passwordless registration and login ceremonies, with the issued session coming from the togo auth plugin.
PASSKEYS_RP_ID=localhost PASSKEYS_RP_NAME="Fort" PASSKEYS_RP_ORIGINS=http://localhost:3000
Endpoints (mounted on the kernel router):
POST /api/auth/passkeys/register/begin POST /api/auth/passkeys/register/finish POST /api/auth/passkeys/login/begin POST /api/auth/passkeys/login/finish
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credential ¶
type Credential struct {
ID string `json:"id"` // base64url credential id
UserID string `json:"user_id"` // the owning user (email/id)
Name string `json:"name"` // display label
SignCount uint32 `json:"sign_count"`
CreatedAt time.Time `json:"created_at"`
// contains filtered or unexported fields
}
Credential is a stored passkey for a user.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the passkeys runtime stored on the kernel (k.Get("passkeys")).
func FromKernel ¶
FromKernel returns the passkeys Service.
func (*Service) CredentialsFor ¶
func (s *Service) CredentialsFor(userID string) []*Credential
CredentialsFor returns the stored passkeys for a user.
type Store ¶
type Store interface {
Add(c *Credential)
ByUser(userID string) []*Credential
Get(id string) (*Credential, bool)
UpdateSignCount(id string, count uint32)
Delete(id string) bool
}
Store is the credential persistence seam (swap for a DB-backed store).
Click to show internal directories.
Click to hide internal directories.