webauthn-swift icon indicating copy to clipboard operation
webauthn-swift copied to clipboard

Dedicated AAGUID Type

Open dimitribouniol opened this issue 1 year ago • 0 comments

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: AuthenticatorAttestationGloballyUniqueID is clearly more descriptive, though AAGUID is defined as a type alias. Similarly, the property names are now spelled out, but I kept aaguid for 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 extension AuthenticatorData) 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.

dimitribouniol avatar Mar 25 '24 12:03 dimitribouniol