Improve Challenge type plugin staticmethods (#394)

This passes more logic into the challenge classes so that it can be accessed by plugins
This commit is contained in:
Kevin Chung
2017-09-27 17:01:58 -04:00
committed by GitHub
parent 6c9b8af3c3
commit a20e7eae63
4 changed files with 32 additions and 15 deletions

View File

@@ -155,7 +155,9 @@ def test_submitting_flags_with_large_ips():
ip_addresses = ['172.18.0.1', '255.255.255.255', '2001:0db8:85a3:0000:0000:8a2e:0370:7334']
for ip_address in ip_addresses:
# Monkeypatch get_ip
utils.get_ip = lambda: ip_address
def get_ip_fake(req=None):
return ip_address
utils.get_ip = get_ip_fake
# Generate challenge and flag
chal = gen_challenge(app.db)