Skip to content

Validation error when using x509 for user authentication #122

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
verdel opened this issue May 14, 2025 · 0 comments · May be fixed by #123
Open

Validation error when using x509 for user authentication #122

verdel opened this issue May 14, 2025 · 0 comments · May be fixed by #123

Comments

@verdel
Copy link

verdel commented May 14, 2025

What did you do to encounter the bug?

Steps to reproduce the behavior:

We use x509 certificates for validation. In the MongoDBCommunity CustomResource, the users are listed under .spec.users without the scramCredentialsSecretName:

- db: $external
    name: CN=user1
    roles:
    - db: admin
      name: clusterAdmin
  - db: $external
    name: CN=user2
    roles:
    - db: db2
      name: readWrite

What did you expect?

No validation errors.

What happened instead?

Errors in the MongoDBCommunity status and in the operator logs:

message: 'error validating new Spec: scram credential secret names collision, update
    at least one of the users: [scram secret name: "" for user: "CN=user1"
    and user: "CN=user2"]
controllers/mongodb_status_options.go:104	error validating new Spec: scram credential secret names collision, update at least one of the users: [scram secret name: "" for user: "CN=user1" and user: "CN=user2"]

Operator Information

  • Operator Version - 1.0.0
  • MongoDB Image used - 6.0.20

Additional context

Validation was fixed in PR but according to the documentation, user definitions that use x509 for authentication should not contain scramCredentialsSecretName parameter.

During validation, users without the scramCredentialsSecretName parameter are added to a dictionary with an empty key, which leads to the error mentioned above.

I think we should skip the scram secret collision validation for users authenticated with x509 certificates.

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