Skip to content

Commit fb7e9fe

Browse files
authored
Merge pull request #4 from ChaosEngine/dev
Dev to Master
2 parents 4b1aec5 + cc78b11 commit fb7e9fe

31 files changed

Lines changed: 5416 additions & 7427 deletions

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030

3131
steps:
3232
- name: Checkout repository
33-
uses: actions/checkout@v2
33+
uses: actions/checkout@v4
3434
with:
3535
# We must fetch at least the immediate parents so that if this is
3636
# a pull request then we can checkout the head.
@@ -43,7 +43,7 @@ jobs:
4343

4444
# Initializes the CodeQL tools for scanning.
4545
- name: Initialize CodeQL
46-
uses: github/codeql-action/init@v1
46+
uses: github/codeql-action/init@v4
4747
with:
4848
languages: ${{ matrix.language }}
4949
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -54,7 +54,7 @@ jobs:
5454
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5555
# If this step fails, then you should remove it and run the build manually (see below)
5656
- name: Autobuild
57-
uses: github/codeql-action/autobuild@v1
57+
uses: github/codeql-action/autobuild@v4
5858

5959
# ℹ️ Command-line programs to run using the OS shell.
6060
# 📚 https://git.io/JvXDl
@@ -68,4 +68,4 @@ jobs:
6868
# make release
6969

7070
- name: Perform CodeQL Analysis
71-
uses: github/codeql-action/analyze@v1
71+
uses: github/codeql-action/analyze@v4

.github/workflows/dotnet-core.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616
- name: Setup .NET Core
17-
uses: actions/setup-dotnet@v3
17+
uses: actions/setup-dotnet@v4
1818
with:
19-
dotnet-version: '8.x'
19+
dotnet-version: 9.0.x
2020
- name: Install dependencies
2121
run: dotnet restore
2222
- name: Build

src/Hosts/Hosts.CookieAuthentication/Hosts.CookieAuthentication.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

src/Hosts/Hosts.IdentityServerAuthentication/Controllers/LoginController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
using System.Linq;
44
using System.Security.Claims;
55
using System.Threading.Tasks;
6+
using Duende.IdentityServer;
7+
using Duende.IdentityServer.Services;
68
using Hosts.Shared.InMemory;
79
using IdentityManager2;
8-
using IdentityServer4;
9-
using IdentityServer4.Services;
1010
using Microsoft.AspNetCore.Authentication;
1111
using Microsoft.AspNetCore.Http;
1212
using Microsoft.AspNetCore.Mvc;

src/Hosts/Hosts.IdentityServerAuthentication/Hosts.IdentityServerAuthentication.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="IdentityServer4" Version="3.1.0" />
8+
<PackageReference Include="Duende.IdentityServer" Version="7.4.4" />
99
</ItemGroup>
1010

1111
<ItemGroup>

src/Hosts/Hosts.IdentityServerAuthentication/Startup.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
using System.Collections.Generic;
33
using System.IdentityModel.Tokens.Jwt;
44
using System.Linq;
5+
using Duende.IdentityServer.Models;
6+
using Duende.IdentityServer.Test;
57
using Hosts.Shared.InMemory;
68
using IdentityManager2.Configuration;
7-
using IdentityServer4.Models;
8-
using IdentityServer4.Test;
99
using Microsoft.AspNetCore.Builder;
1010
using Microsoft.Extensions.DependencyInjection;
1111

src/Hosts/Hosts.LosthostAuthentication/Hosts.LosthostAuthentication.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

src/Hosts/Hosts.Shared/Hosts.Shared.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

src/IdentityManager2/Api/Controllers/RolesController.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public async Task<IActionResult> GetRolesAsync(string filter = null, int start =
6868

6969
// POST
7070
[HttpPost, Route("", Name = IdentityManagerConstants.RouteNames.CreateRole)]
71+
[ValidateAntiForgeryToken]
7172
public async Task<IActionResult> CreateRoleAsync([FromBody] PropertyValue[] properties)
7273
{
7374
var meta = await GetMetadataAsync();
@@ -140,6 +141,7 @@ public async Task<IActionResult> GetRoleAsync(string subject)
140141
}
141142

142143
[HttpDelete, Route("{subject}", Name = IdentityManagerConstants.RouteNames.DeleteRole)]
144+
[ValidateAntiForgeryToken]
143145
public async Task<IActionResult> DeleteRoleAsync(string subject)
144146
{
145147
var meta = await GetMetadataAsync();
@@ -163,6 +165,7 @@ public async Task<IActionResult> DeleteRoleAsync(string subject)
163165
}
164166

165167
[HttpPut, Route("{subject}/properties/{type}", Name = IdentityManagerConstants.RouteNames.UpdateRoleProperty)]
168+
[ValidateAntiForgeryToken]
166169
public async Task<IActionResult> SetPropertyAsync(string subject, string type)
167170
{
168171
if (IsNullOrWhiteSpace(subject))

src/IdentityManager2/Api/Controllers/UsersController.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public async Task<IActionResult> GetUsersAsync(string filter = null, int start =
5555
}
5656

5757
[HttpPost("", Name = IdentityManagerConstants.RouteNames.CreateUser)]
58+
[ValidateAntiForgeryToken]
5859
public async Task<IActionResult> CreateUserAsync([FromBody] PropertyValue[] properties)
5960
{
6061
var meta = await GetMetadataAsync();
@@ -135,6 +136,7 @@ public async Task<IActionResult> GetUserAsync(string subject)
135136
}
136137

137138
[HttpDelete, Route("{subject}", Name = IdentityManagerConstants.RouteNames.DeleteUser)]
139+
[ValidateAntiForgeryToken]
138140
public async Task<IActionResult> DeleteUserAsync(string subject)
139141
{
140142
var meta = await GetMetadataAsync();
@@ -164,6 +166,7 @@ public async Task<IActionResult> DeleteUserAsync(string subject)
164166
}
165167

166168
[HttpPut, Route("{subject}/properties/{type}", Name = IdentityManagerConstants.RouteNames.UpdateUserProperty)]
169+
[ValidateAntiForgeryToken]
167170
public async Task<IActionResult> SetPropertyAsync(string subject, string type)
168171
{
169172
if (IsNullOrWhiteSpace(subject))
@@ -194,6 +197,7 @@ public async Task<IActionResult> SetPropertyAsync(string subject, string type)
194197
}
195198

196199
[HttpPost, Route("{subject}/claims", Name = IdentityManagerConstants.RouteNames.AddClaim)]
200+
[ValidateAntiForgeryToken]
197201
public async Task<IActionResult> AddClaimAsync(string subject, [FromBody] ClaimValue model)
198202
{
199203
var meta = await GetMetadataAsync();
@@ -229,6 +233,7 @@ public async Task<IActionResult> AddClaimAsync(string subject, [FromBody] ClaimV
229233
}
230234

231235
[HttpDelete, Route("{subject}/claims/{type}/{value}", Name = IdentityManagerConstants.RouteNames.RemoveClaim)]
236+
[ValidateAntiForgeryToken]
232237
public async Task<IActionResult> RemoveClaimAsync(string subject, string type, string value)
233238
{
234239
type = type.FromBase64UrlEncoded();
@@ -257,6 +262,7 @@ public async Task<IActionResult> RemoveClaimAsync(string subject, string type, s
257262
}
258263

259264
[HttpPost, Route("{subject}/roles/{role}", Name = IdentityManagerConstants.RouteNames.AddRole)]
265+
[ValidateAntiForgeryToken]
260266
public async Task<IActionResult> AddRoleAsync(string subject, string role)
261267
{
262268
var meta = await GetMetadataAsync();
@@ -282,6 +288,7 @@ public async Task<IActionResult> AddRoleAsync(string subject, string role)
282288
}
283289

284290
[HttpDelete, Route("{subject}/roles/{role}", Name = IdentityManagerConstants.RouteNames.RemoveRole)]
291+
[ValidateAntiForgeryToken]
285292
public async Task<IActionResult> RemoveRoleAsync(string subject, string role)
286293
{
287294
var meta = await GetMetadataAsync();

0 commit comments

Comments
 (0)