Skip to content

fix: enforce profileVisibility and PII privacy in user profile APIs#388

Merged
3m1n3nc3 merged 1 commit into
geevapp:mainfrom
samlogy1:fix-user-profile-api
Jun 27, 2026
Merged

fix: enforce profileVisibility and PII privacy in user profile APIs#388
3m1n3nc3 merged 1 commit into
geevapp:mainfrom
samlogy1:fix-user-profile-api

Conversation

@samlogy1

Copy link
Copy Markdown
Contributor

closes #353

  • Gate GET /api/users/[id] by profileVisibility and requester relationship (self / follower / public)
  • Strip email and walletAddress unless requester is the user themselves or the corresponding showEmail/showWalletAddress flag is true
  • Add privacy gating to all profile sub-resource endpoints (posts, entries, stats, activity, followers, following)
  • Strip walletAddress from follower/following user lists unless permitted
  • Update existing test to expect anonymized PII for anonymous requests
  • Add tests for third-party privacy enforcement

Pull Request Template

Description

Please include a summary of the change and which issue is fixed. Also include relevant motivation and context.


Checklist

  • I have tested my changes locally
  • I have updated documentation as needed
  • I have run npx prisma generate after schema changes
  • I have run npx prisma migrate dev or npx prisma migrate deploy as appropriate

Post-Merge Steps for Maintainers

If this PR includes changes to the Prisma schema:

  1. Run the following command to apply the migration to your database:

    npx prisma migrate deploy

    or, for local development:

    npx prisma migrate dev
  2. Ensure your CI pipeline runs the migration before tests (add this step if missing):

    - name: Run Prisma Migrate
      run: npx prisma migrate deploy
  3. Make sure the database user in CI has permission to run migrations.


If you have any questions, please comment on this PR.

- Gate GET /api/users/[id] by profileVisibility and requester relationship
  (self / follower / public)
- Strip email and walletAddress unless requester is the user themselves or
  the corresponding showEmail/showWalletAddress flag is true
- Add privacy gating to all profile sub-resource endpoints
  (posts, entries, stats, activity, followers, following)
- Strip walletAddress from follower/following user lists unless permitted
- Update existing test to expect anonymized PII for anonymous requests
- Add tests for third-party privacy enforcement
@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

@samlogy1 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@3m1n3nc3 3m1n3nc3 merged commit 5b3be3b into geevapp:main Jun 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

User profile API ignores privacy settings and always returns email and wallet address

2 participants