Skip to content

[18.0][MIG] password_security#773

Merged
OCA-git-bot merged 79 commits intoOCA:18.0from
ForgeFlow:18.0-mig-password_security
Jun 14, 2025
Merged

[18.0][MIG] password_security#773
OCA-git-bot merged 79 commits intoOCA:18.0from
ForgeFlow:18.0-mig-password_security

Conversation

@IsabelAForgeFlow
Copy link
Copy Markdown
Contributor

@IsabelAForgeFlow IsabelAForgeFlow commented Mar 10, 2025

Migration to 18.0

Depends on:

It also includes this improvement, in a separate commit:

lasley and others added 30 commits March 10, 2025 15:15
* [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 (OCA#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/
alexis-via and others added 2 commits March 10, 2025 15:15
Replace fields on res.company by ir.config_parameter
Remove dead test for v16 migration script
@OCA-git-bot
Copy link
Copy Markdown
Contributor

Hi @sbidoul,
some modules you are maintaining are being modified, check this out!

@IsabelAForgeFlow IsabelAForgeFlow force-pushed the 18.0-mig-password_security branch 3 times, most recently from a1c95dc to 5fff96b Compare March 17, 2025 11:19
@LauraCForgeFlow LauraCForgeFlow force-pushed the 18.0-mig-password_security branch 3 times, most recently from 16da4aa to d022825 Compare March 17, 2025 14:26
@hailangvn
Copy link
Copy Markdown

Good day @IsabelAForgeFlow, @LauraCForgeFlow: is this PR ready for review?

@IsabelAForgeFlow IsabelAForgeFlow marked this pull request as ready for review June 3, 2025 07:54
@IsabelAForgeFlow
Copy link
Copy Markdown
Contributor Author

Good day @IsabelAForgeFlow, @LauraCForgeFlow: is this PR ready for review?

Yes!

Copy link
Copy Markdown

@hailangvn hailangvn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except for small changes. Thanks for the work.

Comment thread password_security/__manifest__.py Outdated
{
"name": "Password Security",
"summary": "Allow admin to set password security requirements.",
"version": "18.0.2.0.0",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is just small correction.

Suggested change
"version": "18.0.2.0.0",
"version": "18.0.1.0.0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this migration still applicable for 18.0.1.0.0 version?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, is this migration still applicable?

@LauraCForgeFlow LauraCForgeFlow force-pushed the 18.0-mig-password_security branch from 9d090a0 to 148c6e5 Compare June 10, 2025 07:07
@LauraCForgeFlow
Copy link
Copy Markdown
Contributor

@hailangvn We changed the version and removed the migration scripts (in fact, they were no longer necessary). Thanks for the review! :)

@pedrobaeza
Copy link
Copy Markdown
Member

/ocabot migration password_security
/ocabot merge nobump

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Jun 14, 2025
@OCA-git-bot
Copy link
Copy Markdown
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 18.0-ocabot-merge-pr-773-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot mentioned this pull request Jun 14, 2025
23 tasks
@OCA-git-bot OCA-git-bot merged commit d82873c into OCA:18.0 Jun 14, 2025
8 of 9 checks passed
@OCA-git-bot
Copy link
Copy Markdown
Contributor

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

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.