mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 15:06:27 +00:00
refactor: warn if localhost registry detected
This commit is contained in:
parent
db0efdf053
commit
8a8e5c8fed
1 changed files with 9 additions and 0 deletions
|
@ -66,6 +66,15 @@ function setNpmrc(input, trustLevel = 'low') {
|
|||
npmrc = ini.parse(input);
|
||||
// massage _auth to _authToken
|
||||
for (const [key, val] of Object.entries(npmrc)) {
|
||||
// istanbul ignore if
|
||||
if (
|
||||
trustLevel === 'low' &&
|
||||
key.endsWith('registry') &&
|
||||
val &&
|
||||
val.includes('localhost')
|
||||
) {
|
||||
logger.warn({ key, val }, 'Detected localhost registry');
|
||||
}
|
||||
if (key !== '_auth' && key.endsWith('_auth') && isBase64(val)) {
|
||||
logger.debug('Massaging _auth to _authToken');
|
||||
npmrc[key + 'Token'] = val;
|
||||
|
|
Loading…
Reference in a new issue