@@ -3977,6 +3977,56 @@ t.test('should preserve exact ranges, missing actual tree', async (t) => {
39773977 await t . resolves ( arb . reify ( ) , 'same-origin tarball is allowed for registry root' )
39783978 } )
39793979
3980+ t . test ( 'allowRemote=none allows registry tarball under linked install strategy' , async t => {
3981+ // The linked strategy extracts store nodes as IsolatedNode, which has no edges to recompute isRegistryDependency from.
3982+ // The flag must be carried from the source tree node so the registry-tarball allow-remote exemption still applies.
3983+ const abbrevPackument5 = JSON . stringify ( {
3984+ _id : 'abbrev' ,
3985+ _rev : 'lkjadflkjasdf' ,
3986+ name : 'abbrev' ,
3987+ 'dist-tags' : { latest : '1.1.1' } ,
3988+ versions : {
3989+ '1.1.1' : {
3990+ name : 'abbrev' ,
3991+ version : '1.1.1' ,
3992+ dist : {
3993+ tarball : 'https://registry.example.com/npm/abbrev/-/abbrev-1.1.1.tgz' ,
3994+ } ,
3995+ } ,
3996+ } ,
3997+ } )
3998+
3999+ const testdir = t . testdir ( {
4000+ project : {
4001+ 'package.json' : JSON . stringify ( {
4002+ name : 'myproject' ,
4003+ version : '1.0.0' ,
4004+ dependencies : {
4005+ abbrev : '1.1.1' ,
4006+ } ,
4007+ } ) ,
4008+ } ,
4009+ } )
4010+
4011+ tnock ( t , 'https://registry.example.com' )
4012+ . get ( '/npm/abbrev' )
4013+ . reply ( 200 , abbrevPackument5 )
4014+
4015+ tnock ( t , 'https://registry.example.com' )
4016+ . get ( '/npm/abbrev/-/abbrev-1.1.1.tgz' )
4017+ . reply ( 200 , abbrevTGZ )
4018+
4019+ const arb = new Arborist ( {
4020+ path : resolve ( testdir , 'project' ) ,
4021+ registry : 'https://registry.example.com/npm' ,
4022+ cache : resolve ( testdir , 'cache' ) ,
4023+ allowRemote : 'none' ,
4024+ installStrategy : 'linked' ,
4025+ } )
4026+
4027+ await t . resolves ( arb . reify ( ) , 'registry tarball is allowed under linked strategy' )
4028+ } )
4029+
39804030 t . test ( 'registry with different protocol should swap protocol' , async ( t ) => {
39814031 const abbrevPackument4 = JSON . stringify ( {
39824032 _id : 'abbrev' ,
0 commit comments