aaguidgen

package
v1.0.0-dev.9 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package aaguidgen builds the webauthn package's authenticator name table from the community passkey AAGUID list at https://github.com/passkeydeveloper/passkey-authenticator-aaguids.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fetch

func Fetch(ctx context.Context, client *http.Client, url string) (io.ReadCloser, error)

Fetch requests url and returns the response body for Run to read. The caller closes it. Any status but 200 is an error.

func ReadCommit

func ReadCommit(path string) (string, error)

ReadCommit returns the value of the aaguidListCommit string constant declared in the Go file at path, refusing anything but a full lowercase commit hash.

func Run

func Run(in io.Reader, commit string, p Paths, report io.Writer) error

Run reads the list taken from commit from in, generates, and replaces p.Snapshot and then p.Out, each by rename so a reader never sees a partial file. Any input or validation error writes nothing. It prints the kept and covered extra entries to report.

func SourceURL

func SourceURL(commit string) string

SourceURL returns the raw aaguid.json at one commit of the community list.

Types

type Output

type Output struct {
	Table    []entry // the merged table, sorted by AAGUID
	Source   []byte  // gofmt'd webauthn/aaguids_gen.go
	Snapshot []byte  // name-only copy of the list, itself valid Generate input
	Kept     []entry // extra entries the list lacks, sorted by AAGUID
	Covered  []entry // extra entries the list now has, sorted by AAGUID
}

Output is everything one generation produces.

func Generate

func Generate(data []byte, commit string) (*Output, error)

Generate validates an aaguid.json document taken from commit of the community list and renders the table. It refuses a commit that is not a full lowercase hash, an empty or invalid-UTF-8 document, a key that is not a lowercase UUID, and an entry whose name is missing, empty, padded, unprintable or longer than 64 runes. Only the names are kept; every other field is dropped.

type Paths

type Paths struct{ Out, Snapshot string }

Paths names Run's two outputs.

Jump to

Keyboard shortcuts

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