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

DBforPostgreSQL User can only be assigned lowercase roles #4334

Open
Paul-B98 opened this issue Oct 10, 2024 · 2 comments
Open

DBforPostgreSQL User can only be assigned lowercase roles #4334

Paul-B98 opened this issue Oct 10, 2024 · 2 comments
Labels
waiting-on-user-response Waiting on more information from the original user before progressing.

Comments

@Paul-B98
Copy link

Describe the current behavior
It seems that the current behaviour only allows the assignment of roles that are written in lowercase to a user. This results in an error that the corresponding role cannot be found when deviating from lowercase lettering. A testcase to reproduce this behaviour is to add uppercase letters or hyphens to the name of the admin role. When creating a new user that role should be assignable but is not.

Describe the improvement
It would be helpful if there is a way to also allow the assignment of roles that contains letter in uppercase or hyphens.

@theunrepentantgeek
Copy link
Member

Do you have the exact error message available to share? This would help us isolate the underlying code.

@theunrepentantgeek theunrepentantgeek added waiting-on-user-response Waiting on more information from the original user before progressing. and removed needs-triage 🔍 labels Oct 14, 2024
@matthchr
Copy link
Member

matthchr commented Oct 14, 2024

Can you also share an example user input (a User) you've given that produces an error? Don't forget to redact the password.

My quick scan of the code suggests that other than performing some sql-injection-escaping safety checks, the value you pass for roles is passed as is directly to the server, so if you have defined the roles as uppercase you should be able to refer to them as uppercase.

See https://stackoverflow.com/questions/27638358/role-names-are-case-sensitive-in-postgres which talks about this some.

You'll need to match the case of the role in the server in the User specification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-on-user-response Waiting on more information from the original user before progressing.
Projects
Development

No branches or pull requests

3 participants