Skip to content

Conversation

@maraino
Copy link
Contributor

@maraino maraino commented Jan 13, 2026

This commit adds a new option to the CA client that allows the customization of the HTTP transport.

@github-actions github-actions bot added the needs triage Waiting for discussion / prioritization by team label Jan 13, 2026
@maraino maraino requested review from hslatman and removed request for hslatman January 13, 2026 21:23
retryFunc RetryFunc
timeout time.Duration
opts []ClientOption
transportDecorator TransportDecorator
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps the client would benefit from having a reference to *clientOptions and not []ClientOption. This way you wouldn't need to copy transportDecorator around. Not sure how big of a change this is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We use those options later, perhaps we could refactor that part, but there might be some unexpected implications.

This commit adds a new option to the CA client that allows the
customization of the HTTP transport.
@maraino maraino force-pushed the mariano/transport-decorator branch from bbad043 to e86b66b Compare January 13, 2026 21:36
@maraino maraino requested review from azazeal and hslatman January 13, 2026 21:53
@hslatman hslatman added this to the v0.29.1 milestone Jan 14, 2026
hslatman
hslatman previously approved these changes Jan 14, 2026
Copy link
Member

@hslatman hslatman left a comment

Choose a reason for hiding this comment

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

Just a nit. Approving despite that. Panos may want to approve too.

ca/client.go Outdated
return fmt.Errorf("client request failed: %w", err)
}

func decorateTransport(tr http.RoundTripper, td TransportDecorator) http.RoundTripper {
Copy link
Member

Choose a reason for hiding this comment

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

Nit, but it's decorating a RoundTripper; not a *Transport.

Copy link
Contributor

Choose a reason for hiding this comment

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

True. decorateRoundTripper is better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made this change in 63231db, but I left WithTransportDecorator as we are modifying the http.Client.Transport.

@maraino maraino merged commit a7ceb2d into master Jan 14, 2026
14 checks passed
@maraino maraino deleted the mariano/transport-decorator branch January 14, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs triage Waiting for discussion / prioritization by team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants