Skip to content

Commit e80729f

Browse files
committed
Protect benchmark execution endpoints
1 parent 8d6c310 commit e80729f

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/hybrid_pki/api/routes_benchmarks.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
benchmark_classical_signatures,
1010
benchmark_pqc_signatures,
1111
)
12-
from fastapi import APIRouter
12+
from fastapi import APIRouter, Depends
13+
14+
from hybrid_pki.api.security import require_mutation_access
1315

1416
router = APIRouter(
1517
prefix="/benchmarks",
@@ -73,7 +75,7 @@ def benchmark_status():
7375
}
7476

7577

76-
@router.post("/run-keygen")
78+
@router.post("/run-keygen", dependencies=[Depends(require_mutation_access)])
7779
def run_keygen_benchmark():
7880
"""
7981
Run classical and PQC key generation benchmarks.
@@ -96,7 +98,7 @@ def run_keygen_benchmark():
9698
}
9799

98100

99-
@router.post("/run-signatures")
101+
@router.post("/run-signatures", dependencies=[Depends(require_mutation_access)])
100102
def run_signature_benchmark():
101103
"""
102104
Run classical and PQC signature benchmarks.
@@ -119,7 +121,7 @@ def run_signature_benchmark():
119121
}
120122

121123

122-
@router.post("/run-handshake")
124+
@router.post("/run-handshake", dependencies=[Depends(require_mutation_access)])
123125
def run_handshake_benchmark():
124126
"""
125127
Run classical and hybrid handshake benchmarks.

0 commit comments

Comments
 (0)