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
Extend form validation
Oliver Güntherdb8283017c6c
diff --git a/modules/openid_connect/app/contracts/openid_connect/providers/base_contract.rb b/modules/openid_connect/app/contracts/openid_connect/providers/base_contract.rbindex e4efc55cdd0..03f909a67bc 100644--- a/modules/openid_connect/app/contracts/openid_connect/providers/base_contract.rb+++ b/modules/openid_connect/app/contracts/openid_connect/providers/base_contract.rb@@ -46,6 +46,31 @@ module OpenIDConnectvalidates :metadata_url,url: { allow_blank: true, allow_nil: true, schemes: %w[http https] },if: -> { model.metadata_url_changed? }++ attribute :authorization_endpoint+ validates :authorization_endpoint,+ url: { allow_blank: false, allow_nil: false, schemes: %w[http https] },+ if: -> { model.authorization_endpoint_changed? }++ attribute :userinfo_endpoint+ validates :userinfo_endpoint,+ url: { allow_blank: true, allow_nil: true, schemes: %w[http https] },+ if: -> { model.userinfo_endpoint_changed? }++ attribute :token_endpoint+ validates :token_endpoint,+ url: { allow_blank: true, allow_nil: true, schemes: %w[http https] },+ if: -> { model.token_endpoint_changed? }++ attribute :end_session_endpoint+ validates :end_session_endpoint,+ url: { allow_blank: true, allow_nil: true, schemes: %w[http https] },+ if: -> { model.end_session_endpoint_changed? }++ attribute :jwks_uri+ validates :jwks_uri,+ url: { allow_blank: true, allow_nil: true, schemes: %w[http https] },+ if: -> { model.jwks_uri_changed? }endendenddiff --git a/modules/openid_connect/app/models/openid_connect/provider.rb b/modules/openid_connect/app/models/openid_connect/provider.rbindex 9d5f5c4c867..dd446950ecb 100644--- a/modules/openid_connect/app/models/openid_connect/provider.rb+++ b/modules/openid_connect/app/models/openid_connect/provider.rb@@ -1,6 +1,6 @@module OpenIDConnectclass Provider < AuthProvider- OIDC_PROVIDERS = ["google", "microsoft_entra", "custom"].freeze+ OIDC_PROVIDERS = %w[google microsoft_entra custom].freezeDISCOVERABLE_ATTRIBUTES_ALL = %i[authorization_endpointuserinfo_endpointtoken_endpoint@@ -8,7 +8,7 @@ module OpenIDConnectjwks_uriissuer].freezeDISCOVERABLE_ATTRIBUTES_OPTIONAL = %i[end_session_endpoint].freeze- DISCOVERABLE_ATTRIBUTES_MANDATORY = DISCOVERABLE_ATTRIBUTES_ALL - %i[end_session_endpoint]+ DISCOVERABLE_ATTRIBUTES_MANDATORY = DISCOVERABLE_ATTRIBUTES_ALL - %i[end_session_endpoint jwks_uri]store_attribute :options, :oidc_provider, :stringstore_attribute :options, :metadata_url, :string