API网关,ApiKeyRequired:在任何{proxy} endpoints 上都为true,但仍可以在没有指定任何密钥的情况下访问

AWS是否在 {proxy+} 方法上不支持 ApiKeyRequired: true ?我有以下相关的Cloudformation资源:

Api:
    Type: AWS::ApiGateway::RestApi
    Properties:
      Name: !Sub ${AppStagePrefix}-api
      ApiKeySourceType: HEADER

  ProxyResource:
    Type: AWS::ApiGateway::Resource
    Properties:
      RestApiId: !Ref Api
      ParentId: !GetAtt Api.RootResourceId
      PathPart: "{proxy+}"

  ProxyResourceAnyMethod:
    DependsOn: LambdaPermission
    Type: AWS::ApiGateway::Method
    Properties:
      RestApiId: !Ref Api
      ResourceId: !Ref ProxyResource
      HttpMethod: ANY
      ApiKeyRequired: true
      AuthorizationType: NONE
      Integration:
        Type: AWS_PROXY
        IntegrationHttpMethod: POST
        Uri: !Sub arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${Lambda.Arn}/invocations

但我仍然可以访问我的特定于阶段的 endpoints ,没有通过标头传递的api密钥 .

我错过了什么?

回答(0)