diff --git a/changelog.d/0-release-notes/client-internal-api b/changelog.d/0-release-notes/client-internal-api new file mode 100644 index 00000000000..d0d44c9b703 --- /dev/null +++ b/changelog.d/0-release-notes/client-internal-api @@ -0,0 +1 @@ +The "addClient" internal endpoint of galley has been changed. This can cause temporary failures during upgrades if brig attempts to use this endpoint on a different version of galley. diff --git a/changelog.d/1-api-changes/client-capabilities b/changelog.d/1-api-changes/client-capabilities new file mode 100644 index 00000000000..7bd98638b78 --- /dev/null +++ b/changelog.d/1-api-changes/client-capabilities @@ -0,0 +1 @@ +Create version 6 of client-related endpoints, fixing an oddity in the serialisation of capabilities. diff --git a/integration/test/Test/Notifications.hs b/integration/test/Test/Notifications.hs index 741d9b10b0a..14078b5b56e 100644 --- a/integration/test/Test/Notifications.hs +++ b/integration/test/Test/Notifications.hs @@ -1,9 +1,11 @@ {-# OPTIONS -Wno-ambiguous-fields #-} module Test.Notifications where +import API.Brig import API.Common import API.Gundeck import API.GundeckInternal +import Notifications import SetupHelpers import Testlib.Prelude @@ -89,3 +91,20 @@ testInvalidNotification = do void $ getNotifications user def {since = Just notifId} >>= getJSON 404 + +-- | Check that client-add notifications use the V5 format: +-- @ +-- "capabilities": { "capabilities": [..] } +-- @ +-- +-- Migration plan: clients must be able to parse both old and new schema starting from V6. Once V5 is deprecated, the backend can start sending notifications in the new form. +testAddClientNotification :: HasCallStack => App () +testAddClientNotification = do + alice <- randomUser OwnDomain def + + e <- withWebSocket alice $ \ws -> do + void $ addClient alice def + n <- awaitMatch isUserClientAddNotif ws + nPayload n + + void $ e %. "client.capabilities.capabilities" & asList diff --git a/libs/wire-api/src/Wire/API/Routes/Public/Brig.hs b/libs/wire-api/src/Wire/API/Routes/Public/Brig.hs index 15b07451e10..0cd23b3c3e3 100644 --- a/libs/wire-api/src/Wire/API/Routes/Public/Brig.hs +++ b/libs/wire-api/src/Wire/API/Routes/Public/Brig.hs @@ -65,6 +65,7 @@ import Wire.API.Routes.Public.Brig.Services (ServicesAPI) import Wire.API.Routes.Public.Util import Wire.API.Routes.QualifiedCapture import Wire.API.Routes.Version +import Wire.API.Routes.Versioned import Wire.API.SystemSettings import Wire.API.Team.Invitation import Wire.API.Team.Size @@ -126,8 +127,6 @@ type QualifiedCaptureUserId name = QualifiedCapture' '[Description "User Id"] na type CaptureClientId name = Capture' '[Description "ClientId"] name ClientId -type NewClientResponse = Headers '[Header "Location" ClientId] Client - type DeleteSelfResponses = '[ RespondEmpty 200 "Deletion is initiated.", RespondWithDeletionCodeTimeout @@ -730,15 +729,18 @@ type PrekeyAPI = :> Post '[JSON] QualifiedUserClientPrekeyMapV4 ) -type UserClientAPI = - -- User Client API ---------------------------------------------------- +-- User Client API ---------------------------------------------------- + +type ClientHeaders = '[DescHeader "Location" "Client ID" ClientId] +type UserClientAPI = -- This endpoint can lead to the following events being sent: -- - ClientAdded event to self -- - ClientRemoved event to self, if removing old clients due to max number Named - "add-client" + "add-client-v5" ( Summary "Register a new client" + :> Until 'V6 :> MakesFederatedCall 'Brig "send-connection-action" :> CanThrow 'TooManyClients :> CanThrow 'MissingAuth @@ -749,8 +751,38 @@ type UserClientAPI = :> ZConn :> "clients" :> ReqBody '[JSON] NewClient - :> Verb 'POST 201 '[JSON] NewClientResponse + :> MultiVerb1 + 'POST + '[JSON] + ( WithHeaders + ClientHeaders + Client + (VersionedRespond 'V5 201 "Client registered" Client) + ) ) + :<|> Named + "add-client" + ( Summary "Register a new client" + :> From 'V6 + :> MakesFederatedCall 'Brig "send-connection-action" + :> CanThrow 'TooManyClients + :> CanThrow 'MissingAuth + :> CanThrow 'MalformedPrekeys + :> CanThrow 'CodeAuthenticationFailed + :> CanThrow 'CodeAuthenticationRequired + :> ZUser + :> ZConn + :> "clients" + :> ReqBody '[JSON] NewClient + :> MultiVerb1 + 'POST + '[JSON] + ( WithHeaders + ClientHeaders + Client + (Respond 201 "Client registered" Client) + ) + ) :<|> Named "update-client" ( Summary "Update a registered client" @@ -774,16 +806,49 @@ type UserClientAPI = :> ReqBody '[JSON] RmClient :> MultiVerb 'DELETE '[JSON] '[RespondEmpty 200 "Client deleted"] () ) + :<|> Named + "list-clients-v5" + ( Summary "List the registered clients" + :> Until 'V6 + :> ZUser + :> "clients" + :> MultiVerb1 + 'GET + '[JSON] + ( VersionedRespond 'V5 200 "List of clients" [Client] + ) + ) :<|> Named "list-clients" ( Summary "List the registered clients" + :> From 'V6 + :> ZUser + :> "clients" + :> MultiVerb1 + 'GET + '[JSON] + ( Respond 200 "List of clients" [Client] + ) + ) + :<|> Named + "get-client-v5" + ( Summary "Get a registered client by ID" + :> Until 'V6 :> ZUser :> "clients" - :> Get '[JSON] [Client] + :> CaptureClientId "client" + :> MultiVerb + 'GET + '[JSON] + '[ EmptyErrorForLegacyReasons 404 "Client not found", + VersionedRespond 'V5 200 "Client found" Client + ] + (Maybe Client) ) :<|> Named "get-client" ( Summary "Get a registered client by ID" + :> From 'V6 :> ZUser :> "clients" :> CaptureClientId "client" diff --git a/libs/wire-api/src/Wire/API/Routes/Public/Brig/Bot.hs b/libs/wire-api/src/Wire/API/Routes/Public/Brig/Bot.hs index 4d544b64a53..635e6711c4a 100644 --- a/libs/wire-api/src/Wire/API/Routes/Public/Brig/Bot.hs +++ b/libs/wire-api/src/Wire/API/Routes/Public/Brig/Bot.hs @@ -30,6 +30,8 @@ import Wire.API.Provider.Bot (BotUserView) import Wire.API.Routes.MultiVerb import Wire.API.Routes.Named (Named) import Wire.API.Routes.Public +import Wire.API.Routes.Version +import Wire.API.Routes.Versioned import Wire.API.User import Wire.API.User.Client import Wire.API.User.Client.Prekey (PrekeyId) @@ -39,11 +41,6 @@ type DeleteResponses = Respond 200 "User found" RemoveBotResponse ] -type GetClientResponses = - '[ ErrorResponse 'ClientNotFound, - Respond 200 "Client found" Client - ] - type BotAPI = Named "add-bot" @@ -116,15 +113,39 @@ type BotAPI = :> ReqBody '[JSON] UpdateBotPrekeys :> MultiVerb1 'POST '[JSON] (RespondEmpty 200 "") ) + :<|> Named + "bot-get-client-v5" + ( Summary "Get client for bot" + :> Until 'V6 + :> CanThrow 'AccessDenied + :> CanThrow 'ClientNotFound + :> ZBot + :> "bot" + :> "client" + :> MultiVerb + 'GET + '[JSON] + '[ ErrorResponse 'ClientNotFound, + VersionedRespond 'V5 200 "Client found" Client + ] + (Maybe Client) + ) :<|> Named "bot-get-client" ( Summary "Get client for bot" + :> From 'V6 :> CanThrow 'AccessDenied :> CanThrow 'ClientNotFound :> ZBot :> "bot" :> "client" - :> MultiVerb 'GET '[JSON] GetClientResponses (Maybe Client) + :> MultiVerb + 'GET + '[JSON] + '[ ErrorResponse 'ClientNotFound, + Respond 200 "Client found" Client + ] + (Maybe Client) ) :<|> Named "bot-claim-users-prekeys" diff --git a/libs/wire-api/src/Wire/API/User/Client.hs b/libs/wire-api/src/Wire/API/User/Client.hs index d900d8b830a..c26b7c5b9b0 100644 --- a/libs/wire-api/src/Wire/API/User/Client.hs +++ b/libs/wire-api/src/Wire/API/User/Client.hs @@ -46,6 +46,7 @@ module Wire.API.User.Client -- * Client Client (..), + clientSchema, PubClient (..), ClientType (..), ClientClass (..), @@ -85,9 +86,11 @@ import Data.Misc (Latitude (..), Longitude (..), PlainTextPassword6) import Data.OpenApi hiding (Schema, ToSchema, nullable, schema) import Data.OpenApi qualified as Swagger hiding (nullable) import Data.Qualified +import Data.SOP hiding (fn) import Data.Schema import Data.Set qualified as Set -import Data.Text.Encoding qualified as Text.E +import Data.Text qualified as T +import Data.Text.Encoding qualified as T import Data.Time.Clock import Data.UUID (toASCIIBytes) import Deriving.Swagger @@ -98,6 +101,9 @@ import Deriving.Swagger ) import Imports import Wire.API.MLS.CipherSuite +import Wire.API.Routes.MultiVerb +import Wire.API.Routes.Version +import Wire.API.Routes.Versioned import Wire.API.User.Auth import Wire.API.User.Client.Prekey as Prekey import Wire.Arbitrary (Arbitrary (arbitrary), GenericUniform (..), generateExample, mapOf', setOf') @@ -376,7 +382,7 @@ instance ToJSON UserClientsFull where toJSON . Map.foldrWithKey' fn Map.empty . userClientsFull where fn u c m = - let k = Text.E.decodeLatin1 (toASCIIBytes (toUUID u)) + let k = T.decodeLatin1 (toASCIIBytes (toUUID u)) in Map.insert k c m instance FromJSON UserClientsFull where @@ -498,24 +504,46 @@ mlsPublicKeysSchema = mapSchema :: ValueSchema SwaggerDoc MLSPublicKeys mapSchema = map_ base64Schema +clientSchema :: Maybe Version -> ValueSchema NamedSwaggerDoc Client +clientSchema mv = + object ("Client" <> T.pack (foldMap show mv)) $ + Client + <$> clientId .= field "id" schema + <*> clientType .= field "type" schema + <*> clientTime .= field "time" schema + <*> clientClass .= maybe_ (optField "class" schema) + <*> clientLabel .= maybe_ (optField "label" schema) + <*> clientCookie .= maybe_ (optField "cookie" schema) + <*> clientModel .= maybe_ (optField "model" schema) + <*> clientCapabilities .= (fromMaybe mempty <$> caps) + <*> clientMLSPublicKeys .= mlsPublicKeysFieldSchema + <*> clientLastActive .= maybe_ (optField "last_active" utcTimeSchema) + where + caps :: ObjectSchemaP SwaggerDoc ClientCapabilityList (Maybe ClientCapabilityList) + caps = case mv of + -- broken capability serialisation for backwards compatibility + Just v | v <= V5 -> optField "capabilities" schema + _ -> fmap ClientCapabilityList <$> fromClientCapabilityList .= capabilitiesFieldSchema + instance ToSchema Client where + schema = clientSchema Nothing + +instance ToSchema (Versioned 'V5 Client) where + schema = Versioned <$> unVersioned .= clientSchema (Just V5) + +instance {-# OVERLAPPING #-} ToSchema (Versioned 'V5 [Client]) where schema = - object "Client" $ - Client - <$> clientId .= field "id" schema - <*> clientType .= field "type" schema - <*> clientTime .= field "time" schema - <*> clientClass .= maybe_ (optField "class" schema) - <*> clientLabel .= maybe_ (optField "label" schema) - <*> clientCookie .= maybe_ (optField "cookie" schema) - <*> clientModel .= maybe_ (optField "model" schema) - <*> clientCapabilities .= (fromMaybe mempty <$> optField "capabilities" schema) - <*> clientMLSPublicKeys .= mlsPublicKeysFieldSchema - <*> clientLastActive .= maybe_ (optField "last_active" utcTimeSchema) + Versioned + <$> unVersioned + .= named "ClientList" (array (clientSchema (Just V5))) mlsPublicKeysFieldSchema :: ObjectSchema SwaggerDoc MLSPublicKeys mlsPublicKeysFieldSchema = fromMaybe mempty <$> optField "mls_public_keys" mlsPublicKeysSchema +instance AsHeaders '[ClientId] Client Client where + toHeaders c = (I (clientId c) :* Nil, c) + fromHeaders = snd + -------------------------------------------------------------------------------- -- ClientList diff --git a/libs/wire-api/src/Wire/API/UserEvent.hs b/libs/wire-api/src/Wire/API/UserEvent.hs index 6ed42e3690c..59e5ff91502 100644 --- a/libs/wire-api/src/Wire/API/UserEvent.hs +++ b/libs/wire-api/src/Wire/API/UserEvent.hs @@ -33,6 +33,7 @@ import Imports import System.Logger.Message hiding (field, (.=)) import Wire.API.Connection import Wire.API.Properties +import Wire.API.Routes.Version import Wire.API.User import Wire.API.User.Client import Wire.API.User.Client.Prekey @@ -380,7 +381,7 @@ eventObjectSchema = _ClientEvent ( tag _ClientAdded - (field "client" schema) + (field "client" (clientSchema (Just V5))) ) EventTypeClientRemoved -> tag diff --git a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated.hs index 52cde0922bd..88433fe1f78 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated.hs @@ -1004,6 +1004,8 @@ tests = testObjects [(Test.Wire.API.Golden.Generated.ClientClass_user.testObject_ClientClass_user_1, "testObject_ClientClass_user_1.json"), (Test.Wire.API.Golden.Generated.ClientClass_user.testObject_ClientClass_user_2, "testObject_ClientClass_user_2.json"), (Test.Wire.API.Golden.Generated.ClientClass_user.testObject_ClientClass_user_3, "testObject_ClientClass_user_3.json"), (Test.Wire.API.Golden.Generated.ClientClass_user.testObject_ClientClass_user_4, "testObject_ClientClass_user_4.json"), (Test.Wire.API.Golden.Generated.ClientClass_user.testObject_ClientClass_user_5, "testObject_ClientClass_user_5.json"), (Test.Wire.API.Golden.Generated.ClientClass_user.testObject_ClientClass_user_6, "testObject_ClientClass_user_6.json"), (Test.Wire.API.Golden.Generated.ClientClass_user.testObject_ClientClass_user_7, "testObject_ClientClass_user_7.json"), (Test.Wire.API.Golden.Generated.ClientClass_user.testObject_ClientClass_user_8, "testObject_ClientClass_user_8.json"), (Test.Wire.API.Golden.Generated.ClientClass_user.testObject_ClientClass_user_9, "testObject_ClientClass_user_9.json"), (Test.Wire.API.Golden.Generated.ClientClass_user.testObject_ClientClass_user_10, "testObject_ClientClass_user_10.json"), (Test.Wire.API.Golden.Generated.ClientClass_user.testObject_ClientClass_user_11, "testObject_ClientClass_user_11.json"), (Test.Wire.API.Golden.Generated.ClientClass_user.testObject_ClientClass_user_12, "testObject_ClientClass_user_12.json"), (Test.Wire.API.Golden.Generated.ClientClass_user.testObject_ClientClass_user_13, "testObject_ClientClass_user_13.json"), (Test.Wire.API.Golden.Generated.ClientClass_user.testObject_ClientClass_user_14, "testObject_ClientClass_user_14.json"), (Test.Wire.API.Golden.Generated.ClientClass_user.testObject_ClientClass_user_15, "testObject_ClientClass_user_15.json"), (Test.Wire.API.Golden.Generated.ClientClass_user.testObject_ClientClass_user_16, "testObject_ClientClass_user_16.json"), (Test.Wire.API.Golden.Generated.ClientClass_user.testObject_ClientClass_user_17, "testObject_ClientClass_user_17.json"), (Test.Wire.API.Golden.Generated.ClientClass_user.testObject_ClientClass_user_18, "testObject_ClientClass_user_18.json"), (Test.Wire.API.Golden.Generated.ClientClass_user.testObject_ClientClass_user_19, "testObject_ClientClass_user_19.json"), (Test.Wire.API.Golden.Generated.ClientClass_user.testObject_ClientClass_user_20, "testObject_ClientClass_user_20.json")], testGroup "Golden: PubClient_user" $ testObjects [(Test.Wire.API.Golden.Generated.PubClient_user.testObject_PubClient_user_1, "testObject_PubClient_user_1.json"), (Test.Wire.API.Golden.Generated.PubClient_user.testObject_PubClient_user_2, "testObject_PubClient_user_2.json"), (Test.Wire.API.Golden.Generated.PubClient_user.testObject_PubClient_user_3, "testObject_PubClient_user_3.json"), (Test.Wire.API.Golden.Generated.PubClient_user.testObject_PubClient_user_4, "testObject_PubClient_user_4.json"), (Test.Wire.API.Golden.Generated.PubClient_user.testObject_PubClient_user_5, "testObject_PubClient_user_5.json"), (Test.Wire.API.Golden.Generated.PubClient_user.testObject_PubClient_user_6, "testObject_PubClient_user_6.json"), (Test.Wire.API.Golden.Generated.PubClient_user.testObject_PubClient_user_7, "testObject_PubClient_user_7.json"), (Test.Wire.API.Golden.Generated.PubClient_user.testObject_PubClient_user_8, "testObject_PubClient_user_8.json"), (Test.Wire.API.Golden.Generated.PubClient_user.testObject_PubClient_user_9, "testObject_PubClient_user_9.json"), (Test.Wire.API.Golden.Generated.PubClient_user.testObject_PubClient_user_10, "testObject_PubClient_user_10.json"), (Test.Wire.API.Golden.Generated.PubClient_user.testObject_PubClient_user_11, "testObject_PubClient_user_11.json"), (Test.Wire.API.Golden.Generated.PubClient_user.testObject_PubClient_user_12, "testObject_PubClient_user_12.json"), (Test.Wire.API.Golden.Generated.PubClient_user.testObject_PubClient_user_13, "testObject_PubClient_user_13.json"), (Test.Wire.API.Golden.Generated.PubClient_user.testObject_PubClient_user_14, "testObject_PubClient_user_14.json"), (Test.Wire.API.Golden.Generated.PubClient_user.testObject_PubClient_user_15, "testObject_PubClient_user_15.json"), (Test.Wire.API.Golden.Generated.PubClient_user.testObject_PubClient_user_16, "testObject_PubClient_user_16.json"), (Test.Wire.API.Golden.Generated.PubClient_user.testObject_PubClient_user_17, "testObject_PubClient_user_17.json"), (Test.Wire.API.Golden.Generated.PubClient_user.testObject_PubClient_user_18, "testObject_PubClient_user_18.json"), (Test.Wire.API.Golden.Generated.PubClient_user.testObject_PubClient_user_19, "testObject_PubClient_user_19.json"), (Test.Wire.API.Golden.Generated.PubClient_user.testObject_PubClient_user_20, "testObject_PubClient_user_20.json")], + testGroup "Golden: ClientV5_user" $ + testObjects [(Versioned @'V5 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_1, "testObject_ClientV5_user_1.json"), (Versioned @'V5 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_2, "testObject_ClientV5_user_2.json"), (Versioned @'V5 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_3, "testObject_ClientV5_user_3.json"), (Versioned @'V5 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_4, "testObject_ClientV5_user_4.json"), (Versioned @'V5 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_5, "testObject_ClientV5_user_5.json"), (Versioned @'V5 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_6, "testObject_ClientV5_user_6.json"), (Versioned @'V5 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_7, "testObject_ClientV5_user_7.json"), (Versioned @'V5 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_8, "testObject_ClientV5_user_8.json"), (Versioned @'V5 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_9, "testObject_ClientV5_user_9.json"), (Versioned @'V5 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_10, "testObject_ClientV5_user_10.json"), (Versioned @'V5 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_11, "testObject_ClientV5_user_11.json"), (Versioned @'V5 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_12, "testObject_ClientV5_user_12.json"), (Versioned @'V5 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_13, "testObject_ClientV5_user_13.json"), (Versioned @'V5 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_14, "testObject_ClientV5_user_14.json"), (Versioned @'V5 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_15, "testObject_ClientV5_user_15.json"), (Versioned @'V5 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_16, "testObject_ClientV5_user_16.json"), (Versioned @'V5 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_17, "testObject_ClientV5_user_17.json"), (Versioned @'V5 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_18, "testObject_ClientV5_user_18.json"), (Versioned @'V5 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_19, "testObject_ClientV5_user_19.json"), (Versioned @'V5 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_20, "testObject_ClientV5_user_20.json")], testGroup "Golden: Client_user" $ testObjects [(Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_1, "testObject_Client_user_1.json"), (Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_2, "testObject_Client_user_2.json"), (Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_3, "testObject_Client_user_3.json"), (Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_4, "testObject_Client_user_4.json"), (Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_5, "testObject_Client_user_5.json"), (Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_6, "testObject_Client_user_6.json"), (Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_7, "testObject_Client_user_7.json"), (Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_8, "testObject_Client_user_8.json"), (Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_9, "testObject_Client_user_9.json"), (Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_10, "testObject_Client_user_10.json"), (Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_11, "testObject_Client_user_11.json"), (Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_12, "testObject_Client_user_12.json"), (Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_13, "testObject_Client_user_13.json"), (Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_14, "testObject_Client_user_14.json"), (Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_15, "testObject_Client_user_15.json"), (Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_16, "testObject_Client_user_16.json"), (Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_17, "testObject_Client_user_17.json"), (Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_18, "testObject_Client_user_18.json"), (Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_19, "testObject_Client_user_19.json"), (Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_20, "testObject_Client_user_20.json")], testGroup "Golden: NewClient_user" $ diff --git a/libs/wire-api/test/golden/testObject_ClientV5_user_1.json b/libs/wire-api/test/golden/testObject_ClientV5_user_1.json new file mode 100644 index 00000000000..9fc8b644e4a --- /dev/null +++ b/libs/wire-api/test/golden/testObject_ClientV5_user_1.json @@ -0,0 +1,12 @@ +{ + "capabilities": { + "capabilities": [] + }, + "class": "desktop", + "id": "2", + "label": "%*", + "mls_public_keys": {}, + "model": "󳇚;􇻫", + "time": "1864-05-06T19:39:12.770Z", + "type": "permanent" +} diff --git a/libs/wire-api/test/golden/testObject_ClientV5_user_10.json b/libs/wire-api/test/golden/testObject_ClientV5_user_10.json new file mode 100644 index 00000000000..1d08a33cfd0 --- /dev/null +++ b/libs/wire-api/test/golden/testObject_ClientV5_user_10.json @@ -0,0 +1,13 @@ +{ + "capabilities": { + "capabilities": [] + }, + "cookie": "L", + "id": "0", + "mls_public_keys": { + "ed25519": "Wm1GclpTQndkV0pzYVdNZ2EyVjU=" + }, + "model": "\u0018", + "time": "1864-05-10T18:42:04.137Z", + "type": "permanent" +} diff --git a/libs/wire-api/test/golden/testObject_ClientV5_user_11.json b/libs/wire-api/test/golden/testObject_ClientV5_user_11.json new file mode 100644 index 00000000000..6e4c38b8dc9 --- /dev/null +++ b/libs/wire-api/test/golden/testObject_ClientV5_user_11.json @@ -0,0 +1,13 @@ +{ + "capabilities": { + "capabilities": [] + }, + "class": "legalhold", + "cookie": "5", + "id": "3", + "label": "\u001fb", + "mls_public_keys": {}, + "model": "ML", + "time": "1864-05-08T11:57:08.087Z", + "type": "temporary" +} diff --git a/libs/wire-api/test/golden/testObject_ClientV5_user_12.json b/libs/wire-api/test/golden/testObject_ClientV5_user_12.json new file mode 100644 index 00000000000..644db85ecbf --- /dev/null +++ b/libs/wire-api/test/golden/testObject_ClientV5_user_12.json @@ -0,0 +1,12 @@ +{ + "capabilities": { + "capabilities": [] + }, + "cookie": "0", + "id": "2", + "label": "", + "mls_public_keys": {}, + "model": "", + "time": "1864-05-08T18:44:00.378Z", + "type": "permanent" +} diff --git a/libs/wire-api/test/golden/testObject_ClientV5_user_13.json b/libs/wire-api/test/golden/testObject_ClientV5_user_13.json new file mode 100644 index 00000000000..9034bcbc4ab --- /dev/null +++ b/libs/wire-api/test/golden/testObject_ClientV5_user_13.json @@ -0,0 +1,13 @@ +{ + "capabilities": { + "capabilities": [] + }, + "class": "phone", + "cookie": "\u000c^󷋏", + "id": "2", + "label": "􃱽", + "mls_public_keys": {}, + "model": "\u0017𐲤", + "time": "1864-05-07T01:09:04.597Z", + "type": "permanent" +} diff --git a/libs/wire-api/test/golden/testObject_ClientV5_user_14.json b/libs/wire-api/test/golden/testObject_ClientV5_user_14.json new file mode 100644 index 00000000000..a4d61fe168c --- /dev/null +++ b/libs/wire-api/test/golden/testObject_ClientV5_user_14.json @@ -0,0 +1,12 @@ +{ + "capabilities": { + "capabilities": [] + }, + "class": "tablet", + "id": "2", + "label": "x\u000e", + "mls_public_keys": {}, + "model": "􀸏\r󠁨", + "time": "1864-05-12T11:00:10.449Z", + "type": "temporary" +} diff --git a/libs/wire-api/test/golden/testObject_ClientV5_user_15.json b/libs/wire-api/test/golden/testObject_ClientV5_user_15.json new file mode 100644 index 00000000000..626f76201cd --- /dev/null +++ b/libs/wire-api/test/golden/testObject_ClientV5_user_15.json @@ -0,0 +1,12 @@ +{ + "capabilities": { + "capabilities": [] + }, + "cookie": "􌨷N", + "id": "3", + "label": "\u0004G", + "mls_public_keys": {}, + "model": "zAI", + "time": "1864-05-08T11:28:27.778Z", + "type": "temporary" +} diff --git a/libs/wire-api/test/golden/testObject_ClientV5_user_16.json b/libs/wire-api/test/golden/testObject_ClientV5_user_16.json new file mode 100644 index 00000000000..7216da58868 --- /dev/null +++ b/libs/wire-api/test/golden/testObject_ClientV5_user_16.json @@ -0,0 +1,13 @@ +{ + "capabilities": { + "capabilities": [] + }, + "class": "legalhold", + "cookie": "U", + "id": "2", + "label": "=E", + "mls_public_keys": {}, + "model": "", + "time": "1864-05-12T11:31:10.072Z", + "type": "temporary" +} diff --git a/libs/wire-api/test/golden/testObject_ClientV5_user_17.json b/libs/wire-api/test/golden/testObject_ClientV5_user_17.json new file mode 100644 index 00000000000..9f0f36f96a3 --- /dev/null +++ b/libs/wire-api/test/golden/testObject_ClientV5_user_17.json @@ -0,0 +1,12 @@ +{ + "capabilities": { + "capabilities": [] + }, + "class": "desktop", + "cookie": "", + "id": "4", + "mls_public_keys": {}, + "model": "", + "time": "1864-05-12T02:25:34.770Z", + "type": "temporary" +} diff --git a/libs/wire-api/test/golden/testObject_ClientV5_user_18.json b/libs/wire-api/test/golden/testObject_ClientV5_user_18.json new file mode 100644 index 00000000000..80dad343c4e --- /dev/null +++ b/libs/wire-api/test/golden/testObject_ClientV5_user_18.json @@ -0,0 +1,13 @@ +{ + "capabilities": { + "capabilities": [] + }, + "class": "legalhold", + "cookie": "PG:", + "id": "1", + "label": "󳔺", + "mls_public_keys": {}, + "model": "􅩹", + "time": "1864-05-07T17:21:05.930Z", + "type": "temporary" +} diff --git a/libs/wire-api/test/golden/testObject_ClientV5_user_19.json b/libs/wire-api/test/golden/testObject_ClientV5_user_19.json new file mode 100644 index 00000000000..db061827756 --- /dev/null +++ b/libs/wire-api/test/golden/testObject_ClientV5_user_19.json @@ -0,0 +1,12 @@ +{ + "capabilities": { + "capabilities": [] + }, + "class": "desktop", + "id": "2", + "label": "􌇰l", + "mls_public_keys": {}, + "model": "", + "time": "1864-05-12T07:49:27.999Z", + "type": "permanent" +} diff --git a/libs/wire-api/test/golden/testObject_ClientV5_user_2.json b/libs/wire-api/test/golden/testObject_ClientV5_user_2.json new file mode 100644 index 00000000000..08dd2786531 --- /dev/null +++ b/libs/wire-api/test/golden/testObject_ClientV5_user_2.json @@ -0,0 +1,10 @@ +{ + "capabilities": { + "capabilities": [] + }, + "cookie": "􏬺c􄂩", + "id": "1", + "mls_public_keys": {}, + "time": "1864-05-07T08:48:22.537Z", + "type": "legalhold" +} diff --git a/libs/wire-api/test/golden/testObject_ClientV5_user_20.json b/libs/wire-api/test/golden/testObject_ClientV5_user_20.json new file mode 100644 index 00000000000..253cd8c3952 --- /dev/null +++ b/libs/wire-api/test/golden/testObject_ClientV5_user_20.json @@ -0,0 +1,14 @@ +{ + "capabilities": { + "capabilities": [ + "legalhold-implicit-consent" + ] + }, + "class": "phone", + "cookie": "", + "id": "1", + "label": "-󼊣v", + "mls_public_keys": {}, + "time": "1864-05-06T18:43:52.483Z", + "type": "legalhold" +} diff --git a/libs/wire-api/test/golden/testObject_ClientV5_user_3.json b/libs/wire-api/test/golden/testObject_ClientV5_user_3.json new file mode 100644 index 00000000000..8c5026d2cb7 --- /dev/null +++ b/libs/wire-api/test/golden/testObject_ClientV5_user_3.json @@ -0,0 +1,13 @@ +{ + "capabilities": { + "capabilities": [] + }, + "class": "legalhold", + "cookie": "", + "id": "1", + "label": "pi", + "last_active": "2023-07-04T09:35:32Z", + "mls_public_keys": {}, + "time": "1864-05-07T00:38:22.384Z", + "type": "temporary" +} diff --git a/libs/wire-api/test/golden/testObject_ClientV5_user_4.json b/libs/wire-api/test/golden/testObject_ClientV5_user_4.json new file mode 100644 index 00000000000..25e8c8860bd --- /dev/null +++ b/libs/wire-api/test/golden/testObject_ClientV5_user_4.json @@ -0,0 +1,12 @@ +{ + "capabilities": { + "capabilities": [] + }, + "class": "legalhold", + "cookie": "j", + "id": "3", + "mls_public_keys": {}, + "model": "", + "time": "1864-05-06T09:13:45.902Z", + "type": "permanent" +} diff --git a/libs/wire-api/test/golden/testObject_ClientV5_user_5.json b/libs/wire-api/test/golden/testObject_ClientV5_user_5.json new file mode 100644 index 00000000000..0af93523dc2 --- /dev/null +++ b/libs/wire-api/test/golden/testObject_ClientV5_user_5.json @@ -0,0 +1,12 @@ +{ + "capabilities": { + "capabilities": [] + }, + "class": "desktop", + "cookie": "", + "id": "0", + "mls_public_keys": {}, + "model": "⌷o", + "time": "1864-05-07T09:07:14.559Z", + "type": "temporary" +} diff --git a/libs/wire-api/test/golden/testObject_ClientV5_user_6.json b/libs/wire-api/test/golden/testObject_ClientV5_user_6.json new file mode 100644 index 00000000000..90a2b0ea16e --- /dev/null +++ b/libs/wire-api/test/golden/testObject_ClientV5_user_6.json @@ -0,0 +1,13 @@ +{ + "capabilities": { + "capabilities": [] + }, + "class": "tablet", + "cookie": "l\u0002", + "id": "4", + "last_active": "2021-09-15T22:00:21Z", + "mls_public_keys": {}, + "model": "", + "time": "1864-05-08T22:37:53.030Z", + "type": "permanent" +} diff --git a/libs/wire-api/test/golden/testObject_ClientV5_user_7.json b/libs/wire-api/test/golden/testObject_ClientV5_user_7.json new file mode 100644 index 00000000000..41253b1fb0a --- /dev/null +++ b/libs/wire-api/test/golden/testObject_ClientV5_user_7.json @@ -0,0 +1,12 @@ +{ + "capabilities": { + "capabilities": [] + }, + "class": "phone", + "id": "4", + "label": "", + "mls_public_keys": {}, + "model": "", + "time": "1864-05-07T04:35:34.201Z", + "type": "permanent" +} diff --git a/libs/wire-api/test/golden/testObject_ClientV5_user_8.json b/libs/wire-api/test/golden/testObject_ClientV5_user_8.json new file mode 100644 index 00000000000..fafbbc7e6e5 --- /dev/null +++ b/libs/wire-api/test/golden/testObject_ClientV5_user_8.json @@ -0,0 +1,13 @@ +{ + "capabilities": { + "capabilities": [] + }, + "class": "phone", + "cookie": "\u0015p`", + "id": "4", + "label": "", + "mls_public_keys": {}, + "model": "􏽉", + "time": "1864-05-11T06:32:01.921Z", + "type": "legalhold" +} diff --git a/libs/wire-api/test/golden/testObject_ClientV5_user_9.json b/libs/wire-api/test/golden/testObject_ClientV5_user_9.json new file mode 100644 index 00000000000..ed4e67747ca --- /dev/null +++ b/libs/wire-api/test/golden/testObject_ClientV5_user_9.json @@ -0,0 +1,13 @@ +{ + "capabilities": { + "capabilities": [] + }, + "class": "legalhold", + "cookie": "G", + "id": "1", + "label": "v", + "mls_public_keys": {}, + "model": "㌀m", + "time": "1864-05-08T03:54:56.526Z", + "type": "legalhold" +} diff --git a/libs/wire-api/test/golden/testObject_Client_user_1.json b/libs/wire-api/test/golden/testObject_Client_user_1.json index 9fc8b644e4a..3ae58f75402 100644 --- a/libs/wire-api/test/golden/testObject_Client_user_1.json +++ b/libs/wire-api/test/golden/testObject_Client_user_1.json @@ -1,7 +1,5 @@ { - "capabilities": { - "capabilities": [] - }, + "capabilities": [], "class": "desktop", "id": "2", "label": "%*", diff --git a/libs/wire-api/test/golden/testObject_Client_user_10.json b/libs/wire-api/test/golden/testObject_Client_user_10.json index 1d08a33cfd0..35ad363f074 100644 --- a/libs/wire-api/test/golden/testObject_Client_user_10.json +++ b/libs/wire-api/test/golden/testObject_Client_user_10.json @@ -1,7 +1,5 @@ { - "capabilities": { - "capabilities": [] - }, + "capabilities": [], "cookie": "L", "id": "0", "mls_public_keys": { diff --git a/libs/wire-api/test/golden/testObject_Client_user_11.json b/libs/wire-api/test/golden/testObject_Client_user_11.json index 6e4c38b8dc9..8d6af47dc49 100644 --- a/libs/wire-api/test/golden/testObject_Client_user_11.json +++ b/libs/wire-api/test/golden/testObject_Client_user_11.json @@ -1,7 +1,5 @@ { - "capabilities": { - "capabilities": [] - }, + "capabilities": [], "class": "legalhold", "cookie": "5", "id": "3", diff --git a/libs/wire-api/test/golden/testObject_Client_user_12.json b/libs/wire-api/test/golden/testObject_Client_user_12.json index 644db85ecbf..63ca4553dee 100644 --- a/libs/wire-api/test/golden/testObject_Client_user_12.json +++ b/libs/wire-api/test/golden/testObject_Client_user_12.json @@ -1,7 +1,5 @@ { - "capabilities": { - "capabilities": [] - }, + "capabilities": [], "cookie": "0", "id": "2", "label": "", diff --git a/libs/wire-api/test/golden/testObject_Client_user_13.json b/libs/wire-api/test/golden/testObject_Client_user_13.json index 9034bcbc4ab..9b2552d9086 100644 --- a/libs/wire-api/test/golden/testObject_Client_user_13.json +++ b/libs/wire-api/test/golden/testObject_Client_user_13.json @@ -1,7 +1,5 @@ { - "capabilities": { - "capabilities": [] - }, + "capabilities": [], "class": "phone", "cookie": "\u000c^󷋏", "id": "2", diff --git a/libs/wire-api/test/golden/testObject_Client_user_14.json b/libs/wire-api/test/golden/testObject_Client_user_14.json index a4d61fe168c..c95b927805a 100644 --- a/libs/wire-api/test/golden/testObject_Client_user_14.json +++ b/libs/wire-api/test/golden/testObject_Client_user_14.json @@ -1,7 +1,5 @@ { - "capabilities": { - "capabilities": [] - }, + "capabilities": [], "class": "tablet", "id": "2", "label": "x\u000e", diff --git a/libs/wire-api/test/golden/testObject_Client_user_15.json b/libs/wire-api/test/golden/testObject_Client_user_15.json index 626f76201cd..7050d356278 100644 --- a/libs/wire-api/test/golden/testObject_Client_user_15.json +++ b/libs/wire-api/test/golden/testObject_Client_user_15.json @@ -1,7 +1,5 @@ { - "capabilities": { - "capabilities": [] - }, + "capabilities": [], "cookie": "􌨷N", "id": "3", "label": "\u0004G", diff --git a/libs/wire-api/test/golden/testObject_Client_user_16.json b/libs/wire-api/test/golden/testObject_Client_user_16.json index 7216da58868..e70257998b5 100644 --- a/libs/wire-api/test/golden/testObject_Client_user_16.json +++ b/libs/wire-api/test/golden/testObject_Client_user_16.json @@ -1,7 +1,5 @@ { - "capabilities": { - "capabilities": [] - }, + "capabilities": [], "class": "legalhold", "cookie": "U", "id": "2", diff --git a/libs/wire-api/test/golden/testObject_Client_user_17.json b/libs/wire-api/test/golden/testObject_Client_user_17.json index 9f0f36f96a3..485f822a3d2 100644 --- a/libs/wire-api/test/golden/testObject_Client_user_17.json +++ b/libs/wire-api/test/golden/testObject_Client_user_17.json @@ -1,7 +1,5 @@ { - "capabilities": { - "capabilities": [] - }, + "capabilities": [], "class": "desktop", "cookie": "", "id": "4", diff --git a/libs/wire-api/test/golden/testObject_Client_user_18.json b/libs/wire-api/test/golden/testObject_Client_user_18.json index 80dad343c4e..5f1ba1bf5b8 100644 --- a/libs/wire-api/test/golden/testObject_Client_user_18.json +++ b/libs/wire-api/test/golden/testObject_Client_user_18.json @@ -1,7 +1,5 @@ { - "capabilities": { - "capabilities": [] - }, + "capabilities": [], "class": "legalhold", "cookie": "PG:", "id": "1", diff --git a/libs/wire-api/test/golden/testObject_Client_user_19.json b/libs/wire-api/test/golden/testObject_Client_user_19.json index db061827756..f6263f00203 100644 --- a/libs/wire-api/test/golden/testObject_Client_user_19.json +++ b/libs/wire-api/test/golden/testObject_Client_user_19.json @@ -1,7 +1,5 @@ { - "capabilities": { - "capabilities": [] - }, + "capabilities": [], "class": "desktop", "id": "2", "label": "􌇰l", diff --git a/libs/wire-api/test/golden/testObject_Client_user_2.json b/libs/wire-api/test/golden/testObject_Client_user_2.json index 08dd2786531..802de9bd21f 100644 --- a/libs/wire-api/test/golden/testObject_Client_user_2.json +++ b/libs/wire-api/test/golden/testObject_Client_user_2.json @@ -1,7 +1,5 @@ { - "capabilities": { - "capabilities": [] - }, + "capabilities": [], "cookie": "􏬺c􄂩", "id": "1", "mls_public_keys": {}, diff --git a/libs/wire-api/test/golden/testObject_Client_user_20.json b/libs/wire-api/test/golden/testObject_Client_user_20.json index 253cd8c3952..c9f3ae4459b 100644 --- a/libs/wire-api/test/golden/testObject_Client_user_20.json +++ b/libs/wire-api/test/golden/testObject_Client_user_20.json @@ -1,9 +1,7 @@ { - "capabilities": { - "capabilities": [ - "legalhold-implicit-consent" - ] - }, + "capabilities": [ + "legalhold-implicit-consent" + ], "class": "phone", "cookie": "", "id": "1", diff --git a/libs/wire-api/test/golden/testObject_Client_user_3.json b/libs/wire-api/test/golden/testObject_Client_user_3.json index 8c5026d2cb7..b6cb51e0fbf 100644 --- a/libs/wire-api/test/golden/testObject_Client_user_3.json +++ b/libs/wire-api/test/golden/testObject_Client_user_3.json @@ -1,7 +1,5 @@ { - "capabilities": { - "capabilities": [] - }, + "capabilities": [], "class": "legalhold", "cookie": "", "id": "1", diff --git a/libs/wire-api/test/golden/testObject_Client_user_4.json b/libs/wire-api/test/golden/testObject_Client_user_4.json index 25e8c8860bd..4a8398a2e9b 100644 --- a/libs/wire-api/test/golden/testObject_Client_user_4.json +++ b/libs/wire-api/test/golden/testObject_Client_user_4.json @@ -1,7 +1,5 @@ { - "capabilities": { - "capabilities": [] - }, + "capabilities": [], "class": "legalhold", "cookie": "j", "id": "3", diff --git a/libs/wire-api/test/golden/testObject_Client_user_5.json b/libs/wire-api/test/golden/testObject_Client_user_5.json index 0af93523dc2..e1967bb1bcf 100644 --- a/libs/wire-api/test/golden/testObject_Client_user_5.json +++ b/libs/wire-api/test/golden/testObject_Client_user_5.json @@ -1,7 +1,5 @@ { - "capabilities": { - "capabilities": [] - }, + "capabilities": [], "class": "desktop", "cookie": "", "id": "0", diff --git a/libs/wire-api/test/golden/testObject_Client_user_6.json b/libs/wire-api/test/golden/testObject_Client_user_6.json index 90a2b0ea16e..929f3132496 100644 --- a/libs/wire-api/test/golden/testObject_Client_user_6.json +++ b/libs/wire-api/test/golden/testObject_Client_user_6.json @@ -1,7 +1,5 @@ { - "capabilities": { - "capabilities": [] - }, + "capabilities": [], "class": "tablet", "cookie": "l\u0002", "id": "4", diff --git a/libs/wire-api/test/golden/testObject_Client_user_7.json b/libs/wire-api/test/golden/testObject_Client_user_7.json index 41253b1fb0a..8ca4dc49b6a 100644 --- a/libs/wire-api/test/golden/testObject_Client_user_7.json +++ b/libs/wire-api/test/golden/testObject_Client_user_7.json @@ -1,7 +1,5 @@ { - "capabilities": { - "capabilities": [] - }, + "capabilities": [], "class": "phone", "id": "4", "label": "", diff --git a/libs/wire-api/test/golden/testObject_Client_user_8.json b/libs/wire-api/test/golden/testObject_Client_user_8.json index fafbbc7e6e5..35f568dd53c 100644 --- a/libs/wire-api/test/golden/testObject_Client_user_8.json +++ b/libs/wire-api/test/golden/testObject_Client_user_8.json @@ -1,7 +1,5 @@ { - "capabilities": { - "capabilities": [] - }, + "capabilities": [], "class": "phone", "cookie": "\u0015p`", "id": "4", diff --git a/libs/wire-api/test/golden/testObject_Client_user_9.json b/libs/wire-api/test/golden/testObject_Client_user_9.json index ed4e67747ca..cfda4f2768a 100644 --- a/libs/wire-api/test/golden/testObject_Client_user_9.json +++ b/libs/wire-api/test/golden/testObject_Client_user_9.json @@ -1,7 +1,5 @@ { - "capabilities": { - "capabilities": [] - }, + "capabilities": [], "class": "legalhold", "cookie": "G", "id": "1", diff --git a/services/brig/src/Brig/API/Public.hs b/services/brig/src/Brig/API/Public.hs index b747d81dba5..0a4137e24b7 100644 --- a/services/brig/src/Brig/API/Public.hs +++ b/services/brig/src/Brig/API/Public.hs @@ -369,10 +369,13 @@ servantSitemap = userClientAPI :: ServerT UserClientAPI (Handler r) userClientAPI = - Named @"add-client" (callsFed (exposeAnnotations addClient)) + Named @"add-client-v5" (callsFed (exposeAnnotations addClient)) + :<|> Named @"add-client" (callsFed (exposeAnnotations addClient)) :<|> Named @"update-client" updateClient :<|> Named @"delete-client" deleteClient + :<|> Named @"list-clients-v5" listClients :<|> Named @"list-clients" listClients + :<|> Named @"get-client-v5" getClient :<|> Named @"get-client" getClient :<|> Named @"get-client-capabilities" getClientCapabilities :<|> Named @"get-client-prekeys" getClientPrekeys @@ -578,17 +581,13 @@ addClient :: UserId -> ConnId -> Public.NewClient -> - (Handler r) NewClientResponse + Handler r Public.Client addClient usr con new = do -- Users can't add legal hold clients when (Public.newClientType new == Public.LegalHoldClientType) $ throwE (clientError ClientLegalHoldCannotBeAdded) - clientResponse - <$> API.addClient usr (Just con) new - !>> clientError - where - clientResponse :: Public.Client -> NewClientResponse - clientResponse client = Servant.addHeader (Public.clientId client) client + API.addClient usr (Just con) new + !>> clientError deleteClient :: UserId -> ConnId -> ClientId -> Public.RmClient -> (Handler r) () deleteClient usr con clt body = diff --git a/services/brig/src/Brig/Provider/API.hs b/services/brig/src/Brig/Provider/API.hs index db1616d3c67..535ad5c9750 100644 --- a/services/brig/src/Brig/Provider/API.hs +++ b/services/brig/src/Brig/Provider/API.hs @@ -142,6 +142,7 @@ botAPI = :<|> Named @"bot-delete-self" botDeleteSelf :<|> Named @"bot-list-prekeys" botListPrekeys :<|> Named @"bot-update-prekeys" botUpdatePrekeys + :<|> Named @"bot-get-client-v5" botGetClient :<|> Named @"bot-get-client" botGetClient :<|> Named @"bot-claim-users-prekeys" botClaimUsersPrekeys :<|> Named @"bot-list-users" botListUserProfiles diff --git a/services/brig/src/Brig/Run.hs b/services/brig/src/Brig/Run.hs index 553a773366f..b74e58081c2 100644 --- a/services/brig/src/Brig/Run.hs +++ b/services/brig/src/Brig/Run.hs @@ -26,7 +26,7 @@ import Brig.API (sitemap) import Brig.API.Federation import Brig.API.Handler import Brig.API.Internal qualified as IAPI -import Brig.API.Public (DocsAPI, docsAPI, servantSitemap) +import Brig.API.Public import Brig.API.User qualified as API import Brig.AWS (amazonkaEnv, sesQueue) import Brig.AWS qualified as AWS diff --git a/services/brig/test/integration/API/User/Client.hs b/services/brig/test/integration/API/User/Client.hs index ec3e9d35052..3372c1b3e56 100644 --- a/services/brig/test/integration/API/User/Client.hs +++ b/services/brig/test/integration/API/User/Client.hs @@ -71,6 +71,8 @@ import UnliftIO (mapConcurrently) import Util import Wire.API.Internal.Notification import Wire.API.MLS.CipherSuite +import Wire.API.Routes.Version +import Wire.API.Routes.Versioned import Wire.API.Team.Feature qualified as Public import Wire.API.User import Wire.API.User qualified as Public @@ -257,7 +259,7 @@ testAddGetClient params brig cannon = do let etype = j ^? key "type" . _String let eclient = j ^? key "client" etype @?= Just "user.client-add" - fmap fromJSON eclient @?= Just (Success c) + fmap fromJSON eclient @?= Just (Success (Versioned @'V5 c)) pure c liftIO $ clientMLSPublicKeys c @?= keys getClient brig uid (clientId c) !!! do