yada

2019-10-16T13:03:18.012800Z

Do people use Yada in combination with AWS Cognito? (I think obtaining JWT tokens via Cognito using those tokens for Yada authentication)

2019-10-16T13:49:13.013100Z

ok I cannot find examples, but it looks rather simple

mccraigmccraig 2019-10-16T14:30:35.014100Z

we don't use cognito, but do use JWTs for yada auth ( with funcool/buddy ) - all very straightforward

2019-10-16T14:58:42.014400Z

@mccraigmccraig thanks for confirming that

raymcdermott 2019-10-16T15:07:19.015800Z

a question about versioning via Accept a la github API v3 https://developer.github.com/v3/#current-version

raymcdermott 2019-10-16T15:08:21.016700Z

I would like to use Yada to process something like Accept: application/vnd.funcky-api.v1+edn

raymcdermott 2019-10-16T15:10:38.018600Z

tbh we have an interceptor to retain raw payloads at the moment so I don't need yada to read the edn but just want to check whether there are any known issues with this approach - which is quite common in the API world

raymcdermott 2019-10-16T15:12:01.019200Z

I can just parse the header myself and put the parts back on the ctx

dominicm 2019-10-16T16:54:03.019600Z

I seem to recall adding support for that

raymcdermott 2019-10-16T16:56:07.020500Z

do you remember what the support offered? ie did it allow routing per version?

raymcdermott 2019-10-16T17:02:47.021500Z

or was it just adding the data to the context to allow for later interpretation (which is what I'm doing)

raymcdermott 2019-10-16T17:06:33.022600Z

I have added a map {:name api-name :version api-version :data-format api-data-format} under [:request :accept-data]

dominicm 2019-10-16T18:28:55.023600Z

It was making the parsing work for the spec of extension types

dominicm 2019-10-16T18:29:24.024200Z

Might have been a pull request that I reviewed, I don't think we merged it

malcolmsparks 2019-10-16T18:31:46.027200Z

I don't think you don't need suffix support. You just declare in yada the versions you are able to produce and in the Accept header the versions you can process. Content negotiation does the rest.

malcolmsparks 2019-10-16T18:33:26.027300Z

https://www.infoq.com/articles/roy-fielding-on-versioning/

dominicm 2019-10-16T18:53:40.028Z

Oh, missed that you already have something that reads the edn

raymcdermott 2019-10-16T20:00:07.028400Z

@malcolmsparks do you have an example?

raymcdermott 2019-10-16T20:31:23.030400Z

apart from 'application/edn' where can I specify that the consumer expects v1 or v2? or are you saying that a client should never express that?

malcolmsparks 2019-10-16T20:54:08.033300Z

Ah, I see. You'd offer to consume either of application/vnd. funcky-api.v1+edn and application/vnd.funcky-api.v2+edn.

malcolmsparks 2019-10-16T20:55:41.035400Z

A v2 api wouldn't necessarily be different routes, or it might. The routes would be contained in the representation of the initial response from /.

malcolmsparks 2019-10-16T20:56:00.036100Z

That representation would reflect its version.

malcolmsparks 2019-10-16T21:00:57.037900Z

That's a problem if clients code themselves against specific URLs, rather than generating those URLs in representations.

malcolmsparks 2019-10-16T21:04:42.043400Z

Which is why Swagger/OpenAPI isn't REST, which prioritises evolution of services on the web. However, in-house services, codeveloped along with their clients, can benefit from establishing the OpenAPI contract up-front. I think that's still a poor strategy long term - not much progress made since IDL really.

malcolmsparks 2019-10-16T21:05:25.044200Z

Because ultimately, even in-house services can last decades.

malcolmsparks 2019-10-16T21:06:03.045300Z

But today's culture is dominated by moving fast and building 'MVP's

malcolmsparks 2019-10-16T21:06:53.046400Z

Tomorrow's culture maybe more cautious and spend thrift

raymcdermott 2019-10-16T23:07:32.053500Z

the goal is mostly to express the fact that various clients in the wild will produce and consume v1 / v2 payloads without the need for out of band schemas so maybe the question is posed badly

raymcdermott 2019-10-16T23:11:25.055400Z

if we find a bug or a security problem with the encoding of data by v1 we need a way to tell the customers to upgrade the SDK to v2

raymcdermott 2019-10-16T23:12:18.056300Z

I'm happy to keep tending the sprawl on the back end 🙂