Skip to content

Commit

Permalink
Merge pull request #853 from bcgov/stories/ecer-4076-efxdev
Browse files Browse the repository at this point in the history
ECER-4076 setting up EFXDev for local development. Making sure we load user sec…
  • Loading branch information
SoLetsDev authored Jan 21, 2025
2 parents dc42d4e + e2329e7 commit d584f32
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/ECER.Clients.Api/Program.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
using ECER.Infrastructure.Common;
using ECER.Utilities.Hosting;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Http.Json;
using Microsoft.IdentityModel.Tokens;
using Microsoft.OpenApi.Models;
using System.Diagnostics;
using System.Reflection;
using System.Security.Claims;
using System.Text.Json.Serialization;
Expand All @@ -29,6 +26,13 @@ private static async Task<int> Main(string[] args)

try
{
if (builder.Environment.IsEnvironment("EFXDevelopment"))
{
foreach (var assembly in assemblies)
{
builder.Configuration.AddUserSecrets(assembly);
}
}
builder.Services.AddMediatR(opts =>
{
opts.RegisterServicesFromAssemblies(assemblies);
Expand Down
32 changes: 32 additions & 0 deletions src/ECER.Clients.Api/appsettings.EFXDevelopment.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"Serilog": {
"MinimumLevel": {
"Default": "Debug",
"Override": {
"Microsoft": "Information",
"Microsoft.AspNetCore": "Warning",
"Microsoft.Hosting.Lifetime": "Information",
"System.Net.Http.HttpClient": "Warning",
"MinimalApis.Extensions.Filters": "Information"
}
}
},
"Authentication": {
"Schemes": {
"api": {
"Authority": "https://dev.loginproxy.gov.bc.ca/auth/realms/childcare-applications",
"ValidAudiences": [
"childcare-ecer-api-efxdev",
"childcare-ecer-ew-efxdev"
],
"ValidIssuers": [
"https://dev.loginproxy.gov.bc.ca/auth/realms//childcare-applications"
]
}
}
},
"PortalApp": {
"BaseUrl": "efxdev-ecer-registry-portal.apps.silver.devops.gov.bc.ca",
"ReferenceVerificationRoute": "verify"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ private static async Task<int> Main(string[] args)

try
{
if (builder.Environment.IsEnvironment("EFXDevelopment"))
{
foreach (var assembly in assemblies)
{
builder.Configuration.AddUserSecrets(assembly);
}
}

builder.Services.AddMediatR(opts =>
{
opts.RegisterServicesFromAssemblies(assemblies);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"Serilog": {
"MinimumLevel": {
"Default": "Debug",
"Override": {
"Microsoft": "Information",
"Microsoft.AspNetCore": "Warning",
"Microsoft.Hosting.Lifetime": "Information",
"System.Net.Http.HttpClient": "Warning",
"MinimalApis.Extensions.Filters": "Information"
}
}
},
"cors": {
"allowedOrigins": "https://dev.loginproxy.gov.bc.ca/;https://idtest.gov.bc.ca/"
},
"ContentSecurityPolicy": {
"ConnectSource": "'self' https://dev.loginproxy.gov.bc.ca/ https://idtest.gov.bc.ca/"
},
"clientAuthenticationMethods": {
"kc": {
"authority": "https://dev.loginproxy.gov.bc.ca/auth/realms/childcare-applications",
"clientId": "childcare-ecer-efxdev"
}
},
"authentication": {
"Schemes": {
"kc": {
"Authority": "https://dev.loginproxy.gov.bc.ca/auth/realms/childcare-applications",
"ValidAudiences": [
"childcare-ecer-efxdev"
],
"ValidIssuers": [
"https://dev.loginproxy.gov.bc.ca/auth/realms/childcare-applications"
]
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,11 @@ npm run lint
docker build -t clamav:latest .
3. Run ClamAV container:
docker run --name clamav -p 3310:3310 -d clamav:latest

### swapping between Development and EFXDevelopment environments

1. In Visual Studio launchSettings.json (in both ECER.Clients.Api and ECER.Clients.RegistryPortal.Server) change the variable ASPNETCORE_ENVIRONMENT from

```
ASPNETCORE_ENVIRONMENT: "Development" to "EFXDevelopment"
```

0 comments on commit d584f32

Please sign in to comment.