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
[#53370] updated files query to use new authentication
Eric Schubert3200df28ebae
diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/files_query.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/files_query.rbindex 975347a1ee0..c8d618489d8 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/files_query.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/files_query.rb@@ -28,42 +28,48 @@module Storages::Peripherals::StorageInteraction::Nextcloudclass FilesQuery- def initialize(storage)- @uri = storage.uri- @configuration = storage.oauth_configuration- end+ Auth = ::Storages::Peripherals::StorageInteraction::Authentication- def self.call(storage:, user:, folder:)- new(storage).call(user:, folder:)+ def self.call(storage:, auth_strategy:, folder:)+ new(storage).call(auth_strategy:, folder:)end- def call(user:, folder:)- result = Util.token(user:, configuration: @configuration) do |token|- @location_prefix = Util.join_uri_path(@uri.path, "remote.php/dav/files", token.origin_user_id.gsub(' ', '%20'))-- response = OpenProject- .httpx- .request(- "PROPFIND",- Util.join_uri_path(@uri,- "remote.php/dav/files",- CGI.escapeURIComponent(token.origin_user_id),- requested_folder(folder)),- xml: requested_properties,- headers: {- 'Depth' => '1',- 'Authorization' => "Bearer #{token.access_token}"- }- )+ def initialize(storage)+ @storage = storage+ end- handle_response(response)+ def call(auth_strategy:, folder:)+ if auth_strategy.user.nil?+ error_data = Storages::StorageErrorData.new(source: self)+ return Util.error(:error, 'Cannot execute query without user context.', error_data)end+ origin_user = origin_user_id(auth_strategy.user)+ @location_prefix = Util.join_uri_path(@storage.uri.path,+ "remote.php/dav/files",+ origin_user.gsub(' ', '%20'))++ result = make_request(auth_strategy:, folder:, user: auth_strategy.user)storage_files(result)endprivate+ def make_request(auth_strategy:, folder:, user:)+ origin_user = origin_user_id(user)++ Auth[auth_strategy].call(storage: @storage,+ http_options: Util.webdav_request_with_depth(1)) do |http|+ response = http.request('PROPFIND',+ Util.join_uri_path(@storage.uri,+ 'remote.php/dav/files',+ CGI.escapeURIComponent(origin_user),+ requested_folder(folder)),+ xml: requested_properties)+ handle_response(response)+ end+ end+def handle_response(response)error_data = Storages::StorageErrorData.new(source: self, payload: response)@@ -79,6 +85,10 @@ module Storages::Peripherals::StorageInteraction::Nextcloudendend+ def origin_user_id(user)+ OAuthClientToken.find_by(user_id: user, oauth_client_id: @storage.oauth_client.id)&.origin_user_id || ''+ end+def requested_folder(folder)return '' if folder.root?diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/util.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/util.rbindex c41aa76ffed..e707eee5c6b 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/util.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/util.rb@@ -38,10 +38,12 @@ module Storages::Peripherals::StorageInteraction::Nextcloud::Utilescaped_pathend- def basic_auth_header(username, password)- {- 'Authorization' => "Basic #{Base64::strict_encode64("#{username}:#{password}")}"- }+ def ocs_api_request+ { headers: { 'OCS-APIRequest' => 'true' } }+ end++ def webdav_request_with_depth(number)+ { headers: { 'Depth' => number } }enddef error(code, log_message = nil, data = nil)diff --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 87333f07c45..5c9b7d8207f 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@@ -34,11 +34,12 @@ module Storagesmodule OneDriveclass FilesQueryFIELDS = "?$select=id,name,size,webUrl,lastModifiedBy,createdBy,fileSystemInfo,file,folder,parentReference"+ Auth = ::Storages::Peripherals::StorageInteraction::Authenticationusing ServiceResultRefinements- def self.call(storage:, user:, folder:)- new(storage).call(user:, folder:)+ def self.call(storage:, auth_strategy:, folder:)+ new(storage).call(auth_strategy:, folder:)enddef initialize(storage)@@ -46,20 +47,16 @@ module Storages@uri = storage.uriend- def call(user:, folder:)- result = Util.using_user_token(@storage, user) do |token|- response = OpenProject.httpx.get(- Util.join_uri_path(@uri, children_uri_path_for(folder) + FIELDS),- headers: { 'Authorization' => "Bearer #{token.access_token}" }- )-- handle_response(response, :value)- end+ def call(auth_strategy:, folder:)+ Auth[auth_strategy].call(storage: @storage) do |http|+ call = http.get(Util.join_uri_path(@uri, children_uri_path_for(folder) + FIELDS))+ response = handle_response(call, :value)- if result.result.empty?- empty_response(user, folder)- else- result.map { |json_files| storage_files(json_files) }+ if response.result.empty?+ empty_response(http, folder)+ else+ response.map { |json_files| storage_files(json_files) }+ endendend@@ -103,17 +100,11 @@ module Storages)end- def empty_response(user, folder)- result = Util.using_user_token(@storage, user) do |token|- response = OpenProject.httpx.get(- Util.join_uri_path(@uri, location_uri_path_for(folder) + FIELDS),- headers: { 'Authorization' => "Bearer #{token.access_token}" }- )-- handle_response(response, :id)+ def empty_response(http, folder)+ response = http.get(Util.join_uri_path(@uri, location_uri_path_for(folder) + FIELDS))+ handle_response(response, :id).map do |parent_location_id|+ empty_storage_files(folder.path, parent_location_id)end-- result.map { |parent_location_id| empty_storage_files(folder.path, parent_location_id) }enddef empty_storage_files(path, parent_id)diff --git a/modules/storages/lib/api/v3/storage_files/storage_files_api.rb b/modules/storages/lib/api/v3/storage_files/storage_files_api.rbindex 863541ed25c..96b2250a2c4 100644--- a/modules/storages/lib/api/v3/storage_files/storage_files_api.rb+++ b/modules/storages/lib/api/v3/storage_files/storage_files_api.rb@@ -59,16 +59,19 @@ module API::V3::StorageFiles.call(storage: @storage, user: current_user, data:)endend++ def auth_strategy+ Storages::Peripherals::StorageInteraction::AuthenticationStrategies::OAuthUserToken+ .strategy+ .with_user(current_user)+ endendresources :files doget doStorages::Peripherals::Registry.resolve("#{@storage.short_provider_type}.queries.files")- .call(- storage: @storage,- user: current_user, folder: extract_parent_folder(params)- )+ .call(storage: @storage, auth_strategy:, folder: extract_parent_folder(params)).match(on_success: ->(files) { API::V3::StorageFiles::StorageFilesRepresenter.new(files, @storage, current_user:) },on_failure: ->(error) { raise_error(error) }diff --git a/modules/storages/spec/common/storages/peripherals/storage_interaction/nextcloud/files_query_spec.rb b/modules/storages/spec/common/storages/peripherals/storage_interaction/nextcloud/files_query_spec.rbindex 4484bfc358c..a6e426cc6cf 100644--- a/modules/storages/spec/common/storages/peripherals/storage_interaction/nextcloud/files_query_spec.rb+++ b/modules/storages/spec/common/storages/peripherals/storage_interaction/nextcloud/files_query_spec.rb@@ -39,20 +39,25 @@ RSpec.describe Storages::Peripherals::StorageInteraction::Nextcloud::FilesQuery,create(:nextcloud_storage_with_local_connection, :as_not_automatically_managed, oauth_client_token_user: user)endlet(:folder) { Storages::Peripherals::ParentFolder.new('/') }+ let(:auth_strategy) do+ Storages::Peripherals::StorageInteraction::AuthenticationStrategies::OAuthUserToken.strategy.with_user(user)+ enddescribe '#call' doit 'responds with correct parameters' doexpect(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 folder])+ expect(method.parameters).to contain_exactly(%i[keyreq storage],+ %i[keyreq auth_strategy],+ %i[keyreq folder])endcontext 'with outbound requests successful' docontext 'with parent folder being root', vcr: 'nextcloud/files_query_root' do# rubocop:disable RSpec/ExampleLengthit 'returns a StorageFiles object for root' do- storage_files = described_class.call(storage:, user:, folder:).result+ storage_files = described_class.call(storage:, auth_strategy:, folder:).resultexpect(storage_files).to be_a(Storages::StorageFiles)expect(storage_files.ancestors).to be_empty@@ -115,7 +120,7 @@ RSpec.describe Storages::Peripherals::StorageInteraction::Nextcloud::FilesQuery,let(:folder) { Storages::Peripherals::ParentFolder.new('/Folder with spaces/New Requests') }subject do- described_class.call(storage:, user:, folder:).result+ described_class.call(storage:, auth_strategy:, folder:).resultend# rubocop:disable RSpec/ExampleLength@@ -176,7 +181,7 @@ RSpec.describe Storages::Peripherals::StorageInteraction::Nextcloud::FilesQuery,let(:folder) { Storages::Peripherals::ParentFolder.new('/Folder/empty') }it 'returns an empty StorageFiles object with parent and ancestors' do- storage_files = described_class.call(storage:, user:, folder:).result+ storage_files = described_class.call(storage:, auth_strategy:, folder:).resultexpect(storage_files).to be_a(Storages::StorageFiles)expect(storage_files.files).to be_empty@@ -190,7 +195,7 @@ RSpec.describe Storages::Peripherals::StorageInteraction::Nextcloud::FilesQuery,let(:folder) { Storages::Peripherals::ParentFolder.new('/I/just/made/that/up') }it 'must return not found' do- result = described_class.call(storage:, user:, folder:)+ result = described_class.call(storage:, auth_strategy:, folder:)expect(result).to be_failureexpect(result.error_source).to be_a(described_class)@@ -200,39 +205,5 @@ RSpec.describe Storages::Peripherals::StorageInteraction::Nextcloud::FilesQuery,)endend-- context 'with invalid oauth token', vcr: 'nextcloud/files_query_invalid_token' do- before do- token = build_stubbed(:oauth_client_token, oauth_client: storage.oauth_client)- allow(Storages::Peripherals::StorageInteraction::Nextcloud::Util)- .to receive(:token).and_yield(token)- end-- it 'must return unauthorized' do- result = described_class.call(storage:, user:, folder:)- expect(result).to be_failure- expect(result.error_source).to be_a(described_class)-- result.match(- on_failure: ->(error) { expect(error.code).to eq(:unauthorized) },- on_success: ->(file_infos) { fail "Expected failure, got #{file_infos}" }- )- end- end-- context 'with not existent oauth token' do- let(:user_without_token) { create(:user) }-- it 'must return unauthorized' do- result = described_class.call(storage:, user: user_without_token, folder:)- expect(result).to be_failure- expect(result.error_source).to be_a(OAuthClients::ConnectionManager)-- result.match(- on_failure: ->(error) { expect(error.code).to eq(:unauthorized) },- on_success: ->(file_infos) { fail "Expected failure, got #{file_infos}" }- )- end- endendenddiff --git a/modules/storages/spec/common/storages/peripherals/storage_interaction/nextcloud/util_spec.rb b/modules/storages/spec/common/storages/peripherals/storage_interaction/nextcloud/util_spec.rbdeleted file mode 100644index d84cc7a30f9..00000000000--- a/modules/storages/spec/common/storages/peripherals/storage_interaction/nextcloud/util_spec.rb+++ /dev/null@@ -1,54 +0,0 @@-# frozen_string_literal: true--#-- copyright-# OpenProject is an open source project management software.-# Copyright (C) 2012-2024 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--RSpec.describe Storages::Peripherals::StorageInteraction::Nextcloud::Util do- describe '.basic_auth_header' do- subject { described_class.basic_auth_header(username, password) }-- context 'when password is more than 60 symbols' do- let(:username) { 'Dart Scuadron' }- let(:password) { "#{'StarWars' * 10}Forever!" }-- it 'has no newline characters in encoded string' do- expect(subject['Authorization']).not_to match(/\n/)- expect(subject).to eq(- {- "Authorization" => "Basic RGFydCBTY3VhZHJvbjpTdGFyV2Fyc1N0YXJXYXJzU3Rhcl" \- "dhcnNTdGFyV2Fyc1N0YXJXYXJzU3RhcldhcnNTdGFyV2Fyc1N0YX" \- "JXYXJzU3RhcldhcnNTdGFyV2Fyc0ZvcmV2ZXIh"- }- )- end- end- end-enddiff --git a/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/files_query_spec.rb b/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/files_query_spec.rbindex 1d84e155e20..b2df40f1df6 100644--- a/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/files_query_spec.rb+++ b/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/files_query_spec.rb@@ -37,19 +37,22 @@ RSpec.describe Storages::Peripherals::StorageInteraction::OneDrive::FilesQuery,let(:user) { create(:user) }let(:storage) { create(:sharepoint_dev_drive_storage, oauth_client_token_user: user) }let(:folder) { Storages::Peripherals::ParentFolder.new('/') }+ let(:auth_strategy) do+ Storages::Peripherals::StorageInteraction::AuthenticationStrategies::OAuthUserToken.strategy.with_user(user)+ enddescribe '#call' doit 'responds with correct parameters' doexpect(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 folder])+ expect(method.parameters).to contain_exactly(%i[keyreq storage], %i[keyreq auth_strategy], %i[keyreq folder])endcontext 'with outbound requests successful' docontext 'with parent folder being root', vcr: 'one_drive/files_query_root' doit 'returns a StorageFiles object for root' do- storage_files = described_class.call(storage:, user:, folder:).result+ storage_files = described_class.call(storage:, auth_strategy:, folder:).resultexpect(storage_files).to be_a(Storages::StorageFiles)expect(storage_files.ancestors).to be_empty@@ -73,7 +76,7 @@ RSpec.describe Storages::Peripherals::StorageInteraction::OneDrive::FilesQuery,let(:folder) { Storages::Peripherals::ParentFolder.new('/Folder/Subfolder') }subject do- described_class.call(storage:, user:, folder:).result+ described_class.call(storage:, auth_strategy:, folder:).resultend# rubocop:disable RSpec/ExampleLength@@ -133,7 +136,7 @@ RSpec.describe Storages::Peripherals::StorageInteraction::OneDrive::FilesQuery,let(:folder) { Storages::Peripherals::ParentFolder.new('/Folder with spaces/very empty folder') }it 'returns an empty StorageFiles object with parent and ancestors' do- storage_files = described_class.call(storage:, user:, folder:).result+ storage_files = described_class.call(storage:, auth_strategy:, folder:).resultexpect(storage_files).to be_a(Storages::StorageFiles)expect(storage_files.files).to be_empty@@ -147,7 +150,7 @@ RSpec.describe Storages::Peripherals::StorageInteraction::OneDrive::FilesQuery,let(:folder) { Storages::Peripherals::ParentFolder.new('/Folder/Ümlæûts') }it 'returns the correct StorageFiles object' do- storage_files = described_class.call(storage:, user:, folder:).result+ storage_files = described_class.call(storage:, auth_strategy:, folder:).resultexpect(storage_files).to be_a(Storages::StorageFiles)expect(storage_files.parent.id).to eq('01AZJL5PNQYF5NM3KWYNA3RJHJIB2XMMMB')@@ -176,7 +179,7 @@ RSpec.describe Storages::Peripherals::StorageInteraction::OneDrive::FilesQuery,let(:folder) { Storages::Peripherals::ParentFolder.new('/I/just/made/that/up') }it 'must return not found' do- result = described_class.call(storage:, user:, folder:)+ result = described_class.call(storage:, auth_strategy:, folder:)expect(result).to be_failureexpect(result.error_source).to be_a(described_class)@@ -186,56 +189,5 @@ RSpec.describe Storages::Peripherals::StorageInteraction::OneDrive::FilesQuery,)endend-- context 'with invalid oauth token', vcr: 'one_drive/files_query_invalid_token' do- 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-- it 'must return unauthorized' do- result = described_class.call(storage:, user:, folder:)- expect(result).to be_failure- expect(result.error_source).to be_a(described_class)-- result.match(- on_failure: ->(error) { expect(error.code).to eq(:unauthorized) },- on_success: ->(file_infos) { fail "Expected failure, got #{file_infos}" }- )- end- end-- context 'with not existent oauth token' do- let(:user_without_token) { create(:user) }-- it 'must return unauthorized' do- result = described_class.call(storage:, user: user_without_token, folder:)- expect(result).to be_failure- expect(result.error_source).to be_a(OAuthClients::ConnectionManager)-- result.match(- on_failure: ->(error) { expect(error.code).to eq(:unauthorized) },- on_success: ->(file_infos) { fail "Expected failure, got #{file_infos}" }- )- end- end-- context 'with network errors' do- before do- request = HTTPX::Request.new(:get, 'https://my.timeout.org/')- httpx_double = class_double(HTTPX, get: HTTPX::ErrorResponse.new(request, 'Timeout happens', {}))-- allow(OpenProject).to receive(:httpx).and_return(httpx_double)- end-- it 'must return an error with wrapped network error response' do- error = described_class.call(storage:, user:, folder:)- expect(error).to be_failure- expect(error.result).to eq(:error)- expect(error.error_payload).to be_a(HTTPX::ErrorResponse)- end- endendenddiff --git a/modules/storages/spec/support/fixtures/vcr_cassettes/nextcloud/files_query_invalid_token.yml b/modules/storages/spec/support/fixtures/vcr_cassettes/nextcloud/files_query_invalid_token.ymldeleted file mode 100644index 329fda31582..00000000000--- a/modules/storages/spec/support/fixtures/vcr_cassettes/nextcloud/files_query_invalid_token.yml+++ /dev/null@@ -1,88 +0,0 @@-----http_interactions:-- request:- method: propfind- uri: https://nextcloud.local/remote.php/dav/files/admin/- body:- encoding: UTF-8- string: |- <?xml version="1.0"?>- <d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">- <d:prop>- <oc:fileid/>- <oc:size/>- <d:getcontenttype/>- <d:getlastmodified/>- <oc:permissions/>- <oc:owner-display-name/>- </d:prop>- </d:propfind>- headers:- Depth:- - '1'- 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:- Cache-Control:- - no-store, no-cache, must-revalidate- Content-Length:- - '476'- Content-Security-Policy:- - default-src 'none';- Content-Type:- - application/xml; charset=utf-8- Date:- - Wed, 29 Nov 2023 15:45:31 GMT- Expires:- - Thu, 19 Nov 1981 08:52:00 GMT- Pragma:- - no-cache- Referrer-Policy:- - no-referrer- Server:- - Apache/2.4.57 (Debian)- Set-Cookie:- - __Host-nc_sameSiteCookielax=true; path=/; httponly;secure; expires=Fri, 31-Dec-2100- 23:59:59 GMT; SameSite=lax- - __Host-nc_sameSiteCookiestrict=true; path=/; httponly;secure; expires=Fri,- 31-Dec-2100 23:59:59 GMT; SameSite=strict- - oc_sessionPassphrase=UXh8eFuRtTRf9T7iZTT0kzicJGCTmNYEv3KVKHQGG%2BZr8KS8oJPhgRClJm2zErUam7AK8qAWgc%2FVXHitCHegMiwPALDz14awrmo1H7qHMrZaDdGjwvfN7d%2Bcul%2BFa9YB;- path=/; secure; HttpOnly; SameSite=Lax- - ocirabgzify6=633a1046540dd6fb7ce9e41e77b73076; path=/; secure; HttpOnly; SameSite=Lax- - ocirabgzify6=633a1046540dd6fb7ce9e41e77b73076; path=/; secure; HttpOnly; SameSite=Lax- - ocirabgzify6=633a1046540dd6fb7ce9e41e77b73076; path=/; secure; HttpOnly; SameSite=Lax- - ocirabgzify6=f939fd60240f843f64f1a146dac38aef; path=/; secure; HttpOnly; SameSite=Lax- Www-Authenticate:- - Basic realm="Nextcloud", charset="UTF-8"- X-Content-Type-Options:- - nosniff- X-Frame-Options:- - SAMEORIGIN- X-Permitted-Cross-Domain-Policies:- - none- X-Powered-By:- - PHP/8.2.13- X-Robots-Tag:- - noindex, nofollow- X-Xss-Protection:- - 1; mode=block- body:- encoding: UTF-8- string: |- <?xml version="1.0" encoding="utf-8"?>- <d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">- <s:exception>Sabre\DAV\Exception\NotAuthenticated</s:exception>- <s:message>No public access to this resource., No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured, Bearer token was incorrect, No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured</s:message>- </d:error>- recorded_at: Wed, 29 Nov 2023 15:45:31 GMT-recorded_with: VCR 6.2.0diff --git a/modules/storages/spec/support/fixtures/vcr_cassettes/one_drive/files_query_invalid_token.yml b/modules/storages/spec/support/fixtures/vcr_cassettes/one_drive/files_query_invalid_token.ymldeleted file mode 100644index 421e55301ff..00000000000--- a/modules/storages/spec/support/fixtures/vcr_cassettes/one_drive/files_query_invalid_token.yml+++ /dev/null@@ -1,51 +0,0 @@-----http_interactions:-- request:- method: get- uri: https://graph.microsoft.com/v1.0/drives/b!dmVLG22QlE2PSW0AqVB7UOhZ8n7tjkVGkgqLNnuw2OBb-brzKzZAR4DYT1k9KPXs/root/children?$select=id,name,size,webUrl,lastModifiedBy,createdBy,fileSystemInfo,file,folder,parentReference- body:- encoding: US-ASCII- string: ''- headers:- Authorization:- - Bearer <BEARER TOKEN>- User-Agent:- - httpx.rb/1.2.1- Accept:- - "*/*"- Accept-Encoding:- - gzip, deflate- response:- status:- code: 401- message: Unauthorized- headers:- Transfer-Encoding:- - chunked- Content-Type:- - application/json- Content-Encoding:- - gzip- Vary:- - Accept-Encoding- Strict-Transport-Security:- - max-age=31536000- Request-Id:- - 0116dfa7-1f73-4738-8fc1-666cacd957ae- Client-Request-Id:- - 0116dfa7-1f73-4738-8fc1-666cacd957ae- X-Ms-Ags-Diagnostic:- - '{"ServerInfo":{"DataCenter":"Germany West Central","Slice":"E","Ring":"5","ScaleUnit":"005","RoleInstance":"FR3PEPF00000368"}}'- Www-Authenticate:- - Bearer realm="", authorization_uri="https://login.microsoftonline.com/common/oauth2/authorize",- client_id="00000003-0000-0000-c000-000000000000"- Date:- - Tue, 30 Jan 2024 11:56:00 GMT- body:- encoding: UTF-8- string: '{"error":{"code":"InvalidAuthenticationToken","message":"IDX14100:- JWT is not well formed, there are no dots (.).\nThe token needs to be in JWS- or JWE Compact Serialization Format. (JWS): ''EncodedHeader.EndcodedPayload.EncodedSignature''.- (JWE): ''EncodedProtectedHeader.EncodedEncryptedKey.EncodedInitializationVector.EncodedCiphertext.EncodedAuthenticationTag''.","innerError":{"date":"2024-01-30T11:56:00","request-id":"0116dfa7-1f73-4738-8fc1-666cacd957ae","client-request-id":"0116dfa7-1f73-4738-8fc1-666cacd957ae"}}}'- recorded_at: Tue, 30 Jan 2024 11:56:00 GMT-recorded_with: VCR 6.2.0