← Back to Pull requests

CNTRLPLANE-3762: Add support for component-scoped proxy #946

Closed
unknown closed this pull request without merging on Jul 29, 2026 03:21 UTC
View on GitHub
unknown unknown commented on Jul 07, 2026 14:55 UTC
Author

Add component-scoped proxy support for authentication

Adds support for a per-component proxy configuration on the operator.openshift.io/v1 Authentication CR, gated behind FeatureGateAuthenticationComponentProxy. When enabled, the authentication operator reads spec.proxy (HTTPProxy, HTTPSProxy, NoProxy, TrustedCA) from the Authentication CR instead of relying on the cluster-wide proxy environment variables.

Enhancement: Proxy support for integrated auth stack

Motivation

In disconnected or restricted-network environments, the cluster-wide proxy may not be appropriate for authentication traffic. A component-scoped proxy allows administrators to route OAuth/OIDC and IdP traffic through a dedicated proxy with its own CA trust, independent of the global proxy configuration.

Changes

Cluster-wide proxy: no longer loaded from the proxies.config.openshift.io/cluster API resource. ResolveProxy reads it from the process environment variables (HTTP_PROXY, HTTPS_PROXY, NO_PROXY), which are already injected by the cluster proxy controller. This removes the direct API dependency and the proxyLister/proxyInformer from the deployment controller.

Transport layer (pkg/transport)

  • TransportForCARefWithProxy: builds proxy-aware HTTP transports with configurable CA references.

  • LoadCAData: exported helper that reads CA bundle bytes from a ConfigMap, checking Data first then BinaryData.
  • Proxy resolution (pkg/controllers/common)

  • ResolveProxy: reads the component proxy from the Authentication CR when the feature gate is enabled; falls back to httpproxy.FromEnvironment() otherwise. Returns a ResolvedProxy with the effective proxy configuration and optional TrustedCAName.
  • Config observer (pkg/controllers/configobservation/oauth)

  • IDP transport construction uses the resolved proxy settings and appends the proxy trusted CA to CA references.

  • New ObserveProxyTrustedCA observer injects the proxy CA bundle file path into the observed config when a trusted CA is configured.
  • Deployment controller (pkg/controllers/deployment)

  • Injects HTTP_PROXY/HTTPS_PROXY/NO_PROXY env vars from the resolved proxy into the OAuth Server pod.

  • Syncs the trusted CA ConfigMap from openshift-config to openshift-authentication.

  • Adds a volume/mount with Optional: true for CA hot-reload without redeployment.
  • Proxy validation controller (pkg/controllers/proxyconfig)

  • Validates route reachability through the resolved proxy (component or cluster-wide).

  • Tests IdP endpoint connectivity and emits IdPEndpointUnreachable warning events for transient failures (does not set Degraded).

  • Uses hash-based change detection to avoid redundant validation.
  • Endpoint accessible controller (pkg/libs/endpointaccessible)

  • Accepts an optional proxy function for route health checks. Only the route check controller uses it (external hostname); service and endpoint checks remain proxy-free (cluster-internal addresses).
  • Custom route controller (pkg/controllers/customroute)

  • Route availability health check uses the resolved proxy and loads the proxy trusted CA via LoadCAData.
  • Test plan

    Unit tests are in place, but e2e tests are still missing.

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    Summary by CodeRabbit

    New Features
    OAuth server and route/endpoint accessibility checks now support component-scoped proxy settings (with component-scoped trusted CA support) in addition to cluster-wide proxies.
    Proxy validation and identity-provider discovery now use CA-aware, proxy-aware transports and deterministic noProxy merging.
    Bug Fixes
    When component proxy configuration can’t be read, behavior now safely falls back to cluster-wide proxy settings.
    Proxying is disabled when no effective proxy is set, and identity-provider reachability warnings are aggregated while avoiding unnecessary revalidation.
    Tests
    Added unit coverage for proxy resolution, request proxy selection, and IdP connectivity event behavior.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 544 lines (+408 / -136) across 6 files Reviewer: ehearne-redhat Review duration: 30986m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.48 · 544 lines diff across 6 files
    0.48
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.377
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #946"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 48% (MEDIUM) · Higher = larger blast radius
    48%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.0% · Safe to merge
    19.0%