Resolves Issue #1715, Add expanded user map to registry org response#1835
Open
afoote-mitre wants to merge 2 commits into
Open
Resolves Issue #1715, Add expanded user map to registry org response#1835afoote-mitre wants to merge 2 commits into
afoote-mitre wants to merge 2 commits into
Conversation
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.Important Changes
src/controller/org.controller/index.jsexpand=usersonGET /api/registry/org/{identifier}src/controller/org.controller/org.middleware.jsexpandquery parameter intoreq.ctx.querysrc/controller/registry-org.controller/registry-org.controller.js_userMaphydration whenexpand=usersis requestedusers,admins, defensivecontact_info.additional_contacts, and visible conversationauthor_idssrc/repositories/baseUserRepository.jssrc/repositories/baseOrgRepository.jsschemas/registry-org/get-registry-org-response.json_userMapresponse objectapi-docs/openapi.jsonexpandquery parameter documentation for the registry org lookup endpointtest/unit-tests/org/registryOrgGetSingleTest.jsexpand=userstest/integration-tests/registry-org/registryOrgCRUDTest.jsTesting
Steps to manually test updated functionality:
GET /api/registry/org/{shortname}and verify_userMapis not presentGET /api/registry/org/{shortname}?expand=usersand verify_userMapis present_userMapis keyed by user UUID and includesusername,name, andorg.short_name_userMapGET /api/registry/org/{shortname}?expand=invalidand verify the request is rejectedRecommended automated tests:
npm run test:integrationnpm run test:unit-testsNotes
_userMapis returned as an object keyed by UUIDcontact_info.additional_contactsis handled defensively, but it is not currently modeled as a first-class registry org schema field