Skip to content

fix(agent): align action approval requests with the signed payload - #419

Draft
Tonours wants to merge 1 commit into
mainfrom
fix/prd-1764-bind-signed-approval
Draft

Tonours wants to merge 1 commit into
mainfrom
fix/prd-1764-bind-signed-approval

Conversation

@Tonours

@Tonours Tonours commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Aligns action approval request handling with agent-nodejs and agent-python: an action run with an approval request uses the signed payload, scoped to the collection it was issued for.

fixes PRD-1764

What

File Change
routes/action/actions.rb The decoded approval request's data is used as the action request data. Approval requests issued for another collection, without explicit record ids, with an unexpected shape, or that cannot be decoded return a ForbiddenError (403) before permission checks.
spec/.../routes/resources/action/actions_spec.rb Approval request specs with server-shaped payloads: signed ids and values, collection scoping, explicit record ids, 403 cases, field-aware value parsing, outer query filters.
spec/.../routes/action/actions_spec.rb Two existing specs use server-shaped payloads (PRD-1704 behaviour kept).
spec/.../services/smart_action_checker_spec.rb Checker spec on the new payload shape.

Why

  • Using the signed payload as the request data matches agent-nodejs and agent-python.
  • The decoded payload uses indifferent access so signed values keep field-aware parsing (collection and file fields). The copy passed to SmartActionChecker is a deep_dup, so the checker contract is unchanged.
  • Decoding errors now map to 403 instead of 500.
  • Outer query filters (filters, search, segment) still apply on top of the signed selection, as in Node and Python.

Parity: consistency follow-ups for the other agents are tracked internally.

How to test

  • cd packages/forest_admin_agent && BUNDLE_GEMFILE=Gemfile-test bundle exec rspec spec/lib/forest_admin_agent/routes/action spec/lib/forest_admin_agent/routes/resources/action spec/lib/forest_admin_agent/services/smart_action_checker_spec.rb spec/lib/forest_admin_agent/services/permissions_spec.rb: 133 examples, 0 failures.
  • Rubocop on the touched files: no offenses.

Definition of Done

General

  • Write an explicit title for the Pull Request, following Conventional Commits specification
  • Test manually the implemented changes
  • Validate the code quality (indentation, syntax, style, simplicity, readability)

Security

  • Consider the security impact of the changes made

https://claude.ai/code/session_01TVjvko66LLq8rEjEqNokRA

@linear-code

linear-code Bot commented Oct 28, 2026

Copy link
Copy Markdown

PRD-1764

@qltysh

qltysh Bot commented Oct 28, 2026

Copy link
Copy Markdown

Qlty


Coverage Impact

This PR will not change total coverage.

Modified Files with Diff Coverage (1)

RatingFile% DiffUncovered Line #s
Coverage rating: A Coverage rating: A
...st_admin_agent/lib/forest_admin_agent/routes/action/actions.rb100.0%
Total100.0%
🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@Tonours
Tonours force-pushed the fix/prd-1764-bind-signed-approval branch from 02b1d9d to ba409f6 Compare October 28, 2026 10:54
@Tonours Tonours changed the title fix(agent): bind signed approval requests to the signed payload fix(agent): align action approval requests with the signed payload Oct 28, 2026
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