Fork me on GitHub
#yada
<
2017-10-09
>
akiroz03:10:59

hi guys, how can I handle authentication using JWT in a HTTP header? I've taken a little dive into the source code and tried providing a custom :verify handler in the :access-control map but got a cryptic error about not being able to create the resource, something like :error :access-control :realm "default" not (namespace :verify) (don't remember which bracket goes where)

danielcompton07:10:33

It means that you're trying to put the verify function at the wrong level

danielcompton07:10:49

yada only expects a certain set of unqualified keywords at each level of the map

danielcompton07:10:14

you'll need to show the full error, also helpful is to show the ex-data for the exception

danielcompton08:10:32

Am I looking at :exists? correctly in the issue above, or am I misunderstanding what it's for?

malcolmsparks09:10:50

It is for allowing properties to sat that a resource doesn't exist so the response fn doesn't need to be called at.

malcolmsparks09:10:11

A PUT to a resource that doesn't exist is quite valid.

malcolmsparks09:10:30

But a GET would be 404

malcolmsparks09:10:43

Depends on the method's semantics

danielcompton09:10:18

So if I want to return 404 to a PUT, then I need to return it myself?

malcolmsparks09:10:22

Yada can't know what your intent is.

malcolmsparks09:10:00

It has to call your response function when the semantics of the method are undefined.