File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed
Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 22
33## Unreleased
44
5+ - Fix ` ${netrc:...} ` to consider ` :netrcFile ` config properly.
6+
57## 0.84.1
68
79- Fix ` ${netrc:...} ` to consider ` :netrcFile ` config.
Original file line number Diff line number Diff line change 175175 (string/replace #"\$\{ netrc:([^}]+)\} "
176176 (fn [[_match key-rc]]
177177 (try
178- (or (secrets/get-credential key-rc (:netrcFile config)) " " )
178+ (or (secrets/get-credential key-rc (get config " netrcFile " )) " " )
179179 (catch Exception e
180180 (logger/warn logger-tag " Error reading netrc credential:" (.getMessage e))
181181 " " ))))))
Original file line number Diff line number Diff line change 342342 (when (= key-rc " api.openai.com" )
343343 " secret-password-123" ))]
344344 (is (= " secret-password-123" (#'config/parse-dynamic-string " ${netrc:api.openai.com}" " /tmp" {})))))
345+ (testing " replaces netrc pattern with credential password with a custom netrcFile"
346+ (with-redefs [secrets/get-credential (fn [key-rc netrc-file]
347+ (when (and (= key-rc " api.openai.com" )
348+ (= netrc-file " /tmp/my-file" ))
349+ " secret-password-123" ))]
350+ (is (= " secret-password-123" (#'config/parse-dynamic-string " ${netrc:api.openai.com}" " /tmp" {" netrcFile" " /tmp/my-file" })))))
345351
346352 (testing " replaces netrc pattern with empty string when credential not found"
347353 (with-redefs [secrets/get-credential (constantly nil )]
You can’t perform that action at this time.
0 commit comments