vault-clj icon indicating copy to clipboard operation
vault-clj copied to clipboard

Specs for authenticate (and other APIs)?

Open bsless opened this issue 3 years ago • 2 comments

Hello, What do you think about adding clojure.spec.alpha specs to authenticate and possibly other parts of the public API, similar to how cognitect's AWS client validates requests before sending them?

I wouldn't mind PRing it

Thanks, Ben

bsless avatar Jul 04 '22 09:07 bsless

I'm generally in favor of more validation, as long as it doesn't get in the way of compatibility with different versions of the vault API.

greglook avatar Aug 01 '22 16:08 greglook

My idea in particular was to spec authenticate! itself https://github.com/amperity/vault-clj/blob/master/src/vault/core.clj#L12

bsless avatar Aug 02 '22 05:08 bsless

I'm open to further validation of the requests on APIs, however I don't think we can use clojure.spec and retain babashka compatibility. For example, in ac8a864b0277751b436367aa90160257ed64efce I switched to a really simplified validation approach for the auth and lease states.

greglook avatar Sep 08 '23 20:09 greglook