passkey

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPasskeyNotFound              = auth.ErrPasskeyNotFound
	ErrPasskeyAlreadyExists         = auth.ErrPasskeyAlreadyExists
	ErrPasskeyRegistrationInvalid   = auth.ErrPasskeyRegistrationInvalid
	ErrPasskeyAuthenticationInvalid = auth.ErrPasskeyAuthenticationInvalid
	ErrCannotRemoveLastAuthMethod   = auth.ErrCannotRemoveLastAuthMethod
	ErrCannotRemoveLastAuthProvider = ErrCannotRemoveLastAuthMethod
)

Functions

This section is empty.

Types

type Config

type Config struct {
	RPDisplayName string
	RPID          string
	RPOrigins     []string
	Store         *store.Store
	Tx            *tx.Manager
	ChallengeTTL  time.Duration
	Logger        *slog.Logger
}

type OptionsResponse

type OptionsResponse struct {
	ChallengeID string          `json:"challenge_id"`
	Options     json.RawMessage `json:"options"`
}

type RegistrationMetadata

type RegistrationMetadata struct {
	Name         string
	UserAgent    string
	PlatformHint string
}

type Service

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

func New

func New(cfg Config) (*Service, error)

func (*Service) BeginLogin

func (s *Service) BeginLogin(ctx context.Context) ([]byte, uuid.UUID, error)

func (*Service) BeginRegistration

func (s *Service) BeginRegistration(ctx context.Context, userID uuid.UUID) ([]byte, uuid.UUID, error)

func (*Service) DeletePasskey

func (s *Service) DeletePasskey(ctx context.Context, userID uuid.UUID, passkeyID uuid.UUID) error

func (*Service) FinishLogin

func (s *Service) FinishLogin(
	ctx context.Context,
	challengeID uuid.UUID,
	assertionResponseJSON []byte,
	now time.Time,
) (domain.User, error)

func (*Service) FinishRegistration

func (s *Service) FinishRegistration(
	ctx context.Context,
	userID uuid.UUID,
	challengeID uuid.UUID,
	credentialResponseJSON []byte,
	metadata RegistrationMetadata,
) error

func (*Service) ListUserPasskeys

func (s *Service) ListUserPasskeys(ctx context.Context, userID uuid.UUID) ([]domain.Passkey, error)

Jump to

Keyboard shortcuts

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