Fork me on GitHub

Edge now uses the @(promise) technique


What’s the state of using JWT for authentication? Seen sections in docs but not sure the functionality is there but no docs yet, or if it’s on the todo list.


Where is the yada.yada/path-for described in ? I only see uri-for in the namespace...


(And I don't want to use uri-for, because I would need to use vhost)


hey I am curious about :parameters :form I know a form can have multiple inputs but I am wondering about a single input that can be multiple e.g. :parameters {:form {:users [String]}} a long those lines?


nevermind, turns out that does just work


@frozenlock My answer probably wasn't clear enough. vhost conveniently provides a uri-for, and puts it into the ctx.


Anything which puts a :uri-for key into the ctx, that function will be called for you.


@kardan: there are some jwt examples under dev/src in the yada repo. It's all working and used in prod


@frozenlock: you have to use bidi's vhosts model to use yada/uri-for. Otherwise use bidi's path-for directly


malcolmsparks : does path-for support yada resource ID? (I think I tried it a few days ago without much success.)


I also understand that yada.path-for was removed in favor of uri-for.


@malcolmsparks perfect - then I’ll dig in. Thanks


@frozenlock It should do - are you wrapping your resources in yada/handler?


Ah no, that must be it. I was using yada


it shouldn't matter - you should be able to put in resources in your bidi structure, or wrap them in yada/handler -both cases should work


It does seem to work with a minimal example... 😕 --- edit: I was wrong, I can't get it to work.


What is the advantage of using vhosts over simply looking the scheme and host in the ctx?


I had asked in the datomic channel but thought I’d ask here too hey guys I’ve this query

(defn mult-lookup-user [db phones]
  (let [result (d/q '[:find ?e ?phone
                      :in $ [?phone ...]
                      :where [?e :user/phone ?phone]] db phones)]
    (map second result)))

(mult-lookup-user (d/db connect) ["0862561423" "0877654321"])
where it will return only existing phones, and running it standalone works perfectly but my issues is using with a yada resource, the important section below
{:post {:parameters {:form {:users [String]}
                                  :body [String]}
            :consumes  #{"application/json" "application/x-www-form-urlencoded;q=0.9"}
            :produces   #{"application/json" "application/edn"}
            :response   (fn [ctx]
                                    (let [users (or (get-in ctx [:parameters :body])
                                                           (get-in ctx [:parameters :form :users]))]
                                          (when-let [valid-users (mult-lookup-user (d/db connect) users)]
                                                (println "valid" valid-users)
                                                (if (seq? valid-users)
                                                    (json/generate-string valid-users)))))}}
using the same input as when called standalone returns an empty list, but if I include just one value (valid of course) it returns that singular result. Can any help explain this issue?


not sure if it was an error or mistake on my behalf but discovered that doing {:form {:users [String]}} causes an array of input to be transformed into array with a singular value of all the values joined. but the solution was to (str/split (first users) #",”)