|
15 | 15 |
|
16 | 16 | import logging
|
17 | 17 | from typing import Any, Optional, Tuple
|
| 18 | +import warnings |
18 | 19 |
|
19 | 20 | from django.apps import apps
|
20 | 21 | from django.conf import settings
|
@@ -237,3 +238,40 @@ def send_user_update_signal(self, user: settings.AUTH_USER_MODEL, attributes: di
|
237 | 238 | user_modified=user_modified)]
|
238 | 239 | )
|
239 | 240 | return signal_modified
|
| 241 | + |
| 242 | + # ############################################ |
| 243 | + # Backwards-compatibility stubs |
| 244 | + # ############################################ |
| 245 | + |
| 246 | + def get_attribute_value(self, django_field, attributes, attribute_mapping): |
| 247 | + warnings.warn("get_attribute_value() is deprecated, look at the Saml2Backend on how to subclass it", DeprecationWarning) |
| 248 | + self._get_attribute_value(django_field, attributes, attribute_mapping) |
| 249 | + |
| 250 | + def get_django_user_main_attribute(self): |
| 251 | + warnings.warn("get_django_user_main_attribute() is deprecated, look at the Saml2Backend on how to subclass it", DeprecationWarning) |
| 252 | + self._user_lookup_attribute |
| 253 | + |
| 254 | + def get_django_user_main_attribute_lookup(self): |
| 255 | + warnings.warn("get_django_user_main_attribute_lookup() is deprecated, look at the Saml2Backend on how to subclass it", DeprecationWarning) |
| 256 | + return getattr(settings, 'SAML_DJANGO_USER_MAIN_ATTRIBUTE_LOOKUP', '') |
| 257 | + |
| 258 | + def get_user_query_args(self, main_attribute): |
| 259 | + warnings.warn("get_user_query_args() is deprecated, look at the Saml2Backend on how to subclass it", DeprecationWarning) |
| 260 | + return {self.get_django_user_main_attribute() + self.get_django_user_main_attribute_lookup()} |
| 261 | + |
| 262 | + def configure_user(self, user, attributes, attribute_mapping): |
| 263 | + warnings.warn("configure_user() is deprecated, look at the Saml2Backend on how to subclass it", DeprecationWarning) |
| 264 | + return self._update_user(user, attributes, attribute_mapping) |
| 265 | + |
| 266 | + def update_user(self, user, attributes, attribute_mapping, force_save=False): |
| 267 | + warnings.warn("update_user() is deprecated, look at the Saml2Backend on how to subclass it", DeprecationWarning) |
| 268 | + return self._update_user(user, attributes, attribute_mapping) |
| 269 | + |
| 270 | + def _set_attribute(self, obj, attr, value): |
| 271 | + warnings.warn("_set_attribute() is deprecated, look at the Saml2Backend on how to subclass it", DeprecationWarning) |
| 272 | + return set_attribute(obj, attr, value) |
| 273 | + |
| 274 | + |
| 275 | +def get_saml_user_model(): |
| 276 | + warnings.warn("_set_attribute() is deprecated, look at the Saml2Backend on how to subclass it", DeprecationWarning) |
| 277 | + return Saml2Backend()._user_model |
0 commit comments