Skip to content

Commit

Permalink
Remove the target endpoints from V9
Browse files Browse the repository at this point in the history
  • Loading branch information
mdimjasevic committed Dec 9, 2024
1 parent f428562 commit eeaa83d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion integration/test/Test/Swagger.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Testlib.Prelude
import UnliftIO.Temporary

existingVersions :: Set Int
existingVersions = Set.fromList [0, 1, 2, 3, 4, 5, 6, 7, 8]
existingVersions = Set.fromList [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

internalApis :: Set String
internalApis = Set.fromList ["brig", "cannon", "cargohold", "cannon", "spar"]
Expand Down
14 changes: 10 additions & 4 deletions integration/test/Test/Version.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ instance TestCases Versioned' where
MkTestCase "[version=versioned]" (Versioned' Versioned),
MkTestCase "[version=v1]" (Versioned' (ExplicitVersion 1)),
MkTestCase "[version=v3]" (Versioned' (ExplicitVersion 3)),
MkTestCase "[version=v6]" (Versioned' (ExplicitVersion 6))
MkTestCase "[version=v6]" (Versioned' (ExplicitVersion 6)),
MkTestCase "[version=v7]" (Versioned' (ExplicitVersion 7)),
MkTestCase "[version=v8]" (Versioned' (ExplicitVersion 8))
]

-- | Used to test endpoints that have changed after version 5
Expand Down Expand Up @@ -43,9 +45,11 @@ testVersion (Versioned' v) = withModifiedBackend
domain <- resp.json %. "domain" & asString
federation <- resp.json %. "federation" & asBool

-- currently there is only one development version
-- it is however theoretically possible to have multiple development versions
length dev `shouldMatchInt` 1
-- currently there are two development versions
--
-- it is however possible to have a different number of development
-- versions
length dev `shouldMatchInt` 2
domain `shouldMatch` dom
federation `shouldMatch` True

Expand Down Expand Up @@ -77,6 +81,8 @@ testVersionDisabled = withModifiedBackend
void $ getSelfWithVersion (ExplicitVersion 4) user >>= getJSON 200
void $ getSelfWithVersion (ExplicitVersion 5) user >>= getJSON 200
void $ getSelfWithVersion (ExplicitVersion 6) user >>= getJSON 200
void $ getSelfWithVersion (ExplicitVersion 7) user >>= getJSON 200
void $ getSelfWithVersion (ExplicitVersion 8) user >>= getJSON 200
void $ getSelfWithVersion Unversioned user >>= getJSON 200

testVersionDisabledNotAdvertised :: App ()
Expand Down
2 changes: 2 additions & 0 deletions libs/wire-api/src/Wire/API/Routes/Public/Cannon.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ import Servant
import Wire.API.Routes.API
import Wire.API.Routes.Named
import Wire.API.Routes.Public (ZConn, ZUser)
import Wire.API.Routes.Version
import Wire.API.Routes.WebSocket

type CannonAPI =
Named
"await-notifications"
( Summary "Establish websocket connection"
-- Description "This is the legacy variant of \"consume-events\""
:> Until 'V9
:> "await"
:> ZUser
:> ZConn
Expand Down
3 changes: 3 additions & 0 deletions libs/wire-api/src/Wire/API/Routes/Public/Gundeck.hs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ type NotificationAPI =
Named
"get-notification-by-id"
( Summary "Fetch a notification by ID"
:> Until 'V9
:> ZUser
:> "notifications"
:> Capture' '[Description "Notification ID"] "id" NotificationId
Expand All @@ -83,6 +84,7 @@ type NotificationAPI =
:<|> Named
"get-last-notification"
( Summary "Fetch the last notification"
:> Until 'V9
:> ZUser
:> "notifications"
:> "last"
Expand Down Expand Up @@ -116,6 +118,7 @@ type NotificationAPI =
"get-notifications"
( Summary "Fetch notifications"
:> From 'V3
:> Until 'V9
:> ZUser
:> "notifications"
:> QueryParam' [Optional, Strict, Description "Only return notifications more recent than this"] "since" NotificationId
Expand Down
4 changes: 2 additions & 2 deletions services/brig/test/integration/API/User/Auth.hs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ testNginz b n = do
post (unversioned . n . path "/access" . cookie c . header "Authorization" ("Bearer " <> toByteString' t)) <!! do
const 200 === statusCode
-- ensure regular user tokens can fetch notifications
get (n . path "/notifications" . header "Authorization" ("Bearer " <> toByteString' t)) !!! const 200 === statusCode
get (apiVersion "v8" . n . path "/notifications" . header "Authorization" ("Bearer " <> toByteString' t)) !!! const 200 === statusCode

testNginzLegalHold :: Brig -> Galley -> Nginz -> Http ()
testNginzLegalHold b g n = do
Expand Down Expand Up @@ -282,7 +282,7 @@ testNginzLegalHold b g n = do
get (n . path "/clients" . header "Authorization" ("Bearer " <> toByteString' t)) !!! const 403 === statusCode
get (n . path "/self" . header "Authorization" ("Bearer " <> toByteString' t)) !!! const 403 === statusCode
-- ensure legal hold tokens can fetch notifications
get (n . path "/notifications" . header "Authorization" ("Bearer " <> toByteString' t)) !!! const 200 === statusCode
get (apiVersion "v8" . n . path "/notifications" . header "Authorization" ("Bearer " <> toByteString' t)) !!! const 200 === statusCode

get (apiVersion "v1" . n . paths ["legalhold", "conversations", toByteString' (qUnqualified qconv)] . header "Authorization" ("Bearer " <> toByteString' t)) !!! const 200 === statusCode

Expand Down

0 comments on commit eeaa83d

Please sign in to comment.