Skip to content

feat(gateway): validate mutual TLS field combinations - #315

Merged
edenreich merged 1 commit into
mainfrom
feat/issue-314-20261101-1328
Nov 1, 2026
Merged

edenreich merged 1 commit into
mainfrom
feat/issue-314-20261101-1328

Conversation

@inference-gateway-maintainer

@inference-gateway-maintainer inference-gateway-maintainer Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #314.

Commit 3cd4b24 (#313) already landed the first two acceptance criteria: spec.server.tls.clientCARef is mounted and surfaced as SERVER_TLS_CLIENT_CA_PATH, and spec.client.tls.{caRef,certificateRef,keyRef} are mounted and surfaced as CLIENT_TLS_CA_PATH / CLIENT_TLS_CERT_PATH / CLIENT_TLS_KEY_PATH. What was missing is the validation, so this PR adds only that.

Two CEL rules on the CRD, matching the house pattern already used in orchestrator_types.go, so the API server rejects the broken combinations at admission instead of the gateway crash-looping on startup:

  • spec.server.tls: clientCARef requires enabled: true. Without it the controller emits no SERVER_TLS_* env vars at all, so inbound mTLS was silently ignored - which is exactly the "client CA without server certificate and key" case from the gateway's startup error.
  • spec.client.tls: certificateRef and keyRef must be set together. A certificate without its key (or a key without its certificate) cannot build a client keypair. An outbound caRef on its own stays valid, since trusting a private CA does not need a client certificate.

Testing

  • task test - 5 new envtest cases in internal/controller/gateway_controller_test.go covering both rejections, the key-without-certificate direction, and the two valid shapes. internal/controller coverage 71.6%.
  • task fmt, task vet, task lint - clean.
  • task manifests - regenerated CRD and install manifests are committed alongside the API change.

Docs and the Helm values criterion

The CRD reference lives in inference-gateway/docs, so the new fields are tracked there: inference-gateway/docs#1068.

The issue's "Helm values" criterion has no target in the org - there is no Chart.yaml in any inference-gateway repo (gh search code --owner inference-gateway --filename Chart.yaml returns nothing). The operator installs via kustomize (config/ rendered into manifests/install.yaml), and the new fields are Gateway CR spec fields rather than operator deployment settings, so nothing in the install manifests needs to change beyond the regenerated CRD included here. If a chart is planned, its values should surface these fields then.

Generated with Claude Code

@inference-gateway-maintainer
inference-gateway-maintainer Bot requested a review from a team as a code owner November 1, 2026 13:34
@edenreich
edenreich merged commit d43a7ea into main Nov 1, 2026
1 check passed
@edenreich
edenreich deleted the feat/issue-314-20261101-1328 branch November 1, 2026 13:44
inference-gateway-releaser Bot added a commit that referenced this pull request Nov 1, 2026
## [0.31.0](v0.30.0...v0.31.0) (2026-11-01)

### ✨ Features

* **gateway:** express mutual TLS in both directions ([#313](#313)) ([3cd4b24](3cd4b24)), closes [#311](#311)
* **gateway:** validate mutual TLS field combinations ([#315](#315)) ([d43a7ea](d43a7ea))

### 🐛 Bug Fixes

* **gateway:** probe over HTTPS when spec.server.tls is on ([#312](#312)) ([2e3400c](2e3400c))
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.31.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Expose gateway mutual TLS settings in the CRD

1 participant