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

Add django-setup-configuration as optional dependancy for mozilla-django-oidc-db to autoconfigure the Admin OIDC for our components #114

Open alextreme opened 2 weeks ago

alextreme commented 2 weeks ago

Taiga OIP 2607

Hey all, I saw that you added Admin-OIDC support via SetupConfig. It would be great if this can be part of the mozilla-django-oidc-db library as a contrib or optional dep, so we can use it in ALL our products.

Its about this piece of code: https://github.com/maykinmedia/open-inwoner/blob/ab1950d4f71ed85c1819dfcb69f027fba196c763/src/open_inwoner/configurations/bootstrap/auth.py#L198

So the idea is that we have a mozilla-django-oidc-db[setupconfig] (see https://setuptools.pypa.io/en/latest/userguide/dependency_management.html#optional-dependencies ) which ensures django-setup-configuration is installed and that the above AdminOIDCConfigurationSettings bit from OIP is registered when using the setup-configuration management command

sergei-maertens commented 2 weeks ago

Feel free to take a look at https://github.com/maykinmedia/django-digid-eherkenning which has a similar setup with the optional [oidc] dependency group, especially with how tests are organized!