Hi,
I’ve been trying to change an authorizer type
from token
to request
following the example shown in the docs, however, it seems that serverless is ignoring it, and the event contains type:'TOKEN'
.
Mi handler code in the serverless.yml
is:
libraries_ingest:
handler: project/handlers/dummy._dummy
warmup: true
events:
- http:
path: libraries/{id}/ingest
method: post
private: true
authorizer: integration
The authorizer attribute points to a label in the yml
called integration
:
integration:
handler: project/handlers/authorizers/aws_authorizer._integration_authorizer
type: request
identitySource: method.request.header.Authorization, method.request.header.WorkspaceId
identityValidationExpression: someRegex
If I print the event inside the handler it throws something similar to:
{'type': 'TOKEN', 'methodArn': 'arn:aws:execute-api:eu-west-1:xxxxxxxxx:xxxxxxxxx/dev/POST/libraries/a982331236b5dvvb973a504665e883cef55/ingest', 'authorizationToken': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}
It doesn’t matter whether I put the type
attribute or not, the event is the same.
Is there something that I’m doing wrong?
Thanks in advance!