Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Introduce a way to provide custom headers#1811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
sai-sunder-s wants to merge1 commit intomain
base:main
Choose a base branch
Loading
fromcustomheaders

Conversation

@sai-sunder-s
Copy link
Contributor

For certain scenarios, custom headers are required to be sent to the backend along with usual headers likeauthorization,x-goog-user-project. Exposing a way for users to specify these custom headers.

@sai-sunder-ssai-sunder-s marked this pull request as ready for reviewSeptember 16, 2025 17:37
"""
importcopy

PROTECTED_HEADERS= {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way to capture this in a more central way? I worry that we are missing some now or may miss some in the future if new ones get added

for example

_METADATA_HEADERS= {_METADATA_FLAVOR_HEADER:_METADATA_FLAVOR_VALUE}

creds_with_header.before_request(request,"http://example.com","GET",headers)
assertheaders["X-Custom-Header"]=="value1"
assert"authorization"inheaders# Ensure base apply logic ran
assertcreds_with_headerisnotcredentials
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure what you're trying to test here but as I understand python, this will never be true.

i.e. if you did:

credentials_a = CredentialsImpl()credentials_b = CredentialsImpl()assert credentials_a is not credentials_b # success

assertc._use_non_blocking_refresh


deftest_with_headers():
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this test is testing multiple scenarios. could you break it up so that we are testing ~1 thing per test?

https://engdoc.corp.google.com/eng/doc/tott/episodes/726.md?cl=head


self._use_non_blocking_refresh=False
self._refresh_worker=RefreshThreadManager()
self._custom_headers= {}
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not used?

@parthea
Copy link
Contributor

Switching to draft since there are failing tests

@partheaparthea marked this pull request as draftDecember 17, 2025 20:26
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nolanleastinnolanleastinnolanleastin left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@sai-sunder-s@parthea@nolanleastin

[8]ページ先頭

©2009-2025 Movatter.jp