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

[#53610] refactor usage of open storage query

Eric Schubertdc20a9bb201f
diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/open_storage_query.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/open_storage_query.rb
index a512135ea1d..0fb0f431a1e 100644
--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/open_storage_query.rb
+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/open_storage_query.rb
@@ -33,17 +33,17 @@ module Storages
module StorageInteraction
module Nextcloud
class OpenStorageQuery
- def initialize(storage)
- @uri = storage.uri
+ def self.call(storage:, auth_strategy:)
+ new(storage).call(auth_strategy:)
end
- def self.call(storage:, user:)
- new(storage).call(user:)
+ def initialize(storage)
+ @storage = storage
end
# rubocop:disable Lint/UnusedMethodArgument
- def call(user:)
- ServiceResult.success(result: Util.join_uri_path(@uri, "index.php/apps/files"))
+ def call(auth_strategy:)
+ ServiceResult.success(result: Util.join_uri_path(@storage.uri, "index.php/apps/files"))
end
# rubocop:enable Lint/UnusedMethodArgument
diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/open_storage_query.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/open_storage_query.rb
index 0e5e4a8eec0..6eaa679f052 100644
--- a/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/open_storage_query.rb
+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/one_drive/open_storage_query.rb
@@ -33,29 +33,26 @@ module Storages
module StorageInteraction
module OneDrive
class OpenStorageQuery
- def self.call(storage:, user:)
- new(storage).call(user:)
+ Auth = ::Storages::Peripherals::StorageInteraction::Authentication
+
+ def self.call(storage:, auth_strategy:)
+ new(storage).call(auth_strategy:)
end
def initialize(storage)
@storage = storage
- @uri = storage.uri
end
- def call(user:)
- Util.using_user_token(@storage, user) do |token|
- request_drive(token).map(&web_url)
+ def call(auth_strategy:)
+ Auth[auth_strategy].call(storage: @storage) do |http|
+ request_drive(http).map(&web_url)
end
end
private
- def request_drive(token)
- response = OpenProject.httpx.get(
- Util.join_uri_path(@uri, drive_uri_path),
- headers: { 'Authorization' => "Bearer #{token.access_token}" }
- )
- handle_responses(response)
+ def request_drive(http)
+ handle_responses http.get(Util.join_uri_path(@storage.uri, drive_uri_path))
end
def handle_responses(response)
diff --git a/modules/storages/app/models/storages/project_storage.rb b/modules/storages/app/models/storages/project_storage.rb
index 46ec7b7fde4..51663bc4ecc 100644
--- a/modules/storages/app/models/storages/project_storage.rb
+++ b/modules/storages/app/models/storages/project_storage.rb
@@ -78,10 +78,14 @@ module Storages
end
def open(user)
+ auth_strategy = Peripherals::StorageInteraction::AuthenticationStrategies::OAuthUserToken
+ .strategy
+ .with_user(user)
+
if project_folder_not_accessible?(user)
Peripherals::Registry
.resolve("#{storage.short_provider_type}.queries.open_storage")
- .call(storage:, user:)
+ .call(storage:, auth_strategy:)
else
Peripherals::Registry
.resolve("#{storage.short_provider_type}.queries.open_file_link")
diff --git a/modules/storages/lib/api/v3/storages/storage_open_api.rb b/modules/storages/lib/api/v3/storages/storage_open_api.rb
index bb42396fd5e..7c886ad3302 100644
--- a/modules/storages/lib/api/v3/storages/storage_open_api.rb
+++ b/modules/storages/lib/api/v3/storages/storage_open_api.rb
@@ -33,9 +33,13 @@ class API::V3::Storages::StorageOpenAPI < API::OpenProjectAPI
resources :open do
get do
+ auth_strategy = Storages::Peripherals::StorageInteraction::AuthenticationStrategies::OAuthUserToken
+ .strategy
+ .with_user(current_user)
+
Storages::Peripherals::Registry
.resolve("#{@storage.short_provider_type}.queries.open_storage")
- .call(storage: @storage, user: current_user)
+ .call(storage: @storage, auth_strategy:)
.match(
on_success: ->(url) do
redirect url, body: "The requested resource can be viewed at #{url}"
diff --git a/modules/storages/spec/common/storages/peripherals/storage_interaction/nextcloud/open_storage_query_spec.rb b/modules/storages/spec/common/storages/peripherals/storage_interaction/nextcloud/open_storage_query_spec.rb
index a4a6c1d291b..bf99812db11 100644
--- a/modules/storages/spec/common/storages/peripherals/storage_interaction/nextcloud/open_storage_query_spec.rb
+++ b/modules/storages/spec/common/storages/peripherals/storage_interaction/nextcloud/open_storage_query_spec.rb
@@ -33,17 +33,17 @@ require_module_spec_helper
RSpec.describe Storages::Peripherals::StorageInteraction::Nextcloud::OpenStorageQuery do
let(:storage) { create(:nextcloud_storage, host: "https://example.com") }
- let(:user) { create(:user) }
+ let(:auth_strategy) { Storages::Peripherals::StorageInteraction::AuthenticationStrategies::BasicAuth.strategy }
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])
+ expect(method.parameters).to contain_exactly(%i[keyreq storage], %i[keyreq auth_strategy])
end
it "returns the url for opening the file on storage" do
- url = described_class.call(storage:, user:).result
+ url = described_class.call(storage:, auth_strategy:).result
expect(url).to eq("#{storage.host}/index.php/apps/files")
end
@@ -51,7 +51,7 @@ RSpec.describe Storages::Peripherals::StorageInteraction::Nextcloud::OpenStorage
let(:storage) { create(:nextcloud_storage, host: "https://example.com/html") }
it "returns the url for opening the file on storage" do
- url = described_class.call(storage:, user:).result
+ url = described_class.call(storage:, auth_strategy:).result
expect(url).to eq("#{storage.host}/index.php/apps/files")
end
end
diff --git a/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/open_storage_query_spec.rb b/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/open_storage_query_spec.rb
index 7ee646a596a..b8fec04296c 100644
--- a/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/open_storage_query_spec.rb
+++ b/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/open_storage_query_spec.rb
@@ -28,7 +28,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require 'spec_helper'
+require "spec_helper"
require_module_spec_helper
RSpec.describe Storages::Peripherals::StorageInteraction::OneDrive::OpenStorageQuery, :webmock do
@@ -36,52 +36,41 @@ RSpec.describe Storages::Peripherals::StorageInteraction::OneDrive::OpenStorageQ
let(:user) { create(:user) }
let(:storage) { create(:sharepoint_dev_drive_storage, oauth_client_token_user: user) }
+ let(:auth_strategy) do
+ Storages::Peripherals::StorageInteraction::AuthenticationStrategies::OAuthUserToken.strategy.with_user(user)
+ end
subject { described_class.new(storage) }
- describe '#call' do
- it 'responds with correct parameters' do
+ describe "#call" do
+ it "responds with correct parameters" 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])
+ expect(method.parameters).to contain_exactly(%i[keyreq storage], %i[keyreq auth_strategy])
end
- context 'with outbound requests successful', vcr: 'one_drive/open_storage_query_success' do
- it 'returns the url for opening the storage' do
- call = subject.call(user:)
+ context "with outbound requests successful", vcr: "one_drive/open_storage_query_success" do
+ it "returns the url for opening the storage" do
+ call = subject.call(auth_strategy:)
expect(call).to be_success
- expect(call.result).to eq('https://finn.sharepoint.com/sites/openprojectfilestoragetests/VCR')
+ expect(call.result).to eq("https://finn.sharepoint.com/sites/openprojectfilestoragetests/VCR")
end
end
- context 'with not existent oauth token' do
+ context "with not existent oauth token" do
let(:user_without_token) { create(:user) }
-
- it 'must return unauthorized when called' do
- result = subject.call(user: user_without_token)
- 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}" }
- )
+ let(:auth_strategy) do
+ Storages::Peripherals::StorageInteraction::AuthenticationStrategies::OAuthUserToken
+ .strategy
+ .with_user(user_without_token)
end
- end
- context 'with invalid oauth token', vcr: 'one_drive/open_storage_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 = subject.call(user:)
+ it "must return unauthorized when called" do
+ result = subject.call(auth_strategy:)
expect(result).to be_failure
- expect(result.error_source).to be_a(described_class)
+ expect(result.error_source)
+ .to be(Storages::Peripherals::StorageInteraction::AuthenticationStrategies::OAuthUserToken)
result.match(
on_failure: ->(error) { expect(error.code).to eq(:unauthorized) },
@@ -89,21 +78,5 @@ RSpec.describe Storages::Peripherals::StorageInteraction::OneDrive::OpenStorageQ
)
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 = subject.call(user:)
- expect(error).to be_failure
- expect(error.result).to eq(:error)
- expect(error.error_payload).to be_a(HTTPX::ErrorResponse)
- end
- end
end
end
diff --git a/modules/storages/spec/lib/api/v3/storages/storages_representer_rendering_spec.rb b/modules/storages/spec/lib/api/v3/storages/storages_representer_rendering_spec.rb
index 2dbda82112f..529e52ffc5c 100644
--- a/modules/storages/spec/lib/api/v3/storages/storages_representer_rendering_spec.rb
+++ b/modules/storages/spec/lib/api/v3/storages/storages_representer_rendering_spec.rb
@@ -28,10 +28,10 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require 'spec_helper'
+require "spec_helper"
require_module_spec_helper
-RSpec.describe API::V3::Storages::StorageRepresenter, 'rendering' do
+RSpec.describe API::V3::Storages::StorageRepresenter, "rendering" do
let(:oauth_application) { build_stubbed(:oauth_application) }
let(:oauth_client_credentials) { build_stubbed(:oauth_client) }
let(:storage) { build_stubbed(:nextcloud_storage, oauth_application:, oauth_client: oauth_client_credentials) }
@@ -48,39 +48,39 @@ RSpec.describe API::V3::Storages::StorageRepresenter, 'rendering' do
)
end
- describe '_links' do
- describe 'self' do
- it_behaves_like 'has a titled link' do
- let(:link) { 'self' }
+ describe "_links" do
+ describe "self" do
+ it_behaves_like "has a titled link" do
+ let(:link) { "self" }
let(:href) { "/api/v3/storages/#{storage.id}" }
let(:title) { storage.name }
end
end
- describe 'origin' do
- it_behaves_like 'has an untitled link' do
- let(:link) { 'origin' }
+ describe "origin" do
+ it_behaves_like "has an untitled link" do
+ let(:link) { "origin" }
let(:href) { storage.host }
end
end
- describe 'connectionState' do
- it_behaves_like 'has a titled link' do
- let(:link) { 'authorizationState' }
- let(:href) { 'urn:openproject-org:api:v3:storages:authorization:Connected' }
- let(:title) { 'Connected' }
+ describe "connectionState" do
+ it_behaves_like "has a titled link" do
+ let(:link) { "authorizationState" }
+ let(:href) { "urn:openproject-org:api:v3:storages:authorization:Connected" }
+ let(:title) { "Connected" }
end
end
- describe 'prepareUpload' do
- context 'when user has no :manage_file_links permission on any projects linked to the storage' do
- it 'is empty' do
- expect(generated).to have_json_path('_links/prepareUpload')
- expect(generated).to have_json_size(0).at_path('_links/prepareUpload')
+ describe "prepareUpload" do
+ context "when user has no :manage_file_links permission on any projects linked to the storage" do
+ it "is empty" do
+ expect(generated).to have_json_path("_links/prepareUpload")
+ expect(generated).to have_json_size(0).at_path("_links/prepareUpload")
end
end
- context 'when user has :manage_file_links permission on some projects linked to the storage' do
+ context "when user has :manage_file_links permission on some projects linked to the storage" do
let(:oauth_application) { create(:oauth_application) }
let(:oauth_client_credentials) { create(:oauth_client) }
let(:storage) { create(:nextcloud_storage, oauth_application:, oauth_client: oauth_client_credentials) }
@@ -90,39 +90,39 @@ RSpec.describe API::V3::Storages::StorageRepresenter, 'rendering' do
let(:uploader_role) { create(:project_role, permissions: [:manage_file_links]) }
# rubocop:disable RSpec/ExampleLength
- it 'contains upload information for each of these projects' do
+ it "contains upload information for each of these projects" do
project_linked_with_upload_permission =
- create(:project, name: 'project linked, user member with upload permission').tap do |project|
+ create(:project, name: "project linked, user member with upload permission").tap do |project|
create(:project_storage, project:, storage:, creator: user)
create(:member, user:, project:, roles: [uploader_role])
end
another_project_linked_with_upload_permission =
- create(:project, name: 'another project linked, user member with upload permission').tap do |project|
+ create(:project, name: "another project linked, user member with upload permission").tap do |project|
create(:project_storage, project:, storage:, creator: user)
create(:member, user:, project:, roles: [uploader_role])
end
- create(:project, name: 'project linked, no permissions').tap do |project|
+ create(:project, name: "project linked, no permissions").tap do |project|
create(:project_storage, project:, storage:, creator: user)
create(:member, user:, project:, roles: [no_permissions_role])
end
- create(:project, name: 'project linked, user not member').tap do |project|
+ create(:project, name: "project linked, user not member").tap do |project|
create(:project_storage, project:, storage:, creator: user)
end
- create(:project, active: false, name: 'archived project linked, user member with upload permission').tap do |project|
+ create(:project, active: false, name: "archived project linked, user member with upload permission").tap do |project|
create(:project_storage, project:, storage:, creator: user)
create(:member, user:, project:, roles: [uploader_role])
end
- create(:project, name: 'project linked, another user is member with upload permission').tap do |project|
+ create(:project, name: "project linked, another user is member with upload permission").tap do |project|
create(:project_storage, project:, storage:, creator: user)
create(:member, user: another_user, project:, roles: [uploader_role])
end
- create(:project, name: 'project not linked, with upload permission').tap do |project|
+ create(:project, name: "project not linked, with upload permission").tap do |project|
create(:member, user:, project:, roles: [uploader_role])
end
- expect(generated).to have_json_size(2).at_path('_links/prepareUpload')
+ expect(generated).to have_json_size(2).at_path("_links/prepareUpload")
- project_ids = JSON.parse(generated).dig('_links', 'prepareUpload').map { _1.dig('payload', 'projectId') }
+ project_ids = JSON.parse(generated).dig("_links", "prepareUpload").map { _1.dig("payload", "projectId") }
expect(project_ids)
.to contain_exactly(project_linked_with_upload_permission.id, another_project_linked_with_upload_permission.id)
end
@@ -130,164 +130,165 @@ RSpec.describe API::V3::Storages::StorageRepresenter, 'rendering' do
end
end
- describe 'oauthApplication' do
- it_behaves_like 'has no link' do
- let(:link) { 'oauthApplication' }
+ describe "oauthApplication" do
+ it_behaves_like "has no link" do
+ let(:link) { "oauthApplication" }
end
- context 'as admin' do
+ context "as admin" do
let(:user) { build_stubbed(:admin) }
- it_behaves_like 'has a titled link' do
- let(:link) { 'oauthApplication' }
+ it_behaves_like "has a titled link" do
+ let(:link) { "oauthApplication" }
let(:href) { "/api/v3/oauth_applications/#{oauth_application.id}" }
let(:title) { oauth_application.name }
end
- context 'with invalid configured storage with missing oauth application' do
+ context "with invalid configured storage with missing oauth application" do
let(:oauth_application) { nil }
- it_behaves_like 'has an untitled link' do
- let(:link) { 'oauthApplication' }
+ it_behaves_like "has an untitled link" do
+ let(:link) { "oauthApplication" }
let(:href) { nil }
end
end
end
end
- describe 'oauthClientCredentials' do
- it_behaves_like 'has no link' do
- let(:link) { 'oauthClientCredentials' }
+ describe "oauthClientCredentials" do
+ it_behaves_like "has no link" do
+ let(:link) { "oauthClientCredentials" }
end
- context 'as admin' do
+ context "as admin" do
let(:user) { build_stubbed(:admin) }
- it_behaves_like 'has an untitled link' do
- let(:link) { 'oauthClientCredentials' }
+ it_behaves_like "has an untitled link" do
+ let(:link) { "oauthClientCredentials" }
let(:href) { "/api/v3/oauth_client_credentials/#{oauth_client_credentials.id}" }
end
end
- context 'as admin without oauth client credentials set' do
+ context "as admin without oauth client credentials set" do
let(:user) { build_stubbed(:admin) }
let(:oauth_client_credentials) { nil }
- it_behaves_like 'has an untitled link' do
- let(:link) { 'oauthClientCredentials' }
+ it_behaves_like "has an untitled link" do
+ let(:link) { "oauthClientCredentials" }
let(:href) { nil }
end
end
end
end
- describe '_embedded' do
- describe 'oauthApplication' do
- it { is_expected.not_to have_json_path('_embedded/oauthApplication') }
+ describe "_embedded" do
+ describe "oauthApplication" do
+ it { is_expected.not_to have_json_path("_embedded/oauthApplication") }
- context 'as admin' do
+ context "as admin" do
let(:user) { build_stubbed(:admin) }
- it { is_expected.to be_json_eql(oauth_application.id).at_path('_embedded/oauthApplication/id') }
+ it { is_expected.to be_json_eql(oauth_application.id).at_path("_embedded/oauthApplication/id") }
end
end
- describe 'oauthClientCredentials' do
- it { is_expected.not_to have_json_path('_embedded/oauthClientCredentials') }
+ describe "oauthClientCredentials" do
+ it { is_expected.not_to have_json_path("_embedded/oauthClientCredentials") }
- context 'as admin' do
+ context "as admin" do
let(:user) { build_stubbed(:admin) }
- it { is_expected.to be_json_eql(oauth_client_credentials.id).at_path('_embedded/oauthClientCredentials/id') }
+ it { is_expected.to be_json_eql(oauth_client_credentials.id).at_path("_embedded/oauthClientCredentials/id") }
end
- context 'as admin without oauth client credentials set' do
+ context "as admin without oauth client credentials set" do
let(:user) { build_stubbed(:admin) }
let(:oauth_client_credentials) { nil }
- it { is_expected.not_to have_json_path('_embedded/oauthClientCredentials') }
+ it { is_expected.not_to have_json_path("_embedded/oauthClientCredentials") }
end
end
end
- describe 'properties' do
- it_behaves_like 'property', :_type do
- let(:value) { 'Storage' }
+ describe "properties" do
+ it_behaves_like "property", :_type do
+ let(:value) { "Storage" }
end
- it_behaves_like 'property', :id do
+ it_behaves_like "property", :id do
let(:value) { storage.id }
end
- it_behaves_like 'datetime property', :createdAt do
+ it_behaves_like "datetime property", :createdAt do
let(:value) { storage.created_at }
end
- it_behaves_like 'datetime property', :updatedAt do
+ it_behaves_like "datetime property", :updatedAt do
let(:value) { storage.updated_at }
end
- describe 'Automatically managed project folders' do
- shared_examples 'protects applicationPassword' do
- it 'does not render the applicationPassword' do
- expect(generated).not_to have_json_path('applicationPassword')
+ describe "Automatically managed project folders" do
+ shared_examples "protects applicationPassword" do
+ it "does not render the applicationPassword" do
+ expect(generated).not_to have_json_path("applicationPassword")
end
end
- context 'with automatic project folder management enabled' do
+ context "with automatic project folder management enabled" do
let(:storage) do
build(:nextcloud_storage, :as_automatically_managed, oauth_application:, oauth_client: oauth_client_credentials)
end
- it_behaves_like 'property', :hasApplicationPassword do
+ it_behaves_like "property", :hasApplicationPassword do
let(:value) { true }
end
- it_behaves_like 'protects applicationPassword'
+ it_behaves_like "protects applicationPassword"
end
- context 'with automatic project folder management disabled' do
+ context "with automatic project folder management disabled" do
let(:storage) do
build(:nextcloud_storage, :as_not_automatically_managed, oauth_application:, oauth_client: oauth_client_credentials)
end
- it_behaves_like 'property', :hasApplicationPassword do
+ it_behaves_like "property", :hasApplicationPassword do
let(:value) { false }
end
- it_behaves_like 'protects applicationPassword'
+ it_behaves_like "protects applicationPassword"
end
- context 'when automatic project folder management is not configured' do
+ context "when automatic project folder management is not configured" do
let(:storage) do
build(:nextcloud_storage,
provider_fields: { automatically_managed: false },
oauth_application:, oauth_client: oauth_client_credentials)
end
- it 'hasApplicationPassword is false' do
- expect(generated).to be_json_eql(false).at_path('hasApplicationPassword')
+ it "hasApplicationPassword is false" do
+ expect(generated).to be_json_eql(false).at_path("hasApplicationPassword")
end
- it_behaves_like 'protects applicationPassword'
+ it_behaves_like "protects applicationPassword"
end
- context 'with a non-Nextcloud storage' do
+ context "with a non-Nextcloud storage" do
let(:storage) do
build(:one_drive_storage, oauth_application:, oauth_client: oauth_client_credentials)
end
before do
- Storages::Peripherals::Registry.stub('one_drive.queries.open_storage', ->(_) do
- ServiceResult.success(result: 'https://my.sharepoint.com/sites/DeathStar/Documents')
- end)
+ Storages::Peripherals::Registry.stub(
+ "one_drive.queries.open_storage",
+ ->(_) { ServiceResult.success(result: "https://my.sharepoint.com/sites/DeathStar/Documents") }
+ )
end
- it 'does not include the property hasApplicationPassword' do
- expect(generated).not_to have_json_path('hasApplicationPassword')
+ it "does not include the property hasApplicationPassword" do
+ expect(generated).not_to have_json_path("hasApplicationPassword")
end
- it_behaves_like 'protects applicationPassword'
+ it_behaves_like "protects applicationPassword"
end
end
end
diff --git a/modules/storages/spec/support/fixtures/vcr_cassettes/one_drive/open_storage_query_invalid_token.yml b/modules/storages/spec/support/fixtures/vcr_cassettes/one_drive/open_storage_query_invalid_token.yml
deleted file mode 100644
index 1bfcb15d625..00000000000
--- a/modules/storages/spec/support/fixtures/vcr_cassettes/one_drive/open_storage_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?$select=webUrl
- 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:
- - bffd6278-3953-412d-afd7-dff03382cbfd
- Client-Request-Id:
- - bffd6278-3953-412d-afd7-dff03382cbfd
- X-Ms-Ags-Diagnostic:
- - '{"ServerInfo":{"DataCenter":"Germany West Central","Slice":"E","Ring":"5","ScaleUnit":"005","RoleInstance":"FR3PEPF000002E8"}}'
- 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:55:53 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:55:54","request-id":"bffd6278-3953-412d-afd7-dff03382cbfd","client-request-id":"bffd6278-3953-412d-afd7-dff03382cbfd"}}}'
- recorded_at: Tue, 30 Jan 2024 11:55:54 GMT
-recorded_with: VCR 6.2.0