
Staged publishing is generally available on npm and adds a human approval step before a package version becomes installable. Instead of publishing directly to make a version available to consumers, the prebuilt tarball is uploaded to a staging queue. A maintainer must pass a two-factor authentication challenge to approve the staged release before it is pushed to npmjs.com. The change provides proof of presence for publishes, including those from non-interactive CI/CD workflows and trusted publishing using OpenID Connect authentication. Staging requires publish access, an existing package on the npm registry, and 2FA enabled on the account. Developers can submit releases using npm stage publish with npm CLI 11.15.0 or newer. GitHub also introduced install source flags: --allow-file, --allow-remote, and --allow-directory, enabling explicit allowlisting for non-registry installs.
"Instead of a direct publish that immediately makes a package version available to consumers, the prebuilt tarball is uploaded to a stage queue where a maintainer must explicitly approve it before it becomes installable. Called staged publishing, the feature is now generally available on npm. It mandates that a human maintainer pass a two-factor authentication (2FA) challenge to approve a package before it is pushed to the npmjs[.]com."
"The Microsoft-owned subsidiary said the change ensures "proof of presence" for every publish, including those that come from non-interactive CI/CD workflows and trusted publishing with OpenID Connect (OIDC) authentication. Before using staged publishing, package maintainers have to meet the following criteria - Have publish access to the package, Package already exists on the npm registry, and 2FA is enabled for the account."
"Developers can use the command "npm stage publish" from the root directory of the package to submit it to a staging area. To use this command, it's essential to update to npm CLI 11.15.0 or newer. For optimal protection, GitHub is recommending that staged publishing be paired with trusted publishing using OIDC."
"A second update focused on npm relates to the introduction of three new install source flags alongside the existing -allow-git flag - --allow-file: Controls installs from local file paths and local tarballs --allow-remote: Controls installs from remote URLs, including https tarballs --allow-directory: Controls installs from local directories The flags allow developers to "apply the same explicit-allowlist approach to every non-registry install source," GitHub said."
Read at The Hacker News
Unable to calculate read time
Collection
[
|
...
]