Fork me on GitHub
#yada
<
2017-06-07
>
danielcompton01:06:32

@malcolmsparks I was thinking that being able to specify an interceptor chain in yada/listener could be good

danielcompton01:06:39

Not sure about the exact location/implementation, but having to walk the routes to e.g. add authentication on every resource gets a bit messy, especially if you've got lots of things to customise like CSP, or want to modify interceptor chain. But maybe that is the best way to do it

lmergen09:06:06

https://github.com/juxt/yada/blob/master/doc/interceptors.adoc is that documentation still accurate ? the interceptor helper functions have moved to yada.handler a long time ago, not ?

malcolmsparks12:06:24

Yes. Recently we made the decision to keep interceptors defined in the resource rather than handler.

malcolmsparks12:06:43

The docs need some work. I will merge the PR

lucasbradstreet18:06:43

Is it possible to turn off automatic serialisation/deserialisation? We have to integrate with an tool that produces broken json (record per line), and need to work around it manually

lucasbradstreet19:06:48

Alternatively, if I can just use a ring handler with my yada server/bidi routes as is, that'd be nice

lucasbradstreet21:06:40

Maybe the right way is to replace whatever interceptor does the deserialisation

dominicm21:06:56

@lucasbradstreet just for a single resource, or globally? There's a multi-method that handles json deserialization

lucasbradstreet21:06:30

@dominicm for a single resource

dominicm22:06:24

@lucasbradstreet probably gotta remove the interceptor, yeah. Nothing built in to yada. But that does surprise me.

dominicm22:06:59

Actually, I lied

dominicm22:06:27

It looks like you can define a :consumer key, which will be used in place 🙂

lucasbradstreet22:06:41

Awesome, that appears to be working!

lucasbradstreet22:06:37

Hmm maybe not. Will figure it out.