Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Dominic Monroe
    @SevereOverfl0w
    We haven't at JUXT
    Sameer Rahmani
    @lxsameer
    do you guys have any oauth service ?
    Dominic Monroe
    @SevereOverfl0w
    Yada has oauth built in, but it's undocumented.
    Sameer Rahmani
    @lxsameer
    oauth2 ?
    Dominic Monroe
    @SevereOverfl0w
    Yeah
    Sameer Rahmani
    @lxsameer
    cool, is it reliable ? I mean did any one use it before ?
    Dominic Monroe
    @SevereOverfl0w
    We have used it ourselves a lot
    On client projects and our own website.
    Sameer Rahmani
    @lxsameer
    cool. thanks man so it is reliable
    Dominic Monroe
    @SevereOverfl0w
    I would feel comfortable introducing it into a client project.
    Sameer Rahmani
    @lxsameer
    nice, I'll try to read the code then ?
    Dominic Monroe
    @SevereOverfl0w
    I'm afraid that's the best option, sorry.
    Pratik Pai
    @pratikpai_gitlab
    Hi folks, I was looking for examples/references for creating a yada resource that consumes multipart/form-data. The resource is intended to take in few form fields along with a field "files" that would contain multiple files. I know a way of doing it via multiple parameters like file1,file2 etc. However I want to do it using a single field.
    Eugene Pakhomov
    @p-himik
    @pratikpai_gitlab I'm afraid It's not possible at the moment: juxt/yada#277
    You may also be interested in this: juxt/yada#291
    Tyler Hoppe
    @leguma
    It is possible, I just did it. :D
    Ya' just have to write a query that pulls all the parts that match a condition instead of just the first.
    But I'm running into a super-bizarre issue with multipart form parsing. With seemingly arbitrary combinations of file parts, yada seems to fail parsing the request body.
    ERROR [manifold-pool-2-41] manifold.stream.default : error in stream transformer
    Oddly, this error seems to occur with this file combination when the request is parsed correctly; when this error does not occur with this file combination, yada claims that the form body had nothing in it
    It's also intermittent locally, maybe half the time it throws the above error and gets a filled-out context. The rest of the time, the context is empty, throwing validation errors due to missing required fields.
    Tyler Hoppe
    @leguma
    For reference of how to do the aforementioned multiple-files-per-entry, here's an example with a starts-with predicate:
    (defn- find-parts
      "Find parts by Content-Disposition name parameter that start with the given String"
      [ctx name]
      (some->> ctx
               :yada.multipart/parts
               (filter (fn [part] (s/starts-with? (get-in part [:content-disposition :params "name"]) name)))))
    Tyler Hoppe
    @leguma
    ^ That works for any combination of file entries. So you could lump a bunch of files under a single entry, a bunch under different entries with the same name, or a combo thereof.
    I suspect that's due to multiple files in a given entry being equivalently serialized as separate entries with the same field. Shrug
    juxt/yada#291 Seems to be the issue I'm encountering, though.
    Eugene Pakhomov
    @p-himik
    @leguma Yeah, you're right. Now I'm not sure how I missed that. Although IMO it still should be a less involved procedure. I'll add your function as a workaround to the issue.
    But why s/starts-with? instead of just =? Won't it cause any issues with parts names like part and part2?
    Eugene Pakhomov
    @p-himik
    Also, yada itself filters parts by (= (:type part) :part) but it seems to be redundant.
    Tyler Hoppe
    @leguma
    I just used starts-with? as an example. :)
    It made sense for my use case. Modify to your liking.
    Tyler Hoppe
    @leguma
    For me, I wanted to grab everything starting with "file", such as "file[0]" or "files" etc. It returns a collection, which is what I wanted. You can modify the above to take a predicate or something to pass into the filter eval if you want something flexible
    Tyler Hoppe
    @leguma
    Blech. This multipart issue is killing me. I'm proxying a multipart call (with some transformation) to another yada multipart endpoint, so the chance of it failing on request body parsing is exponential. The more files, the more likely it is to occur. It appears that if files appear in a certain order, it happens more or less. I'll try to figure out a pattern today
    Tyler Hoppe
    @leguma
    juxt/yada#291 Should be pretty easy to reproduce, if you play around with files of different sizes. I'll put my ad hoc test results there to assist reproduction, just in case.
    Eugene Pakhomov
    @p-himik
    @leguma I just answered on GitHub. It's pretty easy to apply the fix outlined there within your own project.
    Tyler Hoppe
    @leguma
    Thanks! Do ya' have plans to submit a PR?
    Eugene Pakhomov
    @p-himik
    @leguma Initially I wanted to, but I couldn't come up with a reliable test case.
    Tyler Hoppe
    @leguma
    @p-himik I went ahead and submitted a PR for this: juxt/yada#303
    It's against 1.2, assuming they've got some sort of merge-forward strategy to take care of the rest
    geraldodev
    @geraldodev
    regarding the yada version to use on a starting project in development phase. which version to use ? 1.4.0-alpha-1 1.3.0-alpha-12 ?
    Malcolm Sparks
    @malcolmsparks
    I recommend staying on 1.2 until we announce the resolution of our authentication/authorization planning work
    Gaurav Rampal
    @r4mp4l
    Hi,

    Im trying to learn clojure & make a web app so I thought I'd use Yada. However, the instructions fail when I try to run:

    git clone https://github.com/juxt/edge
    cd edge/app

    There is no directory called app.

    Would anyone be able to help me with this?

    Eugene Pakhomov
    @p-himik
    @r4mp4l Hi. The Yada's manual is not up to date with the current version ofEdge. Use this: https://juxt.pro/edge/docs/setup.html
    Also note that Yada/Edge might be a bit too much for a Clojure novice, so continue at your own discretion.
    Gaurav Rampal
    @r4mp4l
    thank you
    Gaurav Rampal
    @r4mp4l
    @p-himik what is the best tool-chain for a novice please ? Getting that right is taking a lot of time.
    Eugene Pakhomov
    @p-himik
    @r4mp4l To be honest, I have no idea. After a quick search, I think I'd first look at one of these:
    http://pedestal.io/
    http://www.luminusweb.net/
    https://coastonclojure.com/
    See the examples and the guides on the corresponding websites, choose what you like best and experiment.
    Note that I tried to look for frameworks. If you're not comfortable with frameworks and want instead just a simple web server, your best starting point is probably Ring: https://github.com/ring-clojure/ring
    Gaurav Rampal
    @r4mp4l
    Thank you very much
    Mark Addleman
    @markaddleman_twitter
    Hey folks - Does yada support using clojure.spec to define APIs? After quickly looking at the source, it looks like only Schema is supported
    Eugene Pakhomov
    @p-himik
    @markaddleman_twitter I think that's correct - prismatic/schema is used everywhere and I don't see any way to use your own coercers.
    Mark Addleman
    @markaddleman_twitter
    @p-himik THanks
    Paul Iannazzo
    @boxxxie
    I'm making heavy use of mulitpart form encoded requests. I noticed there are many open issues for the mulitpart code. is there an easy way to swap out the mulitpart parser for something else?