Skip to content
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

Unblock release. #3871

Merged
merged 2 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 1 addition & 35 deletions integration/test/Test/LegalHold.hs
Original file line number Diff line number Diff line change
Expand Up @@ -165,39 +165,12 @@ testLHMessageExchange (TaggedBool clients1New) (TaggedBool clients2New) (TaggedB
(False, False, False, False) ->
-- no LH in the picture
check 201 Nothing
(False, False, False, True) ->
-- sender has old clients and not given consent, recipient has LH device
check 403 (Just "missing-legalhold-consent-old-clients")
(False, False, True, False) ->
-- recipient has old clients and not given consent, sender has LH device
check 403 (Just "missing-legalhold-consent-old-clients")
(False, False, True, True) ->
-- both sender, recipient have has old clients and LH devices, but given consent
check 403 (Just "missing-legalhold-consent-old-clients")
(False, True, False, False) ->
-- no LH in the picture
check 201 Nothing
(False, True, False, True) ->
-- sender has old clients and not given consent, recipient has LH device (and only new clients)
check 403 (Just "missing-legalhold-consent-old-clients")
(False, True, True, False) ->
-- sender has old clients but given consent and LH device; recipient has not given consent
check 403 (Just "missing-legalhold-consent-old-clients")
(False, True, True, True) ->
-- sender has old clients but given consent and LH device; recipient has LH device (and only new clients)
check 403 (Just "missing-legalhold-consent-old-clients")
(True, False, False, False) ->
-- no LH in the picture
check 201 Nothing
(True, False, False, True) ->
-- recipient has given consent and LH device, but old clients (and sender has not given consent)
check 403 (Just "missing-legalhold-consent-old-clients")
(True, False, True, False) ->
-- recipient has old clients and not given consent, sender has LH device
check 403 (Just "missing-legalhold-consent-old-clients")
(True, False, True, True) ->
-- old clients with recipient, LH devices by all
check 403 (Just "missing-legalhold-consent-old-clients")
(True, True, False, False) ->
-- no LH in the picture
check 201 Nothing
Expand All @@ -210,13 +183,13 @@ testLHMessageExchange (TaggedBool clients1New) (TaggedBool clients2New) (TaggedB
(True, True, True, True) ->
-- everybody happy with LH
check 201 Nothing
_ -> pure ()
stefanwire marked this conversation as resolved.
Show resolved Hide resolved

-- _oneWay -- run this if you want to make sure both ways are equivalent, but please don't commit!
theOtherWay

data TestClaimKeys
= TCKConsentMissing -- (team not whitelisted, that is)
| TCKOldClient
| TCKConsentAndNewClients
deriving (Show, Bounded, Enum)

Expand Down Expand Up @@ -245,10 +218,6 @@ testLHClaimKeys = WithBoundedEnumArg $ \testmode -> do
in case testmode of
TCKConsentMissing ->
addc $ Just ["legalhold-implicit-consent"]
TCKOldClient -> do
addc Nothing
void $ legalholdWhitelistTeam powner ptid >>= assertSuccess
void $ legalholdIsTeamInWhitelist powner ptid >>= assertSuccess
TCKConsentAndNewClients -> do
addc $ Just ["legalhold-implicit-consent"]
void $ legalholdWhitelistTeam powner ptid >>= assertSuccess
Expand All @@ -270,9 +239,6 @@ testLHClaimKeys = WithBoundedEnumArg $ \testmode -> do
TCKConsentMissing -> do
resp.status `shouldMatchInt` 403
resp.json %. "label" `shouldMatch` "missing-legalhold-consent"
TCKOldClient -> do
resp.status `shouldMatchInt` 403
resp.json %. "label" `shouldMatch` "missing-legalhold-consent-old-clients"
TCKConsentAndNewClients -> do
resp.status `shouldMatchInt` 200

Expand Down
2 changes: 1 addition & 1 deletion services/galley/src/Galley/API/LegalHold/Conflicts.hs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ guardLegalholdPolicyConflictsUid self (Map.keys . userClients -> otherUids) = do
-- when no other client is under LH, then we're good and can leave this function. but...
when anyClientHasLH $ do
P.debug $ Log.msg ("guardLegalholdPolicyConflicts[5]: anyClientHasLH" :: Text)
if anyClientIsOld
if anyClientIsOld && False -- https://wearezeta.atlassian.net/browse/WPB-6392
then do
-- you can't effectively give consent as long as you have old clients: when using the
-- old clients, you still would not be exposed to the popups and red dot where
Expand Down
Loading