Skip to content

Commit dc0f7b6

Browse files
committed
fix(SDK): Made all authentication schemes properties nullable, enabling proper ASP.NET validation when using secret-based authentication
Signed-off-by: Charles d'Avernas <[email protected]>
1 parent 4773537 commit dc0f7b6

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/ServerlessWorkflow.Sdk/Models/Authentication/BasicAuthenticationSchemeDefinition.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ public record BasicAuthenticationSchemeDefinition
2929
/// Gets/sets the username used for authentication
3030
/// </summary>
3131
[DataMember(Name = "username", Order = 1), JsonPropertyName("username"), JsonPropertyOrder(1), YamlMember(Alias = "username", Order = 1)]
32-
public virtual string Username { get; set; } = null!;
32+
public virtual string? Username { get; set; }
3333

3434
/// <summary>
3535
/// Gets/sets the password used for authentication
3636
/// </summary>
3737
[DataMember(Name = "password", Order = 2), JsonPropertyName("password"), JsonPropertyOrder(2), YamlMember(Alias = "password", Order = 2)]
38-
public virtual string Password { get; set; } = null!;
38+
public virtual string? Password { get; set; }
3939

4040
}

src/ServerlessWorkflow.Sdk/Models/Authentication/BearerAuthenticationSchemeDefinition.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ public record BearerAuthenticationSchemeDefinition
2929
/// Gets/sets the bearer token used for authentication
3030
/// </summary>
3131
[DataMember(Name = "token", Order = 1), JsonPropertyName("token"), JsonPropertyOrder(1), YamlMember(Alias = "token", Order = 1)]
32-
public virtual string Token { get; set; } = null!;
32+
public virtual string? Token { get; set; }
3333

3434
}

src/ServerlessWorkflow.Sdk/Models/Authentication/DigestAuthenticationSchemeDefinition.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ public record DigestAuthenticationSchemeDefinition
2929
/// Gets/sets the username used for authentication
3030
/// </summary>
3131
[DataMember(Name = "username", Order = 1), JsonPropertyName("username"), JsonPropertyOrder(1), YamlMember(Alias = "username", Order = 1)]
32-
public virtual string Username { get; set; } = null!;
32+
public virtual string? Username { get; set; }
3333

3434
/// <summary>
3535
/// Gets/sets the password used for authentication
3636
/// </summary>
3737
[DataMember(Name = "password", Order = 2), JsonPropertyName("password"), JsonPropertyOrder(2), YamlMember(Alias = "password", Order = 2)]
38-
public virtual string Password { get; set; } = null!;
38+
public virtual string? Password { get; set; }
3939

4040
}

0 commit comments

Comments
 (0)