refactor(thalos-bff): use identity contracts
This commit is contained in:
parent
3997d5d77e
commit
26c6e141c0
14
docs/architecture/bff-identity-boundary.md
Normal file
14
docs/architecture/bff-identity-boundary.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# Thalos BFF Identity Boundary
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
Keep thalos-bff as an edge adapter layer that consumes thalos-service and adopted identity capability contracts.
|
||||||
|
|
||||||
|
## BFF Responsibilities
|
||||||
|
- Edge contract handling
|
||||||
|
- Service client adaptation
|
||||||
|
- Correlation/tracing propagation
|
||||||
|
|
||||||
|
## Prohibited
|
||||||
|
- Direct DAL access
|
||||||
|
- Identity policy decision ownership
|
||||||
|
- Identity persistence concerns
|
||||||
13
docs/migration/building-block-identity-adoption-plan.md
Normal file
13
docs/migration/building-block-identity-adoption-plan.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# Building Block Identity Adoption Plan
|
||||||
|
|
||||||
|
## Goal
|
||||||
|
Align BFF contract usage with building-block-identity contract surface without changing behavior.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
1. Map current BFF identity contract types to capability contract types.
|
||||||
|
2. Keep compatibility bridge active during migration window.
|
||||||
|
3. Validate edge payload behavior and service compatibility.
|
||||||
|
|
||||||
|
## Guardrails
|
||||||
|
- BFF remains service-facing.
|
||||||
|
- No identity decision logic moves into BFF.
|
||||||
6
docs/migration/edge-compatibility-checks.md
Normal file
6
docs/migration/edge-compatibility-checks.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# Edge Compatibility Checks
|
||||||
|
|
||||||
|
## Checks
|
||||||
|
- Existing edge request/response behavior remains stable.
|
||||||
|
- Correlation and trace metadata pass-through remains stable.
|
||||||
|
- Service contract compatibility is preserved after identity contract adoption.
|
||||||
@ -1,6 +1,6 @@
|
|||||||
using Thalos.Bff.Application.Contracts;
|
|
||||||
using Thalos.Bff.Contracts.Api;
|
using Thalos.Bff.Contracts.Api;
|
||||||
using Thalos.Service.Identity.Abstractions.Contracts;
|
using BuildingBlock.Identity.Contracts.Requests;
|
||||||
|
using BuildingBlock.Identity.Contracts.Responses;
|
||||||
|
|
||||||
namespace Thalos.Bff.Application.Adapters;
|
namespace Thalos.Bff.Application.Adapters;
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
using Thalos.Bff.Application.Contracts;
|
using BuildingBlock.Identity.Contracts.Requests;
|
||||||
using Thalos.Service.Identity.Abstractions.Contracts;
|
using BuildingBlock.Identity.Contracts.Responses;
|
||||||
|
|
||||||
namespace Thalos.Bff.Application.Adapters;
|
namespace Thalos.Bff.Application.Adapters;
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
using Thalos.Bff.Application.Contracts;
|
|
||||||
using Thalos.Bff.Contracts.Api;
|
using Thalos.Bff.Contracts.Api;
|
||||||
using Thalos.Service.Identity.Abstractions.Contracts;
|
using BuildingBlock.Identity.Contracts.Requests;
|
||||||
|
using BuildingBlock.Identity.Contracts.Responses;
|
||||||
|
|
||||||
namespace Thalos.Bff.Application.Adapters;
|
namespace Thalos.Bff.Application.Adapters;
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +0,0 @@
|
|||||||
namespace Thalos.Bff.Application.Contracts;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Transport-neutral internal request contract for refresh session flow.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="RefreshToken">Refresh token value.</param>
|
|
||||||
/// <param name="CorrelationId">Request correlation identifier.</param>
|
|
||||||
public sealed record RefreshIdentitySessionRequest(string RefreshToken, string CorrelationId);
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
namespace Thalos.Bff.Application.Contracts;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Transport-neutral internal response contract for refresh session flow.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="Token">Refreshed token value.</param>
|
|
||||||
/// <param name="ExpiresInSeconds">Token expiration in seconds.</param>
|
|
||||||
public sealed record RefreshIdentitySessionResponse(string Token, int ExpiresInSeconds);
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
using Thalos.Service.Identity.Abstractions.Contracts;
|
using BuildingBlock.Identity.Contracts.Responses;
|
||||||
|
|
||||||
namespace Thalos.Bff.Application.Security;
|
namespace Thalos.Bff.Application.Security;
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using Thalos.Service.Identity.Abstractions.Contracts;
|
using BuildingBlock.Identity.Contracts.Responses;
|
||||||
|
|
||||||
namespace Thalos.Bff.Application.Security;
|
namespace Thalos.Bff.Application.Security;
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,6 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.0" />
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.0" />
|
||||||
<ProjectReference Include="..\Thalos.Bff.Contracts\Thalos.Bff.Contracts.csproj" />
|
<ProjectReference Include="..\Thalos.Bff.Contracts\Thalos.Bff.Contracts.csproj" />
|
||||||
<ProjectReference Include="..\..\..\thalos-service\src\Thalos.Service.Identity.Abstractions\Thalos.Service.Identity.Abstractions.csproj" />
|
<ProjectReference Include="..\..\..\building-block-identity\src\BuildingBlock.Identity.Contracts\BuildingBlock.Identity.Contracts.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -11,5 +11,5 @@ public sealed class ThalosBffPackageContract : IBlueprintPackageContract
|
|||||||
public BlueprintPackageDescriptor Descriptor { get; } = new(
|
public BlueprintPackageDescriptor Descriptor { get; } = new(
|
||||||
"Thalos.Bff.Contracts",
|
"Thalos.Bff.Contracts",
|
||||||
PackageVersionPolicy.Minor,
|
PackageVersionPolicy.Minor,
|
||||||
["Core.Blueprint.Common", "Thalos.Service.Identity.Abstractions"]);
|
["Core.Blueprint.Common", "BuildingBlock.Identity.Contracts"]);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
using Grpc.Core;
|
using Grpc.Core;
|
||||||
using Microsoft.Extensions.Primitives;
|
using Microsoft.Extensions.Primitives;
|
||||||
using Thalos.Bff.Application.Adapters;
|
using Thalos.Bff.Application.Adapters;
|
||||||
using Thalos.Bff.Application.Contracts;
|
|
||||||
using Thalos.Service.Grpc;
|
using Thalos.Service.Grpc;
|
||||||
using Thalos.Service.Identity.Abstractions.Contracts;
|
using BuildingBlock.Identity.Contracts.Requests;
|
||||||
|
using BuildingBlock.Identity.Contracts.Responses;
|
||||||
|
|
||||||
namespace Thalos.Bff.Rest.Adapters;
|
namespace Thalos.Bff.Rest.Adapters;
|
||||||
|
|
||||||
|
|||||||
@ -24,6 +24,6 @@ public class ContractShapeTests
|
|||||||
Assert.Equal("Thalos.Bff.Contracts", contract.Descriptor.PackageId);
|
Assert.Equal("Thalos.Bff.Contracts", contract.Descriptor.PackageId);
|
||||||
Assert.Equal(PackageVersionPolicy.Minor, contract.Descriptor.VersionPolicy);
|
Assert.Equal(PackageVersionPolicy.Minor, contract.Descriptor.VersionPolicy);
|
||||||
Assert.Contains("Core.Blueprint.Common", contract.Descriptor.DependencyPackageIds);
|
Assert.Contains("Core.Blueprint.Common", contract.Descriptor.DependencyPackageIds);
|
||||||
Assert.Contains("Thalos.Service.Identity.Abstractions", contract.Descriptor.DependencyPackageIds);
|
Assert.Contains("BuildingBlock.Identity.Contracts", contract.Descriptor.DependencyPackageIds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
using Thalos.Bff.Application.Contracts;
|
|
||||||
using Thalos.Bff.Application.Adapters;
|
using Thalos.Bff.Application.Adapters;
|
||||||
using Thalos.Bff.Application.Handlers;
|
using Thalos.Bff.Application.Handlers;
|
||||||
using Thalos.Bff.Application.Security;
|
using Thalos.Bff.Application.Security;
|
||||||
using Thalos.Bff.Contracts.Api;
|
using Thalos.Bff.Contracts.Api;
|
||||||
using Thalos.Service.Identity.Abstractions.Contracts;
|
using BuildingBlock.Identity.Contracts.Requests;
|
||||||
|
using BuildingBlock.Identity.Contracts.Responses;
|
||||||
|
|
||||||
namespace Thalos.Bff.Application.UnitTests;
|
namespace Thalos.Bff.Application.UnitTests;
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
using Thalos.Bff.Application.Adapters;
|
using Thalos.Bff.Application.Adapters;
|
||||||
using Thalos.Bff.Application.Contracts;
|
|
||||||
using Thalos.Bff.Application.Handlers;
|
using Thalos.Bff.Application.Handlers;
|
||||||
using Thalos.Bff.Contracts.Api;
|
using Thalos.Bff.Contracts.Api;
|
||||||
using Thalos.Service.Identity.Abstractions.Contracts;
|
using BuildingBlock.Identity.Contracts.Requests;
|
||||||
|
using BuildingBlock.Identity.Contracts.Responses;
|
||||||
|
|
||||||
namespace Thalos.Bff.Application.UnitTests;
|
namespace Thalos.Bff.Application.UnitTests;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user