Skip to content

fix: reject an invalid identity name before offering the creation wizard - #14

Merged
Mearman merged 1 commit into
mainfrom
validate-identity-name-before-wizard
Sep 11, 2026
Merged

Mearman merged 1 commit into
mainfrom
validate-identity-name-before-wizard

Conversation

@Mearman

@Mearman Mearman commented Sep 11, 2026

Copy link
Copy Markdown
Member

The @<name> shortcut passes its name portion through verbatim, so an email-shaped argument like @joseph.mearman@exadev.io reached runIdentityWizard unchanged. The wizard prompted "Create it now?" and only threw InvalidIdentityNameError after the user selected Create — an interaction that offers an action it can never perform.

This validates the name against IdentitySchema at the top of the wizard, the single choke point both the @<name> shortcut and identity use route through, so the clean one-line error fires before any prompt appears:

"joseph.mearman@exadev.io" is not a valid identity name — identity names must start
with a letter or number and may only contain letters, numbers, dots, hyphens, and underscores.

Continues the raw-throw-to-CliError sweep already on main (d03712a, 74cfe16, 423eddf): 2.0.1 already stopped addIdentity crashing with a raw ZodError; this closes the remaining interactive gap where a doomed name was still offered the wizard.

@Mearman

Mearman commented Sep 11, 2026

Copy link
Copy Markdown
Member Author

The one red check, audit, is advisory-database drift on main (js-yaml/fast-uri/vitest), not this diff — cleared by #16. This branch will be rebased onto main after #16 lands so its lockfile carries the bumps, then merged.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-11T07:51:16.336848Z e418ca4 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

The @<name> shortcut passes its name portion through verbatim, so an
email-shaped argument like @joseph.mearman@exadev.io reached
runIdentityWizard unchanged. The wizard prompted "Create it now?" and
only threw InvalidIdentityNameError after the user confirmed, an
interaction that offers an action it can never perform.

Validate the name against IdentitySchema at the top of the wizard, the
single choke point both the @<name> shortcut and `identity use` route
through, so the clean one-line error fires before any prompt appears.
@Mearman
Mearman force-pushed the validate-identity-name-before-wizard branch from e418ca4 to d4b1ff6 Compare September 11, 2026 07:58
@Mearman
Mearman merged commit 91442d0 into main Sep 11, 2026
30 checks passed
@Mearman
Mearman deleted the validate-identity-name-before-wizard branch September 11, 2026 08:07
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