Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only][full-ci]Added GDPR export for folder creation, sharing a file #6360

Merged
merged 4 commits into from
May 24, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
333 changes: 333 additions & 0 deletions tests/acceptance/features/apiGraph/userGDPRExport.feature
Original file line number Diff line number Diff line change
Expand Up @@ -518,3 +518,336 @@ Feature: user GDPR (General Data Protection Regulation) report
| Admin | User |
| Admin | Guest |
| Admin | Admin |


Scenario: generate a GDPR report and check events when user creates a folder
Given user "Alice" has created folder "/folderMain"
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.ContainerCreated" in item 'events' and should match
"""
{
"type": "object",
"required": [
"event"
],
"properties": {
"event" : {
"type": "object",
"required": [
"Executant",
"Owner",
"Ref",
"SpaceOwner"
],
"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]
}
}
},
"Ref": {
"type": "object",
"required": [
"path",
"resource_id"
],
"properties": {
"path" : {
"type": "string",
"enum": ["./folderMain"]
}
}
}
}
}
}
}
"""


Scenario: generate a GDPR report and check events when user creates a share for a folder
SagarGi marked this conversation as resolved.
Show resolved Hide resolved
Given user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has created folder "/folderMain"
And user "Alice" has shared entry "/folderMain" with user "Brian"
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.ShareCreated" in item 'events' and should match
"""
{
"type": "object",
"required": [
"event"
],
"properties": {
"event" : {
"type": "object",
"required": [
"CTime",
"Executant",
"GranteeGroupID",
"GranteeUserID",
"ItemID",
"Permissions",
"ShareID",
"Sharee",
"Sharer"
],
"properties": {
"GranteeGroupID": {
"type": ["number", "null"],
"enum": [null]
},
"Permissions": {
"type": "object",
"required": [
"permissions"
],
"properties": {
"permissions": {
"type": "object",
"required": [
"add_grant",
"get_path",
"get_quota",
"initiate_file_download",
"list_container",
"list_recycle",
"stat"
],
"properties": {
"add_grant" : {
"type": "boolean",
"enum": [true]
},
"get_path" : {
"type": "boolean",
"enum": [true]
},
"get_quota" : {
"type": "boolean",
"enum": [true]
},
"initiate_file_download" : {
"type": "boolean",
"enum": [true]
},
"list_container" : {
"type": "boolean",
"enum": [true]
},
"list_recycle" : {
"type": "boolean",
"enum": [true]
},
"stat" : {
"type": "boolean",
"enum": [true]
}
}
}
}
},
"ShareID": {
"type": "object",
"required": [
"opaque_id"
],
"properties": {
"type": "object",
"pattern": "^%user_id_pattern%:%user_id_pattern%:%user_id_pattern%$"
}
},
"Sharee": {
"type": ["number", "null"],
"enum": [null]
},
"Sharer": {
"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]
}
}
}
}
}
}
}
"""


Scenario: generate a GDPR report and check events when user creates a link for a resource
SagarGi marked this conversation as resolved.
Show resolved Hide resolved
Given user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has created folder "/folderMain"
And user "Alice" has created a public link share with settings
| path | /folderMain |
| name | sharedlink |
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.LinkCreated" in item 'events' and should match
"""
{
"type": "object",
"required": [
"event"
],
"properties": {
"event" : {
"type": "object",
"required": [
"CTime",
"DisplayName",
"Executant",
"Expiration",
"ItemID",
"PasswordProtected",
"Permissions",
"ShareID",
"Sharer",
"Token"
],
"properties": {
"DisplayName": {
"type": "string",
"enum": ["sharedlink"]
},
"Expiration": {
"type": ["string", "null"],
"enum": [null]
},
"PasswordProtected": {
"type": "boolean",
"enum": [false]
},
"Permissions": {
"type": "object",
"required": [
"permissions"
],
"properties": {
"permissions": {
"type": "object",
"required": [
"get_path",
"get_quota",
"initiate_file_download",
"list_container",
"list_recycle",
"stat"
],
"properties": {
"get_path" : {
"type": "boolean",
"enum": [true]
},
"get_quota" : {
"type": "boolean",
"enum": [true]
},
"initiate_file_download" : {
"type": "boolean",
"enum": [true]
},
"list_container" : {
"type": "boolean",
"enum": [true]
},
"list_recycle" : {
"type": "boolean",
"enum": [true]
},
"stat" : {
"type": "boolean",
"enum": [true]
}
}
}
}
},
"Token": {
"type": "string",
"pattern": "^[a-zA-Z]{15}$"
}
}
}
}
}
"""


Scenario: generate a GDPR report and check events when user deletes a resource
Given user "Alice" has created folder "/folderMain"
And user "Alice" has deleted folder "/folderMain"
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.ItemTrashed" in item 'events' and should match
"""
{
"type": "object",
"required": [
"event"
],
"properties": {
"event" : {
"type": "object",
"required": [
"Executant",
"Owner",
"ID",
"Ref",
"SpaceOwner"
],
"properties": {
"Ref": {
"type": "object",
"required": [
"path"
],
"properties": {
"path" : {
"type": "string",
"enum": ["./folderMain"]
}
}
}
}
}
}
}
"""