Open andrewjacksongamma opened 1 year ago
I am currently using version 11.1.3 of serverless-offline. ... I have tried the --apiKey cli parameter as per documentation. However this appears to have been deprecated and is resulting in a
serverless-offline removed --apiKey
as a cli parameter as part of v11.0.0. I believe the documentation on https://www.serverless.com/plugins/serverless-offline to be out of date.
MIGRATION: if you want to specify the apiKey value yourself, please define it under provider.apiGateway.apiKeys in the serverless config
I believe @dnalborczyk's response should provide more insight: https://github.com/dherault/serverless-offline/issues/1608#issuecomment-1306200311
Hi - I am experiencing an issue when trying to specify an API key for private endpoints. Our API keys are linked to usage accounts and have been setup following https://www.serverless.com/framework/docs/providers/aws/events/apigateway#setting-api-keys-for-your-rest-api, under the "You can also setup multiple usage plans for your API. In this case you need to map your usage plans to your api keys. Here's an example how this might look like:" section.
Note this is working successfully as expected when deployed to AWS - the issue being experienced only occurs when running with serverless-offline.
Our application uses a serverless.ts file with various imports to separate out parts. So rather than reference the serverless.yml file I've put the results of the
sls print
command below.I am currently using version 11.1.3 of serverless-offline.
Configuration
Results from sls print
Behaviour
Running serverless offline shows that the API key being generated is a random value.
Desired behaviour is to have the the value
API_KEY_VALUE_FOR_INTEGRATION_TESTS_TO_BE_USED_BY_SERVERLESS_OFFLINE
used for the x-api-key headerAttempts
I have tried the
--apiKey
cli parameter as per documentation. However this appears to have been deprecated and is resulting in aI have also tried adding the override to the
custom
section of the serverless filebut still experience the random API key being used