Skip to content

Commit

Permalink
Fix bool assignment for use_remote_user
Browse files Browse the repository at this point in the history
The option `use_remote_user` was used an declared as bool in the codebase, but it was assigned the value of `single_user` in some cases and that option can be either a bool or an email address (str) causing the type validation to fail.
  • Loading branch information
davelopez committed Aug 25, 2023
1 parent bc9a64f commit c9a6794
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/galaxy/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ def _process_config(self, kwargs: Dict[str, Any]) -> None:
self.galaxy_data_manager_data_path = self.galaxy_data_manager_data_path or self.tool_data_path
self.tool_secret = kwargs.get("tool_secret", "")
self.metadata_strategy = kwargs.get("metadata_strategy", "directory")
self.use_remote_user = self.use_remote_user or self.single_user
self.use_remote_user = self.use_remote_user or bool(self.single_user)
self.fetch_url_allowlist_ips = [
ipaddress.ip_network(unicodify(ip.strip())) # If it has a slash, assume 127.0.0.1/24 notation
if "/" in ip
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/webapps/galaxy/buildapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@ def wrap_in_middleware(app, global_conf, application_stack, **local_conf):
# protects Galaxy from improperly configured authentication in the
# upstream server
single_user = conf.get("single_user", None)
use_remote_user = asbool(conf.get("use_remote_user", False)) or single_user
use_remote_user = asbool(conf.get("use_remote_user", False)) or bool(single_user)
if use_remote_user:
from galaxy.web.framework.middleware.remoteuser import RemoteUser

Expand Down

0 comments on commit c9a6794

Please sign in to comment.