passkey

package
v0.1.23 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: MIT Imports: 19 Imported by: 0

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