Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3a310c2
WIP
tnotheis Sep 29, 2026
a82f6f9
fix: several fixes
tnotheis Sep 30, 2026
4144b49
test: extract single get message tests into separate file
tnotheis Oct 1, 2026
8fc21f1
test: fix step definition
tnotheis Oct 1, 2026
0d9de38
chore: fix formatting
tnotheis Oct 1, 2026
797813d
chore: fix naming
tnotheis Oct 1, 2026
bae2d11
chore: update package-lock
tnotheis Oct 1, 2026
109398e
test: make UserContextBaggageMiddlewareTests work
tnotheis Oct 1, 2026
e470d8f
refactor: migrate Tags module
tnotheis Oct 1, 2026
fa45155
refactor: migrate Challenges module
tnotheis Oct 1, 2026
b515912
test: delete accidentally added test
tnotheis Oct 1, 2026
12ffd63
refactor: migrate Announcements module
tnotheis Oct 1, 2026
1482e1a
refactor: migrate Tokens module
tnotheis Oct 1, 2026
b6e5a41
refactor: migrate Files module
tnotheis Oct 2, 2026
a522526
refactor: migrate Quotas and Devices modules
tnotheis Oct 2, 2026
66a8348
refactor: migrate Relationships modules
tnotheis Oct 2, 2026
be7b0cb
refactor: move http stuff into the Endpoint.cs file that's using it
tnotheis Oct 2, 2026
019d420
refactor: migrate Synchonization module
tnotheis Oct 2, 2026
0f85490
refactor: simplify naming
tnotheis Oct 2, 2026
4075a02
refactor: make tests match folder and namespace of corresponding source
tnotheis Oct 2, 2026
cdbf615
chore: remove stuff that was only there for migration
tnotheis Oct 2, 2026
51f7fea
chore: satisfy formatter
tnotheis Oct 2, 2026
cdf0817
fix: use ConcurrentQueue instead of IList in rabbitmq SubscriptionMan…
tnotheis Oct 2, 2026
3807e4b
chore: fix casing in folder names for linux
tnotheis Oct 2, 2026
d23181e
chore: cleanup
tnotheis Oct 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 1 addition & 6 deletions Applications/AdminApi/src/AdminApi/AdminApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,14 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\BuildingBlocks\src\BuildingBlocks.API\BuildingBlocks.API.csproj" />
<ProjectReference Include="..\..\..\..\Modules\Announcements\src\Announcements.Application\Announcements.Application.csproj" />
<ProjectReference Include="..\..\..\..\Modules\Announcements\src\Announcements.Infrastructure\Announcements.Infrastructure.csproj" />
<ProjectReference Include="..\..\..\..\Modules\Announcements\src\Announcements.Module\Announcements.Module.csproj" />
<ProjectReference Include="..\..\..\..\Modules\Challenges\src\Challenges.Application\Challenges.Application.csproj" />
<ProjectReference Include="..\..\..\..\Modules\Challenges\src\Challenges.Infrastructure\Challenges.Infrastructure.csproj" />
<ProjectReference Include="..\..\..\..\Modules\Challenges\src\Challenges.Module\Challenges.Module.csproj" />
<ProjectReference Include="..\..\..\..\Modules\Devices\src\Devices.Application\Devices.Application.csproj" />
<ProjectReference Include="..\..\..\..\Modules\Devices\src\Devices.Infrastructure\Devices.Infrastructure.csproj" />
<ProjectReference Include="..\..\..\..\Modules\Devices\src\Devices.Module\Devices.Module.csproj" />
<ProjectReference Include="..\..\..\..\Modules\Quotas\src\Quotas.Application\Quotas.Application.csproj" />
<ProjectReference Include="..\..\..\..\Modules\Devices\src\Devices.Infrastructure\Devices.Infrastructure.csproj" />
<ProjectReference Include="..\..\..\..\Modules\Quotas\src\Quotas.Infrastructure\Quotas.Infrastructure.csproj" />
<ProjectReference Include="..\..\..\..\Modules\Quotas\src\Quotas.Module\Quotas.Module.csproj" />
<ProjectReference Include="..\..\..\..\Modules\Tokens\src\Tokens.Application\Tokens.Application.csproj" />
<ProjectReference Include="..\..\..\..\Modules\Tokens\src\Tokens.Infrastructure\Tokens.Infrastructure.csproj" />
<ProjectReference Include="..\..\..\..\Modules\Tokens\src\Tokens.Module\Tokens.Module.csproj" />
<ProjectReference Include="..\AdminApi.Infrastructure.Database.Postgres\AdminApi.Infrastructure.Database.Postgres.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using Backbone.AdminApi.Versions;
using Backbone.BuildingBlocks.API.Mvc;
using Backbone.BuildingBlocks.API.Mvc.ControllerAttributes;
using Backbone.Modules.Announcements.Application.Announcements.Commands.CreateAnnouncement;
using Backbone.Modules.Announcements.Application.Announcements.Commands.DeleteAnnouncementById;
using Backbone.Modules.Announcements.Application.Announcements.DTOs;
using Backbone.Modules.Announcements.Application.Announcements.Queries.GetAnnouncementById;
using Backbone.Modules.Announcements.Application.Announcements.Queries.ListAnnouncements;
using Backbone.Modules.Announcements.Module.Features.Announcements.Shared;
using MediatR;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using CreateAnnouncement = Backbone.Modules.Announcements.Module.Features.Announcements.CreateAnnouncement;
using DeleteAnnouncementById = Backbone.Modules.Announcements.Module.Features.Announcements.DeleteAnnouncementById;
using GetAnnouncementById = Backbone.Modules.Announcements.Module.Features.Announcements.GetAnnouncementById;
using ListAnnouncements = Backbone.Modules.Announcements.Module.Features.Announcements.ListAnnouncements;

namespace Backbone.AdminApi.Controllers;

Expand All @@ -24,7 +24,7 @@ public AnnouncementsController(IMediator mediator) : base(mediator)
[HttpPost]
[ProducesResponseType(typeof(AnnouncementDTO), StatusCodes.Status201Created)]
[ProducesError(StatusCodes.Status400BadRequest)]
public async Task<IActionResult> CreateAnnouncement([FromBody] CreateAnnouncementCommand request, CancellationToken cancellationToken)
public async Task<IActionResult> CreateAnnouncement([FromBody] CreateAnnouncement.Command request, CancellationToken cancellationToken)
{
var response = await _mediator.Send(request, cancellationToken);
return Created(response);
Expand All @@ -36,7 +36,7 @@ public async Task<IActionResult> CreateAnnouncement([FromBody] CreateAnnouncemen
[ProducesError(StatusCodes.Status404NotFound)]
public async Task<IActionResult> DeleteAnnouncement(string id, CancellationToken cancellationToken)
{
await _mediator.Send(new DeleteAnnouncementByIdCommand { Id = id }, cancellationToken);
await _mediator.Send(new DeleteAnnouncementById.Command { Id = id }, cancellationToken);
return NoContent();
}

Expand All @@ -45,15 +45,15 @@ public async Task<IActionResult> DeleteAnnouncement(string id, CancellationToken
[ProducesError(StatusCodes.Status404NotFound)]
public async Task<IActionResult> GetAnnouncement(string id, CancellationToken cancellationToken)
{
var response = await _mediator.Send(new GetAnnouncementByIdQuery { Id = id }, cancellationToken);
var response = await _mediator.Send(new GetAnnouncementById.Query { Id = id }, cancellationToken);
return Ok(response);
}

[HttpGet]
[ProducesResponseType(typeof(ListAnnouncementsResponse), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ListAnnouncements.Response), StatusCodes.Status200OK)]
public async Task<IActionResult> ListAnnouncements(CancellationToken cancellationToken)
{
var response = await _mediator.Send(new ListAnnouncementsQuery(), cancellationToken);
var response = await _mediator.Send(new ListAnnouncements.Query(), cancellationToken);
return Ok(response);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
using Backbone.BuildingBlocks.API;
using Backbone.BuildingBlocks.API.Mvc;
using Backbone.BuildingBlocks.API.Mvc.ControllerAttributes;
using Backbone.Modules.Challenges.Application.Challenges.Commands.CreateChallenge;
using Backbone.Modules.Challenges.Application.Challenges.DTOs;
using Backbone.Modules.Challenges.Module.Features.Challenges.Shared;
using MediatR;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using CreateChallenge = Backbone.Modules.Challenges.Module.Features.Challenges.CreateChallenge;

namespace Backbone.AdminApi.Controllers;

Expand All @@ -24,7 +24,7 @@ public ChallengesController(IMediator mediator) : base(mediator)
[ProducesError(StatusCodes.Status400BadRequest)]
public async Task<IActionResult> Create(CancellationToken cancellationToken)
{
var response = await _mediator.Send(new CreateChallengeCommand(), cancellationToken);
var response = await _mediator.Send(new CreateChallenge.Command(), cancellationToken);
return CreatedAtAction(nameof(Create), new { id = response.Id }, response);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
using Backbone.BuildingBlocks.API;
using Backbone.BuildingBlocks.API.Mvc;
using Backbone.BuildingBlocks.API.Mvc.ControllerAttributes;
using Backbone.Modules.Devices.Application.Clients.Commands.ChangeClientSecret;
using Backbone.Modules.Devices.Application.Clients.Commands.CreateClient;
using Backbone.Modules.Devices.Application.Clients.Commands.DeleteClient;
using Backbone.Modules.Devices.Application.Clients.Commands.UpdateClient;
using Backbone.Modules.Devices.Application.Clients.DTOs;
using Backbone.Modules.Devices.Application.Clients.Queries.GetClient;
using Backbone.Modules.Devices.Module.Features.Clients.Shared;
using MediatR;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using ChangeClientSecret = Backbone.Modules.Devices.Module.Features.Clients.ChangeClientSecret;
using CreateClient = Backbone.Modules.Devices.Module.Features.Clients.CreateClient;
using DeleteClient = Backbone.Modules.Devices.Module.Features.Clients.DeleteClient;
using GetClient = Backbone.Modules.Devices.Module.Features.Clients.GetClient;
using UpdateClient = Backbone.Modules.Devices.Module.Features.Clients.UpdateClient;

namespace Backbone.AdminApi.Controllers;

Expand Down Expand Up @@ -51,35 +51,35 @@ public async Task<IActionResult> ListClients(CancellationToken cancellationToken
[ProducesError(StatusCodes.Status404NotFound)]
public async Task<IActionResult> GetClient([FromRoute] string id, CancellationToken cancellationToken)
{
var client = await _mediator.Send(new GetClientQuery { Id = id }, cancellationToken);
var client = await _mediator.Send(new GetClient.Query { Id = id }, cancellationToken);
return Ok(client);
}

[HttpPost]
[ProducesResponseType(typeof(HttpResponseEnvelopeResult<CreateClientResponse>), StatusCodes.Status200OK)]
public async Task<CreatedResult> CreateOAuthClients(CreateClientCommand command, CancellationToken cancellationToken)
[ProducesResponseType(typeof(HttpResponseEnvelopeResult<CreateClient.Response>), StatusCodes.Status200OK)]
public async Task<CreatedResult> CreateOAuthClients(CreateClient.Command command, CancellationToken cancellationToken)
{
var createdClient = await _mediator.Send(command, cancellationToken);
return Created(createdClient);
}

[HttpPatch("{clientId}/ChangeSecret")]
[ProducesResponseType(typeof(HttpResponseEnvelopeResult<ChangeClientSecretResponse>), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(HttpResponseEnvelopeResult<ChangeClientSecret.Response>), StatusCodes.Status200OK)]
[ProducesError(StatusCodes.Status404NotFound)]
[ProducesError(StatusCodes.Status400BadRequest)]
public async Task<IActionResult> ChangeClientSecret([FromRoute] string clientId, [FromBody] ChangeClientSecretRequest request, CancellationToken cancellationToken)
{
var changedClient = await _mediator.Send(new ChangeClientSecretCommand { ClientId = clientId, NewSecret = request.NewSecret }, cancellationToken);
var changedClient = await _mediator.Send(new ChangeClientSecret.Command { ClientId = clientId, NewSecret = request.NewSecret }, cancellationToken);
return Ok(changedClient);
}

[HttpPut("{clientId}")]
[ProducesResponseType(typeof(HttpResponseEnvelopeResult<UpdateClientResponse>), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(HttpResponseEnvelopeResult<UpdateClient.Response>), StatusCodes.Status200OK)]
[ProducesError(StatusCodes.Status404NotFound)]
[ProducesError(StatusCodes.Status400BadRequest)]
public async Task<IActionResult> UpdateClient([FromRoute] string clientId, [FromBody] UpdateClientRequest request, CancellationToken cancellationToken)
{
var updatedClient = await _mediator.Send(new UpdateClientCommand { ClientId = clientId, DefaultTier = request.DefaultTier, MaxIdentities = request.MaxIdentities }, cancellationToken);
var updatedClient = await _mediator.Send(new UpdateClient.Command { ClientId = clientId, DefaultTier = request.DefaultTier, MaxIdentities = request.MaxIdentities }, cancellationToken);
return Ok(updatedClient);
}

Expand All @@ -88,7 +88,7 @@ public async Task<IActionResult> UpdateClient([FromRoute] string clientId, [From
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<IActionResult> DeleteClient([FromRoute] string clientId, CancellationToken cancellationToken)
{
await _mediator.Send(new DeleteClientCommand { ClientId = clientId }, cancellationToken);
await _mediator.Send(new DeleteClient.Command { ClientId = clientId }, cancellationToken);
return NoContent();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
using Backbone.BuildingBlocks.API;
using Backbone.BuildingBlocks.API.Mvc;
using Backbone.BuildingBlocks.API.Mvc.ControllerAttributes;
using Backbone.Modules.Devices.Application.Devices.DTOs;
using Backbone.Modules.Devices.Application.DTOs;
using Backbone.Modules.Devices.Application.Identities.Commands.CreateIdentity;
using Backbone.Modules.Devices.Application.Identities.Commands.UpdateIdentity;
using Backbone.Modules.Devices.Application.Identities.Queries.GetDeletionProcessAsSupport;
using Backbone.Modules.Devices.Application.Identities.Queries.ListDeletionProcessesAsSupport;
using Backbone.Modules.Devices.Application.Identities.Queries.ListDeletionProcessesAuditLogs;
using Backbone.Modules.Quotas.Application.DTOs;
using Backbone.Modules.Quotas.Application.Identities.Commands.CreateQuotaForIdentity;
using Backbone.Modules.Quotas.Application.Identities.Commands.DeleteQuotaForIdentity;
using Backbone.Modules.Devices.Module.Features.Devices.Shared;
using Backbone.Modules.Devices.Module.Features.Shared;
using Backbone.Modules.Quotas.Domain.Aggregates.Identities;
using Backbone.Modules.Quotas.Module.Features.Shared;
using MediatR;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using GetIdentityQueryDevices = Backbone.Modules.Devices.Application.Identities.Queries.GetIdentity.GetIdentityQuery;
using GetIdentityQueryQuotas = Backbone.Modules.Quotas.Application.Identities.Queries.GetIdentity.GetIdentityQuery;
using CreateIdentity = Backbone.Modules.Devices.Module.Features.Identities.CreateIdentity;
using CreateQuotaForIdentity = Backbone.Modules.Quotas.Module.Features.Identities.CreateQuotaForIdentity;
using DeleteQuotaForIdentity = Backbone.Modules.Quotas.Module.Features.Identities.DeleteQuotaForIdentity;
using GetDeletionProcessAsSupport = Backbone.Modules.Devices.Module.Features.Identities.GetDeletionProcessAsSupport;
using GetIdentityQueryDevices = Backbone.Modules.Devices.Module.Features.Identities.GetIdentity.Query;
using GetIdentityQueryQuotas = Backbone.Modules.Quotas.Module.Features.Identities.GetIdentity.Query;
using ListDeletionProcessesAsSupport = Backbone.Modules.Devices.Module.Features.Identities.ListDeletionProcessesAsSupport;
using ListDeletionProcessesAuditLogs = Backbone.Modules.Devices.Module.Features.Identities.ListDeletionProcessesAuditLogs;
using UpdateIdentity = Backbone.Modules.Devices.Module.Features.Identities.UpdateIdentity;

namespace Backbone.AdminApi.Controllers;

Expand All @@ -37,7 +37,7 @@ public IdentitiesController(IMediator mediator) : base(mediator)
public async Task<CreatedResult> CreateIndividualQuota([FromRoute] string identityAddress, [FromBody] CreateQuotaForIdentityRequest request, CancellationToken cancellationToken)
{
var createdIndividualQuotaDTO =
await _mediator.Send(new CreateQuotaForIdentityCommand { IdentityAddress = identityAddress, MetricKey = request.MetricKey, Max = request.Max, Period = request.Period }, cancellationToken);
await _mediator.Send(new CreateQuotaForIdentity.Command { IdentityAddress = identityAddress, MetricKey = request.MetricKey, Max = request.Max, Period = request.Period }, cancellationToken);
return Created(createdIndividualQuotaDTO);
}

Expand All @@ -47,7 +47,7 @@ public async Task<CreatedResult> CreateIndividualQuota([FromRoute] string identi
[ProducesError(StatusCodes.Status400BadRequest)]
public async Task<IActionResult> DeleteIndividualQuota([FromRoute] string identityAddress, [FromRoute] string individualQuotaId, CancellationToken cancellationToken)
{
await _mediator.Send(new DeleteQuotaForIdentityCommand { IdentityAddress = identityAddress, IndividualQuotaId = individualQuotaId }, cancellationToken);
await _mediator.Send(new DeleteQuotaForIdentity.Command { IdentityAddress = identityAddress, IndividualQuotaId = individualQuotaId }, cancellationToken);
return NoContent();
}

Expand Down Expand Up @@ -80,17 +80,17 @@ public async Task<IActionResult> GetIdentityByAddress([FromRoute] string address
[ProducesError(StatusCodes.Status404NotFound)]
public async Task<IActionResult> UpdateIdentity([FromRoute] string identityAddress, [FromBody] UpdateIdentityRequest request, CancellationToken cancellationToken)
{
var command = new UpdateIdentityCommand { Address = identityAddress, TierId = request.TierId };
var command = new UpdateIdentity.Command { Address = identityAddress, TierId = request.TierId };
await _mediator.Send(command, cancellationToken);
return NoContent();
}

[HttpPost]
[ProducesResponseType(typeof(HttpResponseEnvelopeResult<CreateIdentityResponse>), StatusCodes.Status201Created)]
[ProducesResponseType(typeof(HttpResponseEnvelopeResult<CreateIdentity.Response>), StatusCodes.Status201Created)]
[ProducesError(StatusCodes.Status400BadRequest)]
public async Task<IActionResult> CreateIdentity(CreateIdentityRequest request, CancellationToken cancellationToken)
{
var command = new CreateIdentityCommand
var command = new CreateIdentity.Command
{
ClientId = request.ClientId,
DevicePassword = request.DevicePassword,
Expand All @@ -110,20 +110,20 @@ public async Task<IActionResult> CreateIdentity(CreateIdentityRequest request, C
}

[HttpGet("{identityAddress}/DeletionProcesses")]
[ProducesResponseType(typeof(HttpResponseEnvelopeResult<GetDeletionProcessesAsSupportResponse>), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(HttpResponseEnvelopeResult<ListDeletionProcessesAsSupport.Response>), StatusCodes.Status200OK)]
[ProducesError(StatusCodes.Status400BadRequest)]
public async Task<IActionResult> ListDeletionProcessesAsSupport([FromRoute] string identityAddress, CancellationToken cancellationToken)
{
var response = await _mediator.Send(new ListDeletionProcessesAsSupportQuery { IdentityAddress = identityAddress }, cancellationToken);
var response = await _mediator.Send(new ListDeletionProcessesAsSupport.Query { IdentityAddress = identityAddress }, cancellationToken);
return Ok(response);
}

[HttpGet("{identityAddress}/DeletionProcesses/AuditLogs")]
[ProducesResponseType(typeof(HttpResponseEnvelopeResult<ListDeletionProcessesAuditLogsResponse>), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(HttpResponseEnvelopeResult<ListDeletionProcessesAuditLogs.Response>), StatusCodes.Status200OK)]
[ProducesError(StatusCodes.Status400BadRequest)]
public async Task<IActionResult> ListDeletionProcessesAuditLogs([FromRoute] string identityAddress, CancellationToken cancellationToken)
{
var response = await _mediator.Send(new ListDeletionProcessesAuditLogsQuery { IdentityAddress = identityAddress }, cancellationToken);
var response = await _mediator.Send(new ListDeletionProcessesAuditLogs.Query { IdentityAddress = identityAddress }, cancellationToken);
return Ok(response);
}

Expand All @@ -132,7 +132,7 @@ public async Task<IActionResult> ListDeletionProcessesAuditLogs([FromRoute] stri
[ProducesError(StatusCodes.Status404NotFound)]
public async Task<IActionResult> GetDeletionProcessAsSupport([FromRoute] string identityAddress, [FromRoute] string deletionProcessId, CancellationToken cancellationToken)
{
var response = await _mediator.Send(new GetDeletionProcessAsSupportQuery { IdentityAddress = identityAddress, DeletionProcessId = deletionProcessId }, cancellationToken);
var response = await _mediator.Send(new GetDeletionProcessAsSupport.Query { IdentityAddress = identityAddress, DeletionProcessId = deletionProcessId }, cancellationToken);
return Ok(response);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using Backbone.BuildingBlocks.Application.Abstractions.Exceptions;
using Backbone.BuildingBlocks.Application.Extensions;
using Backbone.BuildingBlocks.Application.Pagination;
using Backbone.Modules.Devices.Application;
using Backbone.Modules.Devices.Module;
using MediatR;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
Expand Down
Loading
Loading