Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename AuthenticatorAttestationRawResponse.ResponseData to AttestationResponse #455

Merged
merged 1 commit into from
Nov 10, 2023
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
2 changes: 1 addition & 1 deletion Src/Fido2.Models/AuthenticatorAssertionRawResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class AuthenticatorAssertionRawResponse
[JsonPropertyName("extensions")]
public AuthenticationExtensionsClientOutputs Extensions { get; set; }

public class AssertionResponse
public sealed class AssertionResponse
{
[JsonConverter(typeof(Base64UrlConverter))]
[JsonPropertyName("authenticatorData")]
Expand Down
4 changes: 2 additions & 2 deletions Src/Fido2.Models/AuthenticatorAttestationRawResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ public sealed class AuthenticatorAttestationRawResponse
public PublicKeyCredentialType Type { get; set; } = PublicKeyCredentialType.PublicKey;

[JsonPropertyName("response")]
public ResponseData Response { get; set; }
public AttestationResponse Response { get; set; }

[JsonPropertyName("extensions")]
public AuthenticationExtensionsClientOutputs Extensions { get; set; }

public sealed class ResponseData
public sealed class AttestationResponse
{
[JsonConverter(typeof(Base64UrlConverter))]
[JsonPropertyName("attestationObject")]
Expand Down
2 changes: 1 addition & 1 deletion Test/Attestation/Apple.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public async Task TestApplePublicKeyMismatch()
Type = PublicKeyCredentialType.PublicKey,
Id = new byte[] { 0xf1, 0xd0 },
RawId = new byte[] { 0xf1, 0xd0 },
Response = new AuthenticatorAttestationRawResponse.ResponseData()
Response = new AuthenticatorAttestationRawResponse.AttestationResponse
{
AttestationObject = _attestationObject.Encode(),
ClientDataJson = clientDataJson,
Expand Down
34 changes: 17 additions & 17 deletions Test/AuthenticatorResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public async Task TestAuthenticatorOriginsAsync(string origin, string expectedOr
Type = PublicKeyCredentialType.PublicKey,
Id = new byte[] { 0xf1, 0xd0 },
RawId = new byte[] { 0xf1, 0xd0 },
Response = new AuthenticatorAttestationRawResponse.ResponseData()
Response = new AuthenticatorAttestationRawResponse.AttestationResponse
{
AttestationObject = new CborMap {
{ "fmt", "none" },
Expand Down Expand Up @@ -179,7 +179,7 @@ public void TestAuthenticatorOriginsFail(string origin, string expectedOrigin)
Type = PublicKeyCredentialType.PublicKey,
Id = new byte[] { 0xf1, 0xd0 },
RawId = new byte[] { 0xf1, 0xd0 },
Response = new AuthenticatorAttestationRawResponse.ResponseData
Response = new AuthenticatorAttestationRawResponse.AttestationResponse
{
AttestationObject = new CborMap {
{ "fmt", "none" },
Expand Down Expand Up @@ -248,7 +248,7 @@ public void TestAuthenticatorAttestationRawResponse()
Type = PublicKeyCredentialType.PublicKey,
Id = new byte[] { 0xf1, 0xd0 },
RawId = new byte[] { 0xf1, 0xd0 },
Response = new AuthenticatorAttestationRawResponse.ResponseData
Response = new AuthenticatorAttestationRawResponse.AttestationResponse
{
AttestationObject = new CborMap().Encode(),
ClientDataJson = clientDataJson
Expand Down Expand Up @@ -320,7 +320,7 @@ public void TestAuthenticatorAttestationResponseAttestationObjectNull(byte[] val
{
var rawResponse = new AuthenticatorAttestationRawResponse
{
Response = new AuthenticatorAttestationRawResponse.ResponseData()
Response = new AuthenticatorAttestationRawResponse.AttestationResponse
{
AttestationObject = value,
}
Expand All @@ -335,7 +335,7 @@ public void TestAuthenticatorAttestationObjectBadCBOR(byte[] value)
{
var rawResponse = new AuthenticatorAttestationRawResponse
{
Response = new AuthenticatorAttestationRawResponse.ResponseData
Response = new AuthenticatorAttestationRawResponse.AttestationResponse
{
AttestationObject = value,
}
Expand All @@ -361,7 +361,7 @@ public void TestAuthenticatorAttestationObjectMalformed(byte[] value)
{
var rawResponse = new AuthenticatorAttestationRawResponse
{
Response = new AuthenticatorAttestationRawResponse.ResponseData
Response = new AuthenticatorAttestationRawResponse.AttestationResponse
{
AttestationObject = value
}
Expand Down Expand Up @@ -390,7 +390,7 @@ public async Task TestAuthenticatorAttestationResponseInvalidType()
Type = PublicKeyCredentialType.PublicKey,
Id = new byte[] { 0xf1, 0xd0 },
RawId = new byte[] { 0xf1, 0xd0 },
Response = new AuthenticatorAttestationRawResponse.ResponseData()
Response = new AuthenticatorAttestationRawResponse.AttestationResponse
{
AttestationObject = new CborMap {
{ "fmt", "testing" },
Expand Down Expand Up @@ -462,7 +462,7 @@ public void TestAuthenticatorAttestationResponseInvalidRawId(byte[] value)
Type = PublicKeyCredentialType.PublicKey,
Id = value,
RawId = value,
Response = new AuthenticatorAttestationRawResponse.ResponseData
Response = new AuthenticatorAttestationRawResponse.AttestationResponse
{
AttestationObject = new CborMap {
{ "fmt", "testing" },
Expand Down Expand Up @@ -532,7 +532,7 @@ public async Task TestAuthenticatorAttestationResponseInvalidRawType()
Type = PublicKeyCredentialType.Invalid,
Id = new byte[] { 0xf1, 0xd0 },
RawId = new byte[] { 0xf1, 0xd0 },
Response = new AuthenticatorAttestationRawResponse.ResponseData()
Response = new AuthenticatorAttestationRawResponse.AttestationResponse
{
AttestationObject = new CborMap {
{ "fmt", "testing" },
Expand Down Expand Up @@ -609,7 +609,7 @@ public void TestAuthenticatorAttestationResponseRpidMismatch()
Type = PublicKeyCredentialType.PublicKey,
Id = new byte[] { 0xf1, 0xd0 },
RawId = new byte[] { 0xf1, 0xd0 },
Response = new AuthenticatorAttestationRawResponse.ResponseData()
Response = new AuthenticatorAttestationRawResponse.AttestationResponse
{
AttestationObject = new CborMap {
{ "fmt", "testing" },
Expand Down Expand Up @@ -687,7 +687,7 @@ public async Task TestAuthenticatorAttestationResponseNotUserPresentAsync()
Type = PublicKeyCredentialType.PublicKey,
Id = new byte[] { 0xf1, 0xd0 },
RawId = new byte[] { 0xf1, 0xd0 },
Response = new AuthenticatorAttestationRawResponse.ResponseData
Response = new AuthenticatorAttestationRawResponse.AttestationResponse
{
AttestationObject = new CborMap {
{ "fmt", "testing" },
Expand Down Expand Up @@ -767,7 +767,7 @@ public void TestAuthenticatorAttestationResponseBackupEligiblePolicyRequired()
Type = PublicKeyCredentialType.PublicKey,
Id = new byte[] { 0xf1, 0xd0 },
RawId = new byte[] { 0xf1, 0xd0 },
Response = new AuthenticatorAttestationRawResponse.ResponseData()
Response = new AuthenticatorAttestationRawResponse.AttestationResponse
{
AttestationObject = new CborMap {
{ "fmt", "testing" },
Expand Down Expand Up @@ -845,7 +845,7 @@ public void TestAuthenticatorAttestationResponseBackupEligiblePolicyDisallowed()
Type = PublicKeyCredentialType.PublicKey,
Id = new byte[] { 0xf1, 0xd0 },
RawId = new byte[] { 0xf1, 0xd0 },
Response = new AuthenticatorAttestationRawResponse.ResponseData()
Response = new AuthenticatorAttestationRawResponse.AttestationResponse
{
AttestationObject = new CborMap {
{ "fmt", "testing" },
Expand Down Expand Up @@ -923,7 +923,7 @@ public void TestAuthenticatorAttestationResponseNoAttestedCredentialData()
Type = PublicKeyCredentialType.PublicKey,
Id = new byte[] { 0xf1, 0xd0 },
RawId = new byte[] { 0xf1, 0xd0 },
Response = new AuthenticatorAttestationRawResponse.ResponseData
Response = new AuthenticatorAttestationRawResponse.AttestationResponse
{
AttestationObject = new CborMap {
{ "fmt", "testing" },
Expand Down Expand Up @@ -1001,7 +1001,7 @@ public void TestAuthenticatorAttestationResponseUnknownAttestationType()
Type = PublicKeyCredentialType.PublicKey,
Id = new byte[] { 0xf1, 0xd0 },
RawId = new byte[] { 0xf1, 0xd0 },
Response = new AuthenticatorAttestationRawResponse.ResponseData()
Response = new AuthenticatorAttestationRawResponse.AttestationResponse
{
AttestationObject = new CborMap {
{ "fmt", "testing" },
Expand Down Expand Up @@ -1079,7 +1079,7 @@ public void TestAuthenticatorAttestationResponseNotUniqueCredId()
Type = PublicKeyCredentialType.PublicKey,
Id = new byte[] { 0xf1, 0xd0 },
RawId = new byte[] { 0xf1, 0xd0 },
Response = new AuthenticatorAttestationRawResponse.ResponseData
Response = new AuthenticatorAttestationRawResponse.AttestationResponse
{
AttestationObject = new CborMap {
{ "fmt", "none" },
Expand Down Expand Up @@ -1156,7 +1156,7 @@ public void TestAuthenticatorAttestationResponseUVRequired()
Type = PublicKeyCredentialType.PublicKey,
Id = new byte[] { 0xf1, 0xd0 },
RawId = new byte[] { 0xf1, 0xd0 },
Response = new AuthenticatorAttestationRawResponse.ResponseData()
Response = new AuthenticatorAttestationRawResponse.AttestationResponse
{
AttestationObject = new CborMap {
{ "fmt", "none" },
Expand Down
2 changes: 1 addition & 1 deletion Test/Fido2Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public Attestation()
Type = PublicKeyCredentialType.PublicKey,
Id = new byte[] { 0xf1, 0xd0 },
RawId = new byte[] { 0xf1, 0xd0 },
Response = new AuthenticatorAttestationRawResponse.ResponseData()
Response = new AuthenticatorAttestationRawResponse.AttestationResponse
{
AttestationObject = _attestationObject.Encode(),
ClientDataJson = _clientDataJson,
Expand Down