File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import API.Brig
7
7
import API.BrigInternal
8
8
import API.Common
9
9
import API.GalleyInternal (setTeamFeatureLockStatus , setTeamFeatureStatus )
10
+ import Control.Concurrent (threadDelay )
10
11
import SetupHelpers
11
12
import Test.DNSMock
12
13
import Testlib.Prelude
@@ -386,6 +387,20 @@ testOverwriteOwnershipToken = do
386
387
(mkDomainRedirectBackend " https://wire1.example.com" )
387
388
>>= assertStatus 401
388
389
390
+ testChallengeTtl :: (HasCallStack ) => App ()
391
+ testChallengeTtl = withModifiedBackend
392
+ (def {brigCfg = (setField " optSettings.setChallengeTTL" (2 :: Int ))})
393
+ $ \ domain -> do
394
+ registrationDomain <- randomDomain
395
+ challenge <- getDomainVerificationChallenge domain registrationDomain >>= getJSON 200
396
+ challengeId <- challenge %. " id" & asString
397
+ challengeToken <- challenge %. " token" & asString
398
+
399
+ -- wait until the challenge ttl expires
400
+ liftIO $ threadDelay 2_500_000
401
+ bindResponse (verifyDomain domain registrationDomain challengeId challengeToken) $ \ resp -> do
402
+ resp. status `shouldMatchInt` 404
403
+
389
404
-- helpers
390
405
391
406
data ChallengeSetup = ChallengeSetup
You can’t perform that action at this time.
0 commit comments