diff --git a/tools/stern/src/Stern/API.hs b/tools/stern/src/Stern/API.hs index c2c2619047b..a75fb752f2a 100644 --- a/tools/stern/src/Stern/API.hs +++ b/tools/stern/src/Stern/API.hs @@ -159,6 +159,8 @@ sitemap' = :<|> Named @"get-route-outlook-cal-config" (mkFeatureGetRoute @OutlookCalIntegrationConfig) :<|> Named @"lock-unlock-route-outlook-cal-config" (mkFeatureLockUnlockRouteTrivialConfigNoTTL @OutlookCalIntegrationConfig) :<|> Named @"put-route-outlook-cal-config" (mkFeaturePutRouteTrivialConfigNoTTL @OutlookCalIntegrationConfig) + :<|> Named @"get-route-enforce-file-download-location" (mkFeatureGetRoute @EnforceFileDownloadLocationConfig) + :<|> Named @"put-route-enforce-file-download-location" (mkFeaturePutRoute @EnforceFileDownloadLocationConfig) :<|> Named @"get-team-invoice" getTeamInvoice :<|> Named @"get-team-billing-info" getTeamBillingInfo :<|> Named @"put-team-billing-info" updateTeamBillingInfo diff --git a/tools/stern/src/Stern/API/Routes.hs b/tools/stern/src/Stern/API/Routes.hs index 79fccd55c61..71944ddef8d 100644 --- a/tools/stern/src/Stern/API/Routes.hs +++ b/tools/stern/src/Stern/API/Routes.hs @@ -322,6 +322,8 @@ type SternAPI = :<|> Named "get-route-outlook-cal-config" (MkFeatureGetRoute OutlookCalIntegrationConfig) :<|> Named "lock-unlock-route-outlook-cal-config" (MkFeatureLockUnlockRouteTrivialConfigNoTTL OutlookCalIntegrationConfig) :<|> Named "put-route-outlook-cal-config" (MkFeaturePutRouteTrivialConfigNoTTL OutlookCalIntegrationConfig) + :<|> Named "get-route-enforce-file-download-location" (MkFeatureGetRoute EnforceFileDownloadLocationConfig) + :<|> Named "put-route-enforce-file-download-location" (MkFeaturePutRoute EnforceFileDownloadLocationConfig) :<|> Named "get-team-invoice" ( Summary "Get a specific invoice by Number" diff --git a/tools/stern/src/Stern/Intra.hs b/tools/stern/src/Stern/Intra.hs index 4d13739d167..685e6541236 100644 --- a/tools/stern/src/Stern/Intra.hs +++ b/tools/stern/src/Stern/Intra.hs @@ -560,7 +560,7 @@ setTeamFeatureFlag tid status = do resp <- catchRpcErrors $ rpc' "galley" gly req case statusCode resp of 200 -> pure () - 404 -> throwE (mkError status404 "bad-upstream" "team doesnt exist") + 404 -> throwE (mkError status404 "bad-upstream" "team does not exist") 403 -> throwE (mkError status403 "bad-upstream" "legal hold config cannot be changed") _ -> throwE (mkError status502 "bad-upstream" (errorMessage resp)) where diff --git a/tools/stern/test/integration/API.hs b/tools/stern/test/integration/API.hs index 657d7359fc5..8a796121197 100644 --- a/tools/stern/test/integration/API.hs +++ b/tools/stern/test/integration/API.hs @@ -93,13 +93,14 @@ tests s = test s "GET /teams/:tid/features/classifiedDomains" $ testGetFeatureConfig @ClassifiedDomainsConfig (Just FeatureStatusEnabled), test s "GET /teams/:tid/features/outlookCalIntegration" $ testFeatureStatus @OutlookCalIntegrationConfig, test s "PUT /teams/:tid/features/outlookCalIntegration{,'?lockOrUnlock'}" $ testFeatureStatusWithLock @OutlookCalIntegrationConfig, + test s "GET /teams/:tid/features/enforceFileDownloadLocation" $ testFeatureStatus @EnforceFileDownloadLocationConfig, test s "GET /i/consent" testGetConsentLog, test s "GET /teams/:id" testGetTeamInfo, test s "GET i/user/meta-info?id=..." testGetUserMetaInfo, test s "/teams/:tid/search-visibility" testSearchVisibility, test s "/sso-domain-redirect" testRudSsoDomainRedirect, test s "i/oauth/clients" testCrudOAuthClient - -- The following endpoints can not be tested because they require ibis: + -- The following endpoints can not be tested here because they require ibis: -- - `GET /teams/:tid/billing` -- - `GET /teams/:tid/invoice/:inr` -- - `PUT /teams/:tid/billing` @@ -334,7 +335,7 @@ testFeatureStatusOptTtl mTtl = do liftIO $ cfg @?= defFeatureStatus @cfg when (wsLockStatus cfg == LockStatusLocked) $ unlockFeature @cfg tid let newStatus = if wsStatus cfg == FeatureStatusEnabled then FeatureStatusDisabled else FeatureStatusEnabled - void $ putFeatureStatus @cfg tid newStatus mTtl + putFeatureStatus @cfg tid newStatus mTtl !!! const 200 === statusCode cfg' <- getFeatureConfig @cfg tid liftIO $ wsStatus cfg' @?= newStatus