Skip to content

Commit 91ca6c1

Browse files
feat: .NET 10 (#495)
1 parent 060a346 commit 91ca6c1

36 files changed

+3020
-3081
lines changed

.github/renovate.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,6 @@
6565
"tests/**",
6666
"benchmarks/**"
6767
]
68-
},
69-
{
70-
"automerge": true,
71-
"groupName": "Dockerfile Dependencies",
72-
"groupSlug": "dockerfile-dependencies",
73-
"semanticCommitType": "fix",
74-
"matchPackageNames": [
75-
"alpine_*"
76-
]
7768
}
7869
],
7970
"customManagers": [

.github/workflows/cicd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
sudo echo "127.0.0.1 oidc-server.oidc-server" | sudo tee -a /etc/hosts
4646
4747
- name: Install Playwright
48-
working-directory: tests/oidc-guard-tests/bin/Release/net9.0
48+
working-directory: tests/oidc-guard-tests/bin/Release/net10.0
4949
run: ./playwright.ps1 install --with-deps
5050
shell: pwsh
5151

Directory.Build.props

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,54 @@
1-
using BenchmarkDotNet.Attributes;
2-
using BenchmarkDotNet.Jobs;
3-
using FluentAssertions;
4-
using Microsoft.Extensions.Logging;
5-
using oidc_guard_tests.Infra;
6-
using System.Net;
7-
8-
namespace oidc_guard_benchmarks;
9-
10-
[JsonExporterAttribute.FullCompressed]
11-
[MemoryDiagnoser]
12-
public class BenchmarkCookie
13-
{
14-
private HttpClient client = default!;
15-
16-
private string query = "/auth";
17-
18-
[GlobalSetup]
19-
public void GlobalSetup()
20-
{
21-
client = AuthTestsHelpers.GetClient(settings =>
22-
{
23-
settings.LogLevel = LogLevel.Error;
24-
});
25-
26-
var response = client.GetAsync("/signin?rd=/auth").Result;
27-
response.StatusCode.Should().Be(HttpStatusCode.Found);
28-
client.DefaultRequestHeaders.TryAddWithoutValidation("Cookie", response.Headers.GetValues("Set-Cookie"));
29-
}
30-
31-
[Benchmark]
32-
public async Task Auth()
33-
{
34-
await client.GetAsync(query);
35-
}
36-
37-
[Benchmark]
38-
public async Task AuthCheckClaim()
39-
{
40-
await client.GetAsync(query + "?tid=11111111-1111-1111-1111-111111111111");
41-
}
42-
43-
[Benchmark]
44-
public async Task InjectClaims()
45-
{
46-
await client.GetAsync(query + "?inject-claim=tid");
47-
}
48-
49-
[Benchmark]
50-
public async Task InjectJsonClaims()
51-
{
52-
await client.GetAsync(query + "?inject-json-claim=role,gcip,$.firebase.sign_in_attributes.role");
53-
}
54-
}
1+
using BenchmarkDotNet.Attributes;
2+
using BenchmarkDotNet.Jobs;
3+
using FluentAssertions;
4+
using Microsoft.Extensions.Logging;
5+
using oidc_guard_tests.Infra;
6+
using System.Net;
7+
8+
namespace oidc_guard_benchmarks;
9+
10+
[JsonExporterAttribute.FullCompressed]
11+
[MemoryDiagnoser]
12+
public class BenchmarkCookie
13+
{
14+
private HttpClient client = default!;
15+
16+
private string query = "/auth";
17+
18+
[GlobalSetup]
19+
public void GlobalSetup()
20+
{
21+
client = AuthTestsHelpers.GetClient(settings =>
22+
{
23+
settings.LogLevel = LogLevel.Error;
24+
});
25+
26+
var response = client.GetAsync("/signin?rd=/auth").Result;
27+
response.StatusCode.Should().Be(HttpStatusCode.Found);
28+
client.DefaultRequestHeaders.TryAddWithoutValidation("Cookie", response.Headers.GetValues("Set-Cookie"));
29+
}
30+
31+
[Benchmark]
32+
public async Task Auth()
33+
{
34+
await client.GetAsync(query);
35+
}
36+
37+
[Benchmark]
38+
public async Task AuthCheckClaim()
39+
{
40+
await client.GetAsync(query + "?tid=11111111-1111-1111-1111-111111111111");
41+
}
42+
43+
[Benchmark]
44+
public async Task InjectClaims()
45+
{
46+
await client.GetAsync(query + "?inject-claim=tid");
47+
}
48+
49+
[Benchmark]
50+
public async Task InjectJsonClaims()
51+
{
52+
await client.GetAsync(query + "?inject-json-claim=role,gcip,$.firebase.sign_in_attributes.role");
53+
}
54+
}
Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,58 @@
1-
using BenchmarkDotNet.Attributes;
2-
using BenchmarkDotNet.Jobs;
3-
using Microsoft.Extensions.Logging;
4-
using Microsoft.Net.Http.Headers;
5-
using oidc_guard_tests.Infra;
6-
using System.Security.Claims;
7-
8-
namespace oidc_guard_benchmarks;
9-
10-
[JsonExporterAttribute.FullCompressed]
11-
[MemoryDiagnoser]
12-
public class BenchmarkJWT
13-
{
14-
private HttpClient client = default!;
15-
16-
private readonly string query = "/auth";
17-
18-
[GlobalSetup]
19-
public void GlobalSetup()
20-
{
21-
client = AuthTestsHelpers.GetClient(settings =>
22-
{
23-
settings.LogLevel = LogLevel.Error;
24-
});
25-
26-
var claims = new List<Claim>()
27-
{
28-
new Claim("tid", "11111111-1111-1111-1111-111111111111"),
29-
new Claim("gcip", "{\"auth_time\":1553219869,\"email\":\"[email protected]\",\"email_verified\":true,\"firebase\":{\"identities\":{\"email\":[\"[email protected]\"],\"saml.myProvider\":[\"[email protected]\"]},\"sign_in_attributes\":{\"firstname\":\"John\",\"group\":\"test group\",\"role\":\"admin\",\"lastname\":\"Doe\"},\"sign_in_provider\":\"saml.myProvider\",\"tenant\":\"my_tenant_id\"},\"sub\":\"gZG0yELPypZElTmAT9I55prjHg63\"}")
30-
};
31-
32-
client.DefaultRequestHeaders.TryAddWithoutValidation(HeaderNames.Authorization, FakeJwtIssuer.GenerateBearerJwtToken(claims));
33-
}
34-
35-
[Benchmark]
36-
public async Task Auth()
37-
{
38-
await client.GetAsync(query);
39-
}
40-
41-
[Benchmark]
42-
public async Task AuthCheckClaim()
43-
{
44-
await client.GetAsync(query + "?tid=11111111-1111-1111-1111-111111111111");
45-
}
46-
47-
[Benchmark]
48-
public async Task InjectClaims()
49-
{
50-
await client.GetAsync(query + "?inject-claim=tid");
51-
}
52-
53-
[Benchmark]
54-
public async Task InjectJsonClaims()
55-
{
56-
await client.GetAsync(query + "?inject-json-claim=role,gcip,$.firebase.sign_in_attributes.role");
57-
}
58-
}
1+
using BenchmarkDotNet.Attributes;
2+
using BenchmarkDotNet.Jobs;
3+
using Microsoft.Extensions.Logging;
4+
using Microsoft.Net.Http.Headers;
5+
using oidc_guard_tests.Infra;
6+
using System.Security.Claims;
7+
8+
namespace oidc_guard_benchmarks;
9+
10+
[JsonExporterAttribute.FullCompressed]
11+
[MemoryDiagnoser]
12+
public class BenchmarkJWT
13+
{
14+
private HttpClient client = default!;
15+
16+
private readonly string query = "/auth";
17+
18+
[GlobalSetup]
19+
public void GlobalSetup()
20+
{
21+
client = AuthTestsHelpers.GetClient(settings =>
22+
{
23+
settings.LogLevel = LogLevel.Error;
24+
});
25+
26+
var claims = new List<Claim>()
27+
{
28+
new Claim("tid", "11111111-1111-1111-1111-111111111111"),
29+
new Claim("gcip", "{\"auth_time\":1553219869,\"email\":\"[email protected]\",\"email_verified\":true,\"firebase\":{\"identities\":{\"email\":[\"[email protected]\"],\"saml.myProvider\":[\"[email protected]\"]},\"sign_in_attributes\":{\"firstname\":\"John\",\"group\":\"test group\",\"role\":\"admin\",\"lastname\":\"Doe\"},\"sign_in_provider\":\"saml.myProvider\",\"tenant\":\"my_tenant_id\"},\"sub\":\"gZG0yELPypZElTmAT9I55prjHg63\"}")
30+
};
31+
32+
client.DefaultRequestHeaders.TryAddWithoutValidation(HeaderNames.Authorization, FakeJwtIssuer.GenerateBearerJwtToken(claims));
33+
}
34+
35+
[Benchmark]
36+
public async Task Auth()
37+
{
38+
await client.GetAsync(query);
39+
}
40+
41+
[Benchmark]
42+
public async Task AuthCheckClaim()
43+
{
44+
await client.GetAsync(query + "?tid=11111111-1111-1111-1111-111111111111");
45+
}
46+
47+
[Benchmark]
48+
public async Task InjectClaims()
49+
{
50+
await client.GetAsync(query + "?inject-claim=tid");
51+
}
52+
53+
[Benchmark]
54+
public async Task InjectJsonClaims()
55+
{
56+
await client.GetAsync(query + "?inject-json-claim=role,gcip,$.firebase.sign_in_attributes.role");
57+
}
58+
}
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
using BenchmarkDotNet.Running;
2-
3-
namespace oidc_guard_benchmarks;
4-
5-
class Program
6-
{
7-
public static void Main(string[] args)
8-
{
9-
BenchmarkRunner.Run<BenchmarkJWT>();
10-
BenchmarkRunner.Run<BenchmarkCookie>();
11-
}
1+
using BenchmarkDotNet.Running;
2+
3+
namespace oidc_guard_benchmarks;
4+
5+
class Program
6+
{
7+
public static void Main(string[] args)
8+
{
9+
BenchmarkRunner.Run<BenchmarkJWT>();
10+
BenchmarkRunner.Run<BenchmarkCookie>();
11+
}
1212
}
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
2-
3-
<PropertyGroup>
4-
<OutputType>Exe</OutputType>
5-
<TargetFramework>net9.0</TargetFramework>
6-
<RootNamespace>oidc_guard_benchmarks</RootNamespace>
7-
<ImplicitUsings>enable</ImplicitUsings>
8-
<Nullable>enable</Nullable>
9-
<SelfContained>true</SelfContained>
10-
<IsPackable>false</IsPackable>
11-
</PropertyGroup>
12-
13-
<ItemGroup>
14-
<PackageReference Include="BenchmarkDotNet" Version="0.15.2" />
15-
</ItemGroup>
16-
17-
<ItemGroup>
18-
<ProjectReference Include="..\..\src\oidc-guard\oidc-guard.csproj" />
19-
<ProjectReference Include="..\..\tests\oidc-guard-tests\oidc-guard-tests.csproj" />
20-
</ItemGroup>
21-
22-
</Project>
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net10.0</TargetFramework>
6+
<RootNamespace>oidc_guard_benchmarks</RootNamespace>
7+
<ImplicitUsings>enable</ImplicitUsings>
8+
<Nullable>enable</Nullable>
9+
<SelfContained>false</SelfContained>
10+
<IsPackable>false</IsPackable>
11+
</PropertyGroup>
12+
13+
<ItemGroup>
14+
<PackageReference Include="BenchmarkDotNet" Version="0.15.2" />
15+
</ItemGroup>
16+
17+
<ItemGroup>
18+
<ProjectReference Include="..\..\src\oidc-guard\oidc-guard.csproj" />
19+
<ProjectReference Include="..\..\tests\oidc-guard-tests\oidc-guard-tests.csproj" />
20+
</ItemGroup>
21+
22+
</Project>

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "9.0.305",
3+
"version": "10.0.100-rc.1.25451.107",
44
"rollForward": "latestFeature"
55
}
66
}

src/oidc-guard/.dockerignore

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
1-
**/.classpath
2-
**/.dockerignore
3-
**/.env
4-
**/.git
5-
**/.gitignore
6-
**/.project
7-
**/.settings
8-
**/.toolstarget
9-
**/.vs
10-
**/.vscode
11-
**/*.*proj.user
12-
**/*.dbmdl
13-
**/*.jfm
14-
**/azds.yaml
15-
**/bin
16-
**/charts
17-
**/docker-compose*
18-
**/Dockerfile*
19-
**/node_modules
20-
**/npm-debug.log
21-
**/obj
22-
**/secrets.dev.yaml
23-
**/values.dev.yaml
24-
LICENSE
25-
README.md
1+
**/.classpath
2+
**/.dockerignore
3+
**/.env
4+
**/.git
5+
**/.gitignore
6+
**/.project
7+
**/.settings
8+
**/.toolstarget
9+
**/.vs
10+
**/.vscode
11+
**/*.*proj.user
12+
**/*.dbmdl
13+
**/*.jfm
14+
**/azds.yaml
15+
**/bin
16+
**/charts
17+
**/docker-compose*
18+
**/Dockerfile*
19+
**/node_modules
20+
**/npm-debug.log
21+
**/obj
22+
**/secrets.dev.yaml
23+
**/values.dev.yaml
24+
LICENSE
25+
README.md
26+
!**/.gitignore
27+
!.git/HEAD
28+
!.git/config
29+
!.git/packed-refs
30+
!.git/refs/heads/**

0 commit comments

Comments
 (0)