Hello, greetings.
I’m currently using Tyk Gateway Community Edition, which comes only with Redis and Gateway. I’m looking to create multiple policies for my use case. While referring to Secure an API , it talks about the structure of how to define a policy. But I would like to create multiple policies, hence am I supposed to edit the /policies/policies.json file to accommodate multiple policies or will tyk allow only one policy in the Community Edition. Any insights on this would be very helpful!
Already existing Content in policies.json:
{
“default”: {
“rate”: 1000,
“per”: 1,
“quota_max”: 100,
“quota_renewal_rate”: 60,
“access_rights”: {
“41433797848f41a558c1573d3e55a410”: {
“api_name”: “My API”,
“api_id”: “41433797848f41a558c1573d3e55a410”,
“versions”: [
“Default”
]
}
},
“org_id”: “54de205930c55e15bd000001”,
“hmac_enabled”: false
}
}
Changed policies.json file content:
{
“default”: {
“rate”: 1000,
“per”: 1,
“quota_max”: 100,
“quota_renewal_rate”: 60,
“access_rights”: {
“httpbinTest”: {
“api_name”: “httpbin Test API”,
“api_id”: “httpbinTest”,
“versions”: [
“Default”
]
}
},
“org_id”: “VW5pdHkgSW5mb3RlY2ggU29sdXRpb25zIChVSVMpIEdsb2JhbCBQdnQuIEx0ZC4=”,
“hmac_enabled”: false
},
“myNewPolicy”: {
“name”: “My New Policy”,
“rate”: 500,
“per”: 1,
“quota_max”: 50,
“quota_renewal_rate”: 3600,
“access_rights”: {
“myTestApi”: {
“api_name”: “My Test API”,
“api_id”: “myTestApi”,
“versions”: [
“Default”
]
},
“testApi”: {
“api_name”: “API Test”,
“api_id”: “testApi”,
“versions”: [
“Default”
]
}
},
“org_id”: “VW5pdHkgSW5mb3RlY2ggU29sdXRpb25zIChVSVMpIEdsb2JhbCBQdnQuIEx0ZC4=”,
“hmac_enabled”: false
}
}
Thanks and Cheers!
Prashanth (@selvamp)