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 8, 2024
1 parent a0ae051 commit 3aa8aac
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 3aa8aac

Please sign in to comment.