-
Notifications
You must be signed in to change notification settings - Fork 333
Forbid manual updates to email, handle, display for SCIM-managed users #1320
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
Conversation
email <- randomEmail | ||
call $ | ||
changeEmailBrig brig uid email !!! do | ||
(fmap Wai.label . responseJsonEither @Wai.Error) === const (Right "property-managed-by-scim") |
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 think we're using property
as a technical term for something else. What about managed-by-scim
? Or user-managed-by-scim
?
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.
Renamed to managed-by-scim
@@ -147,6 +148,11 @@ import Network.Wai.Utilities | |||
import qualified System.Logger.Class as Log | |||
import System.Logger.Message | |||
|
|||
data AllowSCIMUpdates |
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.
move to update section below line 401?
services/brig/src/Brig/API/User.hs
Outdated
when | ||
( userManagedBy u == ManagedByScim | ||
&& allowScim == ForbidSCIMUpdates | ||
) |
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.
when | |
( userManagedBy u == ManagedByScim | |
&& allowScim == ForbidSCIMUpdates | |
) | |
unless | |
( userManagedBy u /= ManagedByScim | |
|| old handle == new handle -- pseudo-code | |
|| allowScim /= ForbidSCIMUpdates | |
) |
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.
done
services/brig/src/Brig/API/User.hs
Outdated
@@ -525,6 +544,8 @@ changeEmail u email = do | |||
-- The user already has an email address and the new one is exactly the same | |||
Just current | current == em -> return ChangeEmailIdempotent | |||
_ -> do | |||
when (userManagedBy usr == ManagedByScim && allowScim == ForbidSCIMUpdates) $ |
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.
like above, you could change this to unless ...
.
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.
done
I think when spar is calling an internal brig end-point here to trigger email validation, and that end-point needs to call You should check if there are any other calls to this end-point and make sure that it's always |
Co-authored-by: fisx <[email protected]>
Co-authored-by: fisx <[email protected]>
Fixed the failing test by allow scim updates on the internal endpoint |
#1320) Co-authored-by: fisx <[email protected]>
Implements https://wearezeta.atlassian.net/browse/SQSERVICES-171