backend: gate existing endpoints behind auth and app permissions #2

Open
restitux wants to merge 1 commits from auth/2-gate-endpoints into auth/1-user-management
Owner

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

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>
restitux reviewed 2026-04-16 15:07:21 +00:00
@@ -144,2 +146,4 @@
}
// Filter apps by user permissions (admins see everything)
if let Some(ref user) = user {
Author
Owner

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.

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.
restitux reviewed 2026-04-16 15:12:38 +00:00
@@ -88,2 +90,4 @@
});
// Check app permission
if let Some(user) = auth::get_user_from_depot(depot) {
Author
Owner

Same issue here.

Same issue here.
restitux marked this conversation as resolved
restitux added 1 commit 2026-04-16 15:16:18 +00:00
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>
restitux force-pushed auth/2-gate-endpoints from bfe2d79a59 to 826a3b59c9 2026-04-16 15:16:18 +00:00 Compare
restitux reviewed 2026-04-16 15:19:26 +00:00
restitux left a comment
Author
Owner

Code looks good, need to test manually.

Code looks good, need to test manually.
restitux marked the pull request as ready for review 2026-04-16 15:19:36 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin auth/2-gate-endpoints:auth/2-gate-endpoints
git checkout auth/2-gate-endpoints
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: restitux/gamestream-webtransport-proxy#2