Skip to content

Commit c9c2353

Browse files
authored
WPB-5143 locked status for mls config (#3681)
1 parent f304310 commit c9c2353

File tree

17 files changed

+98
-23
lines changed

17 files changed

+98
-23
lines changed

cassandra-schema.cql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,6 +1184,7 @@ CREATE TABLE galley_test.team_features (
11841184
mls_e2eid_lock_status int,
11851185
mls_e2eid_status int,
11861186
mls_e2eid_ver_exp timestamp,
1187+
mls_lock_status int,
11871188
mls_migration_finalise_regardless_after timestamp,
11881189
mls_migration_lock_status int,
11891190
mls_migration_start_time timestamp,
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
The mls team feature now has a lock status. If the current installation has default settings defined in wire-server's `values.yaml`, the `lockStatus` has to be added, e.g.:
2+
3+
```yaml
4+
mls:
5+
defaults:
6+
status: enabled
7+
config:
8+
protocolToggleUsers: []
9+
defaultProtocol: mls
10+
allowedCipherSuites: [1]
11+
defaultCipherSuite: 1
12+
supportedProtocols: [proteus, mls] # must contain defaultProtocol
13+
lockStatus: locked
14+
```

changelog.d/2-features/WPB-5143

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The mls team feature now has a lock status

charts/galley/values.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ config:
4141
conversationCodeURI: null
4242
#
4343
# `multiIngress` is a `Z-Host` depended setting of conversationCodeURI.
44-
# Use this only if you want to expose the instance on mutliple ingresses.
44+
# Use this only if you want to expose the instance on multiple ingresses.
4545
# If set it must a map from `Z-Host` to URI prefix
4646
# Example:
47-
# multiIngress:
47+
# multiIngress:
4848
# example.com: https://accounts.example.com/conversation-join/
4949
# example.net: https://accounts.example.net/conversation-join/
5050
multiIngress: null
@@ -83,6 +83,7 @@ config:
8383
allowedCipherSuites: [1]
8484
defaultCipherSuite: 1
8585
supportedProtocols: [proteus, mls] # must contain defaultProtocol
86+
lockStatus: unlocked
8687
searchVisibilityInbound:
8788
defaults:
8889
status: disabled

docs/src/developer/reference/config-options.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -299,17 +299,18 @@ If this feature is disabled then clients will use the Proteus protocol with this
299299

300300
The default configuration that applies to all teams that didn't explicitly change their feature configuration can be given in galley's `featureFlags` section in the config file:
301301

302-
```
302+
```yaml
303303
# galley.yaml
304304
mls:
305305
defaults:
306-
status: disabled
306+
status: enabled
307307
config:
308308
protocolToggleUsers: []
309-
defaultProtocol: proteus
309+
defaultProtocol: mls
310310
allowedCipherSuites: [1]
311311
defaultCipherSuite: 1
312-
312+
supportedProtocols: [proteus, mls] # must contain defaultProtocol
313+
lockStatus: locked
313314
```
314315

315316
This default configuration can be overriden on a per-team basis through the [feature config API](../developer/features.md)
@@ -748,7 +749,7 @@ to the configuration example above:
748749

749750
![Sequence Diagram: Alice and Bob download an asset](./multi-ingress-example-sequence.svg)
750751

751-
<!--
752+
<!--
752753
Unfortunately, kroki currently doesn't work on our CI: SQPIT-1810
753754
Link to diagram:
754755
https://mermaid.live/edit#pako:eNrdVbFu2zAQ_ZUDJ7ewDdhtUkBDgBRB0CHIYCNL4eVEnmWiMk8lKbttkH8vJbsW5dCOUXSqBkHiPT6-e3yinoVkRSITEC5H32syku40FhbXCwP7C6VnC1hqSQNL6l1XeWRPwBuKqxk8OXKwpRyrahxGxvQD11VJY8mvSHPOB4UlMknSrtonbcfStBVar6Wu0HjQJgCdGwUNKfaonMGMax8WeH9acIq5FXKOuwVE7BcqN4U2v9IlibbgFZcqXZ5_ABeMxYK6uiXpwRb5YHp1NYTJ9FN7ixw3jW6ri5UHXva28rZ5BsVbUzIqB-gc-WgTD9DRzU3Pz7v9FChZYnk8L4KGiW23Gdyz3aJVQW7IoYvQbT3gDq2_wsIIbpWCr6MvHF5WhIpsL2p6g6HFhHePvdajFR6Yv0Fd7ZTDquF9mj3AMoR2t0zHcZg1CiJj92akdGP-OLBJ9JpDFOa73YGNxnRAFZ3Te9rxey5L3gZHdmueMrsLyBnHDwpScerGQr_9dn1tzfFeR_2k2MioRFIn15MhTD82Sb0-ndT4fPjM-emcdsDItf23eVlSW_D_ltXYv0uzenTknU_rOd_fzOsfy_9xYvtN_21ixVCsya5Rq_D3fG6KC-FXtKaFyMKjoiXWpV-IhXkJUKw9z38aKTJvaxqKulKBff-jFdkSS0cvvwHKl250
@@ -761,21 +762,21 @@ For conversation invite links to be correct in a multi-ingress setup `settings.m
761762
Example:
762763

763764
```yaml
764-
multiIngress:
765+
multiIngress:
765766
red.example.com: https://accounts.red.example.com/conversation-join/
766767
green.example.com: https://accounts.green.example.net/conversation-join/
767768
```
768769

769770
### Webapp
770771

771-
The webapp runs its own web server (a NodeJS server) to serve static files and the webapp config (based on environment variables).
772-
In a multi-ingress configuration, a single webapp instance will be deployed and be accessible from multiple domains (say `webapp.red.example.com` and `webapp.green.example.com`).
773-
When the webapp is loaded from one of those domains it first does a request to the web server to get the config (that will give it, for example, the backend endpoint that it should hit).
772+
The webapp runs its own web server (a NodeJS server) to serve static files and the webapp config (based on environment variables).
773+
In a multi-ingress configuration, a single webapp instance will be deployed and be accessible from multiple domains (say `webapp.red.example.com` and `webapp.green.example.com`).
774+
When the webapp is loaded from one of those domains it first does a request to the web server to get the config (that will give it, for example, the backend endpoint that it should hit).
774775

775-
Because of the single instance nature of the webapp, by default the configuration is static and the root url to the backend API can be set there (say `nginz-https.root.example.com`).
776+
Because of the single instance nature of the webapp, by default the configuration is static and the root url to the backend API can be set there (say `nginz-https.root.example.com`).
776777
In order to completely hide this root domain to the webapp, an environment variable can be set to allow the webapp hostname to be used to generate the API endpoint, team settings links, account page links and CSP headers.
777778

778-
The "hostname" is the result of the domain name minus the `webapp.` part of it.
779+
The "hostname" is the result of the domain name minus the `webapp.` part of it.
779780
So querying the webapp on `webapp.red.example.com` will resolve to `red.example.com`.
780781

781782
To enable dynamic hostname replacement, first set this variable:
@@ -784,7 +785,7 @@ To enable dynamic hostname replacement, first set this variable:
784785
ENABLE_DYNAMIC_HOSTNAME="true"
785786
```
786787

787-
Then, any other variable that will contain the string `[[hostname]]` will be replaced by the hostname of the running webapp. (eg. if a webapp is running on `webapp.red.example.com` then any occurrence of `[[hostname]]` in the config will be replaced by `red.example.com`).
788+
Then, any other variable that will contain the string `[[hostname]]` will be replaced by the hostname of the running webapp. (eg. if a webapp is running on `webapp.red.example.com` then any occurrence of `[[hostname]]` in the config will be replaced by `red.example.com`).
788789

789790
You may use the template variable `[[hostname]]` in any environment variable to not provide (reveal) actual domain names.
790791

libs/galley-types/src/Galley/Types/Teams.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ data FeatureFlags = FeatureFlags
162162
_flagsTeamFeatureValidateSAMLEmailsStatus :: !(Defaults (ImplicitLockStatus ValidateSAMLEmailsConfig)),
163163
_flagTeamFeatureSndFactorPasswordChallengeStatus :: !(Defaults (WithStatus SndFactorPasswordChallengeConfig)),
164164
_flagTeamFeatureSearchVisibilityInbound :: !(Defaults (ImplicitLockStatus SearchVisibilityInboundConfig)),
165-
_flagMLS :: !(Defaults (ImplicitLockStatus MLSConfig)),
165+
_flagMLS :: !(Defaults (WithStatus MLSConfig)),
166166
_flagOutlookCalIntegration :: !(Defaults (WithStatus OutlookCalIntegrationConfig)),
167167
_flagMlsE2EId :: !(Defaults (WithStatus MlsE2EIdConfig)),
168168
_flagMlsMigration :: !(Defaults (WithStatus MlsMigrationConfig))
@@ -214,7 +214,7 @@ instance FromJSON FeatureFlags where
214214
<*> withImplicitLockStatusOrDefault obj "validateSAMLEmails"
215215
<*> (fromMaybe (Defaults (defFeatureStatus @SndFactorPasswordChallengeConfig)) <$> (obj .:? "sndFactorPasswordChallenge"))
216216
<*> withImplicitLockStatusOrDefault obj "searchVisibilityInbound"
217-
<*> withImplicitLockStatusOrDefault obj "mls"
217+
<*> (fromMaybe (Defaults (defFeatureStatus @MLSConfig)) <$> (obj .:? "mls"))
218218
<*> (fromMaybe (Defaults (defFeatureStatus @OutlookCalIntegrationConfig)) <$> (obj .:? "outlookCalIntegration"))
219219
<*> (fromMaybe (Defaults (defFeatureStatus @MlsE2EIdConfig)) <$> (obj .:? "mlsE2EId"))
220220
<*> (fromMaybe (Defaults (defFeatureStatus @MlsMigrationConfig)) <$> (obj .:? "mlsMigration"))

libs/galley-types/test/unit/Test/Galley/Types.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ instance Arbitrary FeatureFlags where
9595
<*> fmap (fmap unlocked) arbitrary
9696
<*> arbitrary
9797
<*> fmap (fmap unlocked) arbitrary
98-
<*> fmap (fmap unlocked) arbitrary
98+
<*> arbitrary
9999
<*> arbitrary
100100
<*> arbitrary
101101
<*> arbitrary

libs/wire-api/src/Wire/API/Routes/Internal/Galley.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ type IFeatureAPI =
136136
:<|> IFeatureStatusGet MLSConfig
137137
:<|> IFeatureStatusPut '[] '() MLSConfig
138138
:<|> IFeatureStatusPatch '[] '() MLSConfig
139+
:<|> IFeatureStatusLockStatusPut MLSConfig
139140
-- ExposeInvitationURLsToTeamAdminConfig
140141
:<|> IFeatureStatusGet ExposeInvitationURLsToTeamAdminConfig
141142
:<|> IFeatureStatusPut '[] '() ExposeInvitationURLsToTeamAdminConfig

services/galley/galley.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ library
273273
Galley.Schema.V86_TeamFeatureMlsMigration
274274
Galley.Schema.V87_TeamFeatureSupportedProtocols
275275
Galley.Schema.V88_RemoveMemberClientAndTruncateMLSGroupMemberClient
276+
Galley.Schema.V89_MlsLockStatus
276277
Galley.Types.Clients
277278
Galley.Types.ToUserRole
278279
Galley.Types.UserList

services/galley/src/Galley/API/Internal.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ featureAPI =
206206
<@> mkNamedAPI @'("iget", MLSConfig) (getFeatureStatus DontDoAuth)
207207
<@> mkNamedAPI @'("iput", MLSConfig) setFeatureStatusInternal
208208
<@> mkNamedAPI @'("ipatch", MLSConfig) patchFeatureStatusInternal
209+
<@> mkNamedAPI @'("ilock", MLSConfig) (updateLockStatus @MLSConfig)
209210
<@> mkNamedAPI @'("iget", ExposeInvitationURLsToTeamAdminConfig) (getFeatureStatus DontDoAuth)
210211
<@> mkNamedAPI @'("iput", ExposeInvitationURLsToTeamAdminConfig) setFeatureStatusInternal
211212
<@> mkNamedAPI @'("ipatch", ExposeInvitationURLsToTeamAdminConfig) patchFeatureStatusInternal

0 commit comments

Comments
 (0)