separate MCP ingress without basic auth to enable its own bearer auth - #81
Merged
Conversation
vitek-rostislav
force-pushed
the
rv/mcp-http-auth
branch
from
June 20, 2026 09:03
ae21bfe to
69d7081
Compare
grossmannmartin
requested changes
Jun 22, 2026
grossmannmartin
approved these changes
Jun 23, 2026
vitek-rostislav
force-pushed
the
rv/mcp-http-auth
branch
from
July 20, 2026 12:44
f241350 to
c63fd04
Compare
vitek-rostislav
force-pushed
the
rv/mcp-http-auth
branch
from
July 20, 2026 12:55
f19398e to
6a5259b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Non-production domains (and any production domain in
FORCE_HTTP_AUTH_IN_PRODUCTION) are protected by nginx HTTP basic auth on the main ingress. Basic auth and the MCP Bearer token both use the singleAuthorizationheader, so while basic auth is enabled the Bearer token never reaches the application and external MCP clients (e.g. Claude Code) can't authenticate.This publishes the MCP paths through a second
eshop-mcpingress without basic auth, so they stay reachable. These paths remain protected by the application itself (Bearer token on/_mcp) or are public by the OAuth specification:/_mcpand/mcp/oauth(Prefix)/.well-known/oauth-authorization-serverand/.well-known/oauth-protected-resource(ImplementationSpecific, since ingress-nginx >= 1.12 rejects dots inExact/Prefixpaths by default)Behavior
MCP_INGRESS_ENABLED=0environment variable (default:1, documented in README).kubernetes/ingress/.ingress-mcp.yamltemplate, which can be overridden inorchestration/kubernetes/ingress/as usual.cert-managerannotation dropped) to avoid issuing a duplicate certificate.real_ip_headerserver-snippet) apply to the MCP locations automatically, because ingress-nginx merges all ingresses of the same hostname into a single server block — the MCP ingress intentionally does not repeat them.Refactoring of
deploy/parts/domains.shIngress generation is split into two phases so a second ingress type can be rendered from the same data instead of copying configuration from an already generated ingress:
prepare_domain_databuilds aDOMAIN_DATA_<index>associative array per domain (hostname, redirect counterpart, URL path, TLS secret name, HTTP auth flag, whitelist IPs, Cloudflare flag),render_ingresscopies a template, applies the shared data (name, hostname, TLS) and delegates template-specific behavior to a configure function (configure_default_ingressfor the main ingress; the MCP template needs none).Whitelist IP merging was simplified into a single normalization step (whitespace stripped, duplicated/leading/trailing commas collapsed).
Tests & docs
development-with-cloudflarecovering the Cloudflare + MCP combination (the MCP ingress must stay free of basic auth, IP whitelisting and the Cloudflare server-snippet).eshop-mcpingress.UPGRADE.md(v5.1.0 → v5.2.0) — note that the MCP paths are no longer covered by HTTP basic auth on non-production environments.