Skip to content

feat(catalog): add WithHeaders function - #652

Merged
kevinjqliu merged 5 commits into
apache:mainfrom
rambleraptor:with_headers
Jan 9, 2026
Merged

kevinjqliu merged 5 commits into
apache:mainfrom
rambleraptor:with_headers

Conversation

@rambleraptor

@rambleraptor rambleraptor commented Dec 11, 2025 •

Copy link
Copy Markdown
Contributor

Closes #532

This adds support for sending custom headers for IRC requests.

I'm happy to add a WithClient function as well (for sending a custom HTTP client), but it's unclear when the custom client would be used versus the options the user has sent.

@zeroshade zeroshade changed the title Add WithHeaders function feat(catalog): add WithHeaders function Dec 22, 2025

@zeroshade zeroshade left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you also add a test that expects the custom headers on the fetchAccessToken routes where it fetches credentials?

Comment thread catalog/rest/rest.go Resolved
@rambleraptor

Copy link
Copy Markdown
Contributor Author

@zeroshade added the tests and addressed the comments, ptal!

@zeroshade

Copy link
Copy Markdown
Member

@rambleraptor can you please fix the lint issues?

@rambleraptor

Copy link
Copy Markdown
Contributor Author

I (very dumbly) overwrote the test changes when I rebased. I rewrote the test to the best of my memory (and it still passes!) so hopefully nothing important is lost there. CI is passing!

@kevinjqliu

Copy link
Copy Markdown
Contributor

@rambleraptor rambleraptor force-pushed the with_headers branch from 5c87d2d to 1b15b28
4 hours ago

you can still use the old commits 😄

d173ebd
3660d0d
5c87d2d
1b15b28

@kevinjqliu kevinjqliu 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.

LGTM! one minor nit comment

Comment thread catalog/rest/rest.go Resolved
@rambleraptor

Copy link
Copy Markdown
Contributor Author

@zeroshade @kevinjqliu changes made, and I undid my Git screwup. Thanks for the review!

@zeroshade zeroshade left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

Comment thread catalog/rest/rest.go

session.defaultHeaders.Set("X-Client-Version", icebergRestSpecVersion)
session.defaultHeaders.Set("Content-Type", "application/json")
session.defaultHeaders.Set("User-Agent", "GoIceberg/"+iceberg.Version())

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.

Is it desirable to be able to override this as well?

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.

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.

the order currently would not allow User-Agent to be overridden. I think thats the right behavior

Comment thread catalog/rest/rest.go

session.defaultHeaders.Set("X-Client-Version", icebergRestSpecVersion)
session.defaultHeaders.Set("Content-Type", "application/json")
session.defaultHeaders.Set("User-Agent", "GoIceberg/"+iceberg.Version())

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.

Comment thread catalog/rest/rest.go

session.defaultHeaders.Set("X-Client-Version", icebergRestSpecVersion)
session.defaultHeaders.Set("Content-Type", "application/json")
session.defaultHeaders.Set("User-Agent", "GoIceberg/"+iceberg.Version())

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.

the order currently would not allow User-Agent to be overridden. I think thats the right behavior

Comment thread catalog/rest/rest.go Resolved
@kevinjqliu
kevinjqliu merged commit 4a70225 into apache:main Jan 9, 2026
11 checks passed
@kevinjqliu

Copy link
Copy Markdown
Contributor

Thanks for the PR @rambleraptor and thank you @zeroshade @ferhatelmas for the review

@ferhatelmas

Copy link
Copy Markdown
Contributor

I had put a comment #652 (comment) but it seems it is missed. Please confirm me wrong, otherwise we might want to address it

@ferhatelmas

Copy link
Copy Markdown
Contributor

Put #673 to show the issue

zeroshade pushed a commit that referenced this pull request Jan 9, 2026
@kevinjqliu

Copy link
Copy Markdown
Contributor

I did miss that comment, thanks for following up @ferhatelmas 😄

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.

feat: BigLake REST Catalog Support: Missing x-goog-user-project Header

4 participants