Skip to content

feat: Support generic client headers map#56

Open
stenalpjolly wants to merge 3 commits intogoogleapis:mainfrom
stenalpjolly:stenalpjolly_support_generic_headers
Open

feat: Support generic client headers map#56
stenalpjolly wants to merge 3 commits intogoogleapis:mainfrom
stenalpjolly:stenalpjolly_support_generic_headers

Conversation

@stenalpjolly
Copy link
Copy Markdown
Contributor

@stenalpjolly stenalpjolly commented Apr 6, 2026

Summary

This PR introduces the ability to pass custom HTTP headers to the McpToolboxClient and deprecates the .apiKey() method in favor of the new .headers() method. It also includes improvements to E2E test execution.

Changes:

  • Custom Headers Support: Added a .headers(Map<String, String>) method to McpToolboxClient.Builder to allow providing custom HTTP headers (e.g., custom Authorization tokens).
  • Deprecation of apiKey(): The .apiKey() method is now soft-deprecated but retained for backward compatibility. It acts as a fallback if no Authorization header is provided in .headers().
  • Case-Insensitive Header Checks: Header resolution correctly uses case-insensitive matching for the Authorization header.
  • Test Enhancements: Added McpToolboxClientBuilderTest to verify builder logic with both headers and api keys.
  • E2E Test Graceful Skip: Updated ToolboxE2ESetup to skip E2E tests gracefully via JUnit Assumptions when GOOGLE_CLOUD_PROJECT is not set, preventing test suite failures in unauthenticated environments.

@stenalpjolly stenalpjolly requested a review from a team as a code owner April 6, 2026 15:14
@stenalpjolly
Copy link
Copy Markdown
Contributor Author

/gcbrun

1 similar comment
@anubhav756
Copy link
Copy Markdown
Contributor

/gcbrun

@brayanwestpalmbeach12-lab
Copy link
Copy Markdown

@stenalpjolly
Copy link
Copy Markdown
Contributor Author

/gcbrun

1 similar comment
@anubhav756
Copy link
Copy Markdown
Contributor

/gcbrun

@stenalpjolly stenalpjolly force-pushed the stenalpjolly_support_generic_headers branch from fb8cb3c to c266fd1 Compare April 17, 2026 07:02
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.

3 participants