mjolnir-strike commented on issue #1465:
URL: https://github.com/apache/flink-agents/issues/1465#issuecomment-7195891881

   Hi @rmetzger, I'd like to take this one if you aren't planning to do it 
yourself.
   
   Plan, following your points:
   
   - Add Pydantic `BasicAuth`, `BearerTokenAuth` and `ApiKeyAuth` models. Tell 
them apart with `authType` (`basic`, `bearer`, `api_key`), the same property 
and values as the Java `Auth` interface, so a config reads the same on both 
sides. Build the `httpx.Auth` only when the HTTP client is created.
   - Remove cloudpickle and base64 from `mcp.py`. Reject a string `auth` value 
with a clear error, without decoding it.
   - Tests for each type: a JSON round-trip, YAML loading, and a check that a 
base64 string is rejected and never unpickled.
   
   Two questions before I start:
   
   1. **OAuth.** `test_serialize_mcp_server` currently round-trips an MCP SDK 
`OAuthClientProvider` through cloudpickle. It takes a token storage object and 
redirect/callback handlers, so it can't be rebuilt from a class name plus JSON 
constructor arguments. For point 4, would a factory work instead: an import 
path to a callable plus JSON keyword arguments, which returns an `httpx.Auth`? 
Users would build `OAuthClientProvider`, or any custom auth, in their own code. 
Or would you rather leave OAuth out of this change?
   
   2. **Overlap with #1461** (which I filed). It replaces 
`streamablehttp_client` with `streamable_http_client`, which takes an 
`httpx.AsyncClient`, so auth would then be set on that client: the same lines 
this change touches. Should I keep them as two PRs and rebase whichever lands 
second, or combine them?
   
   Per CONTRIBUTING, I'll wait for a committer to confirm before opening a PR.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to