Skip to content
This repository was archived by the owner on Sep 19, 2024. It is now read-only.

Commit ec0d789

Browse files
committed
update rule structure
1 parent 2b67409 commit ec0d789

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

opa.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,9 @@ opa_socket_context parse_opa_socket_eval_result(char *json)
377377
ret.allowed = true;
378378
ret.passthrough = false;
379379

380-
JSON_Array *allowed_spiffe_ids = json_object_dotget_array(matched_policy, "egress.policy.spiffeID");
380+
JSON_Array *allowed_spiffe_ids = json_object_dotget_array(matched_policy, "egress.policy.allowedSPIFFEIDs");
381381
if (allowed_spiffe_ids == NULL)
382-
allowed_spiffe_ids = json_object_dotget_array(matched_policy, "policy.spiffeID");
382+
allowed_spiffe_ids = json_object_dotget_array(matched_policy, "policy.allowedSPIFFEIDs");
383383
if (allowed_spiffe_ids != NULL)
384384
{
385385
ret.allowed_spiffe_ids_length = json_array_get_count(allowed_spiffe_ids);
@@ -389,17 +389,17 @@ opa_socket_context parse_opa_socket_eval_result(char *json)
389389
}
390390
}
391391

392-
int mtls = json_object_dotget_boolean(matched_policy, "egress.properties.mtls");
392+
int mtls = json_object_dotget_boolean(matched_policy, "egress.policy.mtls");
393393
if (mtls == -1)
394-
mtls = json_object_dotget_boolean(matched_policy, "properties.mtls");
394+
mtls = json_object_dotget_boolean(matched_policy, "policy.mtls");
395395
if (mtls == 0)
396396
ret.mtls = false;
397397
else if (mtls == 1)
398398
ret.mtls = true;
399399

400-
int passthrough = json_object_dotget_boolean(matched_policy, "egress.properties.passthrough");
400+
int passthrough = json_object_dotget_boolean(matched_policy, "egress.policy.passthrough");
401401
if (passthrough == -1)
402-
passthrough = json_object_dotget_boolean(matched_policy, "properties.passthrough");
402+
passthrough = json_object_dotget_boolean(matched_policy, "policy.passthrough");
403403
if (passthrough == 0)
404404
ret.passthrough = false;
405405
else if (passthrough == 1)

0 commit comments

Comments
 (0)