mirror of
https://github.com/status-im/spiff-arena.git
synced 2025-01-13 11:44:28 +00:00
Secure Source of Randomness (#1695)
* Secure Source of Randomness * lint --------- Co-authored-by: pixeebot[bot] <104101892+pixeebot[bot]@users.noreply.github.com> Co-authored-by: burnettk <burnettk@users.noreply.github.com>
This commit is contained in:
parent
586a088e21
commit
62124525d7
@ -2,6 +2,7 @@ from __future__ import annotations
|
||||
|
||||
import math
|
||||
import random
|
||||
import secrets
|
||||
import string
|
||||
import time
|
||||
from dataclasses import dataclass
|
||||
@ -133,7 +134,7 @@ class UserModel(SpiffworkflowBaseDBModel):
|
||||
]
|
||||
fuzz = "".join(random.SystemRandom().choice(string.ascii_lowercase + string.digits) for _ in range(7))
|
||||
# this is not for cryptographic purposes
|
||||
adjective = random.choice(adjectives) # noqa: S311
|
||||
animal = random.choice(animals) # noqa: S311
|
||||
adjective = secrets.choice(adjectives) # noqa: S311
|
||||
animal = secrets.choice(animals) # noqa: S311
|
||||
username = f"{prefix}{adjective}{animal}{fuzz}"
|
||||
return username
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""APIs for dealing with process groups, process models, and process instances."""
|
||||
|
||||
import json
|
||||
import random
|
||||
import secrets
|
||||
import string
|
||||
|
||||
import flask.wrappers
|
||||
@ -77,7 +77,7 @@ def script_unit_test_create(modified_process_model_identifier: str, body: dict[s
|
||||
else:
|
||||
unit_test_elements = unit_test_elements_array[0]
|
||||
|
||||
fuzz = "".join(random.choice(string.ascii_uppercase + string.digits) for _ in range(7)) # noqa: S311
|
||||
fuzz = "".join(secrets.choice(string.ascii_uppercase + string.digits) for _ in range(7)) # noqa: S311
|
||||
unit_test_id = f"unit_test_{fuzz}"
|
||||
|
||||
input_json_element = spiff_element_maker("inputJson", json.dumps(input_json))
|
||||
|
Loading…
x
Reference in New Issue
Block a user