diff --git a/changelog.d/5-internal/client-id-as-uint b/changelog.d/5-internal/client-id-as-uint new file mode 100644 index 0000000000..5df9f4ca1b --- /dev/null +++ b/changelog.d/5-internal/client-id-as-uint @@ -0,0 +1 @@ +Represent client IDs as Word64 internally diff --git a/libs/types-common/src/Data/Id.hs b/libs/types-common/src/Data/Id.hs index c96ae4dac2..5bc62d4ca5 100644 --- a/libs/types-common/src/Data/Id.hs +++ b/libs/types-common/src/Data/Id.hs @@ -42,7 +42,7 @@ module Data.Id -- * Client IDs ClientId (..), - newClientId, + clientToText, -- * Other IDs ConnId (..), @@ -65,6 +65,7 @@ import Data.Attoparsec.ByteString (()) import Data.Attoparsec.ByteString.Char8 qualified as Atto import Data.Bifunctor (first) import Data.Binary +import Data.Binary.Builder qualified as Builder import Data.ByteString.Builder (byteString) import Data.ByteString.Char8 qualified as B8 import Data.ByteString.Conversion @@ -308,39 +309,63 @@ instance Arbitrary ConnId where -- only together with a 'UserId', stored in C*, and used as a handle for end-to-end encryption. It -- lives as long as the device is registered. See also: 'ConnId'. newtype ClientId = ClientId - { client :: Text + { clientToWord64 :: Word64 } - deriving (Eq, Ord, Show, ToByteString, Hashable, NFData, A.ToJSONKey, Generic) - deriving newtype (ToParamSchema, FromHttpApiData, ToHttpApiData, Binary) + deriving (Eq, Ord, Show) deriving (FromJSON, ToJSON, S.ToSchema) via Schema ClientId -instance ToSchema ClientId where - schema = client .= parsedText "ClientId" clientIdFromByteString +instance ToParamSchema ClientId where + toParamSchema _ = toParamSchema (Proxy @Text) + +instance FromHttpApiData ClientId where + parseUrlPiece = first T.pack . runParser parser . encodeUtf8 + +instance ToHttpApiData ClientId where + toUrlPiece = clientToText + +clientToText :: ClientId -> Text +clientToText = toStrict . toLazyText . hexadecimal . clientToWord64 -newClientId :: Word64 -> ClientId -newClientId = ClientId . toStrict . toLazyText . hexadecimal +instance ToSchema ClientId where + schema = withParser s parseClientId + where + s :: ValueSchemaP NamedSwaggerDoc ClientId Text + s = + clientToText .= schema + & doc . S.description + ?~ "A 64-bit unsigned integer, represented as a hexadecimal numeral. \ + \Any valid hexadecimal numeral is accepted, but the backend will only \ + \produce representations with lowercase digits and no leading zeros" -clientIdFromByteString :: Text -> Either String ClientId -clientIdFromByteString txt = - if T.length txt <= 20 && T.all isHexDigit txt - then Right $ ClientId txt - else Left "Invalid ClientId" +parseClientId :: Text -> A.Parser ClientId +parseClientId = either fail pure . runParser parser . encodeUtf8 instance FromByteString ClientId where parser = do - bs <- Atto.takeByteString - either fail pure $ clientIdFromByteString (cs bs) + num :: Integer <- Atto.hexadecimal + guard $ num <= fromIntegral (maxBound :: Word64) + pure (ClientId (fromIntegral num)) + +instance ToByteString ClientId where + builder = Builder.fromByteString . encodeUtf8 . clientToText instance A.FromJSONKey ClientId where - fromJSONKey = A.FromJSONKeyTextParser $ either fail pure . clientIdFromByteString + fromJSONKey = A.FromJSONKeyTextParser parseClientId + +instance A.ToJSONKey ClientId where + toJSONKey = A.toJSONKeyText clientToText -deriving instance Cql ClientId +instance Cql ClientId where + ctype = Tagged TextColumn + toCql = CqlText . clientToText + fromCql (CqlText t) = runParser parser (encodeUtf8 t) + fromCql _ = Left "ClientId: expected CqlText" instance Arbitrary ClientId where - arbitrary = newClientId <$> arbitrary + arbitrary = ClientId <$> arbitrary instance EncodeWire ClientId where - encodeWire t = encodeWire t . client + encodeWire t = encodeWire t . clientToText instance DecodeWire ClientId where decodeWire (DelimitedField _ x) = either fail pure (runParser parser x) diff --git a/libs/wire-api-federation/test/Test/Wire/API/Federation/Golden/MessageSendResponse.hs b/libs/wire-api-federation/test/Test/Wire/API/Federation/Golden/MessageSendResponse.hs index 00cb6928c9..1127f400b7 100644 --- a/libs/wire-api-federation/test/Test/Wire/API/Federation/Golden/MessageSendResponse.hs +++ b/libs/wire-api-federation/test/Test/Wire/API/Federation/Golden/MessageSendResponse.hs @@ -36,10 +36,10 @@ missing = [ ( Domain "golden.example.com", fromList [ ( Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000100000002")), - fromList [ClientId {client = "0"}, ClientId {client = "1"}] + fromList [ClientId 0, ClientId 1] ), ( Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000200000000")), - fromList [ClientId {client = "0"}] + fromList [ClientId 0] ) ] ) @@ -54,10 +54,10 @@ redundant = [ ( Domain "golden.example.com", fromList [ ( Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000100000003")), - fromList [ClientId {client = "0"}, ClientId {client = "1"}] + fromList [ClientId 0, ClientId 1] ), ( Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000200000004")), - fromList [ClientId {client = "0"}] + fromList [ClientId 0] ) ] ) @@ -72,10 +72,10 @@ deleted = [ ( Domain "golden.example.com", fromList [ ( Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000100000005")), - fromList [ClientId {client = "0"}, ClientId {client = "1"}] + fromList [ClientId 0, ClientId 1] ), ( Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000200000006")), - fromList [ClientId {client = "0"}] + fromList [ClientId 0] ) ] ) @@ -90,10 +90,10 @@ failed = [ ( Domain "golden.example.com", fromList [ ( Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000100000007")), - fromList [ClientId {client = "0"}, ClientId {client = "1"}] + fromList [ClientId 0, ClientId 1] ), ( Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000200000008")), - fromList [ClientId {client = "0"}] + fromList [ClientId 0] ) ] ) @@ -108,10 +108,10 @@ failedToConfirm = [ ( Domain "golden.example.com", fromList [ ( Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000100000009")), - fromList [ClientId {client = "0"}, ClientId {client = "1"}] + fromList [ClientId 0, ClientId 1] ), ( Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000200000010")), - fromList [ClientId {client = "0"}] + fromList [ClientId 0] ) ] ) diff --git a/libs/wire-api/src/Wire/API/MLS/Credential.hs b/libs/wire-api/src/Wire/API/MLS/Credential.hs index 1e9dd7d0b8..e5278c517a 100644 --- a/libs/wire-api/src/Wire/API/MLS/Credential.hs +++ b/libs/wire-api/src/Wire/API/MLS/Credential.hs @@ -95,7 +95,7 @@ instance Show ClientIdentity where show (ClientIdentity dom u c) = show u <> ":" - <> T.unpack (client c) + <> T.unpack (clientToText c) <> "@" <> T.unpack (domainText dom) @@ -129,7 +129,7 @@ instance ParseMLS ClientIdentity where uid <- maybe (fail "Invalid UUID") (pure . Id) . fromASCIIBytes =<< getByteString 36 char ':' - cid <- newClientId <$> hexadecimal + cid <- ClientId <$> hexadecimal char '@' dom <- either fail pure . (mkDomain . T.pack) =<< many' anyChar @@ -141,7 +141,7 @@ parseX509ClientIdentity = do uidBytes <- either fail pure $ B64URL.decodeUnpadded b64uuid uid <- maybe (fail "Invalid UUID") (pure . Id) $ fromByteString (L.fromStrict uidBytes) char '/' - cid <- newClientId <$> hexadecimal + cid <- ClientId <$> hexadecimal char '@' dom <- either fail pure . (mkDomain . T.pack) =<< many' anyChar @@ -151,7 +151,7 @@ instance SerialiseMLS ClientIdentity where serialiseMLS cid = do putByteString $ toASCIIBytes (toUUID (ciUser cid)) putCharUtf8 ':' - putStringUtf8 $ T.unpack (client (ciClient cid)) + putStringUtf8 $ T.unpack (clientToText (ciClient cid)) putCharUtf8 '@' putStringUtf8 $ T.unpack (domainText (ciDomain cid)) diff --git a/libs/wire-api/src/Wire/API/Message.hs b/libs/wire-api/src/Wire/API/Message.hs index 3b651796e2..6b117791bc 100644 --- a/libs/wire-api/src/Wire/API/Message.hs +++ b/libs/wire-api/src/Wire/API/Message.hs @@ -235,7 +235,7 @@ protolensToQualifiedNewOtrMessage protoMsg = do } protolensToClientId :: Proto.Otr.ClientId -> ClientId -protolensToClientId = newClientId . view Proto.Otr.client +protolensToClientId = ClientId . view Proto.Otr.client qualifiedNewOtrMessageToProto :: QualifiedNewOtrMessage -> Proto.Otr.QualifiedNewOtrMessage qualifiedNewOtrMessageToProto msg = @@ -276,7 +276,7 @@ mkQualifiedOtrPayload sender entries dat strat = clientIdToProtolens :: ClientId -> Proto.Otr.ClientId clientIdToProtolens cid = ProtoLens.defMessage - & Proto.Otr.client .~ (either error fst . Reader.hexadecimal $ client cid) + & Proto.Otr.client .~ (either error fst . Reader.hexadecimal $ clientToText cid) -------------------------------------------------------------------------------- -- Priority diff --git a/libs/wire-api/src/Wire/API/Message/Proto.hs b/libs/wire-api/src/Wire/API/Message/Proto.hs index 610a701bbf..b2b6f1a383 100644 --- a/libs/wire-api/src/Wire/API/Message/Proto.hs +++ b/libs/wire-api/src/Wire/API/Message/Proto.hs @@ -51,8 +51,6 @@ where import Data.Id qualified as Id import Data.ProtocolBuffers -import Data.Text.Lazy qualified as Text -import Data.Text.Lazy.Read (hexadecimal) import Imports -------------------------------------------------------------------------------- @@ -92,14 +90,10 @@ clientId :: Functor f => (Word64 -> f Word64) -> ClientId -> f ClientId clientId f c = (\x -> c {_client = x}) <$> field f (_client c) toClientId :: ClientId -> Id.ClientId -toClientId c = Id.newClientId $ getField (_client c) +toClientId c = Id.ClientId $ getField (_client c) fromClientId :: Id.ClientId -> ClientId -fromClientId c = - either - (error "Invalid client ID") - (newClientId . fst) - (hexadecimal (Text.fromStrict $ Id.client c)) +fromClientId = newClientId . Id.clientToWord64 -------------------------------------------------------------------------------- -- ClientEntry diff --git a/libs/wire-api/src/Wire/API/User/Client.hs b/libs/wire-api/src/Wire/API/User/Client.hs index b168d21633..d2d8491107 100644 --- a/libs/wire-api/src/Wire/API/User/Client.hs +++ b/libs/wire-api/src/Wire/API/User/Client.hs @@ -240,7 +240,7 @@ instance ToSchema UserClientPrekeyMap where ( Map.singleton (generateExample @UserId) ( Map.singleton - (newClientId 4940483633899001999) + (ClientId 4940483633899001999) (Just (Prekey (PrekeyId 1) "pQABAQECoQBYIOjl7hw0D8YRNq...")) ) ) @@ -415,8 +415,8 @@ instance ToSchema UserClients where & Swagger.schema . Swagger.example ?~ toJSON ( Map.fromList - [ (generateExample @UserId, [newClientId 1684636986166846496, newClientId 4940483633899001999]), - (generateExample @UserId, [newClientId 6987438498444556166, newClientId 7940473633839002939]) + [ (generateExample @UserId, [ClientId 1684636986166846496, ClientId 4940483633899001999]), + (generateExample @UserId, [ClientId 6987438498444556166, ClientId 7940473633839002939]) ] ) diff --git a/libs/wire-api/src/Wire/API/User/Client/Prekey.hs b/libs/wire-api/src/Wire/API/User/Client/Prekey.hs index ff861a3078..9447da1b53 100644 --- a/libs/wire-api/src/Wire/API/User/Client/Prekey.hs +++ b/libs/wire-api/src/Wire/API/User/Client/Prekey.hs @@ -34,14 +34,13 @@ where import Crypto.Hash (SHA256, hash) import Data.Aeson (FromJSON (..), ToJSON (..)) +import Data.Bits import Data.ByteArray (convert) import Data.ByteString qualified as BS -import Data.ByteString.Conversion (toByteString') import Data.Id import Data.OpenApi qualified as S import Data.Schema -import Data.Text.Ascii (encodeBase16) -import Data.Text.Encoding (decodeUtf8, encodeUtf8) +import Data.Text.Encoding (encodeUtf8) import Imports import Wire.Arbitrary (Arbitrary (arbitrary), GenericUniform (..)) @@ -67,12 +66,16 @@ instance ToSchema Prekey where <$> prekeyId .= field "id" schema <*> prekeyKey .= field "key" schema +-- | Construct a new client ID from a prekey. +-- +-- This works by taking the SHA256 hash of the prekey, truncating it to its +-- first 8 bytes, and interpreting the resulting bytestring as a big endian +-- Word64. clientIdFromPrekey :: Prekey -> ClientId clientIdFromPrekey = ClientId - . decodeUtf8 - . toByteString' - . encodeBase16 + . foldl' (\w d -> (w `shiftL` 8) .|. fromIntegral d) 0 + . BS.unpack . BS.take 8 . convert . hash @ByteString @SHA256 diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/AddBotResponse_user.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/AddBotResponse_user.hs index 6b57dd5d66..737b9c8404 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/AddBotResponse_user.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/AddBotResponse_user.hs @@ -20,7 +20,7 @@ module Test.Wire.API.Golden.Generated.AddBotResponse_user where import Data.Domain -import Data.Id (BotId (BotId), ClientId (ClientId, client), Id (Id)) +import Data.Id import Data.Qualified import Data.UUID qualified as UUID (fromString) import Imports (Maybe (Just, Nothing), fromJust, read, (.)) @@ -35,7 +35,7 @@ testObject_AddBotResponse_user_1 :: AddBotResponse testObject_AddBotResponse_user_1 = AddBotResponse { rsAddBotId = (BotId . Id) (fromJust (UUID.fromString "00000003-0000-0004-0000-000300000001")), - rsAddBotClient = ClientId {client = "e"}, + rsAddBotClient = ClientId 0xe, rsAddBotName = Name { fromName = @@ -63,7 +63,7 @@ testObject_AddBotResponse_user_2 :: AddBotResponse testObject_AddBotResponse_user_2 = AddBotResponse { rsAddBotId = (BotId . Id) (fromJust (UUID.fromString "00000001-0000-0003-0000-000200000004")), - rsAddBotClient = ClientId {client = "e"}, + rsAddBotClient = ClientId 0xe, rsAddBotName = Name { fromName = diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/ClientMismatch_user.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/ClientMismatch_user.hs index a5d92df851..6cb51cdd2a 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/ClientMismatch_user.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/ClientMismatch_user.hs @@ -19,7 +19,7 @@ module Test.Wire.API.Golden.Generated.ClientMismatch_user where -import Data.Id (ClientId (ClientId, client), Id (Id)) +import Data.Id import Data.Json.Util (toUTCTimeMillis) import Data.UUID qualified as UUID (fromString) import GHC.Exts (IsList (fromList)) @@ -34,7 +34,7 @@ testObject_ClientMismatch_user_1 = { userClients = fromList [ ( Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000100000002")), - fromList [ClientId {client = "0"}, ClientId {client = "1"}] + fromList [ClientId 0, ClientId 1] ), ( Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000200000000")), fromList [] @@ -47,10 +47,10 @@ testObject_ClientMismatch_user_1 = { userClients = fromList [ ( Id (fromJust (UUID.fromString "00000004-0000-0004-0000-000700000000")), - fromList [ClientId {client = "0"}, ClientId {client = "1"}] + fromList [ClientId 0, ClientId 1] ), ( Id (fromJust (UUID.fromString "00000005-0000-0000-0000-000600000008")), - fromList [ClientId {client = "0"}, ClientId {client = "1"}] + fromList [ClientId 0, ClientId 1] ) ] } diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/ClientPrekey_user.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/ClientPrekey_user.hs index ef462fddae..f11ccb868c 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/ClientPrekey_user.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/ClientPrekey_user.hs @@ -17,145 +17,145 @@ module Test.Wire.API.Golden.Generated.ClientPrekey_user where -import Data.Id (ClientId (ClientId, client)) +import Data.Id import Wire.API.User.Client.Prekey (ClientPrekey (..), Prekey (Prekey, prekeyId, prekeyKey), PrekeyId (PrekeyId, keyId)) testObject_ClientPrekey_user_1 :: ClientPrekey testObject_ClientPrekey_user_1 = ClientPrekey - { prekeyClient = ClientId {client = "f22"}, + { prekeyClient = ClientId 0xf22, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 7}, prekeyKey = ""} } testObject_ClientPrekey_user_2 :: ClientPrekey testObject_ClientPrekey_user_2 = ClientPrekey - { prekeyClient = ClientId {client = "1f7"}, + { prekeyClient = ClientId 0x1f7, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 1}, prekeyKey = "\b\21129\169584\r;"} } testObject_ClientPrekey_user_3 :: ClientPrekey testObject_ClientPrekey_user_3 = ClientPrekey - { prekeyClient = ClientId {client = "fd8"}, + { prekeyClient = ClientId 0xfd8, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 4}, prekeyKey = "KA"} } testObject_ClientPrekey_user_4 :: ClientPrekey testObject_ClientPrekey_user_4 = ClientPrekey - { prekeyClient = ClientId {client = "83d"}, + { prekeyClient = ClientId 0x83d, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 8}, prekeyKey = "OeYn"} } testObject_ClientPrekey_user_5 :: ClientPrekey testObject_ClientPrekey_user_5 = ClientPrekey - { prekeyClient = ClientId {client = "a69"}, + { prekeyClient = ClientId 0xa69, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 3}, prekeyKey = "\131643\&3\ENQN]5~"} } testObject_ClientPrekey_user_6 :: ClientPrekey testObject_ClientPrekey_user_6 = ClientPrekey - { prekeyClient = ClientId {client = "5b4"}, + { prekeyClient = ClientId 0x05b4, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 1}, prekeyKey = "\DEL\1053826("} } testObject_ClientPrekey_user_7 :: ClientPrekey testObject_ClientPrekey_user_7 = ClientPrekey - { prekeyClient = ClientId {client = "7b4"}, + { prekeyClient = ClientId 0x7b4, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 5}, prekeyKey = "\1072578P!+"} } testObject_ClientPrekey_user_8 :: ClientPrekey testObject_ClientPrekey_user_8 = ClientPrekey - { prekeyClient = ClientId {client = "4e8"}, + { prekeyClient = ClientId 0x4e8, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 4}, prekeyKey = "AZrl"} } testObject_ClientPrekey_user_9 :: ClientPrekey testObject_ClientPrekey_user_9 = ClientPrekey - { prekeyClient = ClientId {client = "324"}, + { prekeyClient = ClientId 0x324, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 5}, prekeyKey = "\v>h"} } testObject_ClientPrekey_user_10 :: ClientPrekey testObject_ClientPrekey_user_10 = ClientPrekey - { prekeyClient = ClientId {client = "252"}, + { prekeyClient = ClientId 0x252, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 2}, prekeyKey = "0\EOT\DC2\RS\SI\1082579f"} } testObject_ClientPrekey_user_11 :: ClientPrekey testObject_ClientPrekey_user_11 = ClientPrekey - { prekeyClient = ClientId {client = "b99"}, + { prekeyClient = ClientId 0xb99, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 6}, prekeyKey = "2\1025445\DEL"} } testObject_ClientPrekey_user_12 :: ClientPrekey testObject_ClientPrekey_user_12 = ClientPrekey - { prekeyClient = ClientId {client = "be3"}, + { prekeyClient = ClientId 0xbe3, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 4}, prekeyKey = "\US#\1040242M\120180\ETB?"} } testObject_ClientPrekey_user_13 :: ClientPrekey testObject_ClientPrekey_user_13 = ClientPrekey - { prekeyClient = ClientId {client = "1cf"}, + { prekeyClient = ClientId 0x1cf, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 7}, prekeyKey = "O,-%\150104o"} } testObject_ClientPrekey_user_14 :: ClientPrekey testObject_ClientPrekey_user_14 = ClientPrekey - { prekeyClient = ClientId {client = "710"}, + { prekeyClient = ClientId 0x710, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 1}, prekeyKey = "\DC2\135043\96744\DEL\156322x\1009249"} } testObject_ClientPrekey_user_15 :: ClientPrekey testObject_ClientPrekey_user_15 = ClientPrekey - { prekeyClient = ClientId {client = "97e"}, + { prekeyClient = ClientId 0x97e, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = "\fk\1100893\NUL\ETX"} } testObject_ClientPrekey_user_16 :: ClientPrekey testObject_ClientPrekey_user_16 = ClientPrekey - { prekeyClient = ClientId {client = "2b2"}, + { prekeyClient = ClientId 0x2b2, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 2}, prekeyKey = "\39095"} } testObject_ClientPrekey_user_17 :: ClientPrekey testObject_ClientPrekey_user_17 = ClientPrekey - { prekeyClient = ClientId {client = "81c"}, + { prekeyClient = ClientId 0x81c, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 2}, prekeyKey = "\1079390\987156h9\1060117"} } testObject_ClientPrekey_user_18 :: ClientPrekey testObject_ClientPrekey_user_18 = ClientPrekey - { prekeyClient = ClientId {client = "895"}, + { prekeyClient = ClientId 0x895, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 8}, prekeyKey = ","} } testObject_ClientPrekey_user_19 :: ClientPrekey testObject_ClientPrekey_user_19 = ClientPrekey - { prekeyClient = ClientId {client = "792"}, + { prekeyClient = ClientId 0x792, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 4}, prekeyKey = "g\60021\23060i\ETX"} } testObject_ClientPrekey_user_20 :: ClientPrekey testObject_ClientPrekey_user_20 = ClientPrekey - { prekeyClient = ClientId {client = "b02"}, + { prekeyClient = ClientId 0xb02, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 4}, prekeyKey = "D){H"} } diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/Client_user.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/Client_user.hs index a3b5ebd5c0..eb3b718355 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/Client_user.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/Client_user.hs @@ -19,7 +19,7 @@ module Test.Wire.API.Golden.Generated.Client_user where -import Data.Id (ClientId (ClientId, client)) +import Data.Id import Data.Json.Util import Data.Map qualified as Map import Data.Misc @@ -32,7 +32,7 @@ import Wire.API.User.Client testObject_Client_user_1 :: Client testObject_Client_user_1 = Client - { clientId = ClientId {client = "2"}, + { clientId = ClientId 2, clientType = PermanentClientType, clientTime = fromJust (readUTCTimeMillis "1864-05-06T19:39:12.770Z"), clientClass = Just DesktopClient, @@ -48,7 +48,7 @@ testObject_Client_user_1 = testObject_Client_user_2 :: Client testObject_Client_user_2 = Client - { clientId = ClientId {client = "1"}, + { clientId = ClientId 1, clientType = LegalHoldClientType, clientTime = fromJust (readUTCTimeMillis "1864-05-07T08:48:22.537Z"), clientClass = Nothing, @@ -64,7 +64,7 @@ testObject_Client_user_2 = testObject_Client_user_3 :: Client testObject_Client_user_3 = Client - { clientId = ClientId {client = "1"}, + { clientId = ClientId 1, clientType = TemporaryClientType, clientTime = fromJust (readUTCTimeMillis "1864-05-07T00:38:22.384Z"), clientClass = Just LegalHoldClient, @@ -80,7 +80,7 @@ testObject_Client_user_3 = testObject_Client_user_4 :: Client testObject_Client_user_4 = Client - { clientId = ClientId {client = "3"}, + { clientId = ClientId 3, clientType = PermanentClientType, clientTime = fromJust (readUTCTimeMillis "1864-05-06T09:13:45.902Z"), clientClass = Just LegalHoldClient, @@ -96,7 +96,7 @@ testObject_Client_user_4 = testObject_Client_user_5 :: Client testObject_Client_user_5 = Client - { clientId = ClientId {client = "0"}, + { clientId = ClientId 0, clientType = TemporaryClientType, clientTime = fromJust (readUTCTimeMillis "1864-05-07T09:07:14.559Z"), clientClass = Just DesktopClient, @@ -112,7 +112,7 @@ testObject_Client_user_5 = testObject_Client_user_6 :: Client testObject_Client_user_6 = Client - { clientId = ClientId {client = "4"}, + { clientId = ClientId 4, clientType = PermanentClientType, clientTime = fromJust (readUTCTimeMillis "1864-05-08T22:37:53.030Z"), clientClass = Just TabletClient, @@ -128,7 +128,7 @@ testObject_Client_user_6 = testObject_Client_user_7 :: Client testObject_Client_user_7 = Client - { clientId = ClientId {client = "4"}, + { clientId = ClientId 4, clientType = PermanentClientType, clientTime = fromJust (readUTCTimeMillis "1864-05-07T04:35:34.201Z"), clientClass = Just PhoneClient, @@ -144,7 +144,7 @@ testObject_Client_user_7 = testObject_Client_user_8 :: Client testObject_Client_user_8 = Client - { clientId = ClientId {client = "4"}, + { clientId = ClientId 4, clientType = LegalHoldClientType, clientTime = fromJust (readUTCTimeMillis "1864-05-11T06:32:01.921Z"), clientClass = Just PhoneClient, @@ -160,7 +160,7 @@ testObject_Client_user_8 = testObject_Client_user_9 :: Client testObject_Client_user_9 = Client - { clientId = ClientId {client = "1"}, + { clientId = ClientId 1, clientType = LegalHoldClientType, clientTime = fromJust (readUTCTimeMillis "1864-05-08T03:54:56.526Z"), clientClass = Just LegalHoldClient, @@ -176,7 +176,7 @@ testObject_Client_user_9 = testObject_Client_user_10 :: Client testObject_Client_user_10 = Client - { clientId = ClientId {client = "0"}, + { clientId = ClientId 0, clientType = PermanentClientType, clientTime = fromJust (readUTCTimeMillis "1864-05-10T18:42:04.137Z"), clientClass = Nothing, @@ -192,7 +192,7 @@ testObject_Client_user_10 = testObject_Client_user_11 :: Client testObject_Client_user_11 = Client - { clientId = ClientId {client = "3"}, + { clientId = ClientId 3, clientType = TemporaryClientType, clientTime = fromJust (readUTCTimeMillis "1864-05-08T11:57:08.087Z"), clientClass = Just LegalHoldClient, @@ -208,7 +208,7 @@ testObject_Client_user_11 = testObject_Client_user_12 :: Client testObject_Client_user_12 = Client - { clientId = ClientId {client = "2"}, + { clientId = ClientId 2, clientType = PermanentClientType, clientTime = fromJust (readUTCTimeMillis "1864-05-08T18:44:00.378Z"), clientClass = Nothing, @@ -224,7 +224,7 @@ testObject_Client_user_12 = testObject_Client_user_13 :: Client testObject_Client_user_13 = Client - { clientId = ClientId {client = "2"}, + { clientId = ClientId 2, clientType = PermanentClientType, clientTime = fromJust (readUTCTimeMillis "1864-05-07T01:09:04.597Z"), clientClass = Just PhoneClient, @@ -240,7 +240,7 @@ testObject_Client_user_13 = testObject_Client_user_14 :: Client testObject_Client_user_14 = Client - { clientId = ClientId {client = "2"}, + { clientId = ClientId 2, clientType = TemporaryClientType, clientTime = fromJust (readUTCTimeMillis "1864-05-12T11:00:10.449Z"), clientClass = Just TabletClient, @@ -256,7 +256,7 @@ testObject_Client_user_14 = testObject_Client_user_15 :: Client testObject_Client_user_15 = Client - { clientId = ClientId {client = "3"}, + { clientId = ClientId 3, clientType = TemporaryClientType, clientTime = fromJust (readUTCTimeMillis "1864-05-08T11:28:27.778Z"), clientClass = Nothing, @@ -272,7 +272,7 @@ testObject_Client_user_15 = testObject_Client_user_16 :: Client testObject_Client_user_16 = Client - { clientId = ClientId {client = "2"}, + { clientId = ClientId 2, clientType = TemporaryClientType, clientTime = fromJust (readUTCTimeMillis "1864-05-12T11:31:10.072Z"), clientClass = Just LegalHoldClient, @@ -288,7 +288,7 @@ testObject_Client_user_16 = testObject_Client_user_17 :: Client testObject_Client_user_17 = Client - { clientId = ClientId {client = "4"}, + { clientId = ClientId 4, clientType = TemporaryClientType, clientTime = fromJust (readUTCTimeMillis "1864-05-12T02:25:34.770Z"), clientClass = Just DesktopClient, @@ -304,7 +304,7 @@ testObject_Client_user_17 = testObject_Client_user_18 :: Client testObject_Client_user_18 = Client - { clientId = ClientId {client = "1"}, + { clientId = ClientId 1, clientType = TemporaryClientType, clientTime = fromJust (readUTCTimeMillis "1864-05-07T17:21:05.930Z"), clientClass = Just LegalHoldClient, @@ -320,7 +320,7 @@ testObject_Client_user_18 = testObject_Client_user_19 :: Client testObject_Client_user_19 = Client - { clientId = ClientId {client = "2"}, + { clientId = ClientId 2, clientType = PermanentClientType, clientTime = fromJust (readUTCTimeMillis "1864-05-12T07:49:27.999Z"), clientClass = Just DesktopClient, @@ -336,7 +336,7 @@ testObject_Client_user_19 = testObject_Client_user_20 :: Client testObject_Client_user_20 = Client - { clientId = ClientId {client = "1"}, + { clientId = ClientId 1, clientType = LegalHoldClientType, clientTime = fromJust (readUTCTimeMillis "1864-05-06T18:43:52.483Z"), clientClass = Just PhoneClient, diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/Event_conversation.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/Event_conversation.hs index fbe3ab3e5a..9980de9519 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/Event_conversation.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/Event_conversation.hs @@ -115,7 +115,7 @@ testObject_Event_conversation_6 = evtSubConv = Nothing, evtFrom = Qualified {qUnqualified = Id (fromJust (UUID.fromString "2126ea99-ca79-43ea-ad99-a59616468e8e")), qDomain = Domain {_domainText = "8.0-6.t7pxv"}}, evtTime = UTCTime {utctDay = ModifiedJulianDay 58119, utctDayTime = 0}, - evtData = EdOtrMessage (OtrMessage {otrSender = ClientId {client = "1"}, otrRecipient = ClientId {client = "1"}, otrCiphertext = "", otrData = Just "I\68655"}) + evtData = EdOtrMessage (OtrMessage {otrSender = ClientId 1, otrRecipient = ClientId 1, otrCiphertext = "", otrData = Just "I\68655"}) } testObject_Event_conversation_7 :: Event @@ -125,7 +125,7 @@ testObject_Event_conversation_7 = evtSubConv = Nothing, evtFrom = Qualified {qUnqualified = Id (fromJust (UUID.fromString "2126ea99-ca79-43ea-ad99-a59616468e8e")), qDomain = Domain {_domainText = "64b3--h.u"}}, evtTime = UTCTime {utctDay = ModifiedJulianDay 58119, utctDayTime = 0}, - evtData = EdOtrMessage (OtrMessage {otrSender = ClientId {client = "3"}, otrRecipient = ClientId {client = "3"}, otrCiphertext = "%\SI", otrData = Nothing}) + evtData = EdOtrMessage (OtrMessage {otrSender = ClientId 3, otrRecipient = ClientId 3, otrCiphertext = "%\SI", otrData = Nothing}) } testObject_Event_conversation_8 :: Event diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/Event_user.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/Event_user.hs index b6ffdeea2e..3fa139827c 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/Event_user.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/Event_user.hs @@ -20,7 +20,7 @@ module Test.Wire.API.Golden.Generated.Event_user where import Data.Domain -import Data.Id (ClientId (ClientId, client), Id (Id)) +import Data.Id import Data.Misc (Milliseconds (Ms, ms)) import Data.Qualified import Data.Range (unsafeRange) @@ -72,8 +72,8 @@ testObject_Event_user_3 = (read "1864-04-27 15:44:23.844 UTC") ( EdOtrMessage ( OtrMessage - { otrSender = ClientId {client = "c"}, - otrRecipient = ClientId {client = "f"}, + { otrSender = ClientId 0xc, + otrRecipient = ClientId 0xf, otrCiphertext = "", otrData = Just ">\33032\SI\30584" } diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/LegalHoldServiceConfirm_team.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/LegalHoldServiceConfirm_team.hs index 43ac18d9a9..70d77b0edb 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/LegalHoldServiceConfirm_team.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/LegalHoldServiceConfirm_team.hs @@ -17,7 +17,7 @@ module Test.Wire.API.Golden.Generated.LegalHoldServiceConfirm_team where -import Data.Id (ClientId (ClientId, client), Id (Id)) +import Data.Id import Data.UUID qualified as UUID (fromString) import Imports (fromJust) import Wire.API.Team.LegalHold.External (LegalHoldServiceConfirm (..)) @@ -25,7 +25,7 @@ import Wire.API.Team.LegalHold.External (LegalHoldServiceConfirm (..)) testObject_LegalHoldServiceConfirm_team_1 :: LegalHoldServiceConfirm testObject_LegalHoldServiceConfirm_team_1 = LegalHoldServiceConfirm - { lhcClientId = ClientId {client = "1d"}, + { lhcClientId = ClientId 0x1d, lhcUserId = Id (fromJust (UUID.fromString "00000003-0000-0004-0000-000100000000")), lhcTeamId = Id (fromJust (UUID.fromString "00000007-0000-0000-0000-000600000005")), lhcRefreshToken = "i>\ACKO" @@ -34,7 +34,7 @@ testObject_LegalHoldServiceConfirm_team_1 = testObject_LegalHoldServiceConfirm_team_2 :: LegalHoldServiceConfirm testObject_LegalHoldServiceConfirm_team_2 = LegalHoldServiceConfirm - { lhcClientId = ClientId {client = "15"}, + { lhcClientId = ClientId 0x15, lhcUserId = Id (fromJust (UUID.fromString "00000002-0000-0008-0000-000200000007")), lhcTeamId = Id (fromJust (UUID.fromString "00000007-0000-0004-0000-000600000002")), lhcRefreshToken = "\\i" @@ -43,7 +43,7 @@ testObject_LegalHoldServiceConfirm_team_2 = testObject_LegalHoldServiceConfirm_team_3 :: LegalHoldServiceConfirm testObject_LegalHoldServiceConfirm_team_3 = LegalHoldServiceConfirm - { lhcClientId = ClientId {client = "4"}, + { lhcClientId = ClientId 4, lhcUserId = Id (fromJust (UUID.fromString "00000001-0000-0004-0000-000600000005")), lhcTeamId = Id (fromJust (UUID.fromString "00000003-0000-0005-0000-000100000001")), lhcRefreshToken = ")" @@ -52,7 +52,7 @@ testObject_LegalHoldServiceConfirm_team_3 = testObject_LegalHoldServiceConfirm_team_4 :: LegalHoldServiceConfirm testObject_LegalHoldServiceConfirm_team_4 = LegalHoldServiceConfirm - { lhcClientId = ClientId {client = "1b"}, + { lhcClientId = ClientId 0x1b, lhcUserId = Id (fromJust (UUID.fromString "00000008-0000-0002-0000-000300000001")), lhcTeamId = Id (fromJust (UUID.fromString "00000004-0000-0008-0000-000300000004")), lhcRefreshToken = "W" @@ -61,7 +61,7 @@ testObject_LegalHoldServiceConfirm_team_4 = testObject_LegalHoldServiceConfirm_team_5 :: LegalHoldServiceConfirm testObject_LegalHoldServiceConfirm_team_5 = LegalHoldServiceConfirm - { lhcClientId = ClientId {client = "12"}, + { lhcClientId = ClientId 0x12, lhcUserId = Id (fromJust (UUID.fromString "00000000-0000-0005-0000-000300000006")), lhcTeamId = Id (fromJust (UUID.fromString "00000002-0000-0008-0000-000400000007")), lhcRefreshToken = "\1021908hL\1101997\23856\180103" @@ -70,7 +70,7 @@ testObject_LegalHoldServiceConfirm_team_5 = testObject_LegalHoldServiceConfirm_team_6 :: LegalHoldServiceConfirm testObject_LegalHoldServiceConfirm_team_6 = LegalHoldServiceConfirm - { lhcClientId = ClientId {client = "1"}, + { lhcClientId = ClientId 1, lhcUserId = Id (fromJust (UUID.fromString "00000005-0000-0002-0000-000300000003")), lhcTeamId = Id (fromJust (UUID.fromString "00000004-0000-0008-0000-000200000006")), lhcRefreshToken = "\1089885\983521b" @@ -79,7 +79,7 @@ testObject_LegalHoldServiceConfirm_team_6 = testObject_LegalHoldServiceConfirm_team_7 :: LegalHoldServiceConfirm testObject_LegalHoldServiceConfirm_team_7 = LegalHoldServiceConfirm - { lhcClientId = ClientId {client = "1c"}, + { lhcClientId = ClientId 0x1c, lhcUserId = Id (fromJust (UUID.fromString "00000005-0000-0001-0000-000600000001")), lhcTeamId = Id (fromJust (UUID.fromString "00000006-0000-0004-0000-000500000003")), lhcRefreshToken = "\1048812[\ETBu\r" @@ -88,7 +88,7 @@ testObject_LegalHoldServiceConfirm_team_7 = testObject_LegalHoldServiceConfirm_team_8 :: LegalHoldServiceConfirm testObject_LegalHoldServiceConfirm_team_8 = LegalHoldServiceConfirm - { lhcClientId = ClientId {client = "1f"}, + { lhcClientId = ClientId 0x1f, lhcUserId = Id (fromJust (UUID.fromString "00000003-0000-0008-0000-000200000001")), lhcTeamId = Id (fromJust (UUID.fromString "00000004-0000-0004-0000-000500000004")), lhcRefreshToken = "ZU\990363;\US\ESC" @@ -97,7 +97,7 @@ testObject_LegalHoldServiceConfirm_team_8 = testObject_LegalHoldServiceConfirm_team_9 :: LegalHoldServiceConfirm testObject_LegalHoldServiceConfirm_team_9 = LegalHoldServiceConfirm - { lhcClientId = ClientId {client = "3"}, + { lhcClientId = ClientId 3, lhcUserId = Id (fromJust (UUID.fromString "00000003-0000-0008-0000-000100000003")), lhcTeamId = Id (fromJust (UUID.fromString "00000008-0000-0006-0000-000000000006")), lhcRefreshToken = "Y\1088702" @@ -106,7 +106,7 @@ testObject_LegalHoldServiceConfirm_team_9 = testObject_LegalHoldServiceConfirm_team_10 :: LegalHoldServiceConfirm testObject_LegalHoldServiceConfirm_team_10 = LegalHoldServiceConfirm - { lhcClientId = ClientId {client = "20"}, + { lhcClientId = ClientId 0x20, lhcUserId = Id (fromJust (UUID.fromString "00000006-0000-0005-0000-000500000006")), lhcTeamId = Id (fromJust (UUID.fromString "00000001-0000-0005-0000-000700000001")), lhcRefreshToken = "" @@ -115,7 +115,7 @@ testObject_LegalHoldServiceConfirm_team_10 = testObject_LegalHoldServiceConfirm_team_11 :: LegalHoldServiceConfirm testObject_LegalHoldServiceConfirm_team_11 = LegalHoldServiceConfirm - { lhcClientId = ClientId {client = "0"}, + { lhcClientId = ClientId 0, lhcUserId = Id (fromJust (UUID.fromString "00000006-0000-0002-0000-000700000007")), lhcTeamId = Id (fromJust (UUID.fromString "00000002-0000-0005-0000-000400000007")), lhcRefreshToken = "\153567@-c\ENQ" @@ -124,7 +124,7 @@ testObject_LegalHoldServiceConfirm_team_11 = testObject_LegalHoldServiceConfirm_team_12 :: LegalHoldServiceConfirm testObject_LegalHoldServiceConfirm_team_12 = LegalHoldServiceConfirm - { lhcClientId = ClientId {client = "0"}, + { lhcClientId = ClientId 0, lhcUserId = Id (fromJust (UUID.fromString "00000005-0000-0006-0000-000500000004")), lhcTeamId = Id (fromJust (UUID.fromString "00000007-0000-0008-0000-000600000006")), lhcRefreshToken = "" @@ -133,7 +133,7 @@ testObject_LegalHoldServiceConfirm_team_12 = testObject_LegalHoldServiceConfirm_team_13 :: LegalHoldServiceConfirm testObject_LegalHoldServiceConfirm_team_13 = LegalHoldServiceConfirm - { lhcClientId = ClientId {client = "c"}, + { lhcClientId = ClientId 0xc, lhcUserId = Id (fromJust (UUID.fromString "00000002-0000-0005-0000-000600000005")), lhcTeamId = Id (fromJust (UUID.fromString "00000004-0000-0000-0000-000100000007")), lhcRefreshToken = "DXD[" @@ -142,7 +142,7 @@ testObject_LegalHoldServiceConfirm_team_13 = testObject_LegalHoldServiceConfirm_team_14 :: LegalHoldServiceConfirm testObject_LegalHoldServiceConfirm_team_14 = LegalHoldServiceConfirm - { lhcClientId = ClientId {client = "2"}, + { lhcClientId = ClientId 2, lhcUserId = Id (fromJust (UUID.fromString "00000007-0000-0003-0000-000200000003")), lhcTeamId = Id (fromJust (UUID.fromString "00000004-0000-0001-0000-000400000003")), lhcRefreshToken = "T\1068224\DC3\177787\STX" @@ -151,7 +151,7 @@ testObject_LegalHoldServiceConfirm_team_14 = testObject_LegalHoldServiceConfirm_team_15 :: LegalHoldServiceConfirm testObject_LegalHoldServiceConfirm_team_15 = LegalHoldServiceConfirm - { lhcClientId = ClientId {client = "1a"}, + { lhcClientId = ClientId 0x1a, lhcUserId = Id (fromJust (UUID.fromString "00000005-0000-0005-0000-000300000007")), lhcTeamId = Id (fromJust (UUID.fromString "00000004-0000-0003-0000-000100000004")), lhcRefreshToken = "\n' \FS~\137351)" @@ -160,7 +160,7 @@ testObject_LegalHoldServiceConfirm_team_15 = testObject_LegalHoldServiceConfirm_team_16 :: LegalHoldServiceConfirm testObject_LegalHoldServiceConfirm_team_16 = LegalHoldServiceConfirm - { lhcClientId = ClientId {client = "e"}, + { lhcClientId = ClientId 0xe, lhcUserId = Id (fromJust (UUID.fromString "00000003-0000-0002-0000-000000000000")), lhcTeamId = Id (fromJust (UUID.fromString "00000002-0000-0001-0000-000300000000")), lhcRefreshToken = "\65915\163144\n" @@ -169,7 +169,7 @@ testObject_LegalHoldServiceConfirm_team_16 = testObject_LegalHoldServiceConfirm_team_17 :: LegalHoldServiceConfirm testObject_LegalHoldServiceConfirm_team_17 = LegalHoldServiceConfirm - { lhcClientId = ClientId {client = "e"}, + { lhcClientId = ClientId 0xe, lhcUserId = Id (fromJust (UUID.fromString "00000002-0000-0001-0000-000600000004")), lhcTeamId = Id (fromJust (UUID.fromString "00000002-0000-0000-0000-000400000008")), lhcRefreshToken = "" @@ -178,7 +178,7 @@ testObject_LegalHoldServiceConfirm_team_17 = testObject_LegalHoldServiceConfirm_team_18 :: LegalHoldServiceConfirm testObject_LegalHoldServiceConfirm_team_18 = LegalHoldServiceConfirm - { lhcClientId = ClientId {client = "11"}, + { lhcClientId = ClientId 0x11, lhcUserId = Id (fromJust (UUID.fromString "00000006-0000-0000-0000-000800000004")), lhcTeamId = Id (fromJust (UUID.fromString "00000006-0000-0003-0000-000100000005")), lhcRefreshToken = "Y\1029262" @@ -187,7 +187,7 @@ testObject_LegalHoldServiceConfirm_team_18 = testObject_LegalHoldServiceConfirm_team_19 :: LegalHoldServiceConfirm testObject_LegalHoldServiceConfirm_team_19 = LegalHoldServiceConfirm - { lhcClientId = ClientId {client = "1c"}, + { lhcClientId = ClientId 0x1c, lhcUserId = Id (fromJust (UUID.fromString "00000003-0000-0006-0000-000700000002")), lhcTeamId = Id (fromJust (UUID.fromString "00000001-0000-0003-0000-000600000000")), lhcRefreshToken = "[" @@ -196,7 +196,7 @@ testObject_LegalHoldServiceConfirm_team_19 = testObject_LegalHoldServiceConfirm_team_20 :: LegalHoldServiceConfirm testObject_LegalHoldServiceConfirm_team_20 = LegalHoldServiceConfirm - { lhcClientId = ClientId {client = "1"}, + { lhcClientId = ClientId 1, lhcUserId = Id (fromJust (UUID.fromString "00000001-0000-0004-0000-000600000005")), lhcTeamId = Id (fromJust (UUID.fromString "00000006-0000-0001-0000-000500000008")), lhcRefreshToken = "i\FS" diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/NewBotRequest_provider.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/NewBotRequest_provider.hs index 8e410bf119..b8088ef612 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/NewBotRequest_provider.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/NewBotRequest_provider.hs @@ -42,7 +42,7 @@ import Data.ISO3166_CountryCodes TD ), ) -import Data.Id (BotId (BotId), ClientId (ClientId, client), Id (Id)) +import Data.Id import Data.LanguageCodes qualified ( ISO639_1 ( AB, @@ -99,7 +99,7 @@ testObject_NewBotRequest_provider_1 :: NewBotRequest testObject_NewBotRequest_provider_1 = NewBotRequest { newBotId = (BotId . Id) (fromJust (UUID.fromString "00000004-0000-0003-0000-000000000000")), - newBotClient = ClientId {client = "c"}, + newBotClient = ClientId 0xc, newBotOrigin = BotUserView { botUserViewId = Id (fromJust (UUID.fromString "00000001-0000-0001-0000-000100000000")), @@ -155,7 +155,7 @@ testObject_NewBotRequest_provider_2 :: NewBotRequest testObject_NewBotRequest_provider_2 = NewBotRequest { newBotId = (BotId . Id) (fromJust (UUID.fromString "00000000-0000-0003-0000-000100000003")), - newBotClient = ClientId {client = "4"}, + newBotClient = ClientId 4, newBotOrigin = BotUserView { botUserViewId = Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000100000000")), @@ -174,7 +174,7 @@ testObject_NewBotRequest_provider_3 :: NewBotRequest testObject_NewBotRequest_provider_3 = NewBotRequest { newBotId = (BotId . Id) (fromJust (UUID.fromString "00000003-0000-0004-0000-000000000001")), - newBotClient = ClientId {client = "7"}, + newBotClient = ClientId 7, newBotOrigin = BotUserView { botUserViewId = Id (fromJust (UUID.fromString "00000001-0000-0000-0000-000100000000")), @@ -223,7 +223,7 @@ testObject_NewBotRequest_provider_4 :: NewBotRequest testObject_NewBotRequest_provider_4 = NewBotRequest { newBotId = (BotId . Id) (fromJust (UUID.fromString "00000000-0000-0004-0000-000300000000")), - newBotClient = ClientId {client = "f"}, + newBotClient = ClientId 0xf, newBotOrigin = BotUserView { botUserViewId = Id (fromJust (UUID.fromString "00000001-0000-0000-0000-000100000001")), @@ -246,7 +246,7 @@ testObject_NewBotRequest_provider_5 :: NewBotRequest testObject_NewBotRequest_provider_5 = NewBotRequest { newBotId = (BotId . Id) (fromJust (UUID.fromString "00000001-0000-0002-0000-000300000003")), - newBotClient = ClientId {client = "4"}, + newBotClient = ClientId 4, newBotOrigin = BotUserView { botUserViewId = Id (fromJust (UUID.fromString "00000001-0000-0001-0000-000000000000")), @@ -270,7 +270,7 @@ testObject_NewBotRequest_provider_6 :: NewBotRequest testObject_NewBotRequest_provider_6 = NewBotRequest { newBotId = (BotId . Id) (fromJust (UUID.fromString "00000000-0000-0004-0000-000400000003")), - newBotClient = ClientId {client = "2"}, + newBotClient = ClientId 2, newBotOrigin = BotUserView { botUserViewId = Id (fromJust (UUID.fromString "00000000-0000-0001-0000-000000000001")), @@ -344,7 +344,7 @@ testObject_NewBotRequest_provider_7 :: NewBotRequest testObject_NewBotRequest_provider_7 = NewBotRequest { newBotId = (BotId . Id) (fromJust (UUID.fromString "00000002-0000-0002-0000-000200000000")), - newBotClient = ClientId {client = "9"}, + newBotClient = ClientId 9, newBotOrigin = BotUserView { botUserViewId = Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000100000000")), @@ -363,7 +363,7 @@ testObject_NewBotRequest_provider_8 :: NewBotRequest testObject_NewBotRequest_provider_8 = NewBotRequest { newBotId = (BotId . Id) (fromJust (UUID.fromString "00000004-0000-0004-0000-000100000003")), - newBotClient = ClientId {client = "3"}, + newBotClient = ClientId 3, newBotOrigin = BotUserView { botUserViewId = Id (fromJust (UUID.fromString "00000000-0000-0001-0000-000000000001")), @@ -382,7 +382,7 @@ testObject_NewBotRequest_provider_9 :: NewBotRequest testObject_NewBotRequest_provider_9 = NewBotRequest { newBotId = (BotId . Id) (fromJust (UUID.fromString "00000004-0000-0002-0000-000200000003")), - newBotClient = ClientId {client = "2"}, + newBotClient = ClientId 2, newBotOrigin = BotUserView { botUserViewId = Id (fromJust (UUID.fromString "00000000-0000-0001-0000-000100000001")), @@ -440,7 +440,7 @@ testObject_NewBotRequest_provider_10 :: NewBotRequest testObject_NewBotRequest_provider_10 = NewBotRequest { newBotId = (BotId . Id) (fromJust (UUID.fromString "00000001-0000-0004-0000-000000000004")), - newBotClient = ClientId {client = "c"}, + newBotClient = ClientId 0xc, newBotOrigin = BotUserView { botUserViewId = Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000000000001")), @@ -463,7 +463,7 @@ testObject_NewBotRequest_provider_11 :: NewBotRequest testObject_NewBotRequest_provider_11 = NewBotRequest { newBotId = (BotId . Id) (fromJust (UUID.fromString "00000003-0000-0003-0000-000100000000")), - newBotClient = ClientId {client = "8"}, + newBotClient = ClientId 8, newBotOrigin = BotUserView { botUserViewId = Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000100000000")), @@ -486,7 +486,7 @@ testObject_NewBotRequest_provider_12 :: NewBotRequest testObject_NewBotRequest_provider_12 = NewBotRequest { newBotId = (BotId . Id) (fromJust (UUID.fromString "00000004-0000-0003-0000-000100000003")), - newBotClient = ClientId {client = "c"}, + newBotClient = ClientId 0xc, newBotOrigin = BotUserView { botUserViewId = Id (fromJust (UUID.fromString "00000001-0000-0001-0000-000000000001")), @@ -514,7 +514,7 @@ testObject_NewBotRequest_provider_13 :: NewBotRequest testObject_NewBotRequest_provider_13 = NewBotRequest { newBotId = (BotId . Id) (fromJust (UUID.fromString "00000004-0000-0003-0000-000400000001")), - newBotClient = ClientId {client = "e"}, + newBotClient = ClientId 0xe, newBotOrigin = BotUserView { botUserViewId = Id (fromJust (UUID.fromString "00000001-0000-0000-0000-000100000001")), @@ -559,7 +559,7 @@ testObject_NewBotRequest_provider_14 :: NewBotRequest testObject_NewBotRequest_provider_14 = NewBotRequest { newBotId = (BotId . Id) (fromJust (UUID.fromString "00000003-0000-0001-0000-000300000004")), - newBotClient = ClientId {client = "a"}, + newBotClient = ClientId 0xa, newBotOrigin = BotUserView { botUserViewId = Id (fromJust (UUID.fromString "00000001-0000-0000-0000-000000000000")), @@ -582,7 +582,7 @@ testObject_NewBotRequest_provider_15 :: NewBotRequest testObject_NewBotRequest_provider_15 = NewBotRequest { newBotId = (BotId . Id) (fromJust (UUID.fromString "00000003-0000-0002-0000-000000000004")), - newBotClient = ClientId {client = "7"}, + newBotClient = ClientId 7, newBotOrigin = BotUserView { botUserViewId = Id (fromJust (UUID.fromString "00000000-0000-0001-0000-000000000000")), @@ -605,7 +605,7 @@ testObject_NewBotRequest_provider_16 :: NewBotRequest testObject_NewBotRequest_provider_16 = NewBotRequest { newBotId = (BotId . Id) (fromJust (UUID.fromString "00000003-0000-0004-0000-000200000003")), - newBotClient = ClientId {client = "9"}, + newBotClient = ClientId 9, newBotOrigin = BotUserView { botUserViewId = Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000000000000")), @@ -628,7 +628,7 @@ testObject_NewBotRequest_provider_17 :: NewBotRequest testObject_NewBotRequest_provider_17 = NewBotRequest { newBotId = (BotId . Id) (fromJust (UUID.fromString "00000002-0000-0001-0000-000100000000")), - newBotClient = ClientId {client = "1"}, + newBotClient = ClientId 1, newBotOrigin = BotUserView { botUserViewId = Id (fromJust (UUID.fromString "00000000-0000-0001-0000-000100000000")), @@ -677,7 +677,7 @@ testObject_NewBotRequest_provider_18 :: NewBotRequest testObject_NewBotRequest_provider_18 = NewBotRequest { newBotId = (BotId . Id) (fromJust (UUID.fromString "00000000-0000-0002-0000-000000000001")), - newBotClient = ClientId {client = "4"}, + newBotClient = ClientId 4, newBotOrigin = BotUserView { botUserViewId = Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000100000000")), @@ -731,7 +731,7 @@ testObject_NewBotRequest_provider_19 :: NewBotRequest testObject_NewBotRequest_provider_19 = NewBotRequest { newBotId = (BotId . Id) (fromJust (UUID.fromString "00000000-0000-0001-0000-000000000000")), - newBotClient = ClientId {client = "6"}, + newBotClient = ClientId 6, newBotOrigin = BotUserView { botUserViewId = Id (fromJust (UUID.fromString "00000001-0000-0000-0000-000100000000")), @@ -754,7 +754,7 @@ testObject_NewBotRequest_provider_20 :: NewBotRequest testObject_NewBotRequest_provider_20 = NewBotRequest { newBotId = (BotId . Id) (fromJust (UUID.fromString "00000003-0000-0001-0000-000000000002")), - newBotClient = ClientId {client = "5"}, + newBotClient = ClientId 5, newBotOrigin = BotUserView { botUserViewId = Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000100000001")), diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/NewOtrMessage_user.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/NewOtrMessage_user.hs index 3835b5648f..b036cccd99 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/NewOtrMessage_user.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/NewOtrMessage_user.hs @@ -19,7 +19,7 @@ module Test.Wire.API.Golden.Generated.NewOtrMessage_user where -import Data.Id (ClientId (ClientId, client)) +import Data.Id import GHC.Exts (IsList (fromList)) import Imports (Bool (False, True), Maybe (Just, Nothing)) import Wire.API.Message @@ -32,7 +32,7 @@ import Wire.API.Message testObject_NewOtrMessage_user_1 :: NewOtrMessage testObject_NewOtrMessage_user_1 = NewOtrMessage - { newOtrSender = ClientId {client = "6"}, + { newOtrSender = ClientId 6, newOtrRecipients = OtrRecipients {otrRecipientsMap = UserClientMap {userClientMap = fromList []}}, newOtrNativePush = True, newOtrTransient = False, @@ -44,7 +44,7 @@ testObject_NewOtrMessage_user_1 = testObject_NewOtrMessage_user_2 :: NewOtrMessage testObject_NewOtrMessage_user_2 = NewOtrMessage - { newOtrSender = ClientId {client = "6"}, + { newOtrSender = ClientId 6, newOtrRecipients = OtrRecipients {otrRecipientsMap = UserClientMap {userClientMap = fromList []}}, newOtrNativePush = True, newOtrTransient = False, diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/OtrMessage_user.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/OtrMessage_user.hs index 5f2e76d68e..62712988f0 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/OtrMessage_user.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/OtrMessage_user.hs @@ -17,15 +17,15 @@ module Test.Wire.API.Golden.Generated.OtrMessage_user where -import Data.Id (ClientId (ClientId, client)) +import Data.Id import Imports (Maybe (Just, Nothing)) import Wire.API.Event.Conversation (OtrMessage (..)) testObject_OtrMessage_user_1 :: OtrMessage testObject_OtrMessage_user_1 = OtrMessage - { otrSender = ClientId {client = "4"}, - otrRecipient = ClientId {client = "0"}, + { otrSender = ClientId 4, + otrRecipient = ClientId 0, otrCiphertext = "\1051967\1047896\1101213|", otrData = Nothing } @@ -33,8 +33,8 @@ testObject_OtrMessage_user_1 = testObject_OtrMessage_user_2 :: OtrMessage testObject_OtrMessage_user_2 = OtrMessage - { otrSender = ClientId {client = "18"}, - otrRecipient = ClientId {client = "a"}, + { otrSender = ClientId 0x18, + otrRecipient = ClientId 0xa, otrCiphertext = "\11788t", otrData = Just "\ESC\NAKJj" } diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/OtrRecipients_user.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/OtrRecipients_user.hs index e5a9b8f0fd..854f446b40 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/OtrRecipients_user.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/OtrRecipients_user.hs @@ -19,7 +19,7 @@ module Test.Wire.API.Golden.Generated.OtrRecipients_user where -import Data.Id (ClientId (ClientId, client), Id (Id)) +import Data.Id import Data.UUID qualified as UUID (fromString) import GHC.Exts (IsList (fromList)) import Imports (fromJust) @@ -34,13 +34,13 @@ testObject_OtrRecipients_user_1 = fromList [ ( Id (fromJust (UUID.fromString "00000025-0000-0031-0000-003e00000001")), fromList - [ (ClientId {client = "10"}, "q"), - (ClientId {client = "4"}, "\f"), - (ClientId {client = "b"}, "\83295") + [ (ClientId 0x10, "q"), + (ClientId 4, "\f"), + (ClientId 0xb, "\83295") ] ), ( Id (fromJust (UUID.fromString "0000002c-0000-0078-0000-001d00000069")), - fromList [(ClientId {client = "1d"}, "\"\168226l"), (ClientId {client = "3"}, "{Pu^1")] + fromList [(ClientId 0x1d, "\"\168226l"), (ClientId 3, "{Pu^1")] ) ] } diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/PrekeyBundle_user.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/PrekeyBundle_user.hs index 17b96c2aef..298bb834c7 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/PrekeyBundle_user.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/PrekeyBundle_user.hs @@ -19,7 +19,7 @@ module Test.Wire.API.Golden.Generated.PrekeyBundle_user where -import Data.Id (ClientId (ClientId, client), Id (Id)) +import Data.Id import Data.UUID qualified as UUID (fromString) import Imports (fromJust) import Wire.API.User.Client.Prekey @@ -35,7 +35,7 @@ testObject_PrekeyBundle_user_1 = { prekeyUser = Id (fromJust (UUID.fromString "00000046-0000-0011-0000-007200000022")), prekeyClients = [ ClientPrekey - { prekeyClient = ClientId {client = "8"}, + { prekeyClient = ClientId 8, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = "\rOx"} } ] @@ -47,23 +47,23 @@ testObject_PrekeyBundle_user_2 = { prekeyUser = Id (fromJust (UUID.fromString "00000043-0000-002b-0000-00550000002a")), prekeyClients = [ ClientPrekey - { prekeyClient = ClientId {client = "1"}, + { prekeyClient = ClientId 1, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 1}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "0"}, + { prekeyClient = ClientId 0, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "1"}, + { prekeyClient = ClientId 1, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "0"}, + { prekeyClient = ClientId 0, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "0"}, + { prekeyClient = ClientId 0, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 1}, prekeyKey = ""} } ] @@ -75,11 +75,11 @@ testObject_PrekeyBundle_user_3 = { prekeyUser = Id (fromJust (UUID.fromString "00000001-0000-002b-0000-002e00000010")), prekeyClients = [ ClientPrekey - { prekeyClient = ClientId {client = "0"}, + { prekeyClient = ClientId 0, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 1}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "0"}, + { prekeyClient = ClientId 0, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = "\n"} } ] @@ -98,11 +98,11 @@ testObject_PrekeyBundle_user_5 = { prekeyUser = Id (fromJust (UUID.fromString "0000000b-0000-0075-0000-00620000001e")), prekeyClients = [ ClientPrekey - { prekeyClient = ClientId {client = "1"}, + { prekeyClient = ClientId 1, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = "i"} }, ClientPrekey - { prekeyClient = ClientId {client = "0"}, + { prekeyClient = ClientId 0, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 1}, prekeyKey = "L"} } ] @@ -114,27 +114,27 @@ testObject_PrekeyBundle_user_6 = { prekeyUser = Id (fromJust (UUID.fromString "0000004c-0000-007e-0000-004300000034")), prekeyClients = [ ClientPrekey - { prekeyClient = ClientId {client = "0"}, + { prekeyClient = ClientId 0, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "1"}, + { prekeyClient = ClientId 1, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "1"}, + { prekeyClient = ClientId 1, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "0"}, + { prekeyClient = ClientId 0, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "1"}, + { prekeyClient = ClientId 1, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "0"}, + { prekeyClient = ClientId 0, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 1}, prekeyKey = ""} } ] @@ -146,11 +146,11 @@ testObject_PrekeyBundle_user_7 = { prekeyUser = Id (fromJust (UUID.fromString "0000001e-0000-0066-0000-000200000002")), prekeyClients = [ ClientPrekey - { prekeyClient = ClientId {client = "4"}, + { prekeyClient = ClientId 4, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = "$"} }, ClientPrekey - { prekeyClient = ClientId {client = "0"}, + { prekeyClient = ClientId 0, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 1}, prekeyKey = ""} } ] @@ -162,19 +162,19 @@ testObject_PrekeyBundle_user_8 = { prekeyUser = Id (fromJust (UUID.fromString "00000050-0000-0050-0000-00760000005f")), prekeyClients = [ ClientPrekey - { prekeyClient = ClientId {client = "0"}, + { prekeyClient = ClientId 0, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "0"}, + { prekeyClient = ClientId 0, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 1}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "1"}, + { prekeyClient = ClientId 1, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "1"}, + { prekeyClient = ClientId 1, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 1}, prekeyKey = ""} } ] @@ -200,11 +200,11 @@ testObject_PrekeyBundle_user_11 = { prekeyUser = Id (fromJust (UUID.fromString "00000025-0000-0061-0000-005f0000000a")), prekeyClients = [ ClientPrekey - { prekeyClient = ClientId {client = "0"}, + { prekeyClient = ClientId 0, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "4"}, + { prekeyClient = ClientId 4, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = ">"} } ] @@ -216,7 +216,7 @@ testObject_PrekeyBundle_user_12 = { prekeyUser = Id (fromJust (UUID.fromString "00000073-0000-0034-0000-004c00000024")), prekeyClients = [ ClientPrekey - { prekeyClient = ClientId {client = "a"}, + { prekeyClient = ClientId 0xa, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 1}, prekeyKey = "\1092897\990773-"} } ] @@ -228,31 +228,31 @@ testObject_PrekeyBundle_user_13 = { prekeyUser = Id (fromJust (UUID.fromString "0000000c-0000-006a-0000-00650000007c")), prekeyClients = [ ClientPrekey - { prekeyClient = ClientId {client = "0"}, + { prekeyClient = ClientId 0, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "0"}, + { prekeyClient = ClientId 0, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 1}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "0"}, + { prekeyClient = ClientId 0, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "1"}, + { prekeyClient = ClientId 1, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "0"}, + { prekeyClient = ClientId 0, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 1}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "0"}, + { prekeyClient = ClientId 0, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "0"}, + { prekeyClient = ClientId 0, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 1}, prekeyKey = ""} } ] @@ -271,15 +271,15 @@ testObject_PrekeyBundle_user_15 = { prekeyUser = Id (fromJust (UUID.fromString "00000079-0000-0057-0000-004200000037")), prekeyClients = [ ClientPrekey - { prekeyClient = ClientId {client = "0"}, + { prekeyClient = ClientId 0, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "2"}, + { prekeyClient = ClientId 2, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 1}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "2"}, + { prekeyClient = ClientId 2, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = "\RS"} } ] @@ -291,7 +291,7 @@ testObject_PrekeyBundle_user_16 = { prekeyUser = Id (fromJust (UUID.fromString "0000002b-0000-0032-0000-00140000006e")), prekeyClients = [ ClientPrekey - { prekeyClient = ClientId {client = "f"}, + { prekeyClient = ClientId 0xf, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 1}, prekeyKey = "\1066568\149661?"} } ] @@ -303,43 +303,43 @@ testObject_PrekeyBundle_user_17 = { prekeyUser = Id (fromJust (UUID.fromString "0000006f-0000-0036-0000-00560000002d")), prekeyClients = [ ClientPrekey - { prekeyClient = ClientId {client = "1"}, + { prekeyClient = ClientId 1, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 1}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "0"}, + { prekeyClient = ClientId 0, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "0"}, + { prekeyClient = ClientId 0, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "1"}, + { prekeyClient = ClientId 1, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 1}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "0"}, + { prekeyClient = ClientId 0, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "0"}, + { prekeyClient = ClientId 0, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "1"}, + { prekeyClient = ClientId 1, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "1"}, + { prekeyClient = ClientId 1, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 1}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "0"}, + { prekeyClient = ClientId 0, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 1}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "1"}, + { prekeyClient = ClientId 1, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 1}, prekeyKey = ""} } ] @@ -358,23 +358,23 @@ testObject_PrekeyBundle_user_19 = { prekeyUser = Id (fromJust (UUID.fromString "0000006f-0000-0072-0000-003e00000008")), prekeyClients = [ ClientPrekey - { prekeyClient = ClientId {client = "1"}, + { prekeyClient = ClientId 1, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 1}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "1"}, + { prekeyClient = ClientId 1, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "0"}, + { prekeyClient = ClientId 0, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "0"}, + { prekeyClient = ClientId 0, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 1}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "1"}, + { prekeyClient = ClientId 1, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = ""} } ] @@ -386,15 +386,15 @@ testObject_PrekeyBundle_user_20 = { prekeyUser = Id (fromJust (UUID.fromString "00000073-0000-0017-0000-00690000007a")), prekeyClients = [ ClientPrekey - { prekeyClient = ClientId {client = "1"}, + { prekeyClient = ClientId 1, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = ""} }, ClientPrekey - { prekeyClient = ClientId {client = "2"}, + { prekeyClient = ClientId 2, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 1}, prekeyKey = "\1014040"} }, ClientPrekey - { prekeyClient = ClientId {client = "2"}, + { prekeyClient = ClientId 2, prekeyData = Prekey {prekeyId = PrekeyId {keyId = 0}, prekeyKey = "\SO"} } ] diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/PubClient_user.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/PubClient_user.hs index d3e912e67c..5ffb72ff6c 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/PubClient_user.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/PubClient_user.hs @@ -17,7 +17,7 @@ module Test.Wire.API.Golden.Generated.PubClient_user where -import Data.Id (ClientId (ClientId, client)) +import Data.Id import Imports (Maybe (Just, Nothing)) import Wire.API.User.Client ( ClientClass @@ -30,63 +30,63 @@ import Wire.API.User.Client ) testObject_PubClient_user_1 :: PubClient -testObject_PubClient_user_1 = PubClient {pubClientId = ClientId {client = "1f4"}, pubClientClass = Nothing} +testObject_PubClient_user_1 = PubClient {pubClientId = ClientId 0x1f4, pubClientClass = Nothing} testObject_PubClient_user_2 :: PubClient -testObject_PubClient_user_2 = PubClient {pubClientId = ClientId {client = "502"}, pubClientClass = Just TabletClient} +testObject_PubClient_user_2 = PubClient {pubClientId = ClientId 0x502, pubClientClass = Just TabletClient} testObject_PubClient_user_3 :: PubClient -testObject_PubClient_user_3 = PubClient {pubClientId = ClientId {client = "376"}, pubClientClass = Just DesktopClient} +testObject_PubClient_user_3 = PubClient {pubClientId = ClientId 0x376, pubClientClass = Just DesktopClient} testObject_PubClient_user_4 :: PubClient -testObject_PubClient_user_4 = PubClient {pubClientId = ClientId {client = "47f"}, pubClientClass = Just TabletClient} +testObject_PubClient_user_4 = PubClient {pubClientId = ClientId 0x47f, pubClientClass = Just TabletClient} testObject_PubClient_user_5 :: PubClient -testObject_PubClient_user_5 = PubClient {pubClientId = ClientId {client = "377"}, pubClientClass = Just LegalHoldClient} +testObject_PubClient_user_5 = PubClient {pubClientId = ClientId 0x377, pubClientClass = Just LegalHoldClient} testObject_PubClient_user_6 :: PubClient -testObject_PubClient_user_6 = PubClient {pubClientId = ClientId {client = "e4f"}, pubClientClass = Just DesktopClient} +testObject_PubClient_user_6 = PubClient {pubClientId = ClientId 0xe4f, pubClientClass = Just DesktopClient} testObject_PubClient_user_7 :: PubClient -testObject_PubClient_user_7 = PubClient {pubClientId = ClientId {client = "8ab"}, pubClientClass = Nothing} +testObject_PubClient_user_7 = PubClient {pubClientId = ClientId 0x8ab, pubClientClass = Nothing} testObject_PubClient_user_8 :: PubClient -testObject_PubClient_user_8 = PubClient {pubClientId = ClientId {client = "69b"}, pubClientClass = Just PhoneClient} +testObject_PubClient_user_8 = PubClient {pubClientId = ClientId 0x69b, pubClientClass = Just PhoneClient} testObject_PubClient_user_9 :: PubClient -testObject_PubClient_user_9 = PubClient {pubClientId = ClientId {client = "357"}, pubClientClass = Just LegalHoldClient} +testObject_PubClient_user_9 = PubClient {pubClientId = ClientId 0x357, pubClientClass = Just LegalHoldClient} testObject_PubClient_user_10 :: PubClient -testObject_PubClient_user_10 = PubClient {pubClientId = ClientId {client = "4aa"}, pubClientClass = Just PhoneClient} +testObject_PubClient_user_10 = PubClient {pubClientId = ClientId 0x4aa, pubClientClass = Just PhoneClient} testObject_PubClient_user_11 :: PubClient -testObject_PubClient_user_11 = PubClient {pubClientId = ClientId {client = "599"}, pubClientClass = Nothing} +testObject_PubClient_user_11 = PubClient {pubClientId = ClientId 0x599, pubClientClass = Nothing} testObject_PubClient_user_12 :: PubClient -testObject_PubClient_user_12 = PubClient {pubClientId = ClientId {client = "dcd"}, pubClientClass = Just TabletClient} +testObject_PubClient_user_12 = PubClient {pubClientId = ClientId 0xdcd, pubClientClass = Just TabletClient} testObject_PubClient_user_13 :: PubClient -testObject_PubClient_user_13 = PubClient {pubClientId = ClientId {client = "fdc"}, pubClientClass = Just PhoneClient} +testObject_PubClient_user_13 = PubClient {pubClientId = ClientId 0xfdc, pubClientClass = Just PhoneClient} testObject_PubClient_user_14 :: PubClient testObject_PubClient_user_14 = - PubClient {pubClientId = ClientId {client = "a98"}, pubClientClass = Just LegalHoldClient} + PubClient {pubClientId = ClientId 0xa98, pubClientClass = Just LegalHoldClient} testObject_PubClient_user_15 :: PubClient -testObject_PubClient_user_15 = PubClient {pubClientId = ClientId {client = "f7f"}, pubClientClass = Just DesktopClient} +testObject_PubClient_user_15 = PubClient {pubClientId = ClientId 0xf7f, pubClientClass = Just DesktopClient} testObject_PubClient_user_16 :: PubClient testObject_PubClient_user_16 = - PubClient {pubClientId = ClientId {client = "5b4"}, pubClientClass = Just LegalHoldClient} + PubClient {pubClientId = ClientId 0x5b4, pubClientClass = Just LegalHoldClient} testObject_PubClient_user_17 :: PubClient -testObject_PubClient_user_17 = PubClient {pubClientId = ClientId {client = "a83"}, pubClientClass = Nothing} +testObject_PubClient_user_17 = PubClient {pubClientId = ClientId 0xa83, pubClientClass = Nothing} testObject_PubClient_user_18 :: PubClient -testObject_PubClient_user_18 = PubClient {pubClientId = ClientId {client = "3d6"}, pubClientClass = Just PhoneClient} +testObject_PubClient_user_18 = PubClient {pubClientId = ClientId 0x3d6, pubClientClass = Just PhoneClient} testObject_PubClient_user_19 :: PubClient -testObject_PubClient_user_19 = PubClient {pubClientId = ClientId {client = "4c7"}, pubClientClass = Just TabletClient} +testObject_PubClient_user_19 = PubClient {pubClientId = ClientId 0x4c7, pubClientClass = Just TabletClient} testObject_PubClient_user_20 :: PubClient -testObject_PubClient_user_20 = PubClient {pubClientId = ClientId {client = "787"}, pubClientClass = Just TabletClient} +testObject_PubClient_user_20 = PubClient {pubClientId = ClientId 0x787, pubClientClass = Just TabletClient} diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/PushTokenList_user.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/PushTokenList_user.hs index c6cc80bd52..bc8bf48d0a 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/PushTokenList_user.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/PushTokenList_user.hs @@ -19,7 +19,7 @@ module Test.Wire.API.Golden.Generated.PushTokenList_user where -import Data.Id (ClientId (ClientId, client)) +import Data.Id import Wire.API.Push.Token ( AppName (AppName, appNameText), PushTokenList (..), @@ -32,7 +32,7 @@ testObject_PushTokenList_user_1 :: PushTokenList testObject_PushTokenList_user_1 = PushTokenList { pushTokens = - [ pushToken GCM (AppName {appNameText = "p\DELU2r"}) (Token {tokenText = "MK8p\f"}) (ClientId {client = "4"}) + [ pushToken GCM (AppName {appNameText = "p\DELU2r"}) (Token {tokenText = "MK8p\f"}) (ClientId 4) ] } diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/PushToken_user.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/PushToken_user.hs index 173449fdf7..8f7058d723 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/PushToken_user.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/PushToken_user.hs @@ -17,7 +17,7 @@ module Test.Wire.API.Golden.Generated.PushToken_user where -import Data.Id (ClientId (ClientId, client)) +import Data.Id import Wire.API.Push.Token ( AppName (AppName, appNameText), PushToken, @@ -32,4 +32,4 @@ testObject_PushToken_user_1 = APNSSandbox (AppName {appNameText = "G\1008289"}) (Token {tokenText = "\EOT8M\NAKAv\1104873"}) - (ClientId {client = "16"}) + (ClientId 0x16) diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/QualifiedNewOtrMessage_user.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/QualifiedNewOtrMessage_user.hs index 1a2ef18d9a..2b0b51c183 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/QualifiedNewOtrMessage_user.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/QualifiedNewOtrMessage_user.hs @@ -30,7 +30,7 @@ import Wire.API.User.Client testObject_QualifiedNewOtrMessage_user_1 :: QualifiedNewOtrMessage testObject_QualifiedNewOtrMessage_user_1 = QualifiedNewOtrMessage - { qualifiedNewOtrSender = ClientId {client = "2"}, + { qualifiedNewOtrSender = ClientId 2, qualifiedNewOtrRecipients = QualifiedOtrRecipients { qualifiedOtrRecipientsMap = @@ -76,7 +76,7 @@ testObject_QualifiedNewOtrMessage_user_1 = testObject_QualifiedNewOtrMessage_user_2 :: QualifiedNewOtrMessage testObject_QualifiedNewOtrMessage_user_2 = QualifiedNewOtrMessage - { qualifiedNewOtrSender = ClientId {client = "7"}, + { qualifiedNewOtrSender = ClientId 7, qualifiedNewOtrRecipients = QualifiedOtrRecipients {qualifiedOtrRecipientsMap = QualifiedUserClientMap Map.empty}, qualifiedNewOtrNativePush = True, @@ -89,7 +89,7 @@ testObject_QualifiedNewOtrMessage_user_2 = testObject_QualifiedNewOtrMessage_user_3 :: QualifiedNewOtrMessage testObject_QualifiedNewOtrMessage_user_3 = QualifiedNewOtrMessage - { qualifiedNewOtrSender = ClientId {client = "5"}, + { qualifiedNewOtrSender = ClientId 5, qualifiedNewOtrRecipients = QualifiedOtrRecipients {qualifiedOtrRecipientsMap = QualifiedUserClientMap Map.empty}, qualifiedNewOtrNativePush = True, @@ -102,7 +102,7 @@ testObject_QualifiedNewOtrMessage_user_3 = testObject_QualifiedNewOtrMessage_user_4 :: QualifiedNewOtrMessage testObject_QualifiedNewOtrMessage_user_4 = QualifiedNewOtrMessage - { qualifiedNewOtrSender = ClientId {client = "7"}, + { qualifiedNewOtrSender = ClientId 7, qualifiedNewOtrRecipients = QualifiedOtrRecipients {qualifiedOtrRecipientsMap = QualifiedUserClientMap Map.empty}, qualifiedNewOtrNativePush = True, @@ -115,7 +115,7 @@ testObject_QualifiedNewOtrMessage_user_4 = testObject_QualifiedNewOtrMessage_user_5 :: QualifiedNewOtrMessage testObject_QualifiedNewOtrMessage_user_5 = QualifiedNewOtrMessage - { qualifiedNewOtrSender = ClientId {client = "0"}, + { qualifiedNewOtrSender = ClientId 0, qualifiedNewOtrRecipients = QualifiedOtrRecipients { qualifiedOtrRecipientsMap = @@ -124,7 +124,7 @@ testObject_QualifiedNewOtrMessage_user_5 = [ ( Domain "74.w-5v9", Map.fromList [ ( Id (fromJust (UUID.fromString "00000000-0000-0001-0000-000400000004")), - Map.fromList [(ClientId {client = "7"}, "\229")] + Map.fromList [(ClientId 7, "\229")] ) ] ) @@ -149,7 +149,7 @@ testObject_QualifiedNewOtrMessage_user_5 = testObject_QualifiedNewOtrMessage_user_6 :: QualifiedNewOtrMessage testObject_QualifiedNewOtrMessage_user_6 = QualifiedNewOtrMessage - { qualifiedNewOtrSender = ClientId {client = "3"}, + { qualifiedNewOtrSender = ClientId 3, qualifiedNewOtrRecipients = QualifiedOtrRecipients {qualifiedOtrRecipientsMap = QualifiedUserClientMap Map.empty}, qualifiedNewOtrNativePush = False, @@ -162,7 +162,7 @@ testObject_QualifiedNewOtrMessage_user_6 = testObject_QualifiedNewOtrMessage_user_7 :: QualifiedNewOtrMessage testObject_QualifiedNewOtrMessage_user_7 = QualifiedNewOtrMessage - { qualifiedNewOtrSender = ClientId {client = "1"}, + { qualifiedNewOtrSender = ClientId 1, qualifiedNewOtrRecipients = QualifiedOtrRecipients { qualifiedOtrRecipientsMap = @@ -171,7 +171,7 @@ testObject_QualifiedNewOtrMessage_user_7 = [ ( Domain "9mns-s.ww-ph5oy", Map.fromList [ ( Id (fromJust (UUID.fromString "00000000-0000-0002-0000-000100000001")), - Map.fromList [(ClientId {client = "0"}, ""), (ClientId {client = "1"}, "")] + Map.fromList [(ClientId 0, ""), (ClientId 1, "")] ), (Id (fromJust (UUID.fromString "00000001-0000-0001-0000-000100000000")), Map.empty) ] @@ -189,7 +189,7 @@ testObject_QualifiedNewOtrMessage_user_7 = testObject_QualifiedNewOtrMessage_user_8 :: QualifiedNewOtrMessage testObject_QualifiedNewOtrMessage_user_8 = QualifiedNewOtrMessage - { qualifiedNewOtrSender = ClientId {client = "4"}, + { qualifiedNewOtrSender = ClientId 4, qualifiedNewOtrRecipients = QualifiedOtrRecipients { qualifiedOtrRecipientsMap = QualifiedUserClientMap (Map.fromList [(Domain "cg7t2.rf-2", Map.empty)]) @@ -204,7 +204,7 @@ testObject_QualifiedNewOtrMessage_user_8 = testObject_QualifiedNewOtrMessage_user_9 :: QualifiedNewOtrMessage testObject_QualifiedNewOtrMessage_user_9 = QualifiedNewOtrMessage - { qualifiedNewOtrSender = ClientId {client = "5"}, + { qualifiedNewOtrSender = ClientId 5, qualifiedNewOtrRecipients = QualifiedOtrRecipients { qualifiedOtrRecipientsMap = @@ -229,7 +229,7 @@ testObject_QualifiedNewOtrMessage_user_9 = testObject_QualifiedNewOtrMessage_user_10 :: QualifiedNewOtrMessage testObject_QualifiedNewOtrMessage_user_10 = QualifiedNewOtrMessage - { qualifiedNewOtrSender = ClientId {client = "8"}, + { qualifiedNewOtrSender = ClientId 8, qualifiedNewOtrRecipients = QualifiedOtrRecipients { qualifiedOtrRecipientsMap = @@ -254,7 +254,7 @@ testObject_QualifiedNewOtrMessage_user_10 = testObject_QualifiedNewOtrMessage_user_11 :: QualifiedNewOtrMessage testObject_QualifiedNewOtrMessage_user_11 = QualifiedNewOtrMessage - { qualifiedNewOtrSender = ClientId {client = "7"}, + { qualifiedNewOtrSender = ClientId 7, qualifiedNewOtrRecipients = QualifiedOtrRecipients {qualifiedOtrRecipientsMap = QualifiedUserClientMap Map.empty}, qualifiedNewOtrNativePush = False, @@ -277,7 +277,7 @@ testObject_QualifiedNewOtrMessage_user_11 = testObject_QualifiedNewOtrMessage_user_12 :: QualifiedNewOtrMessage testObject_QualifiedNewOtrMessage_user_12 = QualifiedNewOtrMessage - { qualifiedNewOtrSender = ClientId {client = "6"}, + { qualifiedNewOtrSender = ClientId 6, qualifiedNewOtrRecipients = QualifiedOtrRecipients {qualifiedOtrRecipientsMap = QualifiedUserClientMap Map.empty}, qualifiedNewOtrNativePush = False, @@ -301,7 +301,7 @@ testObject_QualifiedNewOtrMessage_user_12 = testObject_QualifiedNewOtrMessage_user_13 :: QualifiedNewOtrMessage testObject_QualifiedNewOtrMessage_user_13 = QualifiedNewOtrMessage - { qualifiedNewOtrSender = ClientId {client = "8"}, + { qualifiedNewOtrSender = ClientId 8, qualifiedNewOtrRecipients = QualifiedOtrRecipients { qualifiedOtrRecipientsMap = @@ -332,7 +332,7 @@ testObject_QualifiedNewOtrMessage_user_13 = testObject_QualifiedNewOtrMessage_user_14 :: QualifiedNewOtrMessage testObject_QualifiedNewOtrMessage_user_14 = QualifiedNewOtrMessage - { qualifiedNewOtrSender = ClientId {client = "0"}, + { qualifiedNewOtrSender = ClientId 0, qualifiedNewOtrRecipients = QualifiedOtrRecipients {qualifiedOtrRecipientsMap = QualifiedUserClientMap Map.empty}, qualifiedNewOtrNativePush = True, @@ -345,7 +345,7 @@ testObject_QualifiedNewOtrMessage_user_14 = testObject_QualifiedNewOtrMessage_user_15 :: QualifiedNewOtrMessage testObject_QualifiedNewOtrMessage_user_15 = QualifiedNewOtrMessage - { qualifiedNewOtrSender = ClientId {client = "2"}, + { qualifiedNewOtrSender = ClientId 2, qualifiedNewOtrRecipients = QualifiedOtrRecipients { qualifiedOtrRecipientsMap = @@ -354,7 +354,7 @@ testObject_QualifiedNewOtrMessage_user_15 = [ ( Domain "32-d.o0t410.de1kn", Map.fromList [ ( Id (fromJust (UUID.fromString "00000000-0000-0004-0000-000400000002")), - Map.fromList [(ClientId {client = "1"}, "")] + Map.fromList [(ClientId 1, "")] ) ] ) @@ -371,7 +371,7 @@ testObject_QualifiedNewOtrMessage_user_15 = testObject_QualifiedNewOtrMessage_user_16 :: QualifiedNewOtrMessage testObject_QualifiedNewOtrMessage_user_16 = QualifiedNewOtrMessage - { qualifiedNewOtrSender = ClientId {client = "1"}, + { qualifiedNewOtrSender = ClientId 1, qualifiedNewOtrRecipients = QualifiedOtrRecipients { qualifiedOtrRecipientsMap = @@ -404,7 +404,7 @@ testObject_QualifiedNewOtrMessage_user_16 = testObject_QualifiedNewOtrMessage_user_17 :: QualifiedNewOtrMessage testObject_QualifiedNewOtrMessage_user_17 = QualifiedNewOtrMessage - { qualifiedNewOtrSender = ClientId {client = "8"}, + { qualifiedNewOtrSender = ClientId 8, qualifiedNewOtrRecipients = QualifiedOtrRecipients {qualifiedOtrRecipientsMap = QualifiedUserClientMap Map.empty}, qualifiedNewOtrNativePush = True, @@ -424,7 +424,7 @@ testObject_QualifiedNewOtrMessage_user_17 = testObject_QualifiedNewOtrMessage_user_18 :: QualifiedNewOtrMessage testObject_QualifiedNewOtrMessage_user_18 = QualifiedNewOtrMessage - { qualifiedNewOtrSender = ClientId {client = "7"}, + { qualifiedNewOtrSender = ClientId 7, qualifiedNewOtrRecipients = QualifiedOtrRecipients { qualifiedOtrRecipientsMap = @@ -451,7 +451,7 @@ testObject_QualifiedNewOtrMessage_user_18 = testObject_QualifiedNewOtrMessage_user_19 :: QualifiedNewOtrMessage testObject_QualifiedNewOtrMessage_user_19 = QualifiedNewOtrMessage - { qualifiedNewOtrSender = ClientId {client = "0"}, + { qualifiedNewOtrSender = ClientId 0, qualifiedNewOtrRecipients = QualifiedOtrRecipients { qualifiedOtrRecipientsMap = @@ -461,7 +461,7 @@ testObject_QualifiedNewOtrMessage_user_19 = ( Domain "8hhm.a-77q6", Map.fromList [ ( Id (fromJust (UUID.fromString "00000000-0000-0002-0000-000100000000")), - Map.fromList [(ClientId {client = "0"}, ""), (ClientId {client = "1"}, "")] + Map.fromList [(ClientId 0, ""), (ClientId 1, "")] ) ] ) @@ -485,7 +485,7 @@ testObject_QualifiedNewOtrMessage_user_19 = testObject_QualifiedNewOtrMessage_user_20 :: QualifiedNewOtrMessage testObject_QualifiedNewOtrMessage_user_20 = QualifiedNewOtrMessage - { qualifiedNewOtrSender = ClientId {client = "5"}, + { qualifiedNewOtrSender = ClientId 5, qualifiedNewOtrRecipients = QualifiedOtrRecipients { qualifiedOtrRecipientsMap = diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/QualifiedUserClientPrekeyMapV4_user.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/QualifiedUserClientPrekeyMapV4_user.hs index 6f8d53b6eb..7fd8bae301 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/QualifiedUserClientPrekeyMapV4_user.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/QualifiedUserClientPrekeyMapV4_user.hs @@ -34,7 +34,7 @@ user1 = Id . fromJust $ UUID.fromString "44f9c51e-0dce-4e7f-85ba-b4e5a545ce68" user2 = Id . fromJust $ UUID.fromString "284c4e8f-78ef-43f4-a77a-015c22e37960" clientId :: ClientId -clientId = ClientId "0123456789ABCEF" +clientId = ClientId 0x0123456789abcef testObject_QualifiedUserClientPrekeyMapV4_user_1 :: QualifiedUserClientPrekeyMapV4 testObject_QualifiedUserClientPrekeyMapV4_user_1 = diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/UserClientMap_20Int_user.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/UserClientMap_20Int_user.hs index 7af480a384..aa33b2e8d0 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/UserClientMap_20Int_user.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/UserClientMap_20Int_user.hs @@ -19,7 +19,7 @@ module Test.Wire.API.Golden.Generated.UserClientMap_20Int_user where -import Data.Id (ClientId (ClientId, client), Id (Id)) +import Data.Id import Data.UUID qualified as UUID (fromString) import GHC.Exts (IsList (fromList)) import Imports (Int, fromJust) @@ -32,10 +32,10 @@ testObject_UserClientMap_20Int_user_1 = fromList [ ( Id (fromJust (UUID.fromString "00000552-0000-7ae9-0000-5c84000004dd")), fromList - [ (ClientId {client = "0"}, 0), - (ClientId {client = "1"}, -1), - (ClientId {client = "3"}, -3), - (ClientId {client = "4"}, 3) + [ (ClientId 0, 0), + (ClientId 1, -1), + (ClientId 3, -3), + (ClientId 4, 3) ] ) ] @@ -47,10 +47,10 @@ testObject_UserClientMap_20Int_user_2 = { userClientMap = fromList [ ( Id (fromJust (UUID.fromString "00000025-0000-0025-0000-00660000001d")), - fromList [(ClientId {client = "3"}, 5), (ClientId {client = "9"}, 0)] + fromList [(ClientId 3, 5), (ClientId 9, 0)] ), ( Id (fromJust (UUID.fromString "00000038-0000-004a-0000-007700000000")), - fromList [(ClientId {client = "dfd"}, -8)] + fromList [(ClientId 0xdfd, -8)] ) ] } @@ -61,13 +61,13 @@ testObject_UserClientMap_20Int_user_3 = { userClientMap = fromList [ ( Id (fromJust (UUID.fromString "0000000e-0000-001d-0000-00160000000b")), - fromList [(ClientId {client = "0"}, 0), (ClientId {client = "1"}, 0)] + fromList [(ClientId 0, 0), (ClientId 1, 0)] ), ( Id (fromJust (UUID.fromString "00000013-0000-000d-0000-000600000007")), - fromList [(ClientId {client = "4"}, -5), (ClientId {client = "9"}, 1)] + fromList [(ClientId 4, -5), (ClientId 9, 1)] ), ( Id (fromJust (UUID.fromString "00000018-0000-0020-0000-000e00000002")), - fromList [(ClientId {client = "0"}, 0), (ClientId {client = "1"}, 0)] + fromList [(ClientId 0, 0), (ClientId 1, 0)] ) ] } @@ -79,14 +79,14 @@ testObject_UserClientMap_20Int_user_4 = fromList [ (Id (fromJust (UUID.fromString "00000000-0000-0003-0000-000100000000")), fromList []), ( Id (fromJust (UUID.fromString "00000003-0000-0002-0000-000500000002")), - fromList [(ClientId {client = "0"}, 1), (ClientId {client = "1"}, 1)] + fromList [(ClientId 0, 1), (ClientId 1, 1)] ), ( Id (fromJust (UUID.fromString "00000003-0000-0005-0000-000800000001")), - fromList [(ClientId {client = "0"}, 0), (ClientId {client = "1"}, 0)] + fromList [(ClientId 0, 0), (ClientId 1, 0)] ), (Id (fromJust (UUID.fromString "00000004-0000-0003-0000-000300000008")), fromList []), ( Id (fromJust (UUID.fromString "00000007-0000-0008-0000-000100000006")), - fromList [(ClientId {client = "0"}, -2), (ClientId {client = "3"}, 1)] + fromList [(ClientId 0, -2), (ClientId 3, 1)] ) ] } @@ -97,14 +97,14 @@ testObject_UserClientMap_20Int_user_5 = { userClientMap = fromList [ ( Id (fromJust (UUID.fromString "00000000-0000-0004-0000-000400000005")), - fromList [(ClientId {client = "17"}, -7)] + fromList [(ClientId 0x17, -7)] ), ( Id (fromJust (UUID.fromString "00000003-0000-0006-0000-000100000000")), - fromList [(ClientId {client = "2"}, 4)] + fromList [(ClientId 2, 4)] ), (Id (fromJust (UUID.fromString "00000006-0000-0008-0000-000600000003")), fromList []), ( Id (fromJust (UUID.fromString "00000008-0000-0008-0000-000300000008")), - fromList [(ClientId {client = "0"}, 0), (ClientId {client = "1"}, 1)] + fromList [(ClientId 0, 0), (ClientId 1, 1)] ) ] } @@ -115,10 +115,10 @@ testObject_UserClientMap_20Int_user_6 = { userClientMap = fromList [ ( Id (fromJust (UUID.fromString "0000004d-0000-001f-0000-006300000073")), - fromList [(ClientId {client = "1"}, 0), (ClientId {client = "2"}, -3), (ClientId {client = "4"}, -1)] + fromList [(ClientId 1, 0), (ClientId 2, -3), (ClientId 4, -1)] ), ( Id (fromJust (UUID.fromString "0000007c-0000-0075-0000-006000000025")), - fromList [(ClientId {client = "8"}, 0), (ClientId {client = "c"}, 3), (ClientId {client = "f"}, 1)] + fromList [(ClientId 0x8, 0), (ClientId 0xc, 3), (ClientId 0xf, 1)] ) ] } @@ -129,20 +129,20 @@ testObject_UserClientMap_20Int_user_7 = { userClientMap = fromList [ ( Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000200000000")), - fromList [(ClientId {client = "0"}, 0)] + fromList [(ClientId 0, 0)] ), (Id (fromJust (UUID.fromString "00000000-0000-0001-0000-000000000001")), fromList []), ( Id (fromJust (UUID.fromString "00000000-0000-0002-0000-000200000002")), - fromList [(ClientId {client = "0"}, -2)] + fromList [(ClientId 0, -2)] ), ( Id (fromJust (UUID.fromString "00000001-0000-0001-0000-000000000001")), - fromList [(ClientId {client = "0"}, 0), (ClientId {client = "1"}, 0)] + fromList [(ClientId 0, 0), (ClientId 1, 0)] ), ( Id (fromJust (UUID.fromString "00000001-0000-0002-0000-000100000001")), - fromList [(ClientId {client = "0"}, -1), (ClientId {client = "1"}, 0)] + fromList [(ClientId 0, -1), (ClientId 1, 0)] ), ( Id (fromJust (UUID.fromString "00000002-0000-0000-0000-000000000001")), - fromList [(ClientId {client = "2"}, 1)] + fromList [(ClientId 2, 1)] ), (Id (fromJust (UUID.fromString "00000002-0000-0001-0000-000000000002")), fromList []) ] @@ -158,7 +158,7 @@ testObject_UserClientMap_20Int_user_9 = fromList [ (Id (fromJust (UUID.fromString "00000054-0000-003b-0000-00210000005f")), fromList []), ( Id (fromJust (UUID.fromString "00000065-0000-0040-0000-005f00000064")), - fromList [(ClientId {client = "0"}, 2), (ClientId {client = "1"}, -2), (ClientId {client = "2"}, -2)] + fromList [(ClientId 0, 2), (ClientId 1, -2), (ClientId 2, -2)] ) ] } @@ -169,20 +169,20 @@ testObject_UserClientMap_20Int_user_10 = { userClientMap = fromList [ ( Id (fromJust (UUID.fromString "00000001-0000-0003-0000-000200000003")), - fromList [(ClientId {client = "b"}, -1)] + fromList [(ClientId 0xb, -1)] ), (Id (fromJust (UUID.fromString "00000001-0000-0004-0000-000000000000")), fromList []), ( Id (fromJust (UUID.fromString "00000001-0000-0004-0000-000400000000")), - fromList [(ClientId {client = "0"}, 0), (ClientId {client = "1"}, -1)] + fromList [(ClientId 0, 0), (ClientId 1, -1)] ), ( Id (fromJust (UUID.fromString "00000002-0000-0003-0000-000200000003")), - fromList [(ClientId {client = "0"}, 0), (ClientId {client = "1"}, 0)] + fromList [(ClientId 0, 0), (ClientId 1, 0)] ), ( Id (fromJust (UUID.fromString "00000003-0000-0000-0000-000300000003")), - fromList [(ClientId {client = "7"}, -5)] + fromList [(ClientId 7, -5)] ), ( Id (fromJust (UUID.fromString "00000004-0000-0004-0000-000400000000")), - fromList [(ClientId {client = "1"}, 2)] + fromList [(ClientId 1, 2)] ) ] } @@ -193,13 +193,13 @@ testObject_UserClientMap_20Int_user_11 = { userClientMap = fromList [ ( Id (fromJust (UUID.fromString "00000001-0000-001b-0000-000200000004")), - fromList [(ClientId {client = "38"}, -3)] + fromList [(ClientId 0x38, -3)] ), ( Id (fromJust (UUID.fromString "00000007-0000-001b-0000-000700000017")), - fromList [(ClientId {client = "1"}, 0), (ClientId {client = "2"}, 2), (ClientId {client = "3"}, -3)] + fromList [(ClientId 1, 0), (ClientId 2, 2), (ClientId 3, -3)] ), ( Id (fromJust (UUID.fromString "0000000e-0000-001b-0000-000800000011")), - fromList [(ClientId {client = "0"}, 0), (ClientId {client = "1"}, -1)] + fromList [(ClientId 0, 0), (ClientId 1, -1)] ) ] } @@ -210,19 +210,19 @@ testObject_UserClientMap_20Int_user_12 = { userClientMap = fromList [ ( Id (fromJust (UUID.fromString "00000004-0000-0002-0000-000600000005")), - fromList [(ClientId {client = "1"}, -2), (ClientId {client = "2"}, -1)] + fromList [(ClientId 1, -2), (ClientId 2, -1)] ), ( Id (fromJust (UUID.fromString "00000005-0000-0006-0000-000700000006")), - fromList [(ClientId {client = "5"}, 6)] + fromList [(ClientId 5, 6)] ), ( Id (fromJust (UUID.fromString "00000007-0000-0000-0000-000000000005")), - fromList [(ClientId {client = "3"}, 3), (ClientId {client = "4"}, -3)] + fromList [(ClientId 3, 3), (ClientId 4, -3)] ), ( Id (fromJust (UUID.fromString "00000007-0000-0000-0000-000100000005")), - fromList [(ClientId {client = "0"}, 0), (ClientId {client = "1"}, 0)] + fromList [(ClientId 0, 0), (ClientId 1, 0)] ), ( Id (fromJust (UUID.fromString "00000008-0000-0007-0000-000000000005")), - fromList [(ClientId {client = "0"}, 0), (ClientId {client = "1"}, 0)] + fromList [(ClientId 0, 0), (ClientId 1, 0)] ) ] } @@ -234,10 +234,10 @@ testObject_UserClientMap_20Int_user_13 = fromList [ (Id (fromJust (UUID.fromString "00000005-0000-0005-0000-000400000004")), fromList []), ( Id (fromJust (UUID.fromString "00000008-0000-000d-0000-00040000000d")), - fromList [(ClientId {client = "9"}, -3), (ClientId {client = "d"}, -5)] + fromList [(ClientId 0x9, -3), (ClientId 0xd, -5)] ), ( Id (fromJust (UUID.fromString "00000008-0000-0011-0000-000b0000000f")), - fromList [(ClientId {client = "98"}, 1)] + fromList [(ClientId 0x98, 1)] ) ] } @@ -248,20 +248,20 @@ testObject_UserClientMap_20Int_user_14 = { userClientMap = fromList [ ( Id (fromJust (UUID.fromString "00000000-0000-0003-0000-000400000001")), - fromList [(ClientId {client = "0"}, 0)] + fromList [(ClientId 0, 0)] ), ( Id (fromJust (UUID.fromString "00000001-0000-0000-0000-000300000004")), - fromList [(ClientId {client = "0"}, 0), (ClientId {client = "1"}, 0)] + fromList [(ClientId 0, 0), (ClientId 1, 0)] ), (Id (fromJust (UUID.fromString "00000001-0000-0001-0000-000100000002")), fromList []), ( Id (fromJust (UUID.fromString "00000002-0000-0004-0000-000000000000")), - fromList [(ClientId {client = "0"}, 1), (ClientId {client = "1"}, -1)] + fromList [(ClientId 0, 1), (ClientId 1, -1)] ), ( Id (fromJust (UUID.fromString "00000002-0000-0004-0000-000100000004")), - fromList [(ClientId {client = "0"}, 1), (ClientId {client = "1"}, -2)] + fromList [(ClientId 0, 1), (ClientId 1, -2)] ), ( Id (fromJust (UUID.fromString "00000003-0000-0004-0000-000000000003")), - fromList [(ClientId {client = "0"}, 0), (ClientId {client = "1"}, 0)] + fromList [(ClientId 0, 0), (ClientId 1, 0)] ) ] } @@ -273,10 +273,10 @@ testObject_UserClientMap_20Int_user_15 = fromList [ (Id (fromJust (UUID.fromString "00000000-0000-0006-0000-000800000007")), fromList []), ( Id (fromJust (UUID.fromString "00000003-0000-0003-0000-000500000000")), - fromList [(ClientId {client = "c"}, -2)] + fromList [(ClientId 0xc, -2)] ), ( Id (fromJust (UUID.fromString "00000005-0000-0000-0000-000600000002")), - fromList [(ClientId {client = "1b"}, -7)] + fromList [(ClientId 0x1b, -7)] ), (Id (fromJust (UUID.fromString "00000008-0000-0004-0000-000000000002")), fromList []) ] @@ -289,24 +289,24 @@ testObject_UserClientMap_20Int_user_16 = fromList [ (Id (fromJust (UUID.fromString "00000000-0000-0001-0000-000000000001")), fromList []), ( Id (fromJust (UUID.fromString "00000000-0000-0001-0000-000100000000")), - fromList [(ClientId {client = "0"}, -1), (ClientId {client = "1"}, -1)] + fromList [(ClientId 0, -1), (ClientId 1, -1)] ), (Id (fromJust (UUID.fromString "00000000-0000-0001-0000-000200000001")), fromList []), ( Id (fromJust (UUID.fromString "00000000-0000-0002-0000-000100000001")), - fromList [(ClientId {client = "2"}, -3)] + fromList [(ClientId 2, -3)] ), (Id (fromJust (UUID.fromString "00000001-0000-0000-0000-000100000000")), fromList []), ( Id (fromJust (UUID.fromString "00000001-0000-0001-0000-000000000001")), - fromList [(ClientId {client = "1"}, 2)] + fromList [(ClientId 1, 2)] ), ( Id (fromJust (UUID.fromString "00000001-0000-0001-0000-000200000002")), - fromList [(ClientId {client = "0"}, 0), (ClientId {client = "1"}, 0)] + fromList [(ClientId 0, 0), (ClientId 1, 0)] ), ( Id (fromJust (UUID.fromString "00000001-0000-0002-0000-000200000001")), - fromList [(ClientId {client = "0"}, -1)] + fromList [(ClientId 0, -1)] ), ( Id (fromJust (UUID.fromString "00000002-0000-0001-0000-000200000000")), - fromList [(ClientId {client = "3"}, 1)] + fromList [(ClientId 3, 1)] ) ] } @@ -317,13 +317,13 @@ testObject_UserClientMap_20Int_user_17 = { userClientMap = fromList [ ( Id (fromJust (UUID.fromString "00000000-0000-000f-0000-000400000014")), - fromList [(ClientId {client = "0"}, 2), (ClientId {client = "1"}, 1)] + fromList [(ClientId 0, 2), (ClientId 1, 1)] ), ( Id (fromJust (UUID.fromString "00000001-0000-001c-0000-00170000001c")), - fromList [(ClientId {client = "0"}, 2), (ClientId {client = "1"}, 0), (ClientId {client = "2"}, 0)] + fromList [(ClientId 0, 2), (ClientId 1, 0), (ClientId 2, 0)] ), ( Id (fromJust (UUID.fromString "00000014-0000-0018-0000-001f00000002")), - fromList [(ClientId {client = "0"}, 0), (ClientId {client = "1"}, 0)] + fromList [(ClientId 0, 0), (ClientId 1, 0)] ) ] } @@ -335,16 +335,16 @@ testObject_UserClientMap_20Int_user_18 = fromList [ (Id (fromJust (UUID.fromString "00000000-0000-0001-0000-000800000008")), fromList []), ( Id (fromJust (UUID.fromString "00000003-0000-0002-0000-000500000002")), - fromList [(ClientId {client = "0"}, 0), (ClientId {client = "1"}, 0)] + fromList [(ClientId 0, 0), (ClientId 1, 0)] ), ( Id (fromJust (UUID.fromString "00000006-0000-0001-0000-000100000001")), - fromList [(ClientId {client = "2"}, -1), (ClientId {client = "4"}, 3)] + fromList [(ClientId 2, -1), (ClientId 4, 3)] ), ( Id (fromJust (UUID.fromString "00000008-0000-0006-0000-000800000008")), - fromList [(ClientId {client = "0"}, 1)] + fromList [(ClientId 0, 1)] ), ( Id (fromJust (UUID.fromString "00000008-0000-0008-0000-000700000003")), - fromList [(ClientId {client = "1"}, 2), (ClientId {client = "2"}, -2)] + fromList [(ClientId 1, 2), (ClientId 2, -2)] ) ] } @@ -357,7 +357,7 @@ testObject_UserClientMap_20Int_user_19 = [ (Id (fromJust (UUID.fromString "00000000-0000-0005-0000-000800000002")), fromList []), (Id (fromJust (UUID.fromString "00000002-0000-0007-0000-000100000002")), fromList []), ( Id (fromJust (UUID.fromString "00000002-0000-0008-0000-000300000006")), - fromList [(ClientId {client = "12"}, 6)] + fromList [(ClientId 0x12, 6)] ), (Id (fromJust (UUID.fromString "00000002-0000-0008-0000-000300000008")), fromList []) ] diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/UserClients_user.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/UserClients_user.hs index d173eaf23d..4f2ef1e5a4 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/UserClients_user.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/UserClients_user.hs @@ -19,7 +19,7 @@ module Test.Wire.API.Golden.Generated.UserClients_user where -import Data.Id (ClientId (ClientId, client), Id (Id)) +import Data.Id import Data.UUID qualified as UUID (fromString) import GHC.Exts (IsList (fromList)) import Imports (fromJust) @@ -32,11 +32,11 @@ testObject_UserClients_user_1 = fromList [ (Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000000000001")), fromList []), ( Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000100000000")), - fromList [ClientId {client = "0"}, ClientId {client = "1"}] + fromList [ClientId 0, ClientId 1] ), (Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000100000001")), fromList []), ( Id (fromJust (UUID.fromString "00000000-0000-0001-0000-000000000000")), - fromList [ClientId {client = "0"}, ClientId {client = "1"}] + fromList [ClientId 0, ClientId 1] ), (Id (fromJust (UUID.fromString "00000000-0000-0001-0000-000100000000")), fromList []), (Id (fromJust (UUID.fromString "00000000-0000-0001-0000-000100000001")), fromList []), @@ -44,10 +44,10 @@ testObject_UserClients_user_1 = (Id (fromJust (UUID.fromString "00000001-0000-0000-0000-000000000001")), fromList []), (Id (fromJust (UUID.fromString "00000001-0000-0000-0000-000100000001")), fromList []), ( Id (fromJust (UUID.fromString "00000001-0000-0001-0000-000000000000")), - fromList [ClientId {client = "1"}] + fromList [ClientId 1] ), ( Id (fromJust (UUID.fromString "00000001-0000-0001-0000-000100000001")), - fromList [ClientId {client = "0"}] + fromList [ClientId 0] ) ] } @@ -82,29 +82,29 @@ testObject_UserClients_user_3 = { userClients = fromList [ ( Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000000000000")), - fromList [ClientId {client = "0"}] + fromList [ClientId 0] ), (Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000000000001")), fromList []), (Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000100000000")), fromList []), ( Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000100000001")), - fromList [ClientId {client = "0"}] + fromList [ClientId 0] ), ( Id (fromJust (UUID.fromString "00000000-0000-0001-0000-000000000000")), - fromList [ClientId {client = "1"}] + fromList [ClientId 1] ), ( Id (fromJust (UUID.fromString "00000000-0000-0001-0000-000000000001")), - fromList [ClientId {client = "1"}] + fromList [ClientId 1] ), (Id (fromJust (UUID.fromString "00000000-0000-0001-0000-000100000000")), fromList []), (Id (fromJust (UUID.fromString "00000001-0000-0000-0000-000000000001")), fromList []), ( Id (fromJust (UUID.fromString "00000001-0000-0000-0000-000100000000")), - fromList [ClientId {client = "0"}, ClientId {client = "1"}] + fromList [ClientId 0, ClientId 1] ), ( Id (fromJust (UUID.fromString "00000001-0000-0001-0000-000000000000")), - fromList [ClientId {client = "1"}] + fromList [ClientId 1] ), ( Id (fromJust (UUID.fromString "00000001-0000-0001-0000-000100000000")), - fromList [ClientId {client = "0"}] + fromList [ClientId 0] ) ] } @@ -128,23 +128,23 @@ testObject_UserClients_user_7 = (Id (fromJust (UUID.fromString "00000000-0000-0001-0000-000000000000")), fromList []), (Id (fromJust (UUID.fromString "00000000-0000-0001-0000-000000000001")), fromList []), ( Id (fromJust (UUID.fromString "00000000-0000-0002-0000-000100000001")), - fromList [ClientId {client = "0"}] + fromList [ClientId 0] ), ( Id (fromJust (UUID.fromString "00000001-0000-0000-0000-000000000001")), - fromList [ClientId {client = "0"}, ClientId {client = "1"}] + fromList [ClientId 0, ClientId 1] ), ( Id (fromJust (UUID.fromString "00000001-0000-0000-0000-000000000002")), - fromList [ClientId {client = "2"}] + fromList [ClientId 2] ), ( Id (fromJust (UUID.fromString "00000001-0000-0000-0000-000100000002")), - fromList [ClientId {client = "2"}] + fromList [ClientId 2] ), (Id (fromJust (UUID.fromString "00000001-0000-0001-0000-000200000000")), fromList []), ( Id (fromJust (UUID.fromString "00000001-0000-0002-0000-000100000002")), - fromList [ClientId {client = "0"}, ClientId {client = "1"}] + fromList [ClientId 0, ClientId 1] ), ( Id (fromJust (UUID.fromString "00000002-0000-0001-0000-000100000001")), - fromList [ClientId {client = "0"}, ClientId {client = "1"}] + fromList [ClientId 0, ClientId 1] ) ] } @@ -157,22 +157,22 @@ testObject_UserClients_user_8 = [ (Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000100000000")), fromList []), (Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000200000000")), fromList []), ( Id (fromJust (UUID.fromString "00000000-0000-0001-0000-000000000001")), - fromList [ClientId {client = "1"}] + fromList [ClientId 1] ), ( Id (fromJust (UUID.fromString "00000000-0000-0001-0000-000100000000")), - fromList [ClientId {client = "3"}] + fromList [ClientId 3] ), ( Id (fromJust (UUID.fromString "00000000-0000-0002-0000-000100000002")), - fromList [ClientId {client = "0"}, ClientId {client = "1"}] + fromList [ClientId 0, ClientId 1] ), ( Id (fromJust (UUID.fromString "00000002-0000-0001-0000-000000000000")), - fromList [ClientId {client = "2"}] + fromList [ClientId 2] ), ( Id (fromJust (UUID.fromString "00000002-0000-0001-0000-000100000000")), - fromList [ClientId {client = "3"}] + fromList [ClientId 3] ), ( Id (fromJust (UUID.fromString "00000002-0000-0001-0000-000200000001")), - fromList [ClientId {client = "0"}, ClientId {client = "1"}] + fromList [ClientId 0, ClientId 1] ) ] } @@ -183,14 +183,14 @@ testObject_UserClients_user_9 = { userClients = fromList [ ( Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000200000002")), - fromList [ClientId {client = "0"}, ClientId {client = "1"}] + fromList [ClientId 0, ClientId 1] ), (Id (fromJust (UUID.fromString "00000000-0000-0004-0000-000300000003")), fromList []), ( Id (fromJust (UUID.fromString "00000001-0000-0003-0000-000100000001")), - fromList [ClientId {client = "a"}] + fromList [ClientId 0xa] ), ( Id (fromJust (UUID.fromString "00000003-0000-0004-0000-000200000004")), - fromList [ClientId {client = "2"}] + fromList [ClientId 2] ), (Id (fromJust (UUID.fromString "00000004-0000-0004-0000-000200000002")), fromList []) ] @@ -202,7 +202,7 @@ testObject_UserClients_user_10 = { userClients = fromList [ ( Id (fromJust (UUID.fromString "00007d35-0000-33bd-0000-377d000074fb")), - fromList [ClientId {client = "9824c7"}] + fromList [ClientId 0x9824c7] ) ] } @@ -213,30 +213,30 @@ testObject_UserClients_user_11 = { userClients = fromList [ ( Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000000000002")), - fromList [ClientId {client = "2"}] + fromList [ClientId 2] ), (Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000100000000")), fromList []), ( Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000200000001")), - fromList [ClientId {client = "0"}] + fromList [ClientId 0] ), ( Id (fromJust (UUID.fromString "00000000-0000-0001-0000-000000000001")), - fromList [ClientId {client = "0"}] + fromList [ClientId 0] ), ( Id (fromJust (UUID.fromString "00000000-0000-0002-0000-000000000001")), - fromList [ClientId {client = "0"}, ClientId {client = "1"}] + fromList [ClientId 0, ClientId 1] ), ( Id (fromJust (UUID.fromString "00000001-0000-0000-0000-000100000001")), - fromList [ClientId {client = "2"}] + fromList [ClientId 2] ), (Id (fromJust (UUID.fromString "00000001-0000-0001-0000-000000000000")), fromList []), ( Id (fromJust (UUID.fromString "00000001-0000-0001-0000-000100000002")), - fromList [ClientId {client = "0"}] + fromList [ClientId 0] ), ( Id (fromJust (UUID.fromString "00000001-0000-0002-0000-000200000000")), - fromList [ClientId {client = "0"}, ClientId {client = "1"}] + fromList [ClientId 0, ClientId 1] ), ( Id (fromJust (UUID.fromString "00000002-0000-0001-0000-000100000001")), - fromList [ClientId {client = "0"}, ClientId {client = "1"}] + fromList [ClientId 0, ClientId 1] ) ] } @@ -248,11 +248,11 @@ testObject_UserClients_user_12 = fromList [ ( Id (fromJust (UUID.fromString "00000731-0000-23a5-0000-23bc00003dd5")), fromList - [ ClientId {client = "1"}, - ClientId {client = "7"}, - ClientId {client = "8"}, - ClientId {client = "b"}, - ClientId {client = "e"} + [ ClientId 1, + ClientId 7, + ClientId 8, + ClientId 0xb, + ClientId 0xe ] ) ] @@ -266,7 +266,7 @@ testObject_UserClients_user_13 = [ (Id (fromJust (UUID.fromString "00000001-0000-0000-0000-000d00000008")), fromList []), (Id (fromJust (UUID.fromString "00000005-0000-001d-0000-000c0000001c")), fromList []), ( Id (fromJust (UUID.fromString "0000000e-0000-000a-0000-00160000001a")), - fromList [ClientId {client = "1"}, ClientId {client = "2"}] + fromList [ClientId 1, ClientId 2] ) ] } @@ -277,7 +277,7 @@ testObject_UserClients_user_14 = { userClients = fromList [ ( Id (fromJust (UUID.fromString "00001130-0000-01e5-0000-3c24000015c6")), - fromList [ClientId {client = "18"}, ClientId {client = "1f"}, ClientId {client = "a"}] + fromList [ClientId 0x18, ClientId 0x1f, ClientId 0xa] ) ] } @@ -288,7 +288,7 @@ testObject_UserClients_user_15 = { userClients = fromList [ ( Id (fromJust (UUID.fromString "000004e9-0000-307b-0000-1ab300006689")), - fromList [ClientId {client = "6c"}, ClientId {client = "946"}] + fromList [ClientId 0x6c, ClientId 0x946] ) ] } @@ -300,10 +300,10 @@ testObject_UserClients_user_16 = fromList [ (Id (fromJust (UUID.fromString "00000001-0000-0001-0000-000700000007")), fromList []), ( Id (fromJust (UUID.fromString "00000002-0000-0005-0000-000600000007")), - fromList [ClientId {client = "0"}, ClientId {client = "1"}] + fromList [ClientId 0, ClientId 1] ), ( Id (fromJust (UUID.fromString "00000002-0000-0008-0000-000300000000")), - fromList [ClientId {client = "2"}, ClientId {client = "4"}] + fromList [ClientId 2, ClientId 4] ), (Id (fromJust (UUID.fromString "00000005-0000-0002-0000-000100000006")), fromList []) ] @@ -315,11 +315,11 @@ testObject_UserClients_user_17 = { userClients = fromList [ ( Id (fromJust (UUID.fromString "00000011-0000-0007-0000-000f0000001c")), - fromList [ClientId {client = "4"}, ClientId {client = "c"}] + fromList [ClientId 4, ClientId 0xc] ), (Id (fromJust (UUID.fromString "0000001f-0000-000b-0000-001700000005")), fromList []), ( Id (fromJust (UUID.fromString "0000001f-0000-0011-0000-000800000010")), - fromList [ClientId {client = "2"}, ClientId {client = "3"}, ClientId {client = "4"}] + fromList [ClientId 2, ClientId 3, ClientId 4] ) ] } @@ -330,27 +330,27 @@ testObject_UserClients_user_18 = { userClients = fromList [ ( Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000000000000")), - fromList [ClientId {client = "1"}] + fromList [ClientId 1] ), ( Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000100000000")), - fromList [ClientId {client = "1"}] + fromList [ClientId 1] ), ( Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000100000001")), - fromList [ClientId {client = "0"}, ClientId {client = "1"}] + fromList [ClientId 0, ClientId 1] ), ( Id (fromJust (UUID.fromString "00000000-0000-0001-0000-000100000000")), - fromList [ClientId {client = "0"}] + fromList [ClientId 0] ), (Id (fromJust (UUID.fromString "00000000-0000-0001-0000-000100000001")), fromList []), (Id (fromJust (UUID.fromString "00000001-0000-0000-0000-000000000000")), fromList []), ( Id (fromJust (UUID.fromString "00000001-0000-0000-0000-000000000001")), - fromList [ClientId {client = "0"}] + fromList [ClientId 0] ), ( Id (fromJust (UUID.fromString "00000001-0000-0000-0000-000100000000")), - fromList [ClientId {client = "1"}] + fromList [ClientId 1] ), ( Id (fromJust (UUID.fromString "00000001-0000-0000-0000-000100000001")), - fromList [ClientId {client = "1"}] + fromList [ClientId 1] ), (Id (fromJust (UUID.fromString "00000001-0000-0001-0000-000000000000")), fromList []), (Id (fromJust (UUID.fromString "00000001-0000-0001-0000-000100000001")), fromList []) diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/UserLegalHoldStatusResponse_team.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/UserLegalHoldStatusResponse_team.hs index 1cc2314fed..773d5035f3 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/UserLegalHoldStatusResponse_team.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/UserLegalHoldStatusResponse_team.hs @@ -17,7 +17,7 @@ module Test.Wire.API.Golden.Generated.UserLegalHoldStatusResponse_team where -import Data.Id (ClientId (ClientId, client)) +import Data.Id import Data.LegalHold ( UserLegalHoldStatus ( UserLegalHoldDisabled, @@ -34,7 +34,7 @@ testObject_UserLegalHoldStatusResponse_team_1 = UserLegalHoldStatusResponse { ulhsrStatus = UserLegalHoldDisabled, ulhsrLastPrekey = Just (lastPrekey "\39669\&9\ENQ\1016886\11258\\3\62960x\25215"), - ulhsrClientId = Just (ClientId {client = "97"}) + ulhsrClientId = Just (ClientId 0x97) } testObject_UserLegalHoldStatusResponse_team_2 :: UserLegalHoldStatusResponse @@ -42,7 +42,7 @@ testObject_UserLegalHoldStatusResponse_team_2 = UserLegalHoldStatusResponse { ulhsrStatus = UserLegalHoldDisabled, ulhsrLastPrekey = Just (lastPrekey "\111141L,"), - ulhsrClientId = Just (ClientId {client = "46"}) + ulhsrClientId = Just (ClientId 0x46) } testObject_UserLegalHoldStatusResponse_team_3 :: UserLegalHoldStatusResponse @@ -50,7 +50,7 @@ testObject_UserLegalHoldStatusResponse_team_3 = UserLegalHoldStatusResponse { ulhsrStatus = UserLegalHoldEnabled, ulhsrLastPrekey = Just (lastPrekey "W\1042917z\1923\GS"), - ulhsrClientId = Just (ClientId {client = "6d"}) + ulhsrClientId = Just (ClientId 0x6d) } testObject_UserLegalHoldStatusResponse_team_4 :: UserLegalHoldStatusResponse @@ -62,7 +62,7 @@ testObject_UserLegalHoldStatusResponse_team_5 = UserLegalHoldStatusResponse { ulhsrStatus = UserLegalHoldEnabled, ulhsrLastPrekey = Just (lastPrekey "?\tvSq"), - ulhsrClientId = Just (ClientId {client = "12"}) + ulhsrClientId = Just (ClientId 0x12) } testObject_UserLegalHoldStatusResponse_team_6 :: UserLegalHoldStatusResponse @@ -70,7 +70,7 @@ testObject_UserLegalHoldStatusResponse_team_6 = UserLegalHoldStatusResponse { ulhsrStatus = UserLegalHoldEnabled, ulhsrLastPrekey = Nothing, - ulhsrClientId = Just (ClientId {client = "50"}) + ulhsrClientId = Just (ClientId 0x50) } testObject_UserLegalHoldStatusResponse_team_7 :: UserLegalHoldStatusResponse @@ -78,7 +78,7 @@ testObject_UserLegalHoldStatusResponse_team_7 = UserLegalHoldStatusResponse { ulhsrStatus = UserLegalHoldEnabled, ulhsrLastPrekey = Just (lastPrekey ""), - ulhsrClientId = Just (ClientId {client = "63"}) + ulhsrClientId = Just (ClientId 0x63) } testObject_UserLegalHoldStatusResponse_team_8 :: UserLegalHoldStatusResponse @@ -90,7 +90,7 @@ testObject_UserLegalHoldStatusResponse_team_9 = UserLegalHoldStatusResponse { ulhsrStatus = UserLegalHoldEnabled, ulhsrLastPrekey = Nothing, - ulhsrClientId = Just (ClientId {client = "a9"}) + ulhsrClientId = Just (ClientId 0xa9) } testObject_UserLegalHoldStatusResponse_team_10 :: UserLegalHoldStatusResponse @@ -98,7 +98,7 @@ testObject_UserLegalHoldStatusResponse_team_10 = UserLegalHoldStatusResponse { ulhsrStatus = UserLegalHoldPending, ulhsrLastPrekey = Nothing, - ulhsrClientId = Just (ClientId {client = "2e"}) + ulhsrClientId = Just (ClientId 0x2e) } testObject_UserLegalHoldStatusResponse_team_11 :: UserLegalHoldStatusResponse @@ -150,7 +150,7 @@ testObject_UserLegalHoldStatusResponse_team_17 = UserLegalHoldStatusResponse { ulhsrStatus = UserLegalHoldDisabled, ulhsrLastPrekey = Just (lastPrekey "\NAK \GS\1080662\&9,'<\a\8244"), - ulhsrClientId = Just (ClientId {client = "7a"}) + ulhsrClientId = Just (ClientId 0x7a) } testObject_UserLegalHoldStatusResponse_team_18 :: UserLegalHoldStatusResponse @@ -158,7 +158,7 @@ testObject_UserLegalHoldStatusResponse_team_18 = UserLegalHoldStatusResponse { ulhsrStatus = UserLegalHoldPending, ulhsrLastPrekey = Just (lastPrekey "Z"), - ulhsrClientId = Just (ClientId {client = "ba"}) + ulhsrClientId = Just (ClientId 0xba) } testObject_UserLegalHoldStatusResponse_team_19 :: UserLegalHoldStatusResponse @@ -166,7 +166,7 @@ testObject_UserLegalHoldStatusResponse_team_19 = UserLegalHoldStatusResponse { ulhsrStatus = UserLegalHoldEnabled, ulhsrLastPrekey = Just (lastPrekey ""), - ulhsrClientId = Just (ClientId {client = "88"}) + ulhsrClientId = Just (ClientId 0x88) } testObject_UserLegalHoldStatusResponse_team_20 :: UserLegalHoldStatusResponse diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Manual/SubConversation.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Manual/SubConversation.hs index f885593fa4..72810686d4 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Manual/SubConversation.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Manual/SubConversation.hs @@ -83,4 +83,4 @@ testObject_PublicSubConversation_2 = ( Id (fromJust (UUID.fromString "00000000-0000-0007-0000-000a00000002")) ) domain - cid = ClientId "deadbeef" + cid = ClientId 0xdeadbeef diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Manual/UserClientPrekeyMap.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Manual/UserClientPrekeyMap.hs index 5eb55b5a8c..dea59e8ea8 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Manual/UserClientPrekeyMap.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Manual/UserClientPrekeyMap.hs @@ -31,10 +31,10 @@ testObject_UserClientPrekeyMap_1 = (mkUserClientPrekeyMap . fromList) [ ( Id (fromJust (UUID.fromString "00000552-0000-7ae9-0000-5c84000004dd")), fromList - [ (ClientId {client = "0"}, Just testObject_Prekey_user_1), - (ClientId {client = "1"}, Just testObject_Prekey_user_2), - (ClientId {client = "3"}, Nothing), - (ClientId {client = "4"}, Just testObject_Prekey_user_14) + [ (ClientId 0, Just testObject_Prekey_user_1), + (ClientId 1, Just testObject_Prekey_user_2), + (ClientId 3, Nothing), + (ClientId 4, Just testObject_Prekey_user_14) ] ) ] @@ -43,10 +43,10 @@ testObject_UserClientPrekeyMap_2 :: UserClientPrekeyMap testObject_UserClientPrekeyMap_2 = (mkUserClientPrekeyMap . fromList) [ ( Id (fromJust (UUID.fromString "00000025-0000-0025-0000-00660000001d")), - fromList [(ClientId {client = "3"}, Just testObject_Prekey_user_7), (ClientId {client = "9"}, Just testObject_Prekey_user_9)] + fromList [(ClientId 3, Just testObject_Prekey_user_7), (ClientId 9, Just testObject_Prekey_user_9)] ), ( Id (fromJust (UUID.fromString "00000038-0000-004a-0000-007700000000")), - fromList [(ClientId {client = "dfd"}, Just testObject_Prekey_user_15)] + fromList [(ClientId 0xdfd, Just testObject_Prekey_user_15)] ) ] @@ -54,13 +54,13 @@ testObject_UserClientPrekeyMap_3 :: UserClientPrekeyMap testObject_UserClientPrekeyMap_3 = (mkUserClientPrekeyMap . fromList) [ ( Id (fromJust (UUID.fromString "0000000e-0000-001d-0000-00160000000b")), - fromList [(ClientId {client = "0"}, Just testObject_Prekey_user_11), (ClientId {client = "1"}, Just testObject_Prekey_user_1)] + fromList [(ClientId 0, Just testObject_Prekey_user_11), (ClientId 1, Just testObject_Prekey_user_1)] ), ( Id (fromJust (UUID.fromString "00000013-0000-000d-0000-000600000007")), - fromList [(ClientId {client = "4"}, Just testObject_Prekey_user_6), (ClientId {client = "9"}, Just testObject_Prekey_user_8)] + fromList [(ClientId 4, Just testObject_Prekey_user_6), (ClientId 9, Just testObject_Prekey_user_8)] ), ( Id (fromJust (UUID.fromString "00000018-0000-0020-0000-000e00000002")), - fromList [(ClientId {client = "0"}, Just testObject_Prekey_user_10), (ClientId {client = "1"}, Just testObject_Prekey_user_5)] + fromList [(ClientId 0, Just testObject_Prekey_user_10), (ClientId 1, Just testObject_Prekey_user_5)] ) ] @@ -69,14 +69,14 @@ testObject_UserClientPrekeyMap_4 = (mkUserClientPrekeyMap . fromList) [ (Id (fromJust (UUID.fromString "00000000-0000-0003-0000-000100000000")), fromList []), ( Id (fromJust (UUID.fromString "00000003-0000-0002-0000-000500000002")), - fromList [(ClientId {client = "0"}, Just testObject_Prekey_user_1), (ClientId {client = "1"}, Just testObject_Prekey_user_20)] + fromList [(ClientId 0, Just testObject_Prekey_user_1), (ClientId 1, Just testObject_Prekey_user_20)] ), ( Id (fromJust (UUID.fromString "00000003-0000-0005-0000-000800000001")), - fromList [(ClientId {client = "0"}, Just testObject_Prekey_user_6), (ClientId {client = "1"}, Just testObject_Prekey_user_4)] + fromList [(ClientId 0, Just testObject_Prekey_user_6), (ClientId 1, Just testObject_Prekey_user_4)] ), (Id (fromJust (UUID.fromString "00000004-0000-0003-0000-000300000008")), fromList []), ( Id (fromJust (UUID.fromString "00000007-0000-0008-0000-000100000006")), - fromList [(ClientId {client = "0"}, Just testObject_Prekey_user_13), (ClientId {client = "3"}, Just testObject_Prekey_user_9)] + fromList [(ClientId 0, Just testObject_Prekey_user_13), (ClientId 3, Just testObject_Prekey_user_9)] ) ] @@ -84,14 +84,14 @@ testObject_UserClientPrekeyMap_5 :: UserClientPrekeyMap testObject_UserClientPrekeyMap_5 = (mkUserClientPrekeyMap . fromList) [ ( Id (fromJust (UUID.fromString "00000000-0000-0004-0000-000400000005")), - fromList [(ClientId {client = "17"}, Nothing)] + fromList [(ClientId 0x17, Nothing)] ), ( Id (fromJust (UUID.fromString "00000003-0000-0006-0000-000100000000")), - fromList [(ClientId {client = "2"}, Just testObject_Prekey_user_5)] + fromList [(ClientId 2, Just testObject_Prekey_user_5)] ), (Id (fromJust (UUID.fromString "00000006-0000-0008-0000-000600000003")), fromList []), ( Id (fromJust (UUID.fromString "00000008-0000-0008-0000-000300000008")), - fromList [(ClientId {client = "0"}, Just testObject_Prekey_user_19), (ClientId {client = "1"}, Just testObject_Prekey_user_18)] + fromList [(ClientId 0, Just testObject_Prekey_user_19), (ClientId 1, Just testObject_Prekey_user_18)] ) ] @@ -99,10 +99,10 @@ testObject_UserClientPrekeyMap_6 :: UserClientPrekeyMap testObject_UserClientPrekeyMap_6 = (mkUserClientPrekeyMap . fromList) [ ( Id (fromJust (UUID.fromString "0000004d-0000-001f-0000-006300000073")), - fromList [(ClientId {client = "1"}, Just testObject_Prekey_user_7), (ClientId {client = "2"}, Just testObject_Prekey_user_8), (ClientId {client = "4"}, Just testObject_Prekey_user_2)] + fromList [(ClientId 1, Just testObject_Prekey_user_7), (ClientId 2, Just testObject_Prekey_user_8), (ClientId 4, Just testObject_Prekey_user_2)] ), ( Id (fromJust (UUID.fromString "0000007c-0000-0075-0000-006000000025")), - fromList [(ClientId {client = "8"}, Just testObject_Prekey_user_19), (ClientId {client = "c"}, Nothing), (ClientId {client = "f"}, Just testObject_Prekey_user_3)] + fromList [(ClientId 8, Just testObject_Prekey_user_19), (ClientId 0xc, Nothing), (ClientId 0xf, Just testObject_Prekey_user_3)] ) ] @@ -110,20 +110,20 @@ testObject_UserClientPrekeyMap_7 :: UserClientPrekeyMap testObject_UserClientPrekeyMap_7 = (mkUserClientPrekeyMap . fromList) [ ( Id (fromJust (UUID.fromString "00000000-0000-0000-0000-000200000000")), - fromList [(ClientId {client = "0"}, Just testObject_Prekey_user_19)] + fromList [(ClientId 0, Just testObject_Prekey_user_19)] ), (Id (fromJust (UUID.fromString "00000000-0000-0001-0000-000000000001")), fromList []), ( Id (fromJust (UUID.fromString "00000000-0000-0002-0000-000200000002")), - fromList [(ClientId {client = "0"}, Nothing)] + fromList [(ClientId 0, Nothing)] ), ( Id (fromJust (UUID.fromString "00000001-0000-0001-0000-000000000001")), - fromList [(ClientId {client = "0"}, Just testObject_Prekey_user_19), (ClientId {client = "1"}, Just testObject_Prekey_user_19)] + fromList [(ClientId 0, Just testObject_Prekey_user_19), (ClientId 1, Just testObject_Prekey_user_19)] ), ( Id (fromJust (UUID.fromString "00000001-0000-0002-0000-000100000001")), - fromList [(ClientId {client = "0"}, Just testObject_Prekey_user_2), (ClientId {client = "1"}, Just testObject_Prekey_user_19)] + fromList [(ClientId 0, Just testObject_Prekey_user_2), (ClientId 1, Just testObject_Prekey_user_19)] ), ( Id (fromJust (UUID.fromString "00000002-0000-0000-0000-000000000001")), - fromList [(ClientId {client = "2"}, Just testObject_Prekey_user_18)] + fromList [(ClientId 2, Just testObject_Prekey_user_18)] ), (Id (fromJust (UUID.fromString "00000002-0000-0001-0000-000000000002")), fromList []) ] @@ -136,6 +136,6 @@ testObject_UserClientPrekeyMap_9 = (mkUserClientPrekeyMap . fromList) [ (Id (fromJust (UUID.fromString "00000054-0000-003b-0000-00210000005f")), fromList []), ( Id (fromJust (UUID.fromString "00000065-0000-0040-0000-005f00000064")), - fromList [(ClientId {client = "0"}, Just testObject_Prekey_user_13), (ClientId {client = "1"}, Just testObject_Prekey_user_2), (ClientId {client = "2"}, Nothing)] + fromList [(ClientId 0, Just testObject_Prekey_user_13), (ClientId 1, Just testObject_Prekey_user_2), (ClientId 2, Nothing)] ) ] diff --git a/libs/wire-api/test/golden/testObject_QualifiedUserClientPrekeyMapV4_2.json b/libs/wire-api/test/golden/testObject_QualifiedUserClientPrekeyMapV4_2.json index ac608bf31e..1da1f90e2a 100644 --- a/libs/wire-api/test/golden/testObject_QualifiedUserClientPrekeyMapV4_2.json +++ b/libs/wire-api/test/golden/testObject_QualifiedUserClientPrekeyMapV4_2.json @@ -1,9 +1,9 @@ { "qualified_user_client_prekeys" : { "example.com" : { "44f9c51e-0dce-4e7f-85ba-b4e5a545ce68" : { - "0123456789ABCEF" : null + "123456789abcef" : null } } } , "failed_to_list" : [] -} \ No newline at end of file +} diff --git a/libs/wire-api/test/golden/testObject_UserClients_user_14.json b/libs/wire-api/test/golden/testObject_UserClients_user_14.json index 1afefe4b4b..409676f61d 100644 --- a/libs/wire-api/test/golden/testObject_UserClients_user_14.json +++ b/libs/wire-api/test/golden/testObject_UserClients_user_14.json @@ -1,7 +1,7 @@ { "00001130-0000-01e5-0000-3c24000015c6": [ + "a", "18", - "1f", - "a" + "1f" ] } diff --git a/libs/wire-api/test/unit/Test/Wire/API/MLS.hs b/libs/wire-api/test/unit/Test/Wire/API/MLS.hs index 348dbc4fdc..ea8a6b38ad 100644 --- a/libs/wire-api/test/unit/Test/Wire/API/MLS.hs +++ b/libs/wire-api/test/unit/Test/Wire/API/MLS.hs @@ -204,13 +204,13 @@ testKeyPackageRef = do testRemoveProposalMessageSignature :: IO () testRemoveProposalMessageSignature = withSystemTempDirectory "mls" $ \tmp -> do qcid <- do - let c = newClientId 0x3ae58155 + let c = ClientId 0x3ae58155 usr <- flip Qualified (Domain "example.com") <$> (Id <$> UUID.nextRandom) pure (userClientQid usr c) void $ spawn (cli qcid tmp ["init", qcid]) Nothing qcid2 <- do - let c = newClientId 0x4ae58157 + let c = ClientId 0x4ae58157 usr <- flip Qualified (Domain "example.com") <$> (Id <$> UUID.nextRandom) pure (userClientQid usr c) void $ spawn (cli qcid2 tmp ["init", qcid2]) Nothing @@ -282,7 +282,7 @@ userClientQid :: Qualified UserId -> ClientId -> String userClientQid usr c = show (qUnqualified usr) <> ":" - <> T.unpack c.client + <> T.unpack (clientToText c) <> "@" <> T.unpack (domainText (qDomain usr)) @@ -311,5 +311,5 @@ cli store tmp args = randomIdentity :: IO ClientIdentity randomIdentity = do uid <- Id <$> UUID.nextRandom - c <- newClientId <$> randomIO + c <- ClientId <$> randomIO pure $ ClientIdentity (Domain "mls.example.com") uid c diff --git a/services/brig/src/Brig/API/Public.hs b/services/brig/src/Brig/API/Public.hs index f8354d0ef4..0798907a03 100644 --- a/services/brig/src/Brig/API/Public.hs +++ b/services/brig/src/Brig/API/Public.hs @@ -81,7 +81,8 @@ import Data.CommaSeparatedList import Data.Domain import Data.FileEmbed import Data.Handle (Handle, parseHandle) -import Data.Id as Id +import Data.Id +import Data.Id qualified as Id import Data.List.NonEmpty (nonEmpty) import Data.Map.Strict qualified as Map import Data.Misc (IpAddr (..)) @@ -644,7 +645,7 @@ newNonce :: UserId -> ClientId -> (Handler r) (Nonce, CacheControl) newNonce uid cid = do ttl <- setNonceTtlSecs <$> view settings nonce <- randomNonce - lift $ wrapClient $ Nonce.insertNonce ttl uid (client cid) nonce + lift $ wrapClient $ Nonce.insertNonce ttl uid (Id.clientToText cid) nonce pure (nonce, NoStore) createAccessToken :: diff --git a/services/brig/src/Brig/Data/Client.hs b/services/brig/src/Brig/Data/Client.hs index cc0c7eb58c..bc7aaed3b8 100644 --- a/services/brig/src/Brig/Data/Client.hs +++ b/services/brig/src/Brig/Data/Client.hs @@ -486,7 +486,7 @@ ddbVersion :: Text ddbVersion = "version" ddbKey :: UserId -> ClientId -> AWS.AttributeValue -ddbKey u c = AWS.S (UUID.toText (toUUID u) <> "." <> client c) +ddbKey u c = AWS.S (UUID.toText (toUUID u) <> "." <> clientToText c) key :: UserId -> ClientId -> HashMap Text AWS.AttributeValue key u c = HashMap.singleton ddbClient (ddbKey u c) diff --git a/services/brig/src/Brig/Effects/JwtTools.hs b/services/brig/src/Brig/Effects/JwtTools.hs index 759231ffa4..e4f0a23a9e 100644 --- a/services/brig/src/Brig/Effects/JwtTools.hs +++ b/services/brig/src/Brig/Effects/JwtTools.hs @@ -6,7 +6,7 @@ import Brig.API.Types (CertEnrollmentError (..)) import Control.Monad.Trans.Except import Data.ByteString.Conversion import Data.Either.Extra -import Data.Id (ClientId (client)) +import Data.Id import Data.Jwt.Tools qualified as Jwt import Data.Misc (HttpsUrl) import Data.Nonce (Nonce) @@ -47,7 +47,7 @@ makeSem ''JwtTools interpretJwtTools :: Member (Embed IO) r => Sem (JwtTools ': r) a -> Sem r a interpretJwtTools = interpret $ \(GenerateDPoPAccessToken pr ci n uri method skew ex now pem) -> do - case readHex @Word64 (cs $ client $ ciClient ci) of + case readHex @Word64 (cs $ clientToText $ ciClient ci) of [(parsedClientId, "")] -> mapLeft RustError <$> runExceptT diff --git a/services/brig/src/Brig/Provider/API.hs b/services/brig/src/Brig/Provider/API.hs index 6291aa84f6..5a5c7f9485 100644 --- a/services/brig/src/Brig/Provider/API.hs +++ b/services/brig/src/Brig/Provider/API.hs @@ -675,7 +675,7 @@ addBot zuid zcon cid add = do bid <- BotId <$> randomId domain <- viewFederationDomain btk <- Text.decodeLatin1 . toByteString' <$> ZAuth.newBotToken pid bid cid - let bcl = newClientId (fromIntegral (hash bid)) + let bcl = ClientId (fromIntegral (hash bid)) -- Ask the external service to create a bot let zQualifiedUid = Qualified zuid domain let origmem = OtherMember zQualifiedUid Nothing roleNameWireAdmin diff --git a/services/brig/src/Brig/ZAuth.hs b/services/brig/src/Brig/ZAuth.hs index 563540ba01..14e714bd33 100644 --- a/services/brig/src/Brig/ZAuth.hs +++ b/services/brig/src/Brig/ZAuth.hs @@ -92,11 +92,11 @@ import Data.Aeson import Data.Bits import Data.ByteString qualified as BS import Data.ByteString.Conversion -import Data.Id hiding (client) -import Data.Id qualified +import Data.Id import Data.List.NonEmpty (NonEmpty, nonEmpty) import Data.List.NonEmpty qualified as NonEmpty import Data.Proxy +import Data.Text.Encoding qualified as T import Data.Time.Clock import Data.Time.Clock.POSIX import Data.ZAuth.Creation qualified as ZC @@ -291,7 +291,7 @@ mkUserToken' u cid r t = liftZAuth $ do z <- ask liftIO $ ZC.runCreate (z ^. private) (z ^. settings . keyIndex) $ - ZC.newToken (utcTimeToPOSIXSeconds t) U Nothing (mkUser (toUUID u) (fmap Data.Id.client cid) r) + ZC.newToken (utcTimeToPOSIXSeconds t) U Nothing (mkUser (toUUID u) (fmap clientToText cid) r) newUserToken' :: MonadZAuth m => UserId -> Maybe ClientId -> m (Token User) newUserToken' u c = liftZAuth $ do @@ -300,7 +300,7 @@ newUserToken' u c = liftZAuth $ do liftIO $ ZC.runCreate (z ^. private) (z ^. settings . keyIndex) $ let UserTokenTimeout ttl = z ^. settings . userTokenTimeout - in ZC.userToken ttl (toUUID u) (fmap Data.Id.client c) r + in ZC.userToken ttl (toUUID u) (fmap clientToText c) r newSessionToken' :: MonadZAuth m => UserId -> Maybe ClientId -> m (Token User) newSessionToken' u c = liftZAuth $ do @@ -309,7 +309,7 @@ newSessionToken' u c = liftZAuth $ do liftIO $ ZC.runCreate (z ^. private) (z ^. settings . keyIndex) $ let SessionTokenTimeout ttl = z ^. settings . sessionTokenTimeout - in ZC.sessionToken ttl (toUUID u) (fmap Data.Id.client c) r + in ZC.sessionToken ttl (toUUID u) (fmap clientToText c) r newAccessToken' :: MonadZAuth m => Token User -> m (Token Access) newAccessToken' xt = liftZAuth $ do @@ -329,7 +329,7 @@ renewAccessToken' mcid old = liftZAuth $ do ttl (old ^. header) ( clientId - .~ fmap Data.Id.client mcid + .~ fmap clientToText mcid $ (old ^. body) ) @@ -369,7 +369,7 @@ mkLegalHoldUserToken u c r t = liftZAuth $ do (utcTimeToPOSIXSeconds t) LU Nothing - (mkLegalHoldUser (toUUID u) (fmap Data.Id.client c) r) + (mkLegalHoldUser (toUUID u) (fmap clientToText c) r) newLegalHoldUserToken :: MonadZAuth m => UserId -> Maybe ClientId -> m (Token LegalHoldUser) newLegalHoldUserToken u c = liftZAuth $ do @@ -378,7 +378,7 @@ newLegalHoldUserToken u c = liftZAuth $ do liftIO $ ZC.runCreate (z ^. private) (z ^. settings . keyIndex) $ let LegalHoldUserTokenTimeout ttl = z ^. settings . legalHoldUserTokenTimeout - in ZC.legalHoldUserToken ttl (toUUID u) (fmap Data.Id.client c) r + in ZC.legalHoldUserToken ttl (toUUID u) (fmap clientToText c) r newLegalHoldAccessToken :: MonadZAuth m => Token LegalHoldUser -> m (Token LegalHoldAccess) newLegalHoldAccessToken xt = liftZAuth $ do @@ -418,25 +418,25 @@ accessTokenOf' :: Token Access -> UserId accessTokenOf' t = Id (t ^. body . userId) accessTokenClient' :: Token Access -> Maybe ClientId -accessTokenClient' t = fmap ClientId (t ^. body . clientId) +accessTokenClient' t = fromByteString . T.encodeUtf8 =<< t ^. body . clientId userTokenOf' :: Token User -> UserId userTokenOf' t = Id (t ^. body . user) userTokenClient' :: Token User -> Maybe ClientId -userTokenClient' t = fmap ClientId (t ^. body . client) +userTokenClient' t = fromByteString . T.encodeUtf8 =<< t ^. body . client legalHoldAccessTokenOf :: Token LegalHoldAccess -> UserId legalHoldAccessTokenOf t = Id (t ^. body . legalHoldAccess . userId) legalHoldAccessTokenClient :: Token LegalHoldAccess -> Maybe ClientId -legalHoldAccessTokenClient t = fmap ClientId (t ^. body . legalHoldAccess . clientId) +legalHoldAccessTokenClient t = fromByteString . T.encodeUtf8 =<< t ^. body . legalHoldAccess . clientId legalHoldUserTokenOf :: Token LegalHoldUser -> UserId legalHoldUserTokenOf t = Id (t ^. body . legalHoldUser . user) legalHoldClientTokenOf :: Token LegalHoldUser -> Maybe ClientId -legalHoldClientTokenOf t = fmap ClientId (t ^. body . legalHoldUser . client) +legalHoldClientTokenOf t = fromByteString . T.encodeUtf8 =<< t ^. body . legalHoldUser . client userTokenRand' :: Token User -> Word32 userTokenRand' t = t ^. body . rand diff --git a/services/brig/test/integration/API/Internal/Util.hs b/services/brig/test/integration/API/Internal/Util.hs index ab6824f4d7..5a55b04461 100644 --- a/services/brig/test/integration/API/Internal/Util.hs +++ b/services/brig/test/integration/API/Internal/Util.hs @@ -115,7 +115,7 @@ scaffolding brig gundeck = do randomToken :: m PushToken.PushToken randomToken = liftIO $ do - c <- liftIO $ newClientId <$> (randomIO :: IO Word64) + c <- liftIO $ ClientId <$> (randomIO :: IO Word64) tok <- (PushToken.Token . T.decodeUtf8) . B16.encode <$> randomBytes 32 pure $ PushToken.pushToken PushToken.APNSSandbox (PushToken.AppName "test") tok c diff --git a/services/brig/test/integration/API/Provider.hs b/services/brig/test/integration/API/Provider.hs index 3e8e5e8648..f9982d7601 100644 --- a/services/brig/test/integration/API/Provider.hs +++ b/services/brig/test/integration/API/Provider.hs @@ -43,7 +43,7 @@ import Data.ByteString.Lazy.Char8 qualified as LC8 import Data.Domain import Data.Handle (Handle (Handle)) import Data.HashMap.Strict qualified as HashMap -import Data.Id hiding (client) +import Data.Id import Data.Json.Util (toBase64Text) import Data.List1 (List1) import Data.List1 qualified as List1 diff --git a/services/brig/test/integration/API/Team.hs b/services/brig/test/integration/API/Team.hs index 1690a8a3d5..946c4f7e1e 100644 --- a/services/brig/test/integration/API/Team.hs +++ b/services/brig/test/integration/API/Team.hs @@ -36,7 +36,7 @@ import Data.Aeson import Data.ByteString.Conversion import Data.ByteString.Lazy (toStrict) import Data.Either.Extra (eitherToMaybe) -import Data.Id hiding (client) +import Data.Id import Data.Json.Util (UTCTimeMillis, toUTCTimeMillis) import Data.LegalHold (UserLegalHoldStatus (UserLegalHoldDisabled)) import Data.Text qualified as Text diff --git a/services/brig/test/integration/API/Team/Util.hs b/services/brig/test/integration/API/Team/Util.hs index 161902c4bc..dc02b59818 100644 --- a/services/brig/test/integration/API/Team/Util.hs +++ b/services/brig/test/integration/API/Team/Util.hs @@ -29,7 +29,7 @@ import Control.Monad.Catch (MonadCatch) import Data.Aeson hiding (json) import Data.Aeson.Lens import Data.ByteString.Conversion -import Data.Id hiding (client) +import Data.Id import Data.Misc (Milliseconds) import Data.Range import Data.Set qualified as Set diff --git a/services/brig/test/integration/API/User/Account.hs b/services/brig/test/integration/API/User/Account.hs index 15c7c662e1..4d82aa1382 100644 --- a/services/brig/test/integration/API/User/Account.hs +++ b/services/brig/test/integration/API/User/Account.hs @@ -46,7 +46,7 @@ import Data.ByteString.Char8 (pack) import Data.ByteString.Conversion import Data.Domain import Data.Handle -import Data.Id hiding (client) +import Data.Id import Data.Json.Util (fromUTCTimeMillis) import Data.LegalHold import Data.List.NonEmpty qualified as NonEmpty diff --git a/services/brig/test/integration/API/User/Client.hs b/services/brig/test/integration/API/User/Client.hs index f474f65cd7..106d06c6b8 100644 --- a/services/brig/test/integration/API/User/Client.hs +++ b/services/brig/test/integration/API/User/Client.hs @@ -52,6 +52,7 @@ import Data.Qualified (Qualified (..)) import Data.Range (unsafeRange) import Data.Set qualified as Set import Data.Text.Ascii (AsciiChars (validate), encodeBase64UrlUnpadded, toText) +import Data.Text.Encoding qualified as T import Data.Time (addUTCTime) import Data.Time.Clock.POSIX import Data.UUID (toByteString) @@ -478,7 +479,9 @@ testClientsWithoutPrekeys brig cannon db opts = do let ob = Object $ List1.head (ntfPayload n) ob ^? key "type" . _String @?= Just "user.client-remove" - fmap ClientId (ob ^? key "client" . key "id" . _String) + ( fromByteString . T.encodeUtf8 + =<< (ob ^? key "client" . key "id" . _String) + ) @?= Just (clientId c11) post @@ -568,7 +571,7 @@ testClientsWithoutPrekeysV4 brig cannon db opts = do let ob = Object $ List1.head (ntfPayload n) ob ^? key "type" . _String @?= Just "user.client-remove" - fmap ClientId (ob ^? key "client" . key "id" . _String) + (fromByteString . T.encodeUtf8 =<< (ob ^? key "client" . key "id" . _String)) @?= Just (clientId c11) post @@ -670,7 +673,7 @@ testClientsWithoutPrekeysFailToListV4 brig cannon db opts = do let ob = Object $ List1.head (ntfPayload n) ob ^? key "type" . _String @?= Just "user.client-remove" - fmap ClientId (ob ^? key "client" . key "id" . _String) + (fromByteString . T.encodeUtf8 =<< (ob ^? key "client" . key "id" . _String)) @?= Just (clientId c11) post @@ -1015,7 +1018,7 @@ testRemoveClient hasPwd brig cannon = do let etype = j ^? key "type" . _String let eclient = j ^? key "client" . key "id" . _String etype @?= Just "user.client-remove" - fmap ClientId eclient @?= Just (clientId c) + (fromByteString . T.encodeUtf8 =<< eclient) @?= Just (clientId c) -- Not found on retry deleteClient brig uid (clientId c) Nothing !!! const 404 === statusCode -- Prekeys are gone @@ -1334,7 +1337,7 @@ testAddMultipleTemporary brig galley cannon = do let etype = j ^? key "type" . _String let eclient = j ^? key "client" . key "id" . _String etype @?= Just "user.client-remove" - fmap ClientId eclient @?= Just (clientId client) + (fromByteString . T.encodeUtf8 =<< eclient) @?= Just (clientId client) galleyClients2 <- numOfGalleyClients uid liftIO $ assertEqual "Too many clients found" (Just 1) galleyClients2 diff --git a/services/brig/test/integration/API/User/Connection.hs b/services/brig/test/integration/API/User/Connection.hs index 972d4ddeda..f00bcb69db 100644 --- a/services/brig/test/integration/API/User/Connection.hs +++ b/services/brig/test/integration/API/User/Connection.hs @@ -31,7 +31,7 @@ import Cassandra qualified as DB import Control.Arrow ((&&&)) import Data.ByteString.Conversion import Data.Domain -import Data.Id hiding (client) +import Data.Id import Data.Json.Util (UTCTimeMillis, toUTCTimeMillis) import Data.Qualified import Data.Time.Clock (getCurrentTime) diff --git a/services/brig/test/integration/API/User/Handles.hs b/services/brig/test/integration/API/User/Handles.hs index 7d25305cbf..d8bb4ac98c 100644 --- a/services/brig/test/integration/API/User/Handles.hs +++ b/services/brig/test/integration/API/User/Handles.hs @@ -33,7 +33,7 @@ import Data.Aeson import Data.Aeson.Lens import Data.ByteString.Conversion import Data.Handle (Handle (Handle)) -import Data.Id hiding (client) +import Data.Id import Data.List1 qualified as List1 import Data.Qualified (Qualified (..)) import Data.UUID qualified as UUID diff --git a/services/brig/test/integration/API/User/Util.hs b/services/brig/test/integration/API/User/Util.hs index 49dbacd7a9..1675985ba5 100644 --- a/services/brig/test/integration/API/User/Util.hs +++ b/services/brig/test/integration/API/User/Util.hs @@ -41,7 +41,7 @@ import Data.ByteString.Conversion import Data.ByteString.Lazy qualified as LB import Data.Domain import Data.Handle (Handle (Handle)) -import Data.Id hiding (client) +import Data.Id import Data.Kind import Data.List1 qualified as List1 import Data.Misc diff --git a/services/brig/test/integration/Util.hs b/services/brig/test/integration/Util.hs index f907597ccc..cd303231d8 100644 --- a/services/brig/test/integration/Util.hs +++ b/services/brig/test/integration/Util.hs @@ -962,7 +962,7 @@ somePrekeys = -- | The client ID of the first of 'someLastPrekeys' someClientId :: ClientId -someClientId = ClientId "1dbfbe22c8a35cb2" +someClientId = ClientId 0x1dbfbe22c8a35cb2 someLastPrekeys :: [LastPrekey] someLastPrekeys = diff --git a/services/brig/test/unit/Test/Brig/InternalNotification.hs b/services/brig/test/unit/Test/Brig/InternalNotification.hs index a3a3603ab8..696863fe70 100644 --- a/services/brig/test/unit/Test/Brig/InternalNotification.hs +++ b/services/brig/test/unit/Test/Brig/InternalNotification.hs @@ -20,7 +20,7 @@ module Test.Brig.InternalNotification where import Brig.InternalEvent.Types (InternalNotification (..)) import Data.Aeson qualified as A import Data.ByteString.Lazy as BSL -import Data.Id (client) +import Data.Id (clientToText) import Imports import Test.Tasty import Test.Tasty.HUnit @@ -41,5 +41,5 @@ checkGolden = do Right n -> case n of DeleteClient cid _uid _mcon -> - client cid @?= "1" + clientToText cid @?= "1" _ -> assertFailure "Unexpected value" diff --git a/services/cannon/src/Cannon/API/Internal.hs b/services/cannon/src/Cannon/API/Internal.hs index 7e7734919a..ce44b90a54 100644 --- a/services/cannon/src/Cannon/API/Internal.hs +++ b/services/cannon/src/Cannon/API/Internal.hs @@ -26,7 +26,7 @@ import Cannon.Types import Cannon.WS import Control.Monad.Catch import Data.Aeson (encode) -import Data.Id hiding (client) +import Data.Id import Imports import Network.WebSockets import Servant diff --git a/services/galley/src/Galley/Cassandra/Queries.hs b/services/galley/src/Galley/Cassandra/Queries.hs index c590401360..560d8d9a19 100644 --- a/services/galley/src/Galley/Cassandra/Queries.hs +++ b/services/galley/src/Galley/Cassandra/Queries.hs @@ -474,12 +474,12 @@ rmClients = "delete from clients where user = ?" upsertMemberAddClient :: ClientId -> QueryString W (Identity UserId) () upsertMemberAddClient c = - let t = LT.fromStrict (client c) + let t = LT.fromStrict (clientToText c) in QueryString $ "update clients set clients = clients + {'" <> t <> "'} where user = ?" upsertMemberRmClient :: ClientId -> QueryString W (Identity UserId) () upsertMemberRmClient c = - let t = LT.fromStrict (client c) + let t = LT.fromStrict (clientToText c) in QueryString $ "update clients set clients = clients - {'" <> t <> "'} where user = ?" -- MLS Clients -------------------------------------------------------------- diff --git a/services/galley/test/integration/API.hs b/services/galley/test/integration/API.hs index 6f6ed15666..3844b79141 100644 --- a/services/galley/test/integration/API.hs +++ b/services/galley/test/integration/API.hs @@ -687,7 +687,7 @@ postCryptoMessageNotAuthorizeUnknownClient = do -- Unknown client ID => 403 let ciphertext = toBase64Text "hello bob" let m = otrRecipients [(bob, bc, ciphertext)] - postProtoOtrMessage alice (ClientId "172618352518396") conv m + postProtoOtrMessage alice (ClientId 0x172618352518396) conv m !!! const 403 === statusCode -- @SF.Separation @TSFI.RESTfulAPI @S2 diff --git a/services/galley/test/integration/API/Federation.hs b/services/galley/test/integration/API/Federation.hs index 47424e80af..ddc84affa5 100644 --- a/services/galley/test/integration/API/Federation.hs +++ b/services/galley/test/integration/API/Federation.hs @@ -759,10 +759,10 @@ onMessageSent = do eve <- randomUser bob <- randomId conv <- randomId - let fromc = newClientId 0 - aliceC1 = newClientId 0 - aliceC2 = newClientId 1 - eveC = newClientId 0 + let fromc = ClientId 0 + aliceC1 = ClientId 0 + aliceC2 = ClientId 1 + eveC = ClientId 0 bdom = Domain "bob.example.com" qconv = Qualified conv bdom qbob = Qualified bob bdom diff --git a/services/galley/test/integration/API/MLS.hs b/services/galley/test/integration/API/MLS.hs index eff357a58a..c5e05c5164 100644 --- a/services/galley/test/integration/API/MLS.hs +++ b/services/galley/test/integration/API/MLS.hs @@ -223,7 +223,7 @@ postMLSConvFail :: TestM () postMLSConvFail = do qalice <- randomQualifiedUser let alice = qUnqualified qalice - let aliceClient = newClientId 0 + let aliceClient = ClientId 0 bob <- randomUser connectUsers alice (list1 bob []) postConvQualified @@ -241,7 +241,7 @@ postMLSConvOk = do c <- view tsCannon qalice <- randomQualifiedUser let alice = qUnqualified qalice - let aliceClient = newClientId 0 + let aliceClient = ClientId 0 let nameMaxSize = T.replicate 256 "a" WS.bracketR c alice $ \wsA -> do rsp <- @@ -866,9 +866,9 @@ testRemoteToRemoteInSub = do bob <- randomId conv <- randomId let subConvId = SubConvId "conference" - aliceC1 = newClientId 0 - aliceC2 = newClientId 1 - eveC = newClientId 0 + aliceC1 = ClientId 0 + aliceC2 = ClientId 1 + eveC = ClientId 0 bdom = Domain "bob.example.com" qconv = Qualified conv bdom qbob = Qualified bob bdom @@ -1753,7 +1753,7 @@ postMLSConvDisabled = do withMLSDisabled $ postConvQualified (qUnqualified alice) - (Just (newClientId 0)) + (Just (ClientId 0)) defNewMLSConv !!! assertMLSNotEnabled diff --git a/services/galley/test/integration/API/MLS/Util.hs b/services/galley/test/integration/API/MLS/Util.hs index f15e326db3..8cc9b51c60 100644 --- a/services/galley/test/integration/API/MLS/Util.hs +++ b/services/galley/test/integration/API/MLS/Util.hs @@ -89,7 +89,7 @@ cid2Str :: ClientIdentity -> String cid2Str cid = show cid.ciUser <> ":" - <> T.unpack cid.ciClient.client + <> T.unpack (clientToText cid.ciClient) <> "@" <> T.unpack (domainText (ciDomain cid)) diff --git a/services/galley/test/integration/API/Teams.hs b/services/galley/test/integration/API/Teams.hs index 0764e84e45..b31f5cf347 100644 --- a/services/galley/test/integration/API/Teams.hs +++ b/services/galley/test/integration/API/Teams.hs @@ -784,7 +784,7 @@ testCreateTeamMLSConv = do lConvId <- Util.createMLSTeamConv lOwner - (newClientId 0) + (ClientId 0) tid mempty (Just "Team MLS conversation") diff --git a/services/galley/test/integration/API/Util.hs b/services/galley/test/integration/API/Util.hs index 97e3e61d70..a050b333e2 100644 --- a/services/galley/test/integration/API/Util.hs +++ b/services/galley/test/integration/API/Util.hs @@ -66,8 +66,9 @@ import Data.Serialize (runPut) import Data.Set qualified as Set import Data.Singletons import Data.Text qualified as Text +import Data.Text.Encoding qualified as T import Data.Text.Encoding qualified as Text -import Data.Text.Lazy.Encoding qualified as T +import Data.Text.Lazy.Encoding qualified as LT import Data.Time (getCurrentTime) import Data.Tuple.Extra import Data.UUID qualified as UUID @@ -1738,7 +1739,7 @@ wsAssertClientRemoved cid n = do let etype = j ^? key "type" . _String let eclient = j ^? key "client" . key "id" . _String etype @?= Just "user.client-remove" - fmap ClientId eclient @?= Just cid + (fromByteString . T.encodeUtf8 =<< eclient) @?= Just cid wsAssertClientAdded :: HasCallStack => @@ -1750,7 +1751,7 @@ wsAssertClientAdded cid n = do let etype = j ^? key "type" . _String let eclient = j ^? key "client" . key "id" . _String etype @?= Just "user.client-add" - fmap ClientId eclient @?= Just cid + (fromByteString . T.encodeUtf8 =<< eclient) @?= Just cid assertMLSMessageEvent :: HasCallStack => @@ -2419,7 +2420,7 @@ retryWhileN n f m = -- | Changing this will break tests; all prekeys and client Id must match the same -- fingerprint someClientId :: ClientId -someClientId = ClientId "cc6e640e296e8bba" +someClientId = ClientId 0xcc6e640e296e8bba -- | Changing these will break tests; all prekeys and client Id must match the same -- fingerprint @@ -2695,7 +2696,7 @@ makeFedRequestToServant originDomain server fedRequest = do bdy = Wai.simpleBody sresp if HTTP.statusIsSuccessful status then pure bdy - else throw (Mock.MockErrorResponse status (T.decodeUtf8 bdy)) + else throw (Mock.MockErrorResponse status (LT.decodeUtf8 bdy)) where app :: Application app = serve (Proxy @api) server diff --git a/services/gundeck/default.nix b/services/gundeck/default.nix index ddf49dc9fa..ec399622ec 100644 --- a/services/gundeck/default.nix +++ b/services/gundeck/default.nix @@ -188,6 +188,7 @@ mkDerivation { amazonka async base + bytestring-conversion containers exceptions gundeck-types diff --git a/services/gundeck/gundeck.cabal b/services/gundeck/gundeck.cabal index 277c81fea7..b776b03e6d 100644 --- a/services/gundeck/gundeck.cabal +++ b/services/gundeck/gundeck.cabal @@ -455,6 +455,7 @@ test-suite gundeck-tests , amazonka , async , base + , bytestring-conversion , containers , exceptions , gundeck diff --git a/services/gundeck/src/Gundeck/Notification.hs b/services/gundeck/src/Gundeck/Notification.hs index 615ed79c29..a64e347798 100644 --- a/services/gundeck/src/Gundeck/Notification.hs +++ b/services/gundeck/src/Gundeck/Notification.hs @@ -85,4 +85,4 @@ updateActivity uid clt = do Log.warn $ Log.msg ("Could not update client activity" :: ByteString) ~~ "user" .= UUID.toASCIIBytes (toUUID uid) - ~~ "client" .= client clt + ~~ "client" .= clientToText clt diff --git a/services/gundeck/test/bench/Main.hs b/services/gundeck/test/bench/Main.hs index 9b653d1fc8..79fd1d6a9a 100644 --- a/services/gundeck/test/bench/Main.hs +++ b/services/gundeck/test/bench/Main.hs @@ -81,7 +81,7 @@ mkAddress t = do let ept = mkEndpoint t app let tok = Token "test" let con = ConnId "conn" - let clt = ClientId "client" + let clt = ClientId 3265102391 pure $! Address u ept con (pushToken t app tok clt) mkEndpoint :: Transport -> AppName -> EndpointArn diff --git a/services/gundeck/test/integration/API.hs b/services/gundeck/test/integration/API.hs index 051afeb7d0..4ef4bd327b 100644 --- a/services/gundeck/test/integration/API.hs +++ b/services/gundeck/test/integration/API.hs @@ -398,7 +398,7 @@ targetClientPush = do let p = view queuedNotificationPayload (Prelude.head ns) assertEqual "Wrong events in notification" (List1.toNonEmpty (pload c)) p where - pevent c = KeyMap.fromList ["foo" .= client c] + pevent c = KeyMap.fromList ["foo" .= clientToText c] pload c = List1.singleton (pevent c) rcpt u c = recipient u RouteAny @@ -1212,7 +1212,7 @@ randomConnId = pure $ C.pack $ show r randomClientId :: MonadIO m => m ClientId -randomClientId = liftIO $ newClientId <$> (randomIO :: IO Word64) +randomClientId = liftIO $ ClientId <$> (randomIO :: IO Word64) randomBytes :: MonadIO m => Int -> m ByteString randomBytes n = liftIO $ BS.pack <$> replicateM n (randomIO :: IO Word8) diff --git a/services/gundeck/test/unit/MockGundeck.hs b/services/gundeck/test/unit/MockGundeck.hs index 4133be1225..0dacd4e378 100644 --- a/services/gundeck/test/unit/MockGundeck.hs +++ b/services/gundeck/test/unit/MockGundeck.hs @@ -50,6 +50,7 @@ import Data.Aeson import Data.Aeson qualified as Aeson import Data.Aeson.Encode.Pretty qualified as Aeson import Data.Aeson.KeyMap qualified as KeyMap +import Data.ByteString.Conversion import Data.Id import Data.IntMultiSet (IntMultiSet) import Data.IntMultiSet qualified as MSet @@ -297,7 +298,7 @@ genId = do pure . Id . fst $ random gen genClientId :: Gen ClientId -genClientId = newClientId <$> arbitrary +genClientId = ClientId <$> arbitrary genProtoAddress :: HasCallStack => UserId -> ClientId -> Gen Address genProtoAddress _addrUser _addrClient = do @@ -539,7 +540,7 @@ handlePushCass Push {..} handlePushCass Push {..} = do forM_ (fromRange _pushRecipients) $ \(Recipient uid _ cids) -> do let cids' = case cids of - RecipientClientsAll -> [ClientId mempty] + RecipientClientsAll -> [ClientId 0] -- clients are stored in cassandra as a list with a notification. empty list is -- intepreted as "all clients" by 'Gundeck.Notification.Data.toNotif'. (here, we just -- store a specific 'ClientId' that signifies "no client".) @@ -595,7 +596,7 @@ mockStreamAdd _ (toList -> targets) pay _ = clients@(_ : _) -> forM_ clients $ \cid -> msCassQueue %= deliver (tgt ^. targetUser, cid) pay [] -> - msCassQueue %= deliver (tgt ^. targetUser, ClientId mempty) pay + msCassQueue %= deliver (tgt ^. targetUser, ClientId 0) pay mockPushNative :: (HasCallStack, m ~ MockGundeck) => @@ -783,7 +784,7 @@ fakePresence userId clientId_ = Presence {..} -- | See also: 'fakePresence'. fakeConnId :: ClientId -> ConnId -fakeConnId = ConnId . cs . client +fakeConnId = ConnId . cs . clientToText clientIdFromConnId :: ConnId -> ClientId -clientIdFromConnId = ClientId . cs . fromConnId +clientIdFromConnId = fromJust . fromByteString . fromConnId diff --git a/services/gundeck/test/unit/Native.hs b/services/gundeck/test/unit/Native.hs index 030d01c976..500ec668ff 100644 --- a/services/gundeck/test/unit/Native.hs +++ b/services/gundeck/test/unit/Native.hs @@ -164,7 +164,7 @@ mkAddress t = <$> randomId <*> pure (mkEndpoint t (AppName "test")) <*> pure (ConnId "conn") - <*> pure (pushToken t (AppName "test") (Token "test") (ClientId "client")) + <*> pure (pushToken t (AppName "test") (Token "test") (ClientId 0x392c82a0f)) mkEndpoint :: Transport -> AppName -> EndpointArn mkEndpoint t a = mkSnsArn Ireland (Account "test") topic diff --git a/services/spar/test-integration/Util/Email.hs b/services/spar/test-integration/Util/Email.hs index 3e37393ea6..13c8089284 100644 --- a/services/spar/test-integration/Util/Email.hs +++ b/services/spar/test-integration/Util/Email.hs @@ -28,7 +28,7 @@ import Control.Lens (view, (^?)) import Control.Monad.Catch (MonadCatch) import Data.Aeson.Lens import Data.ByteString.Conversion -import Data.Id hiding (client) +import Data.Id import qualified Data.Misc as Misc import qualified Data.Text.Ascii as Ascii import Data.Text.Encoding (encodeUtf8) diff --git a/tools/mlsstats/src/MlsStats/Run.hs b/tools/mlsstats/src/MlsStats/Run.hs index 7132d0b8a9..211933295b 100644 --- a/tools/mlsstats/src/MlsStats/Run.hs +++ b/tools/mlsstats/src/MlsStats/Run.hs @@ -108,7 +108,7 @@ userClient cassandra queryPageSize = do (runClient cassandra) (paginateC userClientCql (paramsP LocalQuorum () queryPageSize) x1) .| concat - .| mapC (\(u, c) -> T.encodeUtf8 $ T.pack (show u) <> "," <> c.client <> "\r\n") + .| mapC (\(u, c) -> T.encodeUtf8 $ T.pack (show u) <> "," <> clientToText c <> "\r\n") ) where userClientCql :: PrepQuery R () (UserId, ClientId) @@ -156,7 +156,7 @@ domainUserClientGroup cassandra queryPageSize = do <> "," <> T.encodeUtf8 (T.pack (show u)) <> "," - <> T.encodeUtf8 (client c) + <> T.encodeUtf8 (clientToText c) <> "," <> BS64.encode (unGroupId g) <> "\r\n"