Resolves Issue #1715, Add expanded user map to registry org response#1835
Open
afoote-mitre wants to merge 6 commits into
Open
Resolves Issue #1715, Add expanded user map to registry org response#1835afoote-mitre wants to merge 6 commits into
afoote-mitre wants to merge 6 commits into
Conversation
jdalphond-mitre
left a comment
Collaborator
There was a problem hiding this comment.
I have tested this and it correctly does not return secretariat users as an org admin.
It does return the secretariat users as a secretariat.
jdalphond-mitre
previously approved these changes
Jun 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes Issue #1715
Summary
Adds optional expanded user metadata to the single registry organization response via
expand=users, reducing the need for clients to fetch all orgs/users just to resolve UUIDs in org views.This also fixes a conversation author-name edge case where Secretariat users with populated
name.firstand/orname.lastcould show their personal name in conversation responses. Secretariat-authored conversations now consistently useauthor_name: "Secretariat"on create and on read, including previously stored conversation records.Important Changes
src/controller/registry-org.controller/registry-org.controller.js_userMaphydration whenexpand=usersis requested.users,admins, defensivecontact_info.additional_contacts, and visible conversationauthor_ids._userMap.src/repositories/conversationRepository.jsauthor_name: "Secretariat".getAll()andgetAllByTargetUUID().author_idandauthor_namefor non-Secretariat readers.src/controller/org.controller/index.jsexpand=usersonGET /api/registry/org/{identifier}.src/controller/org.controller/org.middleware.jsexpandquery parameter intoreq.ctx.query.src/repositories/baseUserRepository.jssrc/repositories/baseOrgRepository.jsschemas/registry-org/get-registry-org-response.json_userMapresponse object.api-docs/openapi.jsonexpandquery parameter documentation for the registry org lookup endpoint.test/unit-tests/org/registryOrgGetSingleTest.jsexpand=users, role-based_userMapaccess, and UUID stripping.test/unit-tests/conversation/conversationRepositoryTest.js"Secretariat".test/integration-tests/registry-org/registryOrgCRUDTest.jstest/integration-tests/conversation/conversationTest.js"Unknown User"to"Secretariat".Testing
Steps to manually test updated functionality:
GET /api/registry/org/{shortname}and verify_userMapis not present.GET /api/registry/org/{shortname}?expand=usersas Secretariat and verify_userMapis present.GET /api/registry/org/{shortname}?expand=usersas an admin of that org and verify_userMapis present only for users in that org.GET /api/registry/org/{shortname}?expand=usersas a regular non-Secretariat user and verify_userMapis not present.author_nameis"Secretariat".GET /api/registry/org/{shortname}and verify Secretariat-authored comments showauthor_name: "Secretariat"for Secretariat readers.author_idandauthor_nameare not exposed.GET /api/registry/org/{shortname}?expand=invalidand verify the request is rejected.Recommended automated tests:
bash -i -c "npm run test:unit-tests"bash -i -c "npm run test:integration"Notes
_userMapis returned as an object keyed by UUID.contact_info.additional_contactsis handled defensively, but it is not currently modeled as a first-class registry org schema field.