fastmcp/tests
Jeremiah Lowin 67e8448389
[codex] Add OAuthProxy RFC 9207 issuer responses (#4438)
* Add OAuthProxy issuer response parameter

* Cover OAuthProxy issuer error redirects

* Relax host origin guard defaults (#4439)

* Use exact issuer in authorize errors

* Restore HTTP host guard compatibility (#4472)

* Hugging Face Auth Integration (#4385)

Co-authored-by: Jeremiah Lowin <153965+jlowin@users.noreply.github.com>

* Docs: add v3.4.4 changelog entries (#4473)

* Explain unnormalized issuer; cover consent-denial path base_url

* Revert "Merge remote-tracking branch 'origin/release/3.x' into codex/oauth-proxy-rfc9207-issuer"

This reverts commit 9e34b1686c, reversing
changes made to 640dc60fe0.

* Preserve callback query bytes when appending iss/code/state params

add_query_params previously decoded the existing query with parse_qsl
and re-encoded it, mutating opaque or signed query strings (a valueless
?flag became ?flag=, non-UTF-8 percent-encoded bytes got replaced).
Append the newly-encoded params to the existing query string instead of
round-tripping it through parse/encode.

Also fixes a stray bare `httpx` reference in a test that should use
httpx2 following the SDK v2 migration.

* Attach RFC 9207 iss to authorize() success redirects too

AuthorizationHandler only added iss to error redirects from the SDK's
base handler, not to code redirects returned directly by authorize()
overrides that bypass consent/upstream (as GitHub's mocked test does).
Since metadata now unconditionally advertises
authorization_response_iss_parameter_supported, any client-facing
redirect missing iss hard-fails RFC 9207-aware clients.

Also fixes HeadlessOAuth, which parsed code/state from the redirect
but silently dropped iss, so the same regression would have masked
itself across every other provider integration test too.

* Carry RFC 9207 iss through the production OAuth callback path

OAuthProxy advertises authorization_response_iss_parameter_supported and
sends iss on every authorization redirect, but the client's production
callback chain (CallbackResponse -> OAuthCallbackResult -> OAuth.callback_handler)
had no iss field, so it was silently dropped and the SDK's
validate_authorization_response_iss rejected the callback. HeadlessOAuth
already carried iss through, which is why CI stayed green while real
clients failed.

Add iss to CallbackResponse and OAuthCallbackResult, thread it through
store_result_once for both success and error branches, and pass it into
AuthorizationCodeResult in OAuth.callback_handler.

* Don't duplicate iss when a provider redirect already carries one

* Consolidate RFC 9207 iss handling into a single redirect helper

Every client-facing authorization redirect must carry exactly one iss.
That invariant was being enforced by hand at five separate call sites,
each building its own params dict -- which is how the success-redirect
path shipped without iss in the first place, and how a registered
redirect_uri that already carries its own iss could end up duplicated.
Route all five sites through build_client_redirect(), which owns the
idempotent replace-or-append behavior so no caller can get it wrong.

---------

Co-authored-by: shaun smith <1936278+evalstate@users.noreply.github.com>
2026-07-19 09:52:43 -04:00
..
apps Add default prefill to FormInput.collect_input (#3937) 2026-04-14 13:23:36 -04:00
cli Migrate to MCP Python SDK v2 (#4437) 2026-07-06 17:36:45 -04:00
client [codex] Add OAuthProxy RFC 9207 issuer responses (#4438) 2026-07-19 09:52:43 -04:00
conformance Forward-port HTTP host guard compatibility (#4474) 2026-07-08 20:55:56 -04:00
contrib Migrate to MCP Python SDK v2 (#4437) 2026-07-06 17:36:45 -04:00
deprecated Merge pull request #4453 from PrefectHQ/remove/deprecated-params 2026-07-07 07:59:53 -04:00
docs Skip live-import validation for frozen v2 doc snapshots 2026-07-07 07:53:10 -04:00
experimental Migrate to MCP Python SDK v2 (#4437) 2026-07-06 17:36:45 -04:00
fs fix(fs): isolate same-named package imports across providers (#4361) 2026-06-24 10:57:01 -04:00
integration_tests Migrate to MCP SDK v2.0.0b2 (httpx2) (#4503) 2026-07-18 15:12:47 -04:00
prompts Migrate to MCP Python SDK v2 (#4437) 2026-07-06 17:36:45 -04:00
resources Screen templated resource parameters for path traversal by default (#4482) 2026-07-17 17:42:48 -04:00
scripts Exempt maintainers from MRE auto-close (#4220) 2026-05-23 09:02:44 -04:00
server [codex] Add OAuthProxy RFC 9207 issuer responses (#4438) 2026-07-19 09:52:43 -04:00
telemetry Preserve telemetry attributes when a sampler does not forward them (#4539) 2026-07-19 09:00:04 -04:00
tools Reject positional-only tool parameters (#4524) 2026-07-17 17:37:28 -04:00
utilities Fix typos (#4498) 2026-07-18 21:18:39 -04:00
__init__.py Update type handling for resources 2024-11-29 19:42:46 -05:00
conftest.py Migrate to MCP SDK v2.0.0b2 (httpx2) (#4503) 2026-07-18 15:12:47 -04:00
test_apps.py Migrate to MCP Python SDK v2 (#4437) 2026-07-06 17:36:45 -04:00
test_apps_prefab.py Migrate to MCP Python SDK v2 (#4437) 2026-07-06 17:36:45 -04:00
test_compat.py Migrate to MCP Python SDK v2 (#4437) 2026-07-06 17:36:45 -04:00
test_exceptions.py Emit one SERVER span per request and adopt spec-correct error codes (#4445) 2026-07-07 07:49:06 -04:00
test_fastmcp_app.py Migrate to MCP Python SDK v2 (#4437) 2026-07-06 17:36:45 -04:00
test_json_schema_generation.py fix: resolve Pyright "Module is not callable" on @tool, @resource, @prompt decorators (#3540) 2026-03-17 18:11:42 -04:00
test_mcp_config.py Stabilize upgraded ty checks (#4526) 2026-07-17 17:46:53 -04:00
test_no_legacy_httpx.py Migrate to MCP SDK v2.0.0b2 (httpx2) (#4503) 2026-07-18 15:12:47 -04:00
test_settings.py Forward-port HTTP host guard compatibility (#4474) 2026-07-08 20:55:56 -04:00