Closed
Description
What would you like to be added:
Refactor external references.
What I propose is:
- To define a
resource
object, such as the following, used to encapsulate external definitions:
auth:
- name: foo_basic
scheme: basic
properties:
username: username
password: password
functions:
- name: secured_function
type: rest
operation: https://foo.bar#baz
authRef: foo_basic
In other words, an external function definition file would not contain an array of function definitions, but an object such as the above.
In addition, that would allow serverless-workflow compatible apps to provide a self-describing document making it ready to use in Serverless Workflow.
- Instead of having
functions
,events
, etc. be of typeoneOf<uri, functionArray>
, they should be only of typearray
, as discussed in the meeting of the 27th of September, and in Function definition namespaces (Importing several function definition files) #676.
A newimports
(orresources
) top-level properties would replace the need for uri-values, and would allow the import of multiple files instead of just one.
name: foobar
version: 0.1.0
specVersion: 0.9
imports:
- namespace: foo
uri: https://foobar.baz/sw.res
- namespace: bar
uri: https://bazfoo.bar/sw.res
states:
- name: invoke_external_functions
type: operation
actions:
- name: invoke_foo
functionRef:
refName: foo.greet
arguments:
greetings: Hello, Serverless Workflow!
- name: invoke_bar
functionRef:
refName: bar.greet
arguments:
greetings: Hello, dear readers!
end: true
Why is this needed:
Currently, external references are easy and simple to use, but unhappilly do not address all common/reasonnable use cases, as explained in #676. In addition, it forbids referencing in a safe manner external functions that define an authRef
Metadata
Metadata
Assignees
Type
Projects
Status
Done