Skip to content

Commit

Permalink
[ADD] auth_admin_passkey_totp_mail_enforce
Browse files Browse the repository at this point in the history
  • Loading branch information
astirpe committed Mar 13, 2024
1 parent f138da2 commit 8887eb0
Show file tree
Hide file tree
Showing 10 changed files with 545 additions and 0 deletions.
79 changes: 79 additions & 0 deletions auth_admin_passkey_totp_mail_enforce/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
=========================================
Authentification - Disable 2FA if Passkey
=========================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:ed2a833d55c09a0f418a9b32605dacfd3cd3d126136d36943257f903dc050d79
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--auth-lightgray.png?logo=github
:target: https://github.com/OCA/server-auth/tree/17.0/auth_admin_passkey_totp_mail_enforce
:alt: OCA/server-auth
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-auth-17-0/server-auth-17-0-auth_admin_passkey_totp_mail_enforce
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-auth&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This is a glue module, needed to allow module auth_admin_passkey working
properly in combination with auth_totp_mail_enforce.

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-auth/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/server-auth/issues/new?body=module:%20auth_admin_passkey_totp_mail_enforce%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* 360ERP

Contributors
------------

- [360ERP](https://www.360erp.com):

- Andrea Stirpe

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/server-auth <https://github.com/OCA/server-auth/tree/17.0/auth_admin_passkey_totp_mail_enforce>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions auth_admin_passkey_totp_mail_enforce/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
15 changes: 15 additions & 0 deletions auth_admin_passkey_totp_mail_enforce/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2024 360ERP (<https://www.360erp.com>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Authentification - Disable 2FA if Passkey",
"summary": " Disable 2FA if Passkey is being used",
"version": "17.0.1.0.0",
"category": "base",
"author": "360ERP,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/server-auth",
"license": "AGPL-3",
"depends": ["auth_admin_passkey", "auth_totp_mail_enforce"],
"installable": True,
"auto_install": True,
}
1 change: 1 addition & 0 deletions auth_admin_passkey_totp_mail_enforce/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import res_users
17 changes: 17 additions & 0 deletions auth_admin_passkey_totp_mail_enforce/models/res_users.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2024 360ERP (<https://www.360erp.com>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models
from odoo.http import request


class ResUsers(models.Model):
_inherit = "res.users"

def _mfa_url(self):
"""Needed to ensure that 'ignore_totp' is processed before entering
the _mfa_url() of auth_totp_mail_enforce.
"""
if request.session.get("ignore_totp"):
return None

Check warning on line 16 in auth_admin_passkey_totp_mail_enforce/models/res_users.py

View check run for this annotation

Codecov / codecov/patch

auth_admin_passkey_totp_mail_enforce/models/res_users.py#L16

Added line #L16 was not covered by tests
return super()._mfa_url()
3 changes: 3 additions & 0 deletions auth_admin_passkey_totp_mail_enforce/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
2 changes: 2 additions & 0 deletions auth_admin_passkey_totp_mail_enforce/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- [360ERP](https://www.360erp.com):
- Andrea Stirpe
2 changes: 2 additions & 0 deletions auth_admin_passkey_totp_mail_enforce/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This is a glue module, needed to allow module auth_admin_passkey working
properly in combination with auth_totp_mail_enforce.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8887eb0

Please sign in to comment.