Skip to content

Commit

Permalink
Add auth tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
jmsmkn committed May 17, 2024
1 parent 26ae6b7 commit 69d0b95
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions scripts/pentest_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,12 @@ def create_workstations(*, container):
def create_algorithms(*, container):
algorithm_count = Algorithm.objects.count()

for ii in range(2):
for ii, public in enumerate([True, True]): # TODO: Add False, False
create_algorithm(
algorithm_num=algorithm_count + 1 + ii,
container=container,
create_jobs=True,
public=public,
)


Expand Down Expand Up @@ -400,6 +401,7 @@ def create_algorithm(
title=None,
editor=None,
create_jobs=False,
public=False,
):
assert algorithm_num is not None or (
title is not None and editor is not None
Expand All @@ -414,6 +416,11 @@ def create_algorithm(
inputs = _get_inputs()
outputs = _get_outputs()

if public:
title += " (Public)"
else:
title += " (Non-Public)"

algorithm = Algorithm.objects.create(
title=title,
logo=create_image_with_text(text=f"{title}, Logo"),
Expand Down Expand Up @@ -557,7 +564,11 @@ def _demo_container():


def create_image_with_text(
*, text, image_size=(1024, 1024), font_size=50, font_path="Roboto-Regular.ttf"
*,
text,
image_size=(1024, 1024),
font_size=50,
font_path="Roboto-Regular.ttf",
):
# Create a new image with a black background
image = PILImage.new("RGB", image_size, color="black")
Expand Down

0 comments on commit 69d0b95

Please sign in to comment.