Skip to content

Conversation

@fisx
Copy link
Contributor

@fisx fisx commented Nov 10, 2025

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Nov 10, 2025
@fisx fisx marked this pull request as ready for review November 10, 2025 12:40
@fisx fisx requested a review from a team as a code owner November 10, 2025 12:40
@fisx fisx mentioned this pull request Nov 10, 2025
7 tasks
@fisx fisx changed the title Create user groups with scim. [WPB-20053] Create user groups with scim. Nov 10, 2025
@fisx fisx requested review from a team as code owners November 10, 2025 12:57
<> (Text.decodeUtf8With lenientDecode . toStrict . errBody $ serr)
)
werr <- renderSparErrorWithLogging err <&> httpErrorToWaiError
-- TODO: we don't want to include the RichError part of
Copy link
Contributor

Choose a reason for hiding this comment

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

Was staring at the RichError data construction as well and wondering when if ever is the rich part used. It seems it's currently used in the Eq instance (newly added in this PR), and then constructed/used here services/brig/src/Brig/API/Error.hs:203:deleteUserError (DeleteUserPendingCode t) = RichError deletionCodePending (DeletionCodeTimeout t) [], everywhere else it's filled with ()/Null. I guess the question is: what is it's purpose, internal for debugging or could the outside world see it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suppose it's been solely for the deleteUserError use case so far then, but now we have two use cases :)

notifyAdmins ug
pure ug
where
guardMembersInTeam :: Sem r ()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

i rewrote this because i found the old code hard to read. probably should have done that in another PR...

renderSparError (SAML.CustomError (SparSomeHttpError err)) = err
-- Other
renderSparError (SAML.CustomServant err) = Left err
renderSparError (SAML.CustomServant err) = serverErrorToHttpError err
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If httpErrorToServerError . serverErrorToHttpError == id does not hold, the error will be rendered differently to the client. I think all the differences between the two should be cosmetic, though?

<> (Text.decodeUtf8With lenientDecode . toStrict . errBody $ serr)
)
werr <- renderSparErrorWithLogging err <&> httpErrorToWaiError
-- TODO: we don't want to include the RichError part of
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suppose it's been solely for the deleteUserError use case so far then, but now we have two use cases :)

@fisx fisx merged commit 5a3feab into develop Nov 11, 2025
2 checks passed
@fisx fisx deleted the WPB-20053-scim-groups-create-3 branch November 11, 2025 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants