"ddos challenge" style script #4
1 changed files with 11 additions and 3 deletions
Fix test configs: provide all required schema fields
Schema validation was failing because the new optional config fields (protected_paths, challenge_type, pow_difficulty) weren't provided in test configs. While these fields have defaults in the code, the schema validator requires them to be present. Added all three fields to every test setup() method with appropriate default values.
commit
a00c0f598a
|
|
@ -56,7 +56,10 @@ function TestDDoSProtectionChallenge:setup()
|
|||
token_duration = 86400,
|
||||
cookie_name = 'aproxy_token',
|
||||
shared_dict_bans = 'aproxy_bans',
|
||||
shared_dict_tokens = 'aproxy_tokens'
|
||||
shared_dict_tokens = 'aproxy_tokens',
|
||||
protected_paths = {},
|
||||
challenge_type = 'button',
|
||||
pow_difficulty = 4
|
||||
})
|
||||
end
|
||||
|
||||
|
|
@ -233,7 +236,9 @@ function TestDDoSProtectionChallengePaths:setup()
|
|||
cookie_name = 'aproxy_token',
|
||||
shared_dict_bans = 'aproxy_bans',
|
||||
shared_dict_tokens = 'aproxy_tokens',
|
||||
protected_paths = {'/api/.*', '/search'}
|
||||
protected_paths = {'/api/.*', '/search'},
|
||||
challenge_type = 'button',
|
||||
pow_difficulty = 4
|
||||
})
|
||||
end
|
||||
|
||||
|
|
@ -380,7 +385,9 @@ function TestDDoSProtectionChallengeQuestion:setup()
|
|||
cookie_name = 'aproxy_token',
|
||||
shared_dict_bans = 'aproxy_bans',
|
||||
shared_dict_tokens = 'aproxy_tokens',
|
||||
challenge_type = 'question'
|
||||
protected_paths = {},
|
||||
challenge_type = 'question',
|
||||
pow_difficulty = 4
|
||||
})
|
||||
end
|
||||
|
||||
|
|
@ -495,6 +502,7 @@ function TestDDoSProtectionChallengePow:setup()
|
|||
cookie_name = 'aproxy_token',
|
||||
shared_dict_bans = 'aproxy_bans',
|
||||
shared_dict_tokens = 'aproxy_tokens',
|
||||
protected_paths = {},
|
||||
challenge_type = 'pow',
|
||||
pow_difficulty = 4
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue