Skip to content

Conversation

@mtodor
Copy link
Collaborator

@mtodor mtodor commented Nov 19, 2025

This pull request is adding StackRox Client.

It's adding the following functionalities:

  • support for a static and passthrough authorization with token
  • support of insecure and secure TLS connection
  • support for communication over HTTP1
  • error handling and human readable errors for a gRPC failures
  • retry and reconnect logic for connection
  • debug logging and error logging of each request to Central API
  • insecure option is renamed to insecure_skip_tls_verify to be more understandable and similar to other tools

File: internal/toolsets/config/tools.go - Besides that it also adds an example implementation of list_clusters tool. Purpose of that is to simply test the full flow. Proper implementation of list_clusters tool will be done in a followup PR.

@mtodor mtodor force-pushed the mtodor/ROX-31477-add-stackrox-client branch 5 times, most recently from df41746 to 79b040c Compare November 21, 2025 13:39
@mtodor mtodor force-pushed the mtodor/ROX-31477-add-stackrox-client branch from 79b040c to 0f4dbd3 Compare November 21, 2025 14:27
@mtodor mtodor changed the title WiP: ROX-31475: Add StackRox client ROX-31475: Add StackRox client Nov 21, 2025
@mtodor mtodor requested a review from janisz November 21, 2025 14:27
allToolsets := getToolsets(&config.Config{}, &client.Client{})

allToolsets := getToolsets(cfg)
toolsetNames := make(map[string]bool)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this boolean has no meaning we are only interested in keys

Suggested change
toolsetNames := make(map[string]bool)
toolsetNames := make(map[string]struct{})

since we have a dependency on stackrox we could use stringset
or since it's just a test a slice will be enough


require.NoError(t, err, "Should be able to establish HTTP connection to server")

_ = resp.Body.Close()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_ = resp.Body.Close()
require.NoError(t, resp.Body.Close())

c.mu.Lock()
defer c.mu.Unlock()

if !c.shouldRedialLocked() {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

2 participants