-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
720 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.0.31903.59 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sdk.Tests", "Tests\Sdk.Tests\Sdk.Tests.csproj", "{F64C850E-9923-43F1-BC84-432AFBBA4425}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sdk", "src\Sdk\Sdk.csproj", "{A01503A8-6AB9-43A7-AC5A-4EAE091B07B6}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{F64C850E-9923-43F1-BC84-432AFBBA4425}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{F64C850E-9923-43F1-BC84-432AFBBA4425}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{F64C850E-9923-43F1-BC84-432AFBBA4425}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{F64C850E-9923-43F1-BC84-432AFBBA4425}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{A01503A8-6AB9-43A7-AC5A-4EAE091B07B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{A01503A8-6AB9-43A7-AC5A-4EAE091B07B6}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{A01503A8-6AB9-43A7-AC5A-4EAE091B07B6}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{A01503A8-6AB9-43A7-AC5A-4EAE091B07B6}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(NestedProjects) = preSolution | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using System.Text.Json; | ||
|
||
namespace Passwordless.Net.Helpers; | ||
|
||
internal static class Json | ||
{ | ||
public static readonly JsonSerializerOptions Options = new(JsonSerializerDefaults.Web); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace Passwordless.Net; | ||
|
||
public class AliasPointer | ||
{ | ||
public string UserId { get; set; } | ||
public string Alias { get; set; } | ||
public string Plaintext { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Passwordless.Net; | ||
|
||
public class AuditLog | ||
{ | ||
public DateTime Timestamp { get; set; } | ||
public string Level { get; set; } | ||
public string Message { get; set; } | ||
public string Details { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace Passwordless.Net; | ||
|
||
public class Credential | ||
{ | ||
public CredentialDescriptor Descriptor { get; set; } | ||
public byte[] PublicKey { get; set; } | ||
public byte[] UserHandle { get; set; } | ||
public uint SignatureCounter { get; set; } | ||
public string AttestationFmt { get; set; } | ||
public DateTime CreatedAt { get; set; } | ||
public Guid AaGuid { get; set; } | ||
public DateTime LastUsedAt { get; set; } | ||
public string RPID { get; set; } | ||
public string Origin { get; set; } | ||
public string Country { get; set; } | ||
public string Device { get; set; } | ||
public string Nickname { get; set; } | ||
public string UserId { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
using static Passwordless.Net.PasswordlessClient; | ||
|
||
namespace Passwordless.Net; | ||
|
||
public class CredentialDescriptor | ||
{ | ||
[JsonConverter(typeof(Base64UrlConverter))] | ||
public byte[] Id { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Passwordless.Net; | ||
|
||
public class NewAppOptions | ||
{ | ||
public string AppId { get; set; } = ""; | ||
public string AdminEmail { get; set; } = ""; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace Passwordless.Net; | ||
|
||
public class NewAppResponse | ||
{ | ||
public string Message { get; set; } | ||
public string ApiKey1 { get; set; } | ||
public string ApiKey2 { get; set; } | ||
public string ApiSecret1 { get; set; } | ||
public string ApiSecret2 { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace Passwordless.Net; | ||
|
||
public class PasswordlessUserSummary | ||
{ | ||
public string UserId { get; set; } | ||
public List<string> Aliases { get; set; } | ||
public int CredentialsCount { get; set; } | ||
public int AliasCount { get; set; } | ||
public DateTime LastUsedAt { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace Passwordless.Net; | ||
|
||
public class RegisterOptions | ||
{ | ||
public required string UserId { get; set; } | ||
public string? DisplayName { get; set; } | ||
public required string Username { get; set; } | ||
public string Attestation { get; set; } | ||
public string AuthenticatorType { get; set; } | ||
public bool Discoverable { get; set; } | ||
public string UserVerification { get; set; } | ||
public HashSet<string>? Aliases { get; set; } | ||
public bool AliasHashing { get; set; } | ||
|
||
public DateTime ExpiresAt { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace Passwordless.Net; | ||
|
||
public class UsersCount | ||
{ | ||
public int Count { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace Passwordless.Net; | ||
|
||
public class VerifiedUser | ||
{ | ||
public string UserId { get; set; } | ||
public byte[] CredentialId { get; set; } | ||
public bool Success { get; set; } | ||
public DateTime Timestamp { get; set; } | ||
public string RpId { get; set; } | ||
public string Origin { get; set; } | ||
public string Device { get; set; } | ||
public string Country { get; set; } | ||
public string Nickname { get; set; } | ||
public DateTime ExpiresAt { get; set; } | ||
public Guid TokenId { get; set; } | ||
public string Type { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Passwordless.Net; | ||
|
||
public sealed class PasswordlessApiException : HttpRequestException | ||
{ | ||
public ProblemDetails Details { get; } | ||
|
||
public PasswordlessApiException(ProblemDetails problemDetails) : base(problemDetails.Title) | ||
{ | ||
Details = problemDetails; | ||
} | ||
} | ||
|
||
public class ProblemDetails | ||
{ | ||
// TODO: Make immutable | ||
// TODO: Include errorCode as a property once it's more common | ||
public string Type { get; set; } = null!; | ||
public string Title { get; set; } = null!; | ||
public int Status { get; set; } | ||
public string? Detail { get; set; } | ||
public string? Instance { get; set; } | ||
|
||
[JsonExtensionData] | ||
public Dictionary<string, object?> Extensions { get; set; } | ||
} |
Oops, something went wrong.