Loading
Only load authnz routes when oidc enabled
We don't construct the necessary manager, so no use exposing API routes
that won't work:
```python
self.authnz_manager = None
if self.config.enable_oidc:
from galaxy.authnz import managers
self.authnz_manager = managers.AuthnzManager(
self, self.config.oidc_config_file, self.config.oidc_backends_config_file
)
```
Fixes https://github.com/galaxyproject/galaxy/issues/18682:
```
AttributeError: 'NoneType' object has no attribute 'get_allowed_idps'
(2 additional frame(s) were not displayed)
...
File "galaxy/web/framework/middleware/statsd.py", line 29, in __call__
req = self.application(environ, start_response)
File "galaxy/web/framework/base.py", line 176, in __call__
return self.handle_request(request_id, path_info, environ, start_response)
File "galaxy/web/framework/base.py", line 271, in handle_request
body = method(trans, **kwargs)
File "galaxy/web/framework/decorators.py", line 74, in call_and_format
rval = func(self, trans, *args, **kwargs)
File "galaxy/webapps/galaxy/controllers/authnz.py", line 210, in get_cilogon_idps
if allowed_idps := trans.app.authnz_manager.get_allowed_idps():
Uncaught Exception
```