-
Notifications
You must be signed in to change notification settings - Fork 333
Fs 897 partial success for list users #3117
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
Changes from 13 commits
7ce12e0
fd50d79
5a16c53
761f2a5
f12495d
d00881d
a734dab
2e17c53
8b92905
e171a3c
0b99b16
2a1f51f
9e274cc
9abda4b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Adding a new version of /list-users that allows for partial success. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{-# LANGUAGE OverloadedLists #-} | ||
|
||
-- This file is part of the Wire Server implementation. | ||
-- | ||
-- Copyright (C) 2022 Wire Swiss GmbH <[email protected]> | ||
-- | ||
-- This program is free software: you can redistribute it and/or modify it under | ||
-- the terms of the GNU Affero General Public License as published by the Free | ||
-- Software Foundation, either version 3 of the License, or (at your option) any | ||
-- later version. | ||
-- | ||
-- This program is distributed in the hope that it will be useful, but WITHOUT | ||
-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
-- FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more | ||
-- details. | ||
-- | ||
-- You should have received a copy of the GNU Affero General Public License along | ||
-- with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
module Test.Wire.API.Golden.Manual.ListUsersById where | ||
|
||
import Data.Domain | ||
import Data.Id | ||
import Data.LegalHold | ||
import Data.Qualified | ||
import qualified Data.UUID as UUID | ||
import Imports | ||
import Wire.API.User | ||
|
||
domain1, domain2 :: Domain | ||
domain1 = Domain "example.com" | ||
domain2 = Domain "test.net" | ||
|
||
user1, user2 :: UserId | ||
user1 = Id . fromJust $ UUID.fromString "4f201a43-935e-4e19-8fe0-0a878d3d6e74" | ||
user2 = Id . fromJust $ UUID.fromString "eb48b095-d96f-4a94-b4ec-2a1d61447e13" | ||
|
||
profile1, profile2 :: UserProfile | ||
profile1 = | ||
UserProfile | ||
{ profileQualifiedId = Qualified user1 domain1, | ||
profileName = Name "user1", | ||
profilePict = Pict [], | ||
profileAssets = [], | ||
profileAccentId = ColourId 0, | ||
profileDeleted = False, | ||
profileService = Nothing, | ||
profileHandle = Nothing, | ||
profileExpire = Nothing, | ||
profileTeam = Nothing, | ||
profileEmail = Nothing, | ||
profileLegalholdStatus = UserLegalHoldDisabled | ||
} | ||
profile2 = | ||
UserProfile | ||
{ profileQualifiedId = Qualified user2 domain2, | ||
profileName = Name "user2", | ||
profilePict = Pict [], | ||
profileAssets = [], | ||
profileAccentId = ColourId 0, | ||
profileDeleted = False, | ||
profileService = Nothing, | ||
profileHandle = Nothing, | ||
profileExpire = Nothing, | ||
profileTeam = Nothing, | ||
profileEmail = Nothing, | ||
profileLegalholdStatus = UserLegalHoldDisabled | ||
} | ||
|
||
testObject_ListUsersById_user_1 :: ListUsersById | ||
testObject_ListUsersById_user_1 = ListUsersById mempty Nothing | ||
|
||
testObject_ListUsersById_user_2 :: ListUsersById | ||
testObject_ListUsersById_user_2 = | ||
ListUsersById | ||
{ listUsersByIdFound = [profile1, profile2], | ||
listUsersByIdFailed = Nothing | ||
} | ||
|
||
testObject_ListUsersById_user_3 :: ListUsersById | ||
testObject_ListUsersById_user_3 = | ||
ListUsersById | ||
{ listUsersByIdFound = [profile1], | ||
listUsersByIdFailed = pure $ [Qualified user2 domain2] | ||
} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where does this one and the other two There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The haskell values are in module Test.Wire.API.Golden.Manual.ListUsersById. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm sorry, but I can't find Haskell values |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ "found" : [] } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ "found" : | ||
[ { "qualified_id" : | ||
{ "domain" : "example.com" | ||
, "id" : "4f201a43-935e-4e19-8fe0-0a878d3d6e74" | ||
} | ||
, "id" : "4f201a43-935e-4e19-8fe0-0a878d3d6e74" | ||
, "name" : "user1" | ||
, "picture" : [] | ||
, "assets" : [] | ||
, "accent_id" : 0 | ||
, "legalhold_status" : "disabled" | ||
} | ||
, { "qualified_id" : | ||
{ "domain" : "test.net" | ||
, "id" : "eb48b095-d96f-4a94-b4ec-2a1d61447e13" | ||
} | ||
, "id" : "eb48b095-d96f-4a94-b4ec-2a1d61447e13" | ||
, "name" : "user2" | ||
, "picture" : [] | ||
, "assets" : [] | ||
, "accent_id" : 0 | ||
, "legalhold_status" : "disabled" | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ "found" : | ||
[ { "qualified_id" : | ||
{ "domain" : "example.com" | ||
, "id" : "4f201a43-935e-4e19-8fe0-0a878d3d6e74" | ||
} | ||
, "id" : "4f201a43-935e-4e19-8fe0-0a878d3d6e74" | ||
, "name" : "user1" | ||
, "picture" : [] | ||
, "assets" : [] | ||
, "accent_id" : 0 | ||
, "legalhold_status" : "disabled" | ||
} | ||
] | ||
, "failed" : | ||
[ { "domain" : "test.net" | ||
, "id" : "eb48b095-d96f-4a94-b4ec-2a1d61447e13" | ||
} | ||
] | ||
} |
Uh oh!
There was an error while loading. Please reload this page.