   (context [this] (or
                    (first (keep #(when (satisfies? BidiRoutesContributor %) (context %))
                                 ((juxt :protector :user-password-authorizer :http-session-store) this)))
-                   "")))
+                   ""))
+  NewUserCreator
+  (add-user! [_ uid pw]
+    (if (satisfies? NewUserCreator user-password-authorizer)
+      (add-user! user-password-authorizer uid pw)
+      (throw (ex-info "This protection domain implementation does not support the creation of new users" {})))))
 
 (def new-default-protection-domain-schema
-  {(s/optional-key :session-timeout-in-seconds) s/Int
-   (s/optional-key :boilerplate) (s/=> 1)})
+  {:password-file s/Any
+   (s/optional-key :session-timeout-in-seconds) s/Int
+   (s/optional-key :boilerplate) (s/=> 1)
+   })
 
 (defn new-default-protection-domain [& {:as opts}]
   (s/validate new-default-protection-domain-schema opts)

(extend-protocol UserPasswordAuthorizer
  Boolean
  (authorized-user? [this user password] this))

(defprotocol FailedAuthorizationHandler
  (failed-authorization [_ request]))


(ns modular.entrance
  (:require
   [clojure.java.io :as io]
   [clojure.pprint :refer (pprint)]
   [bidi.bidi :as bidi :refer (path-for resolve-handler unresolve-handler ->WrapMiddleware)]
   [modular.bidi :as modbidi :refer (BidiRoutesContributor routes context)]
   [schema.core :as s]
