Taha ÇEKEN
11/17/2025, 7:24 AMurl_type is not being saved correctly.
For example, this mapping is saved properly and appears with the regex badge on the frontend:
{
"url": "https?://api.abclojistik.com/test/api/erp/(?:tr|en)/reports/?.*$",
"url_type": "regex",
"http_method": "get",
"resource": "erp_report",
"headers": {},
"action": "read",
"priority": null
}
However, this one gets saved with "url_type": null even though it is also a regex, and the frontend still shows it with the regex badge:
{
"url": "https?://api.abclojistik.com/test/api/hub/(?:tr|en)/orders/?.*$",
"url_type": null,
"http_method": "patch",
"resource": "hub_order",
"headers": {},
"action": "update",
"priority": null
}
When I fetch this configuration from the Permit.io API, it does not indicate that it’s a regex.
I’m not sure if this inconsistency is the root cause, but I’m also getting a PDP crash when calling the allowed_url endpoint.
I’ve attached the PDP crash logs to this message. it gives error about Horizon server. But this error occured after i added new url_mappings.
I need to resolve this issue as soon as possible. Any help would be greatly appreciated.Ask Inkeep
11/17/2025, 7:24 AMAsk Inkeep
11/17/2025, 7:24 AMurl_type field must be explicitly set to "regex" for regex pattern matching to work properly (1) .
When creating proxy configurations with regex patterns, the API call should include url_type: "regex" explicitly :
{
"url": "^<https://api>\\.example\\.com/api/v1/users/(?P<user_id>[0-9]+) /profile$",
"http_method": "post",
"resource": "users",
"action": "update",
"url_type": "regex"
}
The inconsistency where one mapping saves with "url_type": "regex" and another with "url_type": null despite both being regex patterns suggests the url_type field isn't being set correctly during creation. According to the documentation, regex URL mapping is only available through the Permit.io API & PDP API , and requires PDP version 0.8.0 or higher for simple URL mapping support .
To check permissions with regex URL mapping, ensure your PDP is running with proper configuration :
docker run -it \
-p 7766:7000 \
--env PDP_API_KEY=permit_key_{your_permit_env_key} \
--env PDP_DEBUG=True \
permitio/pdp-v2:latest
To help our engineers investigate this bug further, could you please provide:
1. Which Workspace / Project / Env you are using
2. What specific calls you're performing (as SDK code or CURL) when creating these proxy configs
3. Which PDP version you are running (you can check this in your container logs)
4. The relevant PDP logs showing the crash when calling the allowed_url endpoint
This information will help diagnose why the url_type field isn't being saved consistently and why the PDP is crashing.Ask Inkeep
11/17/2025, 7:24 AMTaha ÇEKEN
11/17/2025, 7:28 AMTaha ÇEKEN
11/17/2025, 7:30 AMAsk Inkeep
11/17/2025, 7:30 AMAsk Inkeep
11/17/2025, 7:31 AM< and >) and URL-encoded pipe symbols (%7C) which are causing validation problems.
Based on the documentation (1) , here are the corrected regex patterns for your endpoints:
For the hub orders endpoints:
{
"url": "^https?://api\\.abclojistik\\.com/test/api/hub/(?:tr|en) /orders(?:/.*) ?$",
"url_type": "regex",
"http_method": "get",
"resource": "hub_order",
"action": "read"
}
For the hub users endpoint:
{
"url": "^https?://api\\.abclojistik\\.com/test/api/hub/(?:tr|en) /users(?:/.*) ?$",
"url_type": "regex",
"http_method": "get",
"resource": "hub_user",
"action": "read"
}
Key corrections made:
1. Removed HTML encoding (< and >)
2. Fixed URL-encoded pipe (%7C → |)
3. Used (?:/.*) ? to match optional sub-paths (cleaner than /?.*$)
4. Added ^ at the start for complete URL matching
5. Properly escaped dots in the domain with \\.
Important note from the documentation : When sending these patterns via the API as JSON, you need to escape backslashes. So \. becomes \\. in the JSON payload.
For your PDP crash issue, since you're running PDP v0.9.7 which is above the required v0.8.0 , the crashes might be related to the malformed regex patterns. Once you fix the patterns, the PDP should handle the allowed_url endpoint correctly.
To help our engineers investigate the PDP crash further:
1. Workspace: abclojistik.com
2. Project: decision-engine
3. Env: testing
4. PDP version: 0.9.7
5. Could you share the actual PDP crash logs when calling allowed_url?Ask Inkeep
11/17/2025, 7:31 AMAlon Boshi
11/17/2025, 7:32 AMTaha ÇEKEN
11/17/2025, 8:21 AMNo data - check the PDP logs for more information.
also has that log inside audit-log. my production environment runs without any error.
with this kind of url mappings
{
"url": "https?://api.abex.com.tr/test/api/booking/(?:tr|en)/voyages/?.*$",
"url_type": "regex",
"http_method": "get",
"resource": "bkg_voyage",
"headers": {},
"action": "read",
"priority": null
},
{
"url": "<https://api.abex.com.tr/test/api/booking/{lang}/bookings/{release_no}/get-changes>",
"url_type": null,
"http_method": "get",
"resource": "bkg_booking",
"headers": {},
"action": "read",
"priority": null
},
what should i do ?
@Ask InkeepAsk Inkeep
11/17/2025, 8:21 AMAsk Inkeep
11/17/2025, 8:21 AMurl_type: "regex") and simple URL mapping (url_type: null with {lang} placeholders) .
For simple URL mapping with path parameters, you should use the {var} syntax without regex (1) :
{
"url": "<https://api.abclojistik.com/test/api/hub/{lang}/orders>",
"url_type": null,
"http_method": "get",
"resource": "hub_order",
"action": "read"
}
If you need to match sub-paths with simple URL mapping, the documentation shows you can use templating like <http://example.com/v1/{customer_id}/payments|example.com/v1/{customer_id}/payments> .
For debugging the PDP crash, you can enable debug mode to get more detailed logs (2) :
docker run -it \
-p 7766:7000 \
--env PDP_API_KEY=permit_key_{your_permit_env_key} \
--env PDP_DEBUG=True \
permitio/pdp-v2:latest
To help our engineers investigate this PDP crash bug:
1. *Workspace / Project / Env*: abclojistik.com / decision-engine / testing
2. *What calls are you performing*: Can you share the exact CURL command you're using to call the allowed_url endpoint?
3. *PDP version*: 0.9.7 (OPA 1.4.2)
4. *PDP logs*: Please share the full PDP container logs when the crash occurs - you can get these with docker logs <container_id>
The 504 timeout suggests the PDP is taking too long to evaluate the regex patterns. Try simplifying to simple URL mapping first to isolate if regex complexity is the issue.Ask Inkeep
11/17/2025, 8:21 AMTaha ÇEKEN
11/17/2025, 9:01 AMAlon Boshi
11/17/2025, 9:06 AMAlon Boshi
11/17/2025, 10:12 AMcurl --location '<https://api.permit.io/v2/facts/support/urlmapping/proxy_configs>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer permit_key_yourKey' \
--data '{
"secret": "notUsed",
"key": "test_http",
"name": "test_http",
"auth_mechanism": "Bearer",
"mapping_rules": [
{
"url": "^<http://localhost/users/(?P><user_id>[0-9]+)/profile$",
"http_method": "post",
"resource": "customers",
"action": "create",
"url_type": "regex",
"priority": "1"
}
]
}'