Taha ÇEKEN
09/05/2025, 8:54 AM/allowed_url, the PDP correctly returns "allow": true for my user and URL.
Example PDP request:
POST http://172.24.16.56:7766/allowed_url
{
"user": { "key": "ae454a25-958b-40c0-b004-a02495c0293f" },
"url": "https://api.abex.com.tr/test/api/booking/en/bookings/",
"http_method": "GET",
"tenant": "default"
}
RESPONSE
{
"allow": true,
"query": {},
"debug": {
"rbac": {
"allow": true,
"allowing_roles": [
"Employee"
],
"code": "allow",
"reason": "user 'ae454a25-958b-40c0-b004-a02495c0293f' has the role 'Employee' in tenant 'default', role 'Employee' has the 'read' permission on resources of type 'document'"
},
"request": {
"action": "read",
"resource": {
"attributes": {
"booking_id": "",
"type": "document"
},
"type": "document"
},
"tenant": "default",
"user": {
"attributes": {
"email": "employee@test.com",
"key": "ae454a25-958b-40c0-b004-a02495c0293f",
"roles": [
"Employee"
],
"tenants": [
"default"
]
},
"key": "ae454a25-958b-40c0-b004-a02495c0293f",
"synced": true
}
}
},
"result": true
}
However, when I call the Permit.io proxy endpoint: https://proxy.api.permit.io/proxy/46686b3e7f804317a3143ad1e3a757bc?url=https://api.abex.com.tr/test/api/booking/en/bookings/
I always get the following error:
{
"detail": "Proxy rule not found, consider checking your 'URL' parameter and the request method, or adding a new mapping rule. Hint: pay attention to the trailing slash, or lack thereof."
}
my current proxy config
{
"key": "api-abex",
"id": "46686b3e7f804317a3143ad1e3a757bc",
"organization_id": "50b10af7e4d44b9aae623be4c2466e5a",
"project_id": "167998e377d0412d9822b65450d740ba",
"environment_id": "8fb17dd891a741c4bcc55bf2d4c4dd55",
"created_at": "2025-09-05T072121+00:00",
"updated_at": "2025-09-05T073503+00:00",
"secret": "permit_key_3SJZ915SqaxuMSf6GU7WxGk1VDZ9JWzm4Xw3i8HQCGguq3Ra5IZ8gMGVPJ0H8gHWkFiVRdtS2xDrH78JevtQqS",
"name": "api-abex",
"mapping_rules": [
{
"url": "https://api.abex.com.tr/test/api/booking/en/bookings/{booking_id}",
"url_type": null,
"http_method": "get",
"resource": "document",
"headers": {},
"action": "read",
"priority": null
},
{
"url": "https://api.abex.com.tr/test/api/booking/en/bookings/",
"url_type": null,
"http_method": "get",
"resource": "document",
"headers": {},
"action": "read",
"priority": null
}
],
"auth_mechanism": "Bearer"
}
and proxy config screenshot added as attachment
Thank you!Ask Inkeep
09/05/2025, 8:54 AMAsk Inkeep
09/05/2025, 8:55 AM/allowed_url endpoint is already working correctly, you should continue using that approach (3) . URL Mapping is the replacement for FoAz .
Your current PDP check is already configured correctly and returning the expected results. You can integrate this directly with AWS API Gateway using a Lambda authorizer that calls your PDP's /allowed_url endpoint.
Option 2: Direct API Gateway Integration
According to the documentation, you can implement authorization at the API Gateway layer (4) . The approach involves:
1. Using the PDP as the authorization service
2. Mapping URLs to resources and actions (which you've already done)
3. Having the gateway call the PDP for authorization decisions
The documentation mentions that API Gateways like AWS API Gateway can be integrated with Permit.io's PDP .
Why the Proxy Error Occurs
The FoAz proxy endpoint (`https://proxy.api.permit.io/proxy/`) is part of the deprecated FoAz feature (5) (1) (2) . Even though you have mapping rules configured, the proxy service itself is no longer actively maintained.
Recommended Solution
Continue using your working PDP /allowed_url endpoint with AWS API Gateway. Since this is already returning correct authorization decisions, you can:
1. Create a Lambda authorizer in AWS API Gateway
2. Have the Lambda call your PDP's /allowed_url endpoint
3. Return the authorization decision to API Gateway
This approach is more reliable and follows the current best practices for gateway integration with Permit.io (4) .
To help our engineers investigate if you're still experiencing issues with the PDP or policy checks:
1. Which Workspace / Project / Env are you using?
2. What calls are you performing (as SDK code or CURL) ?
3. Which PDP version are you running?
4. Could you share relevant logs from your PDP?Ask Inkeep
09/05/2025, 8:55 AMAsk Inkeep
09/05/2025, 8:56 AMTaha ÇEKEN
09/05/2025, 8:58 AMAsk Inkeep
09/05/2025, 8:58 AMAsk Inkeep
09/05/2025, 8:58 AM{
"url": "<https://api.stripe.com/v1/balance>",
"method": "POST",
"resource": "balance"
}
*Recommended Alternative:*
Instead of using the deprecated FoAz proxy, use the URL Mapping feature with your PDP (4) . The URL Mapping check is available through the /allowed_url endpoint on your PDP (which you mentioned is already working) .
To use URL Mapping :
docker run -it \
-p 7766:7000 \
--env PDP_API_KEY=permit_key_{your_permit_env_key} \
--env PDP_DEBUG=True \
permitio/pdp-v2:latest
Then call the PDP directly :
curl --location '<http://localhost:7766/allowed_url>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer permit_key_{your_key}' \
--data '{
"user": {
"key": "<mailto:raz@permit.io|raz@permit.io>"
},
"url": "<https://example.com/endpoint?param=value>",
"http_method": "POST",
"tenant": "default"
}'
Since your PDP /allowed_url endpoint is already working correctly, continue using that approach rather than the deprecated proxy endpoint.
To help our engineers investigate if you're still experiencing issues with the PDP or policy checks:
1. Which Workspace / Project / Env are you using?
2. What calls are you performing (as SDK code or CURL) ?
3. Which PDP version are you running?
4. Could you share relevant logs from your PDP?Ask Inkeep
09/05/2025, 8:58 AMTaha ÇEKEN
09/05/2025, 9:06 AMAsk Inkeep
09/05/2025, 9:06 AMAsk Inkeep
09/05/2025, 9:06 AM/allowed_url endpoint.
The AWS API Gateway integration guide shows that you need to create a Lambda function that uses Permit to authorize requests . Here's the approach from the documentation:
from permitio import Permit
import asyncio
permit = Permit(
token="permit_key_xxxxx",
)
def lambda_handler(event, context) :
user_id = event['headers'].get('permit-user-key')
action = event['headers'].get('permit-action')
resource_type = event['headers'].get('permit-resource-type')
# Use asyncio to run the permit.Check() method
is_allowed = asyncio.run(permit.check(user_id, action, resource_type) )
if is_allowed:
return {
'principalId': user_id,
'policyDocument': {
'Version': '2012-10-17',
'Statement': [{
'Action': 'execute-api:Invoke',
'Effect': 'Allow',
'Resource': event['methodArn']
}]
}
}
else:
raise Exception('Unauthorized')
The documentation explains that you need to :
1. Create a Lambda function with Permit.io SDK
2. Deploy the Lambda function
3. Create an API Gateway authorizer that uses this Lambda function
4. Attach the authorizer to your API resources
The FoAz proxy you discovered is deprecated and no longer supported (2) (3) , which is why you're getting errors. The proxy was designed to eliminate backend code, but it's not a viable solution anymore.
For production deployments, the guide also recommends deploying your own PDP in the same region and VPC as your Lambda function to reduce latency (1) .
So yes, you'll need to use a Lambda authorizer - there's no way to have AWS API Gateway directly call the PDP's /allowed_url endpoint without an intermediary Lambda function.Ask Inkeep
09/05/2025, 9:07 AMAlon Boshi
09/05/2025, 9:09 AMTaha ÇEKEN
09/05/2025, 9:11 AMAlon Boshi
09/05/2025, 9:42 AMOr Weis
09/07/2025, 2:29 PM