From f2c6163c98d514fc9b84822018db682527abb3d4 Mon Sep 17 00:00:00 2001 From: ilappe Date: Sun, 10 Mar 2024 15:50:09 +0200 Subject: [PATCH 1/3] fix the error --- Packs/GoogleDrive/Integrations/GoogleDrive/GoogleDrive.py | 3 +++ Packs/GoogleDrive/Integrations/GoogleDrive/GoogleDrive.yml | 7 +++++++ Packs/GoogleDrive/Integrations/GoogleDrive/README.md | 1 + Packs/GoogleDrive/ReleaseNotes/1_3_5.md | 6 ++++++ Packs/GoogleDrive/pack_metadata.json | 2 +- 5 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 Packs/GoogleDrive/ReleaseNotes/1_3_5.md diff --git a/Packs/GoogleDrive/Integrations/GoogleDrive/GoogleDrive.py b/Packs/GoogleDrive/Integrations/GoogleDrive/GoogleDrive.py index 851476f23ee1..bf1e54ff0507 100644 --- a/Packs/GoogleDrive/Integrations/GoogleDrive/GoogleDrive.py +++ b/Packs/GoogleDrive/Integrations/GoogleDrive/GoogleDrive.py @@ -1226,6 +1226,8 @@ def file_upload_command(client: 'GSuiteClient', args: dict[str, str]) -> Command file_path = demisto.getFilePath(file_entry_id) user_id = args.get('user_id') or client.user_id + supports_all_drives = argToBoolean(args.get('supports_all_drives', False)) + client.set_authorized_http(scopes=COMMAND_SCOPES['FILES'], subject=user_id) drive_service = discovery.build(serviceName=SERVICE_NAME, version=API_VERSION, http=client.authorized_http) body: dict[str, str] = assign_params( @@ -1238,6 +1240,7 @@ def file_upload_command(client: 'GSuiteClient', args: dict[str, str]) -> Command media = MediaFileUpload(file_path['path']) file = drive_service.files().create(body=body, media_body=media, + supportsAllDrives=supports_all_drives, fields='*' ).execute() return handle_response_file_single(file, args) diff --git a/Packs/GoogleDrive/Integrations/GoogleDrive/GoogleDrive.yml b/Packs/GoogleDrive/Integrations/GoogleDrive/GoogleDrive.yml index 3b07628af964..f99b0c96b688 100644 --- a/Packs/GoogleDrive/Integrations/GoogleDrive/GoogleDrive.yml +++ b/Packs/GoogleDrive/Integrations/GoogleDrive/GoogleDrive.yml @@ -2115,6 +2115,13 @@ script: description: The file's Entry ID. - name: parent description: The ID of the parent folder which contains the file. If not specified as part of a create request, the file will be placed directly in the user's My Drive folder. + - auto: PREDEFINED + defaultValue: "false" + description: 'Whether the requesting application supports both My Drives and shared drives.' + name: supports_all_drives + predefined: + - "true" + - "false" outputs: - contextPath: GoogleDrive.File.File.id description: The ID of the file. diff --git a/Packs/GoogleDrive/Integrations/GoogleDrive/README.md b/Packs/GoogleDrive/Integrations/GoogleDrive/README.md index d93eb840ced7..0b414df77d35 100644 --- a/Packs/GoogleDrive/Integrations/GoogleDrive/README.md +++ b/Packs/GoogleDrive/Integrations/GoogleDrive/README.md @@ -820,6 +820,7 @@ Creates a new file. | file_name | The name of the file to upload. | Optional | | entry_id | The file's Entry ID. | Optional | | parent | The ID of the parent folder which contains the file. If not specified as part of a create request, the file will be placed directly in the user's My Drive folder. | Optional | +| supports_all_drives | Whether the requesting application supports both My Drives and shared drives. Possible values: "true" and "false". Possible values are: true, false. Default is false. | Optional | #### Context Output diff --git a/Packs/GoogleDrive/ReleaseNotes/1_3_5.md b/Packs/GoogleDrive/ReleaseNotes/1_3_5.md new file mode 100644 index 000000000000..fde21f8d75f1 --- /dev/null +++ b/Packs/GoogleDrive/ReleaseNotes/1_3_5.md @@ -0,0 +1,6 @@ + +#### Integrations + +##### Google Drive + +Fixed an issue where **google-drive-file-upload** command failed to upload file to a shared drive. \ No newline at end of file diff --git a/Packs/GoogleDrive/pack_metadata.json b/Packs/GoogleDrive/pack_metadata.json index f528342fa6ce..60407559c723 100644 --- a/Packs/GoogleDrive/pack_metadata.json +++ b/Packs/GoogleDrive/pack_metadata.json @@ -2,7 +2,7 @@ "name": "Google Drive", "description": "Google Drive allows users to store files on their servers, synchronize files across devices, and share files. This integration helps you to create a new drive, query past activity and view change logs performed by the users, as well as list drives and files, and manage their permissions.", "support": "xsoar", - "currentVersion": "1.3.3", + "currentVersion": "1.3.5", "author": "Cortex XSOAR", "url": "https://www.paloaltonetworks.com/cortex", "email": "", From c9b06ef134c4549fe7cee0ee5d708f8015360a20 Mon Sep 17 00:00:00 2001 From: ilappe Date: Mon, 11 Mar 2024 10:13:53 +0200 Subject: [PATCH 2/3] fix validation --- Packs/GoogleDrive/Integrations/GoogleDrive/GoogleDrive.yml | 2 +- Packs/GoogleDrive/ReleaseNotes/1_3_5.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Packs/GoogleDrive/Integrations/GoogleDrive/GoogleDrive.yml b/Packs/GoogleDrive/Integrations/GoogleDrive/GoogleDrive.yml index 53ef5273b270..6678f31ab856 100644 --- a/Packs/GoogleDrive/Integrations/GoogleDrive/GoogleDrive.yml +++ b/Packs/GoogleDrive/Integrations/GoogleDrive/GoogleDrive.yml @@ -3110,7 +3110,7 @@ script: - contextPath: GoogleDrive.File.Parents description: The IDs of the parent folders which contain the file. type: String - dockerimage: demisto/googleapi-python3:1.0.0.89217 + dockerimage: demisto/googleapi-python3:1.0.0.89487 isfetch: true runonce: false script: "-" diff --git a/Packs/GoogleDrive/ReleaseNotes/1_3_5.md b/Packs/GoogleDrive/ReleaseNotes/1_3_5.md index fde21f8d75f1..2e28d034e331 100644 --- a/Packs/GoogleDrive/ReleaseNotes/1_3_5.md +++ b/Packs/GoogleDrive/ReleaseNotes/1_3_5.md @@ -3,4 +3,5 @@ ##### Google Drive -Fixed an issue where **google-drive-file-upload** command failed to upload file to a shared drive. \ No newline at end of file +- Fixed an issue where **google-drive-file-upload** command failed to upload file to a shared drive. +- Updated the Docker image to: *demisto/googleapi-python3:1.0.0.89487*. \ No newline at end of file From f258252203fb1b016d075a069553973387ee5c6c Mon Sep 17 00:00:00 2001 From: ilappe Date: Mon, 11 Mar 2024 11:21:38 +0200 Subject: [PATCH 3/3] CR change --- Packs/GoogleDrive/Integrations/GoogleDrive/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packs/GoogleDrive/Integrations/GoogleDrive/README.md b/Packs/GoogleDrive/Integrations/GoogleDrive/README.md index 0b414df77d35..cc8a9386b836 100644 --- a/Packs/GoogleDrive/Integrations/GoogleDrive/README.md +++ b/Packs/GoogleDrive/Integrations/GoogleDrive/README.md @@ -820,7 +820,7 @@ Creates a new file. | file_name | The name of the file to upload. | Optional | | entry_id | The file's Entry ID. | Optional | | parent | The ID of the parent folder which contains the file. If not specified as part of a create request, the file will be placed directly in the user's My Drive folder. | Optional | -| supports_all_drives | Whether the requesting application supports both My Drives and shared drives. Possible values: "true" and "false". Possible values are: true, false. Default is false. | Optional | +| supports_all_drives | Whether the requesting application supports both My Drives and shared drives. Possible values: "true" and "false". Default is "false". | Optional | #### Context Output