Skip to content

Standardize legacy/registry format selection in repository APIs #1936

Description

@david-rocca

Summary

Organization repository APIs use booleans with legacy semantics (isLegacyObject / returnLegacyFormat), while user repository APIs use the inverse (isRegistryObject). This makes call sites error-prone and requires separate constants for otherwise equivalent format choices.

Standardize the repository and auth helper APIs on legacy semantics, or replace boolean flags with an explicit format value.

Scope

  • Update BaseUserRepository parameters from isRegistryObject to isLegacyObject.
  • Invert BaseUserRepository conditionals while preserving behavior:
    • true means legacy object/format.
    • false means registry object/format.
  • Preserve current registry defaults by changing isRegistryObject = true to isLegacyObject = false.
  • Update authContext user helpers to use the same semantic convention.
  • Update all controller, repository, utility, mock, and test call sites.
  • Consolidate controller constants where appropriate so both organization and user calls use the same LEGACY_* / REGISTRY_* format meaning.

Alternative

Consider replacing boolean arguments with an explicit value, such as:

const ObjectFormat = {
  LEGACY: 'legacy',
  REGISTRY: 'registry'
}

This is clearer but is a broader signature migration.

Acceptance Criteria

  • No repository or auth helper uses isRegistryObject.
  • User and organization format flags have the same meaning: true represents legacy; false represents registry.
  • Existing legacy and /api/registry/... response behavior is unchanged.
  • Unit and integration tests pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Needs Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions