Hi,
I am unable to get global rate limit working. I have it setup as below but I am able to hit the endpoint as many times as I want. This is keyless.
"disable_quota":false,
"quota_max" : 5,
"quota_remaining":5,
"quota_renewal_rate":30
I got rate limit to work per api. I haven’t tried with key. Can both rate limit and quota be used per key on top of api?
Can they be used as a setting for all apis in one go?
UPDATE: I actually posted the wrong snippet. It was for rate limit. I meant to ask about quota. Is quota meant to be used with key only? I am trying to setup quota for both key and api level.
I’ve also added a ./policy/policy.json with contents below (and tinkered with it few times).
{
"default": {
"rate": 1000,
"per": 1,
"quota_max": 10,
"quota_renewal_rate": 60,
"access_rights": {
"41433797848f41a558c1573d3e55a410": {
"api_name": "Quota test api",
"api_id": "41433797848f41a558c1573d3e55a410",
"versions": [
"Default"
]
}
},
"active": true,
"state": "active",
"org_id": "54de205930c55e15bd000001",
"hmac_enabled": false
}
}
It is version 3.0 using docker-compose.
version: '3.3'
services:
tyk-gateway:
image: tykio/tyk-gateway:v3.0.4
ports:
- 8080:8080
networks:
- tyk
volumes:
- ./tyk.standalone.conf:/opt/tyk-gateway/tyk.conf
- ./apps:/opt/tyk-gateway/apps
- ./middleware:/opt/tyk-gateway/middleware
- ./certs:/opt/tyk-gateway/certs
- ./policies/policies.json:/opt/tyk-gateway/policies/policies.json
environment:
- TYK_GW_SECRET=bar
depends_on:
- tyk-redis
tyk-redis:
image: redis:5.0-alpine
networks:
- tyk
ports:
- 6379:6379
volumes:
- redis_data:/data
networks:
tyk:
volumes:
redis_data:
Policy mapping in tyk.standalone.conf
"policies": {
"policy_source": "file",
"policy_record_name": "/opt/tyk-gateway/policies/policies.json"
},
The problem I am facing is quota does not work regardless (policy or within the app definition)