Open QuingKhaos opened 5 years ago
So I played a bit, and before issuing the putRestApi
i validated it with a getRestApi
call:
Response { id: 'xxxx',
name: 'piximizer-dev',
createdDate: 2018-07-04T07:42:50.000Z,
binaryMediaTypes: [ 'image/jpeg', 'image/png', 'image/webp' ],
apiKeySource: 'AUTHORIZER',
endpointConfiguration: { types: [ 'REGIONAL' ] } }
The plugin sends the following config to AWS:
Swagger {"swagger":"2.0","info":{"title":"piximizer-dev"},"x-amazon-apigateway-binary-media-types":["image/jpeg","image/png","image/webp"]}
And AWS definitely sets the API Key Source back to HEADER
when it is missing in the Swagger input...
Result { id: 'xxxx',
name: 'piximizer-dev',
createdDate: 2018-07-04T07:42:50.000Z,
warnings: [ 'No paths defined for this API.' ],
binaryMediaTypes: [ 'image/jpeg', 'image/png', 'image/webp' ],
apiKeySource: 'HEADER',
endpointConfiguration: { types: [ 'REGIONAL' ] } }
To clarify this issue, this may happen independently if used in a shared gateway scenario or not.
I'm using this plugin with an shared API Gateway and it resets the config of API Key Source back to
HEADER
Main
serverless.yml
which defines and exports the root API:Deploying this one sets the API Key Source correctly to
AUTHORIZER
The next service which uses
serverless-apigw-binary
:When I deploy this one, the API Key Source is back to
HEADER
. Other services which share the same API Gateway don't have this behavior. Only with this plugin.