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

Move SAML and OIDC keys under activerecord, not activemodel

Oliver Günthere91d4860ef80
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 83653ca5375..77a5a090c15 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1059,6 +1059,8 @@ en:
language: "Language"
last_login_on: "Last login"
failed_login_count: "Failed login attempts"
+ first_name: "First name"
+ last_name: "Last name"
first_login: "First login"
new_password: "New password"
password_confirmation: "Confirmation"
diff --git a/modules/auth_saml/app/components/saml/providers/side_panel/information_component.html.erb b/modules/auth_saml/app/components/saml/providers/side_panel/information_component.html.erb
index 7a38adc481b..758bde48119 100644
--- a/modules/auth_saml/app/components/saml/providers/side_panel/information_component.html.erb
+++ b/modules/auth_saml/app/components/saml/providers/side_panel/information_component.html.erb
@@ -5,7 +5,7 @@
component_collection do |collection|
collection.with_component(Primer::Beta::Heading.new(tag: :h5, mb: 1)) do
- I18n.t("activemodel.attributes.saml/provider.sp_entity_id")
+ I18n.t("activerecord.attributes.saml/provider.sp_entity_id")
end
collection.with_component(
@@ -13,7 +13,7 @@
)
collection.with_component(Primer::Beta::Heading.new(tag: :h5, mt: 4, mb: 1)) do
- I18n.t("activemodel.attributes.saml/provider.assertion_consumer_service_url")
+ I18n.t("activerecord.attributes.saml/provider.assertion_consumer_service_url")
end
collection.with_component(
diff --git a/modules/auth_saml/app/components/saml/providers/view_component.html.erb b/modules/auth_saml/app/components/saml/providers/view_component.html.erb
index c1ce44c6bd0..41e85061c95 100644
--- a/modules/auth_saml/app/components/saml/providers/view_component.html.erb
+++ b/modules/auth_saml/app/components/saml/providers/view_component.html.erb
@@ -9,7 +9,7 @@
<%= render(border_box_container) do |component|
component.with_header(color: :muted) do
- render(Primer::Beta::Text.new(font_weight: :semibold)) { I18n.t("activemodel.attributes.saml/provider.display_name") }
+ render(Primer::Beta::Text.new(font_weight: :semibold)) { I18n.t("activerecord.attributes.saml/provider.display_name") }
end
component.with_row(scheme: :default) do
diff --git a/modules/auth_saml/app/forms/saml/providers/configuration_form.rb b/modules/auth_saml/app/forms/saml/providers/configuration_form.rb
index c917d3ec1c7..fa4dabcacb3 100644
--- a/modules/auth_saml/app/forms/saml/providers/configuration_form.rb
+++ b/modules/auth_saml/app/forms/saml/providers/configuration_form.rb
@@ -32,7 +32,7 @@ module Saml
form do |f|
f.text_field(
name: :sp_entity_id,
- label: I18n.t("activemodel.attributes.saml/provider.sp_entity_id"),
+ label: I18n.t("activerecord.attributes.saml/provider.sp_entity_id"),
caption: I18n.t("saml.instructions.sp_entity_id"),
disabled: provider.seeded_from_env?,
required: true,
@@ -40,7 +40,7 @@ module Saml
)
f.text_field(
name: :idp_sso_service_url,
- label: I18n.t("activemodel.attributes.saml/provider.idp_sso_service_url"),
+ label: I18n.t("activerecord.attributes.saml/provider.idp_sso_service_url"),
caption: I18n.t("saml.instructions.idp_sso_service_url"),
disabled: provider.seeded_from_env?,
required: true,
@@ -48,7 +48,7 @@ module Saml
)
f.text_field(
name: :idp_slo_service_url,
- label: I18n.t("activemodel.attributes.saml/provider.idp_slo_service_url"),
+ label: I18n.t("activerecord.attributes.saml/provider.idp_slo_service_url"),
caption: I18n.t("saml.instructions.idp_slo_service_url"),
disabled: provider.seeded_from_env?,
required: false,
@@ -57,7 +57,7 @@ module Saml
f.text_area(
name: :idp_cert,
rows: 10,
- label: I18n.t("activemodel.attributes.saml/provider.idp_cert"),
+ label: I18n.t("activerecord.attributes.saml/provider.idp_cert"),
caption: I18n.t("saml.instructions.idp_cert"),
disabled: provider.seeded_from_env?,
required: true,
@@ -65,7 +65,7 @@ module Saml
)
f.select_list(
name: "name_identifier_format",
- label: I18n.t("activemodel.attributes.saml/provider.name_identifier_format"),
+ label: I18n.t("activerecord.attributes.saml/provider.name_identifier_format"),
input_width: :large,
disabled: provider.seeded_from_env?,
caption: I18n.t("saml.instructions.name_identifier_format")
@@ -76,7 +76,7 @@ module Saml
end
f.check_box(
name: :limit_self_registration,
- label: I18n.t("activemodel.attributes.saml/provider.limit_self_registration"),
+ label: I18n.t("activerecord.attributes.saml/provider.limit_self_registration"),
caption: I18n.t("saml.instructions.limit_self_registration"),
disabled: provider.seeded_from_env?,
required: false,
@@ -84,7 +84,7 @@ module Saml
)
f.text_field(
name: :icon,
- label: I18n.t("activemodel.attributes.saml/provider.icon"),
+ label: I18n.t("activerecord.attributes.saml/provider.icon"),
caption: I18n.t("saml.instructions.icon"),
disabled: provider.seeded_from_env?,
required: false,
diff --git a/modules/auth_saml/app/forms/saml/providers/encryption_form.rb b/modules/auth_saml/app/forms/saml/providers/encryption_form.rb
index 6ca17831771..597db37e833 100644
--- a/modules/auth_saml/app/forms/saml/providers/encryption_form.rb
+++ b/modules/auth_saml/app/forms/saml/providers/encryption_form.rb
@@ -32,21 +32,21 @@ module Saml
form do |f|
f.check_box(
name: :authn_requests_signed,
- label: I18n.t("activemodel.attributes.saml/provider.authn_requests_signed"),
+ label: I18n.t("activerecord.attributes.saml/provider.authn_requests_signed"),
caption: I18n.t("saml.instructions.authn_requests_signed"),
disabled: provider.seeded_from_env?,
required: true
)
f.check_box(
name: :want_assertions_signed,
- label: I18n.t("activemodel.attributes.saml/provider.want_assertions_signed"),
+ label: I18n.t("activerecord.attributes.saml/provider.want_assertions_signed"),
caption: I18n.t("saml.instructions.want_assertions_signed"),
disabled: provider.seeded_from_env?,
required: true
)
f.check_box(
name: :want_assertions_encrypted,
- label: I18n.t("activemodel.attributes.saml/provider.want_assertions_encrypted"),
+ label: I18n.t("activerecord.attributes.saml/provider.want_assertions_encrypted"),
caption: I18n.t("saml.instructions.want_assertions_encrypted"),
disabled: provider.seeded_from_env?,
required: true
@@ -54,7 +54,7 @@ module Saml
f.text_area(
name: :certificate,
rows: 10,
- label: I18n.t("activemodel.attributes.saml/provider.certificate"),
+ label: I18n.t("activerecord.attributes.saml/provider.certificate"),
caption: I18n.t("saml.instructions.certificate"),
required: false,
disabled: provider.seeded_from_env?,
@@ -63,7 +63,7 @@ module Saml
f.text_area(
name: :private_key,
rows: 10,
- label: I18n.t("activemodel.attributes.saml/provider.private_key"),
+ label: I18n.t("activerecord.attributes.saml/provider.private_key"),
caption: I18n.t("saml.instructions.private_key"),
required: false,
disabled: provider.seeded_from_env?,
@@ -71,7 +71,7 @@ module Saml
)
f.select_list(
name: :digest_method,
- label: I18n.t("activemodel.attributes.saml/provider.digest_method"),
+ label: I18n.t("activerecord.attributes.saml/provider.digest_method"),
input_width: :large,
disabled: provider.seeded_from_env?,
caption: I18n.t("saml.instructions.digest_method", default_option: "SHA-1")
@@ -82,7 +82,7 @@ module Saml
end
f.select_list(
name: :signature_method,
- label: I18n.t("activemodel.attributes.saml/provider.signature_method"),
+ label: I18n.t("activerecord.attributes.saml/provider.signature_method"),
input_width: :large,
disabled: provider.seeded_from_env?,
caption: I18n.t("saml.instructions.signature_method", default_option: "RSA SHA-1")
diff --git a/modules/auth_saml/app/forms/saml/providers/name_input_form.rb b/modules/auth_saml/app/forms/saml/providers/name_input_form.rb
index 4583f710e2c..681e4310180 100644
--- a/modules/auth_saml/app/forms/saml/providers/name_input_form.rb
+++ b/modules/auth_saml/app/forms/saml/providers/name_input_form.rb
@@ -32,7 +32,7 @@ module Saml
form do |f|
f.text_field(
name: :display_name,
- label: I18n.t("activemodel.attributes.saml/provider.display_name"),
+ label: I18n.t("activerecord.attributes.saml/provider.display_name"),
required: true,
disabled: provider.seeded_from_env?,
caption: I18n.t("saml.instructions.display_name"),
diff --git a/modules/auth_saml/app/forms/saml/providers/request_attributes_form.rb b/modules/auth_saml/app/forms/saml/providers/request_attributes_form.rb
index e0b4cadcb9e..c336bbf05a6 100644
--- a/modules/auth_saml/app/forms/saml/providers/request_attributes_form.rb
+++ b/modules/auth_saml/app/forms/saml/providers/request_attributes_form.rb
@@ -47,7 +47,7 @@ module Saml
form_group.select_list(
name: :"requested_#{attribute}_format",
- label: I18n.t("activemodel.attributes.saml/provider.format"),
+ label: I18n.t("activerecord.attributes.saml/provider.format"),
input_width: :large,
disabled: provider.seeded_from_env?,
caption: link_translate(
diff --git a/modules/auth_saml/config/locales/en.yml b/modules/auth_saml/config/locales/en.yml
index b1993b9b2f8..9fe4c38fed4 100644
--- a/modules/auth_saml/config/locales/en.yml
+++ b/modules/auth_saml/config/locales/en.yml
@@ -1,5 +1,5 @@
en:
- activemodel:
+ activerecord:
attributes:
saml/provider:
display_name: Name
@@ -23,7 +23,6 @@ en:
digest_method: Digest algorithm
format: "Format"
icon: "Custom icon"
- activerecord:
errors:
models:
saml/provider:
diff --git a/modules/auth_saml/spec/features/administration/saml_crud_spec.rb b/modules/auth_saml/spec/features/administration/saml_crud_spec.rb
index f44a4233d0e..7af47cdb36e 100644
--- a/modules/auth_saml/spec/features/administration/saml_crud_spec.rb
+++ b/modules/auth_saml/spec/features/administration/saml_crud_spec.rb
@@ -174,7 +174,7 @@ RSpec.describe "SAML administration CRUD",
fill_in "Name", with: "My provider"
click_link_or_button "Continue"
- expect(page).to have_text "Display name has already been taken."
+ expect(page).to have_text "Name has already been taken."
end
it "can toggle limit_self_registration (Regression #59370)" do
diff --git a/modules/auth_saml/spec/seeders/env_data/saml/provider_seeder_spec.rb b/modules/auth_saml/spec/seeders/env_data/saml/provider_seeder_spec.rb
index 7fb41c26db9..fe89d496ab2 100644
--- a/modules/auth_saml/spec/seeders/env_data/saml/provider_seeder_spec.rb
+++ b/modules/auth_saml/spec/seeders/env_data/saml/provider_seeder_spec.rb
@@ -104,7 +104,8 @@ RSpec.describe EnvData::Saml::ProviderSeeder, :settings_reset do
OPENPROJECT_SAML_SAML_IDP__CERT: "invalid"
} do
it "raises an exception" do
- expect { seeder.seed! }.to raise_error(/Idp cert is not a valid PEM-formatted certificate/)
+ expect { seeder.seed! }
+ .to raise_error(/Public certificate of identity provider is not a valid PEM-formatted certificate/)
expect(Saml::Provider.all).to be_empty
end
diff --git a/modules/openid_connect/app/components/openid_connect/providers/claims_form.rb b/modules/openid_connect/app/components/openid_connect/providers/claims_form.rb
index 02722ffc0d1..1a4fdee56f7 100644
--- a/modules/openid_connect/app/components/openid_connect/providers/claims_form.rb
+++ b/modules/openid_connect/app/components/openid_connect/providers/claims_form.rb
@@ -35,7 +35,7 @@ module OpenIDConnect
f.text_area(
name: :claims,
rows: 10,
- label: I18n.t("activemodel.attributes.openid_connect/provider.claims"),
+ label: I18n.t("activerecord.attributes.openid_connect/provider.claims"),
caption: link_translate(
"openid_connect.instructions.claims",
links: {
@@ -49,7 +49,7 @@ module OpenIDConnect
f.text_field(
name: :acr_values,
- label: I18n.t("activemodel.attributes.openid_connect/provider.acr_values"),
+ label: I18n.t("activerecord.attributes.openid_connect/provider.acr_values"),
caption: link_translate(
"openid_connect.instructions.acr_values",
links: {
diff --git a/modules/openid_connect/app/components/openid_connect/providers/client_details_form.rb b/modules/openid_connect/app/components/openid_connect/providers/client_details_form.rb
index 88731db4091..fc25de4d1bc 100644
--- a/modules/openid_connect/app/components/openid_connect/providers/client_details_form.rb
+++ b/modules/openid_connect/app/components/openid_connect/providers/client_details_form.rb
@@ -35,7 +35,7 @@ module OpenIDConnect
%i[client_id client_secret].each do |attr|
f.text_field(
name: attr,
- label: I18n.t("activemodel.attributes.openid_connect/provider.#{attr}"),
+ label: I18n.t("activerecord.attributes.openid_connect/provider.#{attr}"),
caption: I18n.t("openid_connect.instructions.#{attr}"),
disabled: provider.seeded_from_env?,
required: true,
@@ -44,7 +44,7 @@ module OpenIDConnect
end
f.text_field(
name: :post_logout_redirect_uri,
- label: I18n.t("activemodel.attributes.openid_connect/provider.post_logout_redirect_uri"),
+ label: I18n.t("activerecord.attributes.openid_connect/provider.post_logout_redirect_uri"),
caption: I18n.t("openid_connect.instructions.post_logout_redirect_uri"),
disabled: provider.seeded_from_env?,
required: false,
@@ -52,7 +52,7 @@ module OpenIDConnect
)
f.text_field(
name: :scope,
- label: I18n.t("activemodel.attributes.openid_connect/provider.scope"),
+ label: I18n.t("activerecord.attributes.openid_connect/provider.scope"),
caption: link_translate(
"openid_connect.instructions.scope",
links: {
@@ -65,7 +65,7 @@ module OpenIDConnect
)
f.check_box(
name: :limit_self_registration,
- label: I18n.t("activemodel.attributes.openid_connect/provider.limit_self_registration"),
+ label: I18n.t("activerecord.attributes.openid_connect/provider.limit_self_registration"),
caption: I18n.t("openid_connect.instructions.limit_self_registration"),
disabled: provider.seeded_from_env?,
required: true
diff --git a/modules/openid_connect/app/components/openid_connect/providers/metadata_details_form.rb b/modules/openid_connect/app/components/openid_connect/providers/metadata_details_form.rb
index 11de02f39f9..cdce864fa77 100644
--- a/modules/openid_connect/app/components/openid_connect/providers/metadata_details_form.rb
+++ b/modules/openid_connect/app/components/openid_connect/providers/metadata_details_form.rb
@@ -33,7 +33,7 @@ module OpenIDConnect
OpenIDConnect::Provider::DISCOVERABLE_STRING_ATTRIBUTES_ALL.each do |attr|
f.text_field(
name: attr,
- label: I18n.t("activemodel.attributes.openid_connect/provider.#{attr}"),
+ label: I18n.t("activerecord.attributes.openid_connect/provider.#{attr}"),
disabled: provider.seeded_from_env?,
required: OpenIDConnect::Provider::DISCOVERABLE_STRING_ATTRIBUTES_MANDATORY.include?(attr),
input_width: :large
@@ -43,7 +43,7 @@ module OpenIDConnect
if OpenProject::FeatureDecisions.oidc_token_exchange_active?
f.text_field(
name: :grant_types_supported,
- label: I18n.t("activemodel.attributes.openid_connect/provider.grant_types_supported"),
+ label: I18n.t("activerecord.attributes.openid_connect/provider.grant_types_supported"),
disabled: provider.seeded_from_env?,
required: false,
input_width: :large
@@ -52,7 +52,7 @@ module OpenIDConnect
f.text_field(
name: :icon,
- label: I18n.t("activemodel.attributes.openid_connect/provider.icon"),
+ label: I18n.t("activerecord.attributes.openid_connect/provider.icon"),
caption: I18n.t("saml.instructions.icon"),
disabled: provider.seeded_from_env?,
required: false,
diff --git a/modules/openid_connect/app/components/openid_connect/providers/name_input_and_tenant_form.rb b/modules/openid_connect/app/components/openid_connect/providers/name_input_and_tenant_form.rb
index 16d73ccd3f1..09ae6787158 100644
--- a/modules/openid_connect/app/components/openid_connect/providers/name_input_and_tenant_form.rb
+++ b/modules/openid_connect/app/components/openid_connect/providers/name_input_and_tenant_form.rb
@@ -33,7 +33,7 @@ module OpenIDConnect
f.hidden(name: :oidc_provider, value: provider.oidc_provider)
f.text_field(
name: :display_name,
- label: I18n.t("activemodel.attributes.openid_connect/provider.display_name"),
+ label: I18n.t("activerecord.attributes.openid_connect/provider.display_name"),
required: true,
disabled: provider.seeded_from_env?,
caption: I18n.t("openid_connect.instructions.display_name"),
@@ -41,7 +41,7 @@ module OpenIDConnect
)
f.text_field(
name: :tenant,
- label: I18n.t("activemodel.attributes.openid_connect/provider.tenant"),
+ label: I18n.t("activerecord.attributes.openid_connect/provider.tenant"),
required: true,
disabled: provider.seeded_from_env?,
value: provider.tenant || "common",
diff --git a/modules/openid_connect/app/components/openid_connect/providers/name_input_form.rb b/modules/openid_connect/app/components/openid_connect/providers/name_input_form.rb
index 68728a4f46d..441563939d3 100644
--- a/modules/openid_connect/app/components/openid_connect/providers/name_input_form.rb
+++ b/modules/openid_connect/app/components/openid_connect/providers/name_input_form.rb
@@ -33,7 +33,7 @@ module OpenIDConnect
f.hidden(name: :oidc_provider, value: provider.oidc_provider)
f.text_field(
name: :display_name,
- label: I18n.t("activemodel.attributes.openid_connect/provider.display_name"),
+ label: I18n.t("activerecord.attributes.openid_connect/provider.display_name"),
required: true,
disabled: provider.seeded_from_env?,
caption: I18n.t("openid_connect.instructions.display_name"),
diff --git a/modules/openid_connect/app/components/openid_connect/providers/side_panel/information_component.html.erb b/modules/openid_connect/app/components/openid_connect/providers/side_panel/information_component.html.erb
index cc4a09471ca..eaf1b3b7118 100644
--- a/modules/openid_connect/app/components/openid_connect/providers/side_panel/information_component.html.erb
+++ b/modules/openid_connect/app/components/openid_connect/providers/side_panel/information_component.html.erb
@@ -5,7 +5,7 @@
component_collection do |collection|
collection.with_component(Primer::Beta::Heading.new(tag: :h5, mb: 1)) do
- I18n.t("activemodel.attributes.openid_connect/provider.slug")
+ I18n.t("activerecord.attributes.openid_connect/provider.slug")
end
collection.with_component(
@@ -13,7 +13,7 @@
)
collection.with_component(Primer::Beta::Heading.new(tag: :h5, mt: 4, mb: 1)) do
- I18n.t("activemodel.attributes.openid_connect/provider.redirect_url")
+ I18n.t("activerecord.attributes.openid_connect/provider.redirect_url")
end
collection.with_component(
diff --git a/modules/openid_connect/app/components/openid_connect/providers/view_component.html.erb b/modules/openid_connect/app/components/openid_connect/providers/view_component.html.erb
index bdd8d873b98..3509c4ec06e 100644
--- a/modules/openid_connect/app/components/openid_connect/providers/view_component.html.erb
+++ b/modules/openid_connect/app/components/openid_connect/providers/view_component.html.erb
@@ -30,7 +30,7 @@
provider,
view_mode:,
target_state: :name,
- heading: t("activemodel.attributes.openid_connect/provider.display_name"),
+ heading: t("activerecord.attributes.openid_connect/provider.display_name"),
description: t("openid_connect.providers.section_texts.display_name")
)
end
@@ -80,7 +80,7 @@
provider,
view_mode:,
target_state: :name,
- heading: t("activemodel.attributes.openid_connect/provider.display_name"),
+ heading: t("activerecord.attributes.openid_connect/provider.display_name"),
description: t("openid_connect.providers.section_texts.display_name")
)
end
@@ -130,7 +130,7 @@
provider,
view_mode:,
target_state: :name,
- heading: t("activemodel.attributes.openid_connect/provider.display_name"),
+ heading: t("activerecord.attributes.openid_connect/provider.display_name"),
description: t("openid_connect.providers.section_texts.display_name")
)
end
@@ -277,7 +277,7 @@
provider,
target_state: :claims,
view_mode:,
- heading: t("activemodel.attributes.openid_connect/provider.claims"),
+ heading: t("activerecord.attributes.openid_connect/provider.claims"),
description: t("openid_connect.providers.section_texts.claims")
)
)
diff --git a/modules/openid_connect/config/locales/en.yml b/modules/openid_connect/config/locales/en.yml
index 73601220a80..9b0f42e7842 100644
--- a/modules/openid_connect/config/locales/en.yml
+++ b/modules/openid_connect/config/locales/en.yml
@@ -5,7 +5,7 @@ en:
logout_warning: >
You have been logged out. The contents of any form you submit may be lost.
Please [log in].
- activemodel:
+ activerecord:
attributes:
openid_connect/provider:
name: Name
@@ -30,7 +30,6 @@ en:
claims: Claims
acr_values: ACR values
redirect_url: Redirect URL
- activerecord:
errors:
models:
openid_connect/provider: