Mapping Caddy forward_auth groups to Otterwiki perms #348
freddyheppell
started this conversation in
Show and tell
Replies: 1 comment
|
Hey @freddyheppell, thanks for sharing this configuration! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I'm using Caddy's
forward_auth(with Authelia) in front of Otter Wiki. It's well documented by Caddy how to map the proxy auth headers to some other value (or indeed to change the headers Otter Wiki wants). The difficult part is transforming the groups header to a permissions header. It took me an annoyingly long time to figure it out but it's actually very simple in the end.In my case I just have an
adminsgroup which get all perms, and any other user gets read access.Warning
This is actually just checking if the user's group string includes admins anywhere in it, so if you have groups
adminsandotherkindofadmins, both will match. If this is a concern, you probably want a regex like(^|,)admins(,|$)instead but I haven't tested this myself.I also wasn't expecting to have to give admins
READ,WRITE,UPLOADas well but it 403s if you don't.Hopefully someone else finds this useful!
All reactions