Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/SimpleAuthentication.Abstractions/ApiKey/ApiKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace SimpleAuthentication.ApiKey;
/// <param name="Value">The API key value</param>
/// <param name="UserName">The user name associated with the current key</param>
/// <param name="Roles">The list of roles to assign to the user</param>
public record class ApiKey(string Value, string UserName, IEnumerable<string> Roles)
public record class ApiKey(string Value, string UserName, IEnumerable<string>? Roles = null)
{
/// <inheritdoc />
public virtual bool Equals(ApiKey? other)
Expand All @@ -25,8 +25,5 @@ public virtual bool Equals(ApiKey? other)
}

/// <inheritdoc />
public override int GetHashCode()
{
return HashCode.Combine(Value, UserName);
}
public override int GetHashCode() => HashCode.Combine(Value, UserName);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace SimpleAuthentication.BasicAuthentication;
/// <param name="UserName">The user name</param>
/// <param name="Password">The password</param>
/// <param name="Roles">The list of roles to assign to the user</param>
public record class Credential(string UserName, string Password, IEnumerable<string> Roles)
public record class Credential(string UserName, string Password, IEnumerable<string>? Roles = null)
{
/// <inheritdoc />
public virtual bool Equals(Credential? other)
Expand All @@ -25,8 +25,5 @@ public virtual bool Equals(Credential? other)
}

/// <inheritdoc />
public override int GetHashCode()
{
return HashCode.Combine(UserName, Password);
}
public override int GetHashCode() => HashCode.Combine(UserName, Password);
}