Page MenuHomeSoftware Heritage

settings/common: Move OIDC_SWH_WEB_CLIENT_ID variable to auth.utils
ClosedPublic

Authored by anlambert on Mon, Mar 23, 4:40 PM.

Details

Summary

Without that small change, overall swh Sphinx doc fails to build with the following error:

WARNING: autodoc: failed to import module 'backends' from module 'swh.web.auth'; the following exception was raised:
Traceback (most recent call last):
  File "/home/jenkins/workspace/DDOC/dev/swh-docs/.tox/sphinx-dev/lib/python3.7/site-packages/sphinx/ext/autodoc/importer.py", line 32, in import_module
    return importlib.import_module(modname)
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/jenkins/workspace/DDOC/dev/swh-web/swh/web/auth/backends.py", line 24, in <module>
    _oidc_client: KeycloakOpenIDConnect = get_oidc_client()
  File "/home/jenkins/workspace/DDOC/dev/swh-web/swh/web/auth/utils.py", line 58, in get_oidc_client
    client_id = settings.OIDC_SWH_WEB_CLIENT_ID
  File "/home/jenkins/workspace/DDOC/dev/swh-docs/.tox/sphinx-dev/lib/python3.7/site-packages/django/conf/__init__.py", line 57, in __getattr__
    val = getattr(self._wrapped, name)
AttributeError: 'Settings' object has no attribute 'OIDC_SWH_WEB_CLIENT_ID'

Diff Detail

Repository
rDWAPPS Web applications
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.