-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- feat(Sdk): Added a new
Metadata
property to both WorkflowDefiniti…
…on and TaskDefinition, addressing serverlessworkflow/specification#996 - feat(Sdk): Added a `Certificate`, `Digest` and `OIDC` authentication schemes, and updated the OAuth2AuthenticationSchemeDefinition, addressing serverlessworkflow/specification#973 Signed-off-by: Charles d'Avernas <charles.davernas@neuroglia.io>
- Loading branch information
Showing
20 changed files
with
454 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...ServerlessWorkflow.Sdk/Models/Authentication/CertificateAuthenticationSchemeDefinition.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright © 2024-Present The Serverless Workflow Specification Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"), | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
namespace ServerlessWorkflow.Sdk.Models.Authentication; | ||
|
||
/// <summary> | ||
/// Represents the definition of a certificate authentication scheme | ||
/// </summary> | ||
[DataContract] | ||
public record CertificateAuthenticationSchemeDefinition | ||
: AuthenticationSchemeDefinition | ||
{ | ||
|
||
/// <inheritdoc/> | ||
[IgnoreDataMember, JsonIgnore, YamlIgnore] | ||
public override string Scheme => AuthenticationScheme.Certificate; | ||
|
||
} |
40 changes: 40 additions & 0 deletions
40
src/ServerlessWorkflow.Sdk/Models/Authentication/DigestAuthenticationSchemeDefinition.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Copyright © 2024-Present The Serverless Workflow Specification Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"), | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
namespace ServerlessWorkflow.Sdk.Models.Authentication; | ||
|
||
/// <summary> | ||
/// Represents the definition of a digest authentication scheme | ||
/// </summary> | ||
[DataContract] | ||
public record DigestAuthenticationSchemeDefinition | ||
: AuthenticationSchemeDefinition | ||
{ | ||
|
||
/// <inheritdoc/> | ||
[IgnoreDataMember, JsonIgnore, YamlIgnore] | ||
public override string Scheme => AuthenticationScheme.Digest; | ||
|
||
/// <summary> | ||
/// Gets/sets the username used for authentication | ||
/// </summary> | ||
[DataMember(Name = "username", Order = 1), JsonPropertyName("username"), JsonPropertyOrder(1), YamlMember(Alias = "username", Order = 1)] | ||
public required virtual string Username { get; set; } | ||
|
||
/// <summary> | ||
/// Gets/sets the password used for authentication | ||
/// </summary> | ||
[DataMember(Name = "password", Order = 2), JsonPropertyName("password"), JsonPropertyOrder(2), YamlMember(Alias = "password", Order = 2)] | ||
public required virtual string Password { get; set; } | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/ServerlessWorkflow.Sdk/Models/Authentication/OAuth2AuthenticationEndpointsDefinition.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright © 2024-Present The Serverless Workflow Specification Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"), | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
namespace ServerlessWorkflow.Sdk.Models.Authentication; | ||
|
||
/// <summary> | ||
/// Represents the configuration of OAUTH2 endpoints | ||
/// </summary> | ||
[DataContract] | ||
public record OAuth2AuthenticationEndpointsDefinition | ||
{ | ||
|
||
/// <summary> | ||
/// Gets/sets the relative path to the token endpoint. Defaults to `/oauth2/token` | ||
/// </summary> | ||
[Required] | ||
[DataMember(Name = "authority", Order = 1), JsonPropertyName("authority"), JsonPropertyOrder(1), YamlMember(Alias = "authority", Order = 1)] | ||
public virtual Uri Token { get; set; } = new("/oauth2/token"); | ||
|
||
/// <summary> | ||
/// Gets/sets the relative path to the revocation endpoint. Defaults to `/oauth2/revoke` | ||
/// </summary> | ||
[Required] | ||
[DataMember(Name = "revocation", Order = 2), JsonPropertyName("revocation"), JsonPropertyOrder(2), YamlMember(Alias = "revocation", Order = 2)] | ||
public virtual Uri Revocation { get; set; } = new("/oauth2/revoke"); | ||
|
||
/// <summary> | ||
/// Gets/sets the relative path to the introspection endpoint. Defaults to `/oauth2/introspect` | ||
/// </summary> | ||
[Required] | ||
[DataMember(Name = "introspection", Order = 3), JsonPropertyName("introspection"), JsonPropertyOrder(3), YamlMember(Alias = "introspection", Order = 3)] | ||
public virtual Uri Introspection { get; set; } = new("/oauth2/introspect"); | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
src/ServerlessWorkflow.Sdk/Models/Authentication/OAuth2AuthenticationRequestDefinition.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright © 2024-Present The Serverless Workflow Specification Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"), | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
namespace ServerlessWorkflow.Sdk.Models.Authentication; | ||
|
||
/// <summary> | ||
/// Represents the configuration of an OAUTH2 authentication request | ||
/// </summary> | ||
[DataContract] | ||
public record OAuth2AuthenticationRequestDefinition | ||
{ | ||
|
||
/// <summary> | ||
/// Gets/sets the encoding of the authentication request. Defaults to 'application/x-www-form-urlencoded'. See <see cref="OAuth2RequestEncoding"/> | ||
/// </summary> | ||
public virtual string Encoding { get; set; } = OAuth2RequestEncoding.FormUrl; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.