backend: gate existing endpoints behind auth and app permissions #2
Reference in New Issue
Block a user
Delete Branch "auth/2-gate-endpoints"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Move /api/pair, /api/apps, and /api/stream/start under the session
auth middleware so they require a valid session token. Add app-level
permission filtering: non-admin users only see and can stream apps
they have been explicitly granted access to. Admins bypass all
permission checks.
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
@@ -144,2 +146,4 @@}// Filter apps by user permissions (admins see everything)if let Some(ref user) = user {I don't like this; we should be hard failing if the depot doesn't contain a user. I will upload a version that fixes this.
@@ -88,2 +90,4 @@});// Check app permissionif let Some(user) = auth::get_user_from_depot(depot) {Same issue here.
bfe2d79a59to826a3b59c9Code looks good, need to test manually.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.