-
-
Notifications
You must be signed in to change notification settings - Fork 424
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] password_security: Add flag to toggle password security policy
This is a forward-ported commit of #500. Some portions were modified to handle multi-company environments
- Loading branch information
Showing
16 changed files
with
118 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ Password Security | |
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:dc29155c73a519d3732e2806f60bd11ebb31cd8c181ebd5918e4bc68080d37aa | ||
!! source digest: sha256:5f0bed48b7eca2655dceb715c14f64fd6a2703a6447e4f8f0401072dc03c3933 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
|
@@ -59,18 +59,19 @@ any user in that company. | |
|
||
These are defined at the company level: | ||
|
||
===================== ======= =================================================== | ||
Name Default Description | ||
===================== ======= =================================================== | ||
password_expiration 60 Days until passwords expire | ||
password_length 12 Minimum number of characters in password | ||
password_lower 0 Minimum number of lowercase letter in password | ||
password_upper 0 Minimum number of uppercase letters in password | ||
password_numeric 0 Minimum number of number in password | ||
password_special 0 Minimum number of unique special character in password | ||
password_history 30 Disallow reuse of this many previous passwords | ||
password_minimum 24 Amount of hours that must pass until another reset | ||
===================== ======= =================================================== | ||
========================= ======= =================================================== | ||
Name Default Description | ||
========================= ======= =================================================== | ||
password_policy_enabled False Enables password security requirements | ||
password_expiration 60 Days until passwords expire | ||
password_length 12 Minimum number of characters in password | ||
password_lower 0 Minimum number of lowercase letter in password | ||
password_upper 0 Minimum number of uppercase letters in password | ||
password_numeric 0 Minimum number of number in password | ||
password_special 0 Minimum number of unique special character in password | ||
password_history 30 Disallow reuse of this many previous passwords | ||
password_minimum 24 Amount of hours that must pass until another reset | ||
========================= ======= =================================================== | ||
|
||
Usage | ||
===== | ||
|
@@ -120,6 +121,9 @@ Contributors | |
* `Onestein <https://www.onestein.nl>`_: | ||
* Andrea Stirpe <[email protected]> | ||
|
||
* `twio.tech <https://www.twio.tech>`_: | ||
* Dawn Hwang <[email protected]> | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl) | ||
|
||
import logging | ||
|
||
from odoo import SUPERUSER_ID, api | ||
|
||
_logger = logging.getLogger(__name__) | ||
|
||
|
||
def migrate(cr, version): | ||
if not version: | ||
return | ||
env = api.Environment(cr, SUPERUSER_ID, {}) | ||
companies = env["res.company"].with_context(active_test=False).search([]) | ||
_logger.info("Enable the password policy on %s companies", len(companies)) | ||
_logger.info(companies.mapped("name")) | ||
companies.write({"password_policy_enabled": True}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,6 @@ | |
|
||
* `Onestein <https://www.onestein.nl>`_: | ||
* Andrea Stirpe <[email protected]> | ||
|
||
* `twio.tech <https://www.twio.tech>`_: | ||
* Dawn Hwang <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters