Skip to content

Commit 72896e5

Browse files
authored
Merge pull request #638 from Laixer/develop
v3.5.1
2 parents 24e888a + 91c2cce commit 72896e5

39 files changed

Lines changed: 1256 additions & 1260 deletions

.vscode/launch.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"request": "launch",
1111
"preLaunchTask": "build",
1212
// If you have changed target frameworks, make sure to update the program path.
13-
"program": "${workspaceFolder}/src/FunderMaps.BatchNode/bin/Debug/net5.0/FunderMaps.BatchNode",
13+
"program": "${workspaceFolder}/src/FunderMaps.BatchNode/bin/Debug/net6.0/FunderMaps.BatchNode",
1414
"args": [],
1515
"cwd": "${workspaceFolder}/src/FunderMaps.BatchNode",
1616
"stopAtEntry": false,
@@ -25,7 +25,7 @@
2525
"request": "launch",
2626
"preLaunchTask": "build",
2727
// If you have changed target frameworks, make sure to update the program path.
28-
"program": "${workspaceFolder}/src/FunderMaps.WebApi/bin/Debug/net5.0/FunderMaps.WebApi",
28+
"program": "${workspaceFolder}/src/FunderMaps.WebApi/bin/Debug/net6.0/FunderMaps.WebApi",
2929
"args": [],
3030
"cwd": "${workspaceFolder}/src/FunderMaps.WebApi",
3131
"stopAtEntry": false,
@@ -43,7 +43,7 @@
4343
"request": "launch",
4444
"preLaunchTask": "build",
4545
// If you have changed target frameworks, make sure to update the program path.
46-
"program": "${workspaceFolder}/src/FunderMaps.Webservice/bin/Debug/net5.0/FunderMaps.Webservice",
46+
"program": "${workspaceFolder}/src/FunderMaps.Webservice/bin/Debug/net6.0/FunderMaps.Webservice",
4747
"args": [],
4848
"cwd": "${workspaceFolder}/src/FunderMaps.Webservice",
4949
"stopAtEntry": false,
@@ -61,7 +61,7 @@
6161
"request": "launch",
6262
"preLaunchTask": "build",
6363
// If you have changed target frameworks, make sure to update the program path.
64-
"program": "${workspaceFolder}/src/FunderMaps.Portal/bin/Debug/net5.0/FunderMaps.Portal",
64+
"program": "${workspaceFolder}/src/FunderMaps.Portal/bin/Debug/net6.0/FunderMaps.Portal",
6565
"args": [],
6666
"cwd": "${workspaceFolder}/src/FunderMaps.Portal",
6767
"stopAtEntry": false,

API_TEST

Lines changed: 0 additions & 3 deletions
This file was deleted.

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ RUN dotnet publish -c release -o /app \
3131
# Build runtime image
3232
FROM mcr.microsoft.com/dotnet/aspnet:6.0
3333
ENV DOTNET_PRINT_TELEMETRY_MESSAGE=false
34+
ENV Logging__Console__FormatterName=Simple
3435
WORKDIR /app
3536
COPY --from=build /app .
3637
RUN if grep -Fxq "FunderMaps.BatchNode" SUBTOOL ; then \

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,37 @@ Foundation issues occur and are actively investigated by local government. Gaini
99
* .NET 6 LTS Runtime and SDK
1010
* Docker
1111

12+
See https://docs.microsoft.com/en-us/dotnet/core/install/ for installation instructions of .NET.
13+
1214
## Running the application on localhost
1315

1416
After cloning or downloading the application you will be able to run the application on localhost. You will need to run the setup and load scripts to configure the local database.
1517

16-
1. Run from solution directory. This will setup the PostgreSQL instance and seed the database.
18+
1. Run from solution directory. This will setup the PostgreSQL instance in a docker container.
1719

18-
```
20+
```sh
1921
./scripts/setupdb.sh
22+
```
23+
24+
2. Wait **5 seconds** before running the database seeder script.
25+
26+
```sh
2027
./scripts/loaddb.sh
2128
```
2229

2330
3. Ensure your connection strings in `appsettings.{ENV}.json` point to the local PostgreSQL instance. For example the *FunderMaps.WebApi* would have `Server=localhost;Database=fundermaps;User Id=fundermaps_webapp` where the user id corresponds to the application.
2431

2532
4. Enter the project directory in `src/{project}`.
2633

27-
5. Run the application with `ASPNETCORE_ENVIRONMENT={ENV} dotnet run`. The application should keep running in the foreground. The foreground logging shows the connection details.
34+
5. _(Optional)_ Test the application by running `dotnet test`. The tests cover almost all of the application logic. Address any issues before continue the development.
35+
36+
6. Run the application with `ASPNETCORE_ENVIRONMENT={ENV} dotnet run`. The application should keep running in the foreground. The foreground logging shows the connection details.
2837

2938
When using VS Code the 'debug' section should list all the applications. Just run the application (or hit F5).
3039

3140
## Configuration
3241

33-
See the `contrib/etc/_appsettings.{ENV}.json` directory for configuration files for each environment. You can copy these configuration files to the project source directory.
42+
See the `contrib/etc/_appsettings.{ENV}.json` directory for configuration files for each environment. You can copy these configuration files to the project source directory (`src/{project}`).
3443

3544
## Using the application
3645

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
namespace FunderMaps.AspNetCore.Authentication
1+
namespace FunderMaps.AspNetCore.Authentication;
2+
3+
/// <summary>
4+
/// FunderMaps claim types.
5+
/// </summary>
6+
public static class FunderMapsAuthenticationClaimTypes
27
{
38
/// <summary>
4-
/// FunderMaps claim types.
9+
/// FunderMaps tenant claim type.
510
/// </summary>
6-
public static class FunderMapsAuthenticationClaimTypes
7-
{
8-
/// <summary>
9-
/// FunderMaps tenant claim type.
10-
/// </summary>
11-
public const string Tenant = "cfo";
11+
public const string Tenant = "cfo";
1212

13-
/// <summary>
14-
/// FunderMaps tenant role claim type.
15-
/// </summary>
16-
public const string TenantRole = "cfor";
17-
}
13+
/// <summary>
14+
/// FunderMaps tenant role claim type.
15+
/// </summary>
16+
public const string TenantRole = "cfor";
1817
}
Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
using Microsoft.IdentityModel.Tokens;
22
using System.Security.Claims;
33

4-
namespace FunderMaps.AspNetCore.Authentication
4+
namespace FunderMaps.AspNetCore.Authentication;
5+
6+
/// <summary>
7+
/// Security token provider.
8+
/// </summary>
9+
public interface ISecurityTokenProvider
510
{
611
/// <summary>
7-
/// Security token provider.
12+
/// Generate token.
813
/// </summary>
9-
public interface ISecurityTokenProvider
10-
{
11-
/// <summary>
12-
/// Generate token.
13-
/// </summary>
14-
/// <param name="principal">Claims principal.</param>
15-
/// <returns>Instance of <see cref="SecurityToken"/>.</returns>
16-
SecurityToken GetToken(ClaimsPrincipal principal);
14+
/// <param name="principal">Claims principal.</param>
15+
/// <returns>Instance of <see cref="SecurityToken"/>.</returns>
16+
SecurityToken GetToken(ClaimsPrincipal principal);
1717

18-
/// <summary>
19-
/// Generate token.
20-
/// </summary>
21-
/// <param name="principal">Claims principal.</param>
22-
/// <returns>Instance of <see cref="TokenContext"/>.</returns>
23-
TokenContext GetTokenContext(ClaimsPrincipal principal);
24-
}
18+
/// <summary>
19+
/// Generate token.
20+
/// </summary>
21+
/// <param name="principal">Claims principal.</param>
22+
/// <returns>Instance of <see cref="TokenContext"/>.</returns>
23+
TokenContext GetTokenContext(ClaimsPrincipal principal);
2524
}

0 commit comments

Comments
 (0)