Skip to content

Secure v2 user responses and access control - #5820

Merged
fan yang (fanyangCS) merged 1 commit into
masterfrom
security/user-api-access-redaction
Aug 15, 2026
Merged

Secure v2 user responses and access control#5820
fan yang (fanyangCS) merged 1 commit into
masterfrom
security/user-api-access-redaction

Conversation

@fanyangCS

Copy link
Copy Markdown
Collaborator

Summary

  • Restrict v2 user list access to admins and enforce self-or-admin checks on per-user reads and the legacy per-user password update route.
  • Add centralized user response sanitization for v2 user responses, removing password data and confidential extension fields such as raw bounded-cluster tokens and SSH private keys while preserving safe metadata.
  • Add focused regression coverage for access control and response redaction behavior.
  • Keep the job-list user filter usable for non-admin portal sessions when the all-user API is unavailable.

Validation

  • node -c src/rest-server/src/utils/userResponse.js
  • node -c src/rest-server/src/controllers/v2/user.js
  • node -c src/rest-server/src/routes/v2/user.js
  • node -c src/rest-server/test/userResponseSecurity.js

Focused mocha/lint commands were attempted but local dependencies are not installed in this worktree:

  • npm run mocha -- --grep "user response security" -> sh: 1: mocha: not found
  • npm run lint -> sh: 1: eslint: not found

Notes

  • Existing /api/v2/user and /api/v2/users aliases are preserved.
  • Sanitization is applied at response construction; stored user extension data is not modified.

@fanyangCS
fan yang (fanyangCS) force-pushed the security/user-api-access-redaction branch from 96d4314 to d7ff773 Compare August 14, 2026 23:56
@fanyangCS
fan yang (fanyangCS) merged commit 15ec8dc into master Aug 15, 2026
10 of 28 checks passed
@fanyangCS
fan yang (fanyangCS) deleted the security/user-api-access-redaction branch August 15, 2026 00:09
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