diff --git a/integration/test/Test/Client.hs b/integration/test/Test/Client.hs index 8c3101737dd..1b4fb5b6971 100644 --- a/integration/test/Test/Client.hs +++ b/integration/test/Test/Client.hs @@ -104,8 +104,8 @@ testUpdateClientWithConsumableNotificationsCapability = do resp.status `shouldMatchInt` 200 resp.json %. "0.capabilities" `shouldMatch` [consumeCapability] -testGetClientCapabilitiesV6 :: App () -testGetClientCapabilitiesV6 = do +testGetClientCapabilitiesV7 :: App () +testGetClientCapabilitiesV7 = do let allCapabilities = ["legalhold-implicit-consent", "consumable-notifications"] alice <- randomUser OwnDomain def addClient alice def {acapabilities = Just allCapabilities} `bindResponse` \resp -> do @@ -116,8 +116,8 @@ testGetClientCapabilitiesV6 = do resp.status `shouldMatchInt` 200 resp.json %. "0.capabilities" `shouldMatchSet` allCapabilities - -- In API v6 and below, the "capabilities" field is an enum, so having a new + -- In API v7 and below, the "capabilities" field is an enum, so having a new -- value for this enum is a breaking change. - withAPIVersion 6 $ getSelfClients alice `bindResponse` \resp -> do + withAPIVersion 7 $ getSelfClients alice `bindResponse` \resp -> do resp.status `shouldMatchInt` 200 resp.json %. "0.capabilities.capabilities" `shouldMatchSet` ["legalhold-implicit-consent"] 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 0fca11d0a72..b5d02b298a0 100644 --- a/libs/wire-api/src/Wire/API/Routes/Public/Brig.hs +++ b/libs/wire-api/src/Wire/API/Routes/Public/Brig.hs @@ -750,9 +750,9 @@ type UserClientAPI = -- - ClientAdded event to self -- - ClientRemoved event to self, if removing old clients due to max number Named - "add-client-v6" + "add-client@v7" ( Summary "Register a new client" - :> Until 'V7 + :> Until 'V8 :> CanThrow 'TooManyClients :> CanThrow 'MissingAuth :> CanThrow 'MalformedPrekeys @@ -761,20 +761,20 @@ type UserClientAPI = :> ZLocalUser :> ZConn :> "clients" - :> ReqBody '[JSON] NewClient + :> VersionedReqBody 'V7 '[JSON] NewClient :> MultiVerb1 'POST '[JSON] ( WithHeaders ClientHeaders Client - (VersionedRespond 'V6 201 "Client registered" Client) + (VersionedRespond 'V7 201 "Client registered" Client) ) ) :<|> Named "add-client" ( Summary "Register a new client" - :> From 'V7 + :> From 'V8 :> CanThrow 'TooManyClients :> CanThrow 'MissingAuth :> CanThrow 'MalformedPrekeys @@ -793,6 +793,17 @@ type UserClientAPI = (Respond 201 "Client registered" Client) ) ) + :<|> Named + "update-client@v7" + ( Summary "Update a registered client" + :> Until 'V8 + :> CanThrow 'MalformedPrekeys + :> ZUser + :> "clients" + :> CaptureClientId "client" + :> VersionedReqBody 'V7 '[JSON] UpdateClient + :> MultiVerb1 'PUT '[JSON] (RespondEmpty 200 "Client updated") + ) :<|> Named "update-client" ( Summary "Update a registered client" @@ -801,7 +812,7 @@ type UserClientAPI = :> "clients" :> CaptureClientId "client" :> ReqBody '[JSON] UpdateClient - :> MultiVerb 'PUT '[JSON] '[RespondEmpty 200 "Client updated"] () + :> MultiVerb1 'PUT '[JSON] (RespondEmpty 200 "Client updated") ) :<|> -- This endpoint can lead to the following events being sent: @@ -817,21 +828,21 @@ type UserClientAPI = :> MultiVerb 'DELETE '[JSON] '[RespondEmpty 200 "Client deleted"] () ) :<|> Named - "list-clients-v6" + "list-clients@v7" ( Summary "List the registered clients" - :> Until 'V7 + :> Until 'V8 :> ZUser :> "clients" :> MultiVerb1 'GET '[JSON] - ( VersionedRespond 'V6 200 "List of clients" [Client] + ( VersionedRespond 'V7 200 "List of clients" [Client] ) ) :<|> Named "list-clients" ( Summary "List the registered clients" - :> From 'V7 + :> From 'V8 :> ZUser :> "clients" :> MultiVerb1 @@ -841,9 +852,9 @@ type UserClientAPI = ) ) :<|> Named - "get-client-v6" + "get-client@v7" ( Summary "Get a registered client by ID" - :> Until 'V7 + :> Until 'V8 :> ZUser :> "clients" :> CaptureClientId "client" @@ -851,14 +862,14 @@ type UserClientAPI = 'GET '[JSON] '[ EmptyErrorForLegacyReasons 404 "Client not found", - VersionedRespond 'V6 200 "Client found" Client + VersionedRespond 'V7 200 "Client found" Client ] (Maybe Client) ) :<|> Named "get-client" ( Summary "Get a registered client by ID" - :> From 'V7 + :> From 'V8 :> ZUser :> "clients" :> CaptureClientId "client" @@ -870,6 +881,19 @@ type UserClientAPI = ] (Maybe Client) ) + :<|> Named + "get-client-capabilities@v7" + ( Summary "Read back what the client has been posting about itself" + :> Until 'V8 + :> ZUser + :> "clients" + :> CaptureClientId "client" + :> "capabilities" + :> MultiVerb1 + 'GET + '[JSON] + (VersionedRespond 'V7 200 "capabilities" ClientCapabilityList) + ) :<|> Named "get-client-capabilities" ( Summary "Read back what the client has been posting about itself" 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 4c072cf0210..1576df42d0a 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 @@ -146,9 +146,9 @@ type BotAPI = :> MultiVerb1 'POST '[JSON] (RespondEmpty 200 "") ) :<|> Named - "bot-get-client-v6" + "bot-get-client@v7" ( Summary "Get client for bot" - :> Until 'V7 + :> Until 'V8 :> CanThrow 'AccessDenied :> CanThrow 'ClientNotFound :> ZBot @@ -158,14 +158,14 @@ type BotAPI = 'GET '[JSON] '[ ErrorResponse 'ClientNotFound, - VersionedRespond 'V6 200 "Client found" Client + VersionedRespond 'V7 200 "Client found" Client ] (Maybe Client) ) :<|> Named "bot-get-client" ( Summary "Get client for bot" - :> From 'V7 + :> From 'V8 :> CanThrow 'AccessDenied :> CanThrow 'ClientNotFound :> ZBot diff --git a/libs/wire-api/src/Wire/API/Routes/Public/Cannon.hs b/libs/wire-api/src/Wire/API/Routes/Public/Cannon.hs index c6f55ef6d6d..03742511080 100644 --- a/libs/wire-api/src/Wire/API/Routes/Public/Cannon.hs +++ b/libs/wire-api/src/Wire/API/Routes/Public/Cannon.hs @@ -28,6 +28,7 @@ type CannonAPI = Named "await-notifications" ( Summary "Establish websocket connection" + -- Description "This is the legacy variant of \"consume-events\"" :> "await" :> ZUser :> ZConn @@ -44,6 +45,8 @@ type CannonAPI = :<|> Named "consume-events" ( Summary "Consume events over a websocket connection" + :> Description "This is the rabbitMQ-based variant of \"await-notifications\"" + -- :> From 'V8 -- cannon is not versioned yet :> "events" :> ZUser :> QueryParam' diff --git a/libs/wire-api/src/Wire/API/User/Client.hs b/libs/wire-api/src/Wire/API/User/Client.hs index 683417c0d6b..79aa53595c2 100644 --- a/libs/wire-api/src/Wire/API/User/Client.hs +++ b/libs/wire-api/src/Wire/API/User/Client.hs @@ -179,11 +179,11 @@ newtype ClientCapabilityList = ClientCapabilityList {fromClientCapabilityList :: instance ToSchema ClientCapabilityList where schema = capabilitiesSchema Nothing -instance ToSchema (Versioned V6 ClientCapabilityList) where +instance ToSchema (Versioned V7 ClientCapabilityList) where schema = - object "ClientCapabilityListV6" $ + object "ClientCapabilityListV7" $ Versioned - <$> unVersioned .= field "capabilities" (capabilitiesSchema (Just V6)) + <$> unVersioned .= field "capabilities" (capabilitiesSchema (Just V7)) capabilitiesSchema :: Maybe Version -> @@ -196,7 +196,7 @@ capabilitiesSchema mVersion = dropIncompatibleCapabilities :: Set ClientCapability -> Set ClientCapability dropIncompatibleCapabilities caps = case mVersion of - Just v | v <= V6 -> Set.delete ClientSupportsConsumableNotifications caps + Just v | v <= V7 -> Set.delete ClientSupportsConsumableNotifications caps _ -> caps -------------------------------------------------------------------------------- @@ -528,21 +528,21 @@ clientSchema mVersion = caps = case mVersion of -- broken capability serialisation for backwards compatibility Just v - | v <= V6 -> - dimap Versioned unVersioned $ schema @(Versioned V6 ClientCapabilityList) + | v <= V7 -> + dimap Versioned unVersioned $ schema @(Versioned V7 ClientCapabilityList) _ -> schema @ClientCapabilityList instance ToSchema Client where schema = clientSchema Nothing -instance ToSchema (Versioned 'V6 Client) where - schema = Versioned <$> unVersioned .= clientSchema (Just V6) +instance ToSchema (Versioned 'V7 Client) where + schema = Versioned <$> unVersioned .= clientSchema (Just V7) -instance {-# OVERLAPPING #-} ToSchema (Versioned 'V6 [Client]) where +instance {-# OVERLAPPING #-} ToSchema (Versioned 'V7 [Client]) where schema = Versioned <$> unVersioned - .= named "ClientList" (array (clientSchema (Just V6))) + .= named "ClientList" (array (clientSchema (Just V7))) mlsPublicKeysFieldSchema :: ObjectSchema SwaggerDoc MLSPublicKeys mlsPublicKeysFieldSchema = fromMaybe mempty <$> optField "mls_public_keys" mlsPublicKeysSchema @@ -682,74 +682,80 @@ data NewClient = NewClient deriving (Arbitrary) via (GenericUniform NewClient) deriving (FromJSON, ToJSON, Swagger.ToSchema) via Schema NewClient +newClientSchema :: Maybe Version -> ValueSchema NamedSwaggerDoc NewClient +newClientSchema mVersion = + object "NewClient" $ + NewClient + <$> newClientPrekeys + .= fieldWithDocModifier + "prekeys" + (description ?~ "Prekeys for other clients to establish OTR sessions.") + (array schema) + <*> newClientLastKey + .= fieldWithDocModifier + "lastkey" + ( description + ?~ "The last resort prekey for other clients to establish OTR sessions. \ + \This key must have the ID 0xFFFF and is never deleted." + ) + schema + <*> newClientType + .= fieldWithDocModifier + "type" + ( description + ?~ "The type of client to register. A user may have no more than \ + \7 (seven) permanent clients and 1 (one) temporary client. When the \ + \limit of permanent clients is reached, an error is returned. \ + \When a temporary client already exists, it is replaced." + ) + schema + <*> newClientLabel .= maybe_ (optField "label" schema) + <*> newClientClass + .= maybe_ + ( optFieldWithDocModifier + "class" + ( description + ?~ "The device class this client belongs to. \ + \Either 'phone', 'tablet', or 'desktop'." + ) + schema + ) + <*> newClientCookie + .= maybe_ + ( optFieldWithDocModifier + "cookie" + (description ?~ "The cookie label, i.e. the label used when logging in.") + schema + ) + <*> newClientPassword + .= maybe_ + ( optFieldWithDocModifier + "password" + ( description + ?~ "The password of the authenticated user for verification. \ + \Note: Required for registration of the 2nd, 3rd, ... client." + ) + schema + ) + <*> newClientModel .= maybe_ (optField "model" schema) + <*> newClientCapabilities + .= maybe_ + ( optFieldWithDocModifier + "capabilities" + ( description + ?~ "Hints provided by the client for the backend so it can \ + \behave in a backwards-compatible way." + ) + (capabilitiesSchema mVersion) + ) + <*> newClientMLSPublicKeys .= mlsPublicKeysFieldSchema + <*> newClientVerificationCode .= maybe_ (optField "verification_code" schema) + instance ToSchema NewClient where - schema = - object "NewClient" $ - NewClient - <$> newClientPrekeys - .= fieldWithDocModifier - "prekeys" - (description ?~ "Prekeys for other clients to establish OTR sessions.") - (array schema) - <*> newClientLastKey - .= fieldWithDocModifier - "lastkey" - ( description - ?~ "The last resort prekey for other clients to establish OTR sessions. \ - \This key must have the ID 0xFFFF and is never deleted." - ) - schema - <*> newClientType - .= fieldWithDocModifier - "type" - ( description - ?~ "The type of client to register. A user may have no more than \ - \7 (seven) permanent clients and 1 (one) temporary client. When the \ - \limit of permanent clients is reached, an error is returned. \ - \When a temporary client already exists, it is replaced." - ) - schema - <*> newClientLabel .= maybe_ (optField "label" schema) - <*> newClientClass - .= maybe_ - ( optFieldWithDocModifier - "class" - ( description - ?~ "The device class this client belongs to. \ - \Either 'phone', 'tablet', or 'desktop'." - ) - schema - ) - <*> newClientCookie - .= maybe_ - ( optFieldWithDocModifier - "cookie" - (description ?~ "The cookie label, i.e. the label used when logging in.") - schema - ) - <*> newClientPassword - .= maybe_ - ( optFieldWithDocModifier - "password" - ( description - ?~ "The password of the authenticated user for verification. \ - \Note: Required for registration of the 2nd, 3rd, ... client." - ) - schema - ) - <*> newClientModel .= maybe_ (optField "model" schema) - <*> newClientCapabilities - .= maybe_ - ( optFieldWithDocModifier - "capabilities" - ( description - ?~ "Hints provided by the client for the backend so it can \ - \behave in a backwards-compatible way." - ) - schema - ) - <*> newClientMLSPublicKeys .= mlsPublicKeysFieldSchema - <*> newClientVerificationCode .= maybe_ (optField "verification_code" schema) + schema = newClientSchema Nothing + +instance ToSchema (Versioned 'V7 NewClient) where + schema = Versioned <$> unVersioned .= newClientSchema (Just V7) newClient :: ClientType -> LastPrekey -> NewClient newClient t k = @@ -792,39 +798,45 @@ defUpdateClient = updateClientMLSPublicKeys = mempty } +updateClientSchema :: Maybe Version -> ValueSchema NamedSwaggerDoc UpdateClient +updateClientSchema mVersion = + object "UpdateClient" $ + UpdateClient + <$> updateClientPrekeys + .= ( fromMaybe [] + <$> optFieldWithDocModifier + "prekeys" + (description ?~ "New prekeys for other clients to establish OTR sessions.") + (array schema) + ) + <*> updateClientLastKey + .= maybe_ + ( optFieldWithDocModifier + "lastkey" + (description ?~ "New last-resort prekey.") + schema + ) + <*> updateClientLabel + .= maybe_ + ( optFieldWithDocModifier + "label" + (description ?~ "A new name for this client.") + schema + ) + <*> updateClientCapabilities + .= maybe_ + ( optFieldWithDocModifier + "capabilities" + (description ?~ "Hints provided by the client for the backend so it can behave in a backwards-compatible way.") + (capabilitiesSchema mVersion) + ) + <*> updateClientMLSPublicKeys .= mlsPublicKeysFieldSchema + instance ToSchema UpdateClient where - schema = - object "UpdateClient" $ - UpdateClient - <$> updateClientPrekeys - .= ( fromMaybe [] - <$> optFieldWithDocModifier - "prekeys" - (description ?~ "New prekeys for other clients to establish OTR sessions.") - (array schema) - ) - <*> updateClientLastKey - .= maybe_ - ( optFieldWithDocModifier - "lastkey" - (description ?~ "New last-resort prekey.") - schema - ) - <*> updateClientLabel - .= maybe_ - ( optFieldWithDocModifier - "label" - (description ?~ "A new name for this client.") - schema - ) - <*> updateClientCapabilities - .= maybe_ - ( optFieldWithDocModifier - "capabilities" - (description ?~ "Hints provided by the client for the backend so it can behave in a backwards-compatible way.") - schema - ) - <*> updateClientMLSPublicKeys .= mlsPublicKeysFieldSchema + schema = updateClientSchema Nothing + +instance ToSchema (Versioned 'V7 UpdateClient) where + schema = Versioned <$> unVersioned .= updateClientSchema (Just V7) -------------------------------------------------------------------------------- -- RmClient 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 7bd3fdc9952..875b031097c 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 @@ -1014,7 +1014,7 @@ tests = 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 @'V6 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_1, "testObject_ClientV6_user_1.json"), (Versioned @'V6 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_2, "testObject_ClientV6_user_2.json"), (Versioned @'V6 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_3, "testObject_ClientV6_user_3.json"), (Versioned @'V6 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_4, "testObject_ClientV6_user_4.json"), (Versioned @'V6 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_5, "testObject_ClientV6_user_5.json"), (Versioned @'V6 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_6, "testObject_ClientV6_user_6.json"), (Versioned @'V6 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_7, "testObject_ClientV6_user_7.json"), (Versioned @'V6 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_8, "testObject_ClientV6_user_8.json"), (Versioned @'V6 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_9, "testObject_ClientV6_user_9.json"), (Versioned @'V6 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_10, "testObject_ClientV6_user_10.json"), (Versioned @'V6 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_11, "testObject_ClientV6_user_11.json"), (Versioned @'V6 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_12, "testObject_ClientV6_user_12.json"), (Versioned @'V6 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_13, "testObject_ClientV6_user_13.json"), (Versioned @'V6 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_14, "testObject_ClientV6_user_14.json"), (Versioned @'V6 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_15, "testObject_ClientV6_user_15.json"), (Versioned @'V6 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_16, "testObject_ClientV6_user_16.json"), (Versioned @'V6 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_17, "testObject_ClientV6_user_17.json"), (Versioned @'V6 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_18, "testObject_ClientV6_user_18.json"), (Versioned @'V6 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_19, "testObject_ClientV6_user_19.json"), (Versioned @'V6 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_20, "testObject_ClientV6_user_20.json")], + testObjects [(Versioned @'V7 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_1, "testObject_ClientV6_user_1.json"), (Versioned @'V7 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_2, "testObject_ClientV6_user_2.json"), (Versioned @'V7 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_3, "testObject_ClientV6_user_3.json"), (Versioned @'V7 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_4, "testObject_ClientV6_user_4.json"), (Versioned @'V7 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_5, "testObject_ClientV6_user_5.json"), (Versioned @'V7 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_6, "testObject_ClientV6_user_6.json"), (Versioned @'V7 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_7, "testObject_ClientV6_user_7.json"), (Versioned @'V7 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_8, "testObject_ClientV6_user_8.json"), (Versioned @'V7 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_9, "testObject_ClientV6_user_9.json"), (Versioned @'V7 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_10, "testObject_ClientV6_user_10.json"), (Versioned @'V7 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_11, "testObject_ClientV6_user_11.json"), (Versioned @'V7 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_12, "testObject_ClientV6_user_12.json"), (Versioned @'V7 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_13, "testObject_ClientV6_user_13.json"), (Versioned @'V7 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_14, "testObject_ClientV6_user_14.json"), (Versioned @'V7 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_15, "testObject_ClientV6_user_15.json"), (Versioned @'V7 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_16, "testObject_ClientV6_user_16.json"), (Versioned @'V7 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_17, "testObject_ClientV6_user_17.json"), (Versioned @'V7 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_18, "testObject_ClientV6_user_18.json"), (Versioned @'V7 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_19, "testObject_ClientV6_user_19.json"), (Versioned @'V7 Test.Wire.API.Golden.Generated.Client_user.testObject_Client_user_20, "testObject_ClientV6_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/Test/Wire/API/Golden/Manual/ClientCapabilityList.hs b/libs/wire-api/test/golden/Test/Wire/API/Golden/Manual/ClientCapabilityList.hs index bbb616c990a..323e4d7d8b3 100644 --- a/libs/wire-api/test/golden/Test/Wire/API/Golden/Manual/ClientCapabilityList.hs +++ b/libs/wire-api/test/golden/Test/Wire/API/Golden/Manual/ClientCapabilityList.hs @@ -23,13 +23,13 @@ import Wire.API.Routes.Version import Wire.API.Routes.Versioned import Wire.API.User.Client (ClientCapability (..), ClientCapabilityList (..)) -testObject_ClientCapabilityList_1 :: Versioned V6 ClientCapabilityList +testObject_ClientCapabilityList_1 :: Versioned V7 ClientCapabilityList testObject_ClientCapabilityList_1 = Versioned $ ClientCapabilityList mempty -testObject_ClientCapabilityList_2 :: Versioned V6 ClientCapabilityList +testObject_ClientCapabilityList_2 :: Versioned V7 ClientCapabilityList testObject_ClientCapabilityList_2 = Versioned $ ClientCapabilityList (Set.fromList [ClientSupportsLegalholdImplicitConsent]) -testObject_ClientCapabilityList_3 :: Versioned V6 ClientCapabilityList +testObject_ClientCapabilityList_3 :: Versioned V7 ClientCapabilityList testObject_ClientCapabilityList_3 = Versioned $ ClientCapabilityList diff --git a/services/brig/src/Brig/API/Public.hs b/services/brig/src/Brig/API/Public.hs index db49a5ff0b8..1ebeea8615f 100644 --- a/services/brig/src/Brig/API/Public.hs +++ b/services/brig/src/Brig/API/Public.hs @@ -453,14 +453,16 @@ servantSitemap = userClientAPI :: ServerT UserClientAPI (Handler r) userClientAPI = - Named @"add-client-v6" addClient + Named @"add-client@v7" addClient :<|> Named @"add-client" addClient + :<|> Named @"update-client@v7" API.updateClient :<|> Named @"update-client" API.updateClient :<|> Named @"delete-client" deleteClient - :<|> Named @"list-clients-v6" listClients + :<|> Named @"list-clients@v7" listClients :<|> Named @"list-clients" listClients - :<|> Named @"get-client-v6" getClient + :<|> Named @"get-client@v7" getClient :<|> Named @"get-client" getClient + :<|> Named @"get-client-capabilities@v7" getClientCapabilities :<|> Named @"get-client-capabilities" getClientCapabilities :<|> Named @"get-client-prekeys" getClientPrekeys :<|> Named @"head-nonce" newNonce diff --git a/services/brig/src/Brig/Provider/API.hs b/services/brig/src/Brig/Provider/API.hs index 162a1109060..c54362abcd7 100644 --- a/services/brig/src/Brig/Provider/API.hs +++ b/services/brig/src/Brig/Provider/API.hs @@ -153,7 +153,7 @@ botAPI = :<|> Named @"bot-delete-self" botDeleteSelf :<|> Named @"bot-list-prekeys" botListPrekeys :<|> Named @"bot-update-prekeys" botUpdatePrekeys - :<|> Named @"bot-get-client-v6" botGetClient + :<|> Named @"bot-get-client@v7" botGetClient :<|> Named @"bot-get-client" botGetClient :<|> Named @"bot-claim-users-prekeys" botClaimUsersPrekeys :<|> Named @"bot-list-users" botListUserProfiles diff --git a/services/brig/test/integration/API/User/Client.hs b/services/brig/test/integration/API/User/Client.hs index c73e81861f0..82546fd9d8e 100644 --- a/services/brig/test/integration/API/User/Client.hs +++ b/services/brig/test/integration/API/User/Client.hs @@ -259,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 (Versioned @'V6 c)) + fmap fromJSON eclient @?= Just (Success (Versioned @'V7 c)) pure c liftIO $ clientMLSPublicKeys c @?= keys getClient brig uid (clientId c) !!! do diff --git a/tools/stern/src/Stern/Intra.hs b/tools/stern/src/Stern/Intra.hs index a5e17507ff2..3c0ad708181 100644 --- a/tools/stern/src/Stern/Intra.hs +++ b/tools/stern/src/Stern/Intra.hs @@ -819,7 +819,7 @@ getUserClients uid = do . expect2xx ) info $ msg ("Response" ++ show r) - let resultOrError :: Either String [Versioned 'V6 Client] = responseJsonEither r + let resultOrError :: Either String [Versioned 'V7 Client] = responseJsonEither r case resultOrError of Left e -> do Log.err $ msg ("Error parsing client response: " ++ e)