Closed Tyrrrz closed 2 weeks ago
:warning: Please install the to ensure uploads and comments are reliably processed by Codecov.
Attention: Patch coverage is 81.81818%
with 2 lines
in your changes missing coverage. Please review.
Project coverage is 73.97%. Comparing base (
cb71a15
) to head (0db7b64
).
Files | Patch % | Lines |
---|---|---|
Src/Fido2.Models/Converters/FidoEnumConverter.cs | 81.81% | 1 Missing and 1 partial :warning: |
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I had previously removed the relaxed parsing behaviors from this type, and believe they should remain strict. As a security critical library, we should continue to prioritize conformance with the specification over convenience.
Currently,
FidoEnumConverter
works in the following way:EnumMemberAttribute
, then the provided custom name is used both for serialization and deserialization.This PR adds another fallback layer:
EnumMemberAttribute
, but the default name is provided (not custom) then the deserialization would still succeed. Serialization will work the same regardless.In other words, it would correctly resolve
PublicKeyCredentialType.PublicKey
from bothpublic-key
, as well asPublicKey
.This makes it a bit easier for applications to use Fido2 types directly in their payloads without building their own converters, and without relying on the intricacies of Fido2 naming conventions.