Resolves Issues #1844 and #1845: Authorization and org-identity issues#1847
Open
afoote-mitre wants to merge 4 commits into
Open
Resolves Issues #1844 and #1845: Authorization and org-identity issues#1847afoote-mitre wants to merge 4 commits into
afoote-mitre wants to merge 4 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 #1844 and #1845
Summary
Fixes org-identity authorization issues around duplicate short names and registry organization renames.
Authenticated request handling now preserves and uses the authenticated user/org UUIDs throughout request execution, preventing short-name lookup ambiguity from granting access to the wrong organization. Registry organization renames via
new_short_namenow follow the same duplicate checks, alias collision checks, and joint-approval flow asshort_namechanges. The follow-up refactor centralizes UUID-scoped requester/org/user checks in repository-backed auth helpers and fixes approved review-object application so it does not re-enter pending review processing.Important Changes
src/middleware/middleware.jsreq.ctxafter API-key validation.src/utils/authContext.jssrc/repositories/baseOrgRepository.jssrc/repositories/orgRepository.jssrc/repositories/baseUserRepository.jssrc/repositories/userRepository.jssrc/controller/*.jssrc/controller/registry-org.controller/registry-org.controller.jsnew_short_nameas the requested rename target for duplicate and alias collision checks.short_name/new_short_namerename intent.src/controller/review-object.controller/review-object.controller.jssrc/repositories/baseOrgRepositoryHelpers.jsnew_short_namefrom mutating stored org documents before joint-approval detection.src/controller/cve-id.controller/cve-id.controller.jstest/unit-tests/**test/integration-tests/middleware/authenticatedContextTest.jstest/integration-tests/registry-org/**new_short_nameduplicate rejection and non-Secretariat review-only rename behavior.Testing
Steps to manually test updated functionality:
bash -i -c "npm run test:unit-test".bash -i -c "npm run test:integration".PUT /api/registry/org/:shortnamewithnew_short_name: "mitre"returns duplicate short-name error.new_short_nameupdates create a pending review object and do not immediately rename the live org.