Skip to content

Commit

Permalink
Move galley's internal endpoint to wire-api
Browse files Browse the repository at this point in the history
  • Loading branch information
supersven committed Jan 20, 2023
1 parent 00848d1 commit 4dafe4c
Show file tree
Hide file tree
Showing 29 changed files with 34 additions and 606 deletions.
2 changes: 0 additions & 2 deletions libs/galley-types/galley-types.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ library
Galley.Types
Galley.Types.Bot
Galley.Types.Bot.Service
Galley.Types.Conversations.Intra
Galley.Types.Conversations.Members
Galley.Types.Conversations.One2One
Galley.Types.Conversations.Roles
Galley.Types.Teams
Galley.Types.Teams.Intra

other-modules: Paths_galley_types
hs-source-dirs: src
Expand Down
87 changes: 0 additions & 87 deletions libs/galley-types/src/Galley/Types/Conversations/Intra.hs

This file was deleted.

120 changes: 0 additions & 120 deletions libs/galley-types/src/Galley/Types/Teams/Intra.hs

This file was deleted.

2 changes: 0 additions & 2 deletions libs/galley-types/test/unit/Test/Galley/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import Control.Lens
import Data.Set hiding (drop)
import qualified Data.Set as Set
import Galley.Types.Teams
import Galley.Types.Teams.Intra (GuardLegalholdPolicyConflicts)
import Imports
import Test.Galley.Roundtrip (testRoundTrip)
import qualified Test.QuickCheck as QC
Expand All @@ -49,7 +48,6 @@ tests =
assertBool "owner.self" ((rolePermissions r2 ^. self) `isSubsetOf` (rolePermissions r1 ^. self))
assertBool "owner.copy" ((rolePermissions r2 ^. copy) `isSubsetOf` (rolePermissions r1 ^. copy)),
testRoundTrip @FeatureFlags,
testRoundTrip @GuardLegalholdPolicyConflicts,
testGroup
"permissionsRole, rolePermissions"
[ testCase "'Role' maps to expected permissions" $ do
Expand Down
2 changes: 1 addition & 1 deletion libs/wire-api/src/Wire/API/Team/Feature.hs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ import Wire.Arbitrary (Arbitrary, GenericUniform (..))
-- 'FeatureStatusPut' (optional) and by by user: 'FeatureConfigGet'. Then
-- implement them in Galley.API.Public.
--
-- 7. Add internal routes in Galley.API.Internal
-- 7. Add internal routes in Wire.API.Routes.Internal.Galley
--
-- 8. If the feature should be configurable via Stern add routes to Stern.API.
-- Manually check that the swagger looks okay.
Expand Down
5 changes: 4 additions & 1 deletion libs/wire-api/test/unit/Test/Wire/API/Roundtrip/Aeson.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ import qualified Wire.API.Provider.Service as Provider.Service
import qualified Wire.API.Provider.Service.Tag as Provider.Service.Tag
import qualified Wire.API.Push.Token as Push.Token
-- import qualified Wire.API.RawJson as RawJson

import qualified Wire.API.Routes.Internal.Galley.TeamsIntra as TeamsIntra
import qualified Wire.API.Team as Team
import qualified Wire.API.Team.Conversation as Team.Conversation
import qualified Wire.API.Team.Feature as Team.Feature
Expand Down Expand Up @@ -311,7 +313,8 @@ tests =
testRoundTrip @User.Search.PagingState,
testRoundTrip @User.Search.TeamContact,
testRoundTrip @(Wrapped.Wrapped "some_int" Int),
testRoundTrip @Conversation.Action.SomeConversationAction
testRoundTrip @Conversation.Action.SomeConversationAction,
testRoundTrip @TeamsIntra.GuardLegalholdPolicyConflicts
]

testRoundTrip ::
Expand Down
3 changes: 3 additions & 0 deletions libs/wire-api/wire-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ library
Wire.API.Routes.Internal.Brig.EJPD
Wire.API.Routes.Internal.Cannon
Wire.API.Routes.Internal.Cargohold
Wire.API.Routes.Internal.Galley
Wire.API.Routes.Internal.Galley.ConversationsIntra
Wire.API.Routes.Internal.Galley.TeamFeatureNoConfigMulti
Wire.API.Routes.Internal.Galley.TeamsIntra
Wire.API.Routes.Internal.LegalHold
Wire.API.Routes.LowLevelStream
Wire.API.Routes.MultiTablePaging
Expand Down
2 changes: 1 addition & 1 deletion services/brig/src/Brig/API/Connection/Remote.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import Control.Error.Util ((??))
import Control.Monad.Trans.Except (runExceptT, throwE)
import Data.Id as Id
import Data.Qualified
import Galley.Types.Conversations.Intra (Actor (..), DesiredMembership (..), UpsertOne2OneConversationRequest (..), UpsertOne2OneConversationResponse (uuorConvId))
import Imports
import Network.Wai.Utilities.Error
import Wire.API.Connection
Expand All @@ -44,6 +43,7 @@ import Wire.API.Federation.API.Brig
( NewConnectionResponse (..),
RemoteConnectionAction (..),
)
import Wire.API.Routes.Internal.Galley.ConversationsIntra (Actor (..), DesiredMembership (..), UpsertOne2OneConversationRequest (..), UpsertOne2OneConversationResponse (uuorConvId))
import Wire.API.Routes.Public.Util (ResponseForExistedCreated (..))

data LocalConnectionAction
Expand Down
2 changes: 1 addition & 1 deletion services/brig/src/Brig/API/User.hs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ import Data.Qualified
import Data.Time.Clock (addUTCTime, diffUTCTime)
import Data.UUID.V4 (nextRandom)
import qualified Galley.Types.Teams as Team
import qualified Galley.Types.Teams.Intra as Team
import Imports
import Network.Wai.Utilities
import Polysemy
Expand All @@ -175,6 +174,7 @@ import qualified Wire.API.Error.Brig as E
import Wire.API.Federation.API
import Wire.API.Federation.Error
import Wire.API.Routes.Internal.Brig.Connection
import qualified Wire.API.Routes.Internal.Galley.TeamsIntra as Team
import Wire.API.Team hiding (newTeam)
import Wire.API.Team.Feature (forgetLock)
import Wire.API.Team.Invitation
Expand Down
2 changes: 1 addition & 1 deletion services/brig/src/Brig/Effects/GalleyProvider.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import Brig.Team.Types (ShowOrHideInvitationUrl (..))
import qualified Data.Currency as Currency
import Data.Id
import Data.Json.Util (UTCTimeMillis)
import qualified Galley.Types.Teams.Intra as Team
import Imports
import qualified Network.Wai.Utilities.Error as Wai
import Polysemy
import Wire.API.Conversation
import qualified Wire.API.Routes.Internal.Galley.TeamsIntra as Team
import Wire.API.Team
import qualified Wire.API.Team.Conversation as Conv
import Wire.API.Team.Feature
Expand Down
2 changes: 1 addition & 1 deletion services/brig/src/Brig/Effects/GalleyProvider/RPC.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import Data.Id
import Data.Json.Util (UTCTimeMillis)
import Data.Range
import qualified Galley.Types.Teams as Team
import qualified Galley.Types.Teams.Intra as Team
import Imports
import Network.HTTP.Types.Method
import Network.HTTP.Types.Status
Expand All @@ -29,6 +28,7 @@ import Polysemy
import Polysemy.Error
import System.Logger (Msg, field, msg, val)
import Wire.API.Conversation hiding (Member)
import qualified Wire.API.Routes.Internal.Galley.TeamsIntra as Team
import Wire.API.Team
import qualified Wire.API.Team.Conversation as Conv
import Wire.API.Team.Feature
Expand Down
4 changes: 2 additions & 2 deletions services/brig/src/Brig/IO/Intra.hs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ import Data.Qualified
import Data.Range
import qualified Data.Set as Set
import GHC.TypeLits
import Galley.Types.Conversations.Intra (UpsertOne2OneConversationRequest, UpsertOne2OneConversationResponse)
import Galley.Types.Teams.Intra (GuardLegalholdPolicyConflicts (GuardLegalholdPolicyConflicts))
import Gundeck.Types.Push.V2
import qualified Gundeck.Types.Push.V2 as Push
import Imports
Expand All @@ -102,6 +100,8 @@ import Wire.API.Federation.API
import Wire.API.Federation.API.Brig
import Wire.API.Federation.Error
import Wire.API.Properties
import Wire.API.Routes.Internal.Galley.ConversationsIntra (UpsertOne2OneConversationRequest, UpsertOne2OneConversationResponse)
import Wire.API.Routes.Internal.Galley.TeamsIntra (GuardLegalholdPolicyConflicts (GuardLegalholdPolicyConflicts))
import Wire.API.Team.LegalHold (LegalholdProtectee)
import qualified Wire.API.Team.Member as Team
import Wire.API.User
Expand Down
2 changes: 1 addition & 1 deletion services/brig/src/Brig/Team/API.hs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ import qualified Data.List1 as List1
import Data.Range
import Data.String.Conversions (cs)
import qualified Galley.Types.Teams as Team
import qualified Galley.Types.Teams.Intra as Team
import Imports hiding (head)
import Network.HTTP.Types.Status
import Network.Wai (Response)
Expand All @@ -68,6 +67,7 @@ import Util.Logging (logFunction, logTeam)
import Wire.API.Error
import qualified Wire.API.Error.Brig as E
import Wire.API.Federation.API
import qualified Wire.API.Routes.Internal.Galley.TeamsIntra as Team
import Wire.API.Routes.Named
import Wire.API.Routes.Public.Brig
import Wire.API.Team
Expand Down
2 changes: 1 addition & 1 deletion services/brig/test/integration/API/Team.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ import Data.Time (addUTCTime, getCurrentTime)
import qualified Data.UUID as UUID (fromString)
import qualified Data.UUID.V4 as UUID
import qualified Galley.Types.Teams as Team
import qualified Galley.Types.Teams.Intra as Team
import Imports
import qualified Network.HTTP.Types as HTTP
import qualified Network.Wai as Wai
Expand All @@ -65,6 +64,7 @@ import Util.AWS as Util
import Web.Cookie (parseSetCookie, setCookieName)
import Wire.API.Asset
import Wire.API.Connection
import qualified Wire.API.Routes.Internal.Galley.TeamsIntra as Team
import Wire.API.Team hiding (newTeam)
import Wire.API.Team.Feature
import qualified Wire.API.Team.Feature as Public
Expand Down
Loading

0 comments on commit 4dafe4c

Please sign in to comment.