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

[13.0][MIG] password_security #239

Merged
merged 39 commits into from
Feb 2, 2021

Conversation

llacroix
Copy link
Contributor

@llacroix llacroix commented Dec 9, 2020

Migration to 13.0 of password_security based on PR from #189

With history exported

lasley and others added 30 commits December 9, 2020 14:06
* [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 OCA#652
* Switch security to be on correct model to fix OCA#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
Avoided requiring the module twice in JS.
Currently translated at 57.9% (22 of 38 strings)

Translation: server-auth-12.0/server-auth-12.0-password_security
Translate-URL: https://translation.odoo-community.org/projects/server-auth-12-0/server-auth-12-0-password_security/hr/
oca-travis and others added 2 commits December 9, 2020 14:06
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: server-auth-12.0/server-auth-12.0-password_security
Translate-URL: https://translation.odoo-community.org/projects/server-auth-12-0/server-auth-12-0-password_security/
@llacroix
Copy link
Contributor Author

llacroix commented Dec 9, 2020

f230f43
e3ce140

Those two commits are from the PR and the newest ones are forward ported from 12.0

@llacroix llacroix force-pushed the 13.0-password_security branch 2 times, most recently from 4168131 to a2da3f7 Compare December 12, 2020 05:59
@llacroix llacroix changed the title 13.0 password security [13.0][MIG] password_security Dec 12, 2020
@mcassuto
Copy link

@gurneyalex can we have a review here and close these 2 PR ?

Thanks

Set requirements in the root of projects
@llacroix llacroix force-pushed the 13.0-password_security branch from b6aa51d to 0618075 Compare December 15, 2020 16:41
@llacroix
Copy link
Contributor Author

I squashed the format commits. If there is an issue I'll add separate commits from the reformatting. So we know which changes are introduced.

@mcassuto
Copy link

Can we have someone to approve this PR ?

@llacroix
Copy link
Contributor Author

llacroix commented Jan 9, 2021

@pedrobaeza could you have a look?

@pedrobaeza
Copy link
Member

Sorry, I don't use this module.

@llacroix
Copy link
Contributor Author

Any idea who could review this?

@llacroix
Copy link
Contributor Author

@gurneyalex anything else to get it merged?

@dreispt
Copy link
Member

dreispt commented Feb 2, 2021

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 13.0-ocabot-merge-pr-239-by-dreispt-bump-nobump, awaiting test results.

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@OCA-git-bot OCA-git-bot merged commit d0656e0 into OCA:13.0 Feb 2, 2021
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at e22cadf. Thanks a lot for contributing to OCA. ❤️

SiesslPhillip pushed a commit to grueneerde/OCA-server-auth that referenced this pull request Nov 20, 2024
Syncing from upstream OCA/server-auth (15.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.