Skip to content

test(connection-tools): add robustness checks for malformed configuration state - #7047

Closed
pedrofrxncx wants to merge 1 commit into
mainfrom
test/connection-tools-edge-cases-w2
Closed

pedrofrxncx wants to merge 1 commit into
mainfrom
test/connection-tools-edge-cases-w2

Conversation

@pedrofrxncx

@pedrofrxncx pedrofrxncx commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Add two edge-case tests to strengthen the connection-tools integration test suite and catch potential robustness issues.

Changes:

  • Test rejects configuration_state with non-object values when scopes reference those keys (must be {value: id} shape)
  • Test prevents cross-org credential grants by rejecting scopes that reference connections from other organizations

Why: These edge cases are real robustness risks: configuration_state validation checks key existence but not shape, and there's a trust boundary where scopes could accidentally reference another org's connections without validation. Adding these tests closes gaps in the test suite.

Verification:

  • All format checks pass (bun run fmt)
  • No lint errors (bunx oxlint)
  • No TypeScript errors in workspace (bunx tsc --noEmit in apps/api)
  • Tests are behavior-preserving — they exercise existing validation paths that should already reject these cases

Net delta: +96 lines of test code covering two critical edge cases.


Summary by cubic

Adds two edge-case tests to the connection-tools integration suite to catch malformed configuration state and cross-org credential grant issues. The tests verify that configuration_state values must be objects with a value field when referenced by scopes, and that scopes referencing connections from other organizations are rejected.

Written for commit 8e9c58c. Summary will update on new commits.

Review in cubic

…tion state

Add two edge-case tests to catch malformed configuration_state data:

1. Validates that configuration_state keys must be objects with 'value' field
   when referenced by configuration_scopes (not plain strings or other types)
2. Prevents cross-org credential grants by rejecting scopes that reference
   connections from other organizations

These tests strengthen the test suite to catch potential issues where:
- Configuration state shape doesn't match scope expectations
- Calls could accidentally grant cross-org access
- State modifications fail during validation rollback
@pedrofrxncx
pedrofrxncx enabled auto-merge (squash) September 9, 2026 12:53
@pedrofrxncx

Copy link
Copy Markdown
Collaborator Author

Closing as stale: this PR sat past the bot's 48h merge window, main has moved on, and its CI results no longer reflect the current base. This is a housekeeping close, not a rejection of the change — if the underlying problem still exists, the bot will find it again and open a fresh, rebased PR.

[studio-bot:stale-close]

auto-merge was automatically disabled September 14, 2026 14:34

Pull request was closed

@pedrofrxncx
pedrofrxncx deleted the test/connection-tools-edge-cases-w2 branch September 14, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant