hackforla / hackforla/peopledepot

Profile API security

Open
#457 2 comments 0 reactions 1 assignee Claimed by @ethanstrominger View on GitHub
complexity: medium ethan milestone: missing p-feature: user PII: FALSE ready for author/assignee role: dev s: PD team size: 2pt
Dominant language
Python
Stars
14
Forks
37
Avg merge
9d 15h
Merged PRs (30d)
5

Description

### Overview

As a security admin I want to make sure that users can see and update only appropriate fields. get for profile api should return all fields except password. Patch should allow all fields except password, created_at, updated_at, is_staff, is_superuser, and is_active.

### Action Items
- [ ] Implement as explained in technical details
- [ ] Add tests
### Technical
Recommended approach:
- Create a ProfileSerializer that includes all fields except password and marks created_at, updated_at, is_active, is_superuser, is_staff, and uuid as read only.
- Disable post (requires googling) operation
- Create a view that uses the ProfileSerializer.
- Modify profile URL to point to this view.
- Tests
- Verify response does not include password
- Verify patching (updating) password gives an error
- Verify patching created_at, updated_at, or uuid gives an error
- Verify all other fields can be updated

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.