diff --git a/tests/integration/acp/add_policy/basic_test.go b/tests/integration/acp/add_policy/basic_test.go index 1bf3cd48fa..48aa649f3b 100644 --- a/tests/integration/acp/add_policy/basic_test.go +++ b/tests/integration/acp/add_policy/basic_test.go @@ -23,7 +23,7 @@ func TestACP_AddPolicy_BasicYAML_ValidPolicyID(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -62,7 +62,7 @@ func TestACP_AddPolicy_BasicJSON_ValidPolicyID(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` { diff --git a/tests/integration/acp/add_policy/with_empty_args_test.go b/tests/integration/acp/add_policy/with_empty_args_test.go index 44de9aee4d..3c392117c7 100644 --- a/tests/integration/acp/add_policy/with_empty_args_test.go +++ b/tests/integration/acp/add_policy/with_empty_args_test.go @@ -23,7 +23,7 @@ func TestACP_AddPolicy_EmptyPolicyData_Error(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: "", diff --git a/tests/integration/acp/add_policy/with_extra_perms_and_relations_test.go b/tests/integration/acp/add_policy/with_extra_perms_and_relations_test.go index b86c0ad865..9bf36b88dd 100644 --- a/tests/integration/acp/add_policy/with_extra_perms_and_relations_test.go +++ b/tests/integration/acp/add_policy/with_extra_perms_and_relations_test.go @@ -23,7 +23,7 @@ func TestACP_AddPolicy_ExtraPermissionsAndExtraRelations_ValidPolicyID(t *testin Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test diff --git a/tests/integration/acp/add_policy/with_extra_perms_test.go b/tests/integration/acp/add_policy/with_extra_perms_test.go index f00d02d847..2de8d0da6a 100644 --- a/tests/integration/acp/add_policy/with_extra_perms_test.go +++ b/tests/integration/acp/add_policy/with_extra_perms_test.go @@ -23,7 +23,7 @@ func TestACP_AddPolicy_ExtraPermissions_ValidPolicyID(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: a policy @@ -63,7 +63,7 @@ func TestACP_AddPolicy_ExtraDuplicatePermissions_Error(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: a policy diff --git a/tests/integration/acp/add_policy/with_extra_relations_test.go b/tests/integration/acp/add_policy/with_extra_relations_test.go index 147584f151..36f7694e52 100644 --- a/tests/integration/acp/add_policy/with_extra_relations_test.go +++ b/tests/integration/acp/add_policy/with_extra_relations_test.go @@ -23,7 +23,7 @@ func TestACP_AddPolicy_ExtraRelations_ValidPolicyID(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: a policy @@ -67,7 +67,7 @@ func TestACP_AddPolicy_ExtraDuplicateRelations_Error(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: a policy diff --git a/tests/integration/acp/add_policy/with_invalid_relations_test.go b/tests/integration/acp/add_policy/with_invalid_relations_test.go index 8c6cdd25d9..09a26a4685 100644 --- a/tests/integration/acp/add_policy/with_invalid_relations_test.go +++ b/tests/integration/acp/add_policy/with_invalid_relations_test.go @@ -23,7 +23,7 @@ func TestACP_AddPolicy_NoRelations_Error(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: a policy @@ -58,7 +58,7 @@ func TestACP_AddPolicy_NoRelationsLabel_Error(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: a policy diff --git a/tests/integration/acp/add_policy/with_invalid_required_relation_test.go b/tests/integration/acp/add_policy/with_invalid_required_relation_test.go index ac600c7c14..12242298d4 100644 --- a/tests/integration/acp/add_policy/with_invalid_required_relation_test.go +++ b/tests/integration/acp/add_policy/with_invalid_required_relation_test.go @@ -23,7 +23,7 @@ func TestACP_AddPolicy_MissingRequiredOwnerRelation_Error(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: a policy @@ -61,7 +61,7 @@ func TestACP_AddPolicy_DuplicateOwnerRelation_Error(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: a policy diff --git a/tests/integration/acp/add_policy/with_invalid_resource_test.go b/tests/integration/acp/add_policy/with_invalid_resource_test.go index baa2671d70..1acf9cf8ca 100644 --- a/tests/integration/acp/add_policy/with_invalid_resource_test.go +++ b/tests/integration/acp/add_policy/with_invalid_resource_test.go @@ -23,7 +23,7 @@ func TestACP_AddPolicy_OneResourceThatIsEmpty_Error(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: a policy diff --git a/tests/integration/acp/add_policy/with_managed_relation_test.go b/tests/integration/acp/add_policy/with_managed_relation_test.go index 14a91522e6..a41a8713a3 100644 --- a/tests/integration/acp/add_policy/with_managed_relation_test.go +++ b/tests/integration/acp/add_policy/with_managed_relation_test.go @@ -22,7 +22,7 @@ func TestACP_AddPolicy_WithRelationManagingOtherRelation_ValidPolicyID(t *testin Description: "Test acp, where a relation is managing another relation, valid policy id", Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: a policy diff --git a/tests/integration/acp/add_policy/with_multi_policies_test.go b/tests/integration/acp/add_policy/with_multi_policies_test.go index 149bfc5cb9..4ca02aeb64 100644 --- a/tests/integration/acp/add_policy/with_multi_policies_test.go +++ b/tests/integration/acp/add_policy/with_multi_policies_test.go @@ -23,7 +23,7 @@ func TestACP_AddPolicy_AddMultipleDifferentPolicies_ValidPolicyIDs(t *testing.T) Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: a policy @@ -51,7 +51,7 @@ func TestACP_AddPolicy_AddMultipleDifferentPolicies_ValidPolicyIDs(t *testing.T) }, testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: a policy @@ -97,7 +97,7 @@ func TestACP_AddPolicy_AddMultipleDifferentPoliciesInDifferentFmts_ValidPolicyID Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` { @@ -132,7 +132,7 @@ func TestACP_AddPolicy_AddMultipleDifferentPoliciesInDifferentFmts_ValidPolicyID }, testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test2 @@ -199,7 +199,7 @@ func TestACP_AddPolicy_AddDuplicatePolicyByOtherCreator_ValidPolicyIDs(t *testin Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: policyUsedByBoth, @@ -207,7 +207,7 @@ func TestACP_AddPolicy_AddDuplicatePolicyByOtherCreator_ValidPolicyIDs(t *testin }, testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), Policy: policyUsedByBoth, @@ -226,7 +226,7 @@ func TestACP_AddPolicy_AddMultipleDuplicatePolicies_Error(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -254,7 +254,7 @@ func TestACP_AddPolicy_AddMultipleDuplicatePolicies_Error(t *testing.T) { }, testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -293,7 +293,7 @@ func TestACP_AddPolicy_AddMultipleDuplicatePoliciesDifferentFmts_ProducesDiffere Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -320,7 +320,7 @@ func TestACP_AddPolicy_AddMultipleDuplicatePoliciesDifferentFmts_ProducesDiffere }, testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` { diff --git a/tests/integration/acp/add_policy/with_multiple_resources_test.go b/tests/integration/acp/add_policy/with_multiple_resources_test.go index ade2511d60..161e2d27fb 100644 --- a/tests/integration/acp/add_policy/with_multiple_resources_test.go +++ b/tests/integration/acp/add_policy/with_multiple_resources_test.go @@ -23,7 +23,7 @@ func TestACP_AddPolicy_MultipleResources_ValidID(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -78,7 +78,7 @@ func TestACP_AddPolicy_MultipleResourcesUsingRelationDefinedInOther_Error(t *tes Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -130,7 +130,7 @@ func TestACP_AddPolicy_SecondResourcesMissingRequiredOwner_Error(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test diff --git a/tests/integration/acp/add_policy/with_no_perms_test.go b/tests/integration/acp/add_policy/with_no_perms_test.go index a77de7bdcc..57cec65ee7 100644 --- a/tests/integration/acp/add_policy/with_no_perms_test.go +++ b/tests/integration/acp/add_policy/with_no_perms_test.go @@ -31,7 +31,7 @@ func TestACP_AddPolicy_NoPermissionsOnlyOwner_ValidID(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -66,7 +66,7 @@ func TestACP_AddPolicy_NoPermissionsMultiRelations_ValidID(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -104,7 +104,7 @@ func TestACP_AddPolicy_NoPermissionsLabelOnlyOwner_ValidID(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -137,7 +137,7 @@ func TestACP_AddPolicy_NoPermissionsLabelMultiRelations_ValidID(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test diff --git a/tests/integration/acp/add_policy/with_no_resources_test.go b/tests/integration/acp/add_policy/with_no_resources_test.go index 194af53c34..26e09a76b6 100644 --- a/tests/integration/acp/add_policy/with_no_resources_test.go +++ b/tests/integration/acp/add_policy/with_no_resources_test.go @@ -27,7 +27,7 @@ func TestACP_AddPolicy_NoResource_ValidID(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -56,7 +56,7 @@ func TestACP_AddPolicy_NoResourceLabel_ValidID(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -85,7 +85,7 @@ func TestACP_AddPolicy_PolicyWithOnlySpace_NameIsRequired(t *testing.T) { }), Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: " ", diff --git a/tests/integration/acp/add_policy/with_perm_expr_test.go b/tests/integration/acp/add_policy/with_perm_expr_test.go index 77ce0e03ae..b058a2e652 100644 --- a/tests/integration/acp/add_policy/with_perm_expr_test.go +++ b/tests/integration/acp/add_policy/with_perm_expr_test.go @@ -23,7 +23,7 @@ func TestACP_AddPolicy_PermissionExprWithOwnerInTheEndWithMinus_ValidID(t *testi Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -65,7 +65,7 @@ func TestACP_AddPolicy_PermissionExprWithOwnerInTheEndWithMinusNoSpace_ValidID(t Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test diff --git a/tests/integration/acp/add_policy/with_perm_invalid_expr_test.go b/tests/integration/acp/add_policy/with_perm_invalid_expr_test.go index 91932cc538..2f3d20ee51 100644 --- a/tests/integration/acp/add_policy/with_perm_invalid_expr_test.go +++ b/tests/integration/acp/add_policy/with_perm_invalid_expr_test.go @@ -23,7 +23,7 @@ func TestACP_AddPolicy_EmptyExpressionInPermission_Error(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -64,7 +64,7 @@ func TestACP_AddPolicy_PermissionExprWithOwnerInTheEndWithInocorrectSymbol_Error Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -105,7 +105,7 @@ func TestACP_AddPolicy_PermissionExprWithOwnerInTheEndWithInocorrectSymbolNoSpac Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test diff --git a/tests/integration/acp/add_policy/with_permissionless_owner_test.go b/tests/integration/acp/add_policy/with_permissionless_owner_test.go index f0b9b0ab5f..822c56907e 100644 --- a/tests/integration/acp/add_policy/with_permissionless_owner_test.go +++ b/tests/integration/acp/add_policy/with_permissionless_owner_test.go @@ -30,7 +30,7 @@ func TestACP_AddPolicy_PermissionlessOwnerWrite_ValidID(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -71,7 +71,7 @@ func TestACP_AddPolicy_PermissionlessOwnerRead_ValidID(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -112,7 +112,7 @@ func TestACP_AddPolicy_PermissionlessOwnerReadWrite_ValidID(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test diff --git a/tests/integration/acp/add_policy/with_unused_relations_test.go b/tests/integration/acp/add_policy/with_unused_relations_test.go index 47b71ea573..2189048ab0 100644 --- a/tests/integration/acp/add_policy/with_unused_relations_test.go +++ b/tests/integration/acp/add_policy/with_unused_relations_test.go @@ -23,7 +23,7 @@ func TestACP_AddPolicy_UnusedRelation_ValidID(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test diff --git a/tests/integration/acp/index/create_test.go b/tests/integration/acp/index/create_test.go index b07c090de4..8a3388878c 100644 --- a/tests/integration/acp/index/create_test.go +++ b/tests/integration/acp/index/create_test.go @@ -22,7 +22,7 @@ func TestACP_IndexCreateWithSeparateRequest_OnCollectionWithPolicy_NoError(t *te Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: userPolicy, ExpectedPolicyID: "94eb195c0e459aa79e02a1986c7e731c5015721c18a373f2b2a0ed140a04b454", }, @@ -70,7 +70,7 @@ func TestACP_IndexCreateWithDirective_OnCollectionWithPolicy_NoError(t *testing. Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: userPolicy, ExpectedPolicyID: "94eb195c0e459aa79e02a1986c7e731c5015721c18a373f2b2a0ed140a04b454", }, diff --git a/tests/integration/acp/index/query_test.go b/tests/integration/acp/index/query_test.go index ef1cf9360d..06edc45065 100644 --- a/tests/integration/acp/index/query_test.go +++ b/tests/integration/acp/index/query_test.go @@ -21,7 +21,7 @@ func TestACPWithIndex_UponQueryingPrivateDocWithoutIdentity_ShouldNotFetch(t *te Description: "Test acp, querying private doc without identity should not fetch", Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: userPolicy, ExpectedPolicyID: "94eb195c0e459aa79e02a1986c7e731c5015721c18a373f2b2a0ed140a04b454", }, @@ -44,7 +44,7 @@ func TestACPWithIndex_UponQueryingPrivateDocWithoutIdentity_ShouldNotFetch(t *te `, }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Doc: ` { "name": "Islam" @@ -75,7 +75,7 @@ func TestACPWithIndex_UponQueryingPrivateDocWithIdentity_ShouldFetch(t *testing. Description: "Test acp, querying private doc with identity should fetch", Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: userPolicy, ExpectedPolicyID: "94eb195c0e459aa79e02a1986c7e731c5015721c18a373f2b2a0ed140a04b454", }, @@ -98,7 +98,7 @@ func TestACPWithIndex_UponQueryingPrivateDocWithIdentity_ShouldFetch(t *testing. `, }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Doc: ` { "name": "Islam" @@ -106,7 +106,7 @@ func TestACPWithIndex_UponQueryingPrivateDocWithIdentity_ShouldFetch(t *testing. `, }, testUtils.Request{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Request: ` query { Users { @@ -135,7 +135,7 @@ func TestACPWithIndex_UponQueryingPrivateDocWithWrongIdentity_ShouldNotFetch(t * Description: "Test acp, querying private doc with wrong identity should not fetch", Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: userPolicy, ExpectedPolicyID: "94eb195c0e459aa79e02a1986c7e731c5015721c18a373f2b2a0ed140a04b454", }, @@ -158,7 +158,7 @@ func TestACPWithIndex_UponQueryingPrivateDocWithWrongIdentity_ShouldNotFetch(t * `, }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Doc: ` { "name": "Islam" @@ -166,7 +166,7 @@ func TestACPWithIndex_UponQueryingPrivateDocWithWrongIdentity_ShouldNotFetch(t * `, }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), Request: ` query { Users { diff --git a/tests/integration/acp/index/query_with_relation_test.go b/tests/integration/acp/index/query_with_relation_test.go index 004958efd1..01a09db435 100644 --- a/tests/integration/acp/index/query_with_relation_test.go +++ b/tests/integration/acp/index/query_with_relation_test.go @@ -19,7 +19,7 @@ import ( func createAuthorBooksSchemaWithPolicyAndCreateDocs() []any { return []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: bookAuthorPolicy, ExpectedPolicyID: "f6927e8861f91122a5e3e333249297e4315b672298b5cb93ee3f49facc1e0d11", }, @@ -54,7 +54,7 @@ func createAuthorBooksSchemaWithPolicyAndCreateDocs() []any { }`, }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, // bae-b769708d-f552-5c3d-a402-ccfd7ac7fb04 Doc: `{ @@ -72,7 +72,7 @@ func createAuthorBooksSchemaWithPolicyAndCreateDocs() []any { }, }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 1, DocMap: map[string]any{ "name": "A Time for Mercy", @@ -81,7 +81,7 @@ func createAuthorBooksSchemaWithPolicyAndCreateDocs() []any { }, }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 1, DocMap: map[string]any{ "name": "Theif Lord", @@ -134,7 +134,7 @@ func TestACPWithIndex_UponQueryingPrivateOneToManyRelatedDocWithIdentity_ShouldF Actions: []any{ createAuthorBooksSchemaWithPolicyAndCreateDocs(), testUtils.Request{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Request: ` query { Author(filter: { @@ -182,7 +182,7 @@ func TestACPWithIndex_UponQueryingPrivateOneToManyRelatedDocWithWrongIdentity_Sh Actions: []any{ createAuthorBooksSchemaWithPolicyAndCreateDocs(), testUtils.Request{ - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), Request: ` query { Author(filter: { @@ -253,7 +253,7 @@ func TestACPWithIndex_UponQueryingPrivateManyToOneRelatedDocWithIdentity_ShouldF Actions: []any{ createAuthorBooksSchemaWithPolicyAndCreateDocs(), testUtils.Request{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Request: ` query { Book(filter: { @@ -300,7 +300,7 @@ func TestACPWithIndex_UponQueryingPrivateManyToOneRelatedDocWithWrongIdentity_Sh Actions: []any{ createAuthorBooksSchemaWithPolicyAndCreateDocs(), testUtils.Request{ - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), Request: ` query { Book(filter: { diff --git a/tests/integration/acp/p2p/create_test.go b/tests/integration/acp/p2p/create_test.go index 5cc84bf32a..db3d5a4508 100644 --- a/tests/integration/acp/p2p/create_test.go +++ b/tests/integration/acp/p2p/create_test.go @@ -39,7 +39,7 @@ func TestACP_P2PCreatePrivateDocumentsOnDifferentNodes_SourceHubACP(t *testing.T testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -103,7 +103,7 @@ func TestACP_P2PCreatePrivateDocumentsOnDifferentNodes_SourceHubACP(t *testing.T }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), NodeID: immutable.Some(0), @@ -115,7 +115,7 @@ func TestACP_P2PCreatePrivateDocumentsOnDifferentNodes_SourceHubACP(t *testing.T }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), NodeID: immutable.Some(1), diff --git a/tests/integration/acp/p2p/delete_test.go b/tests/integration/acp/p2p/delete_test.go index d7b604846a..2f45fbcf43 100644 --- a/tests/integration/acp/p2p/delete_test.go +++ b/tests/integration/acp/p2p/delete_test.go @@ -39,7 +39,7 @@ func TestACP_P2PDeletePrivateDocumentsOnDifferentNodes_SourceHubACP(t *testing.T testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -108,7 +108,7 @@ func TestACP_P2PDeletePrivateDocumentsOnDifferentNodes_SourceHubACP(t *testing.T }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), NodeID: immutable.Some(0), @@ -120,7 +120,7 @@ func TestACP_P2PDeletePrivateDocumentsOnDifferentNodes_SourceHubACP(t *testing.T }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), NodeID: immutable.Some(1), @@ -134,7 +134,7 @@ func TestACP_P2PDeletePrivateDocumentsOnDifferentNodes_SourceHubACP(t *testing.T testUtils.WaitForSync{}, testUtils.DeleteDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), NodeID: immutable.Some(0), @@ -144,7 +144,7 @@ func TestACP_P2PDeletePrivateDocumentsOnDifferentNodes_SourceHubACP(t *testing.T }, testUtils.DeleteDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), NodeID: immutable.Some(1), diff --git a/tests/integration/acp/p2p/replicator_test.go b/tests/integration/acp/p2p/replicator_test.go index b906d603f0..2f7f69ceca 100644 --- a/tests/integration/acp/p2p/replicator_test.go +++ b/tests/integration/acp/p2p/replicator_test.go @@ -29,7 +29,7 @@ func TestACP_P2POneToOneReplicatorWithPermissionedCollection_LocalACP(t *testing testUtils.RandomNetworkingConfig(), testUtils.RandomNetworkingConfig(), testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test description: a test policy which marks a collection in a database as a resource @@ -93,7 +93,7 @@ func TestACP_P2POneToOneReplicatorWithPermissionedCollection_SourceHubACP(t *tes testUtils.RandomNetworkingConfig(), testUtils.RandomNetworkingConfig(), testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test description: a test policy which marks a collection in a database as a resource @@ -141,7 +141,7 @@ func TestACP_P2POneToOneReplicatorWithPermissionedCollection_SourceHubACP(t *tes }, testUtils.CreateDoc{ NodeID: immutable.Some(0), - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), DocMap: map[string]any{ "name": "John", }, @@ -149,7 +149,7 @@ func TestACP_P2POneToOneReplicatorWithPermissionedCollection_SourceHubACP(t *tes testUtils.WaitForSync{}, testUtils.Request{ // Ensure that the document is accessible on all nodes to authorized actors - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Request: ` query { Users { @@ -180,7 +180,7 @@ func TestACP_P2POneToOneReplicatorWithPermissionedCollection_SourceHubACP(t *tes }, testUtils.Request{ // Ensure that the document is hidden on all nodes to unauthorized actors - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), Request: ` query { Users { diff --git a/tests/integration/acp/p2p/replicator_with_doc_actor_relationship_test.go b/tests/integration/acp/p2p/replicator_with_doc_actor_relationship_test.go index 3c4c9744a6..46d01c8616 100644 --- a/tests/integration/acp/p2p/replicator_with_doc_actor_relationship_test.go +++ b/tests/integration/acp/p2p/replicator_with_doc_actor_relationship_test.go @@ -39,7 +39,7 @@ func TestACP_P2PReplicatorWithPermissionedCollectionCreateDocActorRelationship_S testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -109,7 +109,7 @@ func TestACP_P2PReplicatorWithPermissionedCollectionCreateDocActorRelationship_S }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), NodeID: immutable.Some(0), @@ -124,7 +124,7 @@ func TestACP_P2PReplicatorWithPermissionedCollectionCreateDocActorRelationship_S testUtils.Request{ // Ensure that the document is hidden on all nodes to an unauthorized actor - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), Request: ` query { @@ -142,9 +142,9 @@ func TestACP_P2PReplicatorWithPermissionedCollectionCreateDocActorRelationship_S testUtils.AddDocActorRelationship{ NodeID: immutable.Some(0), - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -158,9 +158,9 @@ func TestACP_P2PReplicatorWithPermissionedCollectionCreateDocActorRelationship_S testUtils.AddDocActorRelationship{ NodeID: immutable.Some(1), // Note: Different node than the previous - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -173,7 +173,7 @@ func TestACP_P2PReplicatorWithPermissionedCollectionCreateDocActorRelationship_S testUtils.Request{ // Ensure that the document is now accessible on all nodes to the newly authorized actor. - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), Request: ` query { @@ -194,7 +194,7 @@ func TestACP_P2PReplicatorWithPermissionedCollectionCreateDocActorRelationship_S testUtils.Request{ // Ensure that the document is still accessible on all nodes to the owner. - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Request: ` query { @@ -216,9 +216,9 @@ func TestACP_P2PReplicatorWithPermissionedCollectionCreateDocActorRelationship_S testUtils.DeleteDocActorRelationship{ NodeID: immutable.Some(1), - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -232,9 +232,9 @@ func TestACP_P2PReplicatorWithPermissionedCollectionCreateDocActorRelationship_S testUtils.DeleteDocActorRelationship{ NodeID: immutable.Some(0), // Note: Different node than the previous - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -247,7 +247,7 @@ func TestACP_P2PReplicatorWithPermissionedCollectionCreateDocActorRelationship_S testUtils.Request{ // Ensure that the document is now inaccessible on all nodes to the actor we revoked access from. - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), Request: ` query { @@ -264,7 +264,7 @@ func TestACP_P2PReplicatorWithPermissionedCollectionCreateDocActorRelationship_S testUtils.Request{ // Ensure that the document is still accessible on all nodes to the owner. - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Request: ` query { diff --git a/tests/integration/acp/p2p/subscribe_test.go b/tests/integration/acp/p2p/subscribe_test.go index 4889758797..e776ae4fb2 100644 --- a/tests/integration/acp/p2p/subscribe_test.go +++ b/tests/integration/acp/p2p/subscribe_test.go @@ -32,7 +32,7 @@ func TestACP_P2PSubscribeAddGetSingleWithPermissionedCollection_LocalACP(t *test testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -110,7 +110,7 @@ func TestACP_P2PSubscribeAddGetSingleWithPermissionedCollection_SourceHubACP(t * testUtils.RandomNetworkingConfig(), testUtils.RandomNetworkingConfig(), testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test description: a test policy which marks a collection in a database as a resource @@ -163,7 +163,7 @@ func TestACP_P2PSubscribeAddGetSingleWithPermissionedCollection_SourceHubACP(t * }, testUtils.CreateDoc{ NodeID: immutable.Some(0), - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), DocMap: map[string]any{ "name": "John", }, @@ -171,7 +171,7 @@ func TestACP_P2PSubscribeAddGetSingleWithPermissionedCollection_SourceHubACP(t * testUtils.WaitForSync{}, testUtils.Request{ // Ensure that the document is accessible on all nodes to authorized actors - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Request: ` query { Users { @@ -202,7 +202,7 @@ func TestACP_P2PSubscribeAddGetSingleWithPermissionedCollection_SourceHubACP(t * }, testUtils.Request{ // Ensure that the document is hidden on all nodes to unauthorized actors - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), Request: ` query { Users { diff --git a/tests/integration/acp/p2p/subscribe_with_doc_actor_relationship_test.go b/tests/integration/acp/p2p/subscribe_with_doc_actor_relationship_test.go index f839b7eebe..52038b8d5b 100644 --- a/tests/integration/acp/p2p/subscribe_with_doc_actor_relationship_test.go +++ b/tests/integration/acp/p2p/subscribe_with_doc_actor_relationship_test.go @@ -39,7 +39,7 @@ func TestACP_P2PSubscribeAddGetSingleWithPermissionedCollectionCreateDocActorRel testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -115,7 +115,7 @@ func TestACP_P2PSubscribeAddGetSingleWithPermissionedCollectionCreateDocActorRel }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), NodeID: immutable.Some(0), @@ -130,7 +130,7 @@ func TestACP_P2PSubscribeAddGetSingleWithPermissionedCollectionCreateDocActorRel testUtils.Request{ // Ensure that the document is hidden on all nodes to an unauthorized actor - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), Request: ` query { @@ -148,9 +148,9 @@ func TestACP_P2PSubscribeAddGetSingleWithPermissionedCollectionCreateDocActorRel testUtils.AddDocActorRelationship{ NodeID: immutable.Some(0), - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -164,9 +164,9 @@ func TestACP_P2PSubscribeAddGetSingleWithPermissionedCollectionCreateDocActorRel testUtils.AddDocActorRelationship{ NodeID: immutable.Some(1), // Note: Different node than the previous - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -179,7 +179,7 @@ func TestACP_P2PSubscribeAddGetSingleWithPermissionedCollectionCreateDocActorRel testUtils.Request{ // Ensure that the document is now accessible on all nodes to the newly authorized actor. - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), Request: ` query { @@ -200,7 +200,7 @@ func TestACP_P2PSubscribeAddGetSingleWithPermissionedCollectionCreateDocActorRel testUtils.Request{ // Ensure that the document is still accessible on all nodes to the owner. - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Request: ` query { @@ -222,9 +222,9 @@ func TestACP_P2PSubscribeAddGetSingleWithPermissionedCollectionCreateDocActorRel testUtils.DeleteDocActorRelationship{ NodeID: immutable.Some(1), - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -238,9 +238,9 @@ func TestACP_P2PSubscribeAddGetSingleWithPermissionedCollectionCreateDocActorRel testUtils.DeleteDocActorRelationship{ NodeID: immutable.Some(0), // Note: Different node than the previous - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -253,7 +253,7 @@ func TestACP_P2PSubscribeAddGetSingleWithPermissionedCollectionCreateDocActorRel testUtils.Request{ // Ensure that the document is now inaccessible on all nodes to the actor we revoked access from. - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), Request: ` query { @@ -270,7 +270,7 @@ func TestACP_P2PSubscribeAddGetSingleWithPermissionedCollectionCreateDocActorRel testUtils.Request{ // Ensure that the document is still accessible on all nodes to the owner. - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Request: ` query { diff --git a/tests/integration/acp/p2p/update_test.go b/tests/integration/acp/p2p/update_test.go index 2a7984ad59..df26fe4e9a 100644 --- a/tests/integration/acp/p2p/update_test.go +++ b/tests/integration/acp/p2p/update_test.go @@ -39,7 +39,7 @@ func TestACP_P2PUpdatePrivateDocumentsOnDifferentNodes_SourceHubACP(t *testing.T testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -108,7 +108,7 @@ func TestACP_P2PUpdatePrivateDocumentsOnDifferentNodes_SourceHubACP(t *testing.T }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), NodeID: immutable.Some(0), @@ -120,7 +120,7 @@ func TestACP_P2PUpdatePrivateDocumentsOnDifferentNodes_SourceHubACP(t *testing.T }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), NodeID: immutable.Some(1), @@ -134,7 +134,7 @@ func TestACP_P2PUpdatePrivateDocumentsOnDifferentNodes_SourceHubACP(t *testing.T testUtils.WaitForSync{}, testUtils.UpdateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), NodeID: immutable.Some(0), @@ -150,7 +150,7 @@ func TestACP_P2PUpdatePrivateDocumentsOnDifferentNodes_SourceHubACP(t *testing.T }, testUtils.UpdateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), NodeID: immutable.Some(1), diff --git a/tests/integration/acp/query/avg_test.go b/tests/integration/acp/query/avg_test.go index 479f7012fd..f7804a3474 100644 --- a/tests/integration/acp/query/avg_test.go +++ b/tests/integration/acp/query/avg_test.go @@ -48,7 +48,7 @@ func TestACP_QueryAverageWithIdentity(t *testing.T) { getSetupEmployeeCompanyActions(), testUtils.Request{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Request: ` query { _avg(Employee: {field: salary}) @@ -73,7 +73,7 @@ func TestACP_QueryAverageWithWrongIdentity(t *testing.T) { getSetupEmployeeCompanyActions(), testUtils.Request{ - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), Request: ` query { _avg(Employee: {field: salary}) diff --git a/tests/integration/acp/query/count_test.go b/tests/integration/acp/query/count_test.go index 42b1a8f509..1b0e450148 100644 --- a/tests/integration/acp/query/count_test.go +++ b/tests/integration/acp/query/count_test.go @@ -77,7 +77,7 @@ func TestACP_QueryCountDocumentsWithIdentity(t *testing.T) { getSetupEmployeeCompanyActions(), testUtils.Request{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Request: ` query { _count(Employee: {}) @@ -101,7 +101,7 @@ func TestACP_QueryCountRelatedObjectsWithIdentity(t *testing.T) { getSetupEmployeeCompanyActions(), testUtils.Request{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Request: ` query { Company { @@ -134,7 +134,7 @@ func TestACP_QueryCountDocumentsWithWrongIdentity(t *testing.T) { getSetupEmployeeCompanyActions(), testUtils.Request{ - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), Request: ` query { _count(Employee: {}) @@ -158,7 +158,7 @@ func TestACP_QueryCountRelatedObjectsWithWrongIdentity(t *testing.T) { getSetupEmployeeCompanyActions(), testUtils.Request{ - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), Request: ` query { Company { diff --git a/tests/integration/acp/query/fixture.go b/tests/integration/acp/query/fixture.go index 07bbd807a8..7b9394cd27 100644 --- a/tests/integration/acp/query/fixture.go +++ b/tests/integration/acp/query/fixture.go @@ -56,7 +56,7 @@ resources: func getSetupEmployeeCompanyActions() []any { return []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: employeeCompanyPolicy, ExpectedPolicyID: "9d6c19007a894746c3f45f7fe45513a88a20ad77637948228869546197bb1b05", }, @@ -94,7 +94,7 @@ func getSetupEmployeeCompanyActions() []any { }, testUtils.CreateDoc{ CollectionID: 1, - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Doc: ` { "name": "Private Company", @@ -120,7 +120,7 @@ func getSetupEmployeeCompanyActions() []any { }, testUtils.CreateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), DocMap: map[string]any{ "name": "PrivateEmp in PubCompany", "salary": 30000, @@ -129,7 +129,7 @@ func getSetupEmployeeCompanyActions() []any { }, testUtils.CreateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), DocMap: map[string]any{ "name": "PrivateEmp in PrivateCompany", "salary": 40000, diff --git a/tests/integration/acp/query/relation_objects_test.go b/tests/integration/acp/query/relation_objects_test.go index 850af56fba..eed0ff7351 100644 --- a/tests/integration/acp/query/relation_objects_test.go +++ b/tests/integration/acp/query/relation_objects_test.go @@ -96,7 +96,7 @@ func TestACP_QueryManyToOneRelationObjectsWithIdentity(t *testing.T) { getSetupEmployeeCompanyActions(), testUtils.Request{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Request: ` query { Employee { @@ -142,7 +142,7 @@ func TestACP_QueryOneToManyRelationObjectsWithIdentity(t *testing.T) { getSetupEmployeeCompanyActions(), testUtils.Request{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Request: ` query { Company { @@ -186,7 +186,7 @@ func TestACP_QueryManyToOneRelationObjectsWithWrongIdentity(t *testing.T) { getSetupEmployeeCompanyActions(), testUtils.Request{ - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), Request: ` query { Employee { @@ -224,7 +224,7 @@ func TestACP_QueryOneToManyRelationObjectsWithWrongIdentity(t *testing.T) { getSetupEmployeeCompanyActions(), testUtils.Request{ - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), Request: ` query { Company { diff --git a/tests/integration/acp/register_and_delete_test.go b/tests/integration/acp/register_and_delete_test.go index eb4a8005b3..4c4dead596 100644 --- a/tests/integration/acp/register_and_delete_test.go +++ b/tests/integration/acp/register_and_delete_test.go @@ -28,7 +28,7 @@ func TestACP_CreateWithoutIdentityAndDeleteWithoutIdentity_CanDelete(t *testing. Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -124,7 +124,7 @@ func TestACP_CreateWithoutIdentityAndDeleteWithIdentity_CanDelete(t *testing.T) Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -184,7 +184,7 @@ func TestACP_CreateWithoutIdentityAndDeleteWithIdentity_CanDelete(t *testing.T) testUtils.DeleteDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), DocID: 0, }, @@ -217,7 +217,7 @@ func TestACP_CreateWithIdentityAndDeleteWithIdentity_CanDelete(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -266,7 +266,7 @@ func TestACP_CreateWithIdentityAndDeleteWithIdentity_CanDelete(t *testing.T) { testUtils.CreateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Doc: ` { @@ -279,13 +279,13 @@ func TestACP_CreateWithIdentityAndDeleteWithIdentity_CanDelete(t *testing.T) { testUtils.DeleteDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), DocID: 0, }, testUtils.Request{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Request: ` query { @@ -314,7 +314,7 @@ func TestACP_CreateWithIdentityAndDeleteWithoutIdentity_CanNotDelete(t *testing. Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -363,7 +363,7 @@ func TestACP_CreateWithIdentityAndDeleteWithoutIdentity_CanNotDelete(t *testing. testUtils.CreateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Doc: ` { @@ -382,7 +382,7 @@ func TestACP_CreateWithIdentityAndDeleteWithoutIdentity_CanNotDelete(t *testing. }, testUtils.Request{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Request: ` query { @@ -417,7 +417,7 @@ func TestACP_CreateWithIdentityAndDeleteWithWrongIdentity_CanNotDelete(t *testin Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -466,7 +466,7 @@ func TestACP_CreateWithIdentityAndDeleteWithWrongIdentity_CanNotDelete(t *testin testUtils.CreateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Doc: ` { @@ -479,7 +479,7 @@ func TestACP_CreateWithIdentityAndDeleteWithWrongIdentity_CanNotDelete(t *testin testUtils.DeleteDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), DocID: 0, @@ -487,7 +487,7 @@ func TestACP_CreateWithIdentityAndDeleteWithWrongIdentity_CanNotDelete(t *testin }, testUtils.Request{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Request: ` query { diff --git a/tests/integration/acp/register_and_read_test.go b/tests/integration/acp/register_and_read_test.go index fe0f6b8798..62d041d061 100644 --- a/tests/integration/acp/register_and_read_test.go +++ b/tests/integration/acp/register_and_read_test.go @@ -24,7 +24,7 @@ func TestACP_CreateWithoutIdentityAndReadWithoutIdentity_CanRead(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -115,7 +115,7 @@ func TestACP_CreateWithoutIdentityAndReadWithIdentity_CanRead(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -173,7 +173,7 @@ func TestACP_CreateWithoutIdentityAndReadWithIdentity_CanRead(t *testing.T) { }, testUtils.Request{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Request: ` query { @@ -208,7 +208,7 @@ func TestACP_CreateWithIdentityAndReadWithIdentity_CanRead(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -257,7 +257,7 @@ func TestACP_CreateWithIdentityAndReadWithIdentity_CanRead(t *testing.T) { testUtils.CreateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Doc: ` { @@ -268,7 +268,7 @@ func TestACP_CreateWithIdentityAndReadWithIdentity_CanRead(t *testing.T) { }, testUtils.Request{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Request: ` query { @@ -303,7 +303,7 @@ func TestACP_CreateWithIdentityAndReadWithoutIdentity_CanNotRead(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -352,7 +352,7 @@ func TestACP_CreateWithIdentityAndReadWithoutIdentity_CanNotRead(t *testing.T) { testUtils.CreateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Doc: ` { @@ -390,7 +390,7 @@ func TestACP_CreateWithIdentityAndReadWithWrongIdentity_CanNotRead(t *testing.T) Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -439,7 +439,7 @@ func TestACP_CreateWithIdentityAndReadWithWrongIdentity_CanNotRead(t *testing.T) testUtils.CreateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Doc: ` { @@ -450,7 +450,7 @@ func TestACP_CreateWithIdentityAndReadWithWrongIdentity_CanNotRead(t *testing.T) }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), Request: ` query { diff --git a/tests/integration/acp/register_and_update_test.go b/tests/integration/acp/register_and_update_test.go index c557a68258..4cbb186e19 100644 --- a/tests/integration/acp/register_and_update_test.go +++ b/tests/integration/acp/register_and_update_test.go @@ -30,7 +30,7 @@ func TestACP_CreateWithoutIdentityAndUpdateWithoutIdentity_CanUpdate(t *testing. Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -138,7 +138,7 @@ func TestACP_CreateWithoutIdentityAndUpdateWithIdentity_CanUpdate(t *testing.T) Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -198,7 +198,7 @@ func TestACP_CreateWithoutIdentityAndUpdateWithIdentity_CanUpdate(t *testing.T) testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), DocID: 0, @@ -243,7 +243,7 @@ func TestACP_CreateWithIdentityAndUpdateWithIdentity_CanUpdate(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -292,7 +292,7 @@ func TestACP_CreateWithIdentityAndUpdateWithIdentity_CanUpdate(t *testing.T) { testUtils.CreateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Doc: ` { @@ -305,7 +305,7 @@ func TestACP_CreateWithIdentityAndUpdateWithIdentity_CanUpdate(t *testing.T) { testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), DocID: 0, @@ -317,7 +317,7 @@ func TestACP_CreateWithIdentityAndUpdateWithIdentity_CanUpdate(t *testing.T) { }, testUtils.Request{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Request: ` query { @@ -358,7 +358,7 @@ func TestACP_CreateWithIdentityAndUpdateWithoutIdentity_CanNotUpdate(t *testing. Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -407,7 +407,7 @@ func TestACP_CreateWithIdentityAndUpdateWithoutIdentity_CanNotUpdate(t *testing. testUtils.CreateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Doc: ` { @@ -432,7 +432,7 @@ func TestACP_CreateWithIdentityAndUpdateWithoutIdentity_CanNotUpdate(t *testing. }, testUtils.Request{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Request: ` query { @@ -473,7 +473,7 @@ func TestACP_CreateWithIdentityAndUpdateWithWrongIdentity_CanNotUpdate(t *testin Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -522,7 +522,7 @@ func TestACP_CreateWithIdentityAndUpdateWithWrongIdentity_CanNotUpdate(t *testin testUtils.CreateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Doc: ` { @@ -535,7 +535,7 @@ func TestACP_CreateWithIdentityAndUpdateWithWrongIdentity_CanNotUpdate(t *testin testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), DocID: 0, @@ -549,7 +549,7 @@ func TestACP_CreateWithIdentityAndUpdateWithWrongIdentity_CanNotUpdate(t *testin }, testUtils.Request{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Request: ` query { @@ -591,7 +591,7 @@ func TestACP_CreateWithIdentityAndUpdateWithoutIdentityGQL_CanNotUpdate(t *testi Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -640,7 +640,7 @@ func TestACP_CreateWithIdentityAndUpdateWithoutIdentityGQL_CanNotUpdate(t *testi testUtils.CreateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Doc: ` { @@ -665,7 +665,7 @@ func TestACP_CreateWithIdentityAndUpdateWithoutIdentityGQL_CanNotUpdate(t *testi }, testUtils.Request{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Request: ` query { @@ -707,7 +707,7 @@ func TestACP_CreateWithIdentityAndUpdateWithWrongIdentityGQL_CanNotUpdate(t *tes Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -756,7 +756,7 @@ func TestACP_CreateWithIdentityAndUpdateWithWrongIdentityGQL_CanNotUpdate(t *tes testUtils.CreateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Doc: ` { @@ -769,7 +769,7 @@ func TestACP_CreateWithIdentityAndUpdateWithWrongIdentityGQL_CanNotUpdate(t *tes testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), DocID: 0, @@ -783,7 +783,7 @@ func TestACP_CreateWithIdentityAndUpdateWithWrongIdentityGQL_CanNotUpdate(t *tes }, testUtils.Request{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Request: ` query { diff --git a/tests/integration/acp/relationship/doc_actor/add/invalid_test.go b/tests/integration/acp/relationship/doc_actor/add/invalid_test.go index 04f371ad23..0742151493 100644 --- a/tests/integration/acp/relationship/doc_actor/add/invalid_test.go +++ b/tests/integration/acp/relationship/doc_actor/add/invalid_test.go @@ -27,7 +27,7 @@ func TestACP_AddDocActorRelationshipMissingDocID_Error(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -91,7 +91,7 @@ func TestACP_AddDocActorRelationshipMissingDocID_Error(t *testing.T) { }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -104,9 +104,9 @@ func TestACP_AddDocActorRelationshipMissingDocID_Error(t *testing.T) { }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -132,7 +132,7 @@ func TestACP_AddDocActorRelationshipMissingCollection_Error(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -196,7 +196,7 @@ func TestACP_AddDocActorRelationshipMissingCollection_Error(t *testing.T) { }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -209,9 +209,9 @@ func TestACP_AddDocActorRelationshipMissingCollection_Error(t *testing.T) { }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: -1, @@ -237,7 +237,7 @@ func TestACP_AddDocActorRelationshipMissingRelationName_Error(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -301,7 +301,7 @@ func TestACP_AddDocActorRelationshipMissingRelationName_Error(t *testing.T) { }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -314,9 +314,9 @@ func TestACP_AddDocActorRelationshipMissingRelationName_Error(t *testing.T) { }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -342,7 +342,7 @@ func TestACP_AddDocActorRelationshipMissingTargetActorName_Error(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -406,7 +406,7 @@ func TestACP_AddDocActorRelationshipMissingTargetActorName_Error(t *testing.T) { }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -419,7 +419,7 @@ func TestACP_AddDocActorRelationshipMissingTargetActorName_Error(t *testing.T) { }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), TargetIdentity: testUtils.NoIdentity(), @@ -447,7 +447,7 @@ func TestACP_AddDocActorRelationshipMissingReqestingIdentityName_Error(t *testin Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -511,7 +511,7 @@ func TestACP_AddDocActorRelationshipMissingReqestingIdentityName_Error(t *testin }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -526,7 +526,7 @@ func TestACP_AddDocActorRelationshipMissingReqestingIdentityName_Error(t *testin testUtils.AddDocActorRelationship{ RequestorIdentity: testUtils.NoIdentity(), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, diff --git a/tests/integration/acp/relationship/doc_actor/add/with_delete_test.go b/tests/integration/acp/relationship/doc_actor/add/with_delete_test.go index 3e66a6fcfd..b75fb41ef3 100644 --- a/tests/integration/acp/relationship/doc_actor/add/with_delete_test.go +++ b/tests/integration/acp/relationship/doc_actor/add/with_delete_test.go @@ -27,7 +27,7 @@ func TestACP_OwnerGivesDeleteWriteAccessToAnotherActorTwice_ShowThatTheRelations Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -91,7 +91,7 @@ func TestACP_OwnerGivesDeleteWriteAccessToAnotherActorTwice_ShowThatTheRelations }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -104,7 +104,7 @@ func TestACP_OwnerGivesDeleteWriteAccessToAnotherActorTwice_ShowThatTheRelations }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can not read yet. + Identity: testUtils.ClientIdentity(2), // This identity can not read yet. Request: ` query { @@ -124,7 +124,7 @@ func TestACP_OwnerGivesDeleteWriteAccessToAnotherActorTwice_ShowThatTheRelations testUtils.DeleteDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // This identity can not delete yet. + Identity: testUtils.ClientIdentity(2), // This identity can not delete yet. DocID: 0, @@ -132,9 +132,9 @@ func TestACP_OwnerGivesDeleteWriteAccessToAnotherActorTwice_ShowThatTheRelations }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -146,9 +146,9 @@ func TestACP_OwnerGivesDeleteWriteAccessToAnotherActorTwice_ShowThatTheRelations }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -174,7 +174,7 @@ func TestACP_OwnerGivesDeleteWriteAccessToAnotherActor_OtherActorCanDelete(t *te Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -238,7 +238,7 @@ func TestACP_OwnerGivesDeleteWriteAccessToAnotherActor_OtherActorCanDelete(t *te }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -251,7 +251,7 @@ func TestACP_OwnerGivesDeleteWriteAccessToAnotherActor_OtherActorCanDelete(t *te }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can not read yet. + Identity: testUtils.ClientIdentity(2), // This identity can not read yet. Request: ` query { @@ -271,7 +271,7 @@ func TestACP_OwnerGivesDeleteWriteAccessToAnotherActor_OtherActorCanDelete(t *te testUtils.DeleteDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // This identity can not delete yet. + Identity: testUtils.ClientIdentity(2), // This identity can not delete yet. DocID: 0, @@ -279,9 +279,9 @@ func TestACP_OwnerGivesDeleteWriteAccessToAnotherActor_OtherActorCanDelete(t *te }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -293,7 +293,7 @@ func TestACP_OwnerGivesDeleteWriteAccessToAnotherActor_OtherActorCanDelete(t *te }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can now read. + Identity: testUtils.ClientIdentity(2), // This identity can now read. Request: ` query { @@ -319,13 +319,13 @@ func TestACP_OwnerGivesDeleteWriteAccessToAnotherActor_OtherActorCanDelete(t *te testUtils.DeleteDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // This identity can now delete. + Identity: testUtils.ClientIdentity(2), // This identity can now delete. DocID: 0, }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // Check if actually deleted. + Identity: testUtils.ClientIdentity(2), // Check if actually deleted. Request: ` query { @@ -357,7 +357,7 @@ func TestACP_OwnerGivesDeleteWriteAccessToAnotherActor_OtherActorCanDeleteSoCanT Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -421,7 +421,7 @@ func TestACP_OwnerGivesDeleteWriteAccessToAnotherActor_OtherActorCanDeleteSoCanT }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -434,9 +434,9 @@ func TestACP_OwnerGivesDeleteWriteAccessToAnotherActor_OtherActorCanDeleteSoCanT }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -448,7 +448,7 @@ func TestACP_OwnerGivesDeleteWriteAccessToAnotherActor_OtherActorCanDeleteSoCanT }, testUtils.Request{ - Identity: testUtils.UserIdentity(1), // Owner can still also delete (ownership not transferred) + Identity: testUtils.ClientIdentity(1), // Owner can still also delete (ownership not transferred) Request: ` query { @@ -474,13 +474,13 @@ func TestACP_OwnerGivesDeleteWriteAccessToAnotherActor_OtherActorCanDeleteSoCanT testUtils.DeleteDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(1), // Owner can still also delete. + Identity: testUtils.ClientIdentity(1), // Owner can still also delete. DocID: 0, }, testUtils.Request{ - Identity: testUtils.UserIdentity(1), // Check if actually deleted. + Identity: testUtils.ClientIdentity(1), // Check if actually deleted. Request: ` query { diff --git a/tests/integration/acp/relationship/doc_actor/add/with_dummy_relation_test.go b/tests/integration/acp/relationship/doc_actor/add/with_dummy_relation_test.go index 7569a15e79..7bfe6c2ff2 100644 --- a/tests/integration/acp/relationship/doc_actor/add/with_dummy_relation_test.go +++ b/tests/integration/acp/relationship/doc_actor/add/with_dummy_relation_test.go @@ -27,7 +27,7 @@ func TestACP_AddDocActorRelationshipWithDummyRelationDefinedOnPolicy_NothingChan Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -91,7 +91,7 @@ func TestACP_AddDocActorRelationshipWithDummyRelationDefinedOnPolicy_NothingChan }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -104,7 +104,7 @@ func TestACP_AddDocActorRelationshipWithDummyRelationDefinedOnPolicy_NothingChan }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can not read yet. + Identity: testUtils.ClientIdentity(2), // This identity can not read yet. Request: ` query { @@ -122,9 +122,9 @@ func TestACP_AddDocActorRelationshipWithDummyRelationDefinedOnPolicy_NothingChan }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -136,7 +136,7 @@ func TestACP_AddDocActorRelationshipWithDummyRelationDefinedOnPolicy_NothingChan }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can still not read. + Identity: testUtils.ClientIdentity(2), // This identity can still not read. Request: ` query { @@ -168,7 +168,7 @@ func TestACP_AddDocActorRelationshipWithDummyRelationNotDefinedOnPolicy_Error(t Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -232,7 +232,7 @@ func TestACP_AddDocActorRelationshipWithDummyRelationNotDefinedOnPolicy_Error(t }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -245,7 +245,7 @@ func TestACP_AddDocActorRelationshipWithDummyRelationNotDefinedOnPolicy_Error(t }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can not read yet. + Identity: testUtils.ClientIdentity(2), // This identity can not read yet. Request: ` query { @@ -263,9 +263,9 @@ func TestACP_AddDocActorRelationshipWithDummyRelationNotDefinedOnPolicy_Error(t }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -277,7 +277,7 @@ func TestACP_AddDocActorRelationshipWithDummyRelationNotDefinedOnPolicy_Error(t }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can still not read. + Identity: testUtils.ClientIdentity(2), // This identity can still not read. Request: ` query { diff --git a/tests/integration/acp/relationship/doc_actor/add/with_manager_gql_test.go b/tests/integration/acp/relationship/doc_actor/add/with_manager_gql_test.go index 44761d01ba..757053f365 100644 --- a/tests/integration/acp/relationship/doc_actor/add/with_manager_gql_test.go +++ b/tests/integration/acp/relationship/doc_actor/add/with_manager_gql_test.go @@ -34,7 +34,7 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAndWriteAccess_GQL_ManagerCanR Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -99,7 +99,7 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAndWriteAccess_GQL_ManagerCanR }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -112,7 +112,7 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAndWriteAccess_GQL_ManagerCanR }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity (to be manager) can not read yet. + Identity: testUtils.ClientIdentity(2), // This identity (to be manager) can not read yet. Request: ` query { @@ -132,7 +132,7 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAndWriteAccess_GQL_ManagerCanR testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // Manager can't update yet. + Identity: testUtils.ClientIdentity(2), // Manager can't update yet. DocID: 0, @@ -148,7 +148,7 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAndWriteAccess_GQL_ManagerCanR testUtils.DeleteDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // Manager can't delete yet. + Identity: testUtils.ClientIdentity(2), // Manager can't delete yet. DocID: 0, @@ -156,9 +156,9 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAndWriteAccess_GQL_ManagerCanR }, testUtils.AddDocActorRelationship{ // Make admin / manager - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -170,9 +170,9 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAndWriteAccess_GQL_ManagerCanR }, testUtils.AddDocActorRelationship{ // Manager makes itself a writer - RequestorIdentity: testUtils.UserIdentity(2), + RequestorIdentity: testUtils.ClientIdentity(2), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -185,9 +185,9 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAndWriteAccess_GQL_ManagerCanR // Note: It is not neccesary to make itself a reader, as becoming a writer allows reading. testUtils.AddDocActorRelationship{ // Manager makes itself a reader - RequestorIdentity: testUtils.UserIdentity(2), + RequestorIdentity: testUtils.ClientIdentity(2), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -201,7 +201,7 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAndWriteAccess_GQL_ManagerCanR testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // Manager can now update. + Identity: testUtils.ClientIdentity(2), // Manager can now update. DocID: 0, @@ -213,7 +213,7 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAndWriteAccess_GQL_ManagerCanR }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // Manager can read now + Identity: testUtils.ClientIdentity(2), // Manager can read now Request: ` query { @@ -239,13 +239,13 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAndWriteAccess_GQL_ManagerCanR testUtils.DeleteDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // Manager can now delete. + Identity: testUtils.ClientIdentity(2), // Manager can now delete. DocID: 0, }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // Make sure manager was able to delete the document. + Identity: testUtils.ClientIdentity(2), // Make sure manager was able to delete the document. Request: ` query { @@ -282,7 +282,7 @@ func TestACP_OwnerMakesManagerButManagerCanNotPerformOperations_GQL_ManagerCantR Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -346,7 +346,7 @@ func TestACP_OwnerMakesManagerButManagerCanNotPerformOperations_GQL_ManagerCantR }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -359,9 +359,9 @@ func TestACP_OwnerMakesManagerButManagerCanNotPerformOperations_GQL_ManagerCantR }, testUtils.AddDocActorRelationship{ // Make admin / manager - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -373,7 +373,7 @@ func TestACP_OwnerMakesManagerButManagerCanNotPerformOperations_GQL_ManagerCantR }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // Manager can not read + Identity: testUtils.ClientIdentity(2), // Manager can not read Request: ` query { @@ -393,7 +393,7 @@ func TestACP_OwnerMakesManagerButManagerCanNotPerformOperations_GQL_ManagerCantR testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // Manager can not update. + Identity: testUtils.ClientIdentity(2), // Manager can not update. DocID: 0, @@ -409,7 +409,7 @@ func TestACP_OwnerMakesManagerButManagerCanNotPerformOperations_GQL_ManagerCantR testUtils.DeleteDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // Manager can not delete. + Identity: testUtils.ClientIdentity(2), // Manager can not delete. DocID: 0, @@ -417,9 +417,9 @@ func TestACP_OwnerMakesManagerButManagerCanNotPerformOperations_GQL_ManagerCantR }, testUtils.AddDocActorRelationship{ // Manager can manage only. - RequestorIdentity: testUtils.UserIdentity(2), + RequestorIdentity: testUtils.ClientIdentity(2), - TargetIdentity: testUtils.UserIdentity(3), + TargetIdentity: testUtils.ClientIdentity(3), CollectionID: 0, @@ -450,7 +450,7 @@ func TestACP_ManagerAddsRelationshipWithRelationItDoesNotManageAccordingToPolicy Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -514,7 +514,7 @@ func TestACP_ManagerAddsRelationshipWithRelationItDoesNotManageAccordingToPolicy }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -527,9 +527,9 @@ func TestACP_ManagerAddsRelationshipWithRelationItDoesNotManageAccordingToPolicy }, testUtils.AddDocActorRelationship{ // Make admin / manager - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -541,9 +541,9 @@ func TestACP_ManagerAddsRelationshipWithRelationItDoesNotManageAccordingToPolicy }, testUtils.AddDocActorRelationship{ // Admin tries to make another actor a writer - RequestorIdentity: testUtils.UserIdentity(2), + RequestorIdentity: testUtils.ClientIdentity(2), - TargetIdentity: testUtils.UserIdentity(3), + TargetIdentity: testUtils.ClientIdentity(3), CollectionID: 0, @@ -555,7 +555,7 @@ func TestACP_ManagerAddsRelationshipWithRelationItDoesNotManageAccordingToPolicy }, testUtils.Request{ - Identity: testUtils.UserIdentity(3), // The other actor can't read + Identity: testUtils.ClientIdentity(3), // The other actor can't read Request: ` query { @@ -575,7 +575,7 @@ func TestACP_ManagerAddsRelationshipWithRelationItDoesNotManageAccordingToPolicy testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(3), // The other actor can not update + Identity: testUtils.ClientIdentity(3), // The other actor can not update DocID: 0, @@ -591,7 +591,7 @@ func TestACP_ManagerAddsRelationshipWithRelationItDoesNotManageAccordingToPolicy testUtils.DeleteDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(3), // The other actor can not delete + Identity: testUtils.ClientIdentity(3), // The other actor can not delete DocID: 0, diff --git a/tests/integration/acp/relationship/doc_actor/add/with_manager_test.go b/tests/integration/acp/relationship/doc_actor/add/with_manager_test.go index 6a8c3576c5..485c130805 100644 --- a/tests/integration/acp/relationship/doc_actor/add/with_manager_test.go +++ b/tests/integration/acp/relationship/doc_actor/add/with_manager_test.go @@ -29,7 +29,7 @@ func TestACP_ManagerGivesReadAccessToAnotherActor_OtherActorCanRead(t *testing.T Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -93,7 +93,7 @@ func TestACP_ManagerGivesReadAccessToAnotherActor_OtherActorCanRead(t *testing.T }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -106,7 +106,7 @@ func TestACP_ManagerGivesReadAccessToAnotherActor_OtherActorCanRead(t *testing.T }, testUtils.Request{ - Identity: testUtils.UserIdentity(3), // This identity can not read yet. + Identity: testUtils.ClientIdentity(3), // This identity can not read yet. Request: ` query { @@ -124,9 +124,9 @@ func TestACP_ManagerGivesReadAccessToAnotherActor_OtherActorCanRead(t *testing.T }, testUtils.AddDocActorRelationship{ // Make admin / manager - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -138,9 +138,9 @@ func TestACP_ManagerGivesReadAccessToAnotherActor_OtherActorCanRead(t *testing.T }, testUtils.AddDocActorRelationship{ // Admin makes another actor a reader - RequestorIdentity: testUtils.UserIdentity(2), + RequestorIdentity: testUtils.ClientIdentity(2), - TargetIdentity: testUtils.UserIdentity(3), + TargetIdentity: testUtils.ClientIdentity(3), CollectionID: 0, @@ -152,7 +152,7 @@ func TestACP_ManagerGivesReadAccessToAnotherActor_OtherActorCanRead(t *testing.T }, testUtils.Request{ - Identity: testUtils.UserIdentity(3), // The other actor can read + Identity: testUtils.ClientIdentity(3), // The other actor can read Request: ` query { @@ -178,7 +178,7 @@ func TestACP_ManagerGivesReadAccessToAnotherActor_OtherActorCanRead(t *testing.T testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(3), // The other actor can not update + Identity: testUtils.ClientIdentity(3), // The other actor can not update DocID: 0, @@ -194,7 +194,7 @@ func TestACP_ManagerGivesReadAccessToAnotherActor_OtherActorCanRead(t *testing.T testUtils.DeleteDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(3), // The other actor can not delete + Identity: testUtils.ClientIdentity(3), // The other actor can not delete DocID: 0, @@ -216,7 +216,7 @@ func TestACP_ManagerGivesWriteAccessToAnotherActor_OtherActorCanWrite(t *testing Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -280,7 +280,7 @@ func TestACP_ManagerGivesWriteAccessToAnotherActor_OtherActorCanWrite(t *testing }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -293,7 +293,7 @@ func TestACP_ManagerGivesWriteAccessToAnotherActor_OtherActorCanWrite(t *testing }, testUtils.Request{ - Identity: testUtils.UserIdentity(3), // This identity can not read yet. + Identity: testUtils.ClientIdentity(3), // This identity can not read yet. Request: ` query { @@ -311,9 +311,9 @@ func TestACP_ManagerGivesWriteAccessToAnotherActor_OtherActorCanWrite(t *testing }, testUtils.AddDocActorRelationship{ // Make admin / manager - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -325,9 +325,9 @@ func TestACP_ManagerGivesWriteAccessToAnotherActor_OtherActorCanWrite(t *testing }, testUtils.AddDocActorRelationship{ // Admin makes another actor a writer - RequestorIdentity: testUtils.UserIdentity(2), + RequestorIdentity: testUtils.ClientIdentity(2), - TargetIdentity: testUtils.UserIdentity(3), + TargetIdentity: testUtils.ClientIdentity(3), CollectionID: 0, @@ -341,7 +341,7 @@ func TestACP_ManagerGivesWriteAccessToAnotherActor_OtherActorCanWrite(t *testing testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(3), // The other actor can update + Identity: testUtils.ClientIdentity(3), // The other actor can update DocID: 0, @@ -353,7 +353,7 @@ func TestACP_ManagerGivesWriteAccessToAnotherActor_OtherActorCanWrite(t *testing }, testUtils.Request{ - Identity: testUtils.UserIdentity(3), // The other actor can read + Identity: testUtils.ClientIdentity(3), // The other actor can read Request: ` query { @@ -379,13 +379,13 @@ func TestACP_ManagerGivesWriteAccessToAnotherActor_OtherActorCanWrite(t *testing testUtils.DeleteDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(3), // The other actor can delete + Identity: testUtils.ClientIdentity(3), // The other actor can delete DocID: 0, }, testUtils.Request{ - Identity: testUtils.UserIdentity(3), + Identity: testUtils.ClientIdentity(3), Request: ` query { @@ -417,7 +417,7 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAccess_ManagerCanRead(t *testi Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -481,7 +481,7 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAccess_ManagerCanRead(t *testi }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -494,7 +494,7 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAccess_ManagerCanRead(t *testi }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity (to be manager) can not read yet. + Identity: testUtils.ClientIdentity(2), // This identity (to be manager) can not read yet. Request: ` query { @@ -512,9 +512,9 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAccess_ManagerCanRead(t *testi }, testUtils.AddDocActorRelationship{ // Make admin / manager - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -526,9 +526,9 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAccess_ManagerCanRead(t *testi }, testUtils.AddDocActorRelationship{ // Manager makes itself a reader - RequestorIdentity: testUtils.UserIdentity(2), + RequestorIdentity: testUtils.ClientIdentity(2), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -540,7 +540,7 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAccess_ManagerCanRead(t *testi }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // Manager can read now + Identity: testUtils.ClientIdentity(2), // Manager can read now Request: ` query { @@ -566,7 +566,7 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAccess_ManagerCanRead(t *testi testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // Manager still can't update + Identity: testUtils.ClientIdentity(2), // Manager still can't update DocID: 0, @@ -582,7 +582,7 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAccess_ManagerCanRead(t *testi testUtils.DeleteDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // Manager still can't delete + Identity: testUtils.ClientIdentity(2), // Manager still can't delete DocID: 0, @@ -609,7 +609,7 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAndWriteAccess_ManagerCanReadA Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -674,7 +674,7 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAndWriteAccess_ManagerCanReadA }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -687,7 +687,7 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAndWriteAccess_ManagerCanReadA }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity (to be manager) can not read yet. + Identity: testUtils.ClientIdentity(2), // This identity (to be manager) can not read yet. Request: ` query { @@ -707,7 +707,7 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAndWriteAccess_ManagerCanReadA testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // Manager can't update yet. + Identity: testUtils.ClientIdentity(2), // Manager can't update yet. DocID: 0, @@ -723,7 +723,7 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAndWriteAccess_ManagerCanReadA testUtils.DeleteDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // Manager can't delete yet. + Identity: testUtils.ClientIdentity(2), // Manager can't delete yet. DocID: 0, @@ -731,9 +731,9 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAndWriteAccess_ManagerCanReadA }, testUtils.AddDocActorRelationship{ // Make admin / manager - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -745,9 +745,9 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAndWriteAccess_ManagerCanReadA }, testUtils.AddDocActorRelationship{ // Manager makes itself a writer - RequestorIdentity: testUtils.UserIdentity(2), + RequestorIdentity: testUtils.ClientIdentity(2), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -760,9 +760,9 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAndWriteAccess_ManagerCanReadA // Note: It is not neccesary to make itself a reader, as becoming a writer allows reading. testUtils.AddDocActorRelationship{ // Manager makes itself a reader - RequestorIdentity: testUtils.UserIdentity(2), + RequestorIdentity: testUtils.ClientIdentity(2), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -776,7 +776,7 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAndWriteAccess_ManagerCanReadA testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // Manager can now update. + Identity: testUtils.ClientIdentity(2), // Manager can now update. DocID: 0, @@ -788,7 +788,7 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAndWriteAccess_ManagerCanReadA }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // Manager can read now + Identity: testUtils.ClientIdentity(2), // Manager can read now Request: ` query { @@ -814,13 +814,13 @@ func TestACP_OwnerMakesAManagerThatGivesItSelfReadAndWriteAccess_ManagerCanReadA testUtils.DeleteDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // Manager can now delete. + Identity: testUtils.ClientIdentity(2), // Manager can now delete. DocID: 0, }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // Make sure manager was able to delete the document. + Identity: testUtils.ClientIdentity(2), // Make sure manager was able to delete the document. Request: ` query { @@ -857,7 +857,7 @@ func TestACP_ManagerAddsRelationshipWithRelationItDoesNotManageAccordingToPolicy Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -921,7 +921,7 @@ func TestACP_ManagerAddsRelationshipWithRelationItDoesNotManageAccordingToPolicy }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -934,9 +934,9 @@ func TestACP_ManagerAddsRelationshipWithRelationItDoesNotManageAccordingToPolicy }, testUtils.AddDocActorRelationship{ // Make admin / manager - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -948,9 +948,9 @@ func TestACP_ManagerAddsRelationshipWithRelationItDoesNotManageAccordingToPolicy }, testUtils.AddDocActorRelationship{ // Admin tries to make another actor a writer - RequestorIdentity: testUtils.UserIdentity(2), + RequestorIdentity: testUtils.ClientIdentity(2), - TargetIdentity: testUtils.UserIdentity(3), + TargetIdentity: testUtils.ClientIdentity(3), CollectionID: 0, @@ -962,7 +962,7 @@ func TestACP_ManagerAddsRelationshipWithRelationItDoesNotManageAccordingToPolicy }, testUtils.Request{ - Identity: testUtils.UserIdentity(3), // The other actor can't read + Identity: testUtils.ClientIdentity(3), // The other actor can't read Request: ` query { @@ -982,7 +982,7 @@ func TestACP_ManagerAddsRelationshipWithRelationItDoesNotManageAccordingToPolicy testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(3), // The other actor can not update + Identity: testUtils.ClientIdentity(3), // The other actor can not update DocID: 0, @@ -998,7 +998,7 @@ func TestACP_ManagerAddsRelationshipWithRelationItDoesNotManageAccordingToPolicy testUtils.DeleteDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(3), // The other actor can not delete + Identity: testUtils.ClientIdentity(3), // The other actor can not delete DocID: 0, @@ -1025,7 +1025,7 @@ func TestACP_OwnerMakesManagerButManagerCanNotPerformOperations_ManagerCantReadO Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -1089,7 +1089,7 @@ func TestACP_OwnerMakesManagerButManagerCanNotPerformOperations_ManagerCantReadO }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -1102,9 +1102,9 @@ func TestACP_OwnerMakesManagerButManagerCanNotPerformOperations_ManagerCantReadO }, testUtils.AddDocActorRelationship{ // Make admin / manager - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -1116,7 +1116,7 @@ func TestACP_OwnerMakesManagerButManagerCanNotPerformOperations_ManagerCantReadO }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // Manager can not read + Identity: testUtils.ClientIdentity(2), // Manager can not read Request: ` query { @@ -1136,7 +1136,7 @@ func TestACP_OwnerMakesManagerButManagerCanNotPerformOperations_ManagerCantReadO testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // Manager can not update. + Identity: testUtils.ClientIdentity(2), // Manager can not update. DocID: 0, @@ -1152,7 +1152,7 @@ func TestACP_OwnerMakesManagerButManagerCanNotPerformOperations_ManagerCantReadO testUtils.DeleteDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // Manager can not delete. + Identity: testUtils.ClientIdentity(2), // Manager can not delete. DocID: 0, @@ -1160,9 +1160,9 @@ func TestACP_OwnerMakesManagerButManagerCanNotPerformOperations_ManagerCantReadO }, testUtils.AddDocActorRelationship{ // Manager can manage only. - RequestorIdentity: testUtils.UserIdentity(2), + RequestorIdentity: testUtils.ClientIdentity(2), - TargetIdentity: testUtils.UserIdentity(3), + TargetIdentity: testUtils.ClientIdentity(3), CollectionID: 0, @@ -1188,7 +1188,7 @@ func TestACP_CantMakeRelationshipIfNotOwnerOrManager_Error(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -1252,7 +1252,7 @@ func TestACP_CantMakeRelationshipIfNotOwnerOrManager_Error(t *testing.T) { }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -1265,9 +1265,9 @@ func TestACP_CantMakeRelationshipIfNotOwnerOrManager_Error(t *testing.T) { }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(2), // This identity can not manage as not an admin yet + RequestorIdentity: testUtils.ClientIdentity(2), // This identity can not manage as not an admin yet - TargetIdentity: testUtils.UserIdentity(3), + TargetIdentity: testUtils.ClientIdentity(3), CollectionID: 0, diff --git a/tests/integration/acp/relationship/doc_actor/add/with_no_policy_on_collection_test.go b/tests/integration/acp/relationship/doc_actor/add/with_no_policy_on_collection_test.go index dcffd8bcd7..1f2d7eb1da 100644 --- a/tests/integration/acp/relationship/doc_actor/add/with_no_policy_on_collection_test.go +++ b/tests/integration/acp/relationship/doc_actor/add/with_no_policy_on_collection_test.go @@ -32,7 +32,7 @@ func TestACP_AddDocActorRelationshipWithCollectionThatHasNoPolicy_NotAllowedErro }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -45,9 +45,9 @@ func TestACP_AddDocActorRelationshipWithCollectionThatHasNoPolicy_NotAllowedErro }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, diff --git a/tests/integration/acp/relationship/doc_actor/add/with_only_write_gql_test.go b/tests/integration/acp/relationship/doc_actor/add/with_only_write_gql_test.go index 26f4ebaf0f..6a3f02f4ba 100644 --- a/tests/integration/acp/relationship/doc_actor/add/with_only_write_gql_test.go +++ b/tests/integration/acp/relationship/doc_actor/add/with_only_write_gql_test.go @@ -34,7 +34,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorWithoutExplicitReadPerm_GQ Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -98,7 +98,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorWithoutExplicitReadPerm_GQ }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -111,7 +111,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorWithoutExplicitReadPerm_GQ }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can not read yet. + Identity: testUtils.ClientIdentity(2), // This identity can not read yet. Request: ` query { @@ -131,7 +131,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorWithoutExplicitReadPerm_GQ testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // This identity can not update yet. + Identity: testUtils.ClientIdentity(2), // This identity can not update yet. DocID: 0, @@ -145,9 +145,9 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorWithoutExplicitReadPerm_GQ }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -161,7 +161,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorWithoutExplicitReadPerm_GQ testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // This identity can now update. + Identity: testUtils.ClientIdentity(2), // This identity can now update. DocID: 0, @@ -173,7 +173,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorWithoutExplicitReadPerm_GQ }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can now also read. + Identity: testUtils.ClientIdentity(2), // This identity can now also read. Request: ` query { diff --git a/tests/integration/acp/relationship/doc_actor/add/with_only_write_test.go b/tests/integration/acp/relationship/doc_actor/add/with_only_write_test.go index b014ad9d73..ccac9cd232 100644 --- a/tests/integration/acp/relationship/doc_actor/add/with_only_write_test.go +++ b/tests/integration/acp/relationship/doc_actor/add/with_only_write_test.go @@ -34,7 +34,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorWithoutExplicitReadPerm_Ot Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -98,7 +98,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorWithoutExplicitReadPerm_Ot }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -111,7 +111,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorWithoutExplicitReadPerm_Ot }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can not read yet. + Identity: testUtils.ClientIdentity(2), // This identity can not read yet. Request: ` query { @@ -131,7 +131,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorWithoutExplicitReadPerm_Ot testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // This identity can not update yet. + Identity: testUtils.ClientIdentity(2), // This identity can not update yet. DocID: 0, @@ -145,9 +145,9 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorWithoutExplicitReadPerm_Ot }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -161,7 +161,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorWithoutExplicitReadPerm_Ot testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // This identity can now update. + Identity: testUtils.ClientIdentity(2), // This identity can now update. DocID: 0, @@ -173,7 +173,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorWithoutExplicitReadPerm_Ot }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can now also read. + Identity: testUtils.ClientIdentity(2), // This identity can now also read. Request: ` query { @@ -211,7 +211,7 @@ func TestACP_OwnerGivesDeleteWriteAccessToAnotherActorWithoutExplicitReadPerm_Ot Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -275,7 +275,7 @@ func TestACP_OwnerGivesDeleteWriteAccessToAnotherActorWithoutExplicitReadPerm_Ot }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -288,7 +288,7 @@ func TestACP_OwnerGivesDeleteWriteAccessToAnotherActorWithoutExplicitReadPerm_Ot }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can not read yet. + Identity: testUtils.ClientIdentity(2), // This identity can not read yet. Request: ` query { @@ -308,7 +308,7 @@ func TestACP_OwnerGivesDeleteWriteAccessToAnotherActorWithoutExplicitReadPerm_Ot testUtils.DeleteDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // This identity can not delete yet. + Identity: testUtils.ClientIdentity(2), // This identity can not delete yet. DocID: 0, @@ -316,9 +316,9 @@ func TestACP_OwnerGivesDeleteWriteAccessToAnotherActorWithoutExplicitReadPerm_Ot }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -330,7 +330,7 @@ func TestACP_OwnerGivesDeleteWriteAccessToAnotherActorWithoutExplicitReadPerm_Ot }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can now read. + Identity: testUtils.ClientIdentity(2), // This identity can now read. Request: ` query { @@ -356,13 +356,13 @@ func TestACP_OwnerGivesDeleteWriteAccessToAnotherActorWithoutExplicitReadPerm_Ot testUtils.DeleteDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // This identity can now delete. + Identity: testUtils.ClientIdentity(2), // This identity can now delete. DocID: 0, }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // Check if actually deleted. + Identity: testUtils.ClientIdentity(2), // Check if actually deleted. Request: ` query { diff --git a/tests/integration/acp/relationship/doc_actor/add/with_public_document_test.go b/tests/integration/acp/relationship/doc_actor/add/with_public_document_test.go index 78391cbfad..3a8a11087c 100644 --- a/tests/integration/acp/relationship/doc_actor/add/with_public_document_test.go +++ b/tests/integration/acp/relationship/doc_actor/add/with_public_document_test.go @@ -27,7 +27,7 @@ func TestACP_AddDocActorRelationshipWithPublicDocument_CanAlreadyAccess_Error(t Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -102,7 +102,7 @@ func TestACP_AddDocActorRelationshipWithPublicDocument_CanAlreadyAccess_Error(t }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // Can read as it is a public document + Identity: testUtils.ClientIdentity(2), // Can read as it is a public document Request: ` query { @@ -126,9 +126,9 @@ func TestACP_AddDocActorRelationshipWithPublicDocument_CanAlreadyAccess_Error(t }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, diff --git a/tests/integration/acp/relationship/doc_actor/add/with_reader_gql_test.go b/tests/integration/acp/relationship/doc_actor/add/with_reader_gql_test.go index 6d24f5d221..f51861ec5c 100644 --- a/tests/integration/acp/relationship/doc_actor/add/with_reader_gql_test.go +++ b/tests/integration/acp/relationship/doc_actor/add/with_reader_gql_test.go @@ -34,7 +34,7 @@ func TestACP_OwnerGivesOnlyReadAccessToAnotherActor_GQL_OtherActorCanReadButNotU Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -98,7 +98,7 @@ func TestACP_OwnerGivesOnlyReadAccessToAnotherActor_GQL_OtherActorCanReadButNotU }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -111,7 +111,7 @@ func TestACP_OwnerGivesOnlyReadAccessToAnotherActor_GQL_OtherActorCanReadButNotU }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can not read yet. + Identity: testUtils.ClientIdentity(2), // This identity can not read yet. Request: ` query { @@ -131,7 +131,7 @@ func TestACP_OwnerGivesOnlyReadAccessToAnotherActor_GQL_OtherActorCanReadButNotU testUtils.UpdateDoc{ // Since it can't read, it can't update either. CollectionID: 0, - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), DocID: 0, @@ -145,9 +145,9 @@ func TestACP_OwnerGivesOnlyReadAccessToAnotherActor_GQL_OtherActorCanReadButNotU }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -159,7 +159,7 @@ func TestACP_OwnerGivesOnlyReadAccessToAnotherActor_GQL_OtherActorCanReadButNotU }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // Now this identity can read. + Identity: testUtils.ClientIdentity(2), // Now this identity can read. Request: ` query { @@ -185,7 +185,7 @@ func TestACP_OwnerGivesOnlyReadAccessToAnotherActor_GQL_OtherActorCanReadButNotU testUtils.UpdateDoc{ // But this actor still can't update. CollectionID: 0, - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), DocID: 0, diff --git a/tests/integration/acp/relationship/doc_actor/add/with_reader_test.go b/tests/integration/acp/relationship/doc_actor/add/with_reader_test.go index b851b6c77f..fd452c2d7d 100644 --- a/tests/integration/acp/relationship/doc_actor/add/with_reader_test.go +++ b/tests/integration/acp/relationship/doc_actor/add/with_reader_test.go @@ -29,7 +29,7 @@ func TestACP_OwnerGivesReadAccessToAnotherActorTwice_ShowThatTheRelationshipAlre Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -93,7 +93,7 @@ func TestACP_OwnerGivesReadAccessToAnotherActorTwice_ShowThatTheRelationshipAlre }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -106,7 +106,7 @@ func TestACP_OwnerGivesReadAccessToAnotherActorTwice_ShowThatTheRelationshipAlre }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can not read yet. + Identity: testUtils.ClientIdentity(2), // This identity can not read yet. Request: ` query { @@ -124,9 +124,9 @@ func TestACP_OwnerGivesReadAccessToAnotherActorTwice_ShowThatTheRelationshipAlre }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -138,9 +138,9 @@ func TestACP_OwnerGivesReadAccessToAnotherActorTwice_ShowThatTheRelationshipAlre }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -166,7 +166,7 @@ func TestACP_OwnerGivesReadAccessToAnotherActor_OtherActorCanRead(t *testing.T) Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -230,7 +230,7 @@ func TestACP_OwnerGivesReadAccessToAnotherActor_OtherActorCanRead(t *testing.T) }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -243,7 +243,7 @@ func TestACP_OwnerGivesReadAccessToAnotherActor_OtherActorCanRead(t *testing.T) }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can not read yet. + Identity: testUtils.ClientIdentity(2), // This identity can not read yet. Request: ` query { @@ -261,9 +261,9 @@ func TestACP_OwnerGivesReadAccessToAnotherActor_OtherActorCanRead(t *testing.T) }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -275,7 +275,7 @@ func TestACP_OwnerGivesReadAccessToAnotherActor_OtherActorCanRead(t *testing.T) }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // Now this identity can read. + Identity: testUtils.ClientIdentity(2), // Now this identity can read. Request: ` query { @@ -315,7 +315,7 @@ func TestACP_OwnerGivesReadAccessToAnotherActor_OtherActorCanReadSoCanTheOwner(t Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -379,7 +379,7 @@ func TestACP_OwnerGivesReadAccessToAnotherActor_OtherActorCanReadSoCanTheOwner(t }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -392,9 +392,9 @@ func TestACP_OwnerGivesReadAccessToAnotherActor_OtherActorCanReadSoCanTheOwner(t }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -406,7 +406,7 @@ func TestACP_OwnerGivesReadAccessToAnotherActor_OtherActorCanReadSoCanTheOwner(t }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // Now this identity can read. + Identity: testUtils.ClientIdentity(2), // Now this identity can read. Request: ` query { @@ -430,7 +430,7 @@ func TestACP_OwnerGivesReadAccessToAnotherActor_OtherActorCanReadSoCanTheOwner(t }, testUtils.Request{ - Identity: testUtils.UserIdentity(1), // And so can the owner (ownership not transferred). + Identity: testUtils.ClientIdentity(1), // And so can the owner (ownership not transferred). Request: ` query { @@ -473,7 +473,7 @@ func TestACP_OwnerGivesOnlyReadAccessToAnotherActor_OtherActorCanReadButNotUpdat Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -537,7 +537,7 @@ func TestACP_OwnerGivesOnlyReadAccessToAnotherActor_OtherActorCanReadButNotUpdat }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -550,7 +550,7 @@ func TestACP_OwnerGivesOnlyReadAccessToAnotherActor_OtherActorCanReadButNotUpdat }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can not read yet. + Identity: testUtils.ClientIdentity(2), // This identity can not read yet. Request: ` query { @@ -570,7 +570,7 @@ func TestACP_OwnerGivesOnlyReadAccessToAnotherActor_OtherActorCanReadButNotUpdat testUtils.UpdateDoc{ // Since it can't read, it can't update either. CollectionID: 0, - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), DocID: 0, @@ -584,9 +584,9 @@ func TestACP_OwnerGivesOnlyReadAccessToAnotherActor_OtherActorCanReadButNotUpdat }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -598,7 +598,7 @@ func TestACP_OwnerGivesOnlyReadAccessToAnotherActor_OtherActorCanReadButNotUpdat }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // Now this identity can read. + Identity: testUtils.ClientIdentity(2), // Now this identity can read. Request: ` query { @@ -624,7 +624,7 @@ func TestACP_OwnerGivesOnlyReadAccessToAnotherActor_OtherActorCanReadButNotUpdat testUtils.UpdateDoc{ // But this actor still can't update. CollectionID: 0, - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), DocID: 0, @@ -652,7 +652,7 @@ func TestACP_OwnerGivesOnlyReadAccessToAnotherActor_OtherActorCanReadButNotDelet Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -716,7 +716,7 @@ func TestACP_OwnerGivesOnlyReadAccessToAnotherActor_OtherActorCanReadButNotDelet }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -729,7 +729,7 @@ func TestACP_OwnerGivesOnlyReadAccessToAnotherActor_OtherActorCanReadButNotDelet }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can not read yet. + Identity: testUtils.ClientIdentity(2), // This identity can not read yet. Request: ` query { @@ -749,7 +749,7 @@ func TestACP_OwnerGivesOnlyReadAccessToAnotherActor_OtherActorCanReadButNotDelet testUtils.DeleteDoc{ // Since it can't read, it can't delete either. CollectionID: 0, - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), DocID: 0, @@ -757,9 +757,9 @@ func TestACP_OwnerGivesOnlyReadAccessToAnotherActor_OtherActorCanReadButNotDelet }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -771,7 +771,7 @@ func TestACP_OwnerGivesOnlyReadAccessToAnotherActor_OtherActorCanReadButNotDelet }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // Now this identity can read. + Identity: testUtils.ClientIdentity(2), // Now this identity can read. Request: ` query { @@ -797,7 +797,7 @@ func TestACP_OwnerGivesOnlyReadAccessToAnotherActor_OtherActorCanReadButNotDelet testUtils.DeleteDoc{ // But this actor still can't delete. CollectionID: 0, - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), DocID: 0, diff --git a/tests/integration/acp/relationship/doc_actor/add/with_update_gql_test.go b/tests/integration/acp/relationship/doc_actor/add/with_update_gql_test.go index 0c0c92fd3c..eff2be0f7d 100644 --- a/tests/integration/acp/relationship/doc_actor/add/with_update_gql_test.go +++ b/tests/integration/acp/relationship/doc_actor/add/with_update_gql_test.go @@ -34,7 +34,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorTwice_GQL_ShowThatTheRelat Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -98,7 +98,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorTwice_GQL_ShowThatTheRelat }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -111,7 +111,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorTwice_GQL_ShowThatTheRelat }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can not read yet. + Identity: testUtils.ClientIdentity(2), // This identity can not read yet. Request: ` query { @@ -131,7 +131,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorTwice_GQL_ShowThatTheRelat testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // This identity can not update yet. + Identity: testUtils.ClientIdentity(2), // This identity can not update yet. DocID: 0, @@ -145,9 +145,9 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorTwice_GQL_ShowThatTheRelat }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -159,9 +159,9 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorTwice_GQL_ShowThatTheRelat }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -192,7 +192,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActor_GQL_OtherActorCanUpdate(t Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -256,7 +256,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActor_GQL_OtherActorCanUpdate(t }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -269,7 +269,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActor_GQL_OtherActorCanUpdate(t }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can not read yet. + Identity: testUtils.ClientIdentity(2), // This identity can not read yet. Request: ` query { @@ -289,7 +289,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActor_GQL_OtherActorCanUpdate(t testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // This identity can not update yet. + Identity: testUtils.ClientIdentity(2), // This identity can not update yet. DocID: 0, @@ -303,9 +303,9 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActor_GQL_OtherActorCanUpdate(t }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -319,7 +319,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActor_GQL_OtherActorCanUpdate(t testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // This identity can now update. + Identity: testUtils.ClientIdentity(2), // This identity can now update. DocID: 0, @@ -331,7 +331,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActor_GQL_OtherActorCanUpdate(t }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can now also read. + Identity: testUtils.ClientIdentity(2), // This identity can now also read. Request: ` query { diff --git a/tests/integration/acp/relationship/doc_actor/add/with_update_test.go b/tests/integration/acp/relationship/doc_actor/add/with_update_test.go index 819ac6ea38..f6bf553356 100644 --- a/tests/integration/acp/relationship/doc_actor/add/with_update_test.go +++ b/tests/integration/acp/relationship/doc_actor/add/with_update_test.go @@ -34,7 +34,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorTwice_ShowThatTheRelations Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -98,7 +98,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorTwice_ShowThatTheRelations }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -111,7 +111,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorTwice_ShowThatTheRelations }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can not read yet. + Identity: testUtils.ClientIdentity(2), // This identity can not read yet. Request: ` query { @@ -131,7 +131,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorTwice_ShowThatTheRelations testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // This identity can not update yet. + Identity: testUtils.ClientIdentity(2), // This identity can not update yet. DocID: 0, @@ -145,9 +145,9 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorTwice_ShowThatTheRelations }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -159,9 +159,9 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActorTwice_ShowThatTheRelations }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -192,7 +192,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActor_OtherActorCanUpdate(t *te Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -256,7 +256,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActor_OtherActorCanUpdate(t *te }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -269,7 +269,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActor_OtherActorCanUpdate(t *te }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can not read yet. + Identity: testUtils.ClientIdentity(2), // This identity can not read yet. Request: ` query { @@ -289,7 +289,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActor_OtherActorCanUpdate(t *te testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // This identity can not update yet. + Identity: testUtils.ClientIdentity(2), // This identity can not update yet. DocID: 0, @@ -303,9 +303,9 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActor_OtherActorCanUpdate(t *te }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -319,7 +319,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActor_OtherActorCanUpdate(t *te testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // This identity can now update. + Identity: testUtils.ClientIdentity(2), // This identity can now update. DocID: 0, @@ -331,7 +331,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActor_OtherActorCanUpdate(t *te }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can now also read. + Identity: testUtils.ClientIdentity(2), // This identity can now also read. Request: ` query { @@ -369,7 +369,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActor_OtherActorCanUpdateSoCanT Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -433,7 +433,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActor_OtherActorCanUpdateSoCanT }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -446,9 +446,9 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActor_OtherActorCanUpdateSoCanT }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -462,7 +462,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActor_OtherActorCanUpdateSoCanT testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // This identity can now update. + Identity: testUtils.ClientIdentity(2), // This identity can now update. DocID: 0, @@ -474,7 +474,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActor_OtherActorCanUpdateSoCanT }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can now also read. + Identity: testUtils.ClientIdentity(2), // This identity can now also read. Request: ` query { @@ -500,7 +500,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActor_OtherActorCanUpdateSoCanT testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(1), // Owner can still also update (ownership not transferred) + Identity: testUtils.ClientIdentity(1), // Owner can still also update (ownership not transferred) DocID: 0, @@ -512,7 +512,7 @@ func TestACP_OwnerGivesUpdateWriteAccessToAnotherActor_OtherActorCanUpdateSoCanT }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // Owner can still also read (ownership not transferred) + Identity: testUtils.ClientIdentity(2), // Owner can still also read (ownership not transferred) Request: ` query { diff --git a/tests/integration/acp/relationship/doc_actor/delete/invalid_test.go b/tests/integration/acp/relationship/doc_actor/delete/invalid_test.go index 6db9891656..71bdcc9094 100644 --- a/tests/integration/acp/relationship/doc_actor/delete/invalid_test.go +++ b/tests/integration/acp/relationship/doc_actor/delete/invalid_test.go @@ -27,7 +27,7 @@ func TestACP_DeleteDocActorRelationshipMissingDocID_Error(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -91,7 +91,7 @@ func TestACP_DeleteDocActorRelationshipMissingDocID_Error(t *testing.T) { }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -104,9 +104,9 @@ func TestACP_DeleteDocActorRelationshipMissingDocID_Error(t *testing.T) { }, testUtils.DeleteDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -132,7 +132,7 @@ func TestACP_DeleteDocActorRelationshipMissingCollection_Error(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -196,7 +196,7 @@ func TestACP_DeleteDocActorRelationshipMissingCollection_Error(t *testing.T) { }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -209,9 +209,9 @@ func TestACP_DeleteDocActorRelationshipMissingCollection_Error(t *testing.T) { }, testUtils.DeleteDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: -1, @@ -237,7 +237,7 @@ func TestACP_DeleteDocActorRelationshipMissingRelationName_Error(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -301,7 +301,7 @@ func TestACP_DeleteDocActorRelationshipMissingRelationName_Error(t *testing.T) { }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -314,9 +314,9 @@ func TestACP_DeleteDocActorRelationshipMissingRelationName_Error(t *testing.T) { }, testUtils.DeleteDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -342,7 +342,7 @@ func TestACP_DeleteDocActorRelationshipMissingTargetActorName_Error(t *testing.T Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -406,7 +406,7 @@ func TestACP_DeleteDocActorRelationshipMissingTargetActorName_Error(t *testing.T }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -419,7 +419,7 @@ func TestACP_DeleteDocActorRelationshipMissingTargetActorName_Error(t *testing.T }, testUtils.DeleteDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), TargetIdentity: testUtils.NoIdentity(), @@ -447,7 +447,7 @@ func TestACP_DeleteDocActorRelationshipMissingReqestingIdentityName_Error(t *tes Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -511,7 +511,7 @@ func TestACP_DeleteDocActorRelationshipMissingReqestingIdentityName_Error(t *tes }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -526,7 +526,7 @@ func TestACP_DeleteDocActorRelationshipMissingReqestingIdentityName_Error(t *tes testUtils.DeleteDocActorRelationship{ RequestorIdentity: testUtils.NoIdentity(), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, diff --git a/tests/integration/acp/relationship/doc_actor/delete/with_delete_test.go b/tests/integration/acp/relationship/doc_actor/delete/with_delete_test.go index 631699c3d5..6857f4de16 100644 --- a/tests/integration/acp/relationship/doc_actor/delete/with_delete_test.go +++ b/tests/integration/acp/relationship/doc_actor/delete/with_delete_test.go @@ -27,7 +27,7 @@ func TestACP_OwnerRevokesDeleteWriteAccess_OtherActorCanNoLongerDelete(t *testin Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -92,7 +92,7 @@ func TestACP_OwnerRevokesDeleteWriteAccess_OtherActorCanNoLongerDelete(t *testin // Creating two documents because need one to do the test on after one is deleted. testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -104,7 +104,7 @@ func TestACP_OwnerRevokesDeleteWriteAccess_OtherActorCanNoLongerDelete(t *testin `, }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -118,9 +118,9 @@ func TestACP_OwnerRevokesDeleteWriteAccess_OtherActorCanNoLongerDelete(t *testin // Give access to the other actor to delete and read both documents. testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -131,9 +131,9 @@ func TestACP_OwnerRevokesDeleteWriteAccess_OtherActorCanNoLongerDelete(t *testin ExpectedExistence: false, }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -146,7 +146,7 @@ func TestACP_OwnerRevokesDeleteWriteAccess_OtherActorCanNoLongerDelete(t *testin // Now the other identity can read both and delete both of those documents testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can read. + Identity: testUtils.ClientIdentity(2), // This identity can read. Request: ` query { @@ -174,15 +174,15 @@ func TestACP_OwnerRevokesDeleteWriteAccess_OtherActorCanNoLongerDelete(t *testin testUtils.DeleteDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // This identity can also delete. + Identity: testUtils.ClientIdentity(2), // This identity can also delete. DocID: 1, }, testUtils.DeleteDocActorRelationship{ // Revoke access from being able to delete (and read) the document. - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -195,7 +195,7 @@ func TestACP_OwnerRevokesDeleteWriteAccess_OtherActorCanNoLongerDelete(t *testin // The other identity can neither delete nor read the other document anymore. testUtils.Request{ - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), Request: ` query { @@ -214,7 +214,7 @@ func TestACP_OwnerRevokesDeleteWriteAccess_OtherActorCanNoLongerDelete(t *testin testUtils.DeleteDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), DocID: 0, @@ -223,7 +223,7 @@ func TestACP_OwnerRevokesDeleteWriteAccess_OtherActorCanNoLongerDelete(t *testin // Ensure document was not accidentally deleted using owner identity. testUtils.Request{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Request: ` query { diff --git a/tests/integration/acp/relationship/doc_actor/delete/with_dummy_relation_test.go b/tests/integration/acp/relationship/doc_actor/delete/with_dummy_relation_test.go index ec54670a3b..e9e42b9f42 100644 --- a/tests/integration/acp/relationship/doc_actor/delete/with_dummy_relation_test.go +++ b/tests/integration/acp/relationship/doc_actor/delete/with_dummy_relation_test.go @@ -27,7 +27,7 @@ func TestACP_DeleteDocActorRelationshipWithDummyRelationDefinedOnPolicy_NothingC Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -91,7 +91,7 @@ func TestACP_DeleteDocActorRelationshipWithDummyRelationDefinedOnPolicy_NothingC }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -104,7 +104,7 @@ func TestACP_DeleteDocActorRelationshipWithDummyRelationDefinedOnPolicy_NothingC }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can not read yet. + Identity: testUtils.ClientIdentity(2), // This identity can not read yet. Request: ` query { @@ -122,9 +122,9 @@ func TestACP_DeleteDocActorRelationshipWithDummyRelationDefinedOnPolicy_NothingC }, testUtils.DeleteDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -136,7 +136,7 @@ func TestACP_DeleteDocActorRelationshipWithDummyRelationDefinedOnPolicy_NothingC }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can still not read. + Identity: testUtils.ClientIdentity(2), // This identity can still not read. Request: ` query { @@ -168,7 +168,7 @@ func TestACP_DeleteDocActorRelationshipWithDummyRelationNotDefinedOnPolicy_Error Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -232,7 +232,7 @@ func TestACP_DeleteDocActorRelationshipWithDummyRelationNotDefinedOnPolicy_Error }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -245,7 +245,7 @@ func TestACP_DeleteDocActorRelationshipWithDummyRelationNotDefinedOnPolicy_Error }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can not read yet. + Identity: testUtils.ClientIdentity(2), // This identity can not read yet. Request: ` query { @@ -263,9 +263,9 @@ func TestACP_DeleteDocActorRelationshipWithDummyRelationNotDefinedOnPolicy_Error }, testUtils.DeleteDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -277,7 +277,7 @@ func TestACP_DeleteDocActorRelationshipWithDummyRelationNotDefinedOnPolicy_Error }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can still not read. + Identity: testUtils.ClientIdentity(2), // This identity can still not read. Request: ` query { diff --git a/tests/integration/acp/relationship/doc_actor/delete/with_manager_test.go b/tests/integration/acp/relationship/doc_actor/delete/with_manager_test.go index da77e8602d..779e2d6e62 100644 --- a/tests/integration/acp/relationship/doc_actor/delete/with_manager_test.go +++ b/tests/integration/acp/relationship/doc_actor/delete/with_manager_test.go @@ -27,7 +27,7 @@ func TestACP_ManagerRevokesReadAccess_OtherActorCanNoLongerRead(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -91,7 +91,7 @@ func TestACP_ManagerRevokesReadAccess_OtherActorCanNoLongerRead(t *testing.T) { }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -104,9 +104,9 @@ func TestACP_ManagerRevokesReadAccess_OtherActorCanNoLongerRead(t *testing.T) { }, testUtils.AddDocActorRelationship{ // Owner makes admin / manager - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -118,9 +118,9 @@ func TestACP_ManagerRevokesReadAccess_OtherActorCanNoLongerRead(t *testing.T) { }, testUtils.AddDocActorRelationship{ // Owner gives an actor read access - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(3), + TargetIdentity: testUtils.ClientIdentity(3), CollectionID: 0, @@ -132,7 +132,7 @@ func TestACP_ManagerRevokesReadAccess_OtherActorCanNoLongerRead(t *testing.T) { }, testUtils.Request{ - Identity: testUtils.UserIdentity(3), // The other actor can read + Identity: testUtils.ClientIdentity(3), // The other actor can read Request: ` query { @@ -154,9 +154,9 @@ func TestACP_ManagerRevokesReadAccess_OtherActorCanNoLongerRead(t *testing.T) { }, testUtils.DeleteDocActorRelationship{ // Admin revokes access of the other actor that could read. - RequestorIdentity: testUtils.UserIdentity(2), + RequestorIdentity: testUtils.ClientIdentity(2), - TargetIdentity: testUtils.UserIdentity(3), + TargetIdentity: testUtils.ClientIdentity(3), CollectionID: 0, @@ -169,7 +169,7 @@ func TestACP_ManagerRevokesReadAccess_OtherActorCanNoLongerRead(t *testing.T) { // The other actor can no longer read. testUtils.Request{ - Identity: testUtils.UserIdentity(3), + Identity: testUtils.ClientIdentity(3), Request: ` query { @@ -200,7 +200,7 @@ func TestACP_OwnerRevokesManagersAccess_ManagerCanNoLongerManageOthers(t *testin Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -264,7 +264,7 @@ func TestACP_OwnerRevokesManagersAccess_ManagerCanNoLongerManageOthers(t *testin }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -277,9 +277,9 @@ func TestACP_OwnerRevokesManagersAccess_ManagerCanNoLongerManageOthers(t *testin }, testUtils.AddDocActorRelationship{ // Owner makes admin / manager - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -291,9 +291,9 @@ func TestACP_OwnerRevokesManagersAccess_ManagerCanNoLongerManageOthers(t *testin }, testUtils.AddDocActorRelationship{ // Manager gives an actor read access - RequestorIdentity: testUtils.UserIdentity(2), + RequestorIdentity: testUtils.ClientIdentity(2), - TargetIdentity: testUtils.UserIdentity(3), + TargetIdentity: testUtils.ClientIdentity(3), CollectionID: 0, @@ -305,7 +305,7 @@ func TestACP_OwnerRevokesManagersAccess_ManagerCanNoLongerManageOthers(t *testin }, testUtils.Request{ - Identity: testUtils.UserIdentity(3), // The other actor can read + Identity: testUtils.ClientIdentity(3), // The other actor can read Request: ` query { @@ -327,9 +327,9 @@ func TestACP_OwnerRevokesManagersAccess_ManagerCanNoLongerManageOthers(t *testin }, testUtils.DeleteDocActorRelationship{ // Admin revokes access of the admin. - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -341,9 +341,9 @@ func TestACP_OwnerRevokesManagersAccess_ManagerCanNoLongerManageOthers(t *testin }, testUtils.AddDocActorRelationship{ // Manager can no longer grant read access. - RequestorIdentity: testUtils.UserIdentity(2), + RequestorIdentity: testUtils.ClientIdentity(2), - TargetIdentity: testUtils.UserIdentity(4), // This identity has no access previously. + TargetIdentity: testUtils.ClientIdentity(4), // This identity has no access previously. CollectionID: 0, @@ -355,7 +355,7 @@ func TestACP_OwnerRevokesManagersAccess_ManagerCanNoLongerManageOthers(t *testin }, testUtils.Request{ - Identity: testUtils.UserIdentity(4), // The other actor can ofcourse still not read. + Identity: testUtils.ClientIdentity(4), // The other actor can ofcourse still not read. Request: ` query { @@ -386,7 +386,7 @@ func TestACP_AdminTriesToRevokeOwnersAccess_NotAllowedError(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -450,7 +450,7 @@ func TestACP_AdminTriesToRevokeOwnersAccess_NotAllowedError(t *testing.T) { }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -463,9 +463,9 @@ func TestACP_AdminTriesToRevokeOwnersAccess_NotAllowedError(t *testing.T) { }, testUtils.AddDocActorRelationship{ // Owner makes admin / manager - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -477,9 +477,9 @@ func TestACP_AdminTriesToRevokeOwnersAccess_NotAllowedError(t *testing.T) { }, testUtils.DeleteDocActorRelationship{ // Admin tries to revoke owners `owner` relation. - RequestorIdentity: testUtils.UserIdentity(2), + RequestorIdentity: testUtils.ClientIdentity(2), - TargetIdentity: testUtils.UserIdentity(1), + TargetIdentity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -491,9 +491,9 @@ func TestACP_AdminTriesToRevokeOwnersAccess_NotAllowedError(t *testing.T) { }, testUtils.DeleteDocActorRelationship{ // Owner can still perform owner operations, like restrict admin. - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -505,7 +505,7 @@ func TestACP_AdminTriesToRevokeOwnersAccess_NotAllowedError(t *testing.T) { }, testUtils.Request{ - Identity: testUtils.UserIdentity(1), // The owner can still read + Identity: testUtils.ClientIdentity(1), // The owner can still read Request: ` query { diff --git a/tests/integration/acp/relationship/doc_actor/delete/with_no_policy_on_collection_test.go b/tests/integration/acp/relationship/doc_actor/delete/with_no_policy_on_collection_test.go index 0cd9812817..467759f4fd 100644 --- a/tests/integration/acp/relationship/doc_actor/delete/with_no_policy_on_collection_test.go +++ b/tests/integration/acp/relationship/doc_actor/delete/with_no_policy_on_collection_test.go @@ -32,7 +32,7 @@ func TestACP_DeleteDocActorRelationshipWithCollectionThatHasNoPolicy_NotAllowedE }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -45,9 +45,9 @@ func TestACP_DeleteDocActorRelationshipWithCollectionThatHasNoPolicy_NotAllowedE }, testUtils.DeleteDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, diff --git a/tests/integration/acp/relationship/doc_actor/delete/with_public_document_test.go b/tests/integration/acp/relationship/doc_actor/delete/with_public_document_test.go index 357bb3fc7c..906055c89b 100644 --- a/tests/integration/acp/relationship/doc_actor/delete/with_public_document_test.go +++ b/tests/integration/acp/relationship/doc_actor/delete/with_public_document_test.go @@ -27,7 +27,7 @@ func TestACP_DeleteDocActorRelationshipWithPublicDocument_CanAlreadyAccess_Error Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -102,7 +102,7 @@ func TestACP_DeleteDocActorRelationshipWithPublicDocument_CanAlreadyAccess_Error }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // Can read as it is a public document + Identity: testUtils.ClientIdentity(2), // Can read as it is a public document Request: ` query { @@ -126,9 +126,9 @@ func TestACP_DeleteDocActorRelationshipWithPublicDocument_CanAlreadyAccess_Error }, testUtils.DeleteDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, diff --git a/tests/integration/acp/relationship/doc_actor/delete/with_reader_test.go b/tests/integration/acp/relationship/doc_actor/delete/with_reader_test.go index d1612d90b0..52472ea897 100644 --- a/tests/integration/acp/relationship/doc_actor/delete/with_reader_test.go +++ b/tests/integration/acp/relationship/doc_actor/delete/with_reader_test.go @@ -27,7 +27,7 @@ func TestACP_OwnerRevokesReadAccessTwice_ShowThatTheRecordWasNotFoundSecondTime( Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -91,7 +91,7 @@ func TestACP_OwnerRevokesReadAccessTwice_ShowThatTheRecordWasNotFoundSecondTime( }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -104,9 +104,9 @@ func TestACP_OwnerRevokesReadAccessTwice_ShowThatTheRecordWasNotFoundSecondTime( }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -118,9 +118,9 @@ func TestACP_OwnerRevokesReadAccessTwice_ShowThatTheRecordWasNotFoundSecondTime( }, testUtils.DeleteDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -132,9 +132,9 @@ func TestACP_OwnerRevokesReadAccessTwice_ShowThatTheRecordWasNotFoundSecondTime( }, testUtils.DeleteDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -160,7 +160,7 @@ func TestACP_OwnerRevokesGivenReadAccess_OtherActorCanNoLongerRead(t *testing.T) Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -224,7 +224,7 @@ func TestACP_OwnerRevokesGivenReadAccess_OtherActorCanNoLongerRead(t *testing.T) }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -237,9 +237,9 @@ func TestACP_OwnerRevokesGivenReadAccess_OtherActorCanNoLongerRead(t *testing.T) }, testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -251,7 +251,7 @@ func TestACP_OwnerRevokesGivenReadAccess_OtherActorCanNoLongerRead(t *testing.T) }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can read. + Identity: testUtils.ClientIdentity(2), // This identity can read. Request: ` query { @@ -275,9 +275,9 @@ func TestACP_OwnerRevokesGivenReadAccess_OtherActorCanNoLongerRead(t *testing.T) }, testUtils.DeleteDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -289,7 +289,7 @@ func TestACP_OwnerRevokesGivenReadAccess_OtherActorCanNoLongerRead(t *testing.T) }, testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can not read anymore. + Identity: testUtils.ClientIdentity(2), // This identity can not read anymore. Request: ` query { diff --git a/tests/integration/acp/relationship/doc_actor/delete/with_self_test.go b/tests/integration/acp/relationship/doc_actor/delete/with_self_test.go index 31db6a5aa9..a732284a0c 100644 --- a/tests/integration/acp/relationship/doc_actor/delete/with_self_test.go +++ b/tests/integration/acp/relationship/doc_actor/delete/with_self_test.go @@ -27,7 +27,7 @@ func TestACP_AdminTriesToRevokeItsOwnAccess_NotAllowedError(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -91,7 +91,7 @@ func TestACP_AdminTriesToRevokeItsOwnAccess_NotAllowedError(t *testing.T) { }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -104,9 +104,9 @@ func TestACP_AdminTriesToRevokeItsOwnAccess_NotAllowedError(t *testing.T) { }, testUtils.AddDocActorRelationship{ // Owner makes admin / manager - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -118,9 +118,9 @@ func TestACP_AdminTriesToRevokeItsOwnAccess_NotAllowedError(t *testing.T) { }, testUtils.DeleteDocActorRelationship{ // Admin tries to revoke it's own relation. - RequestorIdentity: testUtils.UserIdentity(2), + RequestorIdentity: testUtils.ClientIdentity(2), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -132,9 +132,9 @@ func TestACP_AdminTriesToRevokeItsOwnAccess_NotAllowedError(t *testing.T) { }, testUtils.AddDocActorRelationship{ // Admin can still perform admin operations. - RequestorIdentity: testUtils.UserIdentity(2), + RequestorIdentity: testUtils.ClientIdentity(2), - TargetIdentity: testUtils.UserIdentity(3), + TargetIdentity: testUtils.ClientIdentity(3), CollectionID: 0, @@ -160,7 +160,7 @@ func TestACP_OwnerTriesToRevokeItsOwnAccess_NotAllowedError(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -224,7 +224,7 @@ func TestACP_OwnerTriesToRevokeItsOwnAccess_NotAllowedError(t *testing.T) { }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -237,9 +237,9 @@ func TestACP_OwnerTriesToRevokeItsOwnAccess_NotAllowedError(t *testing.T) { }, testUtils.DeleteDocActorRelationship{ // Owner tries to revoke it's own relation. - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(1), + TargetIdentity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -251,9 +251,9 @@ func TestACP_OwnerTriesToRevokeItsOwnAccess_NotAllowedError(t *testing.T) { }, testUtils.AddDocActorRelationship{ // Owner can still perform admin operations. - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, diff --git a/tests/integration/acp/relationship/doc_actor/delete/with_update_test.go b/tests/integration/acp/relationship/doc_actor/delete/with_update_test.go index 0a3b5547a5..22777e240d 100644 --- a/tests/integration/acp/relationship/doc_actor/delete/with_update_test.go +++ b/tests/integration/acp/relationship/doc_actor/delete/with_update_test.go @@ -34,7 +34,7 @@ func TestACP_OwnerRevokesUpdateWriteAccess_OtherActorCanNoLongerUpdate(t *testin Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -98,7 +98,7 @@ func TestACP_OwnerRevokesUpdateWriteAccess_OtherActorCanNoLongerUpdate(t *testin }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -112,9 +112,9 @@ func TestACP_OwnerRevokesUpdateWriteAccess_OtherActorCanNoLongerUpdate(t *testin // Give access to the other actor to update and read the document. testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -128,7 +128,7 @@ func TestACP_OwnerRevokesUpdateWriteAccess_OtherActorCanNoLongerUpdate(t *testin testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // This identity can update. + Identity: testUtils.ClientIdentity(2), // This identity can update. DocID: 0, @@ -141,7 +141,7 @@ func TestACP_OwnerRevokesUpdateWriteAccess_OtherActorCanNoLongerUpdate(t *testin // Ensure the other identity can read and update the document. testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can also read. + Identity: testUtils.ClientIdentity(2), // This identity can also read. Request: ` query { @@ -163,9 +163,9 @@ func TestACP_OwnerRevokesUpdateWriteAccess_OtherActorCanNoLongerUpdate(t *testin }, testUtils.DeleteDocActorRelationship{ // Revoke access from being able to update (and read) the document. - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -178,7 +178,7 @@ func TestACP_OwnerRevokesUpdateWriteAccess_OtherActorCanNoLongerUpdate(t *testin // The other identity can neither update nor read the other document anymore. testUtils.Request{ - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), Request: ` query { @@ -197,7 +197,7 @@ func TestACP_OwnerRevokesUpdateWriteAccess_OtherActorCanNoLongerUpdate(t *testin testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), DocID: 0, @@ -212,7 +212,7 @@ func TestACP_OwnerRevokesUpdateWriteAccess_OtherActorCanNoLongerUpdate(t *testin // Ensure document was not accidentally updated using owner identity. testUtils.Request{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Request: ` query { @@ -253,7 +253,7 @@ func TestACP_OwnerRevokesUpdateWriteAccess_GQL_OtherActorCanNoLongerUpdate(t *te Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: Test Policy @@ -317,7 +317,7 @@ func TestACP_OwnerRevokesUpdateWriteAccess_GQL_OtherActorCanNoLongerUpdate(t *te }, testUtils.CreateDoc{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), CollectionID: 0, @@ -331,9 +331,9 @@ func TestACP_OwnerRevokesUpdateWriteAccess_GQL_OtherActorCanNoLongerUpdate(t *te // Give access to the other actor to update and read the document. testUtils.AddDocActorRelationship{ - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -347,7 +347,7 @@ func TestACP_OwnerRevokesUpdateWriteAccess_GQL_OtherActorCanNoLongerUpdate(t *te testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), // This identity can update. + Identity: testUtils.ClientIdentity(2), // This identity can update. DocID: 0, @@ -360,7 +360,7 @@ func TestACP_OwnerRevokesUpdateWriteAccess_GQL_OtherActorCanNoLongerUpdate(t *te // Ensure the other identity can read and update the document. testUtils.Request{ - Identity: testUtils.UserIdentity(2), // This identity can also read. + Identity: testUtils.ClientIdentity(2), // This identity can also read. Request: ` query { @@ -382,9 +382,9 @@ func TestACP_OwnerRevokesUpdateWriteAccess_GQL_OtherActorCanNoLongerUpdate(t *te }, testUtils.DeleteDocActorRelationship{ // Revoke access from being able to update (and read) the document. - RequestorIdentity: testUtils.UserIdentity(1), + RequestorIdentity: testUtils.ClientIdentity(1), - TargetIdentity: testUtils.UserIdentity(2), + TargetIdentity: testUtils.ClientIdentity(2), CollectionID: 0, @@ -397,7 +397,7 @@ func TestACP_OwnerRevokesUpdateWriteAccess_GQL_OtherActorCanNoLongerUpdate(t *te // The other identity can neither update nor read the other document anymore. testUtils.Request{ - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), Request: ` query { @@ -416,7 +416,7 @@ func TestACP_OwnerRevokesUpdateWriteAccess_GQL_OtherActorCanNoLongerUpdate(t *te testUtils.UpdateDoc{ CollectionID: 0, - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), DocID: 0, @@ -431,7 +431,7 @@ func TestACP_OwnerRevokesUpdateWriteAccess_GQL_OtherActorCanNoLongerUpdate(t *te // Ensure document was not accidentally updated using owner identity. testUtils.Request{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Request: ` query { diff --git a/tests/integration/acp/schema/add_dpi/accept_basic_dpi_fmts_test.go b/tests/integration/acp/schema/add_dpi/accept_basic_dpi_fmts_test.go index ce1c282d48..6249dbb77b 100644 --- a/tests/integration/acp/schema/add_dpi/accept_basic_dpi_fmts_test.go +++ b/tests/integration/acp/schema/add_dpi/accept_basic_dpi_fmts_test.go @@ -28,7 +28,7 @@ func TestACP_AddDPISchema_BasicYAML_SchemaAccepted(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -123,7 +123,7 @@ func TestACP_AddDPISchema_BasicJSON_SchemaAccepted(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` { diff --git a/tests/integration/acp/schema/add_dpi/accept_extra_permissions_on_dpi_test.go b/tests/integration/acp/schema/add_dpi/accept_extra_permissions_on_dpi_test.go index 3a5bbc87af..3b4c7d711c 100644 --- a/tests/integration/acp/schema/add_dpi/accept_extra_permissions_on_dpi_test.go +++ b/tests/integration/acp/schema/add_dpi/accept_extra_permissions_on_dpi_test.go @@ -29,7 +29,7 @@ func TestACP_AddDPISchema_WithExtraPermsHavingRequiredRelation_AcceptSchema(t *t testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -129,7 +129,7 @@ func TestACP_AddDPISchema_WithExtraPermsHavingRequiredRelationInTheEnd_AcceptSch testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -229,7 +229,7 @@ func TestACP_AddDPISchema_WithExtraPermsHavingNoRequiredRelation_AcceptSchema(t testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test diff --git a/tests/integration/acp/schema/add_dpi/accept_managed_relation_on_dpi_test.go b/tests/integration/acp/schema/add_dpi/accept_managed_relation_on_dpi_test.go index ba15d990d8..83b92a8721 100644 --- a/tests/integration/acp/schema/add_dpi/accept_managed_relation_on_dpi_test.go +++ b/tests/integration/acp/schema/add_dpi/accept_managed_relation_on_dpi_test.go @@ -29,7 +29,7 @@ func TestACP_AddDPISchema_WithManagedRelation_AcceptSchemas(t *testing.T) { testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test diff --git a/tests/integration/acp/schema/add_dpi/accept_mixed_resources_on_partial_dpi_test.go b/tests/integration/acp/schema/add_dpi/accept_mixed_resources_on_partial_dpi_test.go index a396d69bee..40b62afef9 100644 --- a/tests/integration/acp/schema/add_dpi/accept_mixed_resources_on_partial_dpi_test.go +++ b/tests/integration/acp/schema/add_dpi/accept_mixed_resources_on_partial_dpi_test.go @@ -29,7 +29,7 @@ func TestACP_AddDPISchema_PartialValidDPIButUseOnlyValidDPIResource_AcceptSchema testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test diff --git a/tests/integration/acp/schema/add_dpi/accept_multi_dpis_test.go b/tests/integration/acp/schema/add_dpi/accept_multi_dpis_test.go index 64fb1b7e34..b7aa43d22c 100644 --- a/tests/integration/acp/schema/add_dpi/accept_multi_dpis_test.go +++ b/tests/integration/acp/schema/add_dpi/accept_multi_dpis_test.go @@ -54,7 +54,7 @@ func TestACP_AddDPISchema_AddDuplicateDPIsByOtherCreatorsUseBoth_AcceptSchema(t Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: validDPIUsedByBoth, @@ -63,7 +63,7 @@ func TestACP_AddDPISchema_AddDuplicateDPIsByOtherCreatorsUseBoth_AcceptSchema(t testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(2), + Identity: testUtils.ClientIdentity(2), Policy: validDPIUsedByBoth, diff --git a/tests/integration/acp/schema/add_dpi/accept_multi_resources_on_dpi_test.go b/tests/integration/acp/schema/add_dpi/accept_multi_resources_on_dpi_test.go index 81625228e9..2e9a74a32e 100644 --- a/tests/integration/acp/schema/add_dpi/accept_multi_resources_on_dpi_test.go +++ b/tests/integration/acp/schema/add_dpi/accept_multi_resources_on_dpi_test.go @@ -29,7 +29,7 @@ func TestACP_AddDPISchema_WithMultipleResources_AcceptSchema(t *testing.T) { testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -139,7 +139,7 @@ func TestACP_AddDPISchema_WithMultipleResourcesBothBeingUsed_AcceptSchema(t *tes testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test diff --git a/tests/integration/acp/schema/add_dpi/accept_same_resource_on_diff_schemas_test.go b/tests/integration/acp/schema/add_dpi/accept_same_resource_on_diff_schemas_test.go index f1c547ec83..f296d98eee 100644 --- a/tests/integration/acp/schema/add_dpi/accept_same_resource_on_diff_schemas_test.go +++ b/tests/integration/acp/schema/add_dpi/accept_same_resource_on_diff_schemas_test.go @@ -30,7 +30,7 @@ func TestACP_AddDPISchema_UseSameResourceOnDifferentSchemas_AcceptSchemas(t *tes testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test diff --git a/tests/integration/acp/schema/add_dpi/reject_empty_arg_on_schema_test.go b/tests/integration/acp/schema/add_dpi/reject_empty_arg_on_schema_test.go index 420f86cc6a..7a40c69bc5 100644 --- a/tests/integration/acp/schema/add_dpi/reject_empty_arg_on_schema_test.go +++ b/tests/integration/acp/schema/add_dpi/reject_empty_arg_on_schema_test.go @@ -27,7 +27,7 @@ func TestACP_AddDPISchema_NoArgWasSpecifiedOnSchema_SchemaRejected(t *testing.T) testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -102,7 +102,7 @@ func TestACP_AddDPISchema_SpecifiedArgsAreEmptyOnSchema_SchemaRejected(t *testin testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test diff --git a/tests/integration/acp/schema/add_dpi/reject_invalid_arg_type_on_schema_test.go b/tests/integration/acp/schema/add_dpi/reject_invalid_arg_type_on_schema_test.go index e797e28b84..0d8b8c8e60 100644 --- a/tests/integration/acp/schema/add_dpi/reject_invalid_arg_type_on_schema_test.go +++ b/tests/integration/acp/schema/add_dpi/reject_invalid_arg_type_on_schema_test.go @@ -28,7 +28,7 @@ func TestACP_AddDPISchema_InvalidPolicyIDArgTypeWasSpecifiedOnSchema_SchemaRejec testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -103,7 +103,7 @@ func TestACP_AddDPISchema_InvalidResourceArgTypeWasSpecifiedOnSchema_SchemaRejec testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test diff --git a/tests/integration/acp/schema/add_dpi/reject_invalid_owner_read_perm_on_dpi_test.go b/tests/integration/acp/schema/add_dpi/reject_invalid_owner_read_perm_on_dpi_test.go index 7d43107ca6..c56f6a8f8a 100644 --- a/tests/integration/acp/schema/add_dpi/reject_invalid_owner_read_perm_on_dpi_test.go +++ b/tests/integration/acp/schema/add_dpi/reject_invalid_owner_read_perm_on_dpi_test.go @@ -28,7 +28,7 @@ func TestACP_AddDPISchema_OwnerMissingRequiredReadPermissionOnDPI_SchemaRejected testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -113,7 +113,7 @@ func TestACP_AddDPISchema_OwnerMissingRequiredReadPermissionLabelOnDPI_SchemaRej testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -197,7 +197,7 @@ func TestACP_AddDPISchema_OwnerSpecifiedIncorrectlyOnReadPermissionExprOnDPI_Sch testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -282,7 +282,7 @@ func TestACP_AddDPISchema_OwnerSpecifiedIncorrectlyOnReadPermissionNoSpaceExprOn testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -367,7 +367,7 @@ func TestACP_AddDPISchema_MaliciousOwnerSpecifiedOnReadPermissionExprOnDPI_Schem testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test diff --git a/tests/integration/acp/schema/add_dpi/reject_invalid_owner_read_perm_symbol_on_dpi_test.go b/tests/integration/acp/schema/add_dpi/reject_invalid_owner_read_perm_symbol_on_dpi_test.go index 50e2a232d8..a540b98ddd 100644 --- a/tests/integration/acp/schema/add_dpi/reject_invalid_owner_read_perm_symbol_on_dpi_test.go +++ b/tests/integration/acp/schema/add_dpi/reject_invalid_owner_read_perm_symbol_on_dpi_test.go @@ -28,7 +28,7 @@ func TestACP_AddDPISchema_OwnerRelationWithDifferenceSetOpOnReadPermissionExprOn testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -114,7 +114,7 @@ func TestACP_AddDPISchema_OwnerRelationWithIntersectionSetOpOnReadPermissionExpr testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -200,7 +200,7 @@ func TestACP_AddDPISchema_OwnerRelationWithInvalidSetOpOnReadPermissionExprOnDPI testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test diff --git a/tests/integration/acp/schema/add_dpi/reject_invalid_owner_write_perm_on_dpi_test.go b/tests/integration/acp/schema/add_dpi/reject_invalid_owner_write_perm_on_dpi_test.go index 97e2303e34..c203ed6eb0 100644 --- a/tests/integration/acp/schema/add_dpi/reject_invalid_owner_write_perm_on_dpi_test.go +++ b/tests/integration/acp/schema/add_dpi/reject_invalid_owner_write_perm_on_dpi_test.go @@ -28,7 +28,7 @@ func TestACP_AddDPISchema_OwnerMissingRequiredWritePermissionOnDPI_SchemaRejecte testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -113,7 +113,7 @@ func TestACP_AddDPISchema_OwnerMissingRequiredWritePermissionLabelOnDPI_SchemaRe testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -197,7 +197,7 @@ func TestACP_AddDPISchema_OwnerSpecifiedIncorrectlyOnWritePermissionExprOnDPI_Sc testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -282,7 +282,7 @@ func TestACP_AddDPISchema_OwnerSpecifiedIncorrectlyOnWritePermissionNoSpaceExprO testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -367,7 +367,7 @@ func TestACP_AddDPISchema_MaliciousOwnerSpecifiedOnWritePermissionExprOnDPI_Sche testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test diff --git a/tests/integration/acp/schema/add_dpi/reject_invalid_owner_write_perm_symbol_on_dpi_test.go b/tests/integration/acp/schema/add_dpi/reject_invalid_owner_write_perm_symbol_on_dpi_test.go index 330e320066..cb5c898c75 100644 --- a/tests/integration/acp/schema/add_dpi/reject_invalid_owner_write_perm_symbol_on_dpi_test.go +++ b/tests/integration/acp/schema/add_dpi/reject_invalid_owner_write_perm_symbol_on_dpi_test.go @@ -28,7 +28,7 @@ func TestACP_AddDPISchema_OwnerRelationWithDifferenceSetOpOnWritePermissionExprO testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -114,7 +114,7 @@ func TestACP_AddDPISchema_OwnerRelationWithIntersectionSetOpOnWritePermissionExp testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -200,7 +200,7 @@ func TestACP_AddDPISchema_OwnerRelationWithInvalidSetOpOnWritePermissionExprOnDP testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test diff --git a/tests/integration/acp/schema/add_dpi/reject_missing_dpi_test.go b/tests/integration/acp/schema/add_dpi/reject_missing_dpi_test.go index 6d131b9057..7c2bf74406 100644 --- a/tests/integration/acp/schema/add_dpi/reject_missing_dpi_test.go +++ b/tests/integration/acp/schema/add_dpi/reject_missing_dpi_test.go @@ -79,7 +79,7 @@ func TestACP_AddDPISchema_WhereAPolicyWasAddedButLinkedPolicyWasNotAdded_SchemaR testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test diff --git a/tests/integration/acp/schema/add_dpi/reject_missing_id_arg_on_schema_test.go b/tests/integration/acp/schema/add_dpi/reject_missing_id_arg_on_schema_test.go index f8d92ff528..2dd775a84f 100644 --- a/tests/integration/acp/schema/add_dpi/reject_missing_id_arg_on_schema_test.go +++ b/tests/integration/acp/schema/add_dpi/reject_missing_id_arg_on_schema_test.go @@ -27,7 +27,7 @@ func TestACP_AddDPISchema_NoPolicyIDWasSpecifiedOnSchema_SchemaRejected(t *testi testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -102,7 +102,7 @@ func TestACP_AddDPISchema_SpecifiedPolicyIDArgIsEmptyOnSchema_SchemaRejected(t * testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test diff --git a/tests/integration/acp/schema/add_dpi/reject_missing_perms_on_dpi_test.go b/tests/integration/acp/schema/add_dpi/reject_missing_perms_on_dpi_test.go index d613ad625a..8afbced697 100644 --- a/tests/integration/acp/schema/add_dpi/reject_missing_perms_on_dpi_test.go +++ b/tests/integration/acp/schema/add_dpi/reject_missing_perms_on_dpi_test.go @@ -28,7 +28,7 @@ func TestACP_AddDPISchema_MissingRequiredReadPermissionOnDPI_SchemaRejected(t *t testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test diff --git a/tests/integration/acp/schema/add_dpi/reject_missing_resource_arg_on_schema_test.go b/tests/integration/acp/schema/add_dpi/reject_missing_resource_arg_on_schema_test.go index b87a6ccab3..1a88260ec5 100644 --- a/tests/integration/acp/schema/add_dpi/reject_missing_resource_arg_on_schema_test.go +++ b/tests/integration/acp/schema/add_dpi/reject_missing_resource_arg_on_schema_test.go @@ -28,7 +28,7 @@ func TestACP_AddDPISchema_NoResourceWasSpecifiedOnSchema_SchemaRejected(t *testi testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test @@ -105,7 +105,7 @@ func TestACP_AddDPISchema_SpecifiedResourceArgIsEmptyOnSchema_SchemaRejected(t * testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test diff --git a/tests/integration/acp/schema/add_dpi/reject_missing_resource_on_dpi_test.go b/tests/integration/acp/schema/add_dpi/reject_missing_resource_on_dpi_test.go index 1999816d78..1be8d6bd97 100644 --- a/tests/integration/acp/schema/add_dpi/reject_missing_resource_on_dpi_test.go +++ b/tests/integration/acp/schema/add_dpi/reject_missing_resource_on_dpi_test.go @@ -28,7 +28,7 @@ func TestACP_AddDPISchema_SpecifiedResourceDoesNotExistOnDPI_SchemaRejected(t *t testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test diff --git a/tests/integration/acp/schema/add_dpi/reject_mixed_resources_on_partial_dpi_test.go b/tests/integration/acp/schema/add_dpi/reject_mixed_resources_on_partial_dpi_test.go index 710e332be2..97c3a6f215 100644 --- a/tests/integration/acp/schema/add_dpi/reject_mixed_resources_on_partial_dpi_test.go +++ b/tests/integration/acp/schema/add_dpi/reject_mixed_resources_on_partial_dpi_test.go @@ -28,7 +28,7 @@ func TestACP_AddDPISchema_PartialValidDPIButUseInValidDPIResource_RejectSchema(t testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test diff --git a/tests/integration/collection_description/updates/remove/policy_test.go b/tests/integration/collection_description/updates/remove/policy_test.go index 8c16776527..d0341e0958 100644 --- a/tests/integration/collection_description/updates/remove/policy_test.go +++ b/tests/integration/collection_description/updates/remove/policy_test.go @@ -21,7 +21,7 @@ func TestColDescrUpdateRemovePolicy_Errors(t *testing.T) { Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test diff --git a/tests/integration/collection_description/updates/replace/view_policy_test.go b/tests/integration/collection_description/updates/replace/view_policy_test.go index d09aea0648..20d61b664a 100644 --- a/tests/integration/collection_description/updates/replace/view_policy_test.go +++ b/tests/integration/collection_description/updates/replace/view_policy_test.go @@ -27,7 +27,7 @@ func TestColDescrUpdateReplaceIsMaterialized_GivenPolicyOnNonMAterializedView_Er }), Actions: []any{ testUtils.AddPolicy{ - Identity: testUtils.UserIdentity(1), + Identity: testUtils.ClientIdentity(1), Policy: ` name: test description: a test policy which marks a collection in a database as a resource diff --git a/tests/integration/identity.go b/tests/integration/identity.go index 7603ec4f9e..7c56d81375 100644 --- a/tests/integration/identity.go +++ b/tests/integration/identity.go @@ -23,8 +23,8 @@ import ( // identityRef is a type that refers to a specific identity of a certain type. type identityRef struct { - isUser bool - index int + isClient bool + index int } // NoIdentity returns an reference to an identity that represents no identity. @@ -32,19 +32,19 @@ func NoIdentity() immutable.Option[identityRef] { return immutable.None[identityRef]() } -// UserIdentity returns a reference to a user identity with a given index. -func UserIdentity(index int) immutable.Option[identityRef] { +// ClientIdentity returns a reference to a user identity with a given index. +func ClientIdentity(index int) immutable.Option[identityRef] { return immutable.Some(identityRef{ - isUser: true, - index: index, + isClient: true, + index: index, }) } // NodeIdentity returns a reference to a node identity with a given index. func NodeIdentity(index int) immutable.Option[identityRef] { return immutable.Some(identityRef{ - isUser: false, - index: index, + isClient: false, + index: index, }) }