Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

google-artifactregistry-auth

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-artifactregistry-auth - npm Package Compare versions

Comparing version 3.1.1 to 3.1.2

2

package.json
{
"name": "google-artifactregistry-auth",
"version": "3.1.1",
"version": "3.1.2",
"description": "google-artifactregistry-auth is an npm module that allows you to configure npm to interact with npm repositories stored in Artifact Registry.",

@@ -5,0 +5,0 @@ "main": "./src/main.js",

@@ -32,7 +32,2 @@ // Copyright 2019 Google LLC

toConfigPath = path.resolve(toConfigPath);
// Backward-compatible scenario. Update auth configs in project npmrc directly.
if (fromConfigPath == toConfigPath) {
updateConfigFile(fromConfigPath, creds);
return;
}

@@ -106,3 +101,7 @@ const fromConfigs = [];

await fs.promises.writeFile(toConfigPath, toConfigs.join(`\n`));
await fs.promises.writeFile(fromConfigPath, fromConfigs.join(`\n`));
if(fromConfigPath !== toConfigPath) {
// If the files are the same (and likely the user .npmrc file) only write once with the auth configs
// Otherwise, we'd overwrite this file without adding the credentials
await fs.promises.writeFile(fromConfigPath, fromConfigs.join(`\n`));
}
}

@@ -109,0 +108,0 @@

@@ -280,2 +280,16 @@ /**

it('set multiple tokens in same file', async function(){
fromConfigPath = getConfigPath(`${this.test.title}-from`);
toConfigPath = fromConfigPath;
fs.writeFileSync(fromConfigPath, `registry=https://us-west1-npm.pkg.dev/my-project/my-repo/
@cba:registry=https://asia-npm.pkg.dev/my-project/my-other-repo/`);
await update.updateConfigFiles(fromConfigPath, toConfigPath, creds);
const got = fs.readFileSync(fromConfigPath, 'utf8');
assert.equal(got, `registry=https://us-west1-npm.pkg.dev/my-project/my-repo/
@cba:registry=https://asia-npm.pkg.dev/my-project/my-other-repo/
//us-west1-npm.pkg.dev/my-project/my-repo/:_authToken=abcd
//asia-npm.pkg.dev/my-project/my-other-repo/:_authToken=abcd`);
});
it('use password config if exists', async function(){

@@ -282,0 +296,0 @@ fromConfigPath = getConfigPath(`${this.test.title}-from`);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc