-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SCIM Cleanup #1169
SCIM Cleanup #1169
Conversation
next up:
@arianvp what do you think? |
which means there is some code duplication in |
I'm blind! You already did that. yes bravo. this is the direction I want this to go |
services/spar/src/Spar/Scim/Types.hs
Outdated
_vsuSAMLUserRef :: SAML.UserRef, | ||
_vsuIdp :: IdP, | ||
-- mapping to 'Brig.User' | ||
{ _vsuUser :: Maybe (Scim.User.User SparTag), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why still store the SCIM user? synthesiszeScimUser
can give a Scim.User
for every ValidScimUser
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we will drop that field as a next step right? I am just rubber-ducking to myself. ignore me mostly
We don't need this anywhere, except for storing it in `spar.scim_user`, which will go away in this branch.
These two test cases are wrong now, we need to adjust the expectations:
|
I ran into my first non-trivial issue half-way through removing I propose to:
|
I'm pretty sure cassandra exposes these things for all rows natively.
|
You cannot do that unfortunately; you can only get the |
*Much* easier that way!
getSSOIdentity' brigUser' | ||
externalId <- toExternalId' ssoIdentity' | ||
samlIdentity <- do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this new code? what was wrong with toExternalId'
? It's not clear from context; not commit message, why this code was added to me
-- what we expect a user that comes back from spar to look like in terms of what it looked | ||
-- like when we sent it there. | ||
whatSparReturnsFor :: HasCallStack => IdP -> Int -> Scim.User.User SparTag -> Either String (Scim.User.User SparTag) | ||
whatSparReturnsFor idp richInfoSizeLimit = either (Left . show) (Right . synthesizeScimUser) . validateScimUser' idp richInfoSizeLimit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this might be a bit pedantic; and question of philosophy on testing.
Is the property we want to test here "spar distributes synthesizeUser over responses" or "Spar keeps these specific fields only" ?
Reason I ask is that my expected workflow would be to change the test to expect the new field; get a failure, then implement the new feature. However with the way we formulate the test now; that isn't possible as the test will magically pass.
That's ok; but just wondering whether coupling what we're testing with the implementation is what we want here? It probably is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a very valid point. i was wondering the same thing, wanna try duplicating the work in spar and see how ugly it gets?
This PR contains some cleanup work that should lead to fixing https://github.com/zinfra/backend-issues/issues/1006 in another PR.