Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<PackageVersion Include="Aspire.Hosting.Redis" Version="13.4.0" />
<PackageVersion Include="CommunityToolkit.Aspire.Hosting.NodeJS.Extensions" Version="9.9.0" />
<!-- Dependency injection -->
<PackageVersion Include="Microsoft.Extensions.Configuration.AzureAppConfiguration" Version="8.5.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.2" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.2" />
<!-- Options -->
Expand Down Expand Up @@ -149,4 +150,4 @@
<PackageVersion Include="Testcontainers.MsSql" Version="4.3.0" />
<PackageVersion Include="Respawn" Version="7.0.0" />
</ItemGroup>
</Project>
</Project>
29 changes: 27 additions & 2 deletions src/Dfe.SignIn.AppHost/AppHost.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
using System.Reflection;
using Azure.Identity;
using Dfe.SignIn.AppHost;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Configuration.AzureAppConfiguration;

var builder = DistributedApplication.CreateBuilder(args);

if (!string.IsNullOrEmpty(builder.Configuration.GetConnectionString("AppConfiguration"))) {
var appConfigurationTag = builder.Configuration["AppConfiguration:Tag"];
if (string.IsNullOrEmpty(appConfigurationTag)) {
throw new ArgumentNullException("AppConfiguration Tag missing");

Check warning on line 12 in src/Dfe.SignIn.AppHost/AppHost.cs

View workflow job for this annotation

GitHub Actions / .NET checks / tests

The parameter name 'AppConfiguration Tag missing' is not declared in the argument list.

Check warning on line 12 in src/Dfe.SignIn.AppHost/AppHost.cs

View workflow job for this annotation

GitHub Actions / .NET checks / tests

The parameter name 'AppConfiguration Tag missing' is not declared in the argument list.

Check warning on line 12 in src/Dfe.SignIn.AppHost/AppHost.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Method <Main>$ passes 'AppConfiguration Tag missing' as the paramName argument to a ArgumentNullException constructor. Replace this argument with one of the method's parameter names. Note that the provided parameter name should have the exact casing as declared on the method.

See more on https://sonarcloud.io/project/issues?id=DFE-Digital_dsi-platform&issues=AZ9sXR_eLG18L6h5ECcQ&open=AZ9sXR_eLG18L6h5ECcQ&pullRequest=214

Check warning on line 12 in src/Dfe.SignIn.AppHost/AppHost.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

The parameter name 'AppConfiguration Tag missing' is not declared in the argument list.

See more on https://sonarcloud.io/project/issues?id=DFE-Digital_dsi-platform&issues=AZ9sXR_eLG18L6h5ECcP&open=AZ9sXR_eLG18L6h5ECcP&pullRequest=214
}
builder.Configuration.AddAzureAppConfiguration(options => {
options.Connect(builder.Configuration["ConnectionStrings:AppConfiguration"])
.Select(KeyFilter.Any, "dev");

options.ConfigureKeyVault(kv => {
kv.SetCredential(new DefaultAzureCredential());
});
});
}

builder.Configuration.AddUserSecrets(Assembly.GetExecutingAssembly(), optional: true, reloadOnChange: true);

#pragma warning disable ASPIRECERTIFICATES001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
Expand Down Expand Up @@ -41,6 +59,7 @@
var selectOrgConfig = builder.Configuration.GetSection("SelectOrganisation");
var internalApiConfig = builder.Configuration.GetSection("InternalApiClient");
var efConfig = builder.Configuration.GetSection("EntityFramework");
var assets = builder.Configuration.GetSection("Assets");

var dotNetComponents = builder.Configuration.GetSection("Components:DotNet");
var nodeComponents = builder.Configuration.GetSection("Components:Node");
Expand All @@ -52,6 +71,8 @@
.WithEnvironment("GovNotify__ApiKey", govNotifyConfig["ApiKey"])
.WithEnvironment("RaiseSupportTicketByEmail__SupportEmailAddress", supportEmailConfig["SupportEmailAddress"])
.WithEnvironment("RaiseSupportTicketByEmail__EmailTemplateId", supportEmailConfig["EmailTemplateId"])
.WithEnvironment("Assets__BaseAddress", assets["BaseAddress"])
.WithEnvironment("Assets__FrontendVersion", assets["FrontendVersion"])
.WaitFor(frontend)
.WaitFor(redis);
}
Expand All @@ -66,6 +87,7 @@
.WithEnvironment("EntityFramework__Organisations__Name", efConfig["Organisations:Name"])
.WithEnvironment("EntityFramework__Organisations__Username", efConfig["Organisations:Username"])
.WithEnvironment("EntityFramework__Organisations__Password", efConfig["Organisations:Password"])
.WithEnvironment("PublicApiSecretEncryption__Key", publicApiSecretConfig["Key"])
.WithEnvironment("InternalApiClient__ClientId", internalApiConfig["ClientId"])
.WithEnvironment("InternalApiClient__ClientSecret", internalApiConfig["ClientSecret"])
.WithEnvironment("InternalApiClient__Tenant", internalApiConfig["Tenant"])
Expand Down Expand Up @@ -95,6 +117,8 @@
.WithEnvironment("ExternalId__TenantId", externalIdConfig["TenantId"])
.WithEnvironment("Session__DurationInMinutes", sessionConfig["DurationInMinutes"])
.WithEnvironment("Session__NotifyRemainingMinutes", sessionConfig["NotifyRemainingMinutes"])
.WithEnvironment("Assets__BaseAddress", assets["BaseAddress"])
.WithEnvironment("Assets__FrontendVersion", assets["FrontendVersion"])
.WaitFor(frontend)
.WaitFor(redis);
}
Expand Down Expand Up @@ -154,6 +178,7 @@
.WaitForIfPresent(interactor);
}

builder.AddExecutable("tool-tls-proxy", "pwsh", "../../", "-Command", "Start-DsiTlsProxy");

if (nodeComponents.GetValue("Run-TlsProxy", false)) {
builder.AddExecutable("tool-tls-proxy", "pwsh", "../../", "-Command", "Start-DsiTlsProxy");
}
await builder.Build().RunAsync();
3 changes: 2 additions & 1 deletion src/Dfe.SignIn.AppHost/Dfe.SignIn.AppHost.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
<PackageReference Include="Aspire.Hosting.Redis" />
<PackageReference Include="Aspire.Hosting.NodeJs" />
<PackageReference Include="CommunityToolkit.Aspire.Hosting.NodeJS.Extensions" />
<PackageReference Include="MessagePack" />
<PackageReference Include="MessagePack" />
<PackageReference Include="Microsoft.Extensions.Configuration.AzureAppConfiguration" />
</ItemGroup>

<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Dfe.SignIn.Core.UseCases/CoreUseCasesAssembly.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Dfe.SignIn.Core.UseCases;

/// <summary>
/// An empty type representing the core use cases assembly.
/// An empty type representing the core use cases assembly..
/// </summary>
public static class CoreUseCasesAssembly { }
Loading