Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[24.1] Only load authnz routes when oidc enabled #18683

Conversation

mvdbeek
Copy link
Member

@mvdbeek mvdbeek commented Aug 12, 2024

We don't construct the necessary manager, so no use exposing API routes that won't work:

        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 #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

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

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 galaxyproject#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
```
@github-actions github-actions bot added this to the 24.1 milestone Aug 12, 2024
@mvdbeek mvdbeek requested a review from a team August 12, 2024 14:19
@mvdbeek mvdbeek merged commit 97e7825 into galaxyproject:release_24.1 Aug 12, 2024
46 of 51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants