Skip to content

Commit 1556e05

Browse files
comments and consistent rego
1 parent c5fab52 commit 1556e05

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

rego/policies.rego

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ package policies
33
fromOrg (resp, orgs) if {
44
some i, j, k, l
55
orgUri := resp.responses[i][j][k].signature.certificate.sourceRepositoryOwnerURI
6+
# Prefix the org name with / before doing comparisson
67
endswith(orgUri, concat("", ["/", orgs[l]]))
78
}
89

910
fromRepo (resp, repos) if {
10-
some i
11-
uri := resp.responses[_][_][_].signature.certificate.sourceRepositoryURI
12-
endswith(uri, concat("", ["/", repos[i]]))
11+
some i, j, k, l
12+
uri := resp.responses[i][j][k].signature.certificate.sourceRepositoryURI
13+
# Prefix the repo name with / before doing comparisson
14+
endswith(uri, concat("", ["/", repos[l]]))
1315
}
1416

1517
fromOrgAndSignerRepo(resp, orgs, signerRepos) if {

validation/from-org-constraint-template.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,6 @@ spec:
3939
fromOrg(resp, orgs) {
4040
some i, j, k, l
4141
orgUri := resp.responses[i][j][k].signature.certificate.sourceRepositoryOwnerURI
42+
# Prefix the org name with / before doing comparisson
4243
endswith(orgUri, concat("", ["/", orgs[l]]))
4344
}

validation/from-repo-constraint-template.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ spec:
3737
}
3838
3939
fromRepo(resp, repos) {
40-
some i
41-
uri := resp.responses[_][_][_].signature.certificate.sourceRepositoryURI
42-
endswith(uri, concat("", ["/", repos[i]]))
40+
some i, j, k, l
41+
uri := resp.responses[i][j][k].signature.certificate.sourceRepositoryURI
42+
# Prefix the repo name with / before doing comparisson
43+
endswith(uri, concat("", ["/", repos[l]]))
4344
}

0 commit comments

Comments
 (0)