Skip to content

Commit

Permalink
chore: Use UIF rego rule wrapper in tests (#635)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernauer committed Aug 27, 2024
1 parent b0c4ed0 commit 4151013
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
14 changes: 1 addition & 13 deletions tests/templates/kuttl/opa-authorization/trino_policies.rego
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4151013

Please sign in to comment.