Repository navigation
fix: treat an empty worker queue password or model key as unset - #52
Open
leninworld wants to merge 1 commit into
Open
leninworld wants to merge 1 commit into
leninworld wants to merge 1 commit into
Conversation
Signed-off-by: Lenin Mookiah <2639584+leninworld@users.noreply.github.com>
This branch has not been deployed
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.
Summary
graphicle redis-workerread the variables named by the queue'scredential_refand the model profile'skey_envwithstd::env::var, so a variable that was set but empty counted as a credential. With an empty model key the worker connected to Redis and would send an empty API key header on each model call. With an empty queue password it tried to authenticate with it and reported "Queue authentication or connection failed".resolve_credential(vault.rs) already refuses an empty value for the samecredential_ref, and every model call, whoseenvironment_credentialrefuses an empty key. The worker now callsmodel::environment_credentialinstead of readingkey_envitself.Not changed:
graphicle loginwith an empty token variable, which is a separate command; I can send that as its own PR.Test plan
redis_worker::redis_worker_rejects_empty_credentials_before_connectingruns the program with a queue onredis://127.0.0.1:1(no Redis) and checks three cases: empty queue password, empty model key, and both set. The first two must fail with their credential message. The third must fail without either message. Onmainit fails at the first case (graphicle: Queue authentication or connection failed). With only the model-key check reverted it fails the same way at the second case. With this change it passes.cargo fmt --check,cargo clippy --locked --all-targets -- -D warnings,cargo clippy --locked --all-targets --features local-inference -- -D warningsandcargo test --locked --all-targetsincrates/graphicle(Rust 1.95.0, macOS). Linux and Windows run in CI.