yuqi1129 opened a new pull request, #14872:
URL: https://github.com/apache/gravitino/pull/14872
### What changes were proposed in this pull request?
- `docs/gravitino-mcp-server.md`:
- A new "Connecting to Gravitino over HTTPS" section explains how to trust
a private CA for `--gravitino-uri`. Build a PEM bundle that holds the public
roots plus the CA, and point `SSL_CERT_FILE` at it. The section warns that
`SSL_CERT_FILE` replaces the default roots instead of adding to them, that the
bundle also applies to the OAuth token endpoint, and what the error looks like
when the certificate is not trusted.
- The serving section now says that the certificate and key are read at
startup.
- `tests/unit/test_tls_end_to_end.py` generates throwaway certificates from
one private CA and makes real connections:
- **Outbound**: a Gravitino stub served over HTTPS. With the CA bundle in
`SSL_CERT_FILE`, `list_metalakes` succeeds. Without it, the call fails with
`CERTIFICATE_VERIFY_FAILED`.
- **Inbound**: `python -m mcp_server` is started with
`--tls-cert`/`--tls-key`. The endpoint completes a TLS handshake with the CA,
and rejects both the default roots and plain HTTP.
- `cryptography` is added to the dev dependencies (`pyproject.toml`, the
pinned `devToolRequirements` in `build.gradle.kts`, and `uv.lock`). It was
already installed as a transitive runtime dependency, but the tests now import
it directly. The other `uv.lock` changes are uv re-resolving its environment
markers after this direct dev dependency was added.
### Why are the changes needed?
Operators running Gravitino with a private CA had no documented way to make
the MCP server trust it, and the obvious setting, pointing `SSL_CERT_FILE` at
the CA alone, silently breaks a public identity provider. No existing test made
a real TLS connection, so a break on either hop would go unnoticed.
Fix: #14871
### Does this PR introduce _any_ user-facing change?
Documentation only. There is no change to runtime code or options.
### How was this patch tested?
- `./gradlew :mcp-server:formatCheckPython :mcp-server:pylint
:mcp-server:testPython`: formatting is clean, pylint rates the code 10.00/10,
and all 327 unit tests pass, including the 3 new ones.
- Mutation check: without the `uvicorn_config` TLS wiring in `server.py`,
the endpoint test fails.
--
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]