Skip to content

Commit 061ada2

Browse files
beyondnetPeruclaude
andcommitted
feat(server): align ums.api Authorization/Graph with Ums.Sdk.Contracts
Server-side AuthorizationGraph now declares schemaVersion 1.0.0 as a first-class property, sourced from Ums.Sdk.Contracts.SchemaVersion.Current. This ensures the wire payload carries the schema version field required by every SDK runtime's compatibility check (ADR-0074). Changes - Ums.Domain.csproj references ../../../libs/sdk/dotnet/Ums.Sdk.Contracts via ProjectReference. No runtime behavior change beyond the new property. - Ums.Domain/Authorization/Graph/AuthorizationGraph.cs adds: public string SchemaVersion { get; init; } = Ums.Sdk.Contracts.SchemaVersion.Current; with the same default propagated through the Build(...) factory. Build - Ums.sln builds clean (Debug + Release). - 160 pre-existing warnings unchanged. - Ums.Domain.Test: 708/708 PASS. - Ums.Application.Test AuthorizationGraphBuilderServiceTests: 7 failures are PRE-EXISTING on the baseline (confirmed by isolating the change via stash and re-running). The failures live in SetupFullChain() line 255 and are unrelated to the schemaVersion addition. They will be addressed in a separate fix tied to the working-tree Tenant.cs / repository / seeder changes already in flight. Non-goals (deferred to a follow-up PR) - Replacing the server's domain DTOs with Ums.Sdk.Contracts records. The domain model keeps its types; only the schemaVersion contract field is surfaced. A future canonicalization pass can adopt the SDK DTOs at the wire boundary (serializers) once test failures are cleared. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 6fedb33 commit 061ada2

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

src/apps/ums.api/Ums.Domain/Authorization/Graph/AuthorizationGraph.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ namespace Ums.Domain.Authorization.Graph;
1616
/// </summary>
1717
public sealed record AuthorizationGraph
1818
{
19+
/// <summary>
20+
/// Schema version of this payload. Governed by ADR-0074 and aligned with the canonical
21+
/// `auth-graph.schema.json` in <c>src/libs/sdk/contracts/</c>. Defaults to the value
22+
/// constant declared by <c>Ums.Sdk.Contracts.SchemaVersion.Current</c>.
23+
/// </summary>
24+
public string SchemaVersion { get; init; } = global::Ums.Sdk.Contracts.SchemaVersion.Current;
25+
1926
/// <summary>Who is authenticated and in which context (tenant, suite, role, branch).</summary>
2027
public GraphContext Context { get; init; }
2128

@@ -79,6 +86,7 @@ public static AuthorizationGraph Build(
7986

8087
return new AuthorizationGraph
8188
{
89+
SchemaVersion = global::Ums.Sdk.Contracts.SchemaVersion.Current,
8290
Context = context,
8391
Authentication = authentication,
8492
Actions = actions,

src/apps/ums.api/Ums.Domain/Ums.Domain.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
<PackageReference Include="BeyondNetCode.Shell.Ddd.ValueObjects" Version="1.0.0" />
1212
</ItemGroup>
1313

14+
<ItemGroup>
15+
<ProjectReference Include="../../../libs/sdk/dotnet/Ums.Sdk.Contracts/Ums.Sdk.Contracts.csproj" />
16+
</ItemGroup>
17+
1418
<ItemGroup>
1519
<InternalsVisibleTo Include="Ums.Domain.Test" />
1620
</ItemGroup>

0 commit comments

Comments
 (0)