Skip to content

Align user format flag semantics - #1948

Merged
jdalphond-mitre merged 4 commits into
CVEProject:2.8.4-releasefrom
Ewgna:bugfix/standardize-format-flags
Aug 5, 2026
Merged

Align user format flag semantics#1948
jdalphond-mitre merged 4 commits into
CVEProject:2.8.4-releasefrom
Ewgna:bugfix/standardize-format-flags

Conversation

@Ewgna

@Ewgna Ewgna commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

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.

@Ewgna
Ewgna force-pushed the bugfix/standardize-format-flags branch from 0ecb55d to fba7fd3 Compare July 29, 2026 18:11
@CVEProject CVEProject deleted a comment from 87quebad-lang Aug 5, 2026
@jdalphond-mitre

Copy link
Copy Markdown
Collaborator

Had to fix a merge issue but this looks good. Ran all tests locally.

@jdalphond-mitre
jdalphond-mitre merged commit b406855 into CVEProject:2.8.4-release Aug 5, 2026
9 checks passed
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.

2 participants