New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x-api-key no longer being provided #1749
Comments
I encountered the same problem, and it's just after we upgraded from 13.3.1 to 13.3.2. We also had to downgrade to the previous version, I'm using node 20.9.0. |
Facing similar issue with node 18x |
Same, in 13.3.2 version after webpack building message |
This looks to be the BUG, I was checking their code,
I can see that there is a check for x-api-key but the master keySet doesnt have the required value. In my case when printed the whole key set, the only value that I see is [stage]-[lambda-name] . Eg. local-test-lambda-api
And now if I set the "x-api-key" to "local-test-lambda-api". THIS WORKS !! Eventually the issue is with below piece of serverless.yml config
So If you declare any of apiKeys under api gateway, the automatically created x-api-key will not be shown at all. just remove this apiKeys section, start local and you can see that x-api-key is shown on startup. I hope this may help someone as quickfix. |
Bug Report
Current Behavior
With the latest version
v13.3.2
we're no longer being provided with an API key when running locally.We see only the line
Remember to use 'x-api-key' on the request headers.
in the terminal, but no value forx-api-key
is provided. Reverting back tov13.3.1
we do get the additional lineKey with token: 'some-generated-token'
Expected behavior/code
When running locally using
sls offline start -s some_stage
we should be provided with a value forx-api-key
. The following line should be printed to the terminal as before:Key with token: 'some-token'
Environment
serverless
: v3.38.0serverless-offline
: v13.3.2serverless-plugin-aws-alerts
: v1.7.5serverless-domain-manager
: v7.3.3serverless-sqs-plugin-alarms
: v1.0.2serverless-logless-plugin
: v0.0.2serverless-log-forwarding
: v3.1.0serverless-plugin-cloudwatch-dashboard
: v1.2.0node.js
: v18.18.0The text was updated successfully, but these errors were encountered: