Skip to content

Conversation

@moustachu
Copy link
Member

@moustachu moustachu commented Nov 14, 2025

Backporting code for FranceConnect v2 on release/0.27-stable branch

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR backports FranceConnect v2 implementation from the main branch to the release/0.27-stable branch. The changes replace the deprecated omniauth-france_connect gem with a custom implementation based on OpenID Connect, updating authentication flows, configuration, UI elements, and tests.

Key Changes

  • Removed dependency on the external omniauth-france_connect gem and implemented a custom FranceConnect strategy using OpenID Connect
  • Refactored logout handling to use a new Configurator class that manages omniauth provider settings dynamically from database and environment variables
  • Updated FranceConnect UI assets with new official branding images (Principal, Alternative, and Disabled button states in SVG and PNG formats)

Reviewed Changes

Copilot reviewed 27 out of 44 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
lib/omniauth/strategies/france_connect.rb New custom FranceConnect strategy extending OpenIDConnect with specific French authentication parameters
lib/decidim_app/omniauth/configurator.rb New configurator class for dynamic omniauth provider configuration from multiple sources
lib/decidim_app/omniauth/openid_connect_utils.rb Utility class for setting up OpenID Connect provider configurations
lib/extends/controllers/decidim/devise/*_controller_extends.rb Refactored logout handling to use the new configurator pattern instead of session-based config
config/initializers/omniauth_france_connect.rb Simplified initializer using the new configurator approach
config/secrets.yml Updated FranceConnect configuration structure to match OpenID Connect requirements
config/locales/*.yml Updated translation keys for FranceConnect configuration and removed deprecated entries
app/views/decidim/devise/shared/_omniauth_buttons.html.erb Enhanced view to support custom button images with hover states
spec/**/*_spec.rb Updated tests to match new authentication flows and expect correct redirect behavior
app/packs/images/FranceConnect-Bouton/** Added official FranceConnect v2 button assets in multiple states and formats
Gemfile & Gemfile.lock Removed omniauth-france_connect gem dependency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +30 to +32
rescue Capybara::ElementNotFound
# do nothing
end
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty rescue block swallows all Capybara::ElementNotFound exceptions without logging or handling. Consider logging the exception or documenting why it's safe to ignore.

Copilot uses AI. Check for mistakes.
Comment on lines +16 to 27
<% if provider[:icon_path].present? %>
<%= link_to decidim.send("user_#{name}_omniauth_authorize_path"), class: "button button--social--custom", method: :post do %>
<% if provider[:icon_hover_path].present? %>
<%= image_pack_tag provider[:icon_path], class: "button--has-hover", alt: t("devise.shared.links.sign_in_with_provider", provider: provider_name) %>
<%= image_pack_tag provider[:icon_hover_path], class: "button--is-hover", alt: t("devise.shared.links.sign_in_with_provider", provider: provider_name) %>
<% else %>
<%= image_pack_tag provider[:icon_path], alt: t("devise.shared.links.sign_in_with_provider", provider: provider_name) %>
<% end %>
<% end %>
<% else %>
<%= sso_provider_image(name, decidim.send("user_#{name}_omniauth_authorize_path"), link_class: "button button--social--custom") %>
<% end %>
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The view references provider[:icon_path] and provider[:icon_hover_path] without checking if they exist in the provider hash. This could cause issues if these keys are not present. Consider using safe navigation or providing default values.

Copilot uses AI. Check for mistakes.
logout_path = omniauth_config.options(:logout_path)
end

if provider.present? && logout_policy == "session.destroy" && logout_path.present?
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Local variable logout_policy may be used before it is initialized.

Copilot uses AI. Check for mistakes.
logout_path = omniauth_config.options(:logout_path)
end

if provider.present? && logout_policy == "session.destroy" && logout_path.present?
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Local variable logout_path may be used before it is initialized.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants