Skip to content

Commit

Permalink
Merge pull request #43 from ceph/kill-case-insensitive
Browse files Browse the repository at this point in the history
services/kill: make username check case-insensitive
  • Loading branch information
VallariAg committed Mar 11, 2024
2 parents 4e61121 + 87848fd commit f0a9d59
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/teuthology_api/services/kill.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ def run(args, send_logs: bool, access_token: str, request: Request):
run_name = args.get("--run")
if run_name:
run_details = get_run_details(run_name)
run_username = run_details.get("user")
run_owner = run_details.get("user")
else:
log.error("teuthology-kill is missing --run")
raise HTTPException(status_code=400, detail="--run is a required argument")
# TODO if user has admin priviledge, then they can kill any run/job.
if run_username != username:
if run_owner.lower() != username.lower():
log.error(
"%s doesn't have permission to kill a job scheduled by: %s",
username,
run_username,
run_owner,
)
raise HTTPException(
status_code=401, detail="You don't have permission to kill this run/job"
Expand Down

0 comments on commit f0a9d59

Please sign in to comment.