Skip to content

Validate SAML configuration during application start#12035

Merged
mitchellhenke merged 2 commits intomainfrom
mitchellhenke/saml-metadata-500
Mar 31, 2025
Merged

Validate SAML configuration during application start#12035
mitchellhenke merged 2 commits intomainfrom
mitchellhenke/saml-metadata-500

Conversation

@mitchellhenke
Copy link
Copy Markdown
Contributor

🎫 Ticket

Link to the relevant ticket:
!156
-->

🛠 Summary of changes

We had an issue discovered recently in a non-prod environment where an invalid SAML passphrase was deployed but not detected until it was live. This is similar to #11612, but requiring a slightly different approach for SAML.

This PR makes changes to eagerly read and store the SAML configuration so that instead of failing during a request, it fails the deploy.

@mitchellhenke mitchellhenke requested review from a team, Sgtpluck and mmagsa March 28, 2025 21:07
@mitchellhenke mitchellhenke force-pushed the mitchellhenke/saml-metadata-500 branch 3 times, most recently from b94810c to dd345c5 Compare March 28, 2025 21:35
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[question] there's quite a lot of logic in these constants. i'm curious if we should make them methods (or even a class, although that might be overkill) rather than trying to do all this work here?

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.

Yeah, I was trying to figure out the best way to do that. To use methods, they have to be defined before the constants, and another class does feel like too much.

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.

I think the best two options are move the constants to the bottom of the file and define method for the setup (as we do here) or have long constants like it is now. Perhaps the first option is preferable?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hm, yeah! i think that would be nicer. maybe easier to test directly too?

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.

That's a really good point, will update.

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.

Refactored and added specs in 8234e7e

changelog: Internal, SAML, Validate SAML configuration during application start
@mitchellhenke mitchellhenke force-pushed the mitchellhenke/saml-metadata-500 branch from dd345c5 to 3c7541c Compare March 31, 2025 15:38
@mitchellhenke mitchellhenke merged commit 42a82bb into main Mar 31, 2025
1 check passed
@mitchellhenke mitchellhenke deleted the mitchellhenke/saml-metadata-500 branch March 31, 2025 18:20
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