Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[extension/bearertokenauth] Fix the RPC credential updates #35653

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

JoonasMelin
Copy link

Fixes a bug - The gRPC headers not getting updated after collecter startup

Description

Does not appear there were any open/closed issues for this, but somewhere down the line the extension handling code has likely changed so that the PerRPCCredentials does not get called anymore for each call.

To excite the issue - you can start the collector with valid credentials, then inject invalid credentials to the token file.
Expected behavior: The collector starts using the invalid credentials and fails authentication
Old behavior: The collector keeps using the credentials it read at startup (problematic if you need to refresh the token)

This fixes the behavior by moving the evaluation of the authorization token to happen when the metadata is being fetched instead of at a time when the auth object is created.

Testing

Manual testing performed by manipulating the token file on the disk.
The interface to the rest of the application should remain exactly the same.

@JoonasMelin JoonasMelin requested review from jpkrohling and a team as code owners October 7, 2024 17:36
Copy link

linux-foundation-easycla bot commented Oct 7, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@JoonasMelin
Copy link
Author

Note that I have in-fact never written golang before so would appreciate any pointers on how this actually should be done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants