[extension/basicauth] Add username_file and password_file config options#46227
Open
Aneurysm9 wants to merge 2 commits intoopen-telemetry:mainfrom
Open
[extension/basicauth] Add username_file and password_file config options#46227Aneurysm9 wants to merge 2 commits intoopen-telemetry:mainfrom
Aneurysm9 wants to merge 2 commits intoopen-telemetry:mainfrom
Conversation
4977a05 to
81c6c94
Compare
|
Hello! I stumbled across this PR and noticed it relates closely to an open PR of mine #45953 The implementation seems to be based on the buggy one, and thus it will likely have the same problem. I suggest reconsidering the implementation of |
Member
Author
|
Thanks for the heads up @grelland! This is indeed based on the implementation from |
Add a shared credentials file library (`extension/internal/credentialsfile`) that provides a `ValueResolver` interface for resolving secrets from inline config values or watched files. The library uses fsnotify to watch for file changes, enabling live credential rotation without collector restarts. Wire the library into basicauthextension's `client_auth` config with two new fields: `username_file` and `password_file`. When set, file-based values take precedence over their inline counterparts. Credentials are read dynamically on each request via the `ValueResolver`, so file changes are reflected immediately for both HTTP and gRPC clients. Assisted-by: Kiro (Amazon Q Developer) Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
…d volumes Watch the file itself instead of the parent directory. Kubernetes projected volumes (ConfigMaps, Secrets, serviceAccountTokens) use a double-symlink chain that is rotated via an atomic rename of an intermediate .data symlink followed by removal of the old timestamped directory. Watching the parent directory missed these events because the filename filter never matched the intermediate symlink names. The fix watches the file directly (fsnotify follows symlinks to the underlying inode) and on Remove/Chmod events removes and re-adds the watcher so it follows the new symlink target, then reloads the value. This matches the approach in open-telemetry#45953. Co-authored-by: Halvdan Hoem Grelland <grelland@users.noreply.github.com> Assisted-by: Kiro (Amazon Q Developer) Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
81c6c94 to
238a0f7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a shared credentials file library (
extension/internal/credentialsfile) that provides aValueResolverinterface for resolving secrets from inline config values or watched files. The library uses fsnotify to watch for file changes, enabling live credential rotation without collector restarts.Wire the library into basicauthextension's
client_authconfig with two new fields:username_fileandpassword_file. When set, file-based values take precedence over their inline counterparts. Credentials are read dynamically on each request via theValueResolver, so file changes are reflected immediately for both HTTP and gRPC clients.Assisted-by: Kiro (Amazon Q Developer)