Skip to content

Sentry: track missing france_connect credentials - #318

Open
Samuelfaure wants to merge 1 commit into
developfrom
enhance/sentry_track_missing_fc
Open

Sentry: track missing france_connect credentials#318
Samuelfaure wants to merge 1 commit into
developfrom
enhance/sentry_track_missing_fc

Conversation

@Samuelfaure

Copy link
Copy Markdown
Contributor

Because I lost a bunch of time debugging missing credentials

Why? Because I lost a bunch of time debugging missing
credentials
@Samuelfaure
Samuelfaure requested review from Un3x and skelz0r August 3, 2026 12:54
@Samuelfaure
Samuelfaure marked this pull request as ready for review August 3, 2026 12:54

@skelz0r skelz0r left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

cf mon commentaire, je ne vois pas comment un client id/secret peut-être une chaîne france_connect_v2_whatever

end

def credentials_missing?
client_id == "france_connect_v2_#{api_name}_client_id" ||

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

je ne comprends pas comment cela peut fonctionner y'a un souci quelque part

@Samuelfaure Samuelfaure Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

En staging / dev, Siade.credentials[:france_connect_v2_allocation_rentree_scolaire_client_id] renvoie "france_connect_v2_allocation_rentree_scolaire_client_id" si cette clef n'existe pas

if Rails.env.local? || Rails.env.staging?
  credentials.default_proc = proc do |hash, key|
    is_url_or_domain = key.to_s.include?('_url') || key.to_s.end_with?('_domain')

    hash[key] = is_url_or_domain ? "https://#{key}.gouv.fr" : key.to_s
  end
else
  credentials.default_proc = proc do |_, key|
    raise KeyError, "key '#{key}' not found"
  end
end

En vrai je réalise qu'il faudrait juste virer le .staging? ici à la place, vu que ça raise en prod

@Samuelfaure Samuelfaure Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Quoique d'un autre coté on a mis le .staging? ici pour une bonne raison 🙄 on fait pas d'appels en staging donc osef des credentials... à l'exception de l'env d'intégration FC avec vrai token d'intégration.... mmmmhhh tu en penses quoi?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Je ne comprends pas ce que tu veux résoudre comme problème 😅

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

en staging j'ai passé un moment à debug l'absence des credentials FranceConnect 😅 je me dit que ça vaut la peine de log ça dans Sentry pour pas re-débug le meme problème

@Samuelfaure Samuelfaure closed this Aug 3, 2026
@Samuelfaure Samuelfaure reopened this Aug 3, 2026
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.

2 participants