Skip to content

Commit 57fc9b8

Browse files
Copilotmarcominerva
andcommitted
Move ApiKey and Credential classes to separate files
Co-authored-by: marcominerva <3522534+marcominerva@users.noreply.github.com>
1 parent 113053b commit 57fc9b8

4 files changed

Lines changed: 18 additions & 16 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace SimpleAuthentication.ApiKey;
2+
3+
/// <summary>
4+
/// Store API Keys for API Key Authentication
5+
/// </summary>
6+
/// <param name="Value">The API key value</param>
7+
/// <param name="UserName">The user name associated with the current key</param>
8+
/// <param name="Roles">The optional list of roles to assign to the user</param>
9+
public record class ApiKey(string Value, string UserName, string[]? Roles = null);

src/SimpleAuthentication.Abstractions/ApiKey/ApiKeySettings.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,3 @@ public ICollection<ApiKey> ApiKeys
8888
/// </remarks>
8989
public string RoleClaimType { get; set; } = ClaimsIdentity.DefaultRoleClaimType;
9090
}
91-
92-
/// <summary>
93-
/// Store API Keys for API Key Authentication
94-
/// </summary>
95-
/// <param name="Value">The API key value</param>
96-
/// <param name="UserName">The user name associated with the current key</param>
97-
/// <param name="Roles">The optional list of roles to assign to the user</param>
98-
public record class ApiKey(string Value, string UserName, string[]? Roles = null);

src/SimpleAuthentication.Abstractions/BasicAuthentication/BasicAuthenticationSettings.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,3 @@ public ICollection<Credential> Credentials
7878
public string RoleClaimType { get; set; } = ClaimsIdentity.DefaultRoleClaimType;
7979

8080
}
81-
82-
/// <summary>
83-
/// Store credentials used for Basic Authentication.
84-
/// </summary>
85-
/// <param name="UserName">The user name</param>
86-
/// <param name="Password">The password</param>
87-
/// <param name="Roles">The optional list of roles to assign to the user</param>
88-
public record class Credential(string UserName, string Password, string[]? Roles = null);
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace SimpleAuthentication.BasicAuthentication;
2+
3+
/// <summary>
4+
/// Store credentials used for Basic Authentication.
5+
/// </summary>
6+
/// <param name="UserName">The user name</param>
7+
/// <param name="Password">The password</param>
8+
/// <param name="Roles">The optional list of roles to assign to the user</param>
9+
public record class Credential(string UserName, string Password, string[]? Roles = null);

0 commit comments

Comments
 (0)