Skip to content

Commit

Permalink
[FIX] auth_partner: Fix directory rights on token generation
Browse files Browse the repository at this point in the history
  • Loading branch information
paradoxxxzero committed Nov 7, 2024
1 parent b71a156 commit 52b4816
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ repos:
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
rev: v3.1.0
hooks:
- id: prettier
name: prettier (with plugin-xml)
additional_dependencies:
- "prettier@2.7.1"
- "@prettier/plugin-xml@2.2.0"
- "prettier@3.1.0"
- "@prettier/plugin-xml@3.3.1"
args:
- --plugin=@prettier/plugin-xml
files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
Expand Down Expand Up @@ -123,7 +123,7 @@ repos:
- id: pyupgrade
args: ["--keep-percent-format"]
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
name: isort except __init__.py
Expand All @@ -141,13 +141,13 @@ repos:
- --header
- "# generated from manifests external_dependencies"
- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
rev: 7.0.0
hooks:
- id: flake8
name: flake8
additional_dependencies: ["flake8-bugbear==21.9.2"]
additional_dependencies: ["flake8-bugbear==24.2.6"]
- repo: https://github.com/OCA/pylint-odoo
rev: v8.0.19
rev: v9.0.5
hooks:
- id: pylint_odoo
name: pylint with optional checks
Expand Down
1 change: 1 addition & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ proseWrap: always
semi: true
trailingComma: "es5"
xmlWhitespaceSensitivity: "strict"
plugins: ["@prettier/plugin-xml"]
2 changes: 2 additions & 0 deletions auth_partner/models/auth_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ def _send_mail_impl(self, type_or_template, auth_partner, **context):
return f"Mail {template.name} sent to {auth_partner.login}"

def _generate_token(self, action, auth_partner, expiration_delta, key_salt=""):
# We need to sudo here as secret_key is a protected field
self = self.sudo()
return jwt.encode(
{
"exp": datetime.now(tz=timezone.utc) + expiration_delta,
Expand Down

0 comments on commit 52b4816

Please sign in to comment.