Skip to content

fix(server): Validate control-binding targets locally [SAO-21395] - #308

Open
wrisa wants to merge 3 commits into
mainfrom
fix/return-data-validation-error
Open

wrisa wants to merge 3 commits into
mainfrom
fix/return-data-validation-error

Conversation

@wrisa

@wrisa wrisa commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Invalid target_type or UUID-formatted target_id values on binding-list requests currently reach Orbit, whose 422 response becomes a misleading 502.
  • Validate target_type (log_stream or agent_stream) and UUID v4 target_id locally, returning a clear 422 VALIDATION_ERROR.
  • Reject requests that provide only one of target_type and target_id.

Scope

  • User-facing/API changes: invalid or incomplete target query values receive a clear 422 before an authorization request is sent to Orbit.
  • Internal changes: validate binding-list target query parameters in the request context builder.
  • Out of scope: changing authorization behavior for valid targets or other endpoints.

Risk and Rollout

  • Risk level: low. Valid target pairs continue through the existing upstream authorization flow; requests without target filters retain existing behavior where allowed.
  • Release order: publish Agent Control and validate the response in a non-production environment before normal rollout.
  • Rollback plan: restore the previous Agent Control release through the normal deployment process.
  • No production access or deployment is part of this PR.

Testing

  • Added or updated automated tests for supported target types, unsupported types, malformed UUIDs, non-v4 UUIDs, and incomplete target pairs.
  • Direct checks of valid and invalid query-context validation passed.
  • Ruff passed on the changed files.
  • Focused endpoint pytest suite could not complete: its database fixture could not connect to PostgreSQL at localhost:5432. Docker is not installed here to start the repository’s database dependency.

Checklist

  • Linked issue/spec.
  • Updated docs/examples if needed.
  • Included follow-up validation steps above.

@wrisa wrisa changed the title fix(server): Validate control-binding targets locally fix(server): Validate control-binding targets locally [SAO-21395] Dec 2, 2026
@codecov

codecov Bot commented Dec 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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