From a3d72569fb8ce720dd82d1952e35aa6619437f06 Mon Sep 17 00:00:00 2001 From: Sagar Gurung <46086950+SagarGi@users.noreply.github.com> Date: Fri, 5 May 2023 18:00:04 +0545 Subject: [PATCH] Added GDPR export when user is added to a group (#6237) --- .../features/apiGraph/userGDPRExport.feature | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/tests/acceptance/features/apiGraph/userGDPRExport.feature b/tests/acceptance/features/apiGraph/userGDPRExport.feature index e0f0052ba1..9ab56bd196 100644 --- a/tests/acceptance/features/apiGraph/userGDPRExport.feature +++ b/tests/acceptance/features/apiGraph/userGDPRExport.feature @@ -349,3 +349,108 @@ Feature: user GDPR (General Data Protection Regulation) report } } """ + + + Scenario: generate a GDPR report and check events when a user is added to a group + Given group "tea-lover" has been created + And user "Alice" has been added to group "tea-lover" + When user "Alice" exports her GDPR report to "/.personal_data_export.json" using the Graph API + And user "Alice" downloads the content of GDPR report ".personal_data_export.json" + Then the HTTP status code of responses on each endpoint should be "201, 200" respectively + And the downloaded JSON content should contain event type "events.GroupMemberAdded" in item 'events' and should match + """ + { + "type": "object", + "required": [ + "event" + ], + "properties": { + "event" : { + "type": "object", + "required": [ + "Executant", + "GroupID", + "UserID" + ], + "properties": { + "Executant": { + "type": "object", + "required": [ + "idp", + "opaque_id", + "type" + ], + "properties": { + "idp": { + "type": "string", + "pattern": "^%base_url%$" + }, + "opaque_id": { + "type": "string", + "pattern": "^%user_id_pattern%$" + }, + "type": { + "type": "number", + "enum": [1] + } + } + }, + "GroupID": { + "type": "string", + "pattern": "^%group_id_pattern%$" + }, + "UserID": { + "type": "string", + "pattern": "^%user_id_pattern%$" + } + } + } + } + } + """ + And the downloaded JSON content should contain key 'user' and match + """ + { + "type": "object", + "required": [ + "id", + "username", + "mail", + "display_name", + "groups", + "uid_number", + "gid_number" + ], + "properties": { + "username": { + "type": "string", + "enum": ["Alice"] + }, + "mail": { + "type": "string", + "enum": ["alice@example.org"] + }, + "display_name": { + "type": "string", + "enum": ["Alice Hansen"] + }, + "groups": { + "type": "array", + "items": [ + { + "type": "string", + "pattern": "^%group_id_pattern%$" + } + ] + }, + "uid_number": { + "type": "number", + "enum": [99] + }, + "gid_number": { + "type": "number", + "enum": [99] + } + } + } + """