OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
[#51362] enable manual project folder for one drive
Eric Schuberte9b0ebcfb861
diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/file_info_query.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/file_info_query.rbindex efa64d81ede..8b60d363b33 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/file_info_query.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/file_info_query.rb@@ -44,11 +44,21 @@ module Storagesenddef call(user:, file_id:)+ if file_id.nil?+ return ServiceResult.failure(+ result: :error,+ errors: ::Storages::StorageError.new(code: :error,+ data: StorageErrorData.new(source: self),+ log_message: 'File ID can not be nil')+ )+ end+@delegate.call(user:, drive_item_id: file_id, fields: FIELDS).map(&storage_file_infos)endprivate+ # rubocop:disable Metrics/AbcSizedef storage_file_infos->(json) doStorageFileInfo.new(@@ -66,10 +76,12 @@ module Storageslast_modified_by_name: json.dig(:lastModifiedBy, :user, :displayName),last_modified_by_id: json.dig(:lastModifiedBy, :user, :id),permissions: nil,- location: json.dig(:parentReference, :path)+ location: Util.extract_location(json[:parentReference], json[:name]))endend++ # rubocop:enable Metrics/AbcSizeendendenddiff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/files_query.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/files_query.rbindex a3077561a96..35fc2c87b4f 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/files_query.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/files_query.rb@@ -101,7 +101,7 @@ module Storageslast_modified_at: Time.zone.parse(json_file.dig(:fileSystemInfo, :lastModifiedDateTime)),created_by_name: json_file.dig(:createdBy, :user, :displayName),last_modified_by_name: json_file.dig(:lastModifiedBy, :user, :displayName),- location: extract_location(json_file[:parentReference], json_file[:name]),+ location: Util.extract_location(json_file[:parentReference], json_file[:name]),permissions: %i[readable writeable])end@@ -131,13 +131,6 @@ module Storages)end- def extract_location(parent_reference, file_name = '')- location = parent_reference[:path].gsub(/.*root:/, '')-- appendix = file_name.blank? ? '' : "/#{file_name}"- location.empty? ? "/#{file_name}" : "#{location}#{appendix}"- end-def parent(parent_reference)_, _, name = parent_reference[:path].gsub(/.*root:/, '').rpartition '/'@@ -147,7 +140,7 @@ module StoragesStorageFile.new(id: parent_reference[:id],name:,- location: extract_location(parent_reference),+ location: Util.extract_location(parent_reference),permissions: %i[readable writeable])enddiff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/util.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/util.rbindex 293b76519f3..ffc6dc19eb4 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/util.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/util.rb@@ -58,5 +58,12 @@ module Storages::Peripherals::StorageInteraction::OneDrive::Utilend)end++ def extract_location(parent_reference, file_name = '')+ location = parent_reference[:path].gsub(/.*root:/, '')++ appendix = file_name.blank? ? '' : "/#{file_name}"+ location.empty? ? "/#{file_name}" : "#{location}#{appendix}"+ endendenddiff --git a/modules/storages/app/components/storages/project_storages/row_component.rb b/modules/storages/app/components/storages/project_storages/row_component.rbindex 67876f68386..a197213f9af 100644--- a/modules/storages/app/components/storages/project_storages/row_component.rb+++ b/modules/storages/app/components/storages/project_storages/row_component.rb@@ -50,8 +50,7 @@ module Storages::ProjectStoragesenddef button_links- links = [delete_link]- links.prepend(edit_link) if project_storage.storage.provider_type_nextcloud?+ links = [edit_link, delete_link]links.prepend(members_connection_status_link) if project_storage.project_folder_automatic?linksdiff --git a/modules/storages/app/controllers/storages/admin/project_storages_controller.rb b/modules/storages/app/controllers/storages/admin/project_storages_controller.rbindex f2fc25f6ee0..491edc6e735 100644--- a/modules/storages/app/controllers/storages/admin/project_storages_controller.rb+++ b/modules/storages/app/controllers/storages/admin/project_storages_controller.rb@@ -73,11 +73,7 @@ class Storages::Admin::ProjectStoragesController < Projects::SettingsController.result@last_project_folders = {}- if @project_storage.storage.present? && @project_storage.storage.provider_type_one_drive?- create- else- render template: '/storages/project_settings/new'- end+ render template: '/storages/project_settings/new'end# Create a new ProjectStorage object.diff --git a/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/file_info_query_spec.rb b/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/file_info_query_spec.rbindex 81d085276cf..607182a9243 100644--- a/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/file_info_query_spec.rb+++ b/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/file_info_query_spec.rb@@ -31,78 +31,159 @@require 'spec_helper'require_module_spec_helper-RSpec.describe Storages::Peripherals::StorageInteraction::OneDrive::FileInfoQuery, :webmock do- include JsonResponseHelper+RSpec.describe Storages::Peripherals::StorageInteraction::OneDrive::FileInfoQuery, :vcr, :webmock do+ using Storages::Peripherals::ServiceResultRefinements- let(:storage) do- create(:one_drive_storage,- :with_oauth_client,- drive_id: 'b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd')- endlet(:user) { create(:user) }- let(:token) { create(:oauth_client_token, user:, oauth_client: storage.oauth_client) }- let(:file_id) { '01BYE5RZ5MYLM2SMX75ZBIPQZIHT6OAYPB' }- let(:not_found_json) { not_found_response }- let(:forbidden_json) { forbidden_response }+ let(:storage) { create(:sharepoint_dev_drive_storage, oauth_client_token_user: user) }++ subject { described_class.new(storage) }++ describe '#call' do+ it 'responds with correct parameters' do+ expect(described_class).to respond_to(:call)- it 'responds to .call' do- expect(described_class).to respond_to(:call)+ method = described_class.method(:call)+ expect(method.parameters).to contain_exactly(%i[keyreq storage], %i[keyreq user], %i[keyreq file_id])+ end++ context 'without outbound request involved' do+ context 'with nil' do+ it 'returns an error' do+ result = subject.call(user:, file_id: nil)- method = described_class.method(:call)- expect(method.parameters).to contain_exactly(%i[keyreq storage], %i[keyreq user], %i[keyreq file_id])+ expect(result).to be_failure+ expect(result.error_source).to be_a(described_class)+ expect(result.result).to eq(:error)+ end+ end+ endend- it 'returns a storage file info object' do- stub_request(:get, "https://graph.microsoft.com/v1.0/drives/#{storage.drive_id}/items/#{file_id}?$select=id,name,fileSystemInfo,file,folder,size,createdBy,lastModifiedBy,parentReference")- .with(headers: { 'Authorization' => "Bearer #{token.access_token}" })- .to_return(status: 200, body: read_json('folder_drive_item'), headers: {})-- storage_file_info = described_class.call(storage:, user:, file_id:).result-- # rubocop:disable Layout/LineLength- expect(storage_file_info.to_h).to eq({- status: 'ok',- status_code: 200,- id: '01BYE5RZ5MYLM2SMX75ZBIPQZIHT6OAYPB',- name: 'Business Data',- size: 39566226,- mime_type: 'application/x-op-directory',- created_at: Time.parse('2017-08-07T16:16:30Z'),- last_modified_at: Time.parse('2017-08-07T16:16:30Z'),- owner_name: 'Megan Bowen',- owner_id: '48d31887-5fad-4d73-a9f5-3c356e68a038',- last_modified_by_id: '48d31887-5fad-4d73-a9f5-3c356e68a038',- last_modified_by_name: 'Megan Bowen',- permissions: nil,- trashed: false,- location: '/drives/b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd/root:'- })- # rubocop:enable Layout/LineLength+ context 'with outbound requests successful' do+ context 'with a file id requested', vcr: 'one_drive/file_info_query_success_file' do+ let(:file_id) { '01AZJL5PNCQCEBFI3N7JGZSX5AOX32Z3LA' }++ # rubocop:disable RSpec/ExampleLength+ it 'must return the file information when called' do+ result = subject.call(user:, file_id:)+ expect(result).to be_success++ result.match(+ on_success: ->(file_info) do+ expect(file_info).to be_a(Storages::StorageFileInfo)+ expect(file_info.to_h)+ .to eq({+ status: 'ok',+ status_code: 200,+ id: '01AZJL5PNCQCEBFI3N7JGZSX5AOX32Z3LA',+ name: 'NextcloudHub.md',+ size: 1095,+ mime_type: 'application/octet-stream',+ created_at: Time.parse('2023-09-26T14:45:25Z'),+ last_modified_at: Time.parse('2023-09-26T14:46:13Z'),+ owner_name: 'Eric Schubert',+ owner_id: '0a0d38a9-a59b-4245-93fa-0d2cf727f17a',+ last_modified_by_name: 'Eric Schubert',+ last_modified_by_id: '0a0d38a9-a59b-4245-93fa-0d2cf727f17a',+ permissions: nil,+ trashed: false,+ location: '/Folder/Subfolder/NextcloudHub.md'+ })+ end,+ on_failure: ->(error) { fail "Expected success, got #{error}" }+ )+ end+ # rubocop:enable RSpec/ExampleLength+ end++ context 'with a folder id requested', vcr: 'one_drive/file_info_query_success_folder' do+ let(:file_id) { '01AZJL5PNQYF5NM3KWYNA3RJHJIB2XMMMB' }++ # rubocop:disable RSpec/ExampleLength+ it 'must return the file information when called' do+ result = subject.call(user:, file_id:)+ expect(result).to be_success++ result.match(+ on_success: ->(file_info) do+ expect(file_info).to be_a(Storages::StorageFileInfo)+ expect(file_info.to_h)+ .to eq({+ status: 'ok',+ status_code: 200,+ id: '01AZJL5PNQYF5NM3KWYNA3RJHJIB2XMMMB',+ name: 'Ümlæûts',+ size: 18007,+ mime_type: 'application/x-op-directory',+ created_at: Time.parse('2023-10-09T15:26:32Z'),+ last_modified_at: Time.parse('2023-10-09T15:26:32Z'),+ owner_name: 'Eric Schubert',+ owner_id: '0a0d38a9-a59b-4245-93fa-0d2cf727f17a',+ last_modified_by_name: 'Eric Schubert',+ last_modified_by_id: '0a0d38a9-a59b-4245-93fa-0d2cf727f17a',+ permissions: nil,+ trashed: false,+ location: '/Folder/Ümlæûts'+ })+ end,+ on_failure: ->(error) { fail "Expected success, got #{error}" }+ )+ end+ # rubocop:enable RSpec/ExampleLength+ end+ end++ context 'with outbound request returning not found', vcr: 'one_drive/file_info_query_one_not_found' do+ let(:file_id) { 'not_existent' }++ it 'must return not found' do+ result = subject.call(user:, file_id:)+ expect(result).to be_failure+ expect(result.error_source).to be_a(Storages::Peripherals::StorageInteraction::OneDrive::Internal::DriveItemQuery)++ result.match(+ on_failure: ->(error) { expect(error.code).to eq(:not_found) },+ on_success: ->(file_info) { fail "Expected failure, got #{file_info}" }+ )+ endend- describe 'error handling' do- it 'returns a notfound error if the API call returns a 404' do- stub_request(:get, "https://graph.microsoft.com/v1.0/drives/#{storage.drive_id}/items/#{file_id}?$select=id,name,fileSystemInfo,file,folder,size,createdBy,lastModifiedBy,parentReference")- .with(headers: { 'Authorization' => "Bearer #{token.access_token}" })- .to_return(status: 404, body: not_found_json, headers: {})+ context 'with invalid oauth token', vcr: 'one_drive/file_info_query_invalid_token' do+ let(:file_id) { '01AZJL5PNCQCEBFI3N7JGZSX5AOX32Z3LA' }- storage_files = described_class.call(storage:, user:, file_id:)+ before do+ token = build_stubbed(:oauth_client_token, oauth_client: storage.oauth_client)+ allow(Storages::Peripherals::StorageInteraction::OneDrive::Util)+ .to receive(:using_user_token)+ .and_yield(token)+ end- expect(storage_files).to be_failure- expect(storage_files.result).to eq(:not_found)- expect(storage_files.errors.data.payload.to_json).to eq(not_found_json)+ it 'must return unauthorized' do+ result = subject.call(user:, file_id:)+ expect(result).to be_failure+ expect(result.error_source).to be_a(Storages::Peripherals::StorageInteraction::OneDrive::Internal::DriveItemQuery)++ result.match(+ on_failure: ->(error) { expect(error.code).to eq(:unauthorized) },+ on_success: ->(file_info) { fail "Expected failure, got #{file_info}" }+ )end+ end- it 'returns a forbidden error if the API call returns a 403' do- stub_request(:get, "https://graph.microsoft.com/v1.0/drives/#{storage.drive_id}/items/#{file_id}?$select=id,name,fileSystemInfo,file,folder,size,createdBy,lastModifiedBy,parentReference")- .with(headers: { 'Authorization' => "Bearer #{token.access_token}" })- .to_return(status: 403, body: forbidden_json, headers: {})+ context 'with not existent oauth token' do+ let(:file_id) { '01AZJL5PNCQCEBFI3N7JGZSX5AOX32Z3LA' }+ let(:user_without_token) { create(:user) }- storage_files = described_class.call(storage:, user:, file_id:)+ it 'must return unauthorized' do+ result = subject.call(user: user_without_token, file_id:)+ expect(result).to be_failure+ expect(result.error_source).to be_a(OAuthClients::ConnectionManager)- expect(storage_files).to be_failure- expect(storage_files.result).to eq(:forbidden)- expect(storage_files.errors.data.payload.to_json).to eq(forbidden_json)+ result.match(+ on_failure: ->(error) { expect(error.code).to eq(:unauthorized) },+ on_success: ->(file_infos) { fail "Expected failure, got #{file_infos}" }+ )endendenddiff --git a/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/files_info_query_spec.rb b/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/files_info_query_spec.rbindex 38c2c373e87..04becf7b8a8 100644--- a/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/files_info_query_spec.rb+++ b/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/files_info_query_spec.rb@@ -78,7 +78,6 @@ RSpec.describe Storages::Peripherals::StorageInteraction::OneDrive::FilesInfoQueend# rubocop:disable RSpec/ExampleLength- # rubocop:disable Layout/LineLengthit 'must return an array of file information when called' doresult = subject.call(user:, file_ids:)expect(result).to be_success@@ -104,7 +103,7 @@ RSpec.describe Storages::Peripherals::StorageInteraction::OneDrive::FilesInfoQuelast_modified_by_id: '0a0d38a9-a59b-4245-93fa-0d2cf727f17a',permissions: nil,trashed: false,- location: '/drives/b!dmVLG22QlE2PSW0AqVB7UOhZ8n7tjkVGkgqLNnuw2OBb-brzKzZAR4DYT1k9KPXs/root:'+ location: '/Folder with spaces'},{status: 'ok',@@ -121,7 +120,7 @@ RSpec.describe Storages::Peripherals::StorageInteraction::OneDrive::FilesInfoQuelast_modified_by_id: '0a0d38a9-a59b-4245-93fa-0d2cf727f17a',permissions: nil,trashed: false,- location: '/drives/b!dmVLG22QlE2PSW0AqVB7UOhZ8n7tjkVGkgqLNnuw2OBb-brzKzZAR4DYT1k9KPXs/root:/Folder'+ location: '/Folder/Document.docx'},{status: 'ok',@@ -138,7 +137,7 @@ RSpec.describe Storages::Peripherals::StorageInteraction::OneDrive::FilesInfoQuelast_modified_by_id: '0a0d38a9-a59b-4245-93fa-0d2cf727f17a',permissions: nil,trashed: false,- location: '/drives/b!dmVLG22QlE2PSW0AqVB7UOhZ8n7tjkVGkgqLNnuw2OBb-brzKzZAR4DYT1k9KPXs/root:/Folder/Subfolder'+ location: '/Folder/Subfolder/NextcloudHub.md'}])end,@@ -146,7 +145,6 @@ RSpec.describe Storages::Peripherals::StorageInteraction::OneDrive::FilesInfoQue)end# rubocop:enable RSpec/ExampleLength- # rubocop:enable Layout/LineLengthendenddiff --git a/modules/storages/spec/support/fixtures/vcr_cassettes/one_drive/file_info_query_invalid_token.yml b/modules/storages/spec/support/fixtures/vcr_cassettes/one_drive/file_info_query_invalid_token.ymlnew file mode 100644index 00000000000..d0289823159--- /dev/null+++ b/modules/storages/spec/support/fixtures/vcr_cassettes/one_drive/file_info_query_invalid_token.yml@@ -0,0 +1,47 @@+---+http_interactions:+- request:+ method: get+ uri: https://graph.microsoft.com/v1.0/drives/b!dmVLG22QlE2PSW0AqVB7UOhZ8n7tjkVGkgqLNnuw2OBb-brzKzZAR4DYT1k9KPXs/items/01AZJL5PNCQCEBFI3N7JGZSX5AOX32Z3LA?$select=id,name,fileSystemInfo,file,folder,size,createdBy,lastModifiedBy,parentReference+ body:+ encoding: US-ASCII+ string: ''+ headers:+ Authorization:+ - Bearer 1234567890-1+ Accept-Encoding:+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3+ Accept:+ - "*/*"+ User-Agent:+ - Ruby+ response:+ status:+ code: 401+ message: Unauthorized+ headers:+ Transfer-Encoding:+ - chunked+ Content-Type:+ - application/json+ Vary:+ - Accept-Encoding+ Strict-Transport-Security:+ - max-age=31536000+ Request-Id:+ - c406176b-5cb6-476f-b251-adde1d94c67d+ Client-Request-Id:+ - c406176b-5cb6-476f-b251-adde1d94c67d+ X-Ms-Ags-Diagnostic:+ - '{"ServerInfo":{"DataCenter":"Germany West Central","Slice":"E","Ring":"5","ScaleUnit":"001","RoleInstance":"FR2PEPF000004A6"}}'+ Www-Authenticate:+ - Bearer realm="", authorization_uri="https://login.microsoftonline.com/common/oauth2/authorize",+ client_id="00000003-0000-0000-c000-000000000000"+ Date:+ - Wed, 13 Dec 2023 15:04:27 GMT+ body:+ encoding: UTF-8+ string: '{"error":{"code":"InvalidAuthenticationToken","message":"CompactToken+ parsing failed with error code: 80049217","innerError":{"date":"2023-12-13T15:04:27","request-id":"c406176b-5cb6-476f-b251-adde1d94c67d","client-request-id":"c406176b-5cb6-476f-b251-adde1d94c67d"}}}'+ recorded_at: Wed, 13 Dec 2023 15:04:27 GMT+recorded_with: VCR 6.2.0diff --git a/modules/storages/spec/support/fixtures/vcr_cassettes/one_drive/file_info_query_one_not_found.yml b/modules/storages/spec/support/fixtures/vcr_cassettes/one_drive/file_info_query_one_not_found.ymlnew file mode 100644index 00000000000..6195d0d5033--- /dev/null+++ b/modules/storages/spec/support/fixtures/vcr_cassettes/one_drive/file_info_query_one_not_found.yml@@ -0,0 +1,45 @@+---+http_interactions:+- request:+ method: get+ uri: https://graph.microsoft.com/v1.0/drives/b!dmVLG22QlE2PSW0AqVB7UOhZ8n7tjkVGkgqLNnuw2OBb-brzKzZAR4DYT1k9KPXs/items/not_existent?$select=id,name,fileSystemInfo,file,folder,size,createdBy,lastModifiedBy,parentReference+ body:+ encoding: US-ASCII+ string: ''+ headers:+ Authorization:+ - Bearer <ACCESS_TOKEN>+ Accept-Encoding:+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3+ Accept:+ - "*/*"+ User-Agent:+ - Ruby+ response:+ status:+ code: 404+ message: Not Found+ headers:+ Cache-Control:+ - no-store, no-cache+ Transfer-Encoding:+ - chunked+ Content-Type:+ - application/json+ Vary:+ - Accept-Encoding+ Strict-Transport-Security:+ - max-age=31536000+ Request-Id:+ - d6b3ad40-856e-45e2-8378-82b1645d76a9+ Client-Request-Id:+ - d6b3ad40-856e-45e2-8378-82b1645d76a9+ X-Ms-Ags-Diagnostic:+ - '{"ServerInfo":{"DataCenter":"Germany West Central","Slice":"E","Ring":"5","ScaleUnit":"004","RoleInstance":"FR2PEPF0000037B"}}'+ Date:+ - Wed, 13 Dec 2023 15:00:01 GMT+ body:+ encoding: UTF-8+ string: '{"error":{"code":"itemNotFound","message":"Item not found","innerError":{"date":"2023-12-13T15:00:02","request-id":"d6b3ad40-856e-45e2-8378-82b1645d76a9","client-request-id":"d6b3ad40-856e-45e2-8378-82b1645d76a9"}}}'+ recorded_at: Wed, 13 Dec 2023 15:00:02 GMT+recorded_with: VCR 6.2.0diff --git a/modules/storages/spec/support/fixtures/vcr_cassettes/one_drive/file_info_query_success_file.yml b/modules/storages/spec/support/fixtures/vcr_cassettes/one_drive/file_info_query_success_file.ymlnew file mode 100644index 00000000000..c1bad095e4b--- /dev/null+++ b/modules/storages/spec/support/fixtures/vcr_cassettes/one_drive/file_info_query_success_file.yml@@ -0,0 +1,51 @@+---+http_interactions:+- request:+ method: get+ uri: https://graph.microsoft.com/v1.0/drives/b!dmVLG22QlE2PSW0AqVB7UOhZ8n7tjkVGkgqLNnuw2OBb-brzKzZAR4DYT1k9KPXs/items/01AZJL5PNCQCEBFI3N7JGZSX5AOX32Z3LA?$select=id,name,fileSystemInfo,file,folder,size,createdBy,lastModifiedBy,parentReference+ body:+ encoding: US-ASCII+ string: ''+ headers:+ Authorization:+ - Bearer <ACCESS_TOKEN>+ Accept-Encoding:+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3+ Accept:+ - "*/*"+ User-Agent:+ - Ruby+ response:+ status:+ code: 200+ message: OK+ headers:+ Cache-Control:+ - no-cache+ Transfer-Encoding:+ - chunked+ Content-Type:+ - application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8+ Etag:+ - '"{128880A2-6DA3-4DFA-995F-A075F7ACED60},3"'+ Vary:+ - Accept-Encoding+ Strict-Transport-Security:+ - max-age=31536000+ Request-Id:+ - 697d981e-9059-4f4a-bf92-5fe2a4e40ec6+ Client-Request-Id:+ - 697d981e-9059-4f4a-bf92-5fe2a4e40ec6+ X-Ms-Ags-Diagnostic:+ - '{"ServerInfo":{"DataCenter":"Germany West Central","Slice":"E","Ring":"5","ScaleUnit":"001","RoleInstance":"FR2PEPF000001E4"}}'+ Odata-Version:+ - '4.0'+ Date:+ - Wed, 13 Dec 2023 14:52:04 GMT+ body:+ encoding: UTF-8+ string: '{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#drives(''b%21dmVLG22QlE2PSW0AqVB7UOhZ8n7tjkVGkgqLNnuw2OBb-brzKzZAR4DYT1k9KPXs'')/items(id,name,fileSystemInfo,file,folder,size,createdBy,lastModifiedBy,parentReference)/$entity","@odata.etag":"\"{128880A2-6DA3-4DFA-995F-A075F7ACED60},3\"","id":"01AZJL5PNCQCEBFI3N7JGZSX5AOX32Z3LA","name":"NextcloudHub.md","size":1095,"createdBy":{"user":{"email":"[email protected]","id":"0a0d38a9-a59b-4245-93fa-0d2cf727f17a","displayName":"Eric+ Schubert"}},"lastModifiedBy":{"user":{"email":"[email protected]","id":"0a0d38a9-a59b-4245-93fa-0d2cf727f17a","displayName":"Eric+ Schubert"}},"parentReference":{"driveType":"documentLibrary","driveId":"b!dmVLG22QlE2PSW0AqVB7UOhZ8n7tjkVGkgqLNnuw2OBb-brzKzZAR4DYT1k9KPXs","id":"01AZJL5PPWP5UOATNRJJBYJG5TACDHEUAG","name":"Subfolder","path":"/drives/b!dmVLG22QlE2PSW0AqVB7UOhZ8n7tjkVGkgqLNnuw2OBb-brzKzZAR4DYT1k9KPXs/root:/Folder/Subfolder","siteId":"1b4b6576-906d-4d94-8f49-6d00a9507b50"},"file":{"mimeType":"application/octet-stream","hashes":{"quickXorHash":"2HQJc625zkgBM9NAAjuXr1Im/0M="}},"fileSystemInfo":{"createdDateTime":"2023-09-26T14:45:25Z","lastModifiedDateTime":"2023-09-26T14:46:13Z"}}'+ recorded_at: Wed, 13 Dec 2023 14:52:04 GMT+recorded_with: VCR 6.2.0diff --git a/modules/storages/spec/support/fixtures/vcr_cassettes/one_drive/file_info_query_success_folder.yml b/modules/storages/spec/support/fixtures/vcr_cassettes/one_drive/file_info_query_success_folder.ymlnew file mode 100644index 00000000000..d6d14ccf86c--- /dev/null+++ b/modules/storages/spec/support/fixtures/vcr_cassettes/one_drive/file_info_query_success_folder.yml@@ -0,0 +1,51 @@+---+http_interactions:+- request:+ method: get+ uri: https://graph.microsoft.com/v1.0/drives/b!dmVLG22QlE2PSW0AqVB7UOhZ8n7tjkVGkgqLNnuw2OBb-brzKzZAR4DYT1k9KPXs/items/01AZJL5PNQYF5NM3KWYNA3RJHJIB2XMMMB?$select=id,name,fileSystemInfo,file,folder,size,createdBy,lastModifiedBy,parentReference+ body:+ encoding: US-ASCII+ string: ''+ headers:+ Authorization:+ - Bearer <ACCESS_TOKEN>+ Accept-Encoding:+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3+ Accept:+ - "*/*"+ User-Agent:+ - Ruby+ response:+ status:+ code: 200+ message: OK+ headers:+ Cache-Control:+ - no-cache+ Transfer-Encoding:+ - chunked+ Content-Type:+ - application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8+ Etag:+ - '"{D67AC1B0-566D-41C3-B8A4-E94075763181},2"'+ Vary:+ - Accept-Encoding+ Strict-Transport-Security:+ - max-age=31536000+ Request-Id:+ - e5c6f382-1e3e-45ac-ae85-3bcfee614a60+ Client-Request-Id:+ - e5c6f382-1e3e-45ac-ae85-3bcfee614a60+ X-Ms-Ags-Diagnostic:+ - '{"ServerInfo":{"DataCenter":"Germany West Central","Slice":"E","Ring":"5","ScaleUnit":"001","RoleInstance":"FR2PEPF0000049D"}}'+ Odata-Version:+ - '4.0'+ Date:+ - Wed, 13 Dec 2023 14:55:53 GMT+ body:+ encoding: UTF-8+ string: '{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#drives(''b%21dmVLG22QlE2PSW0AqVB7UOhZ8n7tjkVGkgqLNnuw2OBb-brzKzZAR4DYT1k9KPXs'')/items(id,name,fileSystemInfo,file,folder,size,createdBy,lastModifiedBy,parentReference)/$entity","@odata.etag":"\"{D67AC1B0-566D-41C3-B8A4-E94075763181},2\"","id":"01AZJL5PNQYF5NM3KWYNA3RJHJIB2XMMMB","name":"\u00dcml\u00e6\u00fbts","size":18007,"createdBy":{"user":{"email":"[email protected]","id":"0a0d38a9-a59b-4245-93fa-0d2cf727f17a","displayName":"Eric+ Schubert"}},"lastModifiedBy":{"user":{"email":"[email protected]","id":"0a0d38a9-a59b-4245-93fa-0d2cf727f17a","displayName":"Eric+ Schubert"}},"parentReference":{"driveType":"documentLibrary","driveId":"b!dmVLG22QlE2PSW0AqVB7UOhZ8n7tjkVGkgqLNnuw2OBb-brzKzZAR4DYT1k9KPXs","id":"01AZJL5PMAXGDWAAKMEBALX4Q6GSN5BSBR","name":"Folder","path":"/drives/b!dmVLG22QlE2PSW0AqVB7UOhZ8n7tjkVGkgqLNnuw2OBb-brzKzZAR4DYT1k9KPXs/root:/Folder","siteId":"1b4b6576-906d-4d94-8f49-6d00a9507b50"},"fileSystemInfo":{"createdDateTime":"2023-10-09T15:26:32Z","lastModifiedDateTime":"2023-10-09T15:26:32Z"},"folder":{"childCount":1}}'+ recorded_at: Wed, 13 Dec 2023 14:55:54 GMT+recorded_with: VCR 6.2.0