forked from OCA/server-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reformat password_security to match tests
Set requirements in the root of projects
- Loading branch information
Showing
23 changed files
with
2,800 additions
and
889 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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
# Copyright 2015 LasLabs Inc. | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). | ||
|
||
from . import controllers | ||
from . import models | ||
from . import controllers, models |
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 |
---|---|---|
@@ -1,16 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!-- | ||
Copyright 2016 LasLabs Inc. | ||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). | ||
--> | ||
|
||
<odoo> | ||
|
||
<record id="base.user_root" model="res.users"> | ||
<field name="password_write_date" | ||
eval="datetime.now()" | ||
/> | ||
<field name="password_write_date" eval="datetime.now()" /> | ||
</record> | ||
|
||
</odoo> |
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 |
---|---|---|
@@ -1,7 +1,4 @@ | ||
# Copyright 2015 LasLabs Inc. | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). | ||
|
||
from . import res_users | ||
from . import res_company | ||
from . import res_users_pass_history | ||
from . import res_config_settings | ||
from . import res_company, res_config_settings, res_users, res_users_pass_history |
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 |
---|---|---|
|
@@ -2,61 +2,49 @@ | |
# Copyright 2017 Kaushal Prajapati <[email protected]>. | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). | ||
|
||
from odoo import api, models, fields, _ | ||
from odoo import _, api, fields, models | ||
from odoo.exceptions import ValidationError | ||
|
||
|
||
class ResCompany(models.Model): | ||
_inherit = 'res.company' | ||
_inherit = "res.company" | ||
|
||
password_expiration = fields.Integer( | ||
'Days', | ||
default=60, | ||
help='How many days until passwords expire', | ||
"Days", default=60, help="How many days until passwords expire", | ||
) | ||
password_length = fields.Integer( | ||
'Characters', | ||
default=12, | ||
help='Minimum number of characters', | ||
"Characters", default=12, help="Minimum number of characters", | ||
) | ||
password_lower = fields.Integer( | ||
'Lowercase', | ||
default=1, | ||
help='Require number of lowercase letters', | ||
"Lowercase", default=1, help="Require number of lowercase letters", | ||
) | ||
password_upper = fields.Integer( | ||
'Uppercase', | ||
default=1, | ||
help='Require number of uppercase letters', | ||
"Uppercase", default=1, help="Require number of uppercase letters", | ||
) | ||
password_numeric = fields.Integer( | ||
'Numeric', | ||
default=1, | ||
help='Require number of numeric digits', | ||
"Numeric", default=1, help="Require number of numeric digits", | ||
) | ||
password_special = fields.Integer( | ||
'Special', | ||
default=1, | ||
help='Require number of unique special characters', | ||
"Special", default=1, help="Require number of unique special characters", | ||
) | ||
password_estimate = fields.Integer( | ||
'Estimation', | ||
"Estimation", | ||
default=3, | ||
help='Required score for the strength estimation. Between 0 and 4', | ||
help="Required score for the strength estimation. Between 0 and 4", | ||
) | ||
password_history = fields.Integer( | ||
'History', | ||
"History", | ||
default=30, | ||
help='Disallow reuse of this many previous passwords - use negative ' | ||
'number for infinite, or 0 to disable', | ||
help="Disallow reuse of this many previous passwords - use negative " | ||
"number for infinite, or 0 to disable", | ||
) | ||
password_minimum = fields.Integer( | ||
'Minimum Hours', | ||
"Minimum Hours", | ||
default=24, | ||
help='Amount of hours until a user may change password again', | ||
help="Amount of hours until a user may change password again", | ||
) | ||
|
||
@api.constrains('password_estimate') | ||
@api.constrains("password_estimate") | ||
def _check_password_estimate(self): | ||
if 0 > self.password_estimate > 4: | ||
raise ValidationError(_('The estimation must be between 0 and 4.')) | ||
raise ValidationError(_("The estimation must be between 0 and 4.")) |
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
Oops, something went wrong.