Skip to content

Commit

Permalink
Add Sandbox rate limit
Browse files Browse the repository at this point in the history
  • Loading branch information
JackPlowman committed Apr 5, 2024
1 parent c935935 commit d5381ea
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
20 changes: 18 additions & 2 deletions manifest_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,44 @@ APIGEE_ENVIRONMENTS:
- name: internal-dev
display_name: Internal Development
has_mock_auth: true
rate_limit: 300
spike_rate_limit: 600pm # 10 requests per second
- name: internal-qa
display_name: Internal QA
has_mock_auth: true
rate_limit: 300
spike_rate_limit: 600pm # 10 requests per second
- name: ref
display_name: Reference
has_mock_auth: true
rate_limit: 300
spike_rate_limit: 600pm # 10 requests per second
- name: internal-dev-sandbox
display_name: Internal Development Sandbox
portal_visibility: false
rate_limit: 300
spike_rate_limit: 600pm # 10 requests per second
- name: internal-qa
display_name: Internal QA
has_mock_auth: true
portal_visibility: false
rate_limit: 300
spike_rate_limit: 600pm # 10 requests per second
- name: internal-qa-sandbox
display_name: Internal QA Sandbox
portal_visibility: false
rate_limit: 300
spike_rate_limit: 600pm # 10 requests per second
- name: sandbox
display_name: Sandbox
portal_visibility: false
rate_limit: 120
spike_rate_limit: 300pm # 5 requests per second
- name: int
display_name: Integration Testing
has_mock_auth: true
rate_limit: 300
spike_rate_limit: 600pm # 10 requests per second
---
meta:
api:
Expand Down Expand Up @@ -54,12 +70,12 @@ apigee:
{{ NAME }}:
quota:
enabled: true
limit: 300
limit: {{ ENV.rate_limit }}
interval: 1
timeunit: minute
spikeArrest:
enabled: true
ratelimit: 600pm # 10 requests per second
ratelimit: {{ ENV.spike_rate_limit }}
app:
quota:
enabled: false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<FlowCallout async="false" continueOnError="false" enabled="true" name="FlowCallout.ApplyRateLimiting">
<DisplayName>FlowCallout.ApplyRateLimiting</DisplayName>
<SharedFlowBundle>ApplyRateLimiting</SharedFlowBundle>
</FlowCallout>
3 changes: 3 additions & 0 deletions proxies/sandbox/apiproxy/targets/sandbox.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
</PostFlow>
<PreFlow name="PreFlow">
<Request/>
<Step>
<Name>FlowCallout.ApplyRateLimiting</Name>
</Step>
<Response>
<Step>
<Name>AssignMessage.AddCors</Name>
Expand Down

0 comments on commit d5381ea

Please sign in to comment.