Decorator that marks a function for securing an API or an endpoint inside an API.
The decorator takes the API integration ID, and an optional endpoint ID.
If no endpoint ID is provided, the function will secure the whole API.
The function should return a boolean or a Promise of a boolean indicating
whether the action is allowed.
The function takes a context object as a parameter. The context object contains information about the action.
A call to an API integration that no @secureApi function secures is rejected, unless the client uses an API key.
To read more about securing an API, see the
documentation.
Decorator that marks a function for securing an API or an endpoint inside an API. The decorator takes the API integration ID, and an optional endpoint ID. If no endpoint ID is provided, the function will secure the whole API.
The function should return a boolean or a
Promiseof a boolean indicating whether the action is allowed. The function takes a context object as a parameter. The context object contains information about the action.A call to an API integration that no
@secureApifunction secures is rejected, unless the client uses an API key.To read more about securing an API, see the documentation.