Add E2E test for GET /api/apps/:app_id authorization#140
Merged
Conversation
…mber on private app Adds NonOrgMemberCannotGetApp.cy.ts to the apps suite, exercising the "You are not authorized to view this app" branch in GET_app_handler.ts that gates private-app metadata reads. The symmetric DELETE branch was already tested by NonOrgMemberCannotDeleteApp.cy.ts; this fills the GET gap that previously let an authenticated non-member's access path go unverified.
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
Adds comprehensive E2E test coverage for the authorization guard in
GET /api/apps/:app_idthat prevents non-organization-members from accessing private apps.Changes
New test file:
tests/e2e-auth-tests/cypress/e2e/apps/NonOrgMemberCannotGetApp.cy.tssuccess: falseand an "not authorized" messageauth-server/src/app/api/apps/[app_id]/GET_app_handler.ts(lines 111-132)Version bump:
tests/e2e-auth-tests/package.jsonfrom 0.4.7 to 0.4.8Implementation Details
The test follows the established E2E pattern:
This closes a gap in authorization testing—the GET-private-app guard previously had no E2E coverage, despite being critical to prevent arbitrary signed-in users from reading metadata for any organization's private apps by guessing app IDs.
https://claude.ai/code/session_017p6LFMRm9dRHzZcyJXVpdv