Skip to content

Commit e6bcea7

Browse files
authored
v5.2.0 (#32)
Co-authored-by: JT <Hawxy@users.noreply.github.com>
1 parent 7c21de6 commit e6bcea7

File tree

8 files changed

+124
-44
lines changed

8 files changed

+124
-44
lines changed

.github/workflows/Build_&_Test.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# - To turn off auto-generation set:
77
#
8-
# [GitHubActions (AutoGenerate = false)]
8+
# [GithubActionsExtended (AutoGenerate = false)]
99
#
1010
# - To trigger manual generation invoke:
1111
#
@@ -31,7 +31,17 @@ jobs:
3131
steps:
3232
- uses: actions/setup-dotnet@v4
3333
with:
34-
dotnet-version: '9'
34+
dotnet-version: |
35+
8.0
36+
9.0
37+
10.0
3538
- uses: actions/checkout@v4
39+
- name: 'Cache: .nuke/temp, ~/.nuget/packages'
40+
uses: actions/cache@v4
41+
with:
42+
path: |
43+
.nuke/temp
44+
~/.nuget/packages
45+
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }}
3646
- name: 'Run: Test'
3747
run: ./build.cmd Test

.github/workflows/Manual_Nuget_Push.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# - To turn off auto-generation set:
77
#
8-
# [GitHubActions (AutoGenerate = false)]
8+
# [GithubActionsExtended (AutoGenerate = false)]
99
#
1010
# - To trigger manual generation invoke:
1111
#
@@ -25,8 +25,18 @@ jobs:
2525
steps:
2626
- uses: actions/setup-dotnet@v4
2727
with:
28-
dotnet-version: '9'
28+
dotnet-version: |
29+
8.0
30+
9.0
31+
10.0
2932
- uses: actions/checkout@v4
33+
- name: 'Cache: .nuke/temp, ~/.nuget/packages'
34+
uses: actions/cache@v4
35+
with:
36+
path: |
37+
.nuke/temp
38+
~/.nuget/packages
39+
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }}
3040
- name: 'Run: NugetPush'
3141
run: ./build.cmd NugetPush
3242
env:

build/Build.cs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,18 @@
1414
using static Nuke.Common.Tools.DotNet.DotNetTasks;
1515

1616

17-
[GitHubActions(
17+
[GithubActionsExtended(
1818
"Build & Test",
1919
GitHubActionsImage.UbuntuLatest,
20-
OnPushBranches = new []{ "main" },
21-
OnPullRequestBranches = new []{ "main" },
22-
InvokedTargets = new[] { nameof(Test) },
23-
AutoGenerate = false)]
24-
[GitHubActions(
20+
OnPushBranches = ["main"],
21+
OnPullRequestBranches = ["main"],
22+
InvokedTargets = [nameof(Test)])]
23+
[GithubActionsExtended(
2524
"Manual Nuget Push",
2625
GitHubActionsImage.UbuntuLatest,
27-
On = new[] { GitHubActionsTrigger.WorkflowDispatch },
28-
InvokedTargets = new[] { nameof(NugetPush) },
29-
ImportSecrets = new[] { nameof(NugetApiKey) },
30-
AutoGenerate = false)]
26+
On = [GitHubActionsTrigger.WorkflowDispatch],
27+
InvokedTargets = [nameof(NugetPush)],
28+
ImportSecrets = [nameof(NugetApiKey)])]
3129
class Build : NukeBuild
3230
{
3331
/// Support plugins are available for:
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
using System.Collections.Generic;
2+
using Nuke.Common.CI.GitHubActions;
3+
using Nuke.Common.CI.GitHubActions.Configuration;
4+
using Nuke.Common.Execution;
5+
using Nuke.Common.Utilities;
6+
7+
public class GitHubActionsSetupDotNetStep : GitHubActionsStep
8+
{
9+
public GitHubActionsSetupDotNetStep(string[] versions)
10+
{
11+
Versions = versions;
12+
}
13+
14+
string[] Versions { get; }
15+
16+
public override void Write(CustomFileWriter writer)
17+
{
18+
writer.WriteLine("- uses: actions/setup-dotnet@v4");
19+
20+
using (writer.Indent())
21+
{
22+
writer.WriteLine("with:");
23+
using (writer.Indent())
24+
{
25+
writer.WriteLine("dotnet-version: |");
26+
using (writer.Indent())
27+
{
28+
foreach (var version in Versions)
29+
{
30+
writer.WriteLine(version);
31+
}
32+
}
33+
}
34+
}
35+
}
36+
}
37+
38+
public class GithubActionsExtendedAttribute : GitHubActionsAttribute
39+
{
40+
public GithubActionsExtendedAttribute(string name, GitHubActionsImage image, params GitHubActionsImage[] images) : base(name, image, images)
41+
{
42+
}
43+
44+
protected override GitHubActionsJob GetJobs(GitHubActionsImage image,
45+
IReadOnlyCollection<ExecutableTarget> relevantTargets)
46+
{
47+
var job = base.GetJobs(image, relevantTargets);
48+
49+
var newSteps = new List<GitHubActionsStep>(job.Steps);
50+
newSteps.Insert(0, new GitHubActionsSetupDotNetStep([
51+
"8.0", "9.0", "10.0"
52+
]));
53+
54+
job.Steps = newSteps.ToArray();
55+
56+
return job;
57+
}
58+
}

src/Auth0Net.DependencyInjection/Auth0Extensions.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,16 @@ private static IHttpClientBuilder AddAuth0AuthenticationClientInternal(this ISer
9191

9292
services.AddSingleton<IAuthenticationApiClient, InjectableAuthenticationApiClient>();
9393
return services.AddHttpClient<IAuthenticationConnection, HttpClientAuthenticationConnection>()
94-
#if !NETFRAMEWORK
95-
// TODO drop this code with the release of .NET 10
94+
#if NET8_0
9695
.ConfigurePrimaryHttpMessageHandler(() =>
9796
new SocketsHttpHandler()
9897
{
9998
PooledConnectionLifetime = TimeSpan.FromMinutes(2)
10099
})
100+
.SetHandlerLifetime(Timeout.InfiniteTimeSpan)
101101
#endif
102-
.SetHandlerLifetime(Timeout.InfiniteTimeSpan);
102+
;
103+
103104
}
104105

105106

@@ -117,14 +118,15 @@ public static IHttpClientBuilder AddAuth0ManagementClient(this IServiceCollectio
117118
services.AddSingleton<IManagementApiClient, InjectableManagementApiClient>();
118119

119120
return services.AddHttpClient<IManagementConnection, HttpClientManagementConnection>()
120-
#if !NETFRAMEWORK
121+
#if NET8_0
121122
.ConfigurePrimaryHttpMessageHandler(() =>
122123
new SocketsHttpHandler()
123124
{
124125
PooledConnectionLifetime = TimeSpan.FromMinutes(2)
125126
})
127+
.SetHandlerLifetime(Timeout.InfiniteTimeSpan)
126128
#endif
127-
.SetHandlerLifetime(Timeout.InfiniteTimeSpan);
129+
;
128130
}
129131

130132
/// <summary>

src/Auth0Net.DependencyInjection/Auth0Net.DependencyInjection.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>net48;net8.0;net9.0</TargetFrameworks>
4+
<TargetFrameworks>net48;net8.0;net9.0;net10.0</TargetFrameworks>
55
<GenerateDocumentationFile>true</GenerateDocumentationFile>
66
<Nullable>enable</Nullable>
77
<ImplicitUsings>enable</ImplicitUsings>
8-
<Version>5.1.0</Version>
8+
<Version>5.2.0</Version>
99
<Authors>Hawxy</Authors>
1010
<Description>Dependency Injection, HttpClientFactory &amp; ASP.NET Core extensions for Auth0.NET</Description>
1111
<LangVersion>latest</LangVersion>
1212
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
13-
<Copyright>Hawxy (JT) 2020-2025</Copyright>
13+
<Copyright>Hawxy (JT) 2020-2026</Copyright>
1414
<PackageIcon>icon.png</PackageIcon>
1515
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1616
<PackageProjectUrl>https://github.com/Hawxy/Auth0Net.DependencyInjection</PackageProjectUrl>
@@ -21,29 +21,38 @@
2121
</PropertyGroup>
2222

2323
<ItemGroup>
24-
<PackageReference Include="Auth0.AuthenticationApi" Version="7.36.0" />
25-
<PackageReference Include="Auth0.ManagementApi" Version="7.36.0" />
26-
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.2.25" PrivateAssets="All" />
27-
<PackageReference Include="ZiggyCreatures.FusionCache" Version="2.2.0" />
28-
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.4" />
24+
<PackageReference Include="Auth0.AuthenticationApi" Version="7.42.0" />
25+
<PackageReference Include="Auth0.ManagementApi" Version="7.42.0" />
26+
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.2.39" PrivateAssets="All" />
27+
<PackageReference Include="ZiggyCreatures.FusionCache" Version="2.4.0" />
2928
</ItemGroup>
3029

3130
<ItemGroup Condition=" '$(TargetFramework)' == 'net48' ">
3231
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.1" />
3332
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.1" />
34-
<PackageReference Include="Polyfill" Version="7.31.0" PrivateAssets="all" />
33+
<PackageReference Include="Polyfill" Version="9.1.0" PrivateAssets="all" />
34+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.11" />
3535
</ItemGroup>
3636

3737
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
3838
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.1" />
3939
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.10.0" />
4040
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
41+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.11" />
4142
</ItemGroup>
4243

4344
<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0' ">
44-
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.4" />
45-
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="9.4.0" />
46-
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.4" />
45+
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.11" />
46+
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="9.10.0" />
47+
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.11" />
48+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.11" />
49+
</ItemGroup>
50+
51+
<ItemGroup Condition=" '$(TargetFramework)' == 'net10.0' ">
52+
<PackageReference Include="Microsoft.Extensions.Http" Version="10.0.0" />
53+
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="10.0.0" />
54+
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.0" />
55+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="10.0.0" />
4756
</ItemGroup>
4857

4958
<ItemGroup>

src/Auth0Net.DependencyInjection/Auth0ResilienceExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public static class Auth0ResilienceExtensions
1717
/// <param name="builder">The underlying <see cref="IHttpClientBuilder"/></param>
1818
/// <param name="maxRetryAttempts">The max number of retry attempts to Auth0. Defaults to 10.</param>
1919
/// <returns></returns>
20-
public static IHttpResiliencePipelineBuilder AddAuth0RateLimitResilience(this IHttpClientBuilder builder, int maxRetryAttempts = 10)
20+
public static IHttpResiliencePipelineBuilder AddAuth0RateLimitResilience(this IHttpClientBuilder builder, int maxRetryAttempts = 4)
2121
{
2222
return builder.AddResilienceHandler("RateLimitRetry",
2323
pipelineBuilder =>

tests/Auth0Net.DependencyInjection.Tests/Auth0Net.DependencyInjection.Tests.csproj

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

33
<PropertyGroup>
4-
<IsPackable>false</IsPackable>
5-
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
4+
<OutputType>Exe</OutputType>
5+
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
66
<LangVersion>latest</LangVersion>
7+
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
78
</PropertyGroup>
89

910
<ItemGroup>
1011
<PackageReference Include="FakeItEasy" Version="8.3.0" />
11-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
12-
<PackageReference Include="xunit.v3" Version="2.0.2" />
13-
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.0">
14-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
15-
<PrivateAssets>all</PrivateAssets>
16-
</PackageReference>
17-
<PackageReference Include="coverlet.collector" Version="6.0.3">
18-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
19-
<PrivateAssets>all</PrivateAssets>
20-
</PackageReference>
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
13+
<PackageReference Include="xunit.v3" Version="3.2.0" />
2114
</ItemGroup>
2215

2316
<ItemGroup>

0 commit comments

Comments
 (0)