Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions Src/Fido2.Models/Fido2Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,36 +126,38 @@ public IReadOnlySet<string> FullyQualifiedOrigins
/// </summary>
public CredentialBackupPolicy BackedUpCredentialPolicy { get; set; } = CredentialBackupPolicy.Allowed;

#if NET9_0_OR_GREATER
[JsonConverter(typeof(JsonStringEnumConverter<CredentialBackupPolicy>))]
#else
[JsonConverter(typeof(FidoEnumConverter<CredentialBackupPolicy>))]
#endif
public enum CredentialBackupPolicy
{
/// <summary>
/// This value indicates that the Relying Party requires backup eligible or backed up credentials.
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("required")]
#else
[EnumMember(Value = "required")]
#endif
[EnumMember(Value = "required")]
Required,

/// <summary>
/// This value indicates that the Relying Party allows backup eligible or backed up credentials.
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("allowed")]
#else
[EnumMember(Value = "allowed")]
#endif
[EnumMember(Value = "allowed")]
Allowed,

/// <summary>
/// This value indicates that the Relying Party does not allow backup eligible or backed up credentials.
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("disallowed")]
#else
[EnumMember(Value = "disallowed")]
#endif
[EnumMember(Value = "disallowed")]
Disallowed
}
}
39 changes: 13 additions & 26 deletions Src/Fido2.Models/Metadata/UserVerificationMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,116 +22,103 @@ public enum UserVerificationMethods
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("presence_internal")]
#else
[EnumMember(Value = "presence_internal")]
#endif
[EnumMember(Value = "presence_internal")]
PRESENCE_INTERNAL = 1,
/// <summary>
/// This flag must be set if the authenticator uses any type of measurement of a fingerprint for user verification.
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("fingerprint_internal")]
#else
[EnumMember(Value = "fingerprint_internal")]
#endif
[EnumMember(Value = "fingerprint_internal")]
FINGERPRINT_INTERNAL = 2,
/// <summary>
/// This flag must be set if the authenticator uses a local-only passcode (i.e. a passcode not known by the server) for user verification.
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("passcode_internal")]
#else
[EnumMember(Value = "passcode_internal")]
#endif
[EnumMember(Value = "passcode_internal")]
PASSCODE_INTERNAL = 4,
/// <summary>
/// This flag must be set if the authenticator uses a voiceprint (also known as speaker recognition) for user verification.
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("voiceprint_internal")]
#else
[EnumMember(Value = "voiceprint_internal")]
#endif
[EnumMember(Value = "voiceprint_internal")]
VOICEPRINT_INTERNAL = 8,
/// <summary>
/// This flag must be set if the authenticator uses any manner of face recognition to verify the user.
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("faceprint_internal")]
#else
[EnumMember(Value = "faceprint_internal")]
#endif
[EnumMember(Value = "faceprint_internal")]
FACEPRINT_INTERNAL = 0x10,
/// <summary>
/// This flag must be set if the authenticator uses any form of location sensor or measurement for user verification.
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("location_internal")]
#else
[EnumMember(Value = "location_internal")]
#endif
[EnumMember(Value = "location_internal")]
LOCATION_INTERNAL = 0x20,
/// <summary>
/// This flag must be set if the authenticator uses any form of eye biometrics for user verification.
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("eyeprint_internal")]
#else
[EnumMember(Value = "eyeprint_internal")]
#endif
[EnumMember(Value = "eyeprint_internal")]
EYEPRINT_INTERNAL = 0x40,
/// <summary>
/// This flag must be set if the authenticator uses a drawn pattern for user verification.
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("pattern_internal")]
#else
[EnumMember(Value = "pattern_internal")]
#endif
[EnumMember(Value = "pattern_internal")]
PATTERN_INTERNAL = 0x80,
/// <summary>
/// This flag must be set if the authenticator uses any measurement of a full hand (including palm-print, hand geometry or vein geometry) for user verification.
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("handprint_internal")]
#else
[EnumMember(Value = "handprint_internal")]
#endif
[EnumMember(Value = "handprint_internal")]
HANDPRINT_INTERNAL = 0x100,
/// <summary>
/// This flag must be set if the authenticator uses a local-only passcode (i.e. a passcode not known by the server) for user verification that might be gathered outside the authenticator boundary.
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("passcode_external")]
#else
[EnumMember(Value = "passcode_external")]
#endif
[EnumMember(Value = "passcode_external")]
PASSCODE_EXTERNAL = 0x800,
/// <summary>
/// This flag must be set if the authenticator uses a drawn pattern for user verification that might be gathered outside the authenticator boundary.
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("pattern_external")]
#else
[EnumMember(Value = "pattern_external")]
#endif
[EnumMember(Value = "pattern_external")]
PATTERN_EXTERNAL = 0x1000,
/// <summary>
/// This flag must be set if the authenticator will respond without any user interaction (e.g. Silent Authenticator).
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("none")]
#else
[EnumMember(Value = "none")]
#endif
[EnumMember(Value = "none")]
NONE = 0x200,
/// <summary>
/// If an authenticator sets multiple flags for user verification types, it may also set this flag to indicate that all verification methods will be enforced (e.g. faceprint AND voiceprint). If flags for multiple user verification methods are set and this flag is not set, verification with only one is necessary (e.g. fingerprint OR passcode).
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("all")]
#else
[EnumMember(Value = "all")]
#endif
[EnumMember(Value = "all")]
ALL = 0x400,
}
12 changes: 4 additions & 8 deletions Src/Fido2.Models/Objects/AttestationConveyancePreference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,38 +20,34 @@ public enum AttestationConveyancePreference
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("none")]
#else
[EnumMember(Value = "none")]
#endif
[EnumMember(Value = "none")]
None,

/// <summary>
/// This value indicates that the Relying Party prefers an attestation conveyance yielding verifiable attestation statements, but allows the client to decide how to obtain such attestation statements. The client MAY replace the authenticator-generated attestation statements with attestation statements generated by an Anonymization CA, in order to protect the user’s privacy, or to assist Relying Parties with attestation verification in a heterogeneous ecosystem.
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("indirect")]
#else
[EnumMember(Value = "indirect")]
#endif
[EnumMember(Value = "indirect")]
Indirect,

/// <summary>
/// This value indicates that the Relying Party wants to receive the attestation statement as generated by the authenticator.
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("direct")]
#else
[EnumMember(Value = "direct")]
#endif
[EnumMember(Value = "direct")]
Direct,

/// <summary>
/// This value indicates that the Relying Party wants to receive an attestation statement that may include uniquely identifying information.
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("enterprise")]
#else
[EnumMember(Value = "enterprise")]
#endif
[EnumMember(Value = "enterprise")]
Enterprise
}
21 changes: 7 additions & 14 deletions Src/Fido2.Models/Objects/AttestationStatementFormatIdentifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,69 +19,62 @@ public enum AttestationStatementFormatIdentifier
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("packed")]
#else
[EnumMember(Value = "packed")]
#endif
[EnumMember(Value = "packed")]
Packed,

/// <summary>
/// The "TPM" attestation statement format returns an attestation statement in the same format as the packed attestation statement format, although the rawData and signature fields are computed differently.
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("tpm")]
#else
[EnumMember(Value = "tpm")]
#endif
[EnumMember(Value = "tpm")]
Tpm,

/// <summary>
/// Platform authenticators on versions "N", and later, may provide this proprietary "hardware attestation" statement.
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("android-key")]
#else
[EnumMember(Value = "android-key")]
#endif
[EnumMember(Value = "android-key")]
AndroidKey,

/// <summary>
/// Android-based platform authenticators MAY produce an attestation statement based on the Android SafetyNet API.
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("android-safetynet")]
#else
[EnumMember(Value = "android-safetynet")]
#endif
[EnumMember(Value = "android-safetynet")]
AndroidSafetyNet,

/// <summary>
/// Used with FIDO U2F authenticators.
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("fido-u2f")]
#else
[EnumMember(Value = "fido-u2f")]
#endif
[EnumMember(Value = "fido-u2f")]
FidoU2f,

/// <summary>
/// Used with Apple devices' platform authenticators.
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("apple")]
#else
[EnumMember(Value = "apple")]
#endif
[EnumMember(Value = "apple")]
Apple,

/// <summary>
/// Used to replace any authenticator-provided attestation statement when a WebAuthn Relying Party indicates it does not wish to receive attestation information.
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("none")]
#else
[EnumMember(Value = "none")]
#endif
[EnumMember(Value = "none")]
None
}

6 changes: 2 additions & 4 deletions Src/Fido2.Models/Objects/AuthenticatorAttachment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,16 @@ public enum AuthenticatorAttachment
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("platform")]
#else
[EnumMember(Value = "platform")]
#endif
[EnumMember(Value = "platform")]
Platform,

/// <summary>
/// This value indicates cross-platform attachment.
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("cross-platform")]
#else
[EnumMember(Value = "cross-platform")]
#endif
[EnumMember(Value = "cross-platform")]
CrossPlatform
}
18 changes: 6 additions & 12 deletions Src/Fido2.Models/Objects/AuthenticatorTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,39 +23,35 @@ public enum AuthenticatorTransport
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("usb")]
#else
[EnumMember(Value = "usb")]
#endif
[EnumMember(Value = "usb")]
Usb,

/// <summary>
/// Indicates the respective authenticator can be contacted over Near Field Communication (NFC).
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("nfc")]
#else
[EnumMember(Value = "nfc")]
#endif
[EnumMember(Value = "nfc")]
Nfc,

/// <summary>
/// Indicates the respective authenticator can be contacted over Bluetooth Smart (Bluetooth Low Energy / BLE).
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("ble")]
#else
[EnumMember(Value = "ble")]
#endif
[EnumMember(Value = "ble")]
Ble,

/// <summary>
/// Indicates the respective authenticator can be contacted over over ISO/IEC 7816 smart card with contacts.
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("smart-card")]
#else
[EnumMember(Value = "smart-card")]
#endif
[EnumMember(Value = "smart-card")]
SmartCard,

/// <summary>
Expand All @@ -64,9 +60,8 @@ public enum AuthenticatorTransport
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("hybrid")]
#else
[EnumMember(Value = "hybrid")]
#endif
[EnumMember(Value = "hybrid")]
Hybrid,

/// <summary>
Expand All @@ -75,8 +70,7 @@ public enum AuthenticatorTransport
/// </summary>
#if NET9_0_OR_GREATER
[JsonStringEnumMemberName("internal")]
#else
[EnumMember(Value = "internal")]
#endif
[EnumMember(Value = "internal")]
Internal,
}
Loading
Loading