Resolves #1176 For GET /cve-id, redacts requested_by.user
value for situations when cve-ids changes orgs, and when users change orgs
#1179
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 #1176
Summary
When calling the GET
/cve-id
endpoint as a non Secretariat user, in the returned cve-id data, therequested_by.user
value is now redacted when that user is not in therequested_by.cna
organization. Also, the same value is redacted when theowning_cna
is not the same organization as therequested_by.cna
organization.Important Changes
cve-id.controller.js
getFiliteredCveId()
to check ifrequested_by.user
is not part ofrequested_by.cna
org .getFilteredCveId()
to checkowning_cna
is not the same org asrequested_by.cna
org.REDACTED
value for the above situations.Testing
Run
npm run test:integration
for automated testing.Steps to manually test updated functionality, if possible
- Create two test organizations: testOrgA and testOrgB
- Create two users in testOrgA, and one user in testOrgB
- Reserve 1 Cve-Id as user1 in testOrgA, and 1 Cve-Id as user2 in testOrgA
/cve-id
. Both reserved Cve-ids should be shown, but one will haverequested_by.user
:REDACTED
./cve-id
on the second reserved Cve-id, and updating the org to testOrgB./cve-id
, one reserved Cve-Id should be returned withrequested_by.user
:REDACTED