docs(sandbox): document verified TLS behavior of kubeconfig under Bun#1926
docs(sandbox): document verified TLS behavior of kubeconfig under Bun#1926larryro wants to merge 1 commit into
Conversation
Empirically verify under Bun 1.3.14 + @kubernetes/client-node@1.4.0 which kubeconfig TLS knobs are honoured (issue #1849). @kubernetes/client-node uses node-fetch -> https.request(), not Bun's native fetch(). Bun honours agent options via https.request(): skipTLSVerify and caFile both take effect; neither is inert or dead code. NODE_EXTRA_CA_CERTS is defence-in-depth for k8s API calls, not required. - Rename AUTH NOTE -> TLS NOTE with accurate empirical findings. - Extract makeK8sConfig() so kubeconfig options are unit-testable. - Add three unit tests (caFile branch, skipTLSVerify branch, server/token). - kubernetes.md: demote NODE_EXTRA_CA_CERTS to optional; correct the false "Bun ignores kubeconfig CA" claim; note both TLS knobs are honoured.
|
Warning Review limit reached
More reviews will be available in 51 minutes and 16 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Three open PRs address the same question, and two reach opposite conclusions about whether Bun honors kubeconfig TLS knobs:
This is security-critical: merging the wrong conclusion could leave TLS verification silently disabled in production, or remove code that was actually doing the verification. This cannot be resolved by review alone — it needs an empirical test under the real Bun version (issue a request with a kubeconfig carrying |
Summary
Resolves #1849 — empirical verification of
skipTLSVerify/caFilebehavior under Bun.Finding: both kubeconfig TLS knobs ARE honored.
@kubernetes/client-node@1.4.0usesnode-fetch→https.request(), not Bun's nativefetch(). Bun honorshttps.Agentoptions viahttps.request(), so neitherskipTLSVerifynorcaFileis dead code.Key empirical results (Bun 1.3.14):
skipTLSVerify: true→rejectUnauthorized: falsein thehttps.Agent→ TLS verification genuinely disabled ✓caFile→agent.capopulated and trusted ✓agent.cert/agent.keysent correctly ✓fetch()withagentoption → ignored (but@kubernetes/client-nodedoesn't use native fetch)Contrast: Bun's native
fetch()ignores theagentoption. The prior "AUTH NOTE" was generalizing from native fetch behavior, which misrepresented what@kubernetes/client-nodeactually does.Changes
k8s-client.ts: Replace misleading AUTH NOTE with accurate TLS NOTE; extractmakeK8sConfig()frommakeK8sClient()to enable unit testing of kubeconfig options.k8s-client.test.ts: Add 3 unit tests covering thecaFilebranch,skipTLSVerifybranch, and bearer-token wiring inmakeK8sConfig().kubernetes.md: DemoteNODE_EXTRA_CA_CERTSfrom "in-cluster required" to "optional (defence-in-depth)"; correct the false "Bun's fetch ignores the kubeconfig CA" claim; add note that both TLS knobs are verified to work.Test plan
bun test services/sandbox/src/backend/kubernetes/k8s-client.test.ts— 11 passbun test services/sandbox/src/backend/kubernetes/— 85 passbun run typecheck— cleanrejectUnauthorized: false, custom CA, and client cert — all honored viahttps.Agent+node-fetch