diff --git a/tests/templates/kuttl/opa-authorization/trino_policies.rego b/tests/templates/kuttl/opa-authorization/trino_policies.rego index cd741138..b5cdc2f3 100644 --- a/tests/templates/kuttl/opa-authorization/trino_policies.rego +++ b/tests/templates/kuttl/opa-authorization/trino_policies.rego @@ -288,16 +288,4 @@ policies := { }], } -extra_groups := groups if { - request := { - "method": "POST", - "url": "http://127.0.0.1:9476/user", - "headers": {"Content-Type": "application/json"}, - "body": {"username": input.context.identity.user}, - } - response := http.send(request) - - response.status_code == 200 - - groups := response.body.groups -} +extra_groups := data.stackable.opa.userinfo.v1.userInfoByUsername(input.context.identity.user).groups diff --git a/tests/templates/kuttl/opa-authorization/trino_rules/actual_permissions.rego b/tests/templates/kuttl/opa-authorization/trino_rules/actual_permissions.rego index 110ca302..5ce26245 100644 --- a/tests/templates/kuttl/opa-authorization/trino_rules/actual_permissions.rego +++ b/tests/templates/kuttl/opa-authorization/trino_rules/actual_permissions.rego @@ -27,17 +27,7 @@ identity := input.context.identity # Example: # package trino_policies # import rego.v1 -# extra_groups := groups if { -# request := { -# "method": "POST", -# "url": "http://127.0.0.1:9476/user", -# "headers": {"Content-Type": "application/json"}, -# "body": {"username": input.context.identity.user}, -# } -# response := http.send(request) -# response.status_code == 200 -# groups := response.body.groups -# } +# extra_groups := data.stackable.opa.userinfo.v1.userInfoByUsername(input.context.identity.user).groups default extra_groups := [] extra_groups := data.trino_policies.extra_groups