Skip to content

Add shared Receiver transport for the Filelog agent - #6

Open
craffit wants to merge 3 commits into
masterfrom
receiver-transport
Open

craffit wants to merge 3 commits into
masterfrom
receiver-transport

Conversation

@craffit

@craffit craffit commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Adds NewOpenAPIClientWithOptions with owned transport, rotating authentication, bounded requests, explicit proxy, system certificate trust and redirect rejection. The existing constructor retains its authentication behavior.

Tracking: https://github.com/StackVista/stackstate/issues/587

@craffit

craffit commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

Removed ConnectionOptions.CABundlePEM and explicit CA-pool construction. The transport uses system certificate trust; TLS coverage now exercises a fresh process with SSL_CERT_FILE. CI passed for da4accf.

@LouisLotter LouisLotter left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reviewed at da4accf0 as part of the logs set-A review, with an independent Opus 5.5/high source check. The new transport package tests pass on Linux; the complete macOS suite fails in the new system-trust test below. No Linux runtime TLS defect was found.

Comment thread pkg/openapiclient/options_test.go Outdated
caFile := filepath.Join(t.TempDir(), "receiver-ca.pem")
require.NoError(t, os.WriteFile(caFile, ca, 0600))
command := exec.Command(os.Args[0], "-test.run=^TestTLSOptionsSystemTrustHelper$")
command.Env = append(os.Environ(), "SSL_CERT_FILE="+caFile, "RECEIVER_TEST_URL="+server.URL)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[P2] The system-trust test is not portable to macOS. Go's Darwin verifier uses platform trust and does not load the synthetic CA from SSL_CERT_FILE, so go test ./... fails here with x509: certificate signed by unknown authority. Reproduced on macOS; the OpenAPI-client package passes on Linux. The repository explicitly provides Darwin development shells. Please gate just this environment-based system-trust assertion to supported platforms, or use a platform-appropriate test, while keeping the ordinary untrusted/insecure-mode TLS cases portable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 6806615: only the SSL_CERT_FILE system-trust assertion is Linux-only; untrusted and insecure-mode cases remain portable. Native macOS confirmation is still welcome.

@craffit

craffit commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the P2 portability regression in 6806615: the SSL_CERT_FILE trust assertion now runs on Linux only; ordinary TLS rejection and insecure-mode coverage remain portable. Full client test suite passes on Linux.

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