Resolves Issues #1844 and #1845: Authorization and org-identity issues#1847
Merged
Conversation
david-rocca
previously requested changes
Jun 16, 2026
david-rocca
left a comment
Collaborator
There was a problem hiding this comment.
See comments in PR and in Teams
david-rocca
approved these changes
Jun 16, 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 #1844 and #1845
Summary
Fixes org-identity authorization issues around duplicate short names, registry organization renames, and audit payload target UUIDs.
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.This also corrects registry audit payload identity fields so update/delete events log the UUID of the org or user acted upon, rather than the requester’s org/user UUID.
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.update_registry_org, including joint-approval responses.delete_registry_org.src/controller/registry-user.controller/registry-user.controller.jsdelete_registry_userwhile retaining requester UUID use for repository audit side effects.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.test/integration-tests/registry-user/registryUserCRUDTest.jsdelete_registry_userlogs the deleted user UUID.Testing
Steps to manually test updated functionality:
bash -i -c "npm run test:unit-tests".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.update_registry_orgaudit payloads use the updated org UUID.delete_registry_orgaudit payloads use the deleted org UUID.delete_registry_useraudit payloads use the deleted user UUID.