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

Open Beginner friendly
#1,756 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Quiet
Domain
cli

Research direction

Start with cmds/device-id-cmd.js and the deviceIdRegisterEvento handler to trace where the four cmd-ts defaults are defined. Export a shared defaultCsrSubject from @fireproof/core-cli with the shown values, then verify direct handle() callers can use it without duplicating defaults or triggering CSR validation errors.

Written by the indexing model from the issue text.

Description

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.

Dominant language
TypeScript
Stars
976
Forks
58
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fireproof-storage/fireproof

All issues in fireproof-storage/fireproof

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.