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

Update user.py #676

Merged
merged 7 commits into from
Sep 9, 2024
Merged

Conversation

hubiongithub
Copy link
Contributor

Added correct syntax to ed25519 password plugin.
on create user
on update user
This only accepts cleartext passwords (PASSWORD(%s)) not pregenerated ed25519 hashes.

SUMMARY

MariaDB uses ed25519 for stronger password hashes, the plugin needs the PASSWORD(%s) call if cleartext password is given in plugin_auth_string.
Hopefully fixes #672

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

mysql_user

ADDITIONAL INFORMATION

MariaDB accepts either a clear text password in ... USING PASSWORD('password') or a pregenerated hash in ... USING 'hash'
my changes only accept a cleartext password in "plugin_auth_string", so a generated hash will taken as the cleartext password and used in the PASSWORD(%s) call.

Added correct syntax to ed25519 password plugin.
on create user
on update user
This only accepts cleartext passwords (PASSWORD(%s)) not pregenerated ed25519 hashes.
@Andersson007
Copy link
Collaborator

removed my comment, slept bad.

plugins/module_utils/user.py Outdated Show resolved Hide resolved
plugins/module_utils/user.py Outdated Show resolved Hide resolved
plugins/module_utils/user.py Outdated Show resolved Hide resolved
plugins/module_utils/user.py Outdated Show resolved Hide resolved
@Andersson007
Copy link
Collaborator

@hubiongithub please click Commit suggestion in all the comments

Copy link

codecov bot commented Sep 9, 2024

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 72.65%. Comparing base (37a718c) to head (b038683).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
plugins/module_utils/user.py 0.00% 2 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #676      +/-   ##
==========================================
- Coverage   76.31%   72.65%   -3.67%     
==========================================
  Files          20       17       -3     
  Lines        2651     2607      -44     
  Branches      676      672       -4     
==========================================
- Hits         2023     1894     -129     
- Misses        427      487      +60     
- Partials      201      226      +25     
Flag Coverage Δ
integration 72.57% <0.00%> (-3.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

plugins/module_utils/user.py Outdated Show resolved Hide resolved
plugins/module_utils/user.py Outdated Show resolved Hide resolved
@Andersson007
Copy link
Collaborator

@hubiongithub have you tried to change the code same way locally and tested it and everything works as expected? Can i merge it and release 10.3.3?

@hubiongithub
Copy link
Contributor Author

@Andersson007 despite the in ('pam') -> == 'pam' change I tested that locally and the user was created and the password worked.

@Andersson007 Andersson007 merged commit eec6e70 into ansible-collections:main Sep 9, 2024
47 checks passed
@Andersson007
Copy link
Collaborator

@hubiongithub thanks for the contribution!

@Andersson007
Copy link
Collaborator

pasting the announcement i've just made: The community.mysql collection version 3.10.3 has been released!

@hubiongithub
Copy link
Contributor Author

ansible-galaxy install -- force and retested, user gets created. Thank you

@Andersson007
Copy link
Collaborator

@hubiongithub sure, thanks for the contribution!

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 this pull request may close these issues.

add support for ed25519 password plugin in mysql_user
2 participants