Skip to content

Commit 9640d19

Browse files
merge pull request #20 from https-richardy/maintenance/codebase-alignment
merge pull request #20 from https-richardy/maintenance/codebase-alignment
2 parents dd6a64e + d2145f9 commit 9640d19

48 files changed

Lines changed: 99 additions & 99 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ MONGO_INITDB_ROOT_PASSWORD=admin
1111
COMANDA_MONGO_CONNECTIONSTRING=mongodb://admin:admin@localhost:27017/comanda?authSource=admin
1212
COMANDA_MONGO_DATABASENAME=comanda
1313

14-
COMANDA_FEDERATION_BASEURL=http://localhost:8080
14+
COMANDA_FEDERATION_AUTHORITY=http://localhost:8080
1515
COMANDA_FEDERATION_REALM=comanda
1616
COMANDA_FEDERATION_CLIENTID=client-identifier
1717
COMANDA_FEDERATION_CLIENTSECRET=client-secret

Boundaries/Comanda.Orchestrator/Source/Comanda.Orchestrator.Application/Comanda.Orchestrator.Application.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
<ItemGroup>
1010
<PackageReference Include="FluentValidation" Version="12.1.1" />
11-
<PackageReference Include="HttpsRichardy.Dispatcher" Version="1.0.2" />
12-
<PackageReference Include="HttpsRichardy.Federation.Sdk.Contracts" Version="1.0.2" />
11+
<PackageReference Include="HttpsRichardy.Dispatcher" Version="1.0.3" />
12+
<PackageReference Include="HttpsRichardy.Federation.Sdk.Contracts" Version="4.2.0" />
1313
<PackageReference Include="Comanda.Internal.Contracts" Version="1.0.8" />
1414
</ItemGroup>
1515

Boundaries/Comanda.Orchestrator/Source/Comanda.Orchestrator.CrossCutting/Configurations/FederationSettings.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ public sealed record FederationSettings
55
public string ClientId { get; init; } = default!;
66
public string ClientSecret { get; init; } = default!;
77
public string Realm { get; init; } = default!;
8-
public string BaseUrl { get; init; } = default!;
8+
public string Authority { get; init; } = default!;
9+
public string[] Audiences { get; init; } = default!;
910
}

Boundaries/Comanda.Orchestrator/Source/Comanda.Orchestrator.WebApi/Comanda.Orchestrator.WebApi.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<PackageReference Include="Sentry.Serilog" Version="6.0.0" />
2323
<PackageReference Include="Serilog.AspNetCore" Version="10.0.0" />
2424
<PackageReference Include="Serilog.Sinks.Seq" Version="9.0.0" />
25-
<PackageReference Include="HttpsRichardy.Federation.Sdk" Version="1.0.2" />
25+
<PackageReference Include="HttpsRichardy.Federation.Sdk" Version="4.2.0" />
2626
</ItemGroup>
2727

2828
<ItemGroup>

Boundaries/Comanda.Orchestrator/Source/Comanda.Orchestrator.WebApi/Extensions/OpenApiExtension.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static void AddOpenApiSpecification(this IServiceCollection services)
3030
{
3131
ClientCredentials = new OpenApiOAuthFlow
3232
{
33-
TokenUrl = new Uri(settings.Federation.BaseUrl + "/api/v1/protocol/open-id/connect/token")
33+
TokenUrl = new Uri(settings.Federation.Authority + "/api/v1/protocol/open-id/connect/token")
3434
}
3535
}
3636
};
@@ -41,12 +41,6 @@ public static void AddOpenApiSpecification(this IServiceCollection services)
4141
[document.Components.SecuritySchemes[SecuritySchemes.Bearer]] = Array.Empty<string>(),
4242
});
4343

44-
document.Info.Contact = new OpenApiContact
45-
{
46-
Name = "Richard Garcia",
47-
Email = "code.richardys@gmail.com",
48-
};
49-
5044
return Task.CompletedTask;
5145
});
5246
});

Boundaries/Comanda.Orchestrator/Source/Comanda.Orchestrator.WebApi/Extensions/WebInfrastructureExtension.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ public static void AddWebComposition(this IServiceCollection services)
2222
services.AddOpenApiSpecification();
2323
services.AddFederation(options =>
2424
{
25-
options.BaseUrl = settings.Federation.BaseUrl;
25+
options.Authority = settings.Federation.Authority;
2626
options.ClientId = settings.Federation.ClientId;
2727
options.Realm = settings.Federation.Realm;
2828
options.ClientSecret = settings.Federation.ClientSecret;
29+
options.Audiences = settings.Federation.Audiences;
2930
});
3031

3132
services.AddIdempotency()

Boundaries/Comanda.Orchestrator/Source/Comanda.Orchestrator.WebApi/appsettings.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"Settings": {
33
"Federation": {
4-
"BaseUrl": "${Settings__Federation__BaseUrl}",
4+
"Authority": "${Settings__Federation__BaseUrl}",
55
"Realm": "${Settings__Federation__Realm}",
66
"ClientId": "${Settings__Federation__ClientId}",
7-
"ClientSecret": "${Settings__Federation__ClientSecret}"
7+
"ClientSecret": "${Settings__Federation__ClientSecret}",
8+
"Audiences": [ "${Settings__Federation__Audiences__0}" ]
89
},
910
"Downstream": {
1011
"ProfilesUrl": "${Settings__Downstream__ProfilesUrl}",

Boundaries/Comanda.Orchestrator/Tests/Fixtures/WebApplicationFixture.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public sealed class WebApplicationFixture : IAsyncLifetime
99
public IServiceProvider Services { get; private set; } = default!;
1010
private WebApplicationFactory<Program> _factory = default!;
1111

12-
public async ValueTask InitializeAsync()
12+
public ValueTask InitializeAsync()
1313
{
1414
_factory = new WebApplicationFactory<Program>().WithWebHostBuilder(builder =>
1515
{
@@ -22,7 +22,7 @@ public async ValueTask InitializeAsync()
2222
options.DefaultScheme = Defaults.AuthenticationScheme;
2323
});
2424

25-
policy.AddScheme<AuthenticationSchemeOptions, BypassAuthenticationHandler>(Defaults.AuthenticationScheme, _ => { });
25+
policy.AddScheme<AuthenticationSchemeOptions, BypassAuthenticationHandler>(Defaults.AuthenticationScheme, _ => { });
2626
services.AddAuthorizationBuilder()
2727
.SetDefaultPolicy(new AuthorizationPolicyBuilder(Defaults.AuthenticationScheme)
2828
.RequireAuthenticatedUser()
@@ -32,6 +32,8 @@ public async ValueTask InitializeAsync()
3232

3333
HttpClient = _factory.CreateClient();
3434
Services = _factory.Services;
35+
36+
return ValueTask.CompletedTask;
3537
}
3638

3739
public async ValueTask DisposeAsync()

Boundaries/Comanda.Orders/Source/Comanda.Orders.Application/Comanda.Orders.Application.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
<ItemGroup>
1010
<PackageReference Include="FluentValidation" Version="12.0.0" />
11-
<PackageReference Include="Comanda.Internal.Contracts" Version="1.0.1" />
12-
<PackageReference Include="HttpsRichardy.Dispatcher" Version="1.0.2" />
13-
<PackageReference Include="HttpsRichardy.Federation.Sdk.Contracts" Version="1.0.2" />
11+
<PackageReference Include="Comanda.Internal.Contracts" Version="1.0.8" />
12+
<PackageReference Include="HttpsRichardy.Dispatcher" Version="1.0.3" />
13+
<PackageReference Include="HttpsRichardy.Federation.Sdk.Contracts" Version="4.2.0" />
1414
</ItemGroup>
1515

1616
<ItemGroup>

Boundaries/Comanda.Orders/Source/Comanda.Orders.CrossCutting/Configurations/FederationSettings.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ public sealed record FederationSettings
55
public string ClientId { get; init; } = default!;
66
public string ClientSecret { get; init; } = default!;
77
public string Realm { get; init; } = default!;
8-
public string BaseUrl { get; init; } = default!;
8+
public string Authority { get; init; } = default!;
9+
public string[] Audiences { get; init; } = default!;
910
}

0 commit comments

Comments
 (0)