feat(auth): add access control to container routes - #19
Closed
mariuspruvot wants to merge 1 commit into
Closed
Conversation
All 6 container endpoints (create, get, stream, events, message, stop) were unprotected -- any request without authentication could access sessions. Add get_current_user dependency + installation/session-level authorization checks. - Extract _get_user_org_logins helper from get_installations_for_user - Add verify_installation_access (member-level) for session creation - Add verify_session_access (owner-fast, member-fallback) for session ops - Wire user_id into session creation (was always null) - Add 401 tests for all container endpoints + authorization unit tests
|
helPRs session created for this PR. Skill: |
Owner
Author
|
Cherry-picked to main as 182fa42 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
get_current_userdependency). Any unauthenticated request could create sessions, stream output, send messages, and stop containers. This locks them down.verify_installation_access(member-level) andverify_session_access(owner-fast path, member-fallback) authorization functionsuser_idinto session creation (was always null despite the FK existing)_get_user_org_loginshelper to deduplicate GitHub org membership checksTest plan
user_idin response (new assertion)verify_installation_access: user-owner passes, non-owner 403, org-member passes, org-non-member 403 (4 new tests)verify_session_access: owner passes without API call, org-member passes, non-member 403 (3 new tests)