-
Notifications
You must be signed in to change notification settings - Fork 201
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
Comments
Do you have the exact error message available to share? This would help us isolate the underlying code. |
Can you also share an example user input (a My quick scan of the code suggests that other than performing some sql-injection-escaping safety checks, the value you pass for 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 |
@matthchr I’m sorry for the late response but I was busy the last two weeks. The following is a reconstruction of the issue I had with the sample of the documentation. The problem can be reduced to the point that it was not possible to add a user to the server admin role if the name contained upper case letters. I don’t have the error anymore and I hope this is enough to help you. # FlexibleServer
apiVersion: dbforpostgresql.azure.com/v1api20230601preview
kind: FlexibleServer
metadata:
name: samplepostgresql
namespace: default
spec:
location: uksouth
owner:
name: aso-sample-rg
version: "16" # We used a newer Version
sku:
name: Standard_D4s_v3
tier: GeneralPurpose
administratorLogin: adminLogin # this was the user/role name we specifed
administratorLoginPassword:
name: server-admin-pw
key: password
storage:
storageSizeGB: 128 # User
apiVersion: dbforpostgresql.azure.com/v1
kind: User
metadata:
name: sampleuser
namespace: default
spec:
owner:
name: samplepostgresql
roles:
- adminLogin # this was the server admin user/role name we specifed. This role couldn't be found
# Specify server-level role options of the user.
roleOptions:
login: true
createRole: true
localUser:
serverAdminUsername: admin
serverAdminPassword:
name: server-admin-pw
key: password
password:
name: sampleuser-password
key: password |
Adding to v2.12 to investigate where this behaviour originates - if it's an ASO bug, we'll address. If it comes from PostgreSQL, we'll need to discuss whether varying from that behaviour is appropriate. |
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.
The text was updated successfully, but these errors were encountered: