Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Allow users with any permission type to perform passive declarations (backport #16272)#16274

Merged
michaelklishin merged 3 commits into
v4.3.xfrom
mergify/bp/v4.3.x/pr-16272
Apr 30, 2026
Merged

Allow users with any permission type to perform passive declarations (backport #16272)#16274
michaelklishin merged 3 commits into
v4.3.xfrom
mergify/bp/v4.3.x/pr-16272

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify Bot commented Apr 30, 2026

In 4.3.0 and 4.2.6, the standard configure permission was enforced for passive queue and exchange declarations, matching the "regular" declaration case.

However, this can be a breaking change for some applications that do not have the configure permission on target resources.

With this change, any permission (e.g. read) on the target resource will be considered sufficient as passive declaration is completely non-destructive by definition.

Note that this permission check prevents arbitrary resource enumeration via passive declares.

The change applies to both queue.declare and exchange.declare.

References #16085.


This is an automatic backport of pull request #16272 done by [Mergify](https://mergify.com).

michaelklishin and others added 2 commits April 30, 2026 18:23
In `4.3.0` and `4.2.6`, the standard `configure` permission
was enforced for passive queue and exchange declarations,
matching the "regular" declaration case.

However, this can be a breaking change for some applications
that do not have the `configure` permission on target
resources.

With this change, any permission (e.g. `read`) on the target
resource will be considered sufficient as passive declaration
is completely non-destructive by definition.

Note that this permission check prevents arbitrary resource
enumeration via passive declares.

The change applies to both `queue.declare` and `exchange.declare`.

References #16085.

Conflicts:
	deps/rabbit/Makefile

(cherry picked from commit 54c97bf)

# Conflicts:
#	deps/rabbit/Makefile
The old code used lists:any/2 over the [read, write, configure]
list, and for each element, it called lists:member/2 which scanned
the entire cache. This resulted in up to 3 full scans of the cache.
The new code uses a single lists:any/2 pass over the cache, which
is more efficient.

(cherry picked from commit 55b851e)
@mergify
Copy link
Copy Markdown
Author

mergify Bot commented Apr 30, 2026

Cherry-pick of 54c97bf has failed:

On branch mergify/bp/v4.3.x/pr-16272
Your branch is up to date with 'origin/v4.3.x'.

You are currently cherry-picking commit 54c97bfb9.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   deps/rabbit/src/rabbit_amqp_management.erl
	modified:   deps/rabbit/src/rabbit_channel.erl
	modified:   deps/rabbit/test/amqp_auth_SUITE.erl
	new file:   deps/rabbit/test/passive_declare_permission_SUITE.erl

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   deps/rabbit/Makefile

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify mergify Bot added the make label Apr 30, 2026
@michaelklishin michaelklishin added this to the 4.3.1 milestone Apr 30, 2026
michaelklishin added a commit that referenced this pull request Apr 30, 2026
@michaelklishin michaelklishin force-pushed the mergify/bp/v4.3.x/pr-16272 branch from 3a83196 to 229b071 Compare April 30, 2026 21:20
@michaelklishin michaelklishin merged commit dc2070d into v4.3.x Apr 30, 2026
189 checks passed
@michaelklishin michaelklishin deleted the mergify/bp/v4.3.x/pr-16272 branch April 30, 2026 21:48
michaelklishin added a commit that referenced this pull request Apr 30, 2026
michaelklishin added a commit that referenced this pull request Apr 30, 2026
Allow users with any permission type to perform passive declarations (backport #16272) (backport #16274)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants