[12.0][MIG] password_security - #83
Conversation
|
@shepilov-vladislav you have to preserve commit history as told before, and Travis is red in this PR. Please amend both things. |
|
Full commit history is brought this way: https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-12.0#technical-method-to-migrate-a-module-from-110-to-120-branch |
|
@pedrobaeza I have a problem with one test. How I can setup environment like on travis? With my environment all works fine. |
yajo
left a comment
There was a problem hiding this comment.
I'm reviewing the big diff introduced by this patch and it all seems to come from basically aesthetic styling.
We have a linter to do that job. Please do not "fix" any line that does not fail in a linter (there's a LINT job in travis that you can check).
I commented on 22 of them, but got tired after. Maybe you have a autostyler installed? Please undo all those "fixes" to review again.
Thanks!
@yajo I corrected everything you asked for. |
yajo
left a comment
There was a problem hiding this comment.
Some minor changes. Mostly code is OK. Thanks!
|
Travis is red |
pedrobaeza
left a comment
There was a problem hiding this comment.
Can you use new README by fragments system?
Also version should be 12.0.1.0.0.
And finally, please stay with only one migration commit.
|
Guys, can you help me. I want to fix my one failed test. But I can not reproduce it. Could you give me instructions on how to raise the same environmental locally for tests(like in travis)? Maybe OCA has docker images for it? |
|
Do you mean it's not reproducible in local? |
@pedrobaeza Exactly. How I can reproduce environment like used on travis? |
|
You can check the log for seeing how Travis is installing first "base" modules, and then installing the rest with --test-enable flag. You can produce the same using that 2 commands. |
I understand what you mean, this was my fallback. I thought that OCA has a special docker image for development needs. And I can use it quickly. |
|
No, it uses https://github.com/OCA/maintainer-quality-tools/tree/master/travis. When they were done, there weren't support in Travis for Docker. |
* [ADD] res_users_password_security: New module * Create new module to lock down user passwords * [REF] res_users_password_security: PR Review fixes * Also add beta pass history rule * [ADD] res_users_password_security: Pass history and min time * Add pass history memory and threshold * Add minimum time for pass resets through web reset * Begin controller tests * Fix copyright, wrong year for new file * Add tests for password_security_home * Left to do web_auth_reset_password * Fix minimum reset threshold and finish tests * Bug fixes per review * [REF] password_security: PR review improvements * Change tech name to password_security * Use new except format * Limit 1 & new api * Cascade deletion for pass history * [REF] password_security: Fix travis + style * Fix travis errors * self to cls * Better variable names in tests * [FIX] password_security: Fix travis errors
* Bump versions * Installable to True * Add Usage section to ReadMe w/ Runbot link * `_crypt_context` now directly exposes the `CryptContext` * Change all instances of openerp to odoo
* Add current time as password_write_date for admin user in demo, disabling the reset prompt - fixes #652
* Switch security to be on correct model to fix #674
…ord invalid (#859) * [FIX] password_security: Fix password stored * [REF] password_security: use a unified check_password private method to validate rules and history password
* Add logic to overloaded web_login action to log out users with expired passwords, preventing the password reset from being ignored * Add unit test for new logic
This translates to Spanish all missing translations, 31 in total.
Since some implementation details are changed, I had to change some tests that were actually testing the implementation instead of the desired result of the method.
In a normal Odoo deployment, somebody in group *Administration / Access Rights* should be able to create users; but if this addon is installed, it gets this error:
The requested operation cannot be completed due to security restrictions. Please contact your system administrator.
(Document type: Res Users Password History, Operation: create)
This is now tested and fixed.
[The `website` addon returns an aditional redirection][1] that makes these tests fail if ran after installing `website`. The tests were checking the returned value in a funky way anyways. Now, instead of checking the final returned value, we check directly the parameters sent to the redirection method. [1]: https://github.com/odoo/odoo/blob/3b85900fafc9469dca6e7c01fca6dac4f55d20f5/addons/website/controllers/main.py#L85-L89
@pedrobaeza Please put you attention. It is very interesting why the test fail in past. Explanation: in in and after that days == ( I preferred to simply increase the interval to three days in the test. What do you think about that? Also I added all changes requested by you. So can we merge it now? |
|
OK, if that avoids that edge cases. I remember at least 2 cases in the past with something similar: a test that failed on leap years, and another that fails at midnight when timezone changes the day... |
|
Thanks for the spent time! |
Thank you too for help! |
|
@shepilov-vladislav FYI I fixed the README at e147125. They must be simple text fragments, the rest is generated by the bot which assembles the fragments and add boilerplate text. |
👍 |
Syncing from upstream OCA/server-auth (11.0)
Continue #66