Conversation
bx9001
marked this pull request as ready for review
September 8, 2026 08:40
relrod
reviewed
Sep 11, 2026
| #[test] | ||
| fn otel_password_without_username_parses() { | ||
| let args = parse(&["--otel-password", "McBobberson"]) | ||
| .expect("a password alone is rejected later, not by clap"); |
Member
There was a problem hiding this comment.
Why defer this to later and not use requires = "otel_username"?
|
|
||
| /// Password for basic-auth against the OTel collector. Requires a | ||
| /// username | ||
| #[arg(long, env = "RUSTIK_OTEL_PASSWORD", hide_env_values = true)] |
| .install_default() | ||
| .expect("Failed to install rustls crypto provider"); | ||
|
|
||
| let otel_client = match &args.otel_endpoint { |
Comment on lines
+21
to
+22
| let username = username.filter(|value| !value.is_empty()); | ||
| let password = password.filter(|value| !value.is_empty()); |
Member
There was a problem hiding this comment.
Does clap's value_parser = clap::builder::NonEmptyStringValueParser::new() option on the username param solve what you are trying to do here?
Member
|
Could we add a test asserting that the outgoing request has the expected Authorization header when credentials are configured, and no header otherwise? The current tests only exercise credential resolution. For example you can split the reqwest client build into its own method and then check |
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.
No description provided.