Skip to content

Commit 30b6118

Browse files
committed
update docker compose
1 parent c562c91 commit 30b6118

3 files changed

Lines changed: 18 additions & 13 deletions

File tree

application/CohortManager/compose.core.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,9 @@ services:
233233
- ExceptionManagementDataServiceURL=http://exception-management-data-service:7911/api/ExceptionManagementDataService/
234234
- GPPracticeDataServiceURL=http://gppractice-data-service:7999/api/GPPracticeDataService/
235235
- AcceptableLatencyThresholdMs=500
236+
- BypassAuthentication=true
237+
- AuthClientId=MockClientId-123
238+
- UserInfoUrl=http://wiremock:8080/userinfo
236239

237240
# Screening Validation Service
238241
static-validation:

application/CohortManager/src/Functions/Shared/Common/Authentication/RoleManager.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ public class RoleManager : IRoleManager
77
{
88
private readonly Dictionary<string, Role> _roleMappings;
99

10-
1110
public RoleManager(IOptions<RoleConfig> roleConfig)
1211
{
1312
_roleMappings = new Dictionary<string, Role>

application/CohortManager/src/Functions/Shared/Common/Extensions/AuthenticationExtension.cs

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,22 @@ public static class AuthenticationExtension
88
public static IHostBuilder AddAuthentication(this IHostBuilder hostBuilder)
99
{
1010

11-
hostBuilder.AddConfiguration<AuthConfig>();
12-
hostBuilder.AddConfiguration<RoleConfig>();
13-
hostBuilder.ConfigureFunctionsWorkerDefaults(workerOptions =>
11+
hostBuilder.AddConfiguration<AuthConfig>(out var authConfig);
12+
if(!authConfig.ByPassAuthentication)
1413
{
15-
workerOptions.UseMiddleware<Cis2AuthMiddleware>();
16-
workerOptions.UseMiddleware<PermissionsMiddleware>();
17-
});
18-
hostBuilder.ConfigureServices((context, services) =>
19-
{
20-
services.AddSingleton<IAuthenticationService, JwtAuthentication>();
21-
services.AddSingleton<ICis2UserService,Cis2UserService>();
22-
services.AddSingleton<IRoleManager, RoleManager>();
23-
});
14+
hostBuilder.AddConfiguration<RoleConfig>();
15+
hostBuilder.ConfigureFunctionsWorkerDefaults(workerOptions =>
16+
{
17+
workerOptions.UseMiddleware<Cis2AuthMiddleware>();
18+
workerOptions.UseMiddleware<PermissionsMiddleware>();
19+
});
20+
hostBuilder.ConfigureServices((context, services) =>
21+
{
22+
services.AddSingleton<IAuthenticationService, JwtAuthentication>();
23+
services.AddSingleton<ICis2UserService,Cis2UserService>();
24+
services.AddSingleton<IRoleManager, RoleManager>();
25+
});
26+
}
2427
return hostBuilder;
2528
}
2629
}

0 commit comments

Comments
 (0)