- Rename functions, variables, parameters and imports with scope-aware AST passes - Generalise Flask route and template paths to unique /route_N and tpl_N names - Replace descriptive strings with length-preserving, word-consistent msg tokens - Strip docstrings and comments - Add verification for parse validity and leaked benchmark identifiers - Include SAST prompt and expected labels
33 lines
1.2 KiB
Python
33 lines
1.2 KiB
Python
from flask import redirect as mod_1, url_for as mod_2, request as mod_3, make_response as mod_4, render_template as mod_5
|
|
from helpers.utils import escape_for_html as mod_6
|
|
|
|
def init(var_1):
|
|
|
|
@var_1.route('/route_171', methods=['GET'])
|
|
def func_341():
|
|
return func_342()
|
|
|
|
@var_1.route('/route_171', methods=['POST'])
|
|
def func_342():
|
|
var_2 = ''
|
|
var_3 = mod_3.path.split('/')
|
|
var_4 = var_3[1]
|
|
if not var_4:
|
|
var_4 = ''
|
|
import helpers.ThingFactory
|
|
var_5 = helpers.ThingFactory.createThing()
|
|
var_6 = var_5.doSomething(var_4)
|
|
import base64 as mod_7
|
|
import secrets as mod_8
|
|
from helpers.utils import mysession as mod_9
|
|
var_7 = 'msg00000000000002y'[13:]
|
|
var_8 = f'msg0000006{var_7}'
|
|
var_9 = f'msg0000000{var_7}'
|
|
var_10 = mod_8.token_urlsafe(32)
|
|
if var_9 in mod_9 and mod_3.cookies.get(var_9) == mod_9[var_9]:
|
|
var_2 += f'msg0007 m00b: {var_8}<br/>'
|
|
else:
|
|
mod_9[var_9] = var_10
|
|
var_2 += f'{var_8} koz m00c msg0000001 m00d msg005:{var_9} msg0c msg0d wz: {mod_9[var_9]}<br/>'
|
|
return var_2
|