Skip to content

Commit 6c02af7

Browse files
committed
- Refactor the OAuth2 authentication policy
- Add the OIDC authentication policy - Add the schema for the Digest authentication Signed-off-by: Charles d'Avernas <[email protected]>
1 parent 996b0c4 commit 6c02af7

File tree

2 files changed

+253
-63
lines changed

2 files changed

+253
-63
lines changed

dsl-reference.md

Lines changed: 100 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
- [Certificate](#certificate-authentication)
3838
- [Digest](#digest-authentication)
3939
- [OAUTH2](#oauth2-authentication)
40+
- [OpenIdConnect](#openidconnect-authentication)
4041
+ [Extension](#extension)
4142
+ [Error](#error)
4243
- [Standard Error Types](#standard-error-types)
@@ -1107,6 +1108,7 @@ Defines the mechanism used to authenticate users and workflows attempting to acc
11071108
| certificate | [`certificateAuthentication`](#certificate-authentication) | `no` | The `certificate` authentication scheme to use, if any.<br>Required if no other property has been set, otherwise ignored. |
11081109
| digest | [`digestAuthentication`](#digest-authentication) | `no` | The `digest` authentication scheme to use, if any.<br>Required if no other property has been set, otherwise ignored. |
11091110
| oauth2 | [`oauth2`](#oauth2-authentication) | `no` | The `oauth2` authentication scheme to use, if any.<br>Required if no other property has been set, otherwise ignored. |
1111+
| oidc | [`oidc`](#openidconnect-authentication) | `no` | The `oidc` authentication scheme to use, if any.<br>Required if no other property has been set, otherwise ignored. |
11101112

11111113
##### Examples
11121114

@@ -1205,19 +1207,59 @@ do:
12051207

12061208
#### Digest Authentication
12071209

1210+
Defines the fundamentals of a 'digest' authentication.
1211+
1212+
##### Properties
1213+
1214+
| Property | Type | Required | Description |
1215+
|----------|:----:|:--------:|-------------|
1216+
| username | `string` | `yes` | The username to use. |
1217+
| password | `string` | `yes` | The password to use. |
1218+
1219+
##### Examples
1220+
1221+
```yaml
1222+
document:
1223+
dsl: '1.0.0-alpha1'
1224+
namespace: test
1225+
name: digest-authentication-example
1226+
version: '0.1.0'
1227+
use:
1228+
authentications:
1229+
sampleDigest:
1230+
digest:
1231+
username: admin
1232+
password: password123
1233+
do:
1234+
- sampleTask:
1235+
call: http
1236+
with:
1237+
method: get
1238+
endpoint:
1239+
uri: https://secured.fake.com/sample
1240+
authentication:
1241+
use: sampleDigest
1242+
```
12081243

12091244
#### OAUTH2 Authentication
12101245

1211-
Defines the fundamentals of an 'oauth2' authentication
1246+
Defines the fundamentals of an 'oauth2' authentication.
12121247

12131248
##### Properties
12141249

1215-
| Property | Type | Required | Description |
1216-
|----------|:----:|:--------:|-------------|
1217-
| authority | [`uri-template`](#uri-template) | `yes` | The URI that references the OAuth2 authority to use. |
1218-
| grant | `string` | `yes` | The grant type to use. |
1219-
| client.id | `string` | `yes` | The client id to use. |
1250+
| Name | Type | Required | Description |
1251+
|:-----|:----:|:--------:|:------------|
1252+
| authority | `uri-template` | `yes` | The URI that references the authority to use when making OAUTH2 calls. |
1253+
| endpoints.token | `uri-template` | `no` | The relative path to the endpoint for OAUTH2 token requests.<br>Defaults to `/oauth2/token`. |
1254+
| endpoints.revocation | `uri-template` | `no` | The relative path to the endpoint used to invalidate tokens.<br>Defaults to `/oauth2/revoke`. |
1255+
| endpoints.introspection | `uri-template` | `no` | The relative path to the endpoint used to validate and obtain information about a token, typically to check its validity and associated metadata.<br>Defaults to `/oauth2/introspect`. |
1256+
| grant | `string` | `yes` | The grant type to use.<br>Supported values are `authorization_code`, `client_credentials`, `password`, `refresh_token` and `urn:ietf:params:oauth:grant-type:token-exchange`. |
1257+
| client.id | `string` | `no` | The client id to use.<br>Required if the `client.authentication` method has **not** been set to `none`. |
12201258
| client.secret | `string` | `no` | The client secret to use, if any. |
1259+
| client.assertion | `string` | `no` | A JWT containing a signed assertion with your application credentials.<br>Required when `client.authentication` has been set to `private_key_jwt`. |
1260+
| client.authentication | `string` | `no` | The client authentication method to use.<br>Supported values are `client_secret_basic`, `client_secret_post`, `client_secret_jwt`, `private_key_jwt` or `none`.<br>Defaults to `client_secret_post`. |
1261+
| request.encoding | `string` | `no` | The encoding of the token request.<br>Supported values are `application/x-www-form-urlencoded` and `application/json`.<br>Defaults to application/x-www-form-urlencoded. |
1262+
| issuers | `uri-template[]` | `no` | A list that contains that contains valid issuers that will be used to check against the issuer of generated tokens. |
12211263
| scopes | `string[]` | `no` | The scopes, if any, to request the token for. |
12221264
| audiences | `string[]` | `no` | The audiences, if any, to request the token for. |
12231265
| username | `string` | `no` | The username to use. Used only if the grant type is `Password`. |
@@ -1242,7 +1284,9 @@ do:
12421284
uri: https://secured.fake.com/sample
12431285
authentication:
12441286
oauth2:
1245-
authority: http://keycloak/realms/fake-authority/.well-known/openid-configuration
1287+
authority: http://keycloak/realms/fake-authority
1288+
endpoints:
1289+
token: /oauth2/token
12461290
grant: client-credentials
12471291
client:
12481292
id: workflow-runtime
@@ -1262,6 +1306,55 @@ Represents the definition of an OAUTH2 token
12621306
| token | `string` | `yes` | The security token to use to use. |
12631307
| type | `string` | `yes` | The type of security token to use. |
12641308

1309+
#### OpenIdConnect Authentication
1310+
1311+
Defines the fundamentals of an 'oidc' authentication.
1312+
1313+
##### Properties
1314+
1315+
| Name | Type | Required | Description |
1316+
|:-----|:----:|:--------:|:------------|
1317+
| authority | `uri-template` | `yes` | The URI that references the authority to use when making OpenIdConnect calls. |
1318+
| grant | `string` | `yes` | The grant type to use.<br>Supported values are `authorization_code`, `client_credentials`, `password`, `refresh_token` and `urn:ietf:params:oauth:grant-type:token-exchange`. |
1319+
| client.id | `string` | `no` | The client id to use.<br>Required if the `client.authentication` method has **not** been set to `none`. |
1320+
| client.secret | `string` | `no` | The client secret to use, if any. |
1321+
| client.assertion | `string` | `no` | A JWT containing a signed assertion with your application credentials.<br>Required when `client.authentication` has been set to `private_key_jwt`. |
1322+
| client.authentication | `string` | `no` | The client authentication method to use.<br>Supported values are `client_secret_basic`, `client_secret_post`, `client_secret_jwt`, `private_key_jwt` or `none`.<br>Defaults to `client_secret_post`. |
1323+
| request.encoding | `string` | `no` | The encoding of the token request.<br>Supported values are `application/x-www-form-urlencoded` and `application/json`.<br>Defaults to application/x-www-form-urlencoded. |
1324+
| issuers | `uri-template[]` | `no` | A list that contains that contains valid issuers that will be used to check against the issuer of generated tokens. |
1325+
| scopes | `string[]` | `no` | The scopes, if any, to request the token for. |
1326+
| audiences | `string[]` | `no` | The audiences, if any, to request the token for. |
1327+
| username | `string` | `no` | The username to use. Used only if the grant type is `Password`. |
1328+
| password | `string` | `no` | The password to use. Used only if the grant type is `Password`. |
1329+
| subject | [`oauth2Token`](#oauth2-token) | `no` | The security token that represents the identity of the party on behalf of whom the request is being made. |
1330+
| actor | [`oauth2Token`](#oauth2-token) | `no` | The security token that represents the identity of the acting party. |
1331+
1332+
##### Examples
1333+
1334+
```yaml
1335+
document:
1336+
dsl: '1.0.0-alpha1'
1337+
namespace: test
1338+
name: oidc-authentication-example
1339+
version: '0.1.0'
1340+
do:
1341+
- sampleTask:
1342+
call: http
1343+
with:
1344+
method: get
1345+
endpoint:
1346+
uri: https://secured.fake.com/sample
1347+
authentication:
1348+
oidc:
1349+
authority: http://keycloak/realms/fake-authority/.well-known/openid-configuration
1350+
grant: client_credentials
1351+
client:
1352+
id: workflow-runtime
1353+
secret: "**********"
1354+
scopes: [ api ]
1355+
audiences: [ runtime ]
1356+
```
1357+
12651358
### Extension
12661359

12671360
Holds the definition for extending functionality, providing configuration options for how an extension extends and interacts with other components.

schema/workflow.yaml

Lines changed: 153 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ $defs:
822822
description: The configuration of the basic authentication policy.
823823
unevaluatedProperties: false
824824
oneOf:
825-
- title: BasicAuthenticationData
825+
- title: BasicAuthenticationProperties
826826
description: Inline configuration of the basic authentication policy.
827827
properties:
828828
username:
@@ -845,7 +845,7 @@ $defs:
845845
description: The configuration of the bearer authentication policy.
846846
unevaluatedProperties: false
847847
oneOf:
848-
- title: BearerAuthenticationData
848+
- title: BearerAuthenticationProperties
849849
description: Inline configuration of the bearer authentication policy.
850850
properties:
851851
token:
@@ -856,6 +856,29 @@ $defs:
856856
title: BearerAuthenticationPolicySecret
857857
description: Secret based configuration of the bearer authentication policy.
858858
required: [ bearer ]
859+
- title: DigestAuthenticationPolicy
860+
description: Use digest authentication.
861+
properties:
862+
digest:
863+
type: object
864+
title: DigestAuthenticationPolicyConfiguration
865+
description: The configuration of the digest authentication policy.
866+
unevaluatedProperties: false
867+
oneOf:
868+
- title: BasicAuthenticationProperties
869+
description: Inline configuration of the digest authentication policy.
870+
properties:
871+
username:
872+
type: string
873+
description: The username to use.
874+
password:
875+
type: string
876+
description: The password to use.
877+
required: [ username, password ]
878+
- $ref: '#/$defs/secretBasedAuthenticationPolicy'
879+
title: DigestAuthenticationPolicySecret
880+
description: Secret based configuration of the digest authentication policy.
881+
required: [ digest ]
859882
- title: OAuth2AuthenticationPolicy
860883
description: Use OAuth2 authentication.
861884
properties:
@@ -865,65 +888,139 @@ $defs:
865888
description: The configuration of the OAuth2 authentication policy.
866889
unevaluatedProperties: false
867890
oneOf:
868-
- title: OAuth2AutenthicationData
869-
description: Inline configuration of the OAuth2 authentication policy.
870-
properties:
871-
authority:
872-
type: string
873-
format: uri-template
874-
title: OAuth2AutenthicationDataAuthority
875-
description: The URI that references the OAuth2 authority to use.
876-
grant:
877-
type: string
878-
title: OAuth2AutenthicationDataGrant
879-
description: The grant type to use.
880-
client:
881-
type: object
882-
title: OAuth2AutenthicationDataClient
883-
description: The definition of an OAuth2 client.
884-
unevaluatedProperties: false
891+
- type: object
892+
title: OAuth2ConnectAuthenticationProperties
893+
description: The inline configuration of the OAuth2 authentication policy.
894+
allOf:
895+
- $ref: '#/$defs/oauth2AuthenticationProperties'
896+
- type: object
885897
properties:
886-
id:
887-
type: string
888-
title: ClientId
889-
description: The client id to use.
890-
secret:
891-
type: string
892-
title: ClientSecret
893-
description: The client secret to use, if any.
894-
required: [ id ]
895-
scopes:
896-
type: array
897-
title: OAuth2AutenthicationDataScopes
898-
description: The scopes, if any, to request the token for.
899-
items:
900-
type: string
901-
audiences:
902-
type: array
903-
title: OAuth2AutenthicationDataAudiences
904-
description: The audiences, if any, to request the token for.
905-
items:
906-
type: string
907-
username:
908-
type: string
909-
title: OAuth2AutenthicationDataUsername
910-
description: The username to use. Used only if the grant type is Password.
911-
password:
912-
type: string
913-
title: OAuth2AutenthicationDataPassword
914-
description: The password to use. Used only if the grant type is Password.
915-
subject:
916-
$ref: '#/$defs/oauth2Token'
917-
title: OAuth2AutenthicationDataSubject
918-
description: The security token that represents the identity of the party on behalf of whom the request is being made.
919-
actor:
920-
$ref: '#/$defs/oauth2Token'
921-
title: OAuth2AutenthicationDataActor
922-
description: The security token that represents the identity of the acting party.
898+
endpoints:
899+
type: object
900+
title: OAuth2AuthenticationPropertiesEndpoints
901+
description: The endpoint configurations for OAuth2.
902+
properties:
903+
token:
904+
type: string
905+
format: uri-template
906+
default: /oauth2/token
907+
title: OAuth2TokenEndpoint
908+
description: The relative path to the token endpoint. Defaults to `/oauth2/token`.
909+
revocation:
910+
type: string
911+
format: uri-template
912+
default: /oauth2/revoke
913+
title: OAuth2RevocationEndpoint
914+
description: The relative path to the revocation endpoint. Defaults to `/oauth2/revoke`.
915+
introspection:
916+
type: string
917+
format: uri-template
918+
default: /oauth2/introspect
919+
title: OAuth2IntrospectionEndpoint
920+
description: The relative path to the introspection endpoint. Defaults to `/oauth2/introspect`.
923921
- $ref: '#/$defs/secretBasedAuthenticationPolicy'
924922
title: OAuth2AuthenticationPolicySecret
925923
description: Secret based configuration of the OAuth2 authentication policy.
926924
required: [ oauth2 ]
925+
- title: OpenIdConnectAuthenticationPolicy
926+
description: Use OpenIdConnect authentication.
927+
properties:
928+
oidc:
929+
type: object
930+
title: OpenIdConnectAuthenticationPolicyConfiguration
931+
description: The configuration of the OpenIdConnect authentication policy.
932+
unevaluatedProperties: false
933+
oneOf:
934+
- $ref: '#/$defs/oauth2AuthenticationProperties'
935+
title: OpenIdConnectAuthenticationProperties
936+
description: The inline configuration of the OpenIdConnect authentication policy.
937+
- $ref: '#/$defs/secretBasedAuthenticationPolicy'
938+
title: OpenIdConnectAuthenticationPolicySecret
939+
description: Secret based configuration of the OpenIdConnect authentication policy.
940+
required: [ oidc ]
941+
oauth2AuthenticationProperties:
942+
type: object
943+
title: OAuth2AutenthicationData
944+
description: Inline configuration of the OAuth2 authentication policy.
945+
properties:
946+
authority:
947+
type: string
948+
format: uri-template
949+
title: OAuth2AutenthicationDataAuthority
950+
description: The URI that references the OAuth2 authority to use.
951+
grant:
952+
type: string
953+
enum: [ authorization_code, client_credentials, password, refresh_token, 'urn:ietf:params:oauth:grant-type:token-exchange']
954+
title: OAuth2AutenthicationDataGrant
955+
description: The grant type to use.
956+
client:
957+
type: object
958+
title: OAuth2AutenthicationDataClient
959+
description: The definition of an OAuth2 client.
960+
unevaluatedProperties: false
961+
properties:
962+
id:
963+
type: string
964+
title: ClientId
965+
description: The client id to use.
966+
secret:
967+
type: string
968+
title: ClientSecret
969+
description: The client secret to use, if any.
970+
assertion:
971+
type: string
972+
title: ClientAssertion
973+
description: A JWT containing a signed assertion with your application credentials.
974+
authentication:
975+
type: string
976+
enum: [ client_secret_basic, client_secret_post, client_secret_jwt, private_key_jwt, none ]
977+
default: client_secret_post
978+
title: ClientAuthentication
979+
description: The authentication method to use to authenticate the client.
980+
request:
981+
type: object
982+
title: OAuth2TokenRequest
983+
description: The configuration of an OAuth2 token request
984+
properties:
985+
encoding:
986+
type: string
987+
enum: [ 'application/x-www-form-urlencoded', 'application/json' ]
988+
default: 'application/x-www-form-urlencoded'
989+
title: Oauth2TokenRequestEncoding
990+
issuers:
991+
type: array
992+
title: OAuth2Issuers
993+
description: A list that contains that contains valid issuers that will be used to check against the issuer of generated tokens.
994+
items:
995+
type: string
996+
scopes:
997+
type: array
998+
title: OAuth2AutenthicationDataScopes
999+
description: The scopes, if any, to request the token for.
1000+
items:
1001+
type: string
1002+
audiences:
1003+
type: array
1004+
title: OAuth2AutenthicationDataAudiences
1005+
description: The audiences, if any, to request the token for.
1006+
items:
1007+
type: string
1008+
username:
1009+
type: string
1010+
title: OAuth2AutenthicationDataUsername
1011+
description: The username to use. Used only if the grant type is Password.
1012+
password:
1013+
type: string
1014+
title: OAuth2AutenthicationDataPassword
1015+
description: The password to use. Used only if the grant type is Password.
1016+
subject:
1017+
$ref: '#/$defs/oauth2Token'
1018+
title: OAuth2AutenthicationDataSubject
1019+
description: The security token that represents the identity of the party on behalf of whom the request is being made.
1020+
actor:
1021+
$ref: '#/$defs/oauth2Token'
1022+
title: OAuth2AutenthicationDataActor
1023+
description: The security token that represents the identity of the acting party.
9271024
oauth2Token:
9281025
type: object
9291026
title: OAuth2TokenDefinition

0 commit comments

Comments
 (0)