Many tools in the ecosystem use the _npmUser of a packument to know if a package was created via trusted publishing or not.
When it is, the npm user is the oidc user.
However, now that staging is a thing - the npm user will correctly be the human who approved the publish rather than the automation.
This means there's no longer any way to determine if a package was published via oidc or not.
Due to this, many existing tools in the ecosystem break when encountering staged packages. (e.g. pnpm).
Solution
I think we just need two signals instead of inferring this stuff:
- Whether OIDC was used or not
- Whether staged publishing was used or not
e.g. {_npmMeta: {staged: true, oidc: true}}
Many tools in the ecosystem use the
_npmUserof a packument to know if a package was created via trusted publishing or not.When it is, the npm user is the oidc user.
However, now that staging is a thing - the npm user will correctly be the human who approved the publish rather than the automation.
This means there's no longer any way to determine if a package was published via oidc or not.
Due to this, many existing tools in the ecosystem break when encountering staged packages. (e.g. pnpm).
Solution
I think we just need two signals instead of inferring this stuff:
e.g.
{_npmMeta: {staged: true, oidc: true}}