Operations endpoints: TLS support#946
Open
gengur wants to merge 3 commits into
Open
Conversation
26d5a68 to
7b8da2f
Compare
0ef6d6a to
e565aeb
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds TLS support for the operations HTTP endpoints (metrics/health) and wiring from local config into the operations system, plus unit coverage for the fabhttp TLS config builder.
Changes:
- Extend the operations system to emit
https://URLs when operations TLS is enabled and to honorops.TLS.Enabledwhen constructing the underlying fabhttp server. - Update node configuration extraction to pass operations TLS client-root CAs via
ClientRootCAs. - Extend test utilities to allow fetching Prometheus metrics over TLS and add
common/fabhttpTLS config unit tests.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| testutil/network_utils.go | Adds optional TLS client configuration for Prometheus metrics fetch helper. |
| config/config.go | Wires operations TLS client root CAs through extracted node configs. |
| common/operations/system.go | Switches ops URLs to http/https based on operations TLS enablement; enables TLS on the ops server. |
| common/fabhttp/tls_test.go | Adds unit tests for fabhttp.TLS.Config() behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+277
to
279
| if config.LocalConfig.NodeLocalConfig.OperationsConfig.TLSConfig.ClientRootCAs == nil { | ||
| config.LocalConfig.NodeLocalConfig.OperationsConfig.TLSConfig.ClientRootCAs = config.LocalConfig.NodeLocalConfig.GeneralConfig.TLSConfig.RootCAs | ||
| } |
Comment on lines
+351
to
353
| if config.LocalConfig.NodeLocalConfig.OperationsConfig.TLSConfig.ClientRootCAs == nil { | ||
| config.LocalConfig.NodeLocalConfig.OperationsConfig.TLSConfig.ClientRootCAs = config.LocalConfig.NodeLocalConfig.GeneralConfig.TLSConfig.RootCAs | ||
| } |
Comment on lines
+466
to
468
| if config.LocalConfig.NodeLocalConfig.OperationsConfig.TLSConfig.ClientRootCAs == nil { | ||
| config.LocalConfig.NodeLocalConfig.OperationsConfig.TLSConfig.ClientRootCAs = config.LocalConfig.NodeLocalConfig.GeneralConfig.TLSConfig.RootCAs | ||
| } |
Comment on lines
+546
to
548
| if config.LocalConfig.NodeLocalConfig.OperationsConfig.TLSConfig.ClientRootCAs == nil { | ||
| config.LocalConfig.NodeLocalConfig.OperationsConfig.TLSConfig.ClientRootCAs = config.LocalConfig.NodeLocalConfig.GeneralConfig.TLSConfig.RootCAs | ||
| } |
Comment on lines
+67
to
+72
| client := &http.Client{ | ||
| Transport: &http.Transport{ | ||
| TLSClientConfig: tlsClientConfig, | ||
| }, | ||
| Timeout: 10 * time.Second, | ||
| } |
Comment on lines
+83
to
+86
| if system.options.TLS.Enabled { | ||
| return operationServiceURL("https://", "metrics", system.Addr(), logger) | ||
| } | ||
| return operationServiceURL("http://", "metrics", system.Addr(), logger) |
Contributor
Author
There was a problem hiding this comment.
will be implement further
Signed-off-by: Genady Gurevich <genadyg@il.ibm.com>
e565aeb to
8223f6b
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.
issue: #45