Skip to content

Commit ba756b7

Browse files
committed
move EasyAuthWithHeaderSerivce in a separate namespace
1 parent 743403e commit ba756b7

6 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/KK.AspNetCore.EasyAuthAuthentication/Services/EasyAuthWithHeaderService.cs renamed to src/KK.AspNetCore.EasyAuthAuthentication/Services/Base/EasyAuthWithHeaderService.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace KK.AspNetCore.EasyAuthAuthentication.Services
1+
namespace KK.AspNetCore.EasyAuthAuthentication.Services.Base
22
{
33
using System;
44
using System.Collections.Generic;
@@ -15,7 +15,7 @@ namespace KK.AspNetCore.EasyAuthAuthentication.Services
1515
/// <summary>
1616
/// A service that can be used to authentificat a user principal in the <see cref="EasyAuthAuthenticationHandler"/>.
1717
/// </summary>
18-
public abstract class EasyAuthWithHeaderService<T> : IEasyAuthAuthentificationService where T : IEasyAuthAuthentificationService
18+
public abstract class EasyAuthWithHeaderService<TypeOfService> : IEasyAuthAuthentificationService where TypeOfService : IEasyAuthAuthentificationService
1919
{
2020
private const string PrincipalObjectHeader = "X-MS-CLIENT-PRINCIPAL";
2121
protected const string PrincipalIdpHeaderName = "X-MS-CLIENT-PRINCIPAL-IDP";
@@ -27,7 +27,7 @@ public abstract class EasyAuthWithHeaderService<T> : IEasyAuthAuthentificationSe
2727
(headers, headerName) => !string.IsNullOrEmpty(headers[headerName].ToString());
2828

2929
#pragma warning disable IDE1006 // Naming Styles rule is broken
30-
protected ProviderOptions defaultOptions = new ProviderOptions(typeof(T).Name, ClaimTypes.Email, ClaimTypes.Role);
30+
protected ProviderOptions defaultOptions = new ProviderOptions(typeof(TypeOfService).Name, ClaimTypes.Email, ClaimTypes.Role);
3131
#pragma warning restore IDE1006 // Naming Styles
3232

3333

@@ -37,7 +37,7 @@ public abstract class EasyAuthWithHeaderService<T> : IEasyAuthAuthentificationSe
3737
/// </summary>
3838
/// <param name="logger">The logger for this service.</param>
3939
public EasyAuthWithHeaderService(
40-
ILogger<EasyAuthWithHeaderService<T>> logger) => this.Logger = logger;
40+
ILogger<EasyAuthWithHeaderService<TypeOfService>> logger) => this.Logger = logger;
4141

4242
protected ILogger Logger { get; }
4343

src/KK.AspNetCore.EasyAuthAuthentication/Services/EasyAuthAzureAdService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ namespace KK.AspNetCore.EasyAuthAuthentication.Services
66
using Microsoft.AspNetCore.Authentication;
77
using Microsoft.AspNetCore.Http;
88
using Microsoft.Extensions.Logging;
9+
using KK.AspNetCore.EasyAuthAuthentication.Services.Base;
910

1011
public class EasyAuthAzureAdService: EasyAuthWithHeaderService<EasyAuthAzureAdService>, IEasyAuthAuthentificationService
1112
{

src/KK.AspNetCore.EasyAuthAuthentication/Services/EasyAuthFacebookService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ namespace KK.AspNetCore.EasyAuthAuthentication.Services
66
using Microsoft.AspNetCore.Authentication;
77
using Microsoft.AspNetCore.Http;
88
using Microsoft.Extensions.Logging;
9+
using KK.AspNetCore.EasyAuthAuthentication.Services.Base;
910

1011
public class EasyAuthFacebookService : EasyAuthWithHeaderService<EasyAuthFacebookService>, IEasyAuthAuthentificationService
1112
{

src/KK.AspNetCore.EasyAuthAuthentication/Services/EasyAuthGoogleService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ namespace KK.AspNetCore.EasyAuthAuthentication.Services
66
using Microsoft.AspNetCore.Authentication;
77
using Microsoft.AspNetCore.Http;
88
using Microsoft.Extensions.Logging;
9+
using KK.AspNetCore.EasyAuthAuthentication.Services.Base;
910

1011
public class EasyAuthGoogleService : EasyAuthWithHeaderService<EasyAuthGoogleService>, IEasyAuthAuthentificationService
1112
{

src/KK.AspNetCore.EasyAuthAuthentication/Services/EasyAuthMicrosoftService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ namespace KK.AspNetCore.EasyAuthAuthentication.Services
66
using Microsoft.AspNetCore.Authentication;
77
using Microsoft.AspNetCore.Http;
88
using Microsoft.Extensions.Logging;
9+
using KK.AspNetCore.EasyAuthAuthentication.Services.Base;
910

1011
public class EasyAuthMicrosoftService : EasyAuthWithHeaderService<EasyAuthMicrosoftService>, IEasyAuthAuthentificationService
1112
{

src/KK.AspNetCore.EasyAuthAuthentication/Services/EasyAuthTwitterService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ namespace KK.AspNetCore.EasyAuthAuthentication.Services
66
using Microsoft.AspNetCore.Authentication;
77
using Microsoft.AspNetCore.Http;
88
using Microsoft.Extensions.Logging;
9+
using KK.AspNetCore.EasyAuthAuthentication.Services.Base;
910

1011
public class EasyAuthTwitterService : EasyAuthWithHeaderService<EasyAuthTwitterService>, IEasyAuthAuthentificationService
1112
{

0 commit comments

Comments
 (0)