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.
When doing something like:
cnquery login --api-proxy http://INVALID_PROXY:111 --token XYZ...
The login actually works even through it should have failed b/c of the bad proxy details.
This is due to the way we need to fetch the proxy CLI parameter through the viper package. Since the binding of this parameter is actually "api_proxy" with an underscore, we should reference it exactly that way.
With this change, we now get the expected failure/behavior when given the bad proxy info:
$ ./cnquery login --api-proxy http://192.168.86.3:111 --token "SOME_TOKEN_DATA"
→ token description: test
→ token will expire at Wed, 12 Apr 2023 09:51:44 EDT FTL failed to log in client error="failed to do request: Post "https://api.edge.mondoo.com/AgentManager/RegisterAgent\": proxyconnect tcp: dial tcp 192.168.86.3:111: connect: connection refused"