Skip to content

feat(release): npm-auth preflight fails closed before publish (#3)#17

Merged
anombyte93 merged 2 commits into
mainfrom
fix/prd-taskmaster-npm-auth-preflight
Jun 15, 2026
Merged

feat(release): npm-auth preflight fails closed before publish (#3)#17
anombyte93 merged 2 commits into
mainfrom
fix/prd-taskmaster-npm-auth-preflight

Conversation

@anombyte93

Copy link
Copy Markdown
Owner

Adds an npm release-auth preflight that FAILS CLOSED before any tag/build/publish work — so a release never stalls on a browser web-auth timeout. Pure resolveNpmAuth (no network) detects NPM_TOKEN/NODE_AUTH_TOKEN or a ~/.npmrc _authToken; CLI exits 1 (before any whoami) when none. Wired into prepublishOnly ahead of version-sync. Includes RELEASE.md.

Code-reviewed (Fix-then-merge → fixed): robust main() entry guard via pathToFileURL (a naive file://${argv[1]} guard silently skipped the whole check under spaced/symlinked paths), stricter npmrc startsWith match, + an I1 regression test. Verified: node --test 10/10; no-token + spaced-path both exit 1.

claude and others added 2 commits June 15, 2026 09:35
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…rc match

Addresses code-review I1/M1/M2 on the npm-auth preflight (#3):
- I1: a naive file://${argv[1]} guard silently skipped main() (and the whole
  auth check) when the install path had spaces or was symlinked — a publish could
  proceed with NO auth check. Use pathToFileURL(argv[1]).href.
- M1: repurpose the previously-unused node:url import.
- M2: anchor the npmrc token match with startsWith so a crafted host segment
  can't false-pass.
Adds an I1 regression test (script run from a path with spaces still exits 1).
Verified: node --test 10/10; no-token + spaces-path both exit 1.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@anombyte93 anombyte93 merged commit dc66a44 into main Jun 15, 2026
@anombyte93 anombyte93 deleted the fix/prd-taskmaster-npm-auth-preflight branch June 15, 2026 03:13
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