generated from nventive/Template
-
Notifications
You must be signed in to change notification settings - Fork 10
chore: Cleanup Access Layer #448
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
37 changes: 0 additions & 37 deletions
37
src/app/ApplicationTemplate.Access/ApiClients/Authentication/AuthenticationData.cs
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
src/app/ApplicationTemplate.Access/ApiClients/Authentication/AuthenticationToken.cs
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
src/app/ApplicationTemplate.Access/ApiClients/Authentication/Data/AuthenticationData.cs
This file contains hidden or 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; | ||
using System.Text.Json.Serialization; | ||
using MallardMessageHandlers; | ||
|
||
namespace ApplicationTemplate.DataAccess; | ||
|
||
public sealed class AuthenticationData : IAuthenticationToken | ||
{ | ||
[JsonPropertyName("access_token")] | ||
[JsonConverter(typeof(JwtDataJsonConverter<AuthenticationToken>))] | ||
public JwtData<AuthenticationToken> AccessToken { get; init; } | ||
|
||
[JsonPropertyName("refresh_token")] | ||
public string RefreshToken { get; init; } | ||
|
||
[JsonIgnore] | ||
string IAuthenticationToken.AccessToken => AccessToken?.Token; | ||
|
||
[JsonIgnore] | ||
public bool CanBeRefreshed => !string.IsNullOrEmpty(RefreshToken); | ||
|
||
[JsonIgnore] | ||
public string Email => AccessToken?.Payload?.Email; | ||
|
||
[JsonIgnore] | ||
public DateTimeOffset? Expiration => AccessToken?.Payload?.Expiration; | ||
} |
18 changes: 18 additions & 0 deletions
18
src/app/ApplicationTemplate.Access/ApiClients/Authentication/Data/AuthenticationToken.cs
This file contains hidden or 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,18 @@ | ||
using System; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace ApplicationTemplate.DataAccess; | ||
|
||
public sealed class AuthenticationToken | ||
{ | ||
[JsonPropertyName("unique_name")] | ||
public string Email { get; init; } | ||
|
||
[JsonPropertyName("exp")] | ||
[JsonConverter(typeof(UnixTimestampJsonConverter))] | ||
public DateTimeOffset Expiration { get; init; } | ||
|
||
[JsonPropertyName("iat")] | ||
[JsonConverter(typeof(UnixTimestampJsonConverter))] | ||
public DateTimeOffset IssuedAt { get; init; } | ||
} |
5 changes: 1 addition & 4 deletions
5
src/app/ApplicationTemplate.Access/ApiClients/Authentication/IAuthenticationApiClient.cs
This file contains hidden or 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
5 changes: 5 additions & 0 deletions
5
src/app/ApplicationTemplate.Access/ApiClients/Posts/Data/ErrorData.cs
This file contains hidden or 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,5 @@ | ||
namespace ApplicationTemplate.DataAccess; | ||
|
||
public sealed class ErrorData | ||
{ | ||
} |
7 changes: 2 additions & 5 deletions
7
...plate.Access/ApiClients/Posts/PostData.cs → ....Access/ApiClients/Posts/Data/PostData.cs
This file contains hidden or 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
8 changes: 8 additions & 0 deletions
8
src/app/ApplicationTemplate.Access/ApiClients/Posts/Data/PostErrorResponse.cs
This file contains hidden or 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 ApplicationTemplate.DataAccess; | ||
|
||
public sealed class PostErrorResponse | ||
{ | ||
public PostData Data { get; } | ||
|
||
public ErrorData Error { get; } | ||
} |
9 changes: 0 additions & 9 deletions
9
src/app/ApplicationTemplate.Access/ApiClients/Posts/ErrorData.cs
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
12 changes: 0 additions & 12 deletions
12
src/app/ApplicationTemplate.Access/ApiClients/Posts/PostErrorResponse.cs
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
src/app/ApplicationTemplate.Access/ApiClients/Posts/PostRepositoryException.cs
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
src/app/ApplicationTemplate.Access/ApiClients/Posts/PostsApiClientException.cs
This file contains hidden or 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,24 @@ | ||
using System; | ||
|
||
namespace ApplicationTemplate.DataAccess; | ||
|
||
public sealed class PostsApiClientException : Exception | ||
{ | ||
public PostsApiClientException() | ||
{ | ||
} | ||
|
||
public PostsApiClientException(string message) | ||
: base(message) | ||
{ | ||
} | ||
|
||
public PostsApiClientException(string message, Exception innerException) | ||
: base(message, innerException) | ||
{ | ||
} | ||
|
||
public PostsApiClientException(PostErrorResponse errorResponse) | ||
{ | ||
} | ||
} |
File renamed without changes.
9 changes: 3 additions & 6 deletions
9
...s/ApiClients/Posts/PostsRepositoryMock.cs → ...ss/ApiClients/Posts/PostsApiClientMock.cs
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.