fix(driver): let the binary inject gRPC dial credentials for startup#306
Merged
Conversation
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>
e3e79cb to
df76a4a
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.
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
rpcpackage, whoseServiceDialOptionsare byte-for-byte identical to this repo's except the credential value (mTLS vs insecure). Re-pointing the controller to this repo'srpcsilently dropped mTLS, so the driver could no longer complete the gRPC handshake against TLS-enabled servers.Changes
startup.Config.DialCredentials(grpc/credentials.TransportCredentials). When set, it overrides the rpc package's insecure default on all four backend dials (via a smalldialOptions()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.