 
 (defrecord MapBackedUserRegistry [m]
   UserAuthenticator
-  (allowed-user? [_ user password]
+  (authenticate-user [_ user password]
     ((set (seq m)) [user password])))
 
 (defn new-map-backed-user-registry [m]

    (when this {})))

(defprotocol UserAuthenticator
  (allowed-user? [_ user password]))

(extend-protocol UserAuthenticator
  Boolean
  (allowed-user? [this user password] this))

(def PASSWORD_HASH_ALGO "PBKDF2WithHmacSHA1")



    (if (and username
             (not-empty username)
             (authenticate-user user-authenticator (.trim username) password))

      {:status 302
       :headers {"Location" (or requested-uri "/")} ; "/" can be parameterized (TODO)
