@@ -141,6 +141,12 @@ Note that the dependency installation scripts will run in each subpackage indica
141
141
142
142
# TODO(kgreenek): Add arm64 versions for all of these.
143
143
_ATTRS = {
144
+ "node_download_auth" : attr .string_dict (
145
+ default = {},
146
+ doc = """auth to use for all url requests
147
+ Example: {\" type\" : \" basic\" , \" login\" : \" <UserName>\" , \" password\" : \" <Password>\" }
148
+ """ ,
149
+ ),
144
150
"node_repositories" : attr .string_list_dict (
145
151
doc = """Custom list of node repositories to use
146
152
@@ -194,6 +200,12 @@ If set then also set node_version to the version that of node that is vendored."
194
200
allow_single_file = True ,
195
201
doc = "the local path to a pre-installed yarn tool" ,
196
202
),
203
+ "yarn_download_auth" : attr .string_dict (
204
+ default = {},
205
+ doc = """auth to use for all url requests
206
+ Example: {\" type\" : \" basic\" , \" login\" : \" <UserName>\" , \" password\" : \" <Password>\" }
207
+ """ ,
208
+ ),
197
209
"yarn_repositories" : attr .string_list_dict (
198
210
doc = """Custom list of yarn repositories to use.
199
211
@@ -275,8 +287,14 @@ def _download_node(repository_ctx):
275
287
fail ("Unknown NodeJS version-host %s" % version_host_os )
276
288
filename , strip_prefix , sha256 = node_repositories [version_host_os ]
277
289
290
+ urls = [url .format (version = node_version , filename = filename ) for url in node_urls ]
291
+ auth = {}
292
+ for url in urls :
293
+ auth [url ] = repository_ctx .attr .node_download_auth
294
+
278
295
repository_ctx .download_and_extract (
279
- url = [url .format (version = node_version , filename = filename ) for url in node_urls ],
296
+ auth = auth ,
297
+ url = urls ,
280
298
output = NODE_EXTRACT_DIR ,
281
299
stripPrefix = strip_prefix ,
282
300
sha256 = sha256 ,
@@ -317,8 +335,15 @@ def _download_yarn(repository_ctx):
317
335
else :
318
336
fail ("Unknown Yarn version %s" % yarn_version )
319
337
338
+ urls = [url .format (version = yarn_version , filename = filename ) for url in yarn_urls ]
339
+
340
+ auth = {}
341
+ for url in urls :
342
+ auth [url ] = repository_ctx .attr .yarn_download_auth
343
+
320
344
repository_ctx .download_and_extract (
321
- url = [url .format (version = yarn_version , filename = filename ) for url in yarn_urls ],
345
+ auth = auth ,
346
+ url = urls ,
322
347
output = YARN_EXTRACT_DIR ,
323
348
stripPrefix = strip_prefix ,
324
349
sha256 = sha256 ,
0 commit comments