Skip to content

OAuth 2: Variable expansion in scope aliases #13894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
inseroaj opened this issue May 14, 2025 · 1 comment
Open

OAuth 2: Variable expansion in scope aliases #13894

inseroaj opened this issue May 14, 2025 · 1 comment

Comments

@inseroaj
Copy link

Is your feature request related to a problem? Please describe.

As described in OAuth2 Topic Exchange Scopes it is possible to use variable expansion in scopes, like rabbitmq.write:*/x-{vhost}-*.
However, it seems this is not working/supported in Scope Aliases.
Addition of this feature would make it easy to apply user-based permissions with a single fixed scope.

Describe the solution you'd like

Consider a token including the scope MYSCOPE.
Using a scope alias, the read permission can be set with
auth_oauth2.scope_aliases.MYSCOPE = rabbitmq.read:*/queueprefix.{sub}.*
This would cause a user with subject MYUSER and scope MYSCOPE to have read access to queues named queueprefix.MYUSER.*.

Describe alternatives you've considered

No response

Additional context

No response

@michaelklishin michaelklishin changed the title OAUTH2: Variable expansion in scope aliases OAuth 2: Variable expansion in scope aliases May 14, 2025
@MarcialRosales MarcialRosales self-assigned this May 20, 2025
@MarcialRosales
Copy link
Contributor

@inseroaj Indeed, this feature was initially added exclusively when checking permission on topics as it is stated in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants