1
0
mirror of https://github.com/avatao-content/test-tutorial-framework synced 2024-11-14 21:47:18 +00:00
test-tutorial-framework/solvable/src/demo/sql_injection_fsm.py
2018-03-23 15:27:42 +01:00

27 lines
955 B
Python

from tfw.fsm_base import FSMBase
class SQLInjectionFSM(FSMBase):
states = [
'start',
'stripped_code',
'sql',
'commented_code',
'sql_with_substitutions',
'sql_output',
'end',
]
transitions = [
{'trigger': 'webide', 'source': '*', 'dest': 'stripped_code'}, # TODO: delet this
{'trigger': 'webide', 'source': 'start', 'dest': 'stripped_code'},
{'trigger': 'login', 'source': 'stripped_code', 'dest': 'sql'},
{'trigger': 'logger', 'source': 'sql', 'dest': 'commented_code'},
{'trigger': 'webide', 'source': 'commented_code', 'dest': 'sql_with_substitutions'},
{'trigger': 'logger', 'source': 'sql_with_substitutions', 'dest': 'sql_output'},
{'trigger': 'logger', 'source': 'sql_output', 'dest': 'end'},
{'trigger': 'reset', 'source': 'end', 'dest': 'start'},
]
def __init__(self):
super().__init__('start')