Swap id field in grants to ids since that's now standardized (#4250)
* Swap id field in grants to ids since that's now standardized * Fix some tests I missed * Update generated resource table
This commit is contained in:
1 parent
962f9bd638
commit
253d79116c
43 files changed
+392
-392
No files matched your search
@@ -50,9 +50,9 @@ func TestFetchActionSetForId(t *testing.T) {
|
||||
|
||||
orgRole := iam.TestRole(t, conn, org.GetPublicId())
|
||||
iam.TestUserRole(t, conn, orgRole.PublicId, token.UserId)
|
||||
iam.TestRoleGrant(t, conn, orgRole.PublicId, "id=ttcp_foo;actions=read,update")
|
||||
iam.TestRoleGrant(t, conn, orgRole.PublicId, "id=ttcp_bar;actions=read,update,delete,authorize-session")
|
||||
iam.TestRoleGrant(t, conn, orgRole.PublicId, "id=*;type=role;actions=add-grants,remove-grants")
|
||||
iam.TestRoleGrant(t, conn, orgRole.PublicId, "ids=ttcp_foo;actions=read,update")
|
||||
iam.TestRoleGrant(t, conn, orgRole.PublicId, "ids=ttcp_bar;actions=read,update,delete,authorize-session")
|
||||
iam.TestRoleGrant(t, conn, orgRole.PublicId, "ids=*;type=role;actions=add-grants,remove-grants")
|
||||
|
||||
cases := []struct {
|
||||
name string
|
||||
@@ -137,7 +137,7 @@ func TestRecursiveListingDifferentOutputFields(t *testing.T) {
|
||||
globalRole := iam.TestRole(t, conn, scope.Global.String())
|
||||
iam.TestUserRole(t, conn, globalRole.PublicId, token.UserId)
|
||||
iam.TestUserRole(t, conn, globalRole.PublicId, globals.AnonymousUserId)
|
||||
iam.TestRoleGrant(t, conn, globalRole.PublicId, "id=*;type=auth-method;actions=list,no-op")
|
||||
iam.TestRoleGrant(t, conn, globalRole.PublicId, "ids=*;type=auth-method;actions=list,no-op")
|
||||
|
||||
// Create some users at the org level, and some role grants for them
|
||||
org, _ := iam.TestScopes(t, tc.IamRepo(), iam.WithUserId(token.UserId), iam.WithSkipAdminRoleCreation(true), iam.WithSkipDefaultRoleCreation(true))
|
||||
@@ -152,10 +152,10 @@ func TestRecursiveListingDifferentOutputFields(t *testing.T) {
|
||||
// list to return anything, those grants allow us to list the items, while
|
||||
// also verifying that those output fields don't take effect for the wrong
|
||||
// action.
|
||||
iam.TestRoleGrant(t, conn, orgRole.PublicId, fmt.Sprintf("id=%s;actions=read;output_fields=id,version", orgAm1.GetPublicId()))
|
||||
iam.TestRoleGrant(t, conn, orgRole.PublicId, fmt.Sprintf("id=%s;actions=read;output_fields=description", orgAm2.GetPublicId()))
|
||||
iam.TestRoleGrant(t, conn, orgRole.PublicId, "id=*;type=auth-method;output_fields=name")
|
||||
iam.TestRoleGrant(t, conn, orgRole.PublicId, "id=*;type=auth-method;actions=list;output_fields=scope_id")
|
||||
iam.TestRoleGrant(t, conn, orgRole.PublicId, fmt.Sprintf("ids=%s;actions=read;output_fields=id,version", orgAm1.GetPublicId()))
|
||||
iam.TestRoleGrant(t, conn, orgRole.PublicId, fmt.Sprintf("ids=%s;actions=read;output_fields=description", orgAm2.GetPublicId()))
|
||||
iam.TestRoleGrant(t, conn, orgRole.PublicId, "ids=*;type=auth-method;output_fields=name")
|
||||
iam.TestRoleGrant(t, conn, orgRole.PublicId, "ids=*;type=auth-method;actions=list;output_fields=scope_id")
|
||||
|
||||
amClient := authmethods.NewClient(tc.Client())
|
||||
resp, err := amClient.List(tc.Context(), scope.Global.String(), authmethods.WithRecursive(true))
|
||||
@@ -250,8 +250,8 @@ func TestSelfReadingDifferentOutputFields(t *testing.T) {
|
||||
orgRole := iam.TestRole(t, conn, org.GetPublicId())
|
||||
iam.TestUserRole(t, conn, orgRole.PublicId, user1.GetPublicId())
|
||||
iam.TestUserRole(t, conn, orgRole.PublicId, user2.GetPublicId())
|
||||
iam.TestRoleGrant(t, conn, orgRole.PublicId, "id=*;type=auth-token;actions=read:self;output_fields=account_id")
|
||||
iam.TestRoleGrant(t, conn, orgRole.PublicId, "id=*;type=auth-token;actions=read;output_fields=id,scope_id")
|
||||
iam.TestRoleGrant(t, conn, orgRole.PublicId, "ids=*;type=auth-token;actions=read:self;output_fields=account_id")
|
||||
iam.TestRoleGrant(t, conn, orgRole.PublicId, "ids=*;type=auth-token;actions=read;output_fields=id,scope_id")
|
||||
|
||||
cases := []struct {
|
||||
name string
|
||||
|
||||
@@ -28,7 +28,7 @@ func TestLdapManagedGroupRoleGrants(t *testing.T) {
|
||||
testGrpName2 = "testUserGrp"
|
||||
testLdapUrl = "ldap://test.ldap"
|
||||
testLoginName = "test-user"
|
||||
testGrant = "id=*;type=*;actions=*"
|
||||
testGrant = "ids=*;type=*;actions=*"
|
||||
testClientId = "alice-rp"
|
||||
testClientSecret = "fido"
|
||||
testIssuer = "https://www.alice.com"
|
||||
|
||||
Reference in new issue
Block a user