Player profile pictures: privacy decision and Spaces storage

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
aws, django, python

Research direction

Start by reading ADR 0009, docs/privacy/personal-data-inventory.md, and the settings helpers in config/settings.py; the issue says privacy decisions must be recorded before code stores pictures. Then map the storage, API, test overrides, and deployment changes named in the tasks. Done means the privacy policy, private Space storage, safe image processing, endpoints, deletion behavior, and tests meet the listed acceptance criteria.

Written by the indexing model from the issue text.

Description

area:api area:infra area:players priority:p1 size:L type:feature

Context: Players should be able to upload a profile picture when they create or edit their profile (#124). Nothing stores one today. A photo of a face is identifying personal data, and ADR 0009 does not list it, so it needs a privacy decision before any code. Storage is also missing: STORAGES["default"] is FileSystemStorage, and on App Platform each component's disk is wiped on every deploy and is not shared between web and worker (#61). Pictures need object storage, a DigitalOcean Space.

Tasks:

  • Amend ADR 0009 (or add an ADR) for profile pictures. Decide and record:
    • Who sees a picture: the public profile, signed-in players, Partners, or the player only. How it follows the Player's privacy settings and opt-out
    • Whether players aged 13 to 17 may upload one, and what others see for them. They are already left out of all partner sharing
    • Whether a picture is ever returned to Partners (partner API, webhooks, Log in with OPEN)
    • Content moderation: who reviews images, how a picture is reported and removed, and whether review happens before it is shown
    • Retention: replacing a picture deletes the old file; account deletion (#116) deletes every stored copy
  • Add the picture to docs/privacy/personal-data-inventory.md and to the list of identifying personal data fields, so an Audit Event records only that it changed
  • Add django-storages with the S3 backend for DigitalOcean Spaces. Read the bucket, region, endpoint, and keys from the environment with the config/settings.py helpers; placeholders only in .env.example
  • Private bucket. Serve pictures through short-lived signed URLs or an app endpoint, never public object URLs that outlive a removal or a privacy change
  • Keep local development and tests working without a Space (local storage in compose, in-memory storage in the test overrides, with config/settings_test.py and config/test_runner.py kept identical)
  • Upload processing:
    • Accept JPEG, PNG, and WebP only, checked by decoding the image, not by extension or content type
    • Limit file size and pixel dimensions, and refuse decompression bombs
    • Re-encode the image and strip all metadata (EXIF, including GPS location)
    • Resize to a fixed set of sizes
    • Store under a random key that holds no Player id, OPEN Code, or name
  • Endpoints under /api/v1/me/player to upload, replace, and remove the picture, with explicit operation_ids. Return the picture URL in the profile responses where the ADR allows it
  • Only the player sets their own picture. Staff and moderators may only remove it, with an Audit Event
  • Add the Space and its credentials to the app spec (#61) and the staging and production environments (#63, #68)
  • Tests

Acceptance criteria:

  • The ADR and the personal data inventory list the picture before any code that stores one is merged
  • An uploaded image is stored with no EXIF or other metadata
  • A non-image file, an image over the size or dimension limit, or a decompression bomb returns 422 without echoing the file name or contents
  • A removed or replaced picture is deleted from storage, and an old URL stops working
  • A picture is never visible where the Player's privacy settings or opt-out hide the profile, and never reaches a Partner unless the ADR allows it
  • No stored key or URL contains a row id, OPEN Code, or name
  • The test suite and local development run without a Space or its credentials

Out of scope:

  • The upload and crop screens (frontend repository)
  • CSV upload storage. #71 can keep files in Postgres and does not need a Space

Depends on: #124, #61

Size: L

Dominant language
Python
Stars
0
Forks
1
Avg merge
1h 7m
Merged PRs (30d)
206

Getting set up

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 openpickleball/backend

All issues in openpickleball/backend

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.