Move ApiKeyAuthenticationHandler and associated files to Authentication folder

This commit is contained in:
Robert Marshall 2021-05-08 09:25:33 +01:00
parent 3f1ab3eb12
commit 3331775a0b
4 changed files with 4 additions and 4 deletions

View file

@ -8,7 +8,7 @@ using System.Security.Claims;
using System.Text.Encodings.Web; using System.Text.Encodings.Web;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Robware.Api.Auth.ApiKey { namespace Robware.Api.Auth.Authentication {
public class ApiKeyAuthenticationHandler : AuthenticationHandler<ApiKeyAuthenticationOptions> { public class ApiKeyAuthenticationHandler : AuthenticationHandler<ApiKeyAuthenticationOptions> {
private const string ApiKeyHeaderName = "X-Api-Key"; private const string ApiKeyHeaderName = "X-Api-Key";
private readonly IApiKeyValidator _apiKeyValidator; private readonly IApiKeyValidator _apiKeyValidator;

View file

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication;
namespace Robware.Api.Auth.ApiKey { namespace Robware.Api.Auth.Authentication {
public class ApiKeyAuthenticationOptions : AuthenticationSchemeOptions { public class ApiKeyAuthenticationOptions : AuthenticationSchemeOptions {
public const string DefaultScheme = "API Key"; public const string DefaultScheme = "API Key";
public string Scheme => DefaultScheme; public string Scheme => DefaultScheme;

View file

@ -1,7 +1,7 @@
using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication;
using System; using System;
namespace Robware.Api.Auth.ApiKey { namespace Robware.Api.Auth.Authentication {
public static class AuthenticationBuilderExtensions { public static class AuthenticationBuilderExtensions {
public static AuthenticationBuilder AddApiKeySupport(this AuthenticationBuilder authenticationBuilder, Action<ApiKeyAuthenticationOptions> options) { public static AuthenticationBuilder AddApiKeySupport(this AuthenticationBuilder authenticationBuilder, Action<ApiKeyAuthenticationOptions> options) {
return authenticationBuilder.AddScheme<ApiKeyAuthenticationOptions, ApiKeyAuthenticationHandler>(ApiKeyAuthenticationOptions.DefaultScheme, options); return authenticationBuilder.AddScheme<ApiKeyAuthenticationOptions, ApiKeyAuthenticationHandler>(ApiKeyAuthenticationOptions.DefaultScheme, options);

View file

@ -4,7 +4,7 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using MongoDB.Driver; using MongoDB.Driver;
using Robware.Api.Auth.ApiKey; using Robware.Api.Auth.Authentication;
using Robware.Auth.API; using Robware.Auth.API;
using Robware.Auth.Users; using Robware.Auth.Users;
using Robware.Data; using Robware.Data;