Skip to content

Commit

Permalink
Update configuration files
Browse files Browse the repository at this point in the history
  • Loading branch information
thabart committed Mar 9, 2020
1 parent b5f3ed5 commit df09b8a
Show file tree
Hide file tree
Showing 29 changed files with 298 additions and 139 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<VersionPrefix>1.0.0</VersionPrefix>
<VersionPrefix>1.0.1</VersionPrefix>
<Authors>SimpleIdServer</Authors>
<Owners>SimpleIdServer</Owners>
</PropertyGroup>
Expand Down
8 changes: 8 additions & 0 deletions NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="sid" value="https://www.myget.org/F/advance-ict/api/v3/index.json" />
</packageSources>
</configuration>
27 changes: 18 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ For project documentation, please visit [readthedocs](https://casemanagement.rea

## Packages

| | | | |
| --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `CaseManagement.CMMN` | [![MyGet (dev)](https://img.shields.io/myget/advance-ict/v/CaseManagement.CMMN.svg)](https://www.myget.org/feed/advance-ict/package/nuget/CaseManagement.CMMN) | [![NuGet](https://img.shields.io/nuget/v/CaseManagement.CMMN.svg)](https://nuget.org/packages/CaseManagement.CMMN) | [![NuGet](https://img.shields.io/nuget/dt/CaseManagement.CMMN.svg)](https://nuget.org/packages/CaseManagement.CMMN) |
| `CaseManagement.CMMN.AspNet` | [![MyGet (dev)](https://img.shields.io/myget/advance-ict/v/CaseManagement.CMMN.AspNet.svg)](https://www.myget.org/feed/advance-ict/package/nuget/CaseManagement.CMMN.AspNet) | [![NuGet](https://img.shields.io/nuget/v/CaseManagement.CMMN.AspNet.svg)](https://nuget.org/packages/CaseManagement.CMMN.AspNet) | [![NuGet](https://img.shields.io/nuget/dt/CaseManagement.CMMN.AspNet.svg)](https://nuget.org/packages/CaseManagement.CMMN.AspNet) |
| `CaseManagement.CMMN.AspNetCore` | [![MyGet (dev)](https://img.shields.io/myget/advance-ict/v/CaseManagement.CMMN.AspNetCore.svg)](https://www.myget.org/feed/advance-ict/package/nuget/CaseManagement.CMMN.AspNetCore) | [![NuGet](https://img.shields.io/nuget/v/CaseManagement.CMMN.AspNetCore.svg)](https://nuget.org/packages/CaseManagement.CMMN.AspNetCore) | [![NuGet](https://img.shields.io/nuget/dt/CaseManagement.CMMN.AspNetCore.svg)](https://nuget.org/packages/CaseManagement.CMMN.AspNetCore) |
| | | | |
| --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `CaseManagement.CMMN` | [![MyGet (dev)](https://img.shields.io/myget/advance-ict/v/CaseManagement.CMMN.svg)](https://www.myget.org/feed/advance-ict/package/nuget/CaseManagement.CMMN) | [![NuGet](https://img.shields.io/nuget/v/CaseManagement.CMMN.svg)](https://nuget.org/packages/CaseManagement.CMMN) | [![NuGet](https://img.shields.io/nuget/dt/CaseManagement.CMMN.svg)](https://nuget.org/packages/CaseManagement.CMMN) |
| `CaseManagement.CMMN.AspNet` | [![MyGet (dev)](https://img.shields.io/myget/advance-ict/v/CaseManagement.CMMN.AspNet.svg)](https://www.myget.org/feed/advance-ict/package/nuget/CaseManagement.CMMN.AspNet) | [![NuGet](https://img.shields.io/nuget/v/CaseManagement.CMMN.AspNet.svg)](https://nuget.org/packages/CaseManagement.CMMN.AspNet) | [![NuGet](https://img.shields.io/nuget/dt/CaseManagement.CMMN.AspNet.svg)](https://nuget.org/packages/CaseManagement.CMMN.AspNet) |
| `CaseManagement.CMMN.AspNetCore` | [![MyGet (dev)](https://img.shields.io/myget/advance-ict/v/CaseManagement.CMMN.AspNetCore.svg)](https://www.myget.org/feed/advance-ict/package/nuget/CaseManagement.CMMN.AspNetCore) | [![NuGet](https://img.shields.io/nuget/v/CaseManagement.CMMN.AspNetCore.svg)](https://nuget.org/packages/CaseManagement.CMMN.AspNetCore) | [![NuGet](https://img.shields.io/nuget/dt/CaseManagement.CMMN.AspNetCore.svg)](https://nuget.org/packages/CaseManagement.CMMN.AspNetCore) |
| `CaseManagement.Gateway.Website` | [![MyGet (dev)](https://img.shields.io/myget/advance-ict/v/CaseManagement.Gateway.Website.svg)](https://www.myget.org/feed/advance-ict/package/nuget/CaseManagement.Gateway.Website) | [![NuGet](https://img.shields.io/nuget/v/CaseManagement.Gateway.Website.svg)](https://nuget.org/packages/CaseManagement.Gateway.Website) | [![NuGet](https://img.shields.io/nuget/dt/CaseManagement.Gateway.Website.svg)](https://nuget.org/packages/CaseManagement.Gateway.Website) |
| `CaseManagement.Gateway.Website.AspNetCore` | [![MyGet (dev)](https://img.shields.io/myget/advance-ict/v/CaseManagement.Gateway.Website.AspNetCore.svg)](https://www.myget.org/feed/advance-ict/package/nuget/CaseManagement.Gateway.Website.AspNetCore) | [![NuGet](https://img.shields.io/nuget/v/CaseManagement.Gateway.Website.AspNetCore.svg)](https://nuget.org/packages/CaseManagement.Gateway.Website.AspNetCore) | [![NuGet](https://img.shields.io/nuget/dt/CaseManagement.Gateway.Website.AspNetCore)](https://nuget.org/packages/CaseManagement.Gateway.Website.AspNetCore) |

## Contributing

Expand All @@ -35,9 +37,9 @@ Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduc

### Performance website

Performance live demo : (?).
Performance live demo : [http://simpleidserver.northeurope.cloudapp.azure.com/casemanagementperformance](http://simpleidserver.northeurope.cloudapp.azure.com/casemanagementperformance).

Use the following administrator account to authenticate to the performance website.
Administrator credentials :

| Property | Value |
|---------------|-----------------|
Expand All @@ -46,11 +48,18 @@ Use the following administrator account to authenticate to the performance websi

### Case management website

CaseManagement live demo : [http://simpleidserver.northeurope.cloudapp.azure.com/](http://simpleidserver.northeurope.cloudapp.azure.com/).
CaseManagement live demo : [http://simpleidserver.northeurope.cloudapp.azure.com/casemanagement](http://simpleidserver.northeurope.cloudapp.azure.com/casemanagement).

Use the following businessanalyst account to authenticate to the case management website.
Business analyst credentials :

| Property | Value |
|---------------|-----------------|
| login | businessanalyst |
| value | password |

Case worker credentials :

| Property | Value |
|---------------|-----------------|
| login | caseworker |
| value | password |
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pull_requests:
branches:
only:
- master
image: Visual Studio 2017
image: Visual Studio 2019
nuget:
disable_publish_on_pr: true
build_script:
Expand Down
50 changes: 48 additions & 2 deletions conf/casemanagement.nginx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ server {

server_name simpleidserver.northeurope.cloudapp.azure.com;

location / {
location /casemanagement {
proxy_pass http://localhost:51724;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
Expand All @@ -34,9 +34,55 @@ server {
proxy_buffer_size 128k;
proxy_buffers 32 256k;
}

location /casemanagementperformance {
proxy_pass http://localhost:51725;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_pass_header Set-Cookie;
proxy_pass_request_headers on;
proxy_cache_bypass $http_upgrade;
proxy_cookie_domain localhost $host;
proxy_set_header X-Scheme https;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-URL-SCHEME https;
client_max_body_size 1M;
client_body_buffer_size 4096k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 128k;
proxy_buffers 32 256k;
}

location /casemanagementapi {
proxy_pass http://localhost:54942;
proxy_pass http://localhost:56696;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_pass_header Set-Cookie;
proxy_pass_request_headers on;
proxy_cache_bypass $http_upgrade;
proxy_cookie_domain localhost $host;
proxy_set_header X-Scheme https;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-URL-SCHEME https;
client_max_body_size 1M;
client_body_buffer_size 4096k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 128k;
proxy_buffers 32 256k;
}

location /casemanagementidentity {
proxy_pass http://localhost:60000;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
Expand Down
4 changes: 2 additions & 2 deletions conf/casemanagement.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ Description=Case management
After=network.target

[Service]
ExecStart=/usr/bin/dotnet /src/CaseManagement/src/CaseManagement.CMMN.Host/bin/Debug/netcoreapp2.2/CaseManagement.CMMN.Host.dll --pathBase=/casemanagementapi --server.urls="http://*:54942"
ExecStart=/usr/bin/dotnet /src/CaseManagement/src/CaseManagement.CMMN.Host/bin/Debug/netcoreapp3.1/CaseManagement.CMMN.Host.dll --server.urls="http://*:54942"
KillMode=process
TimeoutStopSec=5s
Restart=always
WorkingDirectory=/src/CaseManagement/src/CaseManagement.CMMN.Host/bin/Debug/netcoreapp2.2
WorkingDirectory=/src/CaseManagement/src/CaseManagement.CMMN.Host/bin/Debug/netcoreapp3.1

[Install]
WantedBy=multi-user.target
13 changes: 13 additions & 0 deletions conf/casemanagementgateway.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=Case management gateway
After=network.target

[Service]
ExecStart=/usr/bin/dotnet /src/CaseManagement/src/CaseManagement.Gateway.Website.Host/bin/Debug/netcoreapp3.1/CaseManagement.Gateway.Website.Host.dll --pathBase=/casemanagementapi --server.urls="http://*:56696"
KillMode=process
TimeoutStopSec=5s
Restart=always
WorkingDirectory=/src/CaseManagement/src/CaseManagement.Gateway.Website.Host

[Install]
WantedBy=multi-user.target
13 changes: 13 additions & 0 deletions conf/casemanagementidentity.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=Case management identity (OPENID)
After=network.target

[Service]
ExecStart=/usr/bin/dotnet /src/CaseManagement/src/CaseManagement.Identity/bin/Debug/netcoreapp2.2/CaseManagement.Identity.dll --pathBase=/casemanagementidentity --server.urls="http://*:60000"
KillMode=process
TimeoutStopSec=5s
Restart=always
WorkingDirectory=/src/CaseManagement/src/CaseManagement.Identity

[Install]
WantedBy=multi-user.target
13 changes: 13 additions & 0 deletions conf/casemanagementoauth.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=Case management authorization (OAUTH)
After=network.target

[Service]
ExecStart=/usr/bin/dotnet /src/CaseManagement/src/CaseManagement.OAuth/bin/Debug/netcoreapp2.2/CaseManagement.OAuth.dll --server.urls="http://*:60001"
KillMode=process
TimeoutStopSec=5s
Restart=always
WorkingDirectory=/src/CaseManagement/src/CaseManagement.OAuth

[Install]
WantedBy=multi-user.target
13 changes: 13 additions & 0 deletions conf/casemanagementperformance.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=Case management performance
After=network.target

[Service]
ExecStart=/usr/bin/dotnet /src/CaseManagement/src/CaseManagement.Performance/bin/Debug/netcoreapp2.2/CaseManagement.Performance.dll --pathBase=/casemanagementperformance --server.urls="http://*:51725"
KillMode=process
TimeoutStopSec=5s
Restart=always
WorkingDirectory=/src/CaseManagement/src/CaseManagement.Performance

[Install]
WantedBy=multi-user.target
2 changes: 1 addition & 1 deletion conf/casemanagementwebsite.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Description=Case management website
After=network.target

[Service]
ExecStart=/usr/bin/dotnet /src/CaseManagement/src/CaseManagement.Website/bin/Debug/netcoreapp2.2/CaseManagement.Website.dll --server.urls="http://*:51724"
ExecStart=/usr/bin/dotnet /src/CaseManagement/src/CaseManagement.Website/bin/Debug/netcoreapp2.2/CaseManagement.Website.dll --pathBase=/casemanagement --server.urls="http://*:51724"
KillMode=process
TimeoutStopSec=5s
Restart=always
Expand Down
5 changes: 3 additions & 2 deletions src/CaseManagement.CMMN.Host/CaseManagement.CMMN.Host.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<OutputType>Exe</OutputType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CaseManagement.CMMN.AspNetCore\CaseManagement.CMMN.AspNetCore.csproj" />
Expand Down
25 changes: 12 additions & 13 deletions src/CaseManagement.CMMN.Host/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
using Microsoft.IdentityModel.Tokens;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand All @@ -34,7 +33,7 @@ public Startup(IHostingEnvironment env, IConfiguration configuration)

public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddMvc(opts => opts.EnableEndpointRouting = false).AddNewtonsoftJson();
services.AddAuthentication(options =>
{
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
Expand Down Expand Up @@ -62,11 +61,13 @@ public void ConfigureServices(IServiceCollection services)
IssuerSigningKey = ExtractKey("openid_puk.txt"),
ValidAudiences = new List<string>
{
"http://localhost:60000"
"http://localhost:60000",
"http://simpleidserver.northeurope.cloudapp.azure.com/casemanagementidentity"
},
ValidIssuers = new List<string>
{
"http://localhost:60000"
"http://localhost:60000",
"http://simpleidserver.northeurope.cloudapp.azure.com/casemanagementidentity"
}
};
});
Expand Down Expand Up @@ -298,16 +299,14 @@ private RsaSecurityKey ExtractKey(string fileName)
{
var json = File.ReadAllText(Path.Combine(_env.ContentRootPath, fileName));
var dic = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);
using (var rsa = RSA.Create())
var rsa = RSA.Create();
var rsaParameters = new RSAParameters
{
var rsaParameters = new RSAParameters
{
Modulus = Convert.FromBase64String(dic["n"].ToString()),
Exponent = Convert.FromBase64String(dic["e"].ToString())
};
rsa.ImportParameters(rsaParameters);
return new RsaSecurityKey(rsa);
}
Modulus = Convert.FromBase64String(dic["n"].ToString()),
Exponent = Convert.FromBase64String(dic["e"].ToString())
};
rsa.ImportParameters(rsaParameters);
return new RsaSecurityKey(rsa);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<OutputType>Exe</OutputType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CaseManagement.Gateway.Website.AspNetCore\CaseManagement.Gateway.Website.AspNetCore.csproj" />
Expand Down
27 changes: 15 additions & 12 deletions src/CaseManagement.Gateway.Website.Host/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.IdentityModel.Logging;
using Microsoft.IdentityModel.Tokens;
using Newtonsoft.Json;
using System;
Expand All @@ -30,7 +32,7 @@ public Startup(IHostingEnvironment env, IConfiguration configuration)

public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddMvc(opts => opts.EnableEndpointRouting = false).AddNewtonsoftJson();
services.AddAuthentication(options =>
{
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
Expand All @@ -43,11 +45,13 @@ public void ConfigureServices(IServiceCollection services)
IssuerSigningKey = ExtractKey("openid_puk.txt"),
ValidAudiences = new List<string>
{
"http://localhost:60000"
"http://localhost:60000",
"http://simpleidserver.northeurope.cloudapp.azure.com/casemanagementidentity"
},
ValidIssuers = new List<string>
{
"http://localhost:60000"
"http://localhost:60000",
"http://simpleidserver.northeurope.cloudapp.azure.com/casemanagementidentity"
}
};
});
Expand Down Expand Up @@ -114,17 +118,16 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
private RsaSecurityKey ExtractKey(string fileName)
{
var json = File.ReadAllText(Path.Combine(_env.ContentRootPath, fileName));
Console.WriteLine(json);
var dic = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);
using (var rsa = RSA.Create())
var rsa = RSA.Create();
var rsaParameters = new RSAParameters
{
var rsaParameters = new RSAParameters
{
Modulus = Convert.FromBase64String(dic["n"].ToString()),
Exponent = Convert.FromBase64String(dic["e"].ToString())
};
rsa.ImportParameters(rsaParameters);
return new RsaSecurityKey(rsa);
}
Modulus = Convert.FromBase64String(dic["n"].ToString()),
Exponent = Convert.FromBase64String(dic["e"].ToString())
};
rsa.ImportParameters(rsaParameters);
return new RsaSecurityKey(rsa);
}
}
}

0 comments on commit df09b8a

Please sign in to comment.