fix path authorizer give no opinion on resource requests (#1981)

This commit is contained in:
zryfish
2020-04-01 17:41:50 +08:00
committed by GitHub
parent c8dc3a4044
commit 3c73471f79
4 changed files with 15 additions and 19 deletions

View File

@@ -47,10 +47,6 @@ func NewAuthorizer(alwaysAllowPaths []string) (authorizer.Authorizer, error) {
}
return authorizer.AuthorizerFunc(func(a authorizer.Attributes) (authorizer.Decision, string, error) {
if a.IsResourceRequest() {
return authorizer.DecisionNoOpinion, "", nil
}
pth := strings.TrimPrefix(a.GetPath(), "/")
if paths.Has(pth) {
return authorizer.DecisionAllow, "", nil