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

Reword storage audience component towards token exchange

Jan Sandbrink99922b226067
diff --git a/modules/storages/app/components/storages/admin/storage_audience_info_component.erb b/modules/storages/app/components/storages/admin/storage_audience_info_component.erb
index 155416c665d..7d1d57eb5b6 100644
--- a/modules/storages/app/components/storages/admin/storage_audience_info_component.erb
+++ b/modules/storages/app/components/storages/admin/storage_audience_info_component.erb
@@ -31,12 +31,12 @@ See COPYRIGHT and LICENSE files for more details.
component_wrapper(tag: 'turbo-frame') do
grid_layout('op-storage-view--row', tag: :div, align_items: :center) do |grid|
grid.with_area(:item, tag: :div, mr: 3) do
- concat(render(Primer::Beta::Text.new(font_weight: :bold, mr: 1, test_selector: 'storage-audience-label')) { I18n.t('storages.file_storage_view.storage_audience') })
+ concat(render(Primer::Beta::Text.new(font_weight: :bold, mr: 1, test_selector: 'storage-audience-label')) { I18n.t('storages.file_storage_view.token_exchange') })
concat(configuration_check_label_for(:storage_audience_configured))
end
grid.with_area(:description, tag: :div, color: :subtle, test_selector: 'storage-audience-description') do
- concat(render(Primer::Beta::Text.new) { audience_summary })
+ concat(render(Primer::Beta::Text.new) { token_exchange_summary })
end
if editable_storage?
@@ -49,7 +49,7 @@ See COPYRIGHT and LICENSE files for more details.
tag: :a,
scheme: :invisible,
href: edit_storage_audience_admin_settings_storage_path(storage),
- aria: { label: I18n.t('storages.label_edit_storage_audience') },
+ aria: { label: I18n.t('storages.label_edit_token_exchange') },
test_selector: 'storage-edit-storage-audience-button',
data: { turbo_stream: true }
)
diff --git a/modules/storages/app/components/storages/admin/storage_audience_info_component.rb b/modules/storages/app/components/storages/admin/storage_audience_info_component.rb
index 00472d62008..86e9f957367 100644
--- a/modules/storages/app/components/storages/admin/storage_audience_info_component.rb
+++ b/modules/storages/app/components/storages/admin/storage_audience_info_component.rb
@@ -33,7 +33,7 @@ module Storages
class StorageAudienceInfoComponent < StorageInfoComponent
def self.wrapper_key = :storage_audience_section
- def audience_summary
+ def token_exchange_summary
case storage.storage_audience
when "", nil
I18n.t("storages.file_storage_view.storage_audience_blank")
diff --git a/modules/storages/config/locales/en.yml b/modules/storages/config/locales/en.yml
index 6acfd1fdf2c..d06285a3bf3 100644
--- a/modules/storages/config/locales/en.yml
+++ b/modules/storages/config/locales/en.yml
@@ -227,12 +227,12 @@ en:
openproject_oauth: OpenProject OAuth
project_folders: Project folders
redirect_uri: Redirect URI
- storage_audience: Storage Audience
storage_audience_blank: No audience has been configured.
- storage_audience_description: Obtaining tokens for audience "%{audience}".
- storage_audience_idp: Using first access token received by identity provider, regardless of audience.
+ storage_audience_description: Exchanging tokens for audience "%{audience}".
+ storage_audience_idp: Using access token obtained by identity provider during login, regardless of audience.
storage_oauth: Nextcloud OAuth
storage_provider: Storage provider
+ token_exchange: Token Exchange
health:
actions:
download_report: Download
@@ -386,9 +386,9 @@ en:
label_creator: Creator
label_delete_storage: Delete storage
label_edit_storage_access_management: Edit storage access management
- label_edit_storage_audience: Edit Storage Audience
label_edit_storage_automatically_managed_folders: Edit storage automatically managed folders
label_edit_storage_host: Edit storage host
+ label_edit_token_exchange: Edit token exchange configuration
label_existing_manual_folder: Existing folder with manually managed permissions
label_file_storage: File storage
label_host: Host URL
@@ -484,11 +484,11 @@ en:
storage_audience:
documentation_intro: Details on the following options and what needs to be configured in the identity provider can be found in our documentation.
idp:
- helptext: OpenProject will use the first access token received by the identity provider to authenticate requests to the storage. It will not try to obtain another token.
- label: Use first access token obtained by identity provider
+ helptext: OpenProject will use the access token received by the identity provider during the user's log in to authenticate requests to the storage. It will not try to obtain another token.
+ label: Use access token obtained during user's log in
manual:
- helptext: Allows you to set the audience of the storage. OpenProject will try to obtain a token for the given audience from the identity provider.
- label: Define storage audience manually
+ helptext: Allows you to set the audience of the storage. OpenProject will try to exchange a token for the given audience from the identity provider.
+ label: Specify audience for which to exchange access token
storage_list_blank_slate:
description: Add a storage to see them here.
heading: You don't have any storages yet.
diff --git a/modules/storages/spec/components/storages/admin/storage_audience_info_component_spec.rb b/modules/storages/spec/components/storages/admin/storage_audience_info_component_spec.rb
index 0ec18ba6a87..4c9841c3821 100644
--- a/modules/storages/spec/components/storages/admin/storage_audience_info_component_spec.rb
+++ b/modules/storages/spec/components/storages/admin/storage_audience_info_component_spec.rb
@@ -43,12 +43,12 @@ RSpec.describe Storages::Admin::StorageAudienceInfoComponent, type: :component d
render_component
expect(page).to have_test_selector("storage-audience-label")
- expect(page).to have_content("Storage Audience")
+ expect(page).to have_content("Token Exchange")
end
it "indicates the name of the selected audience" do
render_component
- expect(page).to have_content('Obtaining tokens for audience "Alice".')
+ expect(page).to have_content('Exchanging tokens for audience "Alice".')
end
context "when audience is empty string" do
@@ -74,7 +74,7 @@ RSpec.describe Storages::Admin::StorageAudienceInfoComponent, type: :component d
it "indicates that the IDP audience has been selected" do
render_component
- expect(page).to have_content("Using first access token received by identity provider, regardless of audience.")
+ expect(page).to have_content("Using access token obtained by identity provider during login, regardless of audience.")
end
end
end
diff --git a/modules/storages/spec/features/storages/admin/create_storage_spec.rb b/modules/storages/spec/features/storages/admin/create_storage_spec.rb
index ce0354b9971..0377675a998 100644
--- a/modules/storages/spec/features/storages/admin/create_storage_spec.rb
+++ b/modules/storages/spec/features/storages/admin/create_storage_spec.rb
@@ -225,7 +225,7 @@ RSpec.describe "Admin Create a new file storage",
end
expect(page).to have_test_selector("label-storage_audience_configured-status", text: "Completed")
- expect(page).to have_test_selector("storage-audience-description", text: "Obtaining tokens for audience \"nextcloud\"")
+ expect(page).to have_test_selector("storage-audience-description", text: "Exchanging tokens for audience \"nextcloud\"")
end
aggregate_failures "Automatically managed project folders" do
diff --git a/modules/storages/spec/features/storages/admin/edit_storage_spec.rb b/modules/storages/spec/features/storages/admin/edit_storage_spec.rb
index 7f1201dd58b..d388309293b 100644
--- a/modules/storages/spec/features/storages/admin/edit_storage_spec.rb
+++ b/modules/storages/spec/features/storages/admin/edit_storage_spec.rb
@@ -274,8 +274,8 @@ RSpec.describe "Admin Edit File storage",
expect(page).to have_test_selector("label-host_name_configured-status", text: "Completed")
expect(page).to have_test_selector("storage-description", text: "Nextcloud - #{storage.name} - #{storage.host}")
- # Storage audience
- expect(page).to have_test_selector("storage-audience-label", text: "Storage Audience")
+ # Token Exchange
+ expect(page).to have_test_selector("storage-audience-label", text: "Token Exchange")
expect(page).to have_test_selector("label-storage_audience_configured-status", text: "Incomplete")
expect(page).to have_test_selector("storage-audience-description", text: "No audience has been configured")
@@ -299,10 +299,10 @@ RSpec.describe "Admin Edit File storage",
end
end
- aggregate_failures "Storage Audience" do
+ aggregate_failures "Token Exchange" do
find_test_selector("storage-edit-storage-audience-button").click
within_test_selector("storage-audience-form") do
- expect(page).to have_checked_field("Define storage audience manually")
+ expect(page).to have_checked_field("Specify audience for which to exchange access token")
expect(page).to have_field("Storage Audience")
click_on "Save and continue"
@@ -310,38 +310,41 @@ RSpec.describe "Admin Edit File storage",
fill_in "Storage Audience", with: "schmaudience"
- choose("Use first access token obtained by identity provider")
+ choose("Use access token obtained during user's log in")
expect(page).to have_no_field("Storage Audience")
- choose("Define storage audience manually")
+ choose("Specify audience for which to exchange access token")
expect(page).to have_field("Storage Audience", with: "schmaudience")
click_on "Save and continue"
end
expect(page).to have_test_selector("label-storage_audience_configured-status", text: "Completed")
- expect(page).to have_test_selector("storage-audience-description", text: "Obtaining tokens for audience \"schmaudience\"")
+ expect(page).to have_test_selector(
+ "storage-audience-description",
+ text: "Exchanging tokens for audience \"schmaudience\""
+ )
find_test_selector("storage-edit-storage-audience-button").click
within_test_selector("storage-audience-form") do
- expect(page).to have_checked_field("Define storage audience manually")
+ expect(page).to have_checked_field("Specify audience for which to exchange access token")
expect(page).to have_field("Storage Audience", with: "schmaudience")
- choose("Use first access token obtained by identity provider")
+ choose("Use access token obtained during user's log in")
click_on "Save and continue"
end
expect(page).to have_test_selector("label-storage_audience_configured-status", text: "Completed")
expect(page).to have_test_selector(
"storage-audience-description",
- text: "Using first access token received by identity provider, regardless of audience."
+ text: "Using access token obtained by identity provider during login, regardless of audience."
)
find_test_selector("storage-edit-storage-audience-button").click
within_test_selector("storage-audience-form") do
- expect(page).to have_checked_field("Use first access token obtained by identity provider")
+ expect(page).to have_checked_field("Use access token obtained during user's log in")
expect(page).to have_no_field("Storage Audience")
- choose("Define storage audience manually")
+ choose("Specify audience for which to exchange access token")
expect(page).to have_field("Storage Audience", with: "")
end
end