Skip to content

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

[#66439] add share point file info query

Eric Schubert4e2a4aa44227
diff --git a/modules/storages/app/common/storages/adapters/providers/share_point/queries/file_info_query.rb b/modules/storages/app/common/storages/adapters/providers/share_point/queries/file_info_query.rb
new file mode 100644
index 00000000000..54439420e80
--- /dev/null
+++ b/modules/storages/app/common/storages/adapters/providers/share_point/queries/file_info_query.rb
@@ -0,0 +1,81 @@
+# frozen_string_literal: true
+
+#-- copyright
+# OpenProject is an open source project management software.
+# Copyright (C) the OpenProject GmbH
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version 3.
+#
+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+# Copyright (C) 2006-2013 Jean-Philippe Lang
+# Copyright (C) 2010-2013 the ChiliProject Team
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# See COPYRIGHT and LICENSE files for more details.
+#++
+
+module Storages
+ module Adapters
+ module Providers
+ module SharePoint
+ module Queries
+ class FileInfoQuery < Base
+ FIELDS = %w[id name fileSystemInfo file folder size createdBy lastModifiedBy parentReference webUrl].freeze
+
+ def call(auth_strategy:, input_data:)
+ identifier_hash = split_identifier(input_data.file_id)
+ drive_id = identifier_hash[:drive_id]
+ item_id = identifier_hash[:location]
+
+ make_base_query(auth_strategy:, drive_id:, item_id:).or do |error|
+ return Failure(error) unless error.code == :not_found && auth_strategy.value!.user.present?
+
+ admin_query(drive_id, item_id)
+ end
+ end
+
+ private
+
+ def make_base_query(auth_strategy:, drive_id:, item_id:)
+ Authentication[auth_strategy].call(storage: @storage) do |http|
+ drive_item_query.call(http:, drive_id:, item_id:, fields: FIELDS)
+ .fmap { |json| storage_file_info(json) }
+ end
+ end
+
+ def drive_item_query
+ @drive_item_query ||= Internal::DriveItemQuery.new(@storage)
+ end
+
+ def admin_query(drive_id, item_id)
+ Authentication[userless_strategy].call(storage: @storage) do |http|
+ drive_item_query.call(http:, drive_id:, item_id:, fields: FIELDS)
+ .fmap { |json| storage_file_info(json, status: "forbidden", status_code: 403) }
+ end
+ end
+
+ def userless_strategy = Registry.resolve("share_point.authentication.userless").call
+
+ def storage_file_info(json, status: "ok", status_code: 200)
+ StorageFileTransformer.new(site_name).transform_file_info({ status:, status_code: }.merge(json))
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/modules/storages/app/common/storages/adapters/providers/share_point/queries/internal/drive_item_query.rb b/modules/storages/app/common/storages/adapters/providers/share_point/queries/internal/drive_item_query.rb
new file mode 100644
index 00000000000..40d18fb0afb
--- /dev/null
+++ b/modules/storages/app/common/storages/adapters/providers/share_point/queries/internal/drive_item_query.rb
@@ -0,0 +1,78 @@
+# frozen_string_literal: true
+
+#-- copyright
+# OpenProject is an open source project management software.
+# Copyright (C) the OpenProject GmbH
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version 3.
+#
+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+# Copyright (C) 2006-2013 Jean-Philippe Lang
+# Copyright (C) 2010-2013 the ChiliProject Team
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# See COPYRIGHT and LICENSE files for more details.
+#++
+
+module Storages
+ module Adapters
+ module Providers
+ module SharePoint
+ module Queries
+ module Internal
+ class DriveItemQuery < Base
+ def call(http:, drive_id:, item_id:, fields: [])
+ select_url_query = if fields.empty?
+ ""
+ else
+ "?$select=#{fields.join(',')}"
+ end
+
+ handle_response http.get("#{request_uri(drive_id:, item_id:)}#{select_url_query}")
+ end
+
+ private
+
+ def handle_response(response)
+ error = Results::Error.new(payload: response, source: self.class)
+
+ case response
+ in { status: 200..299 }
+ Success(response.json(symbolize_keys: true))
+ in { status: 404 }
+ Failure(error.with(code: :not_found))
+ in { status: 403 }
+ Failure(error.with(code: :forbidden))
+ in { status: 401 }
+ Failure(error.with(code: :unauthorized))
+ else
+ Failure(error.with(code: :error))
+ end
+ end
+
+ def request_uri(drive_id:, item_id:)
+ return UrlBuilder.url(base_uri, "/v1.0/drives", drive_id, "root") if item_id.root?
+
+ UrlBuilder.url(base_uri, "/v1.0/drives", drive_id, "items", item_id)
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/modules/storages/app/common/storages/adapters/providers/share_point/share_point_registry.rb b/modules/storages/app/common/storages/adapters/providers/share_point/share_point_registry.rb
index 2c7d58ae67c..f965a56fb7d 100644
--- a/modules/storages/app/common/storages/adapters/providers/share_point/share_point_registry.rb
+++ b/modules/storages/app/common/storages/adapters/providers/share_point/share_point_registry.rb
@@ -69,6 +69,8 @@ module Storages
end
namespace("queries") do
+ register(:download_link, Queries::DownloadLinkQuery)
+ register(:file_info, Queries::FileInfoQuery)
register(:files, Queries::FilesQuery)
register(:user, OneDrive::Queries::UserQuery)
end
diff --git a/modules/storages/app/common/storages/adapters/providers/share_point/storage_file_transformer.rb b/modules/storages/app/common/storages/adapters/providers/share_point/storage_file_transformer.rb
index c825183b925..fd34105d797 100644
--- a/modules/storages/app/common/storages/adapters/providers/share_point/storage_file_transformer.rb
+++ b/modules/storages/app/common/storages/adapters/providers/share_point/storage_file_transformer.rb
@@ -23,7 +23,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See COPYRIGHT and LICENSE files for more details.
#++
@@ -72,6 +72,24 @@ module Storages
)
end
+ def transform_file_info(json)
+ Results::StorageFileInfo.build(
+ status: json[:status],
+ status_code: json[:status_code],
+ id: json[:id],
+ name: json[:name],
+ mime_type: mime_type(json),
+ size: json[:size],
+ owner_name: json.dig(:createdBy, :user, :displayName),
+ owner_id: json.dig(:createdBy, :user, :id),
+ location: extract_location(json),
+ last_modified_at: json.dig(:fileSystemInfo, :lastModifiedDateTime),
+ created_at: json.dig(:fileSystemInfo, :createdDateTime),
+ last_modified_by_name: json.dig(:lastModifiedBy, :user, :displayName),
+ last_modified_by_id: json.dig(:lastModifiedBy, :user, :id)
+ ).value_or(nil)
+ end
+
def build_ancestor(name, location)
Results::StorageFileAncestor.new(name:, location: CGI.unescape(location))
end
diff --git a/modules/storages/spec/common/storages/adapters/providers/share_point/queries/file_info_query_spec.rb b/modules/storages/spec/common/storages/adapters/providers/share_point/queries/file_info_query_spec.rb
new file mode 100644
index 00000000000..5c00b28e554
--- /dev/null
+++ b/modules/storages/spec/common/storages/adapters/providers/share_point/queries/file_info_query_spec.rb
@@ -0,0 +1,134 @@
+# frozen_string_literal: true
+
+#-- copyright
+# OpenProject is an open source project management software.
+# Copyright (C) the OpenProject GmbH
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version 3.
+#
+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+# Copyright (C) 2006-2013 Jean-Philippe Lang
+# Copyright (C) 2010-2013 the ChiliProject Team
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# See COPYRIGHT and LICENSE files for more details.
+#++
+
+require "spec_helper"
+require_module_spec_helper
+
+module Storages
+ module Adapters
+ module Providers
+ module SharePoint
+ module Queries
+ RSpec.describe FileInfoQuery, :webmock do
+ let(:user) { create(:user) }
+ let(:storage) { create(:share_point_dev_storage, oauth_client_token_user: user) }
+ let(:drive_id) { "b!FeOZEMfQx0eGQKqVBLcP__BG8mq-4-9FuRqOyk3MXY87vnZ6fgfvQanZHX-XCAyw" }
+
+ let(:auth_strategy) { Registry["share_point.authentication.user_bound"].call(user, storage) }
+
+ let(:input_data) { Input::FileInfo.build(file_id:).value! }
+
+ it_behaves_like "adapter file_info_query: basic query setup"
+
+ context "with a file id requested", vcr: "share_point/file_info_query_success_file" do
+ let(:file_id) { "#{drive_id}||01ANJ53W5UJK2CQO6IY5HLBVYBVNJ4TKHZ" }
+ let(:file_info) do
+ Results::StorageFileInfo.new(
+ id: "01ANJ53W5UJK2CQO6IY5HLBVYBVNJ4TKHZ",
+ status: "ok",
+ status_code: 200,
+ name: "release_meme.jpg",
+ size: 46264,
+ mime_type: "image/jpeg",
+ created_at: Time.parse("2024-02-20T14:26:07Z"),
+ last_modified_at: Time.parse("2024-02-20T14:26:07Z"),
+ owner_name: "Eric Schubert",
+ owner_id: "5b5a7dc4-4539-41ba-9fa9-100f0a26acb7",
+ last_modified_by_name: "Eric Schubert",
+ last_modified_by_id: "5b5a7dc4-4539-41ba-9fa9-100f0a26acb7",
+ permissions: nil,
+ location: "/Shared%20Documents/Folder/Nested%20Folder/release_meme.jpg"
+ )
+ end
+
+ it_behaves_like "adapter file_info_query: successful file/folder response"
+ end
+
+ context "with a folder id requested", vcr: "share_point/file_info_query_success_folder" do
+ let(:file_id) { "#{drive_id}||01ANJ53WYP6TBC6T4G2RHIU4SVNEYGL6MF" }
+ let(:file_info) do
+ Results::StorageFileInfo.new(
+ id: "01ANJ53WYP6TBC6T4G2RHIU4SVNEYGL6MF",
+ status: "ok",
+ status_code: 200,
+ name: "Ümlæûts",
+ size: 210376,
+ mime_type: "application/x-op-directory",
+ created_at: Time.parse("2024-08-09T11:29:36Z"),
+ last_modified_at: Time.parse("2024-08-09T11:29:37Z"),
+ owner_name: "Eric Schubert",
+ owner_id: "5b5a7dc4-4539-41ba-9fa9-100f0a26acb7",
+ last_modified_by_name: "Eric Schubert",
+ last_modified_by_id: "5b5a7dc4-4539-41ba-9fa9-100f0a26acb7",
+ permissions: nil,
+ location: "/Shared%20Documents/%C3%9Cml%C3%A6%C3%BBts"
+ )
+ end
+
+ it_behaves_like "adapter file_info_query: successful file/folder response"
+ end
+
+ context "with a file with special characters in the path",
+ vcr: "share_point/file_info_query_success_special_characters" do
+ let(:file_id) { "#{drive_id}||01ANJ53W7BT4LBZ3PNORCYAXKILWJBLEBV" }
+ let(:file_info) do
+ Results::StorageFileInfo.new(
+ id: "01ANJ53W7BT4LBZ3PNORCYAXKILWJBLEBV",
+ status: "ok",
+ status_code: 200,
+ name: "written_in_stone.webp",
+ size: 190656,
+ mime_type: "application/octet-stream",
+ created_at: Time.parse("2025-08-11T12:41:19Z"),
+ last_modified_at: Time.parse("2025-08-11T12:41:19Z"),
+ owner_name: "Eric Schubert",
+ owner_id: "5b5a7dc4-4539-41ba-9fa9-100f0a26acb7",
+ last_modified_by_name: "Eric Schubert",
+ last_modified_by_id: "5b5a7dc4-4539-41ba-9fa9-100f0a26acb7",
+ permissions: nil,
+ location: "/Shared%20Documents/%C3%9Cml%C3%A6%C3%BBts/data/written_in_stone.webp"
+ )
+ end
+
+ it_behaves_like "adapter file_info_query: successful file/folder response"
+ end
+
+ context "with a not existing file id", vcr: "share_point/file_info_query_not_found" do
+ let(:file_id) { "#{drive_id}||not_existent" }
+ let(:error_source) { Internal::DriveItemQuery }
+
+ it_behaves_like "adapter file_info_query: not found"
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/modules/storages/spec/support/fixtures/vcr_cassettes/share_point/file_info_query_not_found.yml b/modules/storages/spec/support/fixtures/vcr_cassettes/share_point/file_info_query_not_found.yml
new file mode 100644
index 00000000000..19f0a49b191
--- /dev/null
+++ b/modules/storages/spec/support/fixtures/vcr_cassettes/share_point/file_info_query_not_found.yml
@@ -0,0 +1,155 @@
+---
+http_interactions:
+- request:
+ method: get
+ uri: https://graph.microsoft.com/v1.0/drives/b!FeOZEMfQx0eGQKqVBLcP__BG8mq-4-9FuRqOyk3MXY87vnZ6fgfvQanZHX-XCAyw/items/not_existent?$select=id,name,fileSystemInfo,file,folder,size,createdBy,lastModifiedBy,parentReference,webUrl
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Authorization:
+ - Bearer <BEARER TOKEN>
+ User-Agent:
+ - httpx.rb/1.3.4
+ Accept:
+ - "*/*"
+ Accept-Encoding:
+ - gzip, deflate
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Cache-Control:
+ - no-store, no-cache
+ Content-Type:
+ - application/json; charset=utf-8
+ Content-Encoding:
+ - gzip
+ Vary:
+ - Accept-Encoding
+ Strict-Transport-Security:
+ - max-age=31536000
+ Request-Id:
+ - 3c6461e9-a208-4de2-bdec-ba0aa52493d8
+ Client-Request-Id:
+ - 3c6461e9-a208-4de2-bdec-ba0aa52493d8
+ X-Ms-Ags-Diagnostic:
+ - '{"ServerInfo":{"DataCenter":"Germany West Central","Slice":"E","Ring":"4","ScaleUnit":"001","RoleInstance":"FR2PEPF00000D83"}}'
+ Splogid:
+ - 34b6baa1-904d-0000-7a8c-c470d1607b45
+ Date:
+ - Mon, 11 Aug 2025 12:58:56 GMT
+ body:
+ encoding: UTF-8
+ string: '{"error":{"code":"itemNotFound","message":"Item not found"}}'
+ recorded_at: Mon, 11 Aug 2025 12:58:57 GMT
+- request:
+ method: post
+ uri: https://login.microsoftonline.com/e36f1dbc-fdae-427e-b61b-0d96ddfb81a4/oauth2/v2.0/token
+ body:
+ encoding: ASCII-8BIT
+ string: grant_type=client_credentials&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default+offline_access&client_id=404e0567-19a1-4a64-b2d1-d3b0c99f2ed9&client_secret=QRB8Q%7Ei.1rID_.MC9FTfRGq-FTE5SgWYsoeLacWf
+ headers:
+ User-Agent:
+ - httpx.rb/1.3.4
+ Accept:
+ - "*/*"
+ Accept-Encoding:
+ - gzip, deflate
+ Content-Type:
+ - application/x-www-form-urlencoded
+ Content-Length:
+ - '199'
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Cache-Control:
+ - no-store, no-cache
+ Pragma:
+ - no-cache
+ Content-Type:
+ - application/json; charset=utf-8
+ Expires:
+ - "-1"
+ Strict-Transport-Security:
+ - max-age=31536000; includeSubDomains
+ X-Content-Type-Options:
+ - nosniff
+ P3p:
+ - CP="DSP CUR OTPi IND OTRi ONL FIN"
+ X-Ms-Request-Id:
+ - 607f1ae2-b380-46ce-ae8b-5fa4de9d6d00
+ X-Ms-Ests-Server:
+ - 2.1.21470.11 - SEC ProdSlices
+ X-Ms-Srs:
+ - 1.P
+ Content-Security-Policy-Report-Only:
+ - object-src 'none'; base-uri 'self'; script-src 'self' 'nonce-3BMWqLw4z2cgjNjqW5bDAg'
+ 'unsafe-inline' 'unsafe-eval' https://*.msauth.net https://*.msftauth.net
+ https://*.msftauthimages.net https://*.msauthimages.net https://*.msidentity.com
+ https://*.microsoftonline-p.com https://*.microsoftazuread-sso.com https://*.azureedge.net
+ https://*.outlook.com https://*.office.com https://*.office365.com https://*.microsoft.com
+ https://*.bing.com 'report-sample'; report-uri https://csp.microsoft.com/report/ESTS-UX-All
+ X-Xss-Protection:
+ - '0'
+ Set-Cookie:
+ - fpc=AuLCtkYM7ABMhy2fSy18JndZ-dCOAQAAABHgK-AOAAAA; expires=Wed, 10-Sep-2025
+ 12:58:58 GMT; path=/; secure; HttpOnly; SameSite=None, x-ms-gateway-slice=estsfd;
+ path=/; secure; samesite=none; httponly, stsservicecookie=estsfd; path=/;
+ secure; samesite=none; httponly
+ Date:
+ - Mon, 11 Aug 2025 12:58:57 GMT
+ Content-Length:
+ - '1932'
+ body:
+ encoding: UTF-8
+ string: '{"token_type":"Bearer","expires_in":3599,"ext_expires_in":3599,"access_token":"<ACCESS_TOKEN>"}'
+ recorded_at: Mon, 11 Aug 2025 12:58:58 GMT
+- request:
+ method: get
+ uri: https://graph.microsoft.com/v1.0/drives/b!FeOZEMfQx0eGQKqVBLcP__BG8mq-4-9FuRqOyk3MXY87vnZ6fgfvQanZHX-XCAyw/items/not_existent?$select=id,name,fileSystemInfo,file,folder,size,createdBy,lastModifiedBy,parentReference,webUrl
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ User-Agent:
+ - httpx.rb/1.3.4
+ Accept:
+ - "*/*"
+ Accept-Encoding:
+ - gzip, deflate
+ Authorization:
+ - Bearer <BEARER TOKEN>
+ response:
+ status:
+ code: 404
+ message: Not Found
+ headers:
+ Cache-Control:
+ - no-store, no-cache
+ Content-Type:
+ - application/json; charset=utf-8
+ Content-Encoding:
+ - gzip
+ Vary:
+ - Accept-Encoding
+ Strict-Transport-Security:
+ - max-age=31536000
+ Request-Id:
+ - 0520d76c-2adf-4ab3-bcc6-bb3ec10d1563
+ Client-Request-Id:
+ - 0520d76c-2adf-4ab3-bcc6-bb3ec10d1563
+ X-Ms-Ags-Diagnostic:
+ - '{"ServerInfo":{"DataCenter":"Germany West Central","Slice":"E","Ring":"4","ScaleUnit":"001","RoleInstance":"FR2PEPF00000C6D"}}'
+ Splogid:
+ - 34b6baa1-407b-0000-7534-cd5febb40155
+ Date:
+ - Mon, 11 Aug 2025 12:58:57 GMT
+ body:
+ encoding: UTF-8
+ string: '{"error":{"code":"itemNotFound","message":"Item not found"}}'
+ recorded_at: Mon, 11 Aug 2025 12:58:58 GMT
+recorded_with: VCR 6.3.1
diff --git a/modules/storages/spec/support/fixtures/vcr_cassettes/share_point/file_info_query_success_file.yml b/modules/storages/spec/support/fixtures/vcr_cassettes/share_point/file_info_query_success_file.yml
new file mode 100644
index 00000000000..70c2e77089d
--- /dev/null
+++ b/modules/storages/spec/support/fixtures/vcr_cassettes/share_point/file_info_query_success_file.yml
@@ -0,0 +1,50 @@
+---
+http_interactions:
+- request:
+ method: get
+ uri: https://graph.microsoft.com/v1.0/drives/b!FeOZEMfQx0eGQKqVBLcP__BG8mq-4-9FuRqOyk3MXY87vnZ6fgfvQanZHX-XCAyw/items/01ANJ53W5UJK2CQO6IY5HLBVYBVNJ4TKHZ?$select=id,name,fileSystemInfo,file,folder,size,createdBy,lastModifiedBy,parentReference,webUrl
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Authorization:
+ - Bearer <BEARER TOKEN>
+ User-Agent:
+ - httpx.rb/1.3.4
+ Accept:
+ - "*/*"
+ Accept-Encoding:
+ - gzip, deflate
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Cache-Control:
+ - no-cache
+ Content-Type:
+ - application/json; odata.metadata=minimal; odata.streaming=true; IEEE754Compatible=false;
+ charset=utf-8
+ Content-Encoding:
+ - gzip
+ Strict-Transport-Security:
+ - max-age=31536000
+ Request-Id:
+ - 943d40d2-fa5d-4af1-8f8d-984765e9fd96
+ Client-Request-Id:
+ - 943d40d2-fa5d-4af1-8f8d-984765e9fd96
+ X-Ms-Ags-Diagnostic:
+ - '{"ServerInfo":{"DataCenter":"Germany West Central","Slice":"E","Ring":"4","ScaleUnit":"004","RoleInstance":"FR2PEPF0000038F"}}'
+ Splogid:
+ - 0eb6baa1-406d-0000-7534-c8aa3d55df40
+ Date:
+ - Mon, 11 Aug 2025 12:56:22 GMT
+ body:
+ encoding: UTF-8
+ string: '{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#Collection(driveItem)/$entity","@odata.etag":"\"{28B44AB4-C83B-4EC7-B0D7-01AB53C9A8F9},2\"","createdBy":{"user":{"email":"[email protected]","id":"5b5a7dc4-4539-41ba-9fa9-100f0a26acb7","displayName":"Eric
+ Schubert"}},"id":"01ANJ53W5UJK2CQO6IY5HLBVYBVNJ4TKHZ","lastModifiedBy":{"user":{"email":"[email protected]","id":"5b5a7dc4-4539-41ba-9fa9-100f0a26acb7","displayName":"Eric
+ Schubert"}},"name":"release_meme.jpg","parentReference":{"driveType":"documentLibrary","driveId":"b!FeOZEMfQx0eGQKqVBLcP__BG8mq-4-9FuRqOyk3MXY87vnZ6fgfvQanZHX-XCAyw","id":"01ANJ53W4MWZNYS4FOTNDI3UVTLEXUZ5TQ","name":"Nested
+ Folder","path":"/drives/b!FeOZEMfQx0eGQKqVBLcP__BG8mq-4-9FuRqOyk3MXY87vnZ6fgfvQanZHX-XCAyw/root:/Folder/Nested
+ Folder","siteId":"1099e315-d0c7-47c7-8640-aa9504b70fff"},"webUrl":"https://ymt6d.sharepoint.com/sites/OPTest/Shared%20Documents/Folder/Nested%20Folder/release_meme.jpg","file":{"hashes":{"quickXorHash":"YkS9AR4yVsWrDqYEUTlRDmX28hI="},"mimeType":"image/jpeg"},"fileSystemInfo":{"createdDateTime":"2024-02-20T14:26:07Z","lastModifiedDateTime":"2024-02-20T14:26:07Z"},"size":46264}'
+ recorded_at: Mon, 11 Aug 2025 12:56:22 GMT
+recorded_with: VCR 6.3.1
diff --git a/modules/storages/spec/support/fixtures/vcr_cassettes/share_point/file_info_query_success_folder.yml b/modules/storages/spec/support/fixtures/vcr_cassettes/share_point/file_info_query_success_folder.yml
new file mode 100644
index 00000000000..f75d288f838
--- /dev/null
+++ b/modules/storages/spec/support/fixtures/vcr_cassettes/share_point/file_info_query_success_folder.yml
@@ -0,0 +1,49 @@
+---
+http_interactions:
+- request:
+ method: get
+ uri: https://graph.microsoft.com/v1.0/drives/b!FeOZEMfQx0eGQKqVBLcP__BG8mq-4-9FuRqOyk3MXY87vnZ6fgfvQanZHX-XCAyw/items/01ANJ53WYP6TBC6T4G2RHIU4SVNEYGL6MF?$select=id,name,fileSystemInfo,file,folder,size,createdBy,lastModifiedBy,parentReference,webUrl
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Authorization:
+ - Bearer <BEARER TOKEN>
+ User-Agent:
+ - httpx.rb/1.3.4
+ Accept:
+ - "*/*"
+ Accept-Encoding:
+ - gzip, deflate
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Cache-Control:
+ - no-cache
+ Content-Type:
+ - application/json; odata.metadata=minimal; odata.streaming=true; IEEE754Compatible=false;
+ charset=utf-8
+ Content-Encoding:
+ - gzip
+ Strict-Transport-Security:
+ - max-age=31536000
+ Request-Id:
+ - '0784cf1c-0dcc-459b-adf0-c380cf88442d'
+ Client-Request-Id:
+ - '0784cf1c-0dcc-459b-adf0-c380cf88442d'
+ X-Ms-Ags-Diagnostic:
+ - '{"ServerInfo":{"DataCenter":"Germany West Central","Slice":"E","Ring":"4","ScaleUnit":"005","RoleInstance":"FR3PEPF000002D9"}}'
+ Splogid:
+ - 92b5baa1-b0f9-0000-7bb8-abc1cb1c0d25
+ Date:
+ - Mon, 11 Aug 2025 12:47:56 GMT
+ body:
+ encoding: UTF-8
+ string: '{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#Collection(driveItem)/$entity","@odata.etag":"\"{2FC2F40F-864F-4ED4-8A72-55693065F985},2\"","createdBy":{"user":{"email":"[email protected]","id":"5b5a7dc4-4539-41ba-9fa9-100f0a26acb7","displayName":"Eric
+ Schubert"}},"id":"01ANJ53WYP6TBC6T4G2RHIU4SVNEYGL6MF","lastModifiedBy":{"user":{"email":"[email protected]","id":"5b5a7dc4-4539-41ba-9fa9-100f0a26acb7","displayName":"Eric
+ Schubert"}},"name":"\u00dcml\u00e6\u00fbts","parentReference":{"driveType":"documentLibrary","driveId":"b!FeOZEMfQx0eGQKqVBLcP__BG8mq-4-9FuRqOyk3MXY87vnZ6fgfvQanZHX-XCAyw","id":"01ANJ53W56Y2GOVW7725BZO354PWSELRRZ","name":"Shared
+ Documents","path":"/drives/b!FeOZEMfQx0eGQKqVBLcP__BG8mq-4-9FuRqOyk3MXY87vnZ6fgfvQanZHX-XCAyw/root:","siteId":"1099e315-d0c7-47c7-8640-aa9504b70fff"},"webUrl":"https://ymt6d.sharepoint.com/sites/OPTest/Shared%20Documents/%C3%9Cml%C3%A6%C3%BBts","fileSystemInfo":{"createdDateTime":"2024-08-09T11:29:36Z","lastModifiedDateTime":"2024-08-09T11:29:37Z"},"folder":{"childCount":2,"decorator":{"iconColor":"lightPurple"}},"size":210376}'
+ recorded_at: Mon, 11 Aug 2025 12:47:56 GMT
+recorded_with: VCR 6.3.1
diff --git a/modules/storages/spec/support/fixtures/vcr_cassettes/share_point/file_info_query_success_special_characters.yml b/modules/storages/spec/support/fixtures/vcr_cassettes/share_point/file_info_query_success_special_characters.yml
new file mode 100644
index 00000000000..fbd59221895
--- /dev/null
+++ b/modules/storages/spec/support/fixtures/vcr_cassettes/share_point/file_info_query_success_special_characters.yml
@@ -0,0 +1,48 @@
+---
+http_interactions:
+- request:
+ method: get
+ uri: https://graph.microsoft.com/v1.0/drives/b!FeOZEMfQx0eGQKqVBLcP__BG8mq-4-9FuRqOyk3MXY87vnZ6fgfvQanZHX-XCAyw/items/01ANJ53W7BT4LBZ3PNORCYAXKILWJBLEBV?$select=id,name,fileSystemInfo,file,folder,size,createdBy,lastModifiedBy,parentReference,webUrl
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Authorization:
+ - Bearer <BEARER TOKEN>
+ User-Agent:
+ - httpx.rb/1.3.4
+ Accept:
+ - "*/*"
+ Accept-Encoding:
+ - gzip, deflate
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Cache-Control:
+ - no-cache
+ Content-Type:
+ - application/json; odata.metadata=minimal; odata.streaming=true; IEEE754Compatible=false;
+ charset=utf-8
+ Content-Encoding:
+ - gzip
+ Strict-Transport-Security:
+ - max-age=31536000
+ Request-Id:
+ - 56614a06-a3d1-4ef8-80a7-24f8eedf32b5
+ Client-Request-Id:
+ - 56614a06-a3d1-4ef8-80a7-24f8eedf32b5
+ X-Ms-Ags-Diagnostic:
+ - '{"ServerInfo":{"DataCenter":"Germany West Central","Slice":"E","Ring":"4","ScaleUnit":"005","RoleInstance":"FR3PEPF00000449"}}'
+ Splogid:
+ - 93b5baa1-b017-0000-7534-c329084eb5bc
+ Date:
+ - Mon, 11 Aug 2025 12:47:56 GMT
+ body:
+ encoding: UTF-8
+ string: '{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#Collection(driveItem)/$entity","@odata.etag":"\"{1C169FE1-EDED-4574-805D-485D92159035},1\"","createdBy":{"user":{"email":"[email protected]","id":"5b5a7dc4-4539-41ba-9fa9-100f0a26acb7","displayName":"Eric
+ Schubert"}},"id":"01ANJ53W7BT4LBZ3PNORCYAXKILWJBLEBV","lastModifiedBy":{"user":{"email":"[email protected]","id":"5b5a7dc4-4539-41ba-9fa9-100f0a26acb7","displayName":"Eric
+ Schubert"}},"name":"written_in_stone.webp","parentReference":{"driveType":"documentLibrary","driveId":"b!FeOZEMfQx0eGQKqVBLcP__BG8mq-4-9FuRqOyk3MXY87vnZ6fgfvQanZHX-XCAyw","id":"01ANJ53W6GVP274RHZMJFI6WHHYNYYG6IY","name":"data","path":"/drives/b!FeOZEMfQx0eGQKqVBLcP__BG8mq-4-9FuRqOyk3MXY87vnZ6fgfvQanZHX-XCAyw/root:/\u00dcml\u00e6\u00fbts/data","siteId":"1099e315-d0c7-47c7-8640-aa9504b70fff"},"webUrl":"https://ymt6d.sharepoint.com/sites/OPTest/Shared%20Documents/%C3%9Cml%C3%A6%C3%BBts/data/written_in_stone.webp","file":{"hashes":{"quickXorHash":"Oo63TqbQWEjMVaIwNDmfJJQqGXc="},"mimeType":"application/octet-stream"},"fileSystemInfo":{"createdDateTime":"2025-08-11T12:41:19Z","lastModifiedDateTime":"2025-08-11T12:41:19Z"},"size":190656}'
+ recorded_at: Mon, 11 Aug 2025 12:47:57 GMT
+recorded_with: VCR 6.3.1