The If-None-Match check stripped the quotes from the client value but
compared it against the quoted ETag, so it never matched and icons were
always re-sent. Compare the opaque tags instead (accepting W/ and *),
let If-None-Match take precedence over If-Modified-Since, send the
cache headers on 304 responses too, and drop 'immutable' since the icon
URL isn't versioned.
Drop the aggregate lift headers from the unprivileged tools index
endpoint entirely -- an aggregate across all of a user's tools is
unbounded, has no per-tool attribution, and the same information is
already in the response body per tool. The single-tool endpoints keep
their headers (raw_tool_source has no other channel, the body is the
tool source itself) but dedupe and cap them at 20 entries and a hard
1KB byte bound with a '+N more' suffix, and the Warning header no
longer duplicates the whole list -- it just carries the count and
points at the X-Galaxy-* header. Error paths embed stored dict keys,
so control characters and non-ASCII are replaced and the ends are
stripped before emission; that closes a header-injection hole, keeps
h11 from rejecting a value that starts or ends with a space, and makes
len() the encoded byte length. The helpers live in api/common.py since
both dynamic_tools and the legacy tools controller use them. The
integration tests also cover raw_tool_source, the invalid path on show,
and a stored key with a trailing space.
MCP should accept an OIDC access token in the Authorization header, the same way the REST API does. The precedence should be the x-api-key header, then the Bearer token, then the api_key argument, so both kinds of operator config still beat a key the model passes. Like REST, a Galaxy API key sent as a Bearer token isn't accepted. There's also a guard test that a bad x-api-key header isn't rescued by a good argument, and the missing-key error should now point at the header and warn that the argument exposes the key to the model provider.
(cherry picked from commit 52bd149bf4)
The header comes from the operator's client config and the argument comes from the model, so if both are set the header should decide who the call runs as. Otherwise a key that gets into the model's context, say from a dataset or a page it read, could run tools as someone else. These tests fail until the precedence is flipped.
The built-in MCP server only takes the API key as a required api_key tool argument, so the key has to go through the model. These tests cover sending it as an x-api-key header instead, the argument still working and winning over the header, an empty argument falling back to the header, and the error when there's no key at all. Most of them fail until the server reads the header.
Form-encoded API payload values are JSON-decoded, so a changeset hash made
up only of digits (about 1 in 300 hashes) reached
InstallRepositoryManager.install() as an int. It then never equalled the
tool shed's installable revision, the already-installed check matched, and
the install returned early without reactivating deactivated repository
dependencies. This is the intermittent test_1040 circular dependency
failure in the Toolshed tests workflow.
PUT /api/users/{user_id} let a non-admin change their email and display
name while enable_account_interface is false, which the legacy
information/inputs endpoint refuses. Both fields now go through the same
gate, and every UserUpdatePayload field has to be listed as either gated
or exempt, so a new field cannot skip it unnoticed.
Under use_remote_user or disable_local_accounts the email is what the
proxy or identity provider resolves the account by, so
UserManager.update_email no longer lets a non-admin choose it. OIDC
profile sync writes the address the identity provider asserts and marks
the call with asserted_by_identity_provider to bypass the check.
MCP clients can already create user tools via create_user_tool, but with no container
verification -- its docstring even suggests bare images like python:3.12-slim, reproducing the
hallucinated/non-biocontainer problem the custom-tool agent now guards against. Add a
recommend_biocontainer MCP tool that wraps recommend_container + biocontainer_tag_built (pure
library functions, no app dependency) so a client can resolve and verify a real
quay.io/biocontainers image -- returning image/found/match_quality/source/notes/verified -- and
use it as the container for create_user_tool. The parse+shape logic is a module-level helper with
injectable collaborators so it is unit-testable offline; auth via the existing api-key path.
Drop Python 3.8 support in 5 Pulsar-compatible packages
(job_metrics, tool_util, tool_util_models, util, objectstore)
and run pyupgrade --py310-plus on their source code.
- Bump requires-python from >=3.8 to >=3.10 in all 5 packages
- Remove Python 3.8 and 3.9 classifiers
- Remove ruff per-file-ignores for UP rules on these paths
- Remove backports.zoneinfo conditional dependency
- Remove pydyf<0.11 pin from conditional-requirements.txt
- Update Makefile pyupgrade target (remove PY38_PYUPGRADE_PATHS)
- Update CI workflow to test with Python 3.10 instead of 3.8
Clean up unused deprecated typing imports after pyupgrade
Remove now-unused typing imports (Dict, List, Optional, Set, Tuple,
Type, Union) that became dead after pyupgrade --py310-plus converted
annotations to use built-in types and | syntax.
Also run ruff check --fix --select=UP007,UP045 across the entire
codebase to convert remaining Optional[X] -> X | None and
Union[X, Y] -> X | Y patterns.
Enable ruff UP007/UP045 for Python 3.10 union syntax
Remove UP007 (Union[X,Y] -> X | Y) and UP045 (Optional[X] -> X | None)
from the ruff ignore list and convert all type aliases across the
codebase. These rules were deferred while Python 3.9 was supported;
requires-python is now >=3.10.
A custom script was used because neither ruff --fix nor
pyupgrade --py310-plus converts Optional[X]/Union[X,Y] in type alias
positions (e.g. X = Union[A, B]) — they only handle annotation
positions (e.g. def f(x: Optional[int])). All 167 violations were
module-level type aliases. A few edge cases were fixed manually:
single-element Union[X,], typing.Union qualified refs, runtime
Optional[type] calls, and Annotated[Optional[...]] pydantic fields.
Fix UP007 autofix regression with string forward reference type aliases
Commit fa6bd955a0 enabled ruff UP007/UP045 and auto-fixed
module-level type aliases using Union with string forward
references, producing invalid 'str | str' expressions.
This was a known ruff bug (charliermarsh/ruff#826) that has since
been fixed in later ruff versions, but this codebase was
converted before the fix was in place.
Revert to Union syntax and restore TYPE_CHECKING imports that
ruff's TCH rule cleaned up as a side effect when it thought the
forward references were unused.
MCP tools constructed a bare WorkRequestContext, which has no .request
attribute. HDASerializer.serialize_old_display_applications reads
trans.request.base to build absolute display-app URLs, so any tool
running detailed HDA serialization crashed with AttributeError when
enable_old_display_applications was enabled.
Switch to SessionRequestContext backed by minimal _StaticRequest /
_StaticResponse stubs derived from galaxy_infrastructure_url (the same
base URL already used for the MCP URL builder).
Fix the following error in test_galaxy_packages:
FAILED tests/webapps/api/test_cbv.py::test_multiple_decorators - AssertionError: fastapi_middleware_astack not found in request scope
xref. https://github.com/fastapi/fastapi/issues/14128