BTBurke / caddy-jwt

JWT middleware for the Caddy server
MIT License
114 stars 39 forks source link

jwt { ... } block just for specifying lists of paths #2

Closed mholt closed 8 years ago

mholt commented 8 years ago

Just going through the docs, and was thinking, that instead of doing:

jwt {
    path /path1
    path /path2
    path /path3
}

It might just be easier to do:

jwt /path1
jwt /path2
jwt /path3

Are these equivalent? Can we drop the first syntax in favor of the second one to keep things simpler? (If so, feel free to just update this repo; I will update the docs.)

BTBurke commented 8 years ago

@mholt good catch. I actually broke this when I added the allow and deny rules. This is now fixed. The way it should work is the way you outlined:

jwt /path1
jwt /path2
jwt {
   path /path3
   allow role admin
}

The block format should only have one path but can have multiple allow or deny rules. If you want me to fix the docs, let me know and I can make a quick change.

mholt commented 8 years ago

@BTBurke I'll take care of it and deploy tonight or tomorrow :+1: Thanks!

mholt commented 8 years ago

I have just deployed it. It's good to go!