Skip to content
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

Parametirized RolesAllowed does not work for a list of roles #33982

Closed
sberyozkin opened this issue Jun 12, 2023 · 2 comments · Fixed by #34921
Closed

Parametirized RolesAllowed does not work for a list of roles #33982

sberyozkin opened this issue Jun 12, 2023 · 2 comments · Fixed by #34921
Assignees
Labels
area/security kind/bug Something isn't working
Milestone

Comments

@sberyozkin
Copy link
Member

Describe the bug

RolesAllowed value can be set from the properties, see https://quarkus.io/guides/security-authorize-web-endpoints-reference#standard-security-annotations. Example, instead of @RolesAllowed({"admin"}) it is @RolesAllowed({"${my.roles}"})

However, if a property such as my.roles is a list, instead of a single value, then @RolesAllowed({"${my.roles}"}) does not work

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@quarkus-bot
Copy link

quarkus-bot bot commented Jun 12, 2023

/cc @pedroigor (bearer-token)

@michalvavrik michalvavrik self-assigned this Jul 20, 2023
@michalvavrik
Copy link
Member

Technically I believe SmallRye config properties are string key -> string value and whether you interpret it as a list depends on converter that is determined based on config item return type; but I agree, it should be safe to treat anything that contains list separator as a list and it is nice feature. I don't believe anyone will name their roles with comma. Working on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/security kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants