Skip to content

feat(gax): promote ClientContext getInternalHeaders and setInternalHeaders to @InternalApi - #14361

Closed
whowes wants to merge 1 commit into
mainfrom
whowes/gax-internal-headers
Closed

whowes wants to merge 1 commit into
mainfrom
whowes/gax-internal-headers

Conversation

@whowes

@whowes whowes commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

This will allow generated client library code using gRPC to forward internal headers like x-goog-api-client to HTTP requests made for resumable upload-enabled methods.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates ClientContext.java by changing the visibility of getInternalHeaders() and Builder.setInternalHeaders() from protected to public. Both methods are now annotated with @internalapi to restrict their usage to generated service stubs. I have no feedback to provide.

@whowes
whowes marked this pull request as ready for review September 11, 2026 17:18
@whowes
whowes requested review from a team as code owners September 11, 2026 17:18
@whowes
whowes requested a review from blakeli0 September 11, 2026 17:18
@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown


protected abstract Builder setInternalHeaders(Map<String, String> headers);
@InternalApi("For use by generated service stubs only")
public abstract Builder setInternalHeaders(Map<String, String> headers);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I thought we were talking about external header providers such as getHeaderProvider, which we may want to copy from grpc transport to httptransport.

For internal headers, I don't think we want to expose the setters as public. We should be able to create default http internal headers using defaultHttpJsonApiClientHeaderProviderBuilder.

@whowes whowes Sep 14, 2026

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.

Thanks - you are right here, thanks for pointing out the default builder. Closing this PR.

@whowes whowes closed this Sep 14, 2026
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