         out (chan)
         local-users {"user@mail.com" "P4ssw0rd"
                      "eve@mail.com" "lisp"
-                     "john" "satan"}
+                     "john" "haskell"}
         input-users {"user@mail.com" "P4ssw0rd"
                      "eve@mail.com" "lispo"
-                     "john" "satan"}
+                     "john" "haskell"}
         [new-in new-out] (auth (<!! (new-mem-store (atom
                                                     {"john" {42 {:id 42
                                                                  :causal-order {1 []}

    :meta-pub :meta-pub
    ::auth-required ::auth-required
    ::auth ::auth
    ::authed ::authed
    :unrelated))


(defn- out-dispatch [{:keys [topic]}]
  (case topic
    ::auth-required ::auth-required
    ::auth ::auth
    ::authed ::authed
    :unrelated))



  (let [new-in (chan)
        pub-ch (chan)
        auth-ch (chan)
        auth-req-ch (chan)
        sessions (atom {})
        p-in (pub in in-dispatch)]
    (sub p-in :meta-pub pub-ch)
    (meta-published pub-ch store trusted-hosts sessions [new-in out])

    (sub p-in ::auth-required auth-req-ch)
    (auth-required auth-req-ch auth-fn out)

    (sub p-in ::auth auth-ch)
    (authenticated auth-ch pub-ch credential-fn)

    (sub p-in :unrelated new-in)

    [new-in out]))

