Add E2E test for org-member domain POST authorization#142
Merged
Conversation
…rg-member (non-owner/admin) caller Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01442m5sYx1WZgfdcmfyRkr2
…sed v4 generator Cypress browser context lacks crypto.randomUUID() because the auth server is not served from a secure context. Mirrors the workaround already documented in example_resource_server/ExternalJwksLoad.cy.ts. Bumps the package to 0.4.10 to avoid colliding with main's 0.4.9 from #141. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01442m5sYx1WZgfdcmfyRkr2
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 check in
POST /api/apps/:app_id/domainsthat prevents organization members (non-owner/admin) from adding domains to private applications.Changes
New test file:
tests/e2e-auth-tests/cypress/e2e/apps/OrgMemberCannotAddAppDomain.cy.tsrole === "member"attempts to add a domain to a private app owned by their organizationresource_idis leaked in the rejected responseVersion bump:
tests/e2e-auth-tests/package.json(0.4.8 → 0.4.9)Implementation Details
The test follows a realistic workflow:
role === "member")This guards against the specific regression where the authorization check in
POST_create_app_domain.tscould be accidentally widened to includememberrole, allowing any org member to rewrite domain bindings.https://claude.ai/code/session_01442m5sYx1WZgfdcmfyRkr2