Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
95cc4f7
Remove unused setEnableDevelopmentVersions option
pcapriotti Dec 12, 2023
1866995
Version expressions in brig config
pcapriotti Dec 13, 2023
4c205d3
Implement FromJSON instance for VersionExp
pcapriotti Dec 14, 2023
f91ae2f
Introduce VersionExp to all other services
pcapriotti Dec 15, 2023
415d635
WIP: tests
pcapriotti Dec 19, 2023
6108fa1
Merge remote-tracking branch 'origin/develop' into pcapriotti/disable…
battermann Jan 15, 2024
e6a183e
fix test
battermann Jan 15, 2024
312f8d1
finish test
battermann Jan 15, 2024
c3f0f84
linting
battermann Jan 15, 2024
ef740fe
ported other tests
battermann Jan 15, 2024
a79e406
wip disable dev version per default (brig only)
battermann Jan 15, 2024
f0047f7
list -> set, renaming
battermann Jan 16, 2024
d82c74a
enable all api versions locally and on CI
battermann Jan 16, 2024
b3da682
updated docs
battermann Jan 16, 2024
a478bbc
cannon: disable dev api per default
battermann Jan 16, 2024
445e3e0
cargohold: disable dev api per default
battermann Jan 16, 2024
d010fe0
Update docs/src/developer/reference/config-options.md
battermann Jan 19, 2024
a27f8db
galley: disable dev api per default
battermann Jan 16, 2024
30cb616
Merge remote-tracking branch 'origin/develop' into pcapriotti/disable…
battermann Jan 19, 2024
a9739a8
added comments
battermann Jan 19, 2024
fd5d86d
clean up
battermann Jan 19, 2024
d75269e
gundeck: dev API version disabled by default
battermann Jan 22, 2024
9a6bd83
using HasTests instance
battermann Jan 22, 2024
44ede41
proxy: disable dev API version per default
battermann Jan 22, 2024
a4ac4f2
spar: disable dev API version per default
battermann Jan 22, 2024
d928ee9
changelog
battermann Jan 22, 2024
9cbfe12
improve docs and release notes
battermann Jan 22, 2024
d3cf419
Update charts/brig/values.yaml
battermann Jan 23, 2024
03a4ef2
Update charts/cannon/values.yaml
battermann Jan 23, 2024
c5dedd4
Update charts/cargohold/values.yaml
battermann Jan 23, 2024
95b0646
Update charts/galley/values.yaml
battermann Jan 23, 2024
a8c2143
Update charts/gundeck/values.yaml
battermann Jan 23, 2024
1d2b236
Update charts/proxy/values.yaml
battermann Jan 23, 2024
7012688
Update charts/spar/values.yaml
battermann Jan 23, 2024
89de98f
small clean up and comment
battermann Jan 23, 2024
92f0e64
Merge remote-tracking branch 'origin/develop' into pcapriotti/disable…
battermann Jan 24, 2024
6ea88ec
hi ci
battermann Jan 24, 2024
7277a22
fix cannon's config for CI
battermann Jan 25, 2024
13982c0
to be removed: check Helm value propagation on CI
stefanwire Jan 25, 2024
c544fe8
revert version expression
battermann Jan 25, 2024
b04c137
remove comment in default charts
battermann Jan 25, 2024
e9a1e7f
revert changes in CI values
battermann Jan 25, 2024
da26fa4
revert changes in local configs
battermann Jan 25, 2024
b198be9
removed release notes
battermann Jan 25, 2024
8c5a3e7
brig: new flag to enable dev API
battermann Jan 26, 2024
7fb4fb6
add enableDevAPI flag to all services
battermann Jan 26, 2024
8fb59fb
renamed flag
battermann Jan 26, 2024
de47b1a
fixes
battermann Jan 26, 2024
467feb2
hi ci
stefanwire Jan 26, 2024
41cda08
Revert "fix cannon's config for CI"
battermann Jan 29, 2024
c28ee81
made disabledAPIversions required, removed VersionExpSetDefaultDev
battermann Jan 29, 2024
923a7a8
set default for disabledAPIVersions in template
battermann Jan 29, 2024
95e3b66
fix gundeck config and remove redundant test
battermann Jan 29, 2024
a5d757d
Merge remote-tracking branch 'origin/develop' into pcapriotti/disable…
battermann Jan 29, 2024
e6d6ecd
changelog and docs
battermann Jan 29, 2024
e6a7423
Fix whitespace in galley configmap
pcapriotti Jan 29, 2024
4b144f8
fix values.yaml.gotmpl
battermann Jan 29, 2024
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
3 changes: 3 additions & 0 deletions changelog.d/0-release-notes/WPB-4657
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The settings `setDisabledAPIVersions` (brig) and `disabledAPIVersions` (in cannon, cargohold, galley, gundeck, proxy, and spar) are now required.
The default defined in `charts/<service>/values.yaml` is set to `[ development ]` and disables all development API versions.
For more information see <https://docs.wire.com/developer/reference/config-options.html#disabling-api-versions>
1 change: 1 addition & 0 deletions changelog.d/5-internal/WPB-4657
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The development API version is now disabled by default
2 changes: 0 additions & 2 deletions charts/brig/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,7 @@ data:
{{- if .setOAuthEnabled }}
setOAuthEnabled: {{ .setOAuthEnabled }}
{{- end }}
{{- if .setDisabledAPIVersions }}
setDisabledAPIVersions: {{ .setDisabledAPIVersions }}
{{- end }}
{{- if .setOAuthRefreshTokenExpirationTimeSecs }}
setOAuthRefreshTokenExpirationTimeSecs: {{ .setOAuthRefreshTokenExpirationTimeSecs }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion charts/brig/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ config:
setOAuthMaxActiveRefreshTokens: 10
# 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.
# setDisabledAPIVersions: [ v3 ]
setDisabledAPIVersions: [ development ]
setFederationStrategy: allowNone
setFederationDomainConfigsUpdateFreq: 10
smtp:
Expand Down
2 changes: 0 additions & 2 deletions charts/cannon/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ data:
millisecondsBetweenBatches: {{ .Values.config.drainOpts.millisecondsBetweenBatches }}
minBatchSize: {{ .Values.config.drainOpts.minBatchSize }}

{{- if .Values.config.disabledAPIVersions }}
disabledAPIVersions: {{ .Values.config.disabledAPIVersions }}
{{- end }}

kind: ConfigMap
metadata:
Expand Down
2 changes: 1 addition & 1 deletion charts/cannon/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ config:

# 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: [ v3 ]
disabledAPIVersions: [ development ]

metrics:
serviceMonitor:
Expand Down
2 changes: 0 additions & 2 deletions charts/cargohold/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,5 @@ data:
downloadLinkTTL: {{ .downloadLinkTTL }}
{{- end }}
federationDomain: {{ .federationDomain }}
{{- if .disabledAPIVersions }}
disabledAPIVersions: {{ .disabledAPIVersions }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/cargohold/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ config:
downloadLinkTTL: 300 # Seconds
# 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: [ v3 ]
disabledAPIVersions: [ development ]

serviceAccount:
# When setting this to 'false', either make sure that a service account named
Expand Down
4 changes: 1 addition & 3 deletions charts/galley/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,8 @@ data:
removal:
ed25519: "/etc/wire/galley/secrets/removal_ed25519.pem"
{{- end }}
{{- end -}}
{{- if .settings.disabledAPIVersions }}
disabledAPIVersions: {{ .settings.disabledAPIVersions }}
{{- end }}
disabledAPIVersions: {{ .settings.disabledAPIVersions }}
{{- if .settings.featureFlags }}
{{- if .settings.guestLinkTTLSeconds }}
guestLinkTTLSeconds: {{ .settings.guestLinkTTLSeconds }}
Expand Down
2 changes: 1 addition & 1 deletion charts/galley/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,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: [ v3 ]
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 Down
2 changes: 0 additions & 2 deletions charts/gundeck/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ data:
{{- if hasKey . "perNativePushConcurrency" }}
perNativePushConcurrency: {{ .perNativePushConcurrency }}
{{- end }}
{{- if .disabledAPIVersions }}
disabledAPIVersions: {{ .disabledAPIVersions }}
{{- end }}
# disabledAPIVersions: [ 2 ]
maxConcurrentNativePushes:
soft: {{ .maxConcurrentNativePushes.soft }}
Expand Down
2 changes: 1 addition & 1 deletion charts/gundeck/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ config:
soft: 1000
# 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: [ v3 ]
disabledAPIVersions: [ development ]

# Maximum number of bytes loaded into memory when fetching (referenced) payloads.
# Gundeck will return a truncated page if the whole page's payload sizes would exceed this limit in total.
Expand Down
2 changes: 0 additions & 2 deletions charts/proxy/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ data:
logFormat: {{ .Values.config.logFormat }}
logLevel: {{ .Values.config.logLevel }}
logNetStrings: {{ .Values.config.logNetStrings }}
{{- if .Values.config.disabledAPIVersions }}
disabledAPIVersions: {{ .Values.config.disabledAPIVersions }}
{{- end }}
host: 0.0.0.0
port: {{ .Values.service.internalPort }}
httpPoolSize: 1000
Expand Down
2 changes: 1 addition & 1 deletion charts/proxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ config:
proxy: {}
# 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: [ v3 ]
disabledAPIVersions: [ development ]

podSecurityContext:
allowPrivilegeEscalation: false
Expand Down
2 changes: 0 additions & 2 deletions charts/spar/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ data:

maxScimTokens: {{ .maxScimTokens }}

{{- if .disabledAPIVersions }}
disabledAPIVersions: {{ .disabledAPIVersions }}
{{- end }}

saml:
version: SAML2.0
Expand Down
2 changes: 1 addition & 1 deletion charts/spar/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ config:
proxy: {}
# 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: [ v3 ]
disabledAPIVersions: [ development ]

podSecurityContext:
allowPrivilegeEscalation: false
Expand Down
19 changes: 11 additions & 8 deletions docs/src/developer/reference/config-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -591,10 +591,6 @@ See {ref}`configure-federation-strategy-in-brig` (since [PR#3260](https://github

### API Versioning

#### `setEnableDevelopmentVersions`

This options determines whether development versions should be enabled. If set to `False`, all development versions are removed from the `supported` field of the `/api-version` endpoint. Note that they are still listed in the `development` field, and continue to work normally.

### OAuth

For more information on OAuth please refer to <https://docs.wire.com/developer/reference/oauth.html>.
Expand Down Expand Up @@ -654,10 +650,9 @@ It is possible to disable one ore more API versions. When an API version is disa

Each of the services brig, cannon, cargohold, galley, gundeck, proxy, spar should to be configured with the same set of disable API versions in each service's values.yaml config files.


For example to disable API version v3, you need to configure:

```
```yaml
# brig's values.yaml
config.optSettings.setDisabledAPIVersions: [ v3 ]

Expand All @@ -671,7 +666,7 @@ config.settings.disabledAPIVersions: [ v3 ]
config.settings.disabledAPIVersions: [ v3 ]

# gundecks' values.yaml
config.disabledAPIVersions: [ v3 ]
config.settings.disabledAPIVersions: [ v3 ]

# proxy's values.yaml
config.disabledAPIVersions: [ v3 ]
Expand All @@ -680,7 +675,15 @@ config.disabledAPIVersions: [ v3 ]
config.disabledAPIVersions: [ v3 ]
```

The default setting is that no API version is disabled.
The development API version(s) can be disabled either explicitly or by adding the `development` keyword to the list of disabled API versions. E.g.:

```yaml
config.disabledAPIVersions: [ v3, development ]
```

This setting is required to be present for all the services (brig, cannon, cargohold, galley, gundeck, proxy, and spar).

The default value (provided under `charts/<service>/values.yaml`) is `[ development ]` and disables the development versions. To enable all versions including the development versions set the value to be empty: `[]`.

## Settings in cargohold

Expand Down
10 changes: 10 additions & 0 deletions hack/helm_vars/wire-server/values.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ brig:
setFederationDomain: integration.example.com
setFederationStrategy: allowAll
setFederationDomainConfigsUpdateFreq: 10
setDisabledAPIVersions: []
set2FACodeGenerationDelaySecs: 5
setNonceTtlSecs: 300
setDpopMaxSkewSecs: 1
Expand Down Expand Up @@ -169,6 +170,8 @@ cannon:
limits:
memory: 512Mi
drainTimeout: 0
config:
disabledAPIVersions: []
cargohold:
replicaCount: 1
imagePullPolicy: {{ .Values.imagePullPolicy }}
Expand All @@ -184,6 +187,7 @@ cargohold:
settings:
# See helmfile for the real value
federationDomain: integration.example.com
disabledAPIVersions: []
secrets:
awsKeyId: dummykey
awsSecretKey: dummysecret
Expand Down Expand Up @@ -218,6 +222,8 @@ galley:
conversationCodeURI: https://kube-staging-nginz-https.zinfra.io/conversation-join/
# See helmfile for the real value
federationDomain: integration.example.com
disabledAPIVersions: []

featureFlags:
sso: disabled-by-default # this needs to be the default; tests can enable it when needed.
legalhold: whitelist-teams-and-implicit-consent
Expand Down Expand Up @@ -289,6 +295,7 @@ gundeck:
queueName: integration-gundeck-events
sqsEndpoint: http://fake-aws-sqs:4568
snsEndpoint: http://fake-aws-sns:4575
disabledAPIVersions: []
bulkPush: true
setMaxConcurrentNativePushes:
hard: 30
Expand Down Expand Up @@ -341,6 +348,8 @@ proxy:
giphy = "..."
spotify = "Basic ..."
}
config:
disabledAPIVersions: []
spar:
replicaCount: 1
imagePullPolicy: {{ .Values.imagePullPolicy }}
Expand Down Expand Up @@ -368,6 +377,7 @@ spar:
- type: ContactSupport
company: Example Company
email: email:backend+spar@wire.com
disabledAPIVersions: []
tests:
{{- if .Values.uploadXml }}
config:
Expand Down
1 change: 1 addition & 0 deletions integration/integration.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ library
Test.Services
Test.Swagger
Test.User
Test.Version
Testlib.App
Testlib.Assertions
Testlib.Cannon
Expand Down
14 changes: 6 additions & 8 deletions integration/test/API/Brig.hs
Original file line number Diff line number Diff line change
Expand Up @@ -394,18 +394,16 @@ replaceKeyPackages cid suites kps = do
& addJSONObject ["key_packages" .= map (T.decodeUtf8 . Base64.encode) kps]

-- | https://staging-nginz-https.zinfra.io/v6/api/swagger-ui/#/default/get_self
getSelf :: (HasCallStack, MakesValue caller) => caller -> App Response
getSelf caller = do
req <- baseRequest caller Brig Versioned "/self"
submit "GET" req
getSelf :: (HasCallStack, MakesValue user) => user -> App Response
getSelf = getSelfWithVersion Versioned

getSelfWithVersion :: (HasCallStack, MakesValue user) => Versioned -> user -> App Response
getSelfWithVersion v user = baseRequest user Brig v "/self" >>= submit "GET"

-- | https://staging-nginz-https.zinfra.io/v6/api/swagger-ui/#/default/get_self
-- this is a low-level version of `getSelf` for testing some error conditions.
getSelf' :: HasCallStack => String -> String -> App Response
getSelf' domain uid = do
let user = object ["domain" .= domain, "id" .= uid]
req <- baseRequest user Brig Versioned "/self"
submit "GET" req
getSelf' domain uid = getSelfWithVersion Versioned $ object ["domain" .= domain, "id" .= uid]

data PutSelf = PutSelf
{ accent :: Maybe Int,
Expand Down
4 changes: 2 additions & 2 deletions integration/test/Test/Demo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ testDynamicBackend = do
ownDomain <- objDomain OwnDomain
user <- randomUser OwnDomain def
uid <- objId user
bindResponse (BrigP.getSelf' ownDomain uid) $ \resp -> do
bindResponse (BrigP.getSelf user) $ \resp -> do
resp.status `shouldMatchInt` 200
(resp.json %. "id") `shouldMatch` objId user

Expand All @@ -123,7 +123,7 @@ testDynamicBackend = do
-- now create a user in the dynamic backend
userD1 <- randomUser dynDomain def
uidD1 <- objId userD1
bindResponse (BrigP.getSelf' dynDomain uidD1) $ \resp -> do
bindResponse (BrigP.getSelf userD1) $ \resp -> do
resp.status `shouldMatchInt` 200
(resp.json %. "id") `shouldMatch` objId userD1

Expand Down
7 changes: 0 additions & 7 deletions integration/test/Test/Swagger.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ testSwagger = do
dev <- resp.json %. "development" & asSetOf asIntegral
pure $ sup <> dev
assertBool ("unexpected actually existing versions: " <> show actualVersions) $
-- make sure nobody has added a new version without adding it to `existingVersions`.
-- make sure nobody has added a new version without adding it to `existingVersions`.
-- ("subset" because blocked versions like v3 are not actually existing, but still
-- ("subset" because blocked versions like v3 are not actually existing, but still
-- documented.)
-- documented.)

-- make sure nobody has added a new version without adding it to `existingVersions`.
-- ("subset" because blocked versions like v3 are not actually existing, but still
-- documented.)
Expand Down
Loading