Skip to content

Commit f12e170

Browse files
committed
fix(@angular/cli): remove forceAuth and unscoped credential parsing
Remove the non-standard forceAuth option and custom parsing for unscoped registry credentials (token, username, password, auth) in package-metadata.ts. Since the npm CLI does not support unscoped credentials and ignores them by default, this aligning removes the unnecessary parsing complexity. Unscoped credentials will now behave identically to any other standard configuration property, falling through to default configuration parsing.
1 parent 241f9b9 commit f12e170

1 file changed

Lines changed: 1 addition & 16 deletions

File tree

packages/angular/cli/src/utilities/package-metadata.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ export interface PackageManifest extends Manifest, NgPackageManifestProperties {
5151
deprecated?: boolean;
5252
}
5353

54-
interface PackageManagerOptions extends Record<string, unknown> {
55-
forceAuth?: Record<string, unknown>;
56-
}
54+
type PackageManagerOptions = Record<string, unknown>;
5755

5856
let npmrc: PackageManagerOptions;
5957
const npmPackageJsonCache = new Map<string, Promise<Partial<NpmRepositoryPackageJson>>>();
@@ -174,19 +172,6 @@ function normalizeOptions(
174172
}
175173

176174
switch (key) {
177-
// Unless auth options are scope with the registry url it appears that npm-registry-fetch ignores them,
178-
// even though they are documented.
179-
// https://github.com/npm/npm-registry-fetch/blob/8954f61d8d703e5eb7f3d93c9b40488f8b1b62ac/README.md
180-
// https://github.com/npm/npm-registry-fetch/blob/8954f61d8d703e5eb7f3d93c9b40488f8b1b62ac/auth.js#L45-L91
181-
case '_authToken':
182-
case 'token':
183-
case 'username':
184-
case 'password':
185-
case '_auth':
186-
case 'auth':
187-
options['forceAuth'] ??= {};
188-
options['forceAuth'][key] = substitutedValue;
189-
break;
190175
case 'noproxy':
191176
case 'no-proxy':
192177
options['noProxy'] = substitutedValue;

0 commit comments

Comments
 (0)