Skip to content

Commit

Permalink
fix(kuttl): use bundled userinfo code
Browse files Browse the repository at this point in the history
  • Loading branch information
NickLarsenNZ committed Aug 13, 2024
1 parent cd3c31e commit 7c308cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions tests/templates/kuttl/aas-user-info/10-install-opa.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ commands:
test.rego: |
package test

userInfoByUsername(username) := http.send({"method": "POST", "url": "http://127.0.0.1:9476/user", "body": {"username": username}, "headers": {"Content-Type": "application/json"}, "raise_error": true}).body
userInfoById(id) := http.send({"method": "POST", "url": "http://127.0.0.1:9476/user", "body": {"id": id}, "headers": {"Content-Type": "application/json"}, "raise_error": true}).body
import data.stackable.opa.userinfo.v1 as userinfo

currentUserInfoByUsername := userInfoByUsername(input.username)
currentUserInfoById := userInfoById(input.id)
currentUserInfoByUsername := userinfo.userInfoByUsername(input.username)
currentUserInfoById := userinfo.userInfoById(input.id)
---
apiVersion: opa.stackable.tech/v1alpha1
kind: OpaCluster
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ commands:
test.rego: |
package test

userInfoByUsername(username) := http.send({"method": "POST", "url": "http://127.0.0.1:9476/user", "body": {"username": username}, "headers": {"Content-Type": "application/json"}, "raise_error": true}).body
userInfoById(id) := http.send({"method": "POST", "url": "http://127.0.0.1:9476/user", "body": {"id": id}, "headers": {"Content-Type": "application/json"}, "raise_error": true}).body
import data.stackable.opa.userinfo.v1 as userinfo

currentUserInfoByUsername := userInfoByUsername(input.username)
currentUserInfoById := userInfoById(input.id)
currentUserInfoByUsername := userinfo.userInfoByUsername(input.username)
currentUserInfoById := userinfo.userInfoById(input.id)
---
apiVersion: opa.stackable.tech/v1alpha1
kind: OpaCluster
Expand Down

0 comments on commit 7c308cc

Please sign in to comment.