diff --git a/.editorconfig b/.editorconfig
index 1e503d1..382ea0b 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -489,10 +489,14 @@ roslynator_refactorings.enabled = true
roslynator_compiler_diagnostic_fixes.enabled = true
tab_width = 4
-#
+# default|none|silent|suggestion|warning|error
dotnet_diagnostic.CA1848.severity = silent
dotnet_diagnostic.CA1305.severity = silent
dotnet_diagnostic.CA2016.severity = warning
+dotnet_diagnostic.RCS1163.severity = silent
+dotnet_diagnostic.RCS1228.severity = silent
+dotnet_diagnostic.RCS1141.severity = silent
+dotnet_diagnostic.RCS1006.severity = suggestion
[{*.har,*.jsb2,*.jsb3,*.json,.babelrc,.eslintrc,.stylelintrc,bowerrc,jest.config}]
indent_style = space
diff --git a/common.props b/common.props
new file mode 100644
index 0000000..b5cb0f2
--- /dev/null
+++ b/common.props
@@ -0,0 +1,31 @@
+
+
+ enable
+ latest-minimum
+ True
+ 1701;1702;CS1591
+ latest
+ Passingwind
+ https://github.com/jxnkwlp/Passingwind.CommonLibs
+ https://github.com/jxnkwlp/Passingwind.CommonLibs
+ git
+ README.md
+ MIT
+ True
+ snupkg
+
+
+
+
+ True
+ \
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers
+
+
+
diff --git a/src/Authentication.ApiKey/source/ApiKeyExtensions.cs b/src/Authentication.ApiKey/source/ApiKeyExtensions.cs
index 19d6441..36d5062 100644
--- a/src/Authentication.ApiKey/source/ApiKeyExtensions.cs
+++ b/src/Authentication.ApiKey/source/ApiKeyExtensions.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.AspNetCore.Authentication;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
@@ -14,6 +14,7 @@ public static class ApiKeyExtensions
///
/// Enables ApiKey authentication using the default scheme
///
+ ///
public static AuthenticationBuilder AddApiKey(this AuthenticationBuilder builder) where TApiKeyProvider : class, IApiKeyProvider
{
return AddApiKey(builder: builder, authenticationScheme: ApiKeyDefaults.AuthenticationScheme, displayName: null, configureOptions: _ => { });
@@ -22,6 +23,7 @@ public static AuthenticationBuilder AddApiKey(this Authenticati
///
/// Enables ApiKey authentication
///
+ ///
public static AuthenticationBuilder AddApiKey(this AuthenticationBuilder builder, string authenticationScheme) where TApiKeyProvider : class, IApiKeyProvider
{
return AddApiKey(builder: builder, authenticationScheme: authenticationScheme, displayName: null, configureOptions: _ => { });
@@ -30,6 +32,7 @@ public static AuthenticationBuilder AddApiKey(this Authenticati
///
/// Enables ApiKey authentication
///
+ ///
public static AuthenticationBuilder AddApiKey(this AuthenticationBuilder builder, Action configureOptions) where TApiKeyProvider : class, IApiKeyProvider
{
return AddApiKey(builder: builder, authenticationScheme: ApiKeyDefaults.AuthenticationScheme, displayName: null, configureOptions: configureOptions);
@@ -38,6 +41,7 @@ public static AuthenticationBuilder AddApiKey(this Authenticati
///
/// Enables ApiKey authentication
///
+ ///
public static AuthenticationBuilder AddApiKey(this AuthenticationBuilder builder, string authenticationScheme, Action configureOptions) where TApiKeyProvider : class, IApiKeyProvider
{
return AddApiKey(builder: builder, authenticationScheme: authenticationScheme, displayName: null, configureOptions: configureOptions);
@@ -46,6 +50,7 @@ public static AuthenticationBuilder AddApiKey(this Authenticati
///
/// Enables ApiKey authentication
///
+ ///
public static AuthenticationBuilder AddApiKey(this AuthenticationBuilder builder, string authenticationScheme, string? displayName, Action configureOptions) where TApiKeyProvider : class, IApiKeyProvider
{
builder.Services.TryAddTransient();
@@ -58,4 +63,4 @@ public static AuthenticationBuilder AddApiKey(this Authenticati
return builder;
}
-}
\ No newline at end of file
+}
diff --git a/src/Authentication.ApiKey/source/ApiKeyHandler.cs b/src/Authentication.ApiKey/source/ApiKeyHandler.cs
index a0a558f..0feec53 100644
--- a/src/Authentication.ApiKey/source/ApiKeyHandler.cs
+++ b/src/Authentication.ApiKey/source/ApiKeyHandler.cs
@@ -1,3 +1,4 @@
+using System;
using System.Net.Http.Headers;
using System.Security.Claims;
using System.Text;
@@ -22,11 +23,30 @@ public class ApiKeyHandler : AuthenticationHandler
///
protected new ApiKeyEvents Events { get => (ApiKeyEvents)base.Events!; set => base.Events = value; }
+#if NET8_0_OR_GREATER
///
+ [Obsolete("ISystemClock is obsolete, use TimeProvider on AuthenticationSchemeOptions instead.")]
public ApiKeyHandler(IOptionsMonitor options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock, IApiKeyProvider apiKeyProvider) : base(options, logger, encoder, clock)
{
ApiKeyProvider = apiKeyProvider;
}
+ ///
+ public ApiKeyHandler(IOptionsMonitor options, ILoggerFactory logger, UrlEncoder encoder, IApiKeyProvider apiKeyProvider) : base(options, logger, encoder)
+ {
+ ApiKeyProvider = apiKeyProvider;
+ }
+#else
+ ///
+ public ApiKeyHandler(
+ IOptionsMonitor options,
+ ILoggerFactory logger,
+ UrlEncoder encoder,
+ ISystemClock clock,
+ IApiKeyProvider apiKeyProvider) : base(options, logger, encoder, clock)
+ {
+ ApiKeyProvider = apiKeyProvider;
+ }
+#endif
///
protected override Task