-
Notifications
You must be signed in to change notification settings - Fork 415
Closed
Closed
Copy link
Labels
bugSomething isn't workingSomething isn't workingtriageIssues / Features awaiting triageIssues / Features awaiting triage
Description
Currently, the following endpoints use non-unique identifiers (name for prompts and uri for resources):
Prompt Endpoints:
@admin_router.post("/prompts/{name}/edit")
@admin_router.post("/prompts/{name}/delete")
@admin_router.get("/prompts/{name}")
@prompt_router.put("/{name}", response_model=PromptRead)
@prompt_router.delete("/{name}")
@prompt_router.post("/{name}")
@prompt_router.get("/{name}")Resource Endpoints:
@admin_router.post("/resources/{uri}/edit")
@admin_router.post("/resources/{uri}/delete")
@admin_router.get("/resources/{uri}")
@resource_router.get("/{uri:path}")
@resource_router.put("/{uri:path}", response_model=ResourceRead)
@resource_router.delete("/{uri:path}")
@resource_router.post("/subscribe/{uri:path}")However, prompt names and resource URIs are not guaranteed to be unique across different teams or users (especially when visibility is set to team or private). This can cause conflicts and incorrect operations.
Proposed Change:
Update these endpoints to use unique identifiers (prompt_id and resource_id) instead:
Updated Prompt Endpoints:
@admin_router.post("/prompts/{prompt_id}/edit")
@admin_router.post("/prompts/{prompt_id}/delete")
@admin_router.get("/prompts/{prompt_id}")
@prompt_router.put("/{prompt_id}", response_model=PromptRead)
@prompt_router.delete("/{prompt_id}")
@prompt_router.post("/{prompt_id}")
@prompt_router.get("/{prompt_id}")Updated Resource Endpoints:
@admin_router.post("/resources/{resource_id}/edit")
@admin_router.post("/resources/{resource_id}/delete")
@admin_router.get("/resources/{resource_id}")
@resource_router.get("/{resource_id}")
@resource_router.put("/{resource_id}", response_model=ResourceRead)
@resource_router.delete("/{resource_id}")
@resource_router.post("/subscribe/{resource_id}")Impact:
- Prevents conflicts when multiple prompts or resources share the same name/URI.
- Ensures correct record-level operations across teams and users.
- Improves API consistency and reliability.
Tasks:
- Update route definitions to use
prompt_idandresource_id. - Update frontend/API calls to send
prompt_idandresource_idinstead ofname/uri. - Verify edit, delete, and fetch operations for both Prompts and Resources under user/team visibility scopes.
Additional Notes:
This change will ensure unique identification and accurate operations across all team and user contexts.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingtriageIssues / Features awaiting triageIssues / Features awaiting triage