Skip to content

Commit

Permalink
Merge branch 'wireapp:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
offsoc authored Jan 11, 2025
2 parents 5b43d5d + c7bb078 commit 26187e2
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 14 deletions.
1 change: 1 addition & 0 deletions changelog.d/1-api-changes/WPB-15030
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deprecated API endpoints were removed from API version V8.
3 changes: 3 additions & 0 deletions libs/wire-api/src/Wire/API/Routes/Public/Brig.hs
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,7 @@ type AccountAPI =
"post-password-reset-key-deprecated"
( Summary "Complete a password reset."
:> Deprecated
:> Until 'V8
:> CanThrow 'PasswordResetInProgress
:> CanThrow 'InvalidPasswordResetKey
:> CanThrow 'InvalidPasswordResetCode
Expand All @@ -616,6 +617,7 @@ type AccountAPI =
"onboarding"
( Summary "Upload contacts and invoke matching."
:> Deprecated
:> Until 'V8
:> Description
"DEPRECATED: the feature has been turned off, the end-point does \
\nothing and always returns '{\"results\":[],\"auto-connects\":[]}'."
Expand Down Expand Up @@ -1695,6 +1697,7 @@ type CallingAPI =
"Retrieve TURN server addresses and credentials for \
\ IP addresses, scheme `turn` and transport `udp` only (deprecated)"
:> Deprecated
:> Until 'V8
:> ZUser
:> ZConn
:> "calls"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,7 @@ type ConversationAPI =
"update-conversation-name-deprecated"
( Summary "Update conversation name (deprecated)"
:> Deprecated
:> Until 'V8
:> Description "Use `/conversations/:domain/:conv/name` instead."
:> CanThrow ('ActionDenied 'ModifyConversationName)
:> CanThrow 'ConvNotFound
Expand All @@ -1052,6 +1053,7 @@ type ConversationAPI =
"update-conversation-name-unqualified"
( Summary "Update conversation name (deprecated)"
:> Deprecated
:> Until 'V8
:> Description "Use `/conversations/:domain/:conv/name` instead."
:> CanThrow ('ActionDenied 'ModifyConversationName)
:> CanThrow 'ConvNotFound
Expand Down Expand Up @@ -1092,6 +1094,7 @@ type ConversationAPI =
"update-conversation-message-timer-unqualified"
( Summary "Update the message timer for a conversation (deprecated)"
:> Deprecated
:> Until 'V8
:> Description "Use `/conversations/:domain/:cnv/message-timer` instead."
:> ZLocalUser
:> ZConn
Expand Down Expand Up @@ -1134,6 +1137,7 @@ type ConversationAPI =
"update-conversation-receipt-mode-unqualified"
( Summary "Update receipt mode for a conversation (deprecated)"
:> Deprecated
:> Until 'V8
:> Description "Use `PUT /conversations/:domain/:cnv/receipt-mode` instead."
:> ZLocalUser
:> ZConn
Expand Down Expand Up @@ -1243,7 +1247,9 @@ type ConversationAPI =
:<|> Named
"get-conversation-self-unqualified"
( Summary "Get self membership properties (deprecated)"
:> Description "Use `/conversations/:domain/:conv` instead and get the self member from `response.members.self`."
:> Deprecated
:> Until 'V8
:> ZLocalUser
:> "conversations"
:> Capture' '[Description "Conversation ID"] "cnv" ConvId
Expand All @@ -1254,6 +1260,7 @@ type ConversationAPI =
"update-conversation-self-unqualified"
( Summary "Update self membership properties (deprecated)"
:> Deprecated
:> Until 'V8
:> Description "Use `/conversations/:domain/:conv/self` instead."
:> CanThrow 'ConvNotFound
:> ZLocalUser
Expand Down
11 changes: 10 additions & 1 deletion libs/wire-api/src/Wire/API/Routes/Public/Spar.hs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ type DeprecateSSOAPIV1 =
\Details: https://docs.wire.com/understand/single-sign-on/trouble-shooting.html#can-i-use-the-same-sso-login-code-for-multiple-teams"

type APISSO =
Named "sso-metadata" (DeprecateSSOAPIV1 :> Deprecated :> "metadata" :> SAML.APIMeta)
Named
"sso-metadata"
( -- This deprecated endpoint should be removed at some point. However it does not make a lot of sense to apply our versioning mechanism to it,
-- as this is not a classic client API endpoint. It is used in the SAML IDP flow and should exist independently of the API version,
-- and requires a different process for decommissioning. See https://wearezeta.atlassian.net/browse/WPB-15319
DeprecateSSOAPIV1 :> Deprecated :> "metadata" :> SAML.APIMeta
)
:<|> Named "sso-team-metadata" ("metadata" :> Capture "team" TeamId :> SAML.APIMeta)
:<|> "initiate-login" :> APIAuthReqPrecheck
:<|> "initiate-login" :> APIAuthReq
Expand Down Expand Up @@ -89,6 +95,9 @@ type APIAuthReq =
:> Get '[SAML.HTML] (SAML.FormRedirect SAML.AuthnRequest)
)

-- | This deprecated endpoint should be removed at some point. However it does not make a lot of sense to apply our versioning mechanism to it,
-- as this is not a classic client API endpoint. It is used in the SAML IDP flow and should exist independently of the API version,
-- and requires a different process for decommissioning. See https://wearezeta.atlassian.net/browse/WPB-15319
type APIAuthRespLegacy =
Named
"auth-resp-legacy"
Expand Down
6 changes: 3 additions & 3 deletions services/galley/test/integration/API.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2729,18 +2729,18 @@ putQualifiedConvRenameOk = do
putConvDeprecatedRenameOk :: TestM ()
putConvDeprecatedRenameOk = do
c <- view tsCannon
g <- viewGalley
alice <- randomUser
qbob <- randomQualifiedUser
let bob = qUnqualified qbob
connectUsers alice (singleton bob)
conv <- decodeConvId <$> postO2OConv alice bob (Just "gossip")
let qconv = Qualified conv (qDomain qbob)
WS.bracketR2 c alice bob $ \(wsA, wsB) -> do
unversionedGalley <- view tsUnversionedGalley
-- This endpoint is deprecated but clients still use it
put
( g
. paths ["conversations", toByteString' conv]
( unversionedGalley
. paths ["v7", "conversations", toByteString' conv]
. zUser bob
. zConn "conn"
. zType "access"
Expand Down
20 changes: 10 additions & 10 deletions services/galley/test/integration/API/Util.hs
Original file line number Diff line number Diff line change
Expand Up @@ -637,10 +637,10 @@ createMLSTeamConv lusr c tid users name access role timer convRole = do

updateTeamConv :: UserId -> ConvId -> ConversationRename -> TestM ResponseLBS
updateTeamConv zusr convid upd = do
g <- viewGalley
g <- view tsUnversionedGalley
put
( g
. paths ["/conversations", toByteString' convid]
. paths ["v7", "conversations", toByteString' convid]
. zUser zusr
. zConn "conn"
. zType "access"
Expand Down Expand Up @@ -1181,10 +1181,10 @@ deleteMemberQualified u1 (Qualified u2 u2Domain) (Qualified conv convDomain) = d

getSelfMember :: UserId -> ConvId -> TestM ResponseLBS
getSelfMember u c = do
g <- viewGalley
g <- view tsUnversionedGalley
get $
g
. paths ["conversations", toByteString' c, "self"]
. paths ["v7", "conversations", toByteString' c, "self"]
. zUser u
. zConn "conn"
. zType "access"
Expand Down Expand Up @@ -1261,11 +1261,11 @@ putQualifiedConversationName u c n = do

putConversationName :: UserId -> ConvId -> Text -> TestM ResponseLBS
putConversationName u c n = do
g <- viewGalley
g <- view tsUnversionedGalley
let update = ConversationRename n
put
( g
. paths ["conversations", toByteString' c, "name"]
. paths ["v7", "conversations", toByteString' c, "name"]
. zUser u
. zConn "conn"
. zType "access"
Expand All @@ -1292,11 +1292,11 @@ putQualifiedReceiptMode u (Qualified c dom) r = do

putReceiptMode :: UserId -> ConvId -> ReceiptMode -> TestM ResponseLBS
putReceiptMode u c r = do
g <- viewGalley
g <- view tsUnversionedGalley
let update = ConversationReceiptModeUpdate r
put
( g
. paths ["conversations", toByteString' c, "receipt-mode"]
. paths ["v7", "conversations", toByteString' c, "receipt-mode"]
. zUser u
. zConn "conn"
. zType "access"
Expand Down Expand Up @@ -1379,10 +1379,10 @@ putMessageTimerUpdateQualified u c acc = do
putMessageTimerUpdate ::
UserId -> ConvId -> ConversationMessageTimerUpdate -> TestM ResponseLBS
putMessageTimerUpdate u c acc = do
g <- viewGalley
g <- view tsUnversionedGalley
put $
g
. paths ["/conversations", toByteString' c, "message-timer"]
. paths ["v7", "conversations", toByteString' c, "message-timer"]
. zUser u
. zConn "conn"
. zType "access"
Expand Down

0 comments on commit 26187e2

Please sign in to comment.