"ddos challenge" style script #4

Open
luna wants to merge 20 commits from claude/ddos-protection-challenge-01CMAtrK6Dt24x9Q3v6Gz9fS into mistress
Showing only changes of commit a00c0f598a - Show all commits

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.
Claude 2025-11-22 19:30:51 +00:00 committed by Luna

View file

@ -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
})