Skip to content

fix(api): ユーザーレスポンスから非公開フィールドを除外 - #290

Merged
sasagar merged 1 commit into
devfrom
fix/strip-private-key-from-user-responses
Oct 14, 2026
Merged

sasagar merged 1 commit into
devfrom
fix/strip-private-key-from-user-responses

Conversation

@sasagar

@sasagar sasagar commented Oct 14, 2026

Copy link
Copy Markdown
Member

変更

  • lib/routeUtils.ts に toPublicUser() を追加(passwordHash / privateKey / email を除外)
  • routes/users.ts / routes/auth.ts / routes/following.ts のユーザーを返すレスポンスを toPublicUser()(自分自身のプロフィールは sanitizeUser())経由に統一
  • sanitizeUser() の型制約を緩め、User 型をそのまま渡せるようにした

確認

  • bun run typecheck / bun run lint / ユニットテスト 1031 件 pass

https://claude.ai/code/session_01Y29fBeRP344FME6de48wUv

Use a shared toPublicUser() helper so user responses never include
passwordHash, privateKey or email for other users, and sanitizeUser()
for the caller's own profile.

Claude-Session: https://claude.ai/code/session_01Y29fBeRP344FME6de48wUv
@coderabbitai

coderabbitai Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 41 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: Love-Rox/rox/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a0aa049d-67ed-4fc0-ae4a-734f473c4f06
📥 Commits

Reviewing files that changed from the base of the PR and between 755969e and e2a024c.

📒 Files selected for processing: 4
  • packages/backend/src/lib/routeUtils.ts
  • packages/backend/src/routes/auth.ts
  • packages/backend/src/routes/following.ts
  • packages/backend/src/routes/users.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sasagar
sasagar merged commit f26a7d4 into dev Oct 14, 2026
11 checks passed
This was referenced Oct 14, 2026
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.

1 participant