File tree Expand file tree Collapse file tree 2 files changed +39
-26
lines changed
client/views/api_backends Expand file tree Collapse file tree 2 files changed +39
-26
lines changed Original file line number Diff line number Diff line change @@ -78,31 +78,10 @@ ApiBackendsSchema = new SimpleSchema({
7878 type : String ,
7979 regEx : / ^ [ a - z 0 - 9 A - Z _ ] { 3 , 15 } $ /
8080 } ,
81- duration : {
82- type : Number ,
83- optional : true ,
84- label : 'Duration'
85- } ,
86- accuracy :{
87- type : Number ,
88- optional : true
89- } ,
90- limit_by : {
91- type : String ,
92- optional : true
93- } ,
94- limit : {
95- type : Number ,
96- optional : true
97- } ,
9881 distributed : {
9982 type : Boolean ,
10083 optional : true
10184 } ,
102- response_headers : {
103- type : Boolean ,
104- optional : true
105- } ,
10685 matcher_type : {
10786 type : String ,
10887 optional : true
@@ -227,8 +206,43 @@ ApiBackendsSchema = new SimpleSchema({
227206 'Custom rate limits' ,
228207 'Unlimited requests'
229208 ] ,
230- label : 'Rate limit'
231209 } ,
210+
211+ custom_rate_limits : {
212+ type : [ Object ] ,
213+ optional : true
214+ } ,
215+ "custom_rate_limits.$.duration" : {
216+ type : String ,
217+ optional : true
218+ } ,
219+ "custom_rate_limits.$.accuracy" : {
220+ type : Number ,
221+ optional : true ,
222+ allowedValues : [
223+ 'Seconds' ,
224+ 'Minutes' ,
225+ 'Hours'
226+ ]
227+ } ,
228+ "custom_rate_limits.$.limit_by" : {
229+ type : String ,
230+ optional : true ,
231+ allowedValues : [
232+ 'API key' ,
233+ 'IP Address'
234+ ]
235+ } ,
236+ "custom_rate_limits.$.limit" : {
237+ type : Number ,
238+ optional : true ,
239+ label : 'Number of requests' ,
240+ } ,
241+
242+ "custom_rate_limits.$.response_headers" : {
243+ type : Boolean ,
244+ optional : true
245+ } ,
232246 anonymous_rate_limit_behavior : {
233247 type : String ,
234248 optional : true
Original file line number Diff line number Diff line change @@ -46,10 +46,9 @@ <h4>Global Request Settings</h4>
4646 {{> afQuickField name='pass_api_key_header'}}
4747 {{> afQuickField name='pass_api_key_query_param'}}
4848 {{> afQuickField name='rate_limit_mode' options="allowed"}}
49- {{> afQuickField name='duration'}}
50- {{> afQuickField name='accuracy'}}
51- {{> afQuickField name='limit_by'}}
52- {{> afQuickField name='limit'}}
49+ {{#if afFieldValueIs name='rate_limit_mode' value="Custom rate limits"}}
50+ {{> afQuickField name='custom_rate_limits'}}
51+ {{/if}}
5352 < h4 > Sub-URL Request Settings</ h4 >
5453 < hr />
5554 < span class ="help-block "> Change settings for specific sub-URLs within this API.</ span >
You can’t perform that action at this time.
0 commit comments