mirror of
https://github.com/argoproj/argo-cd
synced 2026-05-24 01:38:43 +00:00
parent
bfe05e4755
commit
cbe94440df
3 changed files with 3 additions and 1 deletions
|
|
@ -58,6 +58,7 @@ dep ensure
|
|||
make dev-tools-image
|
||||
make install-lint-tools
|
||||
go get github.com/mattn/goreman
|
||||
go get github.com/jstemmer/go-junit-report
|
||||
```
|
||||
|
||||
Common make targets:
|
||||
|
|
|
|||
|
|
@ -1374,7 +1374,7 @@ func validatePolicy(proj string, role string, policy string) error {
|
|||
}
|
||||
// object
|
||||
object := strings.Trim(policyComponents[4], " ")
|
||||
objectRegexp, err := regexp.Compile(fmt.Sprintf(`^%s/[*\w-]+$`, proj))
|
||||
objectRegexp, err := regexp.Compile(fmt.Sprintf(`^%s/[*\w-.]+$`, proj))
|
||||
if err != nil || !objectRegexp.MatchString(object) {
|
||||
return status.Errorf(codes.InvalidArgument, "invalid policy rule '%s': object must be of form '%s/*' or '%s/<APPNAME>', not '%s'", policy, proj, proj, object)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -305,6 +305,7 @@ func TestAppProject_ValidPolicyRules(t *testing.T) {
|
|||
"p, proj:my-proj:my-role, applications, get, my-proj/*-foo, allow",
|
||||
"p, proj:my-proj:my-role, applications, get, my-proj/foo-*, allow",
|
||||
"p, proj:my-proj:my-role, applications, get, my-proj/*-*, allow",
|
||||
"p, proj:my-proj:my-role, applications, get, my-proj/*.*, allow",
|
||||
"p, proj:my-proj:my-role, applications, *, my-proj/foo, allow",
|
||||
"p, proj:my-proj:my-role, applications, create, my-proj/foo, allow",
|
||||
"p, proj:my-proj:my-role, applications, update, my-proj/foo, allow",
|
||||
|
|
|
|||
Loading…
Reference in a new issue