Skip to content

Align user format flag semantics - #1948

Open
Ewgna wants to merge 1 commit into
CVEProject:2.8.4-releasefrom
Ewgna:bugfix/standardize-format-flags
Open

Align user format flag semantics#1948
Ewgna wants to merge 1 commit into
CVEProject:2.8.4-releasefrom
Ewgna:bugfix/standardize-format-flags

Conversation

@Ewgna

@Ewgna Ewgna commented Jul 27, 2026

Copy link
Copy Markdown

Closes Issue 1936

Summary

Standardized user repository and auth helper format flags to use legacy semantics, matching organization repository behavior. true now means legacy format and false means registry format across user and organization call sites.

Important Changes

src/repositories/baseUserRepository.js

  • Renamed isRegistryObject parameters to isLegacyObject.
  • Inverted conditionals while preserving existing registry defaults and response behavior.

src/utils/authContext.js

  • Updated user helper parameters to use isLegacyObject.
  • Removed inverse user/org format mapping so both helpers share the same boolean meaning.

src/controller/format.constants.js

  • Added shared LEGACY_FORMAT and REGISTRY_FORMAT constants.

src/controller/*

  • Updated legacy and registry controller call sites to use the shared format constants.
  • Removed old inverted user format constants.

Testing

  • 1) Ran focused eslint on updated repository, auth helper, and controller files.
  • 2) Verified no remaining isRegistryObject, old inverted constants, or conflict markers.
  • 3) Ran git diff --check.
  • 4) Ran node node_modules\mocha\bin\mocha.js test\unit-tests --recursive --exit.
  • 5) Ran 'docker compose exec cveawg npm run test:integration'

Notes

  • Existing legacy and /api/registry/... response behavior is intended to remain unchanged.
  • This PR keeps the boolean API and standardizes semantics rather than doing the broader explicit enum migration as to limit blast radius.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant