这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@srinandan
Copy link
Collaborator

No description provided.

@srinandan srinandan requested a review from kurtkanaskie August 1, 2023 23:43
@srinandan srinandan self-assigned this Aug 1, 2023
@srinandan srinandan added the bug Something isn't working label Aug 1, 2023
@srinandan srinandan linked an issue Aug 1, 2023 that may be closed by this pull request
Copy link
Collaborator

@kurtkanaskie kurtkanaskie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Policy names are being split by '-' character.

x-google-quota: 
        # using "post-pet" as the name, results in a policy named "Quota-post", post_pet works
        - name: post_pet

This affects x-google-quota when using quota config in product

x-google-quota:
  - name: preflow_product 
    useQuotaConfigInAPIProduct: Verify-API-Key-api_key 

Proxy bundle contains a quota policy with an incorrect stepName reference:

<Quota async="false" continueOnError="false" enabled="true" type="calendar" name="Quota-preflow_product">
    <DisplayName>Quota-preflow_product</DisplayName>
    <UseQuotaConfigInAPIProduct stepName="Verify"/>
    <Distributed>true</Distributed>
    <StartTime>2019-01-01 00:00:00</StartTime>
</Quota>

Use of multiple occurrences is processed without error, but only policies for the second occurrence is created.

x-google-ratelimit: 
  - name: preflow_10ps
    rate-literal: 10ps
    identifier-ref: request.header.url #optional
  - name: preflow_20ps
    rate-literal: 20ps
    identifier-ref: request.header.url #optional

DEBUG: Spike map: [map[identifier-ref:request.header.url name:preflow_10ps rate-literal:10ps] map[identifier-ref:request.header.url name:preflow_20ps rate-literal:20ps]]

@srinandan srinandan requested a review from kurtkanaskie August 2, 2023 15:01
Copy link
Collaborator

@kurtkanaskie kurtkanaskie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now underscores in name don't work, but I can work around that by using names with hyphen instead. Can't use an underscore in secutity scheme name.

@srinandan srinandan requested a review from kurtkanaskie August 2, 2023 16:48
Copy link
Collaborator

@kurtkanaskie kurtkanaskie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! thanks for the quick turn around!

@srinandan srinandan merged commit 77b7816 into main Aug 2, 2023
@srinandan srinandan deleted the issue246 branch August 2, 2023 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: incorrect parsing of quota and rate limit definitions in openapi

3 participants