Do Spar things transactionally
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 2.8k
- Forks
- 334
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 50
Description
Right, I think this might still be worth it in this one, and should look like something in the lines of:
insertScimAndSamlUser :: (HasCallStack, MonadClient m) => UserId -> SAML.UserRef -> ScimC.User.StoredUser SparTag -> m ()
insertScimAndSamlUser uid (SAML.UserRef tenant subject) scimUsr = retry x5 . batch $ do
setType BatchLogged
setConsistency Quorum
addPrepQuery insScim (uid, WrappedScimStoredUser scimUsr)
addPrepQuery insSaml (tenant, subject, uid)
where
insScim :: PrepQuery W (UserId, WrappedScimStoredUser SparTag) ()
insScim = "INSERT INTO scim_user (id, json) VALUES (?, ?)"
insSaml :: PrepQuery W (SAML.Issuer, SAML.NameID, UserId) ()
insSaml = "INSERT INTO user (issuer, sso_id, uid) VALUES (?, ?, ?)"
The main annoyance I see with this is that you will need a Show instance for WrappedScimStoredUser SparTag -> not sure how trivial it is to come up with a meaningful one.
Originally posted by @tiago-loureiro in https://github.com/wireapp/wire-server/pull/905
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the proposed insertScimAndSamlUser definition and the referenced pull request #905 first. Trace the existing Spar SCIM and SAML insertion path, including the batch and retry behavior shown in the issue. Done means the two inserts are handled transactionally as described and the WrappedScimStoredUser SparTag serialization concern is resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- backend, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100