Skip to content

Commit

Permalink
Validate run_id with ObjectId.is_valid in api_schema.
Browse files Browse the repository at this point in the history
This seems to be equivalent to the regex in master but in
principle it does not have to be.
  • Loading branch information
vdbergh authored and ppigazzini committed May 10, 2024
1 parent 7d72fde commit ee4cde1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/fishtest/schemas.py
Expand Up @@ -37,7 +37,7 @@
url,
)

run_id = regex(r"[a-f0-9]{24}", name="run_id")
run_id = intersect(str, set_name(ObjectId.is_valid, "valid_object_id"))
run_id_pgns = regex(r"[a-f0-9]{24}-(0|[1-9]\d*)", name="run_id_pgns")
run_name = intersect(regex(r".*-[a-f0-9]{7}", name="run_name"), size(0, 23 + 1 + 7))
action_message = intersect(str, size(0, 1024))
Expand Down

0 comments on commit ee4cde1

Please sign in to comment.