maykinmedia / mozilla-django-oidc-db

Database-backed settings for mozilla-django-oidc, with modified unique identifiers for users
MIT License
4 stars 0 forks source link

Mixin shadows default values set by upstream library #51

Closed sergei-maertens closed 2 years ago

sergei-maertens commented 2 years ago

https://github.com/maykinmedia/mozilla-django-oidc-db/blob/c2faf0869dce7c35fa04b8b3f333141c480a47d6/mozilla_django_oidc_db/mixins.py#L37

This overwrites any default values that have been get/set from the parent super() call, like here: https://github.com/mozilla/mozilla-django-oidc/blob/63f56222e3c95fe67e73107f5f5374f5e662e8ca/mozilla_django_oidc/middleware.py#L44

The effect is that if you forget to configure (an optional) setting, the refresh middleware crashes because it tries to reverse a None URL.

Possibly we should store the super() attributes in a self._defaults or something that we can fall back to if the setting does not exist, or we can pass it along to our own self.get_setting(...) call instead of always using None as default value.