Resolves Issue # 1846: Org PUT response masking#1850
Conversation
|
I think this is too restrictive. The response from the get still needs to have Those things exist in the schema. The point is to remove things that are NOT in the schema. |
@david-rocca we will want to chat about this one further |
jdalphond-mitre
left a comment
There was a problem hiding this comment.
@david-rocca I think this looks good now but I would rather you take a look through it.
I tested by modifying a few records in the database directly adding random fields to the baseorg and baseorg.program_data. They all got stripped out. I also tested _relatedOrganizations and that still comes through.
Closes Issue #1846
Summary
This MR masks stale registry org fields from GET responses so old document shapes do not get returned to clients, while preserving valid response fields and underscore-prefixed response extension fields.
Important Changes
src/repositories/baseOrgRepository.jsprogram_datapaths.created,last_updated,users,admins,reports_to, andconversation._relatedOrganizationswithout adding them to response schemas._id,__v, and__t.src/controller/registry-org.controller/registry-org.controller.jssrc/controller/registry-user.controller/registry-user.controller.jssrc/repositories/baseUserRepository.jstest/integration-tests/registry-org/registryOrgCRUDTest.js_relatedOrganizations, is preserved.Testing
Steps to manually test updated functionality, if possible
bash -i -c "npm run test:integration".