Skip to content

Commit 0cfcc40

Browse files
Merge branch 'serverlessworkflow:main' into fix-usage-of-endpoint-in-call-http
2 parents 4425b0f + cad3d64 commit 0cfcc40

File tree

6 files changed

+94
-13
lines changed

6 files changed

+94
-13
lines changed

dsl-reference.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,10 +1015,10 @@ Defines the mechanism used to authenticate users and workflows attempting to acc
10151015
| Property | Type | Required | Description |
10161016
|----------|:----:|:--------:|-------------|
10171017
| basic | [`basicAuthentication`](#basic-authentication) | `no` | The `basic` authentication scheme to use, if any.<br>Required if no other property has been set, otherwise ignored. |
1018-
| bearer | [`basicAuthentication`](#bearer-authentication) | `no` | The `bearer` authentication scheme to use, if any.<br>Required if no other property has been set, otherwise ignored. |
1018+
| bearer | [`bearerAuthentication`](#bearer-authentication) | `no` | The `bearer` authentication scheme to use, if any.<br>Required if no other property has been set, otherwise ignored. |
10191019
| certificate | [`certificateAuthentication`](#certificate-authentication) | `no` | The `certificate` authentication scheme to use, if any.<br>Required if no other property has been set, otherwise ignored. |
10201020
| digest | [`digestAuthentication`](#digest-authentication) | `no` | The `digest` authentication scheme to use, if any.<br>Required if no other property has been set, otherwise ignored. |
1021-
| bearer | [`oauth2`](#oauth2-authentication) | `no` | The `oauth2` authentication scheme to use, if any.<br>Required if no other property has been set, otherwise ignored. |
1021+
| oauth2 | [`oauth2`](#oauth2-authentication) | `no` | The `oauth2` authentication scheme to use, if any.<br>Required if no other property has been set, otherwise ignored. |
10221022

10231023
##### Examples
10241024

@@ -1087,7 +1087,7 @@ Defines the fundamentals of a 'bearer' authentication
10871087

10881088
| Property | Type | Required | Description |
10891089
|----------|:----:|:--------:|-------------|
1090-
| bearer | `string` | `yes` | The bearer token to use. |
1090+
| token | `string` | `yes` | The bearer token to use. |
10911091

10921092
##### Examples
10931093

examples/asyncapi.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
document:
2+
dsl: 1.0.0-alpha1
3+
namespace: examples
4+
name: bearer-auth
5+
version: 1.0.0-alpha1
6+
do:
7+
greetUser:
8+
call: asyncapi
9+
with:
10+
document:
11+
uri: https://fake.com/docs/asyncapi.json
12+
operationRef: findPetsByStatus
13+
server: staging
14+
message: getPetByStatusQuery
15+
binding: http
16+
payload:
17+
petId: ${ .pet.id }
18+
authentication:
19+
bearer:
20+
token: ${ .token }

examples/bearer-auth-uri-format.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
document:
2+
dsl: 1.0.0-alpha1
3+
namespace: examples
4+
name: bearer-auth-uri-format
5+
version: 1.0.0-alpha1
6+
do:
7+
getPetById:
8+
call: http
9+
with:
10+
method: get
11+
endpoint:
12+
uri: https://petstore.swagger.io/v2/pet/1
13+
authentication:
14+
bearer:
15+
token: ${ .token }

examples/bearer-auth.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
document:
2+
dsl: 1.0.0-alpha1
3+
namespace: examples
4+
name: bearer-auth
5+
version: 1.0.0-alpha1
6+
do:
7+
getPetById:
8+
call: http
9+
with:
10+
method: get
11+
endpoint:
12+
uri: https://petstore.swagger.io/v2/pet/{petId}
13+
authentication:
14+
bearer:
15+
token: ${ .token }

examples/use-authentication.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
document:
2+
dsl: 1.0.0-alpha1
3+
namespace: examples
4+
name: bearer-auth
5+
version: 1.0.0-alpha1
6+
use:
7+
authentications:
8+
petStoreAuth:
9+
bearer:
10+
token: ${ .token }
11+
do:
12+
getPetById:
13+
call: http
14+
with:
15+
method: get
16+
endpoint:
17+
uri: https://petstore.swagger.io/v2/pet/{petId}
18+
authentication: petStoreAuth

schema/workflow.yaml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ $defs:
133133
- properties:
134134
call:
135135
type: string
136-
constant: asyncapi
136+
const: asyncapi
137137
with:
138138
type: object
139139
properties:
@@ -156,15 +156,17 @@ $defs:
156156
type: object
157157
description: The payload to call the AsyncAPI operation with, if any.
158158
authentication:
159-
ref: '#/$defs/authenticationPolicy'
160159
description: The authentication policy, if any, to use when calling the AsyncAPI operation.
160+
oneOf:
161+
- $ref: '#/$defs/authenticationPolicy'
162+
- type: string
161163
required: [ document, operationRef ]
162164
description: Defines the AsyncAPI call to perform.
163165
required: [ call, with ]
164166
- properties:
165167
call:
166168
type: string
167-
constant: grpc
169+
const: grpc
168170
with:
169171
type: object
170172
properties:
@@ -187,8 +189,10 @@ $defs:
187189
max: 65535
188190
description: The port number of the GRPC service to call.
189191
authentication:
190-
$ref: '#/$defs/authenticationPolicy'
191192
description: The endpoint's authentication policy, if any.
193+
oneOf:
194+
- $ref: '#/$defs/authenticationPolicy'
195+
- type: string
192196
required: [ name, host ]
193197
method:
194198
type: string
@@ -203,7 +207,7 @@ $defs:
203207
- properties:
204208
call:
205209
type: string
206-
constant: http
210+
const: http
207211
with:
208212
type: object
209213
properties:
@@ -231,7 +235,7 @@ $defs:
231235
- properties:
232236
call:
233237
type: string
234-
constant: openapi
238+
const: openapi
235239
with:
236240
type: object
237241
properties:
@@ -246,8 +250,10 @@ $defs:
246250
additionalProperties: true
247251
description: A name/value mapping of the parameters of the OpenAPI operation to call.
248252
authentication:
249-
$ref: '#/$defs/authenticationPolicy'
250253
description: The authentication policy, if any, to use when calling the OpenAPI operation.
254+
oneOf:
255+
- $ref: '#/$defs/authenticationPolicy'
256+
- type: string
251257
output:
252258
type: string
253259
enum: [ raw, content, response ]
@@ -267,6 +273,7 @@ $defs:
267273
description: A name/value mapping of the parameters, if any, to call the function with.
268274
required: [ call ]
269275
compositeTask:
276+
type: object
270277
properties:
271278
execute:
272279
type: object
@@ -294,6 +301,7 @@ $defs:
294301
required: [ execute ]
295302
description: Serves as a pivotal orchestrator within workflow systems, enabling the seamless integration and execution of multiple subtasks to accomplish complex operations
296303
emitTask:
304+
type: object
297305
properties:
298306
emit:
299307
type: object
@@ -335,6 +343,7 @@ $defs:
335343
default: continue
336344
- type: string
337345
forTask:
346+
type: object
338347
properties:
339348
for:
340349
type: object
@@ -668,11 +677,13 @@ $defs:
668677
properties:
669678
uri:
670679
type: string
671-
format: uri
680+
format: uri-template
672681
description: The endpoint's URI.
673682
authentication:
674-
$ref: '#/$defs/authenticationPolicy'
675683
description: The authentication policy to use.
684+
oneOf:
685+
- $ref: '#/$defs/authenticationPolicy'
686+
- type: string
676687
required: [ uri ]
677688
eventConsumptionStrategy:
678689
type: object
@@ -764,8 +775,10 @@ $defs:
764775
format: uri
765776
description: The endpoint's URI.
766777
authentication:
767-
$ref: '#/$defs/authenticationPolicy'
768778
description: The authentication policy to use.
779+
oneOf:
780+
- $ref: '#/$defs/authenticationPolicy'
781+
- type: string
769782
name:
770783
type: string
771784
description: The external resource's name, if any.

0 commit comments

Comments
 (0)