                          (and (string? input) (re-find #".+\..+\..+" input)) :jws)))
 
 (defmethod str->badge :json [user input]
-  (let [content (json/read-str input :key-fn keyword)
+  (let [content (-> (json/read-str input :key-fn keyword) (dissoc :endorsement))
         kind (get-in content [:verify :type] (get-in content [:verification :type]))]
     (if (or (= kind "hosted") (= kind "HostedBadge"))
       (str->badge user (get-in content [:verify :url] (:id content))))))

                        :issuer_verified (s/enum 0 1)
                        :show_evidence   (s/enum 0 1)
                        :last_checked (s/maybe s/Int)
                        :old_id (s/maybe s/Int)})


(def valid-badge (s/validator UserBadge))

                                   http/json-get
                                   (get-endorsement (dec depth))))
                     (assoc-in e [:issuer :endorsement] [])))))))))

(defn- get-assertion-endorsement [assertion]
  (let [endorsement (:endorsement assertion)]
    (if (empty? endorsement)
      []
      (->> endorsement
           (map #(if (map? %) {:id nil
                               :external_id (:id %)
                               :user_badge_id nil
                               :issuer_id nil
                               :issuer_name (get-in % [:issuer :name] nil)
                               :issuer_url (get-in % [:issuer :id] nil)
                               :content (get-in % [:claim :endorsementComment])
                               :ctime (u/str->epoch (:issuedOn %))
                               :mtime (u/str->epoch (:issuedOn %))}

                   (http/json-get %)))
           (map (fn [e] {:id nil
                         :external_id (:id e)
                         :user_badge_id nil
                         :issuer_id nil
                         :issuer_name (get-in e [:issuer :name] nil)
                         :issuer_url (get-in e [:issuer :id] nil)
                         :content (get-in e [:claim :endorsementComment])
                         :ctime (u/str->epoch (:issuedOn e))
                         :mtime (u/str->epoch (:issuedOn e))}))))))

(defn- get-alignment [badge]
  (map (fn [a]
