Skip to content

Resolves issue #1984, remove __v from registry user list responses. - #2079

Merged
jdaigneau5 merged 2 commits into
devfrom
dr_1984
Oct 29, 2026
Merged

jdaigneau5 merged 2 commits into
devfrom
dr_1984

Conversation

@david-rocca

@david-rocca david-rocca commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Closes Issue #1984

Summary

GET /api/registry/users exposed Mongoose’s internal __v field. The aggregation now excludes it alongside _id and secret.

Important Changes

src/repositories/baseUserRepository.js

  • Exclude __v from the user-list aggregation projection.

test/integration-tests/user/getUsersTest.js

  • Extend existing registry and legacy list tests to verify internal fields are omitted.
  • Verify registry users retain their public identity, status, and timestamp fields.

test/unit-tests/user/baseUserRepositoryFormatSemanticsTest.js

  • Update the existing projection expectation to include the __v exclusion.

Testing

  • Reproduced the failure using the updated existing integration test before applying the fix.
  • bash -i -c "npm run test:integration:replicas" — 998 passing.
  • ESLint and whitespace checks passed.

Manual verification:

  • GET /api/registry/users as Secretariat and confirm every user excludes __v, _id, and secret.
  • Confirm public user fields are present and GET /api/users retains its legacy response format.

Notes

  • Updated existing tests only; no new test cases or files.
  • Confidence: 9/10. The regression was reproduced before the fix and the full integration suite passed afterward; production DocumentDB was not exercised.

Exclude Mongoose's version field from the user-list aggregation.
Update existing integration and unit assertions to verify internal
fields are omitted and public user fields are preserved.
@david-rocca david-rocca linked an issue Oct 29, 2026 that may be closed by this pull request
@jdaigneau5
jdaigneau5 merged commit 1d0eab7 into dev Oct 29, 2026
9 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.

Remove __v from GET /api/registry/users

2 participants