Skip to main content
Version: Next

Internal Limits

The internal_limits section is designed to set more specific constraints within the main quota by defining nested intenal limits that inherit from the main parent quota. Each internal limit can have its own filters and strategies, enabling precise control over distinct user groups or endpoints.


Quota Example​

Here’s an example of a quota configuration defined in a quota.yaml file. In this example we see that api.website.com/* has a quota, MyQuota of 2000 requests per day. Part of this quota are the Production, Team1 and Team2 limits which allow only 50 requests each per minute.

/etc/lunar-proxy/quotas/{fileName}.yaml

quotas:
- id: MyQuota
filter:
url: api.website.com/*
strategy:
fixed_window:
max: 20000
interval: 1
interval_unit: day

internal_limits:
- id: Production
parent_id: MyQuota
strategy:
fixed_window:
max: 50
interval: 1
interval_unit: minute

- id: Team1
parent_id: MyQuota
strategy:
fixed_window:
max: 50
interval: 1
interval_unit: minute

- id: Team2
parent_id: MyQuota
strategy:
fixed_window:
max: 50
interval: 1
interval_unit: minute