Skip to content

Commit

Permalink
Update testing
Browse files Browse the repository at this point in the history
  • Loading branch information
aayushRedHat committed Jan 15, 2024
1 parent cf92947 commit d2c5cc2
Show file tree
Hide file tree
Showing 13 changed files with 2,512 additions and 149 deletions.
14 changes: 7 additions & 7 deletions lib/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -533,14 +533,15 @@ class Generator {
arbOptions.registry = providedRegistry;
registryUrl = providedRegistry;
}


const domainName = registryUrl.replace(/^https?:\/\//, '');
//doing basic if/else so basically only one auth type is used and token as more secure is primary
if (this.registry.token) {
authorizationName = `//${registryUrl}:_authToken`;
arbOptions.authorizationName = this.registry.token;
authorizationName = `//${domainName}:_authToken`;
arbOptions[authorizationName] = this.registry.token;
} else if (this.registry.auth) {
authorizationName = `//${registryUrl}:_auth`;
arbOptions.authorizationName = this.registry.auth;
authorizationName = `//${domainName}:_auth`;
arbOptions[authorizationName] = this.registry.auth;
}

//not sharing in logs neither token nor auth for security reasons
Expand Down Expand Up @@ -582,12 +583,11 @@ class Generator {

const arbOptions = {
path: ROOT_DIR,
...this.registry.extraAuth // For testing the verdaccio
};
if (this.registry) {
this.initialiseArbOptions(arbOptions);
}

console.log(arbOptions);
const arb = new Arborist(arbOptions);

try {
Expand Down
Loading

0 comments on commit d2c5cc2

Please sign in to comment.