Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

PrevEmployment: add auth + ownership check to PATCH/DELETE/proof endpoints

Open
#143 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
66/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
fastapi, python

Research direction

Start with api/routers/prev_employment.py and inspect how get_current_student and the ownership check are used for the related issue #138. Apply the same authentication and 404 behavior to the three listed endpoints, then add integration tests for unauthenticated, other-user, and owner requests. Done means all three endpoint cases behave as specified.

Written by the indexing model from the issue text.

Description

Problem

These endpoints in api/routers/prev_employment.py have no auth dependency and do no ownership check, so anyone can modify, delete or upload proof for any previous-employment entry by id:

  • PATCH /prev_employments/{prev_employment_id}/proof
  • DELETE /prev_employments/{prev_employment_id}
  • PATCH /prev_employments/{prev_employment_id}

Tasks

  • Require get_current_student
  • Ownership check: entry must have user_account == user["sub"]; otherwise 404 (no existence leak, consistent with #138)
  • Integration tests: unauthenticated → 401; other user's entry → 404; owner → success

Related: #138

Dominant language
Python
Stars
0
Forks
0
Avg merge
39m
Merged PRs (30d)
10

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ClockGU/clockwork-backend

All issues in ClockGU/clockwork-backend

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.