From 77784a82529fadbc629e2b68c8eb71ecf8d31f5d Mon Sep 17 00:00:00 2001 From: Bailin He Date: Tue, 7 May 2024 20:44:44 +0000 Subject: [PATCH] fix typo Signed-off-by: Bailin He --- internal/query/example_policy_test.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/internal/query/example_policy_test.go b/internal/query/example_policy_test.go index 8723c354..3446c611 100644 --- a/internal/query/example_policy_test.go +++ b/internal/query/example_policy_test.go @@ -102,9 +102,9 @@ func TestExamplePolicy(t *testing.T) { } // users - superuser := types.Resource{Type: "user", ID: "idntusr-superuser"} - haroldadmin := types.Resource{Type: "user", ID: "idntusr-harold-admin"} - theotheradmin := types.Resource{Type: "user", ID: "idntusr-the-other-admin"} + superuser := types.Resource{Type: "user", ID: gidx.PrefixedID("idntusr-superuser")} + haroldadmin := types.Resource{Type: "user", ID: gidx.PrefixedID("idntusr-harold-admin")} + theotheradmin := types.Resource{Type: "user", ID: gidx.PrefixedID("idntusr-the-other-admin")} // tenants tnnttenroot := types.Resource{Type: "tenant", ID: gidx.PrefixedID("tnntten-root")} @@ -114,11 +114,11 @@ func TestExamplePolicy(t *testing.T) { tnnttenc := types.Resource{Type: "tenant", ID: gidx.PrefixedID("tnntten-c")} // groups - groupadmin := types.Resource{Type: "group", ID: "idntgrp-admin"} - groupadminsubgroup := types.Resource{Type: "group", ID: "idntgrp-admin-subgroup"} + groupadmin := types.Resource{Type: "group", ID: gidx.PrefixedID("idntgrp-admin")} + groupadminsubgroup := types.Resource{Type: "group", ID: gidx.PrefixedID("idntgrp-admin-subgroup")} // resources - lbtesta := types.Resource{Type: "loadbalancer", ID: "loadbal-test-a"} + lbtesta := types.Resource{Type: "loadbalancer", ID: gidx.PrefixedID("loadbal-test-a")} // create hierarchical tenants and groups err = e.CreateRelationships(ctx, []types.Relationship{ @@ -240,7 +240,6 @@ func TestExamplePolicy(t *testing.T) { forbidden := iamactions allowed := lbactions - // the other admin has no permissions on tnntten-root for _, r := range res { for _, a := range allowed { err := e.checkPermission(ctx, &v1.CheckPermissionRequest{