Skip to content

Plugin resetting API Key Source to HEADER #53

@QuingKhaos

Description

@QuingKhaos

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:

provider:
  name: aws
  runtime: nodejs8.10
  stage: ${self:custom.config.env}
  region: ${opt:region, '${self:custom.config.region}'}
  stackName: ${self:service.name}-${self:custom.config.env}
  apiName: piximizer-${self:custom.config.env}
  endpointType: regional
  timeout: 30
  memorySize: 256
  versionFunctions: false
  logRetentionInDays: ${self:custom.logRetention.${self:custom.config.env}}
  role: { Fn::GetAtt: [ RoleDefault, Arn ] }
  apiGateway:
    apiKeySourceType: AUTHORIZER

resources:
  Outputs:
    apiGatewayRestApiId:
      Value: { Ref: ApiGatewayRestApi }

    apiGatewayRestApiRootResourceId:
      Value: { Fn::GetAtt: [ ApiGatewayRestApi, RootResourceId ] }

Deploying this one sets the API Key Source correctly to AUTHORIZER

The next service which uses serverless-apigw-binary:

plugins:
- serverless-apigw-binary

custom:
  apigwBinary:
    types:
    - 'image/jpeg'
    - 'image/png'
    - 'image/webp'

provider:
  name: aws
  runtime: nodejs8.10
  stage: ${self:custom.config.env}
  region: ${opt:region, '${self:custom.config.region}'}
  stackName: ${self:service.name}-${self:custom.config.env}
  apiName: piximizer-${self:custom.config.env}
  endpointType: regional
  timeout: 30
  memorySize: 256
  versionFunctions: false
  logRetentionInDays: ${self:custom.logRetention.${self:custom.config.env}}
  role: ${cf:piximizer-tenants-${self:custom.config.env}.roleDefaultArn}

  apiGateway:
    restApiId: ${cf:piximizer-tenants-${self:custom.config.env}.apiGatewayRestApiId}
    restApiRootResourceId: ${cf:piximizer-tenants-${self:custom.config.env}.apiGatewayRestApiRootResourceId}

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions