 (defrecord S3DataStore [creds bucket]
   IDataStore
   (put-key [this k v]
-    (assert (encore/bytes? v))
+    (have? enc/bytes? v)
     (let [reply (try (s3/put-object creds bucket k (ByteArrayInputStream. v)
                        {:content-length (count v)
                         ;; Nb! Prevents overwriting with corrupted data:

    (let [fetch1
          (fn [k]
            (tundra/catcht
             (let [obj (s3/get-object creds bucket k)
                   ba  (byte-array (-> obj :metadata :content-length))]
               (.readFully (DataInputStream. (:content obj)) ba)
               ba)))]
      (->> (mapv #(future (fetch1 %)) ks)
           (mapv deref)))))



(comment
  (def dstore  (s3-datastore creds "ensso-store/folder"))
  (def hardkey (tundra/>urlsafe-str "00temp-test-foo:bar /♡\\:baz "))
  (tundra/put-key dstore hardkey (.getBytes "hello world"))
  (String. (first (tundra/fetch-keys dstore [hardkey]))))
