Help us shape the future of Go! Take the 2026 Go Developer Survey

passkey

package
v0.1.0-alpha.9 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package passkey provides user-verified discoverable WebAuthn credentials.

Index

Constants

View Source
const ID = "passkey"
View Source
const Lifetime = 5 * time.Minute
View Source
const Method sigil.AuditMethod = "passkey"
View Source
const RegisterOperation plugin.Operation = "passkey.register"
View Source
const RemoveOperation plugin.Operation = "passkey.remove"

Variables

This section is empty.

Functions

func Contract

func Contract() plugin.Definition

func PruneExpired

func PruneExpired(ctx context.Context, store storage.Store, before time.Time, limit int) (int64, error)

PruneExpired bounds deletion of abandoned ceremonies. Hosts should run it alongside core retention cleanup; active credentials never expire here.

Types

type Ceremony

type Ceremony struct {
	ID          string `json:"id"`
	OptionsJSON string `json:"optionsJSON"`
}

type Config

type Config struct {
	// Store must be the same PostgreSQL store supplied to Auth.
	Store             storage.Store
	RPID, DisplayName string
	Origins           []string
}

type Credential

type Credential struct {
	ID             string `json:"id"`
	BackupEligible bool   `json:"backupEligible"`
	BackupState    bool   `json:"backupState"`
}

type Plugin

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

func New

func New(c Config) (*Plugin, error)

func (*Plugin) BeginLogin

func (p *Plugin) BeginLogin(ctx context.Context, ip netip.Addr) (Ceremony, error)

func (*Plugin) BeginRegistration

func (p *Plugin) BeginRegistration(ctx context.Context, ip netip.Addr) (Ceremony, error)

func (*Plugin) Bind

func (p *Plugin) Bind(a *sigil.Auth) error

func (*Plugin) Definition

func (p *Plugin) Definition() plugin.Definition

func (*Plugin) FinishLogin

func (p *Plugin) FinishLogin(ctx context.Context, ip netip.Addr, id string, response []byte) (sigil.IssuedSession, error)

func (*Plugin) FinishRegistration

func (p *Plugin) FinishRegistration(ctx context.Context, ip netip.Addr, id string, response []byte) error

func (*Plugin) List

func (p *Plugin) List(ctx context.Context) ([]Credential, error)

func (*Plugin) Remove

func (p *Plugin) Remove(ctx context.Context, ip netip.Addr, id string) error

Jump to

Keyboard shortcuts

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