feat(project): Add superuser settings endpoint - #1129
Conversation
|
Warning Review limit reachedNext included review available in 31 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
OpenAPI changes 🟢 1 non-breaking changeTip Safe to merge from an API-contract perspective. Full changelog ·
|
| Method | Path | Change | |
|---|---|---|---|
| 🟢 | PATCH |
/api/v1/projects/{project_id}/settings |
endpoint added |
main ↔ 2f594c77 · generated by oasdiff
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Issue
Closes #1084
Summary
Superusers previously had no way to change project-level settings (e.g. Langfuse tracing) for projects in other organizations — the existing
PATCH /projects/settingsendpoint only operates on the project bound to the caller's API key. This PR adds a project-scoped settings endpoint that lets superusers patch any project's settings across organizations.PATCH /projects/{project_id}/settings— patches the project'ssettingsJSONB (currentlytracing: bool). Only keys provided in the body are changed; existing keys are preserved.project_idreturns 403.No settings provided); missing or inactive projects return 404 viavalidate_project.superuser_update_settings.mddescribing the settings shape and access scope.Checklist
Before submitting a pull request, please ensure that you mark these task.
fastapi run --reload app/main.pyordocker compose upin the repository root and test.Notes
No schema/migration changes — reuses the existing
ProjectSettingsUpdatemodel andupdate_project_settingsCRUD. The existing key-scopedPATCH /projects/settingsendpoint is unchanged.