SQSERVICES-1519 IdP for SAML that was overridden by update cannot be added again#2400
Merged
battermann merged 6 commits intodevelopfrom May 19, 2022
Conversation
fisx
approved these changes
May 18, 2022
| (teamid, idp) <- validateIdPUpdate zusr idpmeta idpid | ||
| GalleyAccess.assertSSOEnabled teamid | ||
| forM_ (idp ^. SAML.idpExtraInfo . wiOldIssuers) IdPConfigStore.deleteIssuer | ||
| IdPRawMetadataStore.store (idp ^. SAML.idpId) raw |
Contributor
There was a problem hiding this comment.
if spar crashes at the right moment, this will cause the old idp to be deleted and the new not to be introduced, which is not fixable over the rest api (let alone the UI).
I don't see a good way around this, though. It would be really nice to have transactions and postgres and everything. but i would like to have the comment below reflect this. (could you maybe also fix my typo there while you're at it ("epected")?)
Contributor
Author
There was a problem hiding this comment.
I moved the deletion to the end which leaves a less inconsistent state, in the case of a failure. And I added a comment.
Co-authored-by: fisx <mf@zerobuzz.net>
This was referenced Jun 7, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://wearezeta.atlassian.net/browse/SQSERVICES-1519
Old behavior
When an IdP was updated, the entry in the table
issuer_idp_v2did not get overridden, but instead a new entry was made. Because the old entry still existed, adding the old IdP again failed.Changes
In this PR, on IdP update, old issuers in
issuer_idp_v2will be deleted. Not sure if this is the correct fix, as those old issuers may serve some other purpose that I am not aware of?Checklist
changelog.d.