-
Notifications
You must be signed in to change notification settings - Fork 90
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
Add salt parameter to hash generation for sha256 plugins #631
Add salt parameter to hash generation for sha256 plugins #631
Conversation
@Aohzan thank you very much for taking the time to share your work. FYI, mysql is still upset about the format of the hashed password. You can see this by searching for the pattern "Failed" in the output of one of the integration tests that use MySQL up until you reach one without the light-blue "...ignoring". |
Yes I have a problem to send the hash in the hex format as quote are added in the MySQL command, I will check that next week edit:PyMySQL doesn't seem to allow to not insert quote arround args : https://github.com/PyMySQL/PyMySQL/blob/b4ed6884a1105df0a27f948f52b3e81d5585634f/pymysql/cursors.py#L129 |
it's finally working @laurent-indermuehle, I let you review |
Sure @Aohzan, thank you for your great work! It's almost perfect as is and it feel like you're experienced with plugin development in Python. I'll suggest minor changes like using the fully qualified collection name for tasks and I saw a repetition in your error handling. But first, the failing CI integration test comes from this task:
The error comes from the positional arguments of user_mod() line 932 of |
Do you want me to use FQCN for all tasks or just tasks that I added ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to use one task instead of 2 when assert only test one conditions.
tests/integration/targets/test_mysql_user/tasks/test_user_plugin_auth.yml
Outdated
Show resolved
Hide resolved
tests/integration/targets/test_mysql_user/tasks/test_user_plugin_auth.yml
Outdated
Show resolved
Hide resolved
tests/integration/targets/test_mysql_user/tasks/test_user_plugin_auth.yml
Outdated
Show resolved
Hide resolved
tests/integration/targets/test_mysql_user/tasks/test_user_plugin_auth.yml
Outdated
Show resolved
Hide resolved
tests/integration/targets/test_mysql_user/tasks/test_user_plugin_auth.yml
Outdated
Show resolved
Hide resolved
tests/integration/targets/test_mysql_user/tasks/test_user_plugin_auth.yml
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #631 +/- ##
==========================================
+ Coverage 75.26% 76.08% +0.81%
==========================================
Files 18 19 +1
Lines 2515 2542 +27
Branches 642 642
==========================================
+ Hits 1893 1934 +41
+ Misses 425 417 -8
+ Partials 197 191 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
ready @laurent-indermuehle 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I finally found the solution to the hundred of ... ignored
in the output of the CI. So please, use it in order to help me to stop this madness :)
More importantly, I was about to ask you to remove if plugin in ['caching_sha2_password', 'sha256_password']:
from the modules utils but then realized that we may add an additional auth plugin that supports salt in the future. So it's a good thing you kept it. But please, review my comment about the generated_hash_string
variable.
tests/integration/targets/test_mysql_user/tasks/test_user_plugin_auth.yml
Outdated
Show resolved
Hide resolved
tests/integration/targets/test_mysql_user/tasks/test_user_plugin_auth.yml
Outdated
Show resolved
Hide resolved
tests/integration/targets/test_mysql_user/tasks/test_user_plugin_auth.yml
Outdated
Show resolved
Hide resolved
tests/integration/targets/test_mysql_user/tasks/test_user_plugin_auth.yml
Outdated
Show resolved
Hide resolved
Thanks @Aohzan for the changes. Before we can merge your PR, I'll need to merge #629 then you can rebase on it an launch integrations tests a last time. |
Yes, it's not the same format than the one MySQL want 😞 |
Hello |
@Aohzan I hope to finish the big project I'm on next week. After that I may have some time. We need to add tests for MySQL 8.4, Mariadb 10.11 and fix the regression with the user password. So, fun times ahead ;) |
@Aohzan I've merge the other PR. Can you rebase your PR and see if tests still pass please? |
bae9117
to
7bbe806
Compare
done, and all tests are ok 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done |
@Aohzan thanks again for your contribution. I'm merging now.
So before you can use your feature it is possible that I may ask for your help in case something doesn't work, if that's ok for you and you have the time? But maybe hopefully it will work without requiring any modification, who knows. |
0bc3e3d
into
ansible-collections:main
Yes no problem |
@Aohzan @tchernomax @laurent-indermuehle thanks for the contribution! |
SUMMARY
Add a salt parameter to handle internal hash generation for
caching_sha2_password
orsha256_password
plugin to avoid idempotence failureFixes #621
ISSUE TYPE
COMPONENT NAME
mysql_user
ADDITIONAL INFORMATION
will generate same hash for each ansible run and be idempotent