This commit extends the model with a "raw field" abstraction, which
allows parametrizing the fully-decoded model by whether some fields
contain the raw encoded data or not.
This makes a lot of things nicer:
We can now have a function that turns model types without the raw
fields into one that does, but doesn't do any other encoding.
We can generate well-behaved Arbitrary instances for the model without
the raw fields
The above two points combined let us generate test model types, encode
its raw fields, then verify it (which requires the raw fields)
As part of this, this commit also cleans up and fully implements the
decoding and encoding of such raw data fields, by creating new
Crypto.Fido2.Model.Binary.{Encoding,Decoding} modules, which contain
functions for encoding/decoding all binary fields of the model
Small model adjustments
When trying to do roundtrip tests for the model encoding, these updates
were necessary:
Make ccdCrossOrigin a required field. It not being set is the same as
the value False
Comment out arcTransports. It was not used, as the webauthn-json library
doesn't propagate that field
Fully implement Arbitrary instances for Model types
I updated the Binary.{Encoding,Decoding} modules to only export the functions that are necessary, and document them properly. Also added specs for the implementations as suggested
Raw model fields and full encoding support
This commit extends the model with a "raw field" abstraction, which allows parametrizing the fully-decoded model by whether some fields contain the raw encoded data or not.
This makes a lot of things nicer:
As part of this, this commit also cleans up and fully implements the decoding and encoding of such raw data fields, by creating new Crypto.Fido2.Model.Binary.{Encoding,Decoding} modules, which contain functions for encoding/decoding all binary fields of the model
Small model adjustments
When trying to do roundtrip tests for the model encoding, these updates were necessary:
Fully implement Arbitrary instances for Model types
Add test for model encoding roundtrips