Closed burbma closed 7 years ago
Ah, good callout. Yes, the way the lib is designed the vault.core
namespace contains the client protocol and construction multimethod, and vault.client.http
and vault.client.mock
provide implementations of the protocol and extensions of the multimethod. In order to use the general constructor you need to require one or both of these namespaces to teach it about the respective URL schemes.
I've updated the README in ac86d41209ac40dd0628c3bb67e52bf6f9a989a0 to reflect this and hopefully prevent future confusion. :+1:
Minimum steps I took to reproduce.
boot repl
(vault.core/new-client "http://vault.example.com") ;; => java.lang.IllegalArgumentException: Unsupported Vault client URI scheme: "http://vault.example.com"
;; Try to use directly (require '[vault.client.http])
(vault.client.http/http-client "http://vault.example.com") ;; => #vault.client.http.HTTPClient{:api-url "http://vault.example.com", :auth #atom[nil 0x16ac813], :leases #atom[{} 0x539b4c1], :lease-timer nil}
;; Try other schemes (vault.core/new-client "https://vault.example.com") ;; => #vault.client.http.HTTPClient{:api-url "https://vault.example.com", :auth #atom[nil 0x1a102f89], :leases #atom[{} 0x2982fcbf], :lease-timer nil}
;; Hold up that worked. Let's try http again.
(vault.core/new-client "http://vault.example.com") ;; => #vault.client.http.HTTPClient{:api-url "http://vault.example.com", :auth #atom[nil 0x4e1f2b6a], :leases #atom[{} 0x23dae4ca], :lease-timer nil}