Skip to content

Commit

Permalink
WPB-15551 Domain Registration Team Feature (#4429)
Browse files Browse the repository at this point in the history
  • Loading branch information
battermann authored Jan 29, 2025
1 parent bc8fb05 commit f0116ff
Show file tree
Hide file tree
Showing 25 changed files with 226 additions and 73 deletions.
2 changes: 2 additions & 0 deletions cassandra-schema.cql
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,8 @@ CREATE TABLE galley_test.team_features (
conference_calling_one_to_one int,
conference_calling_status int,
digital_signatures int,
domain_registration_lock_status int,
domain_registration_status int,
enforce_file_download_location text,
enforce_file_download_location_lock_status int,
enforce_file_download_location_status int,
Expand Down
1 change: 1 addition & 0 deletions changelog.d/2-features/WPB-15551
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Team feature config for domain registration
4 changes: 4 additions & 0 deletions charts/galley/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,9 @@ data:
limitedEventFanout:
{{- toYaml .settings.featureFlags.limitedEventFanout | nindent 10 }}
{{- end }}
{{- if .settings.featureFlags.domainRegistration }}
domainRegistration:
{{- toYaml .settings.featureFlags.domainRegistration | nindent 10 }}
{{- end }}
{{- end }}
{{- end }}
141 changes: 73 additions & 68 deletions charts/galley/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ resources:
memory: "500Mi"
# This is not supported for production use, only here for testing:
# preStop:
# exec:
# exec:
# command: ["sh", "-c", "curl http://acme.example"]
config:
logLevel: Info
Expand All @@ -26,13 +26,13 @@ config:
cassandra:
host: aws-cassandra
replicaCount: 3
# To enable TLS provide a CA:
# tlsCa: <CA in PEM format (can be self-signed)>
#
# Or refer to an existing secret (containing the CA):
# tlsCaSecretRef:
# name: <secret-name>
# key: <ca-attribute>
# To enable TLS provide a CA:
# tlsCa: <CA in PEM format (can be self-signed)>
#
# Or refer to an existing secret (containing the CA):
# tlsCaSecretRef:
# name: <secret-name>
# key: <ca-attribute>
enableFederation: false # keep in sync with background-worker, brig and cargohold charts' config.enableFederation as well as wire-server chart's tags.federation
# Not used if enableFederation is false
rabbitmq:
Expand Down Expand Up @@ -66,7 +66,7 @@ config:
multiIngress: null
# Disable one ore more API versions. Please make sure the configuration value is the same in all these charts:
# brig, cannon, cargohold, galley, gundeck, proxy, spar.
disabledAPIVersions: [ development ]
disabledAPIVersions: [development]
# The lifetime of a conversation guest link in seconds. Must be a value 0 < x <= 31536000 (365 days)
# Default is 31536000 (365 days) if not set
guestLinkTTLSeconds: 31536000
Expand All @@ -80,7 +80,7 @@ config:
# To disable proteus for new federated conversations:
# federationProtocols: ["mls"]

featureFlags: # see #RefConfigOptions in `/docs/reference` (https://github.com/wireapp/wire-server/)
featureFlags: # see #RefConfigOptions in `/docs/reference` (https://github.com/wireapp/wire-server/)
appLock:
defaults:
config:
Expand Down Expand Up @@ -160,6 +160,10 @@ config:
limitedEventFanout:
defaults:
status: disabled
domainRegistration:
defaults:
status: disabled
lockStatus: locked

aws:
region: "eu-west-1"
Expand All @@ -183,7 +187,8 @@ podSecurityContext:
seccompProfile:
type: RuntimeDefault
tests:
config: {}
config:
{}
# uploadXml:
# baseUrl: s3://bucket/path/

Expand All @@ -193,62 +198,62 @@ tests:

# These "secrets" are only used in tests and are therefore safe to be stored unencrypted
providerPrivateKey: |
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAu+Kg/PHHU3atXrUbKnw0G06FliXcNt3lMwl2os5twEDcPPFw
/feGiAKymxp+7JqZDrseS5D9THGrW+OQRIPHWvUBdiLfGrZqJO223DB6D8K2Su/o
dmnjZJ2z23rhXoEArTplu+Dg9K+c2LVeXTKVVPOaOzgtAB21XKRiQ4ermqgi3/nj
r03rXyq/qNkuNd6tNcg+HAfGxfGvvCSYBfiSbUKr/BeArYRcjzr/h5m1In6fG/if
9GEI6m8dxHT9JbY53wiksowy6ajCuqskIFg87X883H+LA/d6X5CTiPv1VMxXdBUi
GPuC9IT/6CNQ1/LFt0P37ax58+LG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h5m1In6fG/if9GEI6m8dxHT9JbY53wiksowy6ajCuqskIFg8
7X883H+LA/d6X5CTiPv1VMxXdBUiGPuC9IT/6CNQ1/LFt0P37ax58+LGYlaFo7la
nQIDAQAB
-----END PUBLIC KEY-----
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu+Kg/PHHU3atXrUbKnw0
G06FliXcNt3lMwl2os5twEDcPPFw/feGiAKymxp+7JqZDrseS5D9THGrW+OQRIPH
WvUBdiLfGrZqJO223DB6D8K2Su/odmnjZJ2z23rhXoEArTplu+Dg9K+c2LVeXTKV
VPOaOzgtAB21XKRiQ4ermqgi3/njr03rXyq/qNkuNd6tNcg+HAfGxfGvvCSYBfiS
bUKr/BeArYRcjzr/h5m1In6fG/if9GEI6m8dxHT9JbY53wiksowy6ajCuqskIFg8
7X883H+LA/d6X5CTiPv1VMxXdBUiGPuC9IT/6CNQ1/LFt0P37ax58+LGYlaFo7la
nQIDAQAB
-----END PUBLIC KEY-----
providerPublicCert: |
-----BEGIN CERTIFICATE-----
MIIDdjCCAl4CCQCm0AiwERR/qjANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJE
RTEPMA0GA1UECAwGQmVybGluMQ8wDQYDVQQHDAZCZXJsaW4xGDAWBgNVBAoMD1dp
cmUgU3dpc3MgR21iSDERMA8GA1UEAwwId2lyZS5jb20xHzAdBgkqhkiG9w0BCQEW
EGJhY2tlbmRAd2lyZS5jb20wHhcNMTYwODA0MTMxNDQyWhcNMzYwNzMwMTMxNDQy
WjB9MQswCQYDVQQGEwJERTEPMA0GA1UECAwGQmVybGluMQ8wDQYDVQQHDAZCZXJs
aW4xGDAWBgNVBAoMD1dpcmUgU3dpc3MgR21iSDERMA8GA1UEAwwId2lyZS5jb20x
HzAdBgkqhkiG9w0BCQEWEGJhY2tlbmRAd2lyZS5jb20wggEiMA0GCSqGSIb3DQEB
AQUAA4IBDwAwggEKAoIBAQC74qD88cd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MD1dpcmUgU3dpc3MgR21iSDERMA8GA1UEAwwId2lyZS5jb20x
HzAdBgkqhkiG9w0BCQEWEGJhY2tlbmRAd2lyZS5jb20wggEiMA0GCSqGSIb3DQEB
AQUAA4IBDwAwggEKAoIBAQC74qD88cdTdq1etRsqfDQbToWWJdw23eUzCXaizm3A
QNw88XD994aIArKbGn7smpkOux5LkP1Mcatb45BEg8da9QF2It8atmok7bbcMHoP
wrZK7+h2aeNknbPbeuFegQCtOmW74OD0r5zYtV5dMpVU85o7OC0AHbVcpGJDh6ua
qCLf+eOvTetfKr+o2S413q01yD4cB8bF8a+8JJgF+JJtQqv8F4CthFyPOv+HmbUi
fp8b+J/0YQjqbx3EdP0ltjnfCKSyjDLpqMK6qyQgWDztfzzcf4sD93pfkJOI+/VU
zFd0FSIY+4L0hP/oI1DX8sW3Q/ftrHnz4sZiVoWjuVqdAgMBAAEwDQYJKoZIhvcN
AQELBQADggEBAEuwlHElIGR56KVC1dJiw238mDGjMfQzSP76Wi4zWS6/zZwJUuog
BkC+vacfju8UAMvL+vdqkjOVUHor84/2wuq0qn91AjOITD7tRAZB+XLXxsikKv/v
OXE3A/lCiNi882NegPyXAfFPp/71CIiTQZps1eQkAvhD5t5WiFYPESxDlvEJrHFY
XP4+pp8fL8YPS7iZNIq+z+P8yVIw+B/Hs0ht7wFIYN0xACbU8m9+Rs08JMoT16c+
hZMuK3BWD3fzkQVfW0yMwz6fWRXB483ZmekGkgndOTDoJQMdJXZxHpI3t2FcxQYj
T45GXxRd18neXtuYa/OoAw9UQFDN5XfXN0g=
-----END CERTIFICATE-----
12 changes: 12 additions & 0 deletions docs/src/developer/reference/config-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,18 @@ limitedEventFanout:
status: disabled
```

### Domain Registration

This feature flag is per default disabled and locked. It can be set by `ibis` via the internal API and it is not meant to be configured via team management.

```yaml
# galley.yaml
domainRegistration:
defaults:
status: disabled
lockStatus: locked
```

## Settings in brig

Some features (as of the time of writing this: only
Expand Down
4 changes: 4 additions & 0 deletions hack/helm_vars/wire-server/values.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,10 @@ galley:
limitedEventFanout:
defaults:
status: disabled
domainRegistration:
defaults:
status: disabled
lockStatus: locked
journal:
endpoint: http://fake-aws-sqs:4568
queueName: integration-team-events.fifo
Expand Down
1 change: 1 addition & 0 deletions integration/integration.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ library
Test.FeatureFlags.ClassifiedDomains
Test.FeatureFlags.ConferenceCalling
Test.FeatureFlags.DigitalSignatures
Test.FeatureFlags.DomainRegistration
Test.FeatureFlags.EnforceFileDownloadLocation
Test.FeatureFlags.FileSharing
Test.FeatureFlags.GuestLinks
Expand Down
17 changes: 17 additions & 0 deletions integration/test/Test/FeatureFlags/DomainRegistration.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module Test.FeatureFlags.DomainRegistration where

import qualified API.GalleyInternal as Internal
import SetupHelpers
import Test.FeatureFlags.Util
import Testlib.Prelude

testPatchDomainRegistration :: (HasCallStack) => App ()
testPatchDomainRegistration = checkPatch OwnDomain "domainRegistration" enabled

testDomainRegistrationInternal :: (HasCallStack) => App ()
testDomainRegistrationInternal = do
(alice, tid, _) <- createTeam OwnDomain 0
Internal.setTeamFeatureLockStatus alice tid "domainRegistration" "unlocked"
withWebSocket alice $ \ws -> do
setFlag InternalAPI ws tid "domainRegistration" enabled
setFlag InternalAPI ws tid "domainRegistration" disabled
4 changes: 3 additions & 1 deletion integration/test/Test/FeatureFlags/Util.hs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ defAllFeatures =
[ "enforcedDownloadLocation" .= "downloads"
]
],
"limitedEventFanout" .= disabled
"limitedEventFanout" .= disabled,
"domainRegistration" .= disabledLocked
]

hasExplicitLockStatus :: String -> Bool
Expand All @@ -146,6 +147,7 @@ hasExplicitLockStatus "guestLinks" = True
hasExplicitLockStatus "sndFactorPasswordChallenge" = True
hasExplicitLockStatus "outlookCalIntegration" = True
hasExplicitLockStatus "enforceFileDownloadLocation" = True
hasExplicitLockStatus "domainRegistration" = True
hasExplicitLockStatus _ = False

checkFeature :: (HasCallStack, MakesValue user, MakesValue tid) => String -> user -> tid -> Value -> App ()
Expand Down
7 changes: 7 additions & 0 deletions libs/galley-types/src/Galley/Types/Teams.hs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,13 @@ newtype instance FeatureDefaults LimitedEventFanoutConfig
deriving (FromJSON) via Defaults (Feature LimitedEventFanoutConfig)
deriving (ParseFeatureDefaults) via OptionalField LimitedEventFanoutConfig

newtype instance FeatureDefaults DomainRegistrationConfig
= DomainRegistrationConfigDefaults (LockableFeature DomainRegistrationConfig)
deriving stock (Eq, Show)
deriving newtype (Default, GetFeatureDefaults)
deriving (FromJSON) via Defaults (LockableFeature DomainRegistrationConfig)
deriving (ParseFeatureDefaults) via OptionalField DomainRegistrationConfig

featureKey :: forall cfg. (IsFeatureConfig cfg) => Key.Key
featureKey = Key.fromText $ featureName @cfg

Expand Down
1 change: 1 addition & 0 deletions libs/wire-api/src/Wire/API/Routes/Internal/Galley.hs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ type IFeatureAPI =
UserId
:> Get '[JSON] AllTeamFeatures
)
:<|> IFeatureStatusLockStatusPut DomainRegistrationConfig

type InternalAPI = "i" :> InternalAPIBase

Expand Down
1 change: 1 addition & 0 deletions libs/wire-api/src/Wire/API/Routes/Public/Galley/Feature.hs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ type FeatureAPI =
:<|> AllTeamFeaturesTeamGet
:<|> DeprecatedFeatureAPI
:<|> AllDeprecatedFeatureConfigAPI DeprecatedFeatureConfigs
:<|> FeatureAPIGet DomainRegistrationConfig

type DeprecationNotice1 = "This endpoint is potentially used by the old Android client. It is not used by iOS, team management, or webapp as of June 2022"

Expand Down
28 changes: 27 additions & 1 deletion libs/wire-api/src/Wire/API/Team/Feature.hs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ module Wire.API.Team.Feature
MlsMigrationConfig (..),
EnforceFileDownloadLocationConfig (..),
LimitedEventFanoutConfig (..),
DomainRegistrationConfig (..),
Features,
AllFeatures,
NpProject (..),
Expand Down Expand Up @@ -217,6 +218,7 @@ data FeatureSingleton cfg where
FeatureSingletonMlsMigrationConfig :: FeatureSingleton MlsMigrationConfig
FeatureSingletonEnforceFileDownloadLocationConfig :: FeatureSingleton EnforceFileDownloadLocationConfig
FeatureSingletonLimitedEventFanoutConfig :: FeatureSingleton LimitedEventFanoutConfig
FeatureSingletonDomainRegistrationConfig :: FeatureSingleton DomainRegistrationConfig

type family DeprecatedFeatureName cfg :: Symbol

Expand Down Expand Up @@ -1149,6 +1151,29 @@ instance IsFeatureConfig LimitedEventFanoutConfig where
instance ToSchema LimitedEventFanoutConfig where
schema = object "LimitedEventFanoutConfig" objectSchema

--------------------------------------------------------------------------------
-- DomainRegistration feature

-- | This feature does not have a PUT endpoint. See [Note: unsettable features].
data DomainRegistrationConfig = DomainRegistrationConfig
deriving stock (Eq, Show, Generic)
deriving (Arbitrary) via (GenericUniform DomainRegistrationConfig)
deriving (RenderableSymbol) via (RenderableTypeName DomainRegistrationConfig)

instance Default DomainRegistrationConfig where
def = DomainRegistrationConfig

instance ToSchema DomainRegistrationConfig where
schema = object "DomainRegistrationConfig" objectSchema

instance Default (LockableFeature DomainRegistrationConfig) where
def = defLockedFeature

instance IsFeatureConfig DomainRegistrationConfig where
type FeatureSymbol DomainRegistrationConfig = "domainRegistration"
featureSingleton = FeatureSingletonDomainRegistrationConfig
objectSchema = pure DomainRegistrationConfig

----------------------------------------------------------------------
-- FeatureStatus

Expand Down Expand Up @@ -1231,7 +1256,8 @@ type Features =
MlsE2EIdConfig,
MlsMigrationConfig,
EnforceFileDownloadLocationConfig,
LimitedEventFanoutConfig
LimitedEventFanoutConfig,
DomainRegistrationConfig
]

-- | list of available features as a record
Expand Down
1 change: 1 addition & 0 deletions services/galley/galley.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ library
Galley.Schema.V91_TeamMemberDeletedLimitedEventFanout
Galley.Schema.V92_MlsE2EIdConfig
Galley.Schema.V93_ConferenceCallingSftForOneToOne
Galley.Schema.V94_DomainRegistrationConfig
Galley.Types.Clients
Galley.Types.ToUserRole
Galley.Types.UserList
Expand Down
6 changes: 5 additions & 1 deletion services/galley/galley.integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ settings:
# brig, cannon, cargohold, galley, gundeck, proxy, spar.
disabledAPIVersions: []

featureFlags: # see #RefConfigOptions in `/docs/reference`
featureFlags: # see #RefConfigOptions in `/docs/reference`
sso: disabled-by-default
legalhold: whitelist-teams-and-implicit-consent
teamSearchVisibility: disabled-by-default
Expand Down Expand Up @@ -120,6 +120,10 @@ settings:
limitedEventFanout:
defaults:
status: disabled
domainRegistration:
defaults:
status: disabled
lockStatus: locked

logLevel: Warn
logNetStrings: false
Expand Down
Loading

0 comments on commit f0116ff

Please sign in to comment.