From 877fe5fb0a3d3c0069da98e1ec50191d15388175 Mon Sep 17 00:00:00 2001 From: Ben Toogood Date: Fri, 22 May 2020 14:02:02 +0100 Subject: [PATCH] Update web wildcard to enable /foo/bar/baz/* to verify /foo/bar/baz --- auth/rules/rules.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth/rules/rules.go b/auth/rules/rules.go index 95d75904..b6bc0b65 100644 --- a/auth/rules/rules.go +++ b/auth/rules/rules.go @@ -22,7 +22,7 @@ func Verify(rules []*auth.Rule, acc *auth.Account, res *auth.Resource) error { // e.g. /foo/* would include /foo/bar. We also want to check for wildcards and the exact endpoint validEndpoints := []string{"*", res.Endpoint} if comps := strings.Split(res.Endpoint, "/"); len(comps) > 1 { - for i := 1; i < len(comps); i++ { + for i := 1; i < len(comps)+1; i++ { wildcard := fmt.Sprintf("%v/*", strings.Join(comps[0:i], "/")) validEndpoints = append(validEndpoints, wildcard) }