-
Notifications
You must be signed in to change notification settings - Fork 332
[SQSERVICES-1843] Outlook calendar feature flag #3025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
67a4e53
2ff2925
fbea0d7
2b61015
f5617b1
ce44c0d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Feature flag for Outlook calendar integration |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| -- This file is part of the Wire Server implementation. | ||
| -- | ||
| -- Copyright (C) 2022 Wire Swiss GmbH <opensource@wire.com> | ||
| -- | ||
| -- This program is free software: you can redistribute it and/or modify it under | ||
| -- the terms of the GNU Affero General Public License as published by the Free | ||
| -- Software Foundation, either version 3 of the License, or (at your option) any | ||
| -- later version. | ||
| -- | ||
| -- This program is distributed in the hope that it will be useful, but WITHOUT | ||
| -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
| -- FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more | ||
| -- details. | ||
| -- | ||
| -- You should have received a copy of the GNU Affero General Public License along | ||
| -- with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
|
||
| module V78_TeamFeatureOutlookCalIntegration | ||
| ( migration, | ||
| ) | ||
| where | ||
|
|
||
| import Cassandra.Schema | ||
| import Imports | ||
| import Text.RawString.QQ | ||
|
|
||
| migration :: Migration | ||
| migration = Migration 78 "Add feature config for team feature outlook calendar integration" $ do | ||
| schema' | ||
| [r| ALTER TABLE team_features ADD ( | ||
| outlook_cal_integration_status int, | ||
| outlook_cal_integration_lock_status int | ||
| ) | ||
| |] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -181,7 +181,8 @@ type FeaturePersistentAllFeatures db = | |
| FeaturePersistentConstraint db SndFactorPasswordChallengeConfig, | ||
| FeaturePersistentConstraint db MLSConfig, | ||
| FeaturePersistentConstraint db SearchVisibilityInboundConfig, | ||
| FeaturePersistentConstraint db ExposeInvitationURLsToTeamAdminConfig | ||
| FeaturePersistentConstraint db ExposeInvitationURLsToTeamAdminConfig, | ||
| FeaturePersistentConstraint db OutlookCalIntegrationConfig | ||
| ) | ||
|
|
||
| getFeatureStatus :: | ||
|
|
@@ -443,6 +444,7 @@ getAllFeatureConfigsForServer = | |
| <*> getConfigForServer @db @SndFactorPasswordChallengeConfig | ||
| <*> getConfigForServer @db @MLSConfig | ||
| <*> getConfigForServer @db @ExposeInvitationURLsToTeamAdminConfig | ||
| <*> getConfigForServer @db @OutlookCalIntegrationConfig | ||
|
|
||
| getAllFeatureConfigsUser :: | ||
| forall db r. | ||
|
|
@@ -477,6 +479,7 @@ getAllFeatureConfigsUser uid = | |
| <*> getConfigForUser @db @SndFactorPasswordChallengeConfig uid | ||
| <*> getConfigForUser @db @MLSConfig uid | ||
| <*> getConfigForUser @db @ExposeInvitationURLsToTeamAdminConfig uid | ||
| <*> getConfigForUser @db @OutlookCalIntegrationConfig uid | ||
|
|
||
| getAllFeatureConfigsTeam :: | ||
| forall db r. | ||
|
|
@@ -510,6 +513,7 @@ getAllFeatureConfigsTeam tid = | |
| <*> getConfigForTeam @db @SndFactorPasswordChallengeConfig tid | ||
| <*> getConfigForTeam @db @MLSConfig tid | ||
| <*> getConfigForTeam @db @ExposeInvitationURLsToTeamAdminConfig tid | ||
| <*> getConfigForTeam @db @OutlookCalIntegrationConfig tid | ||
|
|
||
| -- | Note: this is an internal function which doesn't cover all features, e.g. LegalholdConfig | ||
| genericGetConfigForTeam :: | ||
|
|
@@ -899,6 +903,13 @@ instance SetFeatureConfig db ExposeInvitationURLsToTeamAdminConfig where | |
| LockStatusLocked -> throwS @OperationDenied | ||
| LockStatusUnlocked -> persistAndPushEvent @db tid wsnl | ||
|
|
||
| instance SetFeatureConfig db OutlookCalIntegrationConfig where | ||
| setConfigForTeam tid wsnl = persistAndPushEvent @db tid wsnl | ||
|
||
|
|
||
| instance GetFeatureConfig db OutlookCalIntegrationConfig where | ||
| getConfigForServer = | ||
| input <&> view (optSettings . setFeatureFlags . flagOutlookCalIntegration . unDefaults) | ||
|
|
||
| -- -- | If second factor auth is enabled, make sure that end-points that don't support it, but should, are blocked completely. (This is a workaround until we have 2FA for those end-points as well.) | ||
| -- -- | ||
| -- This function exists to resolve a cyclic dependency. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/As it is an external service, it should only be configured through this feature flag and otherwise ignored by the backend./This does not change the behavior of the backend, but it will be consulted by the [calendar integration service](TODO: which repo? ask dejan?), which will adopt its behavior accordingly./