Skip to content

Remove abandoned ?registry=true registry-mode support #1928

Description

@david-rocca

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

  1. Remove ?registry=true support from /api/users.
  2. Remove mw.handleRegistryParameter if no valid use remains.
  3. Remove legacy org route calls to mw.handleRegistryParameter.
  4. Remove unreachable registry branches and unused validators in src/controller/org.controller/org.middleware.js.
  5. Simplify req.useRegistry branches in legacy controllers where safe.
  6. Remove registry query parameter docs from Swagger/OpenAPI and regenerate api-docs/openapi.json.
  7. 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.

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions