Merged
Conversation
a35c98f to
6e3c4b9
Compare
19493be to
024a526
Compare
(idp by issuer is stored either in one or the other table, never in both, so this doesn't matter except for considerations as to which is most likely to fail and should therefore be tried last.)
`guardReplaceeV2` was never called, and what it checks is already checked in the beginning of `validateNewIdP`; `guardSameTeam` was either testing a tautology or a falsehood, depending on the call side, so it was easy to simplify.
There is an error in this test if we do it the way it's supposed to work, but if we move an offending entry out of the way in `spar.issure_idp_v2` before running into the bug, the test passes. Revert of this commit and proper fix coming up!
This reverts commit 024a526b8bc1e3d3a925a6d8fe85acb6a548efbe.
fc8ecb0 to
adfd1e4
Compare
370d1cf to
178ea3b
Compare
pcapriotti
approved these changes
Sep 16, 2021
| Data.GetIdPNotFound -> pure () | ||
| res@(Data.GetIdPDanglingId _) -> throwSpar . SparIdPNotFound . ("validateNewIdP: " <>) . cs . show $ res -- database inconsistency | ||
| res@(Data.GetIdPNonUnique _) -> throwSpar . SparIdPNotFound . ("validateNewIdP: " <>) . cs . show $ res -- impossible | ||
| Data.GetIdPNonUnique ids' {- same team didn't yield anything, but there are at least two other teams with this issuer already -} -> handleIdPClash (Left ids') |
Contributor
There was a problem hiding this comment.
It seems unnecessary to distinguish between the "non unique" case and the "wrong team", since "non unique" implies "wrong team", and they can still be distinguished by the size of the list.
Contributor
Author
There was a problem hiding this comment.
Good idea, but separate PR. (And I think this may become more obvious of a change if I make the CRUD API for IdPs in Spar.Data less abstract, and expose functions that do precisely what's needed on the call side, and nothing else.)
| | GetUserNotFound | ||
| | GetUserNoTeam | ||
| | GetUserWrongTeam | ||
| deriving (Eq, Show) |
Contributor
There was a problem hiding this comment.
I think you can just deriving Functor.
Contributor
Author
There was a problem hiding this comment.
Thanks, will fix in an upcoming PR. (Also for GetIdPResult in Spar.Data.)
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.
Stuff that should have been part of #1755, but wasn't due to time pressure. See CHANGELOG and individual commits for details. It probably makes sense to read this changelog.d first, then commit-by-commit.
Checklist
make git-add-cassandra-schemato update the cassandra schema documentation.changelog.d.