webauthn-swift
webauthn-swift copied to clipboard
Dedicated AAGUID Type
As I was implementing the client, I found it useful to have a type for Authenticator Attestation Globally Unique IDs (AAGUIDs) since AAGUIDs are defined as 16-byte IDs, which prevents passing in the wrong-sized values. Internally, I have this wrapping a UUID since they are conceptually similar. Some questions before we consider merging this though:
- The name:
AuthenticatorAttestationGloballyUniqueIDis clearly more descriptive, thoughAAGUIDis defined as a type alias. Similarly, the property names are now spelled out, but I keptaaguidfor things like local variables. - Codable for this type falls back to the UUID representation (hex string with dashes), but I can see base64-urlencoded or straight hex as equally good alternatives. This is Codable because
AttestedCredentialData(and by extensionAuthenticatorData) are, but not sure they need to be since authenticator data is represented in a binary form.
As a follow-up, would love to extend this to other bag-of-byte types like CredentialID.