TestResolvedKeyLiteralDollarSurvives: expansion applies ONLY when the whole key is a ${VAR} reference. A literal proxy key containing '$' (llama.cpp --api-key, LiteLLM master keys) must pass through byte-identical: os.ExpandEnv would silently corrupt it ("pa$$word" -> "paword") and every request 401
(t *testing.T)
| 700 | // os.ExpandEnv would silently corrupt it ("pa$$word" -> "paword") and every |
| 701 | // request 401s with nothing anywhere hinting the key was rewritten. |
| 702 | func TestResolvedKeyLiteralDollarSurvives(t *testing.T) { |
| 703 | for _, key := range []string{ |
| 704 | "pa$$word123", |
| 705 | "sk-abc$def", |
| 706 | "trailing$", |
| 707 | "$UPFRONT-rest", |
| 708 | "${not-a-valid-name}", // ${...} but not an env-var name: literal |
| 709 | "prefix-${REAL_VAR}", // reference not the whole key: literal |
| 710 | } { |
| 711 | p := &Profile{Key: key} |
| 712 | if got := p.ResolvedKey(); got != key { |
| 713 | t.Errorf("ResolvedKey(%q) = %q, want the literal back", key, got) |
| 714 | } |
| 715 | } |
| 716 | } |
| 717 | |
| 718 | // TestURLOverrideDoesNotPersist: a CODEHAMR_URL override lives in |
| 719 | // cfg.URLOverride and ActiveURL reflects it, but Save writes only the stored |
nothing calls this directly
no test coverage detected