Add ability to configure proxy quotas

The quotas can be configured in the yaml configuration file. Default quota will be applied to any userId that is not matched in the custom quota list.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178804649
This commit is contained in:
jianglai 2017-12-12 13:19:14 -08:00
parent c941190e71
commit c5515ab4e6
8 changed files with 258 additions and 1 deletions

View file

@ -0,0 +1,8 @@
refreshSeconds: 3600
defaultQuota:
userId: []
tokenAmount: 100
refillSeconds: 60
customQuota: []

View file

@ -0,0 +1,14 @@
refreshSeconds: 3600
defaultQuota:
userId: []
tokenAmount: 100
refillSeconds: 60
customQuota:
- userId: ["abc", "def"]
tokenAmount: 10
refillSeconds: 60
- userId: ["xyz123", "def", "luckycat"]
tokenAmount: 500
refillSeconds: 10

View file

@ -0,0 +1,14 @@
refreshSeconds: 3600
defaultQuota:
userId: []
tokenAmount: 100
refillSeconds: 60
customQuota:
- userId: ["abc", "def"]
tokenAmount: 10
refillSeconds: 60
- userId: ["xyz123", "987lol", "luckycat"]
tokenAmount: 500
refillSeconds: 10