Fix uni-gRPC server wiring and URL password redaction - #1180
Merged
Merged
Conversation
StripPassword string-replaced the decoded password inside the re-encoded URL, so a password containing a URL-special character (most commonly "@", also spaces or non-ASCII) never matched and was logged verbatim - e.g. the NATS broker URL is logged at startup via this function. Use url.Redacted, which redacts the password in the parsed userinfo before re-encoding, so any well-formed URL is redacted regardless of the password's characters.
runGRPCUniServer's result was assigned to grpcAPIServer instead of grpcUniServer, so grpcUniServer stayed nil and was never GracefulStop-ed on shutdown. With both grpc_api and uni_grpc enabled this also overwrote the grpc_api server reference, so the API server's in-flight requests were dropped abruptly at exit instead of draining. Assign to grpcUniServer.
runGRPCUniServer built its TLS from cfg.GrpcAPI.TLS instead of cfg.UniGRPC.TLS, so uni_grpc.tls.enabled was silently ignored (the uni-gRPC listener served plaintext) while grpc_api.tls was unexpectedly applied to it. Read the uni-gRPC TLS section.
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.
Wiring and logging fixes.
Fixes
url.Redacted()).