-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
1,557 additions
and
381 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{ | ||
http_port 8080 | ||
https_port 8443 | ||
debug | ||
|
||
order authenticate before respond | ||
order authorize before basicauth | ||
order xrss last | ||
|
||
security { | ||
oauth identity provider github {env.GITHUB_CLIENT_ID} {env.GITHUB_CLIENT_SECRET} | ||
|
||
authentication portal myportal { | ||
crypto default token lifetime 3600 | ||
crypto key sign-verify {env.JWT_SHARED_KEY} | ||
cookie domain apps.localhost | ||
enable identity provider github | ||
ui { | ||
links { | ||
"My Identity" "/whoami" icon "las la-user" | ||
} | ||
} | ||
|
||
transform user { | ||
match realm github | ||
action add role authp/user | ||
ui link "XRss" https://xrss.apps.localhost:8443/ icon "las la-star" | ||
} | ||
|
||
transform user { | ||
match realm github | ||
match sub github.com/infogulch | ||
action add role authp/admin | ||
} | ||
} | ||
|
||
authorization policy mypolicy { | ||
set auth url https://auth.apps.localhost:8443/oauth2/github | ||
crypto key verify {env.JWT_SHARED_KEY} | ||
allow roles authp/admin authp/user | ||
validate bearer header | ||
inject headers with claims | ||
} | ||
} | ||
} | ||
|
||
(tls_config) { | ||
tls {$HOME}/.local/caddy/server.crt {$HOME}/.local/caddy/server.key | ||
} | ||
|
||
auth.apps.localhost { | ||
import tls_config | ||
authenticate with myportal | ||
} | ||
|
||
xrss.apps.localhost { | ||
import tls_config | ||
authorize with mypolicy | ||
xrss | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.