You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: specification.md
+53-7Lines changed: 53 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1986,8 +1986,7 @@ If we have the following function definition:
1986
1986
```
1987
1987
1988
1988
The `authRef` property is used to reference an authentication definition in
1989
-
the `auth` property and should be applied to access the `https://secure.resources.com/myapi.json`
1990
-
OpenApi definition file.
1989
+
the `auth` property and should be applied when invoking the `helloWorld` function. An [AuthRef](#AuthRef-Definition) object can alternatively be used to configure the authentication definition to use when accessing the function's resource and/or when invoking the function.
1991
1990
1992
1991
The `functions` property can be either an in-line [function](#Function-Definition) definition array, or an URI reference to
1993
1992
a resource containing an array of [functions](#Function-Definition) definition.
@@ -3248,7 +3247,7 @@ Depending on the function `type`, the `operation` property can be:
3248
3247
Defining custom function types is possible, for more information on that refer to the [Defining custom function types](#defining-custom-function-types) section.
3249
3248
3250
3249
The `authRef` property references a name of a defined workflow [auth definition](#Auth-Definition).
3251
-
It is used to provide authentication info to access the resource defined in the `operation` property.
3250
+
It is used to provide authentication info to access the resource defined in the `operation` property and/or to invoke the function.
3252
3251
3253
3252
The [`metadata`](#Workflow-Metadata) property allows users to define custom information to function definitions.
3254
3253
This allows you for example to define functions that describe of a command executions on a Docker image:
@@ -3266,6 +3265,55 @@ Note that using metadata for cases such as above heavily reduces the portability
3266
3265
Function definitions themselves do not define data input parameters. Parameters can be
3267
3266
defined via the `parameters` property in [function definitions](#FunctionRef-Definition) inside [actions](#Action-Definition).
3268
3267
3268
+
###### AuthRef Definition
3269
+
3270
+
| Parameter | Description | Type | Required |
3271
+
| --- | --- | --- | --- |
3272
+
| resource | References an auth definition to be used to access the resource defined in the operation parameter | string | yes |
3273
+
| invocation | References an auth definition to be used to invoke the operation | string | no |
3274
+
3275
+
The `authRef` property references a name of a defined workflow [auth definition](#Auth-Definition). It can be a string or an object.
3276
+
3277
+
If it's a string, the referenced [auth definition](#Auth-Definition) is used solely for the function's invocation.
3278
+
3279
+
If it's an object, it is possible to specify an [auth definition](#Auth-Definition) to use for the function's resource retrieval (as defined by the `operation` property) and another for its invocation.
3280
+
3281
+
Example of a function definition configured to use an [auth definition](#Auth-Definition) called "My Basic Auth" upon invocation:
Example of a function definition configured to use an [auth definition](#Auth-Definition) called "My Basic Auth" to retrieve the resource defined by the `operation` property, and an [auth definition](#Auth-Definition) called "My OIDC Auth" upon invocation:
Note that if multiple functions share the same `operation` path (*which is the first component of the operation value, located before the first '#' character*), and if one of them defines an [auth definition](#Auth-Definition) for resource access, then it should always be used to access said resource.
3302
+
In other words, when retrieving the resource of the function "MySecuredFunction2" defined in the following example, the "My Api Key Auth" [auth definition](#Auth-Definition) should be used, because the "MySecuredFunction1" has defined it for resource access.
3303
+
This is done to avoid unnecessary repetitions of [auth definition](#Auth-Definition) configuration when using the same resource for multiple defined functions.
It's worth noting that if an [auth definition](#Auth-Definition) has been defined for an OpenAPI function which's resource declare an authentication mechanism, the later should be used instead, thus ignoring entirely the [auth definition](#Auth-Definition).
3316
+
3269
3317
##### Event Definition
3270
3318
3271
3319
| Parameter | Description | Type | Required |
@@ -3483,10 +3531,8 @@ If `false`, both Event payload and context attributes should be accessible.
3483
3531
3484
3532
##### Auth Definition
3485
3533
3486
-
Auth definitions can be used to define authentication information that should be applied
3487
-
to resources defined in the operation property of [function definitions](#Function-Definition).
3488
-
It is not used as authentication information for the function invocation, but just to access
3489
-
the resource containing the function invocation information.
3534
+
Auth definitions can be used to define authentication information that should be applied to [function definitions](#Function-Definition).
3535
+
It can be used for both the retrieval of the function's resource (as defined by the `operation` property) and for the function's invocation.
0 commit comments