diff --git a/kubernetes/opa/registry/policies.rego b/kubernetes/opa/registry/policies.rego index 00beec49dff7a268bb25c135eb15f499c3769817..1a3a96267ecc37dd56230f2fa7cd4ed917514630 100644 --- a/kubernetes/opa/registry/policies.rego +++ b/kubernetes/opa/registry/policies.rego @@ -54,5 +54,5 @@ searchRCCertificate { # Retrieve public key API getRCPublicKey { - http_request.method == "POST" + http_request.method in ["POST", "GET"] } \ No newline at end of file diff --git a/kubernetes/opa/registry/policies_test.rego b/kubernetes/opa/registry/policies_test.rego index f8d88d5e65eefa8033e99cc20d1e30378bf68627..01bd3c7a32ba7507ed0012fb25d6f085632f6e77 100644 --- a/kubernetes/opa/registry/policies_test.rego +++ b/kubernetes/opa/registry/policies_test.rego @@ -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" + } + } + } + } } \ No newline at end of file