i just saw our meeting canceled so i will ask my q...
# permit-saas
t
i just saw our meeting canceled so i will ask my questions through here. • URL Mapping ◦ Each time a URL mapping is edited, a new one is created while the old one remains. What is the recommended solution for this issue? ◦ also i cannot delete url mapping. • User Sync ◦ When should the user sync process be executed? What is considered best practice? (We are considering doing this at the pre-token generation stage to keep sync users with cognito) • Lambda Authorizer + Permit.io ◦ Is it recommended to perform resource, user, and action checks directly within the Lambda Authorizer using Permit.check()? with usage of lambda layer ◦ Or should we instead query the PDP’s
/allowed_url
endpoint?
a
Hi @Taha ÇEKEN, I'm an AI assistant for Permit.io. I'll analyze available sources and get back to you shortly.
Let me address your questions: URL Mapping Issues I notice the documentation mentions that FoAz is deprecated (1) (2) . The URL Mapping feature is available at app.permit.io/url-mapping (1) . However, the specific issues you're experiencing with duplicate mappings and deletion aren't covered in the available documentation. To help our engineers investigate these URL mapping issues: 1. Which Workspace / Project / Env are you using? 2. What specific API calls or UI actions are you performing when editing mappings? 3. Which PDP version are you running? 4. Can you share relevant logs showing the duplicate creation behavior? User Sync Best Practices The recommended point to sync users is during the sign-in or sign-up process, right after authentication verifies the user's identity (3) . This occurs at the "handoff point" - the moment users interact with your system . For Cognito specifically, you have two options after login (4) : • Use Cognito's redirect to a specific URL after login • Use the
code
query parameter they send after login Here's the recommended approach from the documentation :
Copy code
// frontend/app.mjs  
if (searchParams.get("code") !== null) {  
 //...  
 const syncUser = await fetch("api/sync", {  
 method: "POST",  
 headers: new Headers({ Authorization: `Bearer ${tokens.access_token}` }) ,  
 }) ;  
 //...  
}
Your pre-token generation stage aligns with the recommended practice of syncing "during the login process, as soon as a user's identity is verified" (3) . Lambda Authorizer Options For checking permissions with URL mapping, you should use the
/allowed_url
endpoint on the PDP (1) . Here's the documented approach:
Copy code
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"  
}'
The
/allowed_url
endpoint is specifically designed for URL-based permission checks and is supported in PDP version 0.2.19 or higher .
To learn more, see the sources I considered: [[1] Simple URL Mapping Check](https://docs.permit.io/foaz/url-mapping-check) [[2] Regex URL Mapping Check](https://docs.permit.io/foaz/regex-url-mapping-check) [[3] Sync your Application Data | Permit.io Documentation](https://docs.permit.io/overview/sync-application-data-into-permit) [[4] Cognito and Permit Integration](https://docs.permit.io/authentication/cognito/permit-integration)
t
"organization_id": "50b10af7e4d44b9aae623be4c2466e5a" "project_id": "167998e377d0412d9822b65450d740ba", "environment_id": "8fb17dd891a741c4bcc55bf2d4c4dd55", (development) it returns 200 after update but it doesnt update existing map, creates new. and i cannot delete any mapping
a
Hey @Taha ÇEKEN , Saw your question and will be back to you
✅ 1
Hey @Taha ÇEKEN, tried it myself and it worked. You can take a look at the Proxy Configs API reference here: proxy-config Did you do/try something else?
t
I’m encountering an issue when trying to edit or delete items via the UI. As a temporary workaround, I can perform these actions using API requests. However, my team needs to be able to manage this directly through the Permit.io UI. If you could help resolve this error, I’d greatly appreciate it.
a
Can you explain what is the issue? What do you see?
@Taha ÇEKEN I want to help you and resolve your issue, can you please share a screenshot of the error you get when you perform those actions in the UI? If you want to perform those actions using API requests, and need any help, feel free to ask
👍 1
t
@Alon Boshi as you can see in the video. When i edit existing one it creates a new one. Also i cannot delete.
a
Thanks @Taha ÇEKEN for sharing this video, I’ll have a look and will get back to you
🙏 1
Hey @Taha ÇEKEN, We opened a ticket and we'll let you know when this is fixed. Thanks for pointing this out!
t
Thanks for the quick response and opening a ticket. I appreciate your support and will be waiting for the update. @Alon Boshi
🙏🏼 1
a
Hey @Taha ÇEKEN the fix for those actions in the UI is now being deployed to production. You should be able to experience them shortly 🙏🏼
t
Thanks a lot 🙌 I’ll check it out shortly! @Alon Boshi
💜 1