Skip to content

fix: add scoped queue publisher and consumer grants - #722

Merged
alongubkin merged 8 commits into
mainfrom
alon/alien-1014-queue-permissions
Sep 25, 2026
Merged

alongubkin merged 8 commits into
mainfrom
alon/alien-1014-queue-permissions

Conversation

@alongubkin

@alongubkin alongubkin commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Why

A queue consumer with queue/data-read cannot call queue.ack on AWS because the set lacks DeleteMessage. A publisher using queue/data-write also receives delete and visibility actions it does not need. Older installations can inherit both sets through implicit link grants, hiding the mismatch.

Change

  • Add an opt-in queue/publish set for AWS SQS, GCP Pub/Sub, and Azure Service Bus.
  • Make AWS queue/data-read sufficient to receive, acknowledge, and change message visibility.
  • Preserve queue/data-write and the existing implicit queue-link defaults for installed applications. Explicit per-role profiles can adopt queue/publish after the normal CLI release.
  • Document that a plain queue link still gets combined access. Direction-aware defaults require a separate migration because some linked workloads poll queues and stored permission profiles are checked on update.

Verification

  • cargo test -p alien-permissions passed, including generated AWS IAM actions/resource scope, GCP publisher topic binding, and Azure sender/receiver roles.
  • cargo test -p alien-preflights passed, including explicit publisher-link preservation.
  • The opt-in alien-bindings AWS integration test passed with one disposable SQS queue and separate generated publisher/consumer IAM roles. It used the real binding under each assumed role: send was allowed only for the publisher; receive and ack only for the consumer; the acknowledged message did not redeliver. The test removed its queue and roles, and independent AWS listings found none remaining.
  • This validates the permission sets and binding on real AWS. A composed application setup package and its deployed workload roles still need separate qualification after release.

ALIEN-1014

@greptile-apps

greptile-apps Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Critical risk] Adds new queue permission sets that control who can publish or consume messages.

The PR appears safe to merge; no outstanding previous findings or actionable new issues remain.

Summary

The PR adds opt-in publisher permissions for AWS, GCP, and Azure queues, makes AWS consumer permissions sufficient to acknowledge messages, and preserves existing implicit queue-link grants.

  • Adds permission-generation tests and an opt-in AWS binding test.
  • Documents how applications can adopt one-way queue profiles.
  • The changes since the previous review update the worker Bun image and the ts-proto Renovate rule; neither establishes a new actionable issue.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Profile[Explicit queue profile] -->|queue/publish| Publisher[Publisher grant]
  Profile -->|queue/data-read| Consumer[Consumer grant]
  Link[Implicit queue link] --> Legacy[Existing combined grants]
  Publisher --> Queue[Queue]
  Consumer --> Queue
  Legacy --> Queue
Loading

Reviews (6) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..."

Comment thread crates/alien-permissions/permission-sets/queue/publish.jsonc
@alongubkin

Copy link
Copy Markdown
Member Author

Greptile’s observation is correct for a queue link with no explicit profile. This PR deliberately adds a narrow permission set and makes queue/data-read sufficient for acknowledgement; it does not claim to migrate implicit link defaults. Changing a plain queue link from bidirectional access to publish-only in this patch release could break workloads that poll a linked queue, and stored mutated permission profiles would differ during update compatibility checks. BCS already declares explicit per-role queue profiles, so its adoption of queue/publish will use the narrow path. I verified the default mutation path in alien-preflights/src/mutations/resource_link_permissions.rs and the update check in compatibility/permission_profiles_unchanged.rs. I’ll track direction-specific queue-link defaults and a safe migration separately rather than silently change existing deployments in this PR.

@alongubkin alongubkin changed the title fix: separate queue publisher and consumer permissions fix: add scoped queue publisher and consumer grants Sep 25, 2026
@alongubkin

Copy link
Copy Markdown
Member Author

@greptileai Please re-review the latest commit. The implicit queue-link default is intentionally unchanged for compatibility; publisher-only access is selected through an explicit queue/publish profile. Your inline review withdrew that finding. The latest commit adds a real AWS IAM smoke test for the explicit publisher and consumer grants. Please refresh the overall score against the current head.

Comment thread crates/alien-bindings/tests/queue_iam_aws.rs
Comment thread crates/alien-bindings/tests/queue_iam_aws.rs
@alongubkin

Copy link
Copy Markdown
Member Author

@greptileai Please review commit 667785d. I addressed both new comments on the AWS IAM smoke test, reran it against real AWS, verified teardown, and resolved the threads with details.

@alongubkin

Copy link
Copy Markdown
Member Author

CI on the prior head stopped before compilation because Renovate #733 left two Node 22 fixtures resolved to Node 24 types in the lockfile. I merged current main and restored the pre-existing Node 22 lock entries for those fixtures; pnpm install --frozen-lockfile --lockfile-only --ignore-scripts now passes. @greptileai Please review the current head 0152bd4, including this narrow lockfile reconciliation.

@alongubkin

Copy link
Copy Markdown
Member Author

@greptileai Please re-review current head 5caba71. This merge resolves the lockfile conflict by taking the already-reviewed fix from main (#737); the PR diff is now limited to the queue-permission changes. No queue implementation changed since your 5/5 review.

alongubkin added a commit that referenced this pull request Sep 25, 2026
## Summary

- Regenerate the Worker runtime TypeScript clients with the locked
`ts-proto` 2.12.4 and CI-compatible `protoc` 35.1.
- Keep future `ts-proto` updates out of Renovate auto-merge so their
generated clients can be committed together.

Renovate #738 updated the lockfile without generated clients and merged
despite a failing TypeScript check. This restores the generated-file
check on unrelated PRs, including #722. Tracks
[ALIEN-1035](https://linear.app/alienplatform/issue/ALIEN-1035/regenerate-worker-runtime-client-after-ts-proto-2124-update).

## Verification

- `pnpm -C packages/sdk generate` with protoc 35.1; a second run
produced an identical diff.
- `pnpm --filter @alienplatform/sdk... build`
- `pnpm -C packages/sdk test:ts`
- `pnpm -C packages/sdk test` (17 passed)
- `pnpm format-and-lint` (passed with four pre-existing warnings)
- `git diff --check`
@alongubkin

Copy link
Copy Markdown
Member Author

@greptileai Please re-review current head b1d6fc1. This merge takes the generated-code CI fix from main (#741); the PR diff remains limited to the eight queue-permission files, with no queue behavior changes since the prior 5/5 review.

@alongubkin
alongubkin merged commit 9d95f4d into main Sep 25, 2026
29 checks passed
@alongubkin
alongubkin deleted the alon/alien-1014-queue-permissions branch September 25, 2026 23:52
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