-
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.
- Loading branch information
Showing
35 changed files
with
293 additions
and
113 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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<ItemGroup> | ||
<ProjectReference Include="..\BuildingBlocks\src\BuildingBlocks.SDK\BuildingBlocks.SDK.csproj" /> | ||
<ProjectReference Include="..\BuildingBlocks\src\Crypto\Crypto.csproj" /> | ||
<ProjectReference Include="..\BuildingBlocks\src\Tooling\Tooling.csproj" /> | ||
</ItemGroup> | ||
</Project> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using Backbone.AdminApi.Sdk.Endpoints.Challenges.Types; | ||
using Backbone.BuildingBlocks.SDK.Endpoints.Common; | ||
using Backbone.BuildingBlocks.SDK.Endpoints.Common.Types; | ||
|
||
namespace Backbone.AdminApi.Sdk.Endpoints.Challenges; | ||
|
||
public class ChallengesEndpoint(EndpointClient client) : Endpoint(client) | ||
{ | ||
public async Task<ApiResponse<Challenge>> CreateChallenge() | ||
{ | ||
return await _client.Post<Challenge>("Challenges"); | ||
} | ||
} |
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 Backbone.AdminApi.Sdk.Endpoints.Challenges.Types; | ||
|
||
public class Challenge | ||
{ | ||
public required string Id { get; set; } | ||
public required DateTime ExpiresAt { get; set; } | ||
public string? CreatedBy { get; set; } | ||
public string? CreatedByDevice { get; set; } | ||
} |
19 changes: 19 additions & 0 deletions
19
AdminApi.Sdk/Endpoints/Challenges/Types/SignedChallenge.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 Backbone.BuildingBlocks.SDK.Crypto; | ||
using Backbone.Crypto; | ||
using Newtonsoft.Json; | ||
|
||
namespace Backbone.AdminApi.Sdk.Endpoints.Challenges.Types; | ||
|
||
public class SignedChallenge | ||
{ | ||
public SignedChallenge(string challenge, ConvertibleString signature) | ||
{ | ||
Challenge = challenge; | ||
Signature = ConvertibleString.FromUtf8( | ||
JsonConvert.SerializeObject(new CryptoSignatureSignedChallenge { alg = CryptoHashAlgorithm.SHA512, sig = signature.BytesRepresentation } | ||
)).Base64Representation; | ||
} | ||
|
||
public string Challenge { get; internal set; } | ||
public string Signature { get; internal 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
15 changes: 15 additions & 0 deletions
15
AdminApi.Sdk/Endpoints/Identities/Types/IdentityOverview.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,15 @@ | ||
using Backbone.AdminApi.Sdk.Endpoints.Tiers.Types; | ||
|
||
namespace Backbone.AdminApi.Sdk.Endpoints.Identities.Types; | ||
|
||
public class IdentityOverview | ||
{ | ||
public required string Address { get; set; } | ||
public required DateTime CreatedAt { get; set; } | ||
public DateTime? LastLoginAt { get; set; } | ||
public string? CreatedWithClient { get; set; } | ||
public int? DatawalletVersion { get; set; } | ||
public required byte IdentityVersion { get; set; } | ||
public Tier? Tier { get; set; } | ||
public int? NumberOfDevices { 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
5 changes: 5 additions & 0 deletions
5
AdminApi.Sdk/Endpoints/Identities/Types/Responses/ListIdentitiesResponse.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,5 @@ | ||
using Backbone.BuildingBlocks.SDK.Endpoints.Common.Types; | ||
|
||
namespace Backbone.AdminApi.Sdk.Endpoints.Identities.Types.Responses; | ||
|
||
public class ListIdentitiesResponse : EnumerableResponseBase<IdentityOverview>; |
2 changes: 2 additions & 0 deletions
2
AdminApi/src/AdminApi/Controllers/OData/IdentitiesController.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
6 changes: 5 additions & 1 deletion
6
BuildingBlocks/src/BuildingBlocks.SDK/BuildingBlocks.SDK.csproj
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="FluentAssertions" Version="6.12.0" /> | ||
<PackageReference Include="Newtonsoft.Json.Schema" Version="3.0.15" /> | ||
<PackageReference Include="NJsonSchema.NewtonsoftJson" Version="11.0.0" /> | ||
</ItemGroup> | ||
</Project> |
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
10 changes: 10 additions & 0 deletions
10
BuildingBlocks/src/BuildingBlocks.SDK/Endpoints/Common/Types/ODataResponse.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,10 @@ | ||
using System.Net; | ||
|
||
namespace Backbone.BuildingBlocks.SDK.Endpoints.Common.Types; | ||
|
||
public class ODataResponse<TResult> | ||
{ | ||
public TResult? Value { get; set; } | ||
|
||
public ApiResponse<TResult> ToApiResponse(HttpStatusCode status) => new() { Result = Value, Status = status }; | ||
} |
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
16 changes: 3 additions & 13 deletions
16
....Application/Identities/Commands/ApproveDeletionProcess/ApproveDeletionProcessResponse.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 |
---|---|---|
@@ -1,21 +1,11 @@ | ||
using Backbone.Modules.Devices.Application.DTOs; | ||
using Backbone.Modules.Devices.Domain.Entities.Identities; | ||
|
||
namespace Backbone.Modules.Devices.Application.Identities.Commands.ApproveDeletionProcess; | ||
|
||
public class ApproveDeletionProcessResponse | ||
public class ApproveDeletionProcessResponse : IdentityDeletionProcessOverviewDTO | ||
{ | ||
public ApproveDeletionProcessResponse(IdentityDeletionProcess deletionProcess) | ||
public ApproveDeletionProcessResponse(IdentityDeletionProcess deletionProcess) : base(deletionProcess) | ||
{ | ||
Id = deletionProcess.Id; | ||
Status = deletionProcess.Status; | ||
CreatedAt = deletionProcess.CreatedAt; | ||
ApprovedAt = deletionProcess.ApprovedAt ?? throw new Exception($"The '{nameof(IdentityDeletionProcess.ApprovedAt)}' property of the given deletion process must not be null."); | ||
ApprovedByDevice = deletionProcess.ApprovedByDevice ?? throw new Exception($"The '{nameof(IdentityDeletionProcess.ApprovedByDevice)}' property of the given deletion process must not be null."); | ||
} | ||
|
||
public string Id { get; } | ||
public DeletionProcessStatus Status { get; } | ||
public DateTime CreatedAt { get; } | ||
public DateTime ApprovedAt { get; } | ||
public string ApprovedByDevice { get; } | ||
} |
16 changes: 4 additions & 12 deletions
16
.../Identities/Commands/CancelDeletionProcessAsOwner/CancelDeletionProcessAsOwnerResponse.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 |
---|---|---|
@@ -1,19 +1,11 @@ | ||
using Backbone.Modules.Devices.Domain.Entities.Identities; | ||
using Backbone.Modules.Devices.Application.DTOs; | ||
using Backbone.Modules.Devices.Domain.Entities.Identities; | ||
|
||
namespace Backbone.Modules.Devices.Application.Identities.Commands.CancelDeletionProcessAsOwner; | ||
|
||
public class CancelDeletionProcessAsOwnerResponse | ||
public class CancelDeletionProcessAsOwnerResponse : IdentityDeletionProcessOverviewDTO | ||
{ | ||
public CancelDeletionProcessAsOwnerResponse(IdentityDeletionProcess deletionProcess) | ||
public CancelDeletionProcessAsOwnerResponse(IdentityDeletionProcess deletionProcess) : base(deletionProcess) | ||
{ | ||
Id = deletionProcess.Id; | ||
Status = deletionProcess.Status; | ||
CancelledAt = deletionProcess.CancelledAt ?? throw new Exception($"The '{nameof(IdentityDeletionProcess.CancelledAt)}' property of the given deletion process must not be null."); | ||
CancelledByDevice = deletionProcess.CancelledByDevice ?? throw new Exception($"The '{nameof(IdentityDeletionProcess.CancelledByDevice)}' property of the given deletion process must not be null."); | ||
} | ||
|
||
public string Id { get; } | ||
public DeletionProcessStatus Status { get; } | ||
public DateTime CancelledAt { get; } | ||
public string CancelledByDevice { 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
Oops, something went wrong.