File tree Expand file tree Collapse file tree
e2e/npm_translate_lock_dynamic_auth Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ cleanup() {
4141trap cleanup EXIT
4242
4343echo -e " ${BLUE} Test 1: Fetch with valid token${NC} "
44- cat > ~ /.npmrc << EOF
44+ cat > ~/.npmrc << EOF
4545_authToken=${ASPECT_NPM_AUTH_TOKEN}
4646EOF
4747touch ~ /.npmrc.test
5757echo " "
5858
5959echo -e " ${BLUE} Test 2: Fetch with broken token (empty repository cache)${NC} "
60- cat > ~ /.npmrc << EOF
60+ cat > ~/.npmrc << EOF
6161_authToken=BROKEN_TOKEN_SHOULD_CAUSE_401
6262EOF
6363
8080echo " "
8181
8282echo -e " ${BLUE} Test 3: Fetch with restored valid token${NC} "
83- cat > ~ /.npmrc << EOF
83+ cat > ~/.npmrc << EOF
8484_authToken=${ASPECT_NPM_AUTH_TOKEN}
8585EOF
8686
Original file line number Diff line number Diff line change @@ -1083,6 +1083,8 @@ def npm_import(
10831083 npm_auth_basic = "" ,
10841084 npm_auth_username = "" ,
10851085 npm_auth_password = "" ,
1086+ npmrc = None ,
1087+ use_home_npmrc = None ,
10861088 bins = {},
10871089 dev = False ,
10881090 exclude_package_contents = [],
@@ -1321,6 +1323,10 @@ def npm_import(
13211323
13221324 npm_auth_password: Auth password to authenticate with npm. When using Basic authentication.
13231325
1326+ npmrc: Label to an .npmrc file for authentication. Supports environment variable expansion.
1327+
1328+ use_home_npmrc: Use ~/.npmrc for authentication.
1329+
13241330 extra_build_content: Additional content to append on the generated BUILD file at the root of
13251331 the created repository, either as a string or a list of lines similar to
13261332 <https://github.com/bazelbuild/bazel-skylib/blob/main/docs/write_file_doc.md>.
@@ -1389,6 +1395,8 @@ def npm_import(
13891395 npm_auth_basic = npm_auth_basic ,
13901396 npm_auth_username = npm_auth_username ,
13911397 npm_auth_password = npm_auth_password ,
1398+ npmrc = npmrc ,
1399+ use_home_npmrc = use_home_npmrc ,
13921400 lifecycle_hooks = lifecycle_hooks ,
13931401 extra_build_content = (
13941402 extra_build_content if type (extra_build_content ) == "string" else "\n " .join (extra_build_content )
You can’t perform that action at this time.
0 commit comments