It is worthwhile to consider how to make several of the features currently offered by web actions more generally available to all action. It may also be useful to generalize the web-export
annotation to provide additional control over which HTTP methods an action is prepared the handle and similarly which content types it supports. One can imagine doing this with a richer web-export
annotation which may define at least these additional properties:
methods
: array of HTTP methods accepted.extensions
: array of supported extensions.authentication
: one of {"none", "builtin"}
where none
is for anonymous access and builtin
for OpenWhisk authentication.As in -a web-export '{ "methods": ["get", "post"], "extensions": ["http"], "authentication": "none" }'
for a web action that only accepts get
and post
requests, handled .http
extensions only, and permits anonymous access. A richer set of annotations will allow the controller to reject requests early if a web action does not support a particular method for example. The current implementation will accept get
, post
, put
and delete
HTTP methods without discrimination for any web action.