1
0
mirror of https://github.com/greenpau/caddy-security.git synced 2025-04-18 08:04:02 +03:00

feature: enable additional scopes (#112)

Co-authored-by: Sergiu Cozma <sergiucozma1994@gmail.com>

Co-authored-by: Daniel Branco and Sergiu Cozma <daniel.branco@vw-dilab.com>
Co-authored-by: Sergiu Cozma <sergiucozma1994@gmail.com>
Co-authored-by: Paul Greenberg <greenpau@users.noreply.github.com>
This commit is contained in:
Sergiu Cozma 2022-05-25 16:00:47 +01:00 committed by GitHub
parent ecffdc9195
commit c741828ab7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -33,6 +33,8 @@ func parseCaddyfileAuthorizationMisc(h *caddyfile.Dispenser, repl *caddy.Replace
p.RedirectWithJavascript = true
case v == "strip token":
p.StripTokenEnabled = true
case v == "additional scopes":
p.AdditionalScopes = true
case strings.HasPrefix(v, "login hint"):
remainingArguments := strings.TrimPrefix(v, "login hint ")
switch {

View File

@ -166,6 +166,7 @@ func TestParseCaddyfileAuthorization(t *testing.T) {
enable js redirect
set auth url /auth
enable strip token
enable additional scopes
acl rule {
comment allow users
match role authp/user
@ -215,6 +216,7 @@ func TestParseCaddyfileAuthorization(t *testing.T) {
}
],
"strip_token_enabled": true,
"additional_scopes": true,
"user_identity_field": "id",
"pass_claims_with_headers": true,
"redirect_with_javascript": true,