Skip to content

Commit

Permalink
fix: SB-29941 allow GET methods on public key retrieval API (project-…
Browse files Browse the repository at this point in the history
  • Loading branch information
beepdot authored May 16, 2022
1 parent 00c331b commit d46bd45
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion kubernetes/opa/registry/policies.rego
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ searchRCCertificate {

# Retrieve public key API
getRCPublicKey {
http_request.method == "POST"
http_request.method in ["POST", "GET"]
}
17 changes: 17 additions & 0 deletions kubernetes/opa/registry/policies_test.rego
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,21 @@ test_rc_certificate_search_public_key {
"filter": {}
}
}
}

test_rc_certificate_get_public_key {
data.main.allow.allowed
with data.common.current_time as current_time
with data.common.iss as iss
with input as
{
"attributes": {
"request": {
"http": {
"path": "/api/v1/PublicKey/search/1-ab8bb63e-d4f2-11ec-9a7d-07cc64ac49c1",
"method": "GET"
}
}
}
}
}

0 comments on commit d46bd45

Please sign in to comment.