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

passkeytest

package
v1.30.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package passkeytest is a software WebAuthn authenticator for passkey integration tests: it answers real registration and assertion ceremonies with a P-256 key, so tests exercise the production ceremony code paths.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UserHandle

func UserHandle(t testing.TB, id any) []byte

UserHandle decodes the user entity id of a creation ceremony, whether it is still the in-process byte form or the base64url string a JSON round trip made it.

Types

type Authenticator

type Authenticator struct {
	Key            *ecdsa.PrivateKey
	CredentialID   []byte
	UserHandle     []byte
	Origin         string
	UserVerified   bool
	BackupEligible bool
	BackupState    bool
}

Authenticator is one resident (discoverable) credential. The flag fields are applied to every response it produces; defaults model a synced platform passkey with user verification.

func New

func New(t testing.TB, origin string) *Authenticator

func (*Authenticator) Assert

func (a *Authenticator) Assert(t testing.TB, assertion *protocol.CredentialAssertion, signCount uint32) []byte

Assert answers an in-process assertion ceremony.

func (*Authenticator) Assertion

func (a *Authenticator) Assertion(t testing.TB, rpID, challenge string, signCount uint32) []byte

Assertion signs a discoverable assertion for the ceremony parameters with the given signature counter (0 models a synced passkey).

func (*Authenticator) Attestation

func (a *Authenticator) Attestation(t testing.TB, rpID string, userHandle []byte, challenge string) []byte

Attestation builds a `none`-format registration response for the ceremony parameters, binding the credential to userHandle.

func (*Authenticator) Register

func (a *Authenticator) Register(t testing.TB, creation *protocol.CredentialCreation) []byte

Register answers an in-process creation ceremony.

Jump to

Keyboard shortcuts

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