Skip to content

Commit cdcb6a9

Browse files
authored
Merge pull request #1048 from neuroglia-io/feat-authorization-runtime-expression-argument
Add a new `$authorization` runtime expression argument
2 parents 23ee151 + c767c85 commit cdcb6a9

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

dsl.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -343,18 +343,20 @@ When the evaluation of an expression fails, runtimes **must** raise an error wit
343343
| input | `any` | The task's transformed input. |
344344
| output | `any` | The task's transformed output. |
345345
| secrets | `map` | A key/value map of the workflow secrets.<br>To avoid unintentional bleeding, secrets can only be used in the `input.from` runtime expression. |
346+
| authorization | [`authorizationDescriptor`](#authorization-descriptor) | Describes the resolved authorization, as defined by the task's authentication, if any. |
346347
| task | [`taskDescriptor`](#task-descriptor) | Describes the current task. |
347348
| workflow | [`workflowDescriptor`](#workflow-descriptor) | Describes the current workflow. |
348349
| runtime | [`runtimeDescriptor`](#runtime-descriptor) | Describes the runtime. |
349350

351+
350352
##### Runtime Descriptor
351353

352354
This argument contains information about the runtime executing the workflow.
353355

354356
| Name | Type | Description | Example |
355-
|:-----|:----:|:------------| ------- |
357+
|:-----|:----:|:------------|:--------|
356358
| name | `string` | A human friendly name for the runtime. | `Synapse`, `Sonata` |
357-
| version | `string` | The version of the runtime. This can be an arbitrary string | a incrementing positive integer (`362`), semantic version (`1.4.78`), commit hash (`04cd3be6da98fc35422c8caa821e0aa1ef6b2c02`) or container image label (`v0.7.43-alpine`) |
359+
| version | `string` | The version of the runtime. This can be an arbitrary string | An incrementing positive integer (`362`), semantic version (`1.4.78`), commit hash (`04cd3be6da98fc35422c8caa821e0aa1ef6b2c02`) or container image label (`v0.7.43-alpine`) |
358360
| metadata | `map` | An object/map of implementation specific key-value pairs. This can be chosen by runtime implementors and usage of this argument signals that a given workflow definition might not be runtime agnostic | A Software as a Service (SaaS) provider might choose to expose information about the tenant the workflow is executed for e.g. `{ "organization": { "id": "org-ff51cff2-fc83-4d70-9af1-8dacdbbce0be", "name": "example-corp" }, "featureFlags": ["fastZip", "arm64"] }`. |
359361

360362
##### Workflow Descriptor
@@ -377,6 +379,13 @@ This argument contains information about the runtime executing the workflow.
377379
| output | `any` | The task's *raw* output (i.e. *BEFORE* the `output.as` expression). | |
378380
| startedAt | [`dateTimeDescriptor`](#datetime-descriptor) | The start time of the task | |
379381

382+
##### Authorization Descriptor
383+
384+
| Name | Type | Description | Example |
385+
|:-------|:------:|:------------|:--------|
386+
| scheme | `string` | The resolved authorization scheme. | `Bearer` |
387+
| parameter | `string` | The resolved authorization parameter. | `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJVadQssw5c` |
388+
380389
##### DateTime Descriptor
381390

382391
| Name | Type | Description | Example |
@@ -387,15 +396,15 @@ This argument contains information about the runtime executing the workflow.
387396

388397
The following table shows which arguments are available for each runtime expression:
389398

390-
| Runtime Expression | Evaluated on | Produces | `$context` | `$input` | `$output` | `$secrets` | `$task` | `$workflow` |
391-
|:-------------------|:---------:|:---------:|:---------:|:---------:|:-------:|:---------:|:-------:|:----------:|
392-
| Workflow `input.from` | Raw workflow input | Transformed workflow input | | | || ||
393-
| Task `input.from` | Raw task input (i.e. transformed workflow input for the first task, transformed output from previous task otherwise) | Transformed task input || | ||||
394-
| Task `if` | Transformed task input | ||| ||||
395-
| Task definition | Transformed task input | ||| ||||
396-
| Task `output.as` | Raw task output | Transformed task output ||| ||||
397-
| Task `export.as` | Transformed task output | `$context` |||||||
398-
| Workflow `output.as` | Last task's transformed output | Transformed workflow output || | || ||
399+
| Runtime Expression | Evaluated on | Produces | `$context` | `$input` | `$output` | `$secrets` | `$task` | `$workflow` | `$runtime` | `$authorization` |
400+
|:-------------------|:---------:|:---------:|:---------:|:---------:|:-------:|:---------:|:-------:|:----------:|:----------:|:----------:|
401+
| Workflow `input.from` | Raw workflow input | Transformed workflow input | | | || ||| |
402+
| Task `input.from` | Raw task input (i.e. transformed workflow input for the first task, transformed output from previous task otherwise) | Transformed task input || | ||||| |
403+
| Task `if` | Transformed task input | ||| ||||| |
404+
| Task definition | Transformed task input | ||| ||||||
405+
| Task `output.as` | Raw task output | Transformed task output ||| ||||||
406+
| Task `export.as` | Transformed task output | `$context` |||||||||
407+
| Workflow `output.as` | Last task's transformed output | Transformed workflow output || | || ||| |
399408

400409
### Fault Tolerance
401410

0 commit comments

Comments
 (0)