Content-Length: 338537 | pFad | http://github.com/npm/cli/pull/8228/commits/f2d9371b4c63673e8bed99ec1e9a9fa8eee7389e

40 fix: add otplease for enable-2fa, disable-2fa, access by reggi · Pull Request #8228 · npm/cli · GitHub
Skip to content

fix: add otplease for enable-2fa, disable-2fa, access #8228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 7, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add otplease for access commands
  • Loading branch information
reggi committed Apr 25, 2025
commit f2d9371b4c63673e8bed99ec1e9a9fa8eee7389e
8 changes: 6 additions & 2 deletions lib/commands/access.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,15 @@ class Access extends BaseCommand {
}

async #grant (permissions, scope, pkg) {
await libnpmaccess.setPermissions(scope, pkg, permissions, this.npm.flatOptions)
await otplease(this.npm, this.npm.flatOptions, async (opts) => {
await libnpmaccess.setPermissions(scope, pkg, permissions, opts)
})
}

async #revoke (scope, pkg) {
await libnpmaccess.removePermissions(scope, pkg, this.npm.flatOptions)
await otplease(this.npm, this.npm.flatOptions, async (opts) => {
await libnpmaccess.removePermissions(scope, pkg, opts)
})
}

async #listPackages (owner, pkg) {
Expand Down
15 changes: 9 additions & 6 deletions node_modules/npm-registry-fetch/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,22 +123,25 @@ function regFetch (uri, /* istanbul ignore next */ opts_ = {}) {
noProxy: opts.noProxy,
proxy: opts.httpsProxy || opts.proxy,
retry: opts.retry ? opts.retry : {
retries: opts.fetchRetries,
factor: opts.fetchRetryFactor,
minTimeout: opts.fetchRetryMintimeout,
maxTimeout: opts.fetchRetryMaxtimeout,
retries: opts.fetchRetries,
factor: opts.fetchRetryFactor,
minTimeout: opts.fetchRetryMintimeout,
maxTimeout: opts.fetchRetryMaxtimeout,
},
strictSSL: opts.strictSSL,
timeout: opts.timeout || 30 * 1000,
}).then(res => checkResponse({
}).then(res => {
console.log('Response Headers:', res.headers.raw());
return checkResponse({
method,
uri,
res,
registry,
startTime,
auth,
opts,
}))
});
})

if (typeof opts.otpPrompt === 'function') {
return p.catch(async er => {
Expand Down
Loading








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/npm/cli/pull/8228/commits/f2d9371b4c63673e8bed99ec1e9a9fa8eee7389e

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy