Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/5-internal/WPB-22515
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Upgrade ormolu to match GHC 9.10.
2 changes: 1 addition & 1 deletion integration/test/API/BrigInternal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ createUser domain cu = do
[ "name" .= "integration test team",
"icon" .= "default"
]
| cu.team
| cu.team
]
)

Expand Down
3 changes: 1 addition & 2 deletions integration/test/API/Galley.hs
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,7 @@ updateRole caller target role qcnv = do
caller
Galley
Versioned
( joinHttpPath ["conversations", cnvDomain, cnvId, "members", tarDomain, tarId]
)
(joinHttpPath ["conversations", cnvDomain, cnvId, "members", tarDomain, tarId])
submit "PUT" (req & addJSONObject ["conversation_role" .= roleReq])

updateReceiptMode ::
Expand Down
2 changes: 1 addition & 1 deletion integration/test/MLS/Util.hs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ initMLSClient opts cid = do
let keys =
object
[ csSignatureScheme ciphersuite .= T.decodeUtf8 (Base64.encode pkey)
| (ciphersuite, pkey) <- suitePKeys
| (ciphersuite, pkey) <- suitePKeys
]
bindResponse
( updateClient
Expand Down
6 changes: 3 additions & 3 deletions integration/test/Test/Conversation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ testDynamicBackendsFullyConnectedWhenAllowDynamic = do
-- between backends when the federation strategy is 'allowDynamic'.
sequence_
[ BrigI.createFedConn x (BrigI.FedConn y "full_search" Nothing)
| x <- [domainA, domainB, domainC],
y <- [domainA, domainB, domainC],
x /= y
| x <- [domainA, domainB, domainC],
y <- [domainA, domainB, domainC],
x /= y
]
uidA <- randomUser domainA def {BrigI.team = True}
uidB <- randomUser domainB def {BrigI.team = True}
Expand Down
6 changes: 2 additions & 4 deletions integration/test/Test/DomainVerification.hs
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,7 @@ testUpdateTeamInvite = forM_ [ExplicitVersion 8, Versioned] \version -> do

-- admin should not be able to set team-invite if the team hasn't been authorized
bindResponse
( updateTeamInvite owner domain (object ["team_invite" .= "team", "team" .= tid])
)
(updateTeamInvite owner domain (object ["team_invite" .= "team", "team" .= tid]))
$ \resp -> do
resp.status `shouldMatchInt` 403
resp.json %. "label" `shouldMatch` "operation-forbidden-for-domain-registration-state"
Expand All @@ -283,8 +282,7 @@ testUpdateTeamInvite = forM_ [ExplicitVersion 8, Versioned] \version -> do

-- non-admin should not be able to set team-invite
bindResponse
( updateTeamInvite mem domain (object ["team_invite" .= "team", "team" .= tid])
)
(updateTeamInvite mem domain (object ["team_invite" .= "team", "team" .= tid]))
$ \resp -> do
resp.status `shouldMatchInt` 403
resp.json %. "label" `shouldMatch` "operation-forbidden-for-domain-registration-state"
Expand Down
18 changes: 9 additions & 9 deletions integration/test/Test/UserGroup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -359,15 +359,15 @@ testUserGroupGetGroupsAllInputs = do
includeMemberCount = includeMemberCount',
includeChannels = includeChannels'
}
| q' <- qs,
sortBy' <- sortByKeysList,
sortOrder' <- sortOrders,
pSize' <- pSizes,
lastName' <- lastNames,
lastCreatedAt' <- lastCreatedAts,
lastId' <- lastIds,
includeMemberCount' <- [False, True],
includeChannels' <- [False, True]
| q' <- qs,
sortBy' <- sortByKeysList,
sortOrder' <- sortOrders,
pSize' <- pSizes,
lastName' <- lastNames,
lastCreatedAt' <- lastCreatedAts,
lastId' <- lastIds,
includeMemberCount' <- [False, True],
includeChannels' <- [False, True]
]
where
qs = [Nothing, Just "A"]
Expand Down
8 changes: 4 additions & 4 deletions integration/test/Testlib/ModService.hs
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,10 @@ updateServiceMapInConfig resource forSrv config =
)
config
[ (srv, berInternalServicePorts resource srv :: Int)
| srv <- allServices,
-- if a service is not enabled, do not set its endpoint configuration,
-- unless we are starting the service itself
berEnableService resource srv || srv == forSrv
| srv <- allServices,
-- if a service is not enabled, do not set its endpoint configuration,
-- unless we are starting the service itself
berEnableService resource srv || srv == forSrv
]

startBackend ::
Expand Down
3 changes: 1 addition & 2 deletions libs/polysemy-wire-zoo/src/Polysemy/TinyLog.hs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ logErrors showError msg action = Polysemy.Error.catch action $ \e -> do

logAndIgnoreErrors ::
forall e r.
( Member TinyLog r
) =>
(Member TinyLog r) =>
(e -> Text) ->
Text ->
Sem (Error e ': r) () ->
Expand Down
3 changes: 1 addition & 2 deletions libs/polysemy-wire-zoo/src/Wire/Sem/Now/Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,4 @@ prop_nowNow =
pure $
simpleLaw
(liftA2 (<=) E.get E.get)
( pure True
)
(pure True)
2 changes: 1 addition & 1 deletion libs/saml2-web-sso/src/SAML2/WebSSO/Cookie.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ headerValueToCookie txt = do
let cookie = parseSetCookie $ cs txt
case ["missing cookie name" | setCookieName cookie == ""]
<> [ cs $ "wrong cookie name: got " <> setCookieName cookie <> ", expected " <> cookieName (Proxy @name)
| setCookieName cookie /= cookieName (Proxy @name)
| setCookieName cookie /= cookieName (Proxy @name)
]
<> ["missing cookie value" | setCookieValue cookie == ""] of
errs@(_ : _) -> throwError $ ST.intercalate ", " errs
Expand Down
8 changes: 4 additions & 4 deletions libs/saml2-web-sso/src/SAML2/WebSSO/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -441,19 +441,19 @@ mkNameID nid@(UNameIDEntity uri) m1 m2 m3 = do
mapM_ throwError $
[ "mkNameID: nameIDNameQ, nameIDSPNameQ, nameIDSPProvidedID MUST be omitted for entity NameIDs."
<> show [m1, m2, m3]
| all isJust [m1, m2, m3]
| all isJust [m1, m2, m3]
]
<> [ "mkNameID: entity URI too long: "
<> show uritxt
| uritxt <- [renderURI uri],
ST.length uritxt > 1024
| uritxt <- [renderURI uri],
ST.length uritxt > 1024
]
pure $ NameID nid Nothing Nothing Nothing
mkNameID nid@(UNameIDPersistent txt) m1 m2 m3 = do
mapM_ throwError $
[ "mkNameID: persistent text too long: "
<> show (nid, ST.length txt)
| ST.length txt > 1024
| ST.length txt > 1024
]
pure $ NameID nid m1 m2 m3
mkNameID nid m1 m2 m3 = do
Expand Down
2 changes: 1 addition & 1 deletion libs/saml2-web-sso/src/SAML2/WebSSO/XML.hs
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ exportConditions conds =
HX.conditions =
[HX.OneTimeUse | conds ^. condOneTimeUse]
<> [ HX.AudienceRestriction (HX.Audience . exportURI <$> hsrs)
| hsrs <- conds ^. condAudienceRestriction
| hsrs <- conds ^. condAudienceRestriction
]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ type UnnamedFedEndpointWithMods (mods :: [Type]) path input output =
type FedEndpointWithMods (mods :: [Type]) name input output =
Named
name
( UnnamedFedEndpointWithMods mods (FedPath name) input output
)
(UnnamedFedEndpointWithMods mods (FedPath name) input output)

type FedEndpoint name input output = FedEndpointWithMods '[] name input output

Expand Down Expand Up @@ -156,8 +155,7 @@ data StreamPostWithRemoteIp framing (ct :: Type) a

-- Server-side simply delegates to the standard 'StreamPost' implementation.
instance
( HasServer (StreamPost framing ct a) context
) =>
(HasServer (StreamPost framing ct a) context) =>
HasServer (StreamPostWithRemoteIp framing ct a) context
where
type ServerT (StreamPostWithRemoteIp framing ct a) m = ServerT (StreamPost framing ct a) m
Expand Down
3 changes: 1 addition & 2 deletions libs/wire-api/src/Wire/API/Conversation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -954,8 +954,7 @@ newConvSchema v sch =
<*> newConvCells .= (fromMaybe False <$> optField "cells" schema)
<*> newConvChannelAddPermission
.= maybe_
( optFieldWithDocModifier "add_permission" (description ?~ "Channel add permission") schema
)
(optFieldWithDocModifier "add_permission" (description ?~ "Channel add permission") schema)
<*> newConvSkipCreator
.= ( fromMaybe False
<$> optFieldWithDocModifier
Expand Down
3 changes: 1 addition & 2 deletions libs/wire-api/src/Wire/API/Routes/Internal/Enterprise.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ type InternalAPI = "i" :> InternalAPIBase
type InternalAPIBase =
Named
"status"
( "status" :> MultiVerb 'GET '[JSON] '[RespondEmpty 200 "OK"] ()
)
("status" :> MultiVerb 'GET '[JSON] '[RespondEmpty 200 "OK"] ())
:<|> Named
"create-verification-token"
( "create-verification-token"
Expand Down
3 changes: 1 addition & 2 deletions libs/wire-api/src/Wire/API/Routes/Internal/Galley.hs
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ type InternalAPI = "i" :> InternalAPIBase
type InternalAPIBase =
Named
"status"
( "status" :> MultiVerb 'GET '[JSON] '[RespondEmpty 200 "OK"] ()
)
("status" :> MultiVerb 'GET '[JSON] '[RespondEmpty 200 "OK"] ())
-- This endpoint can lead to the following events being sent:
-- - MemberLeave event to members for all conversations the user was in
:<|> Named
Expand Down
9 changes: 3 additions & 6 deletions libs/wire-api/src/Wire/API/Routes/Public/Brig.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1040,8 +1040,7 @@ type UserClientAPI =
:> MultiVerb1
'GET
'[JSON]
( VersionedRespond 'V6 200 "List of clients" [Client]
)
(VersionedRespond 'V6 200 "List of clients" [Client])
)
:<|> Named
"list-clients@v7"
Expand All @@ -1053,8 +1052,7 @@ type UserClientAPI =
:> MultiVerb1
'GET
'[JSON]
( VersionedRespond 'V7 200 "List of clients" [Client]
)
(VersionedRespond 'V7 200 "List of clients" [Client])
)
:<|> Named
"list-clients"
Expand All @@ -1065,8 +1063,7 @@ type UserClientAPI =
:> MultiVerb1
'GET
'[JSON]
( Respond 200 "List of clients" [Client]
)
(Respond 200 "List of clients" [Client])
)
:<|> Named
"get-client@v6"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,7 @@ instance ToSchema DomainRedirectResponseV9 where
DomainRedirectResponse
<$> (\r -> True <$ guard r.propagateUserExists)
.= maybe_
( fromMaybe False <$> optField "due_to_existing_account" schema
)
(fromMaybe False <$> optField "due_to_existing_account" schema)
<*> (.redirect) .= domainRedirectSchemaV9

type DomainRedirectResponseV10 = DomainRedirectResponse V10
Expand All @@ -319,8 +318,7 @@ instance ToSchema DomainRedirectResponseV10 where
DomainRedirectResponse
<$> (\r -> True <$ guard r.propagateUserExists)
.= maybe_
( fromMaybe False <$> optField "due_to_existing_account" schema
)
(fromMaybe False <$> optField "due_to_existing_account" schema)
<*> (.redirect) .= domainRedirectSchema V10

type DomainVerificationChallengeAPI =
Expand Down
3 changes: 1 addition & 2 deletions libs/wire-api/src/Wire/API/Routes/Public/Spar.hs
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ type IdpDelete =
type SsoSettingsGet =
Named
"sso-settings"
( Get '[JSON] SsoSettings
)
(Get '[JSON] SsoSettings)

sparSPIssuer :: (Functor m, SAML.HasConfig m) => Maybe TeamId -> Maybe Domain -> m (Maybe SAML.Issuer)
sparSPIssuer mbtid = (SAML.Issuer <$$>) . sparResponseURI mbtid
Expand Down
3 changes: 1 addition & 2 deletions libs/wire-api/src/Wire/API/Routes/Version.hs
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,7 @@ instance ToSchema VersionExp where
<> tag
_VersionExpDevelopment
( unnamed
( enum @Text "VersionExpDevelopment" (element "development" ())
)
(enum @Text "VersionExpDevelopment" (element "development" ()))
)

deriving via Schema VersionExp instance (FromJSON VersionExp)
Expand Down
12 changes: 6 additions & 6 deletions libs/wire-api/src/Wire/API/Team/Member.hs
Original file line number Diff line number Diff line change
Expand Up @@ -521,12 +521,12 @@ permissionsRole (Permissions p p') =
permsRole perms =
listToMaybe
[ role
| role <- [minBound ..],
-- if a there is a role that is strictly less permissive than the perms set that
-- we encounter, we downgrade. this shouldn't happen in real life, but it has
-- happened to very old users on a staging environment, where a user (probably)
-- was create before the current publicly visible permissions had been stabilized.
rolePerms role `Set.isSubsetOf` perms
| role <- [minBound ..],
-- if a there is a role that is strictly less permissive than the perms set that
-- we encounter, we downgrade. this shouldn't happen in real life, but it has
-- happened to very old users on a staging environment, where a user (probably)
-- was create before the current publicly visible permissions had been stabilized.
rolePerms role `Set.isSubsetOf` perms
]

-- | Internal function for 'rolePermissions'. (It works iff the two sets in 'Permissions' are
Expand Down
3 changes: 1 addition & 2 deletions libs/wire-api/src/Wire/API/User/Activation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,7 @@ instance ToSchema SendActivationCode where
.= maybe_
( optFieldWithDocModifier
"locale"
( description ?~ "Locale to use for the activation code template."
)
(description ?~ "Locale to use for the activation code template.")
schema
)
where
Expand Down
6 changes: 2 additions & 4 deletions libs/wire-api/src/Wire/API/UserEvent.hs
Original file line number Diff line number Diff line change
Expand Up @@ -319,13 +319,11 @@ eventObjectSchema =
EventTypeUserLegalholdEnabled ->
tag
_UserEvent
( tag _UserLegalHoldEnabled (field "id" schema)
)
(tag _UserLegalHoldEnabled (field "id" schema))
EventTypeUserLegalholdDisabled ->
tag
_UserEvent
( tag _UserLegalHoldDisabled (field "id" schema)
)
(tag _UserLegalHoldDisabled (field "id" schema))
EventTypeUserLegalholdRequested ->
tag
_UserEvent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ testObject_NewUser_user_8 =
newUserIdentity =
Just
( EmailIdentity
( unsafeEmailAddress "some" "example"
)
(unsafeEmailAddress "some" "example")
),
newUserPassword = Just (plainTextPassword8Unsafe "12345678")
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ testObject_RTCIceServer_user_1 =
testObject_RTCIceServer_user_2 :: RTCIceServer
testObject_RTCIceServer_user_2 =
rtcIceServer
( NonEmpty.singleton (turnURI SchemeTurn (TurnHostIp (IpAddr (read "108.37.81.160"))) (read "0") (Just TransportTCP))
)
(NonEmpty.singleton (turnURI SchemeTurn (TurnHostIp (IpAddr (read "108.37.81.160"))) (read "0") (Just TransportTCP)))
( turnUsername (secondsToNominalDiffTime 3.000000000000) "a8kdffu4"
& tuVersion .~ 5
& tuKeyindex .~ 24
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ testObject_SimpleMember_user_1 =
{ smQualifiedId = Qualified (Id (fromJust (UUID.fromString "0000003a-0000-0042-0000-007500000037"))) (Domain "faraway.example.com"),
smConvRoleName =
fromJust
( parseRoleName "wire_member"
)
(parseRoleName "wire_member")
}

testObject_SimpleMember_user_2 :: SimpleMember
Expand All @@ -41,6 +40,5 @@ testObject_SimpleMember_user_2 =
{ smQualifiedId = Qualified (Id (fromJust (UUID.fromString "0000003a-0000-0042-0000-007500000037"))) (Domain "faraway.example.com"),
smConvRoleName =
fromJust
( parseRoleName "wire_admin"
)
(parseRoleName "wire_admin")
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ testObject_LoginId_user_1 =
testObject_LoginId_user_2 :: LoginId
testObject_LoginId_user_2 =
LoginByEmail
( unsafeEmailAddress "some" "example"
)
(unsafeEmailAddress "some" "example")

testObject_LoginId_user_3 :: LoginId
testObject_LoginId_user_3 = LoginByHandle (fromJust (parseHandle "7a8gg3v98"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ domain = Domain "golden.example.com"
convId :: Qualified ConvId
convId =
Qualified
( Id (fromJust (UUID.fromString "00000000-0000-0001-0000-000100000001"))
)
(Id (fromJust (UUID.fromString "00000000-0000-0001-0000-000100000001")))
domain

testObject_PublicSubConversation_1 :: PublicSubConversation
Expand Down Expand Up @@ -82,7 +81,6 @@ testObject_PublicSubConversation_2 =
user :: Qualified UserId
user =
Qualified
( Id (fromJust (UUID.fromString "00000000-0000-0007-0000-000a00000002"))
)
(Id (fromJust (UUID.fromString "00000000-0000-0007-0000-000a00000002")))
domain
cid = ClientId 0xdeadbeef
Loading