From 92b62c6a80846d2be8b5cf905154a04addbdc29d Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 7 Oct 2022 13:11:54 +0200 Subject: [PATCH 2/3] misc: remove dead code for avoid_consent signal (#69992) --- src/authentic2/idp/saml/saml2_endpoints.py | 14 -------------- src/authentic2/idp/signals.py | 21 --------------------- 2 files changed, 35 deletions(-) delete mode 100644 src/authentic2/idp/signals.py diff --git a/src/authentic2/idp/saml/saml2_endpoints.py b/src/authentic2/idp/saml/saml2_endpoints.py index 34d17ac5..5a235c76 100644 --- a/src/authentic2/idp/saml/saml2_endpoints.py +++ b/src/authentic2/idp/saml/saml2_endpoints.py @@ -63,7 +63,6 @@ from authentic2 import views as a2_views from authentic2.attributes_ng.engine import get_attributes from authentic2.compat_lasso import lasso from authentic2.constants import NONCE_FIELD_NAME -from authentic2.idp import signals as idp_signals from authentic2.idp.saml.common import kill_django_sessions from authentic2.saml import saml2utils from authentic2.saml.common import ( @@ -898,19 +897,6 @@ def sso_after_process_request( except ObjectDoesNotExist: logger.debug('consent not yet given (no existing federation) for %s', login.remoteProviderId) - if not consent_obtained and not transient: - logger.debug('signal avoid_consent sent') - avoid_consent = idp_signals.avoid_consent.send( - sender=None, request=request, user=request.user, audience=login.remoteProviderId - ) - for c in avoid_consent: - logger.debug('avoid_consent connected to function %s', c[0].__name__) - if c[1] and 'avoid_consent' in c[1] and c[1]['avoid_consent']: - logger.debug('avoid consent by signal') - consent_obtained = True - # The user consent is bypassed by the signal - consent_value = 'urn:oasis:names:tc:SAML:2.0:consent:unspecified' - if not consent_obtained and not transient: logger.debug('ask the user consent now') return need_consent_for_federation(request, login, nid_format) diff --git a/src/authentic2/idp/signals.py b/src/authentic2/idp/signals.py deleted file mode 100644 index 63d9fcf4..00000000 --- a/src/authentic2/idp/signals.py +++ /dev/null @@ -1,21 +0,0 @@ -# authentic2 - versatile identity manager -# Copyright (C) 2010-2019 Entr'ouvert -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . - -from django.dispatch import Signal - -# avoid_consent -# Expect a boolean e.g. dic['avoid_consent'] = True or False -avoid_consent = Signal(providing_args=["request", "user", "audience"]) -- 2.37.2