-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial CS to handle SIGNIFY_AUTHORIZE working, replying to Page with…
… faux credential
- Loading branch information
Showing
15 changed files
with
520 additions
and
171 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,28 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace KeriAuth.BrowserExtension.Models | ||
{ | ||
public record AuthorizeResult | ||
{ | ||
[JsonConstructor] | ||
public AuthorizeResult( | ||
Check warning on line 8 in KeriAuth.BrowserExtension/Models/AuthorizeResult.cs GitHub Actions / build
Check warning on line 8 in KeriAuth.BrowserExtension/Models/AuthorizeResult.cs GitHub Actions / build
|
||
AuthorizeResultCredential? arc, | ||
AuthorizeResultIdentifier? ari | ||
) | ||
{ | ||
if (arc is null && ari is null) | ||
{ | ||
throw new ArgumentException("Either arc or ari must be non-null"); | ||
} | ||
|
||
this.arc = arc; | ||
this.ari = ari; | ||
} | ||
|
||
[JsonPropertyName("credential")] | ||
public AuthorizeResultCredential arc { get; } | ||
|
||
[JsonPropertyName("identifier")] | ||
public AuthorizeResultIdentifier ari { get; } | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
KeriAuth.BrowserExtension/Models/AuthorizeResultCredential.cs
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,21 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace KeriAuth.BrowserExtension.Models | ||
{ | ||
public record AuthorizeResultCredential : IEquatable<AuthorizeResultCredential> | ||
{ | ||
[JsonConstructor] | ||
public AuthorizeResultCredential(string raw, string cesr) | ||
{ | ||
this.raw = raw; | ||
this.cesr = cesr; | ||
} | ||
|
||
[JsonPropertyName("raw")] | ||
public string raw { get; } | ||
|
||
|
||
[JsonPropertyName("cesr")] | ||
public string cesr { get; } | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
KeriAuth.BrowserExtension/Models/AuthorizeResultIdentifier.cs
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 @@ | ||
using System.Text.Json.Serialization; | ||
using KeriAuth.BrowserExtension.Models; | ||
|
||
namespace KeriAuth.BrowserExtension.Models | ||
{ | ||
public record AuthorizeResultIdentifier : IEquatable<AuthorizeResultIdentifier> | ||
{ | ||
[JsonConstructor] | ||
public AuthorizeResultIdentifier( | ||
string prefix | ||
) | ||
{ | ||
this.prefix = prefix; | ||
} | ||
|
||
[JsonPropertyName("prefix")] | ||
public string prefix { get; } | ||
} | ||
} |
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,42 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace KeriAuth.BrowserExtension.Models | ||
{ | ||
public record ReplyMessageData<T> | ||
{ | ||
[JsonConstructor] | ||
public ReplyMessageData( | ||
string type, | ||
T payload, | ||
string typeHint, | ||
string? requestId = null, | ||
string? error = null, | ||
string? source = null) | ||
{ | ||
this.type = type; | ||
this.payloadTypeName = typeof(T).Name; | ||
this.requestId = requestId; | ||
this.payload = payload; | ||
this.error = error; | ||
this.source = source; | ||
} | ||
|
||
[JsonPropertyName("type")] | ||
public string type { get; } | ||
|
||
[JsonPropertyName("payloadTypeName")] | ||
public string payloadTypeName { get; } | ||
|
||
[JsonPropertyName("requestId")] | ||
public string? requestId { get; } | ||
|
||
[JsonPropertyName("payload")] | ||
public T payload { get; } | ||
|
||
[JsonPropertyName("error")] | ||
public string? error { get; } | ||
|
||
[JsonPropertyName("source")] | ||
public string? source { get; } | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.