diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 87435f5957..0c74f433ba 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -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: diff --git a/pkg/apis/application/v1alpha1/types.go b/pkg/apis/application/v1alpha1/types.go index 4a4a8a21e2..ba4958876a 100644 --- a/pkg/apis/application/v1alpha1/types.go +++ b/pkg/apis/application/v1alpha1/types.go @@ -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/', not '%s'", policy, proj, proj, object) } diff --git a/pkg/apis/application/v1alpha1/types_test.go b/pkg/apis/application/v1alpha1/types_test.go index ba3f802677..e8b24ebed0 100644 --- a/pkg/apis/application/v1alpha1/types_test.go +++ b/pkg/apis/application/v1alpha1/types_test.go @@ -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",