passkey

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PatchMux

func PatchMux(
	mux *mux.Mux,
	sessionHandler SessionHandler,
	userHandler UserHandler,
	originUrl *url.URL,
	relyingParty *webauthn.RelyingParty,
	allowedCoseAlgorithms []int,
	options ...passkeyConfig.Option,
) error

Types

type SessionHandler

type SessionHandler interface {
	AddPublicKeyAuthenticationRequest(ctx context.Context, challenge []byte) error
	DeletePublicKeyAuthenticationRequest(ctx context.Context, challenge []byte) error
	HandleSuccessfulAuthentication(ctx context.Context, userId string) ([]*muxResponse.HeaderEntry, error)
}

type UserHandler

type UserHandler interface {
	GetPublicKeyCredential(ctx context.Context, credentialId []byte) (*types.SigningData, error)
	AddPublicKeyCredential(ctx context.Context, userId string, credential *webauthn.AttestationPublicKeyCredential) error
	UpdatePublicKeyCredential(ctx context.Context, credentialId []byte, signatureCount uint32) error
	AddRegistrationIssuance(ctx context.Context, userId string, challenge []byte) error
	DeleteRegistrationIssuance(ctx context.Context, challenge []byte) (string, error)
	// TODO: Maybe this should return an error as well?
	GenerateUserId(ctx context.Context) string
	AddUser(ctx context.Context, userId string, emailAddress string) error
}

Jump to

Keyboard shortcuts

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