Skip to content

Commit 32c486d

Browse files
committed
Small clean-up.
1 parent 260601e commit 32c486d

File tree

6 files changed

+25
-29
lines changed

6 files changed

+25
-29
lines changed

charts/galley/values.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,13 @@ config:
3838
enforceAppLock: false
3939
inactivityTimeoutSecs: 60
4040
status: enabled
41-
ttl: unlimited
4241
classifiedDomains:
4342
config:
4443
domains: []
4544
status: disabled
46-
ttl: unlimited
4745
conferenceCalling:
4846
defaults:
4947
status: enabled
50-
ttl: unlimited
5148
conversationGuestLinks:
5249
defaults:
5350
lockStatus: unlocked
@@ -56,7 +53,6 @@ config:
5653
defaults:
5754
lockStatus: unlocked
5855
status: enabled
59-
ttl: unlimited
6056
legalhold: disabled-by-default
6157
mls:
6258
defaults:

libs/wire-api/src/Wire/API/Team/Feature.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ instance (ToSchema cfg, IsFeatureConfig cfg) => ToSchema (WithStatusNoLock cfg)
326326
WithStatusNoLock
327327
<$> wssStatus .= field "status" schema
328328
<*> wssConfig .= objectSchema @cfg
329-
<*> wssTTL .= field "ttl" schema
329+
<*> wssTTL .= (fromMaybe FeatureTTLUnlimited <$> optField "ttl" schema)
330330
where
331331
inner = schema @cfg
332332
name = fromMaybe "" (getName (schemaDoc inner)) <> ".WithStatusNoLock"
@@ -383,7 +383,7 @@ instance ToSchema FeatureTTL where
383383
fromTTL :: FeatureTTL -> Maybe A.Value
384384
fromTTL FeatureTTLUnlimited = Just "unlimited"
385385
fromTTL (FeatureTTLSeconds 0) = Just "unlimited"
386-
fromTTL (FeatureTTLSeconds s) = A.decode . toByteString $ s
386+
fromTTL (FeatureTTLSeconds s) = Just $ A.toJSON s
387387

388388
instance ToHttpApiData FeatureTTL where
389389
toQueryParam = T.decodeUtf8 . toByteString'

libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/WithStatusPatch_team.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{-# LANGUAGE OverloadedLists #-}
2-
{-# OPTIONS_GHC -Wno-deferred-out-of-scope-variables #-}
32

43
-- This file is part of the Wire Server implementation.
54
--

libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/WithStatus_team.hs

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,55 +21,59 @@ module Test.Wire.API.Golden.Generated.WithStatus_team where
2121

2222
import Data.Domain
2323
import Imports
24-
import Wire.API.Team.Feature
24+
import Wire.API.Team.Feature hiding (withStatus)
25+
import qualified Wire.API.Team.Feature as F
2526

2627
testObject_WithStatus_team_1 :: WithStatus AppLockConfig
27-
testObject_WithStatus_team_1 = withStatus FeatureStatusEnabled LockStatusUnlocked (AppLockConfig (EnforceAppLock False) (-98)) FeatureTTLUnlimited
28+
testObject_WithStatus_team_1 = withStatus FeatureStatusEnabled LockStatusUnlocked (AppLockConfig (EnforceAppLock False) (-98))
2829

2930
testObject_WithStatus_team_2 :: WithStatus AppLockConfig
30-
testObject_WithStatus_team_2 = withStatus FeatureStatusEnabled LockStatusUnlocked (AppLockConfig (EnforceAppLock True) 0) FeatureTTLUnlimited
31+
testObject_WithStatus_team_2 = withStatus FeatureStatusEnabled LockStatusUnlocked (AppLockConfig (EnforceAppLock True) 0)
3132

3233
testObject_WithStatus_team_3 :: WithStatus AppLockConfig
33-
testObject_WithStatus_team_3 = withStatus FeatureStatusEnabled LockStatusLocked (AppLockConfig (EnforceAppLock True) 111) FeatureTTLUnlimited
34+
testObject_WithStatus_team_3 = withStatus FeatureStatusEnabled LockStatusLocked (AppLockConfig (EnforceAppLock True) 111)
3435

3536
testObject_WithStatus_team_4 :: WithStatus SelfDeletingMessagesConfig
36-
testObject_WithStatus_team_4 = withStatus FeatureStatusEnabled LockStatusUnlocked (SelfDeletingMessagesConfig (-97)) FeatureTTLUnlimited
37+
testObject_WithStatus_team_4 = withStatus FeatureStatusEnabled LockStatusUnlocked (SelfDeletingMessagesConfig (-97))
3738

3839
testObject_WithStatus_team_5 :: WithStatus SelfDeletingMessagesConfig
39-
testObject_WithStatus_team_5 = withStatus FeatureStatusEnabled LockStatusUnlocked (SelfDeletingMessagesConfig 0) FeatureTTLUnlimited
40+
testObject_WithStatus_team_5 = withStatus FeatureStatusEnabled LockStatusUnlocked (SelfDeletingMessagesConfig 0)
4041

4142
testObject_WithStatus_team_6 :: WithStatus SelfDeletingMessagesConfig
42-
testObject_WithStatus_team_6 = withStatus FeatureStatusEnabled LockStatusLocked (SelfDeletingMessagesConfig 77) FeatureTTLUnlimited
43+
testObject_WithStatus_team_6 = withStatus FeatureStatusEnabled LockStatusLocked (SelfDeletingMessagesConfig 77)
4344

4445
testObject_WithStatus_team_7 :: WithStatus ClassifiedDomainsConfig
45-
testObject_WithStatus_team_7 = withStatus FeatureStatusEnabled LockStatusLocked (ClassifiedDomainsConfig []) FeatureTTLUnlimited
46+
testObject_WithStatus_team_7 = withStatus FeatureStatusEnabled LockStatusLocked (ClassifiedDomainsConfig [])
4647

4748
testObject_WithStatus_team_8 :: WithStatus ClassifiedDomainsConfig
48-
testObject_WithStatus_team_8 = withStatus FeatureStatusEnabled LockStatusLocked (ClassifiedDomainsConfig [Domain "example.com", Domain "test.foobar"]) FeatureTTLUnlimited
49+
testObject_WithStatus_team_8 = withStatus FeatureStatusEnabled LockStatusLocked (ClassifiedDomainsConfig [Domain "example.com", Domain "test.foobar"])
4950

5051
testObject_WithStatus_team_9 :: WithStatus ClassifiedDomainsConfig
51-
testObject_WithStatus_team_9 = withStatus FeatureStatusEnabled LockStatusUnlocked (ClassifiedDomainsConfig [Domain "test.foobar"]) FeatureTTLUnlimited
52+
testObject_WithStatus_team_9 = withStatus FeatureStatusEnabled LockStatusUnlocked (ClassifiedDomainsConfig [Domain "test.foobar"])
5253

5354
testObject_WithStatus_team_10 :: WithStatus SSOConfig
54-
testObject_WithStatus_team_10 = withStatus FeatureStatusDisabled LockStatusLocked SSOConfig FeatureTTLUnlimited
55+
testObject_WithStatus_team_10 = withStatus FeatureStatusDisabled LockStatusLocked SSOConfig
5556

5657
testObject_WithStatus_team_11 :: WithStatus SearchVisibilityAvailableConfig
57-
testObject_WithStatus_team_11 = withStatus FeatureStatusEnabled LockStatusLocked SearchVisibilityAvailableConfig FeatureTTLUnlimited
58+
testObject_WithStatus_team_11 = withStatus FeatureStatusEnabled LockStatusLocked SearchVisibilityAvailableConfig
5859

5960
testObject_WithStatus_team_12 :: WithStatus ValidateSAMLEmailsConfig
60-
testObject_WithStatus_team_12 = withStatus FeatureStatusDisabled LockStatusLocked ValidateSAMLEmailsConfig FeatureTTLUnlimited
61+
testObject_WithStatus_team_12 = withStatus FeatureStatusDisabled LockStatusLocked ValidateSAMLEmailsConfig
6162

6263
testObject_WithStatus_team_13 :: WithStatus DigitalSignaturesConfig
63-
testObject_WithStatus_team_13 = withStatus FeatureStatusEnabled LockStatusLocked DigitalSignaturesConfig FeatureTTLUnlimited
64+
testObject_WithStatus_team_13 = withStatus FeatureStatusEnabled LockStatusLocked DigitalSignaturesConfig
6465

6566
testObject_WithStatus_team_14 :: WithStatus ConferenceCallingConfig
66-
testObject_WithStatus_team_14 = withStatus FeatureStatusDisabled LockStatusUnlocked ConferenceCallingConfig FeatureTTLUnlimited
67+
testObject_WithStatus_team_14 = withStatus FeatureStatusDisabled LockStatusUnlocked ConferenceCallingConfig
6768

6869
testObject_WithStatus_team_15 :: WithStatus GuestLinksConfig
69-
testObject_WithStatus_team_15 = withStatus FeatureStatusEnabled LockStatusUnlocked GuestLinksConfig FeatureTTLUnlimited
70+
testObject_WithStatus_team_15 = withStatus FeatureStatusEnabled LockStatusUnlocked GuestLinksConfig
7071

7172
testObject_WithStatus_team_16 :: WithStatus SndFactorPasswordChallengeConfig
72-
testObject_WithStatus_team_16 = withStatus FeatureStatusDisabled LockStatusUnlocked SndFactorPasswordChallengeConfig FeatureTTLUnlimited
73+
testObject_WithStatus_team_16 = withStatus FeatureStatusDisabled LockStatusUnlocked SndFactorPasswordChallengeConfig
7374

7475
testObject_WithStatus_team_17 :: WithStatus SearchVisibilityInboundConfig
75-
testObject_WithStatus_team_17 = withStatus FeatureStatusEnabled LockStatusUnlocked SearchVisibilityInboundConfig FeatureTTLUnlimited
76+
testObject_WithStatus_team_17 = withStatus FeatureStatusEnabled LockStatusUnlocked SearchVisibilityInboundConfig
77+
78+
withStatus :: FeatureStatus -> LockStatus -> cfg -> WithStatus cfg
79+
withStatus fs ls cfg = F.withStatus fs ls cfg FeatureTTLUnlimited

services/galley/src/Galley/Cassandra/TeamFeatures.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ instance FeatureStatusCassandra AppLockConfig where
176176
WithStatusNoLock
177177
<$> mStatus
178178
<*> (AppLockConfig <$> mEnforce <*> mTimeout)
179-
<*> Nothing -- Should we future-proof this by actually quyerying TTL?
179+
<*> Nothing -- TODO: Should we future-proof this by actually quyerying TTL?
180180
where
181181
select :: PrepQuery R (Identity TeamId) (Maybe FeatureStatus, Maybe EnforceAppLock, Maybe Int32)
182182
select =

services/galley/test/integration/API/Util/TeamFeature.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,7 @@ putTeamFeatureFlagInternalWithGalleyAndMod galley reqmod tid status =
219219
galley
220220
. paths ["i", "teams", toByteString' tid, "features", Public.featureNameBS @cfg]
221221
. json status
222-
. query [("ttl", justBS . Public.wssTTL $ status)]
223222
. reqmod
224-
where
225-
justBS = Just . toByteString'
226223

227224
setLockStatusInternal ::
228225
forall cfg.

0 commit comments

Comments
 (0)