I am a bit unclear about this? Is this with the per_api
enabled (as shown below)? Also, does this mean that you have gotten the expected outcome?
If it’s still not working, can you insert the access_rights
into the policy definition instead and try again. I have dropped an example below
Policy Definition
{
"access_rights": {
"<API-01-ID>": {
"allowed_urls": [],
"api_id": "<API-01-ID>",
"api_name": "<API-01-NAME>",
"versions": [
"Default"
]
},
"<API-02-ID>": {
"allowance_scope": "",
"allowed_urls": [],
"api_id": "<API-02-ID>",
"api_name": "<API-02-NAME>",
"field_access_rights": null,
"limit": {
"per": -1,
"rate": -1
},
"restricted_types": null,
"versions": [
"Default"
]
}
},
"active": true,
"auth_type": "authToken",
"auth_types": [
"authToken"
],
"id": "<POLICY-ID>",
"is_inactive": false,
"key_expires_in": 86400,
"name": "<POLICY-NAME>",
"org_id": "<ORG-ID>",
"partitions": {
"per_api": true
},
"per": 5,
"quota_max": 24,
"quota_renewal_rate": 60,
"rate": 30,
"state": "active",
"tags": null,
"throttle_interval": -1,
"throttle_retry_limit": -1
}
Key Creation API Body
{
"access_rights": {},
"alias": "<KEY-NAME>",
"apply_policies": [
"<POLICY-ID>"
],
"apply_policy_id": "",
"expires": 86400,
"is_inactive": false,
"org_id": "<ORG-ID>"
}
You should see a value for the allowed_scope
in the key. That tells the key what restrictions are applied to it (whether it is a per_api restriction or one inherited from the policy).
{
"last_check": 0,
"allowance": 0,
"rate": 0,
"per": 0,
"throttle_interval": 0,
"throttle_retry_limit": 0,
"max_query_depth": 0,
"date_created": "2022-04-20T11:39:25.9511266Z",
"expires": 0,
"quota_max": 0,
"quota_renews": 1650454765,
"quota_remaining": 0,
"quota_renewal_rate": 0,
"access_rights": {
"free": {
"api_name": "Free API",
"api_id": "free",
"versions": [
"Default"
],
"allowed_urls": [],
"restricted_types": null,
"limit": {
"rate": 30,
"per": 5,
"throttle_interval": -1,
"throttle_retry_limit": -1,
"max_query_depth": -1,
"quota_max": 24,
"quota_renews": 0,
"quota_remaining": 24,
"quota_renewal_rate": 60
},
"field_access_rights": null,
"allowance_scope": "partitioned-05"
},
"subscriber": {
"api_name": "Subscriber API",
"api_id": "subscriber",
"versions": [
"Default"
],
"allowed_urls": [],
"restricted_types": null,
"limit": {
"rate": -1,
"per": -1,
"throttle_interval": 0,
"throttle_retry_limit": 0,
"max_query_depth": 0,
"quota_max": 0,
"quota_renews": 0,
"quota_remaining": 0,
"quota_renewal_rate": 0
},
"field_access_rights": null,
"allowance_scope": "subscriber"
}
},
"org_id": "adi",
"oauth_client_id": "",
"oauth_keys": null,
"certificate": "",
"basic_auth_data": {
"password": "",
"hash_type": ""
},
"jwt_data": {
"secret": ""
},
"hmac_enabled": false,
"enable_http_signature_validation": false,
"hmac_string": "",
"rsa_certificate_id": "",
"is_inactive": false,
"apply_policy_id": "",
"apply_policies": [
"partitioned-05"
],
"data_expires": 0,
"monitor": {
"trigger_limits": null
},
"enable_detail_recording": false,
"enable_detailed_recording": false,
"meta_data": {},
"tags": [],
"alias": "Sailor Partition Key 14",
"last_updated": "1650454765",
"id_extractor_deadline": 0,
"session_lifetime": 0,
"key_id": "adi40db3a9e51e24ae0bcdca4bf1562eda2"
}