npm / npm/cli

[Feature] OIDC should be exported and available in libnpmpublish

Open Beginner friendly
#9,503 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

The OIDC function from oidc.js is not currently exported neither available from the libnpmpublish package. This mean that to get it working in Lerna/Lerna-Lite (I maintain the latter), we had to copy and reimplement the oidc.js into Lerna/Lerna-Lite to make it work.

There's 2 obvious issues related to this approach:

  1. duplicate code increasing Lerna/Lerna-Lite project size
  2. any changes made in oidc.js needs to be resync manually in external projects like Lerna/Lerna-Lite
    • for example adding OIDC CircleCI support was added much later and this wasn't synched back to Lerna which means it doesn't currently work in Lerna (I did synch it myself in Lerna-Lite though)
    • ref: Lerna oidc.ts and Lerna-Lite oidc.ts
    • Lerna currently has an open issue related to their oidc being out of sync: https://github.com/lerna/lerna/issues/4358
libnpmpublish only exports 2 functions (publish and unpublish)

https://github.com/npm/cli/blob/455aa4a17b92a77ffbd474c4dc17a16f71cfe6b1/workspaces/libnpmpublish/lib/index.js#L1-L4

I mention Lerna/Lerna-Lite in here, but I'm sure there's few hundred projects that would benefit from having OIDC available directly in libnpmpublish

Contributor guide

Open the contributing guide

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.

Research direction

Start with workspaces/libnpmpublish/lib/index.js and the existing oidc.js implementation, then compare how libnpmpublish currently exposes publish and unpublish. Done means the OIDC function is available through the libnpmpublish package without downstream projects copying its implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli, developer-experience
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.