Remove abandoned ?registry=true registry-mode support
Summary
The old ?registry=true design was abandoned in favor of explicit /api/registry/... endpoints, but repo-wide audit shows query-param registry mode still has code, tests, and docs. This should be removed so legacy endpoints do not document, parse, validate, test, or branch on ?registry=true.
Findings
src/middleware/middleware.js:99 still defines handleRegistryParameter, which sets req.useRegistry = req.query.registry === 'true'.
src/controller/user.controller/index.js:164 still supports /api/users?registry=true.
src/controller/user.controller/user.controller.js:25 uses !!req.useRegistry to switch /api/users response behavior.
test/integration-tests/user/getUsersTest.js:36 explicitly tests /api/users?registry=true.
src/controller/user.controller/user.middleware.js:7 still maps registry from query params.
src/controller/org.controller/index.js:1271 and src/controller/org.controller/index.js:1673 call mw.handleRegistryParameter, but route validation only allows page, so ?registry=true appears rejected.
src/controller/org.controller/org.middleware.js:25, :175, and :202 still branch on req.query.registry === 'true'.
src/controller/org.controller/org.middleware.js:208 excludes registry from allowed query params, making some registry branches unreachable.
src/swagger.js:482 and api-docs/openapi.json:6107 still define a registry query parameter.
test/unit-tests/org/orgCreateTest.js:182 still includes query: { registry: 'false' }.
test/integration-tests/org/regularUsersTestRegistry.js:321 has a commented test referencing /api/org/...?...registry=true.
Important Exception
Do not blindly remove all req.useRegistry logic. These explicit /api/registry/org... routes still call org.controller.js and rely on registry-mode behavior:
GET /api/registry/org/:shortname/id_quota
PUT /api/registry/org/:shortname/user/:username/reset_secret
These should either be preserved or migrated to registry controllers before cleanup.
Expected Behavior
Registry behavior should be exposed through /api/registry/... routes only. Legacy /api/org... and /api/users... routes should not support or document ?registry=true.
Suggested Cleanup
- Remove
?registry=true support from /api/users.
- Remove
mw.handleRegistryParameter if no valid use remains.
- Remove legacy org route calls to
mw.handleRegistryParameter.
- Remove unreachable registry branches and unused validators in
src/controller/org.controller/org.middleware.js.
- Simplify
req.useRegistry branches in legacy controllers where safe.
- Remove
registry query parameter docs from Swagger/OpenAPI and regenerate api-docs/openapi.json.
- Update or remove tests/comments that reference
?registry=true.
Acceptance Criteria
- No endpoint supports registry switching via
?registry=true.
/api/registry/... endpoints continue to work.
- OpenAPI no longer advertises a
registry query parameter.
- Tests no longer depend on
/api/users?registry=true.
- Integration coverage confirms intended
/api/registry/... behavior remains intact.
Remove abandoned
?registry=trueregistry-mode supportSummary
The old
?registry=truedesign was abandoned in favor of explicit/api/registry/...endpoints, but repo-wide audit shows query-param registry mode still has code, tests, and docs. This should be removed so legacy endpoints do not document, parse, validate, test, or branch on?registry=true.Findings
src/middleware/middleware.js:99still defineshandleRegistryParameter, which setsreq.useRegistry = req.query.registry === 'true'.src/controller/user.controller/index.js:164still supports/api/users?registry=true.src/controller/user.controller/user.controller.js:25uses!!req.useRegistryto switch/api/usersresponse behavior.test/integration-tests/user/getUsersTest.js:36explicitly tests/api/users?registry=true.src/controller/user.controller/user.middleware.js:7still mapsregistryfrom query params.src/controller/org.controller/index.js:1271andsrc/controller/org.controller/index.js:1673callmw.handleRegistryParameter, but route validation only allowspage, so?registry=trueappears rejected.src/controller/org.controller/org.middleware.js:25,:175, and:202still branch onreq.query.registry === 'true'.src/controller/org.controller/org.middleware.js:208excludesregistryfrom allowed query params, making some registry branches unreachable.src/swagger.js:482andapi-docs/openapi.json:6107still define aregistryquery parameter.test/unit-tests/org/orgCreateTest.js:182still includesquery: { registry: 'false' }.test/integration-tests/org/regularUsersTestRegistry.js:321has a commented test referencing/api/org/...?...registry=true.Important Exception
Do not blindly remove all
req.useRegistrylogic. These explicit/api/registry/org...routes still callorg.controller.jsand rely on registry-mode behavior:GET /api/registry/org/:shortname/id_quotaPUT /api/registry/org/:shortname/user/:username/reset_secretThese should either be preserved or migrated to registry controllers before cleanup.
Expected Behavior
Registry behavior should be exposed through
/api/registry/...routes only. Legacy/api/org...and/api/users...routes should not support or document?registry=true.Suggested Cleanup
?registry=truesupport from/api/users.mw.handleRegistryParameterif no valid use remains.mw.handleRegistryParameter.src/controller/org.controller/org.middleware.js.req.useRegistrybranches in legacy controllers where safe.registryquery parameter docs from Swagger/OpenAPI and regenerateapi-docs/openapi.json.?registry=true.Acceptance Criteria
?registry=true./api/registry/...endpoints continue to work.registryquery parameter./api/users?registry=true./api/registry/...behavior remains intact.