 
 (defn tags
   [registry repository-name]
-  (let [headers (headers registry)]
-    (get registry (str "/" repository-name "/tags/list") headers {})))
+  (let [headers (headers registry)
+        api (str "/" repository-name "/tags/list")]
+    (get registry api headers {})))

          (throw
            (ex-info "Registry error!"
                     {:status status
                      :body   {:error (:errors response)}})))))))

(defn- get
  [registry api headers params]

                 :query-params params}]
    (execute @(http/get url options))))

(defn- post
  [registry api headers body]
  (let [url (build-url registry api)
        options {:headers (merge headers {"Content-Type" "application/json"})
                 :body    (generate-string body)}]
    (execute @(http/post url options))))

(defn- basic-auth
  [registry]
  {:Authorization (token/generate-basic (:username registry)
                                        (:password registry))})

(defn- jwt-auth
  [token]
  {:Authorization (str "JWT " token)})

;; Dockerhub

(defn dockerhub-login
  [registry]
  (let [body (select-keys registry [:username :password])]
    (post registry "/users/login" {} body)))

(defn dockerhub-user-repo
  [registry token]
  (let [api (str "/repositories/" (:username registry))]
    (get registry api {} (jwt-auth token))))

(defn dockerhub-repositories
  [registry query page]
