Skip to content

Commit b048b5f

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. (cherry picked from commit f8c3df4)
1 parent 3275b45 commit b048b5f

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
@@ -52,9 +52,7 @@ export interface PackageManifest extends Manifest, NgPackageManifestProperties {
5252
peerDependenciesMeta?: Record<string, { optional?: boolean }>;
5353
}
5454

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

5957
let npmrc: PackageManagerOptions;
6058
const npmPackageJsonCache = new Map<string, Promise<Partial<NpmRepositoryPackageJson>>>();
@@ -175,19 +173,6 @@ function normalizeOptions(
175173
}
176174

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

0 commit comments

Comments
 (0)