Skip to content

granting roles using role@db syntax does not allow db names containing "-" #771

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
dermsd opened this issue Apr 2, 2025 · 0 comments · May be fixed by #772
Open

granting roles using role@db syntax does not allow db names containing "-" #771

dermsd opened this issue Apr 2, 2025 · 0 comments · May be fixed by #772

Comments

@dermsd
Copy link

dermsd commented Apr 2, 2025

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7.34
  • Ruby: 2.7.8
  • Distribution: RHEL9
  • Module version: 6.0.1

How to reproduce (e.g Puppet code you use)

PR#432 introduced a feature to allow grants to other databases in the format 'role@db' for mongodb_user. However, to regex for the roles property does not allow the same db names allowed by the mongodb_database. Specifically, one cannot grant roles to databases containing "-" in their name.

What are you seeing

Error: Failed to apply catalog: Parameter roles failed on Mongodb_user[xyz123]: Invalid value "dbAdmin@abc-db". Valid values match /^\w+(@\w+)?$/. (file: /etc/puppetlabs/code/environments/test/site/profile/manifests/db/mongodb.pp, line: 201)

What behaviour did you expect instead

mongodb_user xyz123 is granted role dbAdmin on database abc-db

Output log

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

Successfully merging a pull request may close this issue.

1 participant