admin管理员组

文章数量:1318573

I have configured my openapi.yaml to restrict access to one of the API endpoints with the following quota settings:

   x-google-management:
  metrics:
    - name: "read-requests"
      displayName: "Read requests"
      valueType: INT64
      metricKind: DELTA
  quota:
    limits:
      - name: "read-limit"
        metric: "read-requests"
        unit: "1/min/{project}"
        values:
          STANDARD: 3

Here is the relevant path configuration:

paths:
  /v1/foo:
    get:
      summary: foo Data
      operationId: fooData
      x-google-backend:
        path_translation: APPEND_PATH_TO_ADDRESS
        address: ${PUB_API_FNC_URL}
      x-google-quota:
        metricCosts:
          "read-requests": 1

*the backend of the api gateway path is a cloud function

Issue: When I add the x-api-key header to the request, the quota limits are not being enforced, regardless of the value provided in the header. However, when the x-api-key header is not included, the quota works as expected.

Details:

There are no security definitions configured in the OpenAPI spec. The x-api-key is not explicitly associated with any project in the configuration.

Any idea why this header "breaks" the api quota enforcement?

本文标签: google cloud platformQuota Limits Not Respected When Using xapikey Header in API GatewayStack Overflow