yada

ThadIsNOTFood 2017-09-28T06:03:42.000163Z

okay I am totally lost. I have from Google

clientId:"<http://xxxapps.googleusercontent.com|xxxapps.googleusercontent.com>"
code:"yyy"
redirectUri:"<http://something/auth/google>"
state:"zzzz"
what do I do with it now?

dominicm 2017-09-28T06:06:16.000084Z

Pro tip, yada has oauth support (which probably works with Google)

ThadIsNOTFood 2017-09-28T06:06:39.000047Z

yeah the documents are a bit sparse in that area šŸ˜ž

dominicm 2017-09-28T06:08:39.000034Z

A little bit of reading the source, you set the authentication scheme to oauth, and the options are specified in that function (kinda)

dominicm 2017-09-28T06:09:31.000165Z

There's even an Google oauth 2 callback resource for use

ThadIsNOTFood 2017-09-28T06:12:57.000086Z

yeah, I'm really feeling this is much simpler than I am making it out to be. I'm sure I am over thinking it.

ThadIsNOTFood 2017-09-28T06:17:25.000009Z

["/auth/google" (yada/as-resource oauth/oauth2-callback-resource-google)]?

dominicm 2017-09-28T06:22:35.000129Z

The Google resource is a function which returns a resorted

dominicm 2017-09-28T06:22:38.000091Z

Resource

ThadIsNOTFood 2017-09-28T06:25:57.000245Z

["/auth/google" (oauth/oauth2-callback-resource-google :response)]?

dominicm 2017-09-28T06:59:13.000068Z

It needs these options in a map: :access-token-url s/Str :client-id s/Str :client-secret s/Str :secret s/Str :redirect-uri s/Keyword ;; The function that will ultimately call the third-party API for user-details. ;; First argument is the access-token :handler (s/=> {s/Any s/Any} {:access-token s/Str :openid-claims {s/Str s/Str}})

macroz 2017-09-28T08:33:19.000366Z

I'm trying to get header parameters to work with yada. One thing is that they seem to be case insensitive. The other is that if I declare a header parameter such as

{:parameters {:header {:foo String}}}
Then no matter if I provide foo or not I get various error messages saying that it is missing. Perhaps I'm doing something wrong. This makes no difference either.
{:parameters {:header {"foo" String}}}

macroz 2017-09-28T08:35:10.000401Z

the error is a variation of

{:status 400,
 :errors ([:header {:error {:foo missing-required-key}}])}
and
More than one non-optional/required key schemata: ["foo" java.lang.String]

macroz 2017-09-28T08:36:18.000124Z

this is not covered in detail in the docs

danielcompton 2017-09-28T08:37:25.000124Z

@macroz this caught me too

danielcompton 2017-09-28T08:37:29.000272Z

what you need is

danielcompton 2017-09-28T08:37:40.000067Z

{:header {(schema/required-key "x-orig-url") String}}

macroz 2017-09-28T08:40:18.000082Z

@danielcompton thanks a million!

danielcompton 2017-09-28T08:42:03.000214Z

np, happy to help

macroz 2017-09-28T09:53:46.000131Z

Is the best practice to match both /foos and /foos/ to use #{"" "/"}

macroz 2017-09-28T09:54:14.000438Z

that seems like a very common thing to have to do and it clutters my routes a bit

borkdude 2017-09-28T15:13:02.000142Z

Iā€™m trying out our yada app on clojure 1.9.0-beta1. I get an exception on aleph/http/multipart.clj line 30

malcolmsparks 2017-09-28T15:51:13.000430Z

@borkdude thanks for reporting

borkdude 2017-09-28T15:51:38.000545Z

Upgrading aleph to the newest stable solves it