 
 (defprotocol HttpRequestAuthenticator
   ;; Return a map, potentially containing entries to be merged with the request.
-  (allowed-request? [_ request]))
+  (authenticate-request [_ request]))
 
 (extend-protocol HttpRequestAuthenticator
   Boolean
-  (allowed-request? [this request]
+  (authenticate-request [this request]
     (when this {})))
 
 (defprotocol UserAuthenticator

that authentication fails."
  ([h authenticator failure-handler]
     (fn [req]
       (let [auth (allowed-request? authenticator req)]
         (cond auth (h (merge req auth))
               failure-handler (failed-authentication failure-handler req)
               ;; Continue without merging auth


(defrecord HttpBasicRequestAuthenticator [user-authenticator user-roles]
  HttpRequestAuthenticator
  (authenticate-request [_ request]
    (when-let [auth (get-in request [:headers "authorization"])]
      (when-let [basic-creds (second (re-matches #"\QBasic\E\s+(.*)" auth))]
        (let [[username password] (->> (String. (DatatypeConverter/parseBase64Binary basic-creds) "UTF-8")
