Skip to content

fix(driver): let the binary inject gRPC dial credentials for startup#306

Merged
jupiterv2 merged 1 commit into
mainfrom
dev/jupiterv2.10/driver-client-mtls
Jun 18, 2026
Merged

fix(driver): let the binary inject gRPC dial credentials for startup#306
jupiterv2 merged 1 commit into
mainfrom
dev/jupiterv2.10/driver-client-mtls

Conversation

@jupiterv2

Copy link
Copy Markdown
Contributor

What

The streaming controller's startup dials its backend services (processor / usage / db-registry / webhook) through this repo's service/common/rpc, which uses insecure transport credentials by default. The driver binary, however, talks to servers that may require mTLS, and the TLS policy + certificates deliberately live in the binary's repo — not in sentio-core (this repo is public; the certs/keys must not land here).

Before the streaming controller moved into sentio-core it dialed via the binary repo's own rpc package, whose ServiceDialOptions are byte-for-byte identical to this repo's except the credential value (mTLS vs insecure). Re-pointing the controller to this repo's rpc silently dropped mTLS, so the driver could no longer complete the gRPC handshake against TLS-enabled servers.

Changes

  • Add startup.Config.DialCredentials (grpc/credentials.TransportCredentials). When set, it overrides the rpc package's insecure default on all four backend dials (via a small dialOptions() helper); when nil, the insecure default is kept — so existing callers are unaffected.

This mirrors the existing inversion seams (Notifier, ClickhouseConnector, EntityMetricsMonitor): the controller stays free of TLS policy/certificates, and the driver binary injects them.

Test

  • bazel build //driver/controller/startup/... — green.

The streaming controller's startup dials its backend services (processor /
usage / db-registry / webhook) through this repo's service/common/rpc, which
defaults to insecure transport credentials. The driver binary, however, talks
to servers that may require mTLS — and the TLS policy + certificates
deliberately live in the binary's repo, not in sentio-core.

Add startup.Config.DialCredentials (grpc credentials.TransportCredentials): when
set, it overrides the rpc package's insecure default on all four backend dials;
when nil, the insecure default is kept. This mirrors the existing inversion
seams (Notifier, ClickhouseConnector, EntityMetricsMonitor) and keeps TLS
certificates out of sentio-core.

Since the transport security is now decided by the injected credentials, dial
with rpc.Dial directly instead of rpc.DialAuto — the http://https:// scheme
sniffing DialAuto does is moot here (the service addresses carry no scheme) and
would only contradict the injected credentials.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jupiterv2 jupiterv2 force-pushed the dev/jupiterv2.10/driver-client-mtls branch from e3e79cb to df76a4a Compare June 18, 2026 14:19
@jupiterv2 jupiterv2 merged commit 7b6df73 into main Jun 18, 2026
1 check passed
@jupiterv2 jupiterv2 deleted the dev/jupiterv2.10/driver-client-mtls branch June 18, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant