Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profile API security #457

Open
2 tasks
ethanstrominger opened this issue Dec 27, 2024 · 0 comments
Open
2 tasks

Profile API security #457

ethanstrominger opened this issue Dec 27, 2024 · 0 comments

Comments

@ethanstrominger
Copy link
Member

ethanstrominger commented Dec 27, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🆕New Issue Review
Development

No branches or pull requests

1 participant