diff --git a/auth_totp_bypass_ip_range/README.rst b/auth_totp_bypass_ip_range/README.rst new file mode 100644 index 0000000000..c40becdeb3 --- /dev/null +++ b/auth_totp_bypass_ip_range/README.rst @@ -0,0 +1,119 @@ +=================== +IP based MFA bypass +=================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:293829077d34925720abfd9ded62f8faa4f395c144d03ecd0e5c7d8091d5bf55 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png + :target: https://odoo-community.org/page/development-status + :alt: Alpha +.. |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/16.0/auth_totp_bypass_ip_range + :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-16-0/server-auth-16-0-auth_totp_bypass_ip_range + :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=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to define some IP networks as not needing multi +factor authentication. + +.. IMPORTANT:: + This is an alpha version, the data model and design can change at any time without warning. + Only for development or testing purpose, do not use in production. + `More details on development status `_ + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +To configure this module, you need to: + +1. Enable debug mode +2. Go to Settings / Technical / System parameters +3. Create or edit parameter ``auth_totp_bypass_ip_range.networks`` + +The parameter can contain a whitespace separated list of networks in +`CIDR +notation `__. +A specific IP address would be ie 42.42.42.42/32 + +Usage +===== + +To use this module, you need to: + +1. Enable 2FA for some user +2. Connect from an IP that was configured to bypass 2FA +3. Observe that no 2FA challenge is raised + +Known issues / Roadmap +====================== + +- support IPv6 + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Hunki Enterprises BV + +Contributors +------------ + +- Holger Brunn + (https://hunki-enterprises.com) + +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. + +.. |maintainer-hbrunn| image:: https://github.com/hbrunn.png?size=40px + :target: https://github.com/hbrunn + :alt: hbrunn + +Current `maintainer `__: + +|maintainer-hbrunn| + +This module is part of the `OCA/server-auth `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/auth_totp_bypass_ip_range/__init__.py b/auth_totp_bypass_ip_range/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/auth_totp_bypass_ip_range/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/auth_totp_bypass_ip_range/__manifest__.py b/auth_totp_bypass_ip_range/__manifest__.py new file mode 100644 index 0000000000..5b1d26e6b9 --- /dev/null +++ b/auth_totp_bypass_ip_range/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2025 Hunki Enterprises BV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0) + +{ + "name": "IP based MFA bypass", + "summary": "Define IP ranges consideres safe without MFA", + "version": "16.0.1.0.0", + "development_status": "Alpha", + "category": "Extra Tools", + "website": "https://github.com/OCA/server-auth", + "author": "Hunki Enterprises BV, Odoo Community Association (OCA)", + "maintainers": ["hbrunn"], + "license": "AGPL-3", + "depends": ["auth_totp"], + "data": [], + "demo": [], +} diff --git a/auth_totp_bypass_ip_range/models/__init__.py b/auth_totp_bypass_ip_range/models/__init__.py new file mode 100644 index 0000000000..8835165330 --- /dev/null +++ b/auth_totp_bypass_ip_range/models/__init__.py @@ -0,0 +1 @@ +from . import res_users diff --git a/auth_totp_bypass_ip_range/models/res_users.py b/auth_totp_bypass_ip_range/models/res_users.py new file mode 100644 index 0000000000..b4047f46c9 --- /dev/null +++ b/auth_totp_bypass_ip_range/models/res_users.py @@ -0,0 +1,51 @@ +# Copyright 2025 Hunki Enterprises BV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0) + +import logging +from ipaddress import AddressValueError, IPv4Address, IPv4Network + +from odoo import models +from odoo.http import request + +_logger = logging.getLogger("auth_totp_bypass_ip_range") + + +class ResUsers(models.Model): + _inherit = "res.users" + + def _auth_totp_bypass_ip_range(self): + """ + Determine if the current request comes from an IP that bypasses MFA + """ + networks = ( + self.env["ir.config_parameter"] + .sudo() + .get_param("auth_totp_bypass_ip_range.networks", "") + .split() + ) + ip = IPv4Address(request.httprequest.environ["REMOTE_ADDR"]) + for network in networks: + try: + parsed_network = IPv4Network(network, strict=False) + except AddressValueError: + _logger.error("%s is not a valid network", network) + continue + if ip in parsed_network: + return True + return False + + def _mfa_type(self): + """ + Don't do MFA if the request comes from an IP that is configured to bypass it + """ + if self._auth_totp_bypass_ip_range(): + return None + return super()._mfa_type() + + def _mfa_url(self): + """ + Don't do MFA if the request comes from an IP that is configured to bypass it + """ + if self._auth_totp_bypass_ip_range(): + return None + return super()._mfa_url() diff --git a/auth_totp_bypass_ip_range/readme/CONFIGURE.md b/auth_totp_bypass_ip_range/readme/CONFIGURE.md new file mode 100644 index 0000000000..caefef774e --- /dev/null +++ b/auth_totp_bypass_ip_range/readme/CONFIGURE.md @@ -0,0 +1,7 @@ +To configure this module, you need to: + +1. Enable debug mode +2. Go to Settings / Technical / System parameters +3. Create or edit parameter ``auth_totp_bypass_ip_range.networks`` + +The parameter can contain a whitespace separated list of networks in [CIDR notation](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation). A specific IP address would be ie 42.42.42.42/32 diff --git a/auth_totp_bypass_ip_range/readme/CONTRIBUTORS.md b/auth_totp_bypass_ip_range/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..cf8bf7205a --- /dev/null +++ b/auth_totp_bypass_ip_range/readme/CONTRIBUTORS.md @@ -0,0 +1 @@ +- Holger Brunn \ (https://hunki-enterprises.com) diff --git a/auth_totp_bypass_ip_range/readme/DESCRIPTION.md b/auth_totp_bypass_ip_range/readme/DESCRIPTION.md new file mode 100644 index 0000000000..ae27f25cc1 --- /dev/null +++ b/auth_totp_bypass_ip_range/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module allows to define some IP networks as not needing multi factor authentication. diff --git a/auth_totp_bypass_ip_range/readme/ROADMAP.md b/auth_totp_bypass_ip_range/readme/ROADMAP.md new file mode 100644 index 0000000000..db203ccd70 --- /dev/null +++ b/auth_totp_bypass_ip_range/readme/ROADMAP.md @@ -0,0 +1 @@ +- support IPv6 diff --git a/auth_totp_bypass_ip_range/readme/USAGE.md b/auth_totp_bypass_ip_range/readme/USAGE.md new file mode 100644 index 0000000000..1f5318dd32 --- /dev/null +++ b/auth_totp_bypass_ip_range/readme/USAGE.md @@ -0,0 +1,5 @@ +To use this module, you need to: + +1. Enable 2FA for some user +2. Connect from an IP that was configured to bypass 2FA +3. Observe that no 2FA challenge is raised diff --git a/auth_totp_bypass_ip_range/static/description/icon.png b/auth_totp_bypass_ip_range/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/auth_totp_bypass_ip_range/static/description/icon.png differ diff --git a/auth_totp_bypass_ip_range/static/description/index.html b/auth_totp_bypass_ip_range/static/description/index.html new file mode 100644 index 0000000000..f32803d879 --- /dev/null +++ b/auth_totp_bypass_ip_range/static/description/index.html @@ -0,0 +1,461 @@ + + + + + +IP based MFA bypass + + + +
+

IP based MFA bypass

+ + +

Alpha License: AGPL-3 OCA/server-auth Translate me on Weblate Try me on Runboat

+

This module allows to define some IP networks as not needing multi +factor authentication.

+
+

Important

+

This is an alpha version, the data model and design can change at any time without warning. +Only for development or testing purpose, do not use in production. +More details on development status

+
+

Table of contents

+ +
+

Configuration

+

To configure this module, you need to:

+
    +
  1. Enable debug mode
  2. +
  3. Go to Settings / Technical / System parameters
  4. +
  5. Create or edit parameter auth_totp_bypass_ip_range.networks
  6. +
+

The parameter can contain a whitespace separated list of networks in +CIDR +notation. +A specific IP address would be ie 42.42.42.42/32

+
+
+

Usage

+

To use this module, you need to:

+
    +
  1. Enable 2FA for some user
  2. +
  3. Connect from an IP that was configured to bypass 2FA
  4. +
  5. Observe that no 2FA challenge is raised
  6. +
+
+
+

Known issues / Roadmap

+
    +
  • support IPv6
  • +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Hunki Enterprises BV
  • +
+
+ +
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

Current maintainer:

+

hbrunn

+

This module is part of the OCA/server-auth project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/auth_totp_bypass_ip_range/tests/__init__.py b/auth_totp_bypass_ip_range/tests/__init__.py new file mode 100644 index 0000000000..847016c769 --- /dev/null +++ b/auth_totp_bypass_ip_range/tests/__init__.py @@ -0,0 +1 @@ +from . import test_auth_totp_bypass_ip_range diff --git a/auth_totp_bypass_ip_range/tests/test_auth_totp_bypass_ip_range.py b/auth_totp_bypass_ip_range/tests/test_auth_totp_bypass_ip_range.py new file mode 100644 index 0000000000..112f1f5f68 --- /dev/null +++ b/auth_totp_bypass_ip_range/tests/test_auth_totp_bypass_ip_range.py @@ -0,0 +1,53 @@ +# Copyright 2025 Hunki Enterprises BV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0) + +from unittest.mock import MagicMock, patch + +from odoo.tests.common import TransactionCase + + +class TestAuthTotpBypassIpRange(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.user = cls.env.ref("base.user_demo") + cls.user.totp_secret = "4242" + + def test_bypass(self): + """Test that demo user can bypass MFA""" + user = self.user.with_user(self.user) + with patch( + "odoo.addons.auth_totp_bypass_ip_range.models.res_users.request", + new=MagicMock, + ) as patched_request: + patched_request.httprequest = MagicMock() + patched_request.httprequest.environ = {"REMOTE_ADDR": "42.42.42.42"} + self.assertTrue(user._mfa_type()) + self.assertTrue(user._mfa_url()) + self.env["ir.config_parameter"].set_param( + "auth_totp_bypass_ip_range.networks", + "1.1.1.0/16\n 42.42.42.42 42.42.1.0/24", + ) + self.assertIsNone(user._mfa_type()) + self.assertIsNone(user._mfa_url()) + + def test_misconfiguration(self): + """ + Test that errors in configuration are logged but don't make it + impossible to log in + """ + user = self.user.with_user(self.user) + with patch( + "odoo.addons.auth_totp_bypass_ip_range.models.res_users.request", + new=MagicMock, + ) as patched_request, self.assertLogs("auth_totp_bypass_ip_range") as logger: + patched_request.httprequest = MagicMock() + patched_request.httprequest.environ = {"REMOTE_ADDR": "42.42.42.42"} + self.env["ir.config_parameter"].set_param( + "auth_totp_bypass_ip_range.networks", + "wrong configuration", + ) + self.assertTrue(user._mfa_type()) + self.assertTrue( + any("wrong is not a valid network" in line for line in logger.output) + ) diff --git a/auth_totp_mail_enforce_bypass_ip_range/README.rst b/auth_totp_mail_enforce_bypass_ip_range/README.rst new file mode 100644 index 0000000000..4e18c32dd8 --- /dev/null +++ b/auth_totp_mail_enforce_bypass_ip_range/README.rst @@ -0,0 +1,91 @@ +================================================= +IP based MFA bypass (with auth_totp_mail_enforce) +================================================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:293829077d34925720abfd9ded62f8faa4f395c144d03ecd0e5c7d8091d5bf55 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png + :target: https://odoo-community.org/page/development-status + :alt: Alpha +.. |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/16.0/auth_totp_mail_enforce_bypass_ip_range + :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-16-0/server-auth-16-0-auth_totp_mail_enforce_bypass_ip_range + :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=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module makes auth_totp_bypass_ip_range compatible with +auth_totp_mail_enforce. + +.. IMPORTANT:: + This is an alpha version, the data model and design can change at any time without warning. + Only for development or testing purpose, do not use in production. + `More details on development status `_ + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Hunki Enterprises BV + +Contributors +------------ + +- Holger Brunn + (https://hunki-enterprises.com) + +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. + +.. |maintainer-hbrunn| image:: https://github.com/hbrunn.png?size=40px + :target: https://github.com/hbrunn + :alt: hbrunn + +Current `maintainer `__: + +|maintainer-hbrunn| + +This module is part of the `OCA/server-auth `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/auth_totp_mail_enforce_bypass_ip_range/__init__.py b/auth_totp_mail_enforce_bypass_ip_range/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/auth_totp_mail_enforce_bypass_ip_range/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/auth_totp_mail_enforce_bypass_ip_range/__manifest__.py b/auth_totp_mail_enforce_bypass_ip_range/__manifest__.py new file mode 100644 index 0000000000..75d1ab1bb9 --- /dev/null +++ b/auth_totp_mail_enforce_bypass_ip_range/__manifest__.py @@ -0,0 +1,21 @@ +# Copyright 2025 Hunki Enterprises BV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0) + +{ + "name": "IP based MFA bypass (with auth_totp_mail_enforce)", + "summary": "Make auth_totp_bypass_ip_range compatible with auth_totp_mail_enforce", + "version": "16.0.1.0.0", + "development_status": "Alpha", + "category": "Hidden", + "website": "https://github.com/OCA/server-auth", + "author": "Hunki Enterprises BV, Odoo Community Association (OCA)", + "maintainers": ["hbrunn"], + "license": "AGPL-3", + "auto_install": True, + "depends": [ + "auth_totp_mail_enforce", + "auth_totp_bypass_ip_range", + ], + "data": [], + "demo": [], +} diff --git a/auth_totp_mail_enforce_bypass_ip_range/models/__init__.py b/auth_totp_mail_enforce_bypass_ip_range/models/__init__.py new file mode 100644 index 0000000000..8835165330 --- /dev/null +++ b/auth_totp_mail_enforce_bypass_ip_range/models/__init__.py @@ -0,0 +1 @@ +from . import res_users diff --git a/auth_totp_mail_enforce_bypass_ip_range/models/res_users.py b/auth_totp_mail_enforce_bypass_ip_range/models/res_users.py new file mode 100644 index 0000000000..b80049ec27 --- /dev/null +++ b/auth_totp_mail_enforce_bypass_ip_range/models/res_users.py @@ -0,0 +1,25 @@ +# Copyright 2025 Hunki Enterprises BV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0) + + +from odoo import models + + +class ResUsers(models.Model): + _inherit = "res.users" + + def _mfa_type(self): + """ + Don't do MFA if the request comes from an IP that is configured to bypass it + """ + if self._auth_totp_bypass_ip_range(): + return None + return super()._mfa_type() + + def _mfa_url(self): + """ + Don't do MFA if the request comes from an IP that is configured to bypass it + """ + if self._auth_totp_bypass_ip_range(): + return None + return super()._mfa_url() diff --git a/auth_totp_mail_enforce_bypass_ip_range/readme/CONTRIBUTORS.md b/auth_totp_mail_enforce_bypass_ip_range/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..cf8bf7205a --- /dev/null +++ b/auth_totp_mail_enforce_bypass_ip_range/readme/CONTRIBUTORS.md @@ -0,0 +1 @@ +- Holger Brunn \ (https://hunki-enterprises.com) diff --git a/auth_totp_mail_enforce_bypass_ip_range/readme/DESCRIPTION.md b/auth_totp_mail_enforce_bypass_ip_range/readme/DESCRIPTION.md new file mode 100644 index 0000000000..9ed31d7bd0 --- /dev/null +++ b/auth_totp_mail_enforce_bypass_ip_range/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module makes auth\_totp\_bypass\_ip\_range compatible with auth\_totp\_mail\_enforce. diff --git a/auth_totp_mail_enforce_bypass_ip_range/static/description/icon.png b/auth_totp_mail_enforce_bypass_ip_range/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/auth_totp_mail_enforce_bypass_ip_range/static/description/icon.png differ diff --git a/auth_totp_mail_enforce_bypass_ip_range/static/description/index.html b/auth_totp_mail_enforce_bypass_ip_range/static/description/index.html new file mode 100644 index 0000000000..12b71f4dc3 --- /dev/null +++ b/auth_totp_mail_enforce_bypass_ip_range/static/description/index.html @@ -0,0 +1,430 @@ + + + + + +IP based MFA bypass (with auth_totp_mail_enforce) + + + +
+

IP based MFA bypass (with auth_totp_mail_enforce)

+ + +

Alpha License: AGPL-3 OCA/server-auth Translate me on Weblate Try me on Runboat

+

This module makes auth_totp_bypass_ip_range compatible with +auth_totp_mail_enforce.

+
+

Important

+

This is an alpha version, the data model and design can change at any time without warning. +Only for development or testing purpose, do not use in production. +More details on development status

+
+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Hunki Enterprises BV
  • +
+
+ +
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

Current maintainer:

+

hbrunn

+

This module is part of the OCA/server-auth project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/auth_totp_mail_enforce_bypass_ip_range/tests/__init__.py b/auth_totp_mail_enforce_bypass_ip_range/tests/__init__.py new file mode 100644 index 0000000000..ea78614434 --- /dev/null +++ b/auth_totp_mail_enforce_bypass_ip_range/tests/__init__.py @@ -0,0 +1 @@ +from . import test_auth_totp_mail_enforce_bypass_ip_range diff --git a/auth_totp_mail_enforce_bypass_ip_range/tests/test_auth_totp_mail_enforce_bypass_ip_range.py b/auth_totp_mail_enforce_bypass_ip_range/tests/test_auth_totp_mail_enforce_bypass_ip_range.py new file mode 100644 index 0000000000..17b1423968 --- /dev/null +++ b/auth_totp_mail_enforce_bypass_ip_range/tests/test_auth_totp_mail_enforce_bypass_ip_range.py @@ -0,0 +1,13 @@ +# Copyright 2025 Hunki Enterprises BV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0) + +from odoo.addons.auth_totp_bypass_ip_range.tests import test_auth_totp_bypass_ip_range + + +class TestAuthTotpMailEnforceBypassIpRange( + test_auth_totp_bypass_ip_range.TestAuthTotpBypassIpRange +): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.env["ir.config_parameter"].set_param("auth_totp.policy", "all_required") diff --git a/setup/auth_totp_bypass_ip_range/odoo/addons/auth_totp_bypass_ip_range b/setup/auth_totp_bypass_ip_range/odoo/addons/auth_totp_bypass_ip_range new file mode 120000 index 0000000000..f8fda2af07 --- /dev/null +++ b/setup/auth_totp_bypass_ip_range/odoo/addons/auth_totp_bypass_ip_range @@ -0,0 +1 @@ +../../../../auth_totp_bypass_ip_range \ No newline at end of file diff --git a/setup/auth_totp_bypass_ip_range/setup.py b/setup/auth_totp_bypass_ip_range/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/auth_totp_bypass_ip_range/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/auth_totp_mail_enforce_bypass_ip_range/odoo/addons/auth_totp_mail_enforce_bypass_ip_range b/setup/auth_totp_mail_enforce_bypass_ip_range/odoo/addons/auth_totp_mail_enforce_bypass_ip_range new file mode 120000 index 0000000000..e8d8f52293 --- /dev/null +++ b/setup/auth_totp_mail_enforce_bypass_ip_range/odoo/addons/auth_totp_mail_enforce_bypass_ip_range @@ -0,0 +1 @@ +../../../../auth_totp_mail_enforce_bypass_ip_range \ No newline at end of file diff --git a/setup/auth_totp_mail_enforce_bypass_ip_range/setup.py b/setup/auth_totp_mail_enforce_bypass_ip_range/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/auth_totp_mail_enforce_bypass_ip_range/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)