Skip to content
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

feat: use @npmcli/redact for url cleaning #231

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/check-response.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const errors = require('./errors.js')
const { Response } = require('minipass-fetch')
const defaultOpts = require('./default-opts.js')
const log = require('proc-log')
const cleanUrl = require('./clean-url.js')
const { redact: cleanUrl } = require('@npmcli/redact')

/* eslint-disable-next-line max-len */
const moreInfoUrl = 'https://github.com/npm/cli/wiki/No-auth-for-URI,-but-auth-present-for-scoped-registry'
Expand Down
27 changes: 0 additions & 27 deletions lib/clean-url.js

This file was deleted.

5 changes: 4 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const qs = require('querystring')
const url = require('url')
const zlib = require('minizlib')
const { Minipass } = require('minipass')
const { redact: cleanUrl } = require('@npmcli/redact')

const defaultOpts = require('./default-opts.js')

Expand Down Expand Up @@ -246,4 +247,6 @@ function getHeaders (uri, auth, opts) {
return headers
}

module.exports.cleanUrl = require('./clean-url.js')
// export cleanUrl to avoid a breaking change
// TODO: next semver major remove this. Consumers should use @npmcli/redact instead
module.exports.cleanUrl = cleanUrl
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"author": "GitHub Inc.",
"license": "ISC",
"dependencies": {
"@npmcli/redact": "^1.1.0",
"make-fetch-happen": "^13.0.0",
"minipass": "^7.0.2",
"minipass-fetch": "^3.0.0",
Expand Down