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
Allow admin mapping
Oliver Günther32afae17e071
diff --git a/modules/openid_connect/app/models/openid_connect/provider.rb b/modules/openid_connect/app/models/openid_connect/provider.rbindex 8e54cf309ea..18fa645b515 100644--- a/modules/openid_connect/app/models/openid_connect/provider.rb+++ b/modules/openid_connect/app/models/openid_connect/provider.rb@@ -10,7 +10,7 @@ module OpenIDConnectDISCOVERABLE_ATTRIBUTES_OPTIONAL = %i[end_session_endpoint jwks_uri].freezeDISCOVERABLE_ATTRIBUTES_ALL = DISCOVERABLE_ATTRIBUTES_MANDATORY + DISCOVERABLE_ATTRIBUTES_OPTIONAL- MAPPABLE_ATTRIBUTES = %i[login email first_name last_name].freeze+ MAPPABLE_ATTRIBUTES = %i[login email first_name last_name admin].freezestore_attribute :options, :oidc_provider, :stringstore_attribute :options, :metadata_url, :stringdiff --git a/modules/openid_connect/app/services/openid_connect/configuration_mapper.rb b/modules/openid_connect/app/services/openid_connect/configuration_mapper.rbindex 57f6d367737..546916d048b 100644--- a/modules/openid_connect/app/services/openid_connect/configuration_mapper.rb+++ b/modules/openid_connect/app/services/openid_connect/configuration_mapper.rb@@ -45,8 +45,11 @@ module OpenIDConnect"client_secret" => options["secret"],"issuer" => options["issuer"],"host" => options["host"],+ "port" => options["port"],+ "scheme" => options["scheme"],"claims" => options["claims"],"tenant" => options["tenant"],+ "post_logout_redirect_uri" => options["post_logout_redirect_uri"],"limit_self_registration" => options["limit_self_registration"],"use_graph_api" => options["use_graph_api"],"acr_values" => options["acr_values"],@@ -113,7 +116,7 @@ module OpenIDConnectoptions["mapping_mail"] = options["attribute_map"]["email"]options["mapping_firstname"] = options["attribute_map"]["first_name"]options["mapping_lastname"] = options["attribute_map"]["last_name"]- options["mapping_uid"] = options["attribute_map"]["uid"]+ options["mapping_admin"] = options["attribute_map"]["admin"]endendenddiff --git a/modules/openid_connect/config/locales/en.yml b/modules/openid_connect/config/locales/en.ymlindex f54137e5ea7..76689750d8c 100644--- a/modules/openid_connect/config/locales/en.yml+++ b/modules/openid_connect/config/locales/en.yml@@ -76,6 +76,9 @@ en:Provide a custom mapping in the userinfo response to be used for the first name.mapping_last_name: >Provide a custom mapping in the userinfo response to be used for the last name.+ mapping_admin: >+ Provide a custom mapping in the userinfo response to be used for the admin status.+ It expects a boolean attribute to be returned.settings:metadata_none: I don't have this informationmetadata_url: I have a discovery endpoint URL