Skip to content

Commit 01b8ee3

Browse files
Copilotmarcominerva
andcommitted
Make Roles property non-nullable with empty array default in settings classes
Co-authored-by: marcominerva <3522534+marcominerva@users.noreply.github.com>
1 parent a356735 commit 01b8ee3

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/SimpleAuthentication.Abstractions/ApiKey/ApiKeySettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public class ApiKeySettings : AuthenticationSchemeOptions
4646
/// </summary>
4747
/// <seealso cref="ApiKeyValue"/>
4848
/// <seealso cref="UserName"/>
49-
public IEnumerable<string>? Roles { get; set; }
49+
public IEnumerable<string> Roles { get; set; } = [];
5050

5151
private ICollection<ApiKey> apiKeys = [];
5252
/// <summary>

src/SimpleAuthentication.Abstractions/BasicAuthentication/BasicAuthenticationSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class BasicAuthenticationSettings : AuthenticationSchemeOptions
3535
/// </summary>
3636
/// <seealso cref="UserName"/>
3737
/// <seealso cref="Password"/>
38-
public IEnumerable<string>? Roles { get; set; }
38+
public IEnumerable<string> Roles { get; set; } = [];
3939

4040
private ICollection<Credential> credentials = [];
4141
/// <summary>

0 commit comments

Comments
 (0)