Add npm and pnpm support - #658
Open
dalldrit13 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This change introduces a 1Password plugin supporting npm and pnpm. Currently both these systems default is to store credentials on disk in plaintext. 1Password to the rescue!
Type of change
Related Issue(s)
Didn't see any related issues however similar PR here that looks to be stale from ~2 years ago.
How To Test
Once built run
op plugin init npmorop plugin init pnpm. Follow the steps and then you can verify functionality withnpm whoamiorpnpm whoami.Note: You do need an npm account for testing this.
File import should work if you've run
npm loginorpnpm loginas these generate the plaintext file the plugin looks for. You can also generate granular access tokens in npm and paste those in the paste flowChangelog
Authenticate with npm (or pnpm) using the newly supported pluginsSome additional notes for the technical writing team in the case this gets accepted and published.
npm loginorpnpm loginafter configuring the plugin will not update your token in 1P but rather it will rewrite the token back into a plaintext file.npmwill continue to use what's in 1P, andpnpmputs higher precedence onauth.iniso that will override our 1P token. I could not think of a clean way to manage this nor did I see an existing pattern in any other plugin. For something likegh, the CLI itself handles this casenpm loginto I believe 1 hour, so users running this often would continually hit this limitation.