Skip to content

Export default CSR subject fields from core-cli device-id-cmd #1756

@jchris

Description

@jchris

Problem

The deviceIdRegisterEvento handler in @fireproof/core-cli accepts a ReqDeviceIdRegister with subject fields (country, organization, locality, state), but the default values for these fields are only defined inline in the cmd-ts option definitions in cmds/device-id-cmd.js:

country: option({ defaultValue: () => "WD" }),
organization: option({ defaultValue: () => "You did not set the Organization" }),
locality: option({ defaultValue: () => "You did not set the City" }),
state: option({ defaultValue: () => "You did not set the State" }),

When calling deviceIdRegisterEvento.handle() directly (instead of shelling out to core-cli deviceId register), callers must duplicate these defaults. The server rejects empty strings — e.g. country must be >= 2 chars.

Request

Export a defaultCsrSubject constant (or similar) from @fireproof/core-cli so direct callers can use it:

export const defaultCsrSubject = {
  country: "WD",
  organization: "You did not set the Organization",
  locality: "You did not set the City",
  state: "You did not set the State",
};

Context

vibes.diy CLI switched from shelling out to core-cli deviceId register to calling deviceIdRegisterEvento.handle() directly (VibesDIY/vibes.diy#1313). Had to hardcode the defaults to avoid CSR validation errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions