Skip to content

fix(cloud): Reject malformed connection IDs in CloudWorkspace.get_connection - #1379

Merged
Aaron ("AJ") Steers (aaronsteers) merged 3 commits into
release-candidate/v1from
devin/1792014086-validate-connection-id
Oct 16, 2026
Merged

Aaron ("AJ") Steers (aaronsteers) merged 3 commits into
release-candidate/v1from
devin/1792014086-validate-connection-id

Conversation

@aaronsteers

@aaronsteers Aaron ("AJ") Steers (aaronsteers) commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Overview

👉 TL;DR: A malformed connection ID used to reach Airbyte Cloud and come back as a bare HTTP 500. It is now rejected up front with a clear input error.

Specifically, CloudWorkspace.get_connection checks uuid.UUID(connection_id) and raises AirbyteLibInputError("connection_id must be a UUID.").

Related: https://linear.app/airbyteio/issue/AGENTIC-2301 (broader risky-args hardening; this PR covers only malformed connection IDs).

Risks

  • Breaking for callers that pass IDs that aren't UUIDs to CloudWorkspace.get_connection (and so to every MCP tool that takes a connection_id). They now get AirbyteLibInputError before any API call. Real Cloud connection IDs are always UUIDs.

Test plan

  • New unit tests: a malformed ID raises before any HTTP call, and a valid UUID still works. Lint and the touched tests pass locally.

Link to Devin session: https://app.devin.ai/sessions/a51d808f26c9402fafc93e7640648187
Open in Devin Desktop: https://app.devin.ai/desktop/session/a51d808f26c9402fafc93e7640648187?variant=devin
Requested by: Aaron ("AJ") Steers (@aaronsteers)

Important

Auto-merge enabled.

This PR is set to merge automatically when all requirements are met.

A malformed connection ID previously surfaced as an opaque HTTP 500 from
the Cloud API. CloudWorkspace.get_connection now raises
AirbyteLibInputError before any request is made.

Co-Authored-By: AJ Steers <[email protected]>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@github-actions

Copy link
Copy Markdown

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

Testing This PyAirbyte Version

You can test this version of PyAirbyte using the following:

# Run PyAirbyte CLI from this branch:
uvx --from 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1792014086-validate-connection-id' pyairbyte --help

# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1792014086-validate-connection-id'

PR Slash Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /fix-pr - Fixes most formatting and linting issues
  • /uv-lock - Updates uv.lock file
  • /test-pr - Runs tests with the updated PyAirbyte
  • /prerelease - Builds and publishes a prerelease version to PyPI
📚 Show Repo Guidance

Helpful Resources

Community Support

Questions? Join the #pyairbyte channel in our Slack workspace.

📝 Edit this welcome message.

@github-code-quality

github-code-quality Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Code coverage overview

Languages: Python

Python / code-coverage/pytest-no-creds

release-candidate/v1 d9f652f devin/1792014086-val... bc98785 +/-
65% 79% +14%
View coverage of the 10 most impacted files.
File release-candidate/v1 d9f652f devin/1792014086-val... bc98785 +/-
airbyte/mcp/cloud.py 52% 83% +31%
airbyte/_util/api_util.py 36% 68% +32%
airbyte/cloud/connectors.py 34% 75% +41%
airbyte/mcp/_datadog.py 0% 50% +50%
airbyte/mcp/_user_identity.py 0% 93% +93%
airbyte/_direct...ctors/models.py 0% 94% +94%
airbyte/mcp/_telemetry.py 0% 94% +94%
airbyte/mcp/_sso_auth.py 0% 96% +96%
airbyte/cloud/models.py 0% 97% +97%
airbyte/mcp/int...nc_status_ui.py 0% 97% +97%

Python / code-coverage/pytest

release-candidate/v1 d9f652f devin/1792014086-val... bc98785 +/-
71% 81% +10%
View coverage of the 10 most impacted files.
File release-candidate/v1 d9f652f devin/1792014086-val... bc98785 +/-
airbyte/cloud/connectors.py 51% 80% +29%
airbyte/mcp/cloud.py 52% 83% +31%
airbyte/mcp/_datadog.py 0% 50% +50%
airbyte/mcp/int..._registry_ui.py 0% 92% +92%
airbyte/mcp/_user_identity.py 0% 93% +93%
airbyte/_direct...ctors/models.py 0% 94% +94%
airbyte/mcp/_telemetry.py 0% 94% +94%
airbyte/mcp/_sso_auth.py 0% 96% +96%
airbyte/cloud/models.py 0% 97% +97%
airbyte/mcp/int...nc_status_ui.py 0% 97% +97%

Python / code-coverage/pytest-unit

release-candidate/v1 devin/1792014086-val... bc98785 +/-
— 76% —

Line coverage data for the release-candidate/v1 branch is not yet available.

View coverage of the 10 most covered files.
File release-candidate/v1 devin/1792014086-val... bc98785 +/-
airbyte/cloud/models.py — 97% —
airbyte/mcp/_sso_auth.py — 96% —
airbyte/_direct...ctors/models.py — 94% —
airbyte/cloud/client.py — 90% —
airbyte/exceptions.py — 89% —
airbyte/mcp/cloud.py — 83% —
airbyte/progress.py — 80% —
airbyte/cloud/connectors.py — 75% —
airbyte/_util/api_util.py — 68% —
airbyte/shared/...ql_processor.py — 68% —

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated October 14, 2026 22:14 UTC

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused validation matches the stated behavior, and no blocking issues were identified.

0 open findings

What changed in this PR

Adds local UUID validation to CloudWorkspace.get_connection, rejecting malformed connection IDs with a clear input error.

Changes:

  • Validates connection IDs and documents AirbyteLibInputError.
  • Adds unit coverage for malformed IDs and valid UUIDs.
File Description
tests/​unit_tests/​test_cloud_connections.py Tests rejection of malformed IDs and acceptance of valid UUIDs.
airbyte/​cloud/​workspaces.py Adds UUID validation and documents the input error.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@aaronsteers
Aaron ("AJ") Steers (aaronsteers) marked this pull request as ready for review October 16, 2026 00:06
@aaronsteers
Aaron ("AJ") Steers (aaronsteers) merged commit d476bba into release-candidate/v1 Oct 16, 2026
30 of 31 checks passed
@aaronsteers
Aaron ("AJ") Steers (aaronsteers) deleted the devin/1792014086-validate-connection-id branch October 16, 2026 00:06

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Devin Review

AirbyteLibInputError: If `connection_id` is not a valid UUID.
"""
try:
uuid.UUID(connection_id)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Malformed connection IDs still reach Cloud

For a UUID with misplaced hyphens, uuid.UUID succeeds and get_connection accepts the malformed ID. CloudConnection keeps the original string, so API calls can still return HTTP 500.

Learn more

Python's UUID parser removes hyphens anywhere in the string before checking the hex digits. It also accepts braces and a URN prefix. This method ignores the parsed value and passes the original string to CloudConnection, which forwards it unchanged through _fetch_connection_info. The server can therefore receive a malformed path ID despite successful local validation.

Example: 1234-5678-1234-1234-1234-1234567890ab parses as a UUID, but the connection lookup still sends that exact, wrongly grouped ID.

Recommended fix: Require the connection ID to match the server's canonical UUID string format before constructing CloudConnection; compare the original ID with the parsed canonical representation if the server supports lowercase canonical IDs only, or explicitly account for accepted case variants.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

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.

2 participants