Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Cabecinha84 committed Jan 14, 2025
1 parent 8b76740 commit 6f55aab
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ZelBack/src/services/appsService.js
Original file line number Diff line number Diff line change
Expand Up @@ -4883,14 +4883,14 @@ async function checkAppSecrets(appName, appComponentSpecs, appOwner, registratio
const results = await dbHelper.findInDatabase(database, globalAppsInformation, query, projection);
let foundSecretsWithSameAppName = false;
let foundSecretsWithDifferentAppName = false;
const appComponentSecrets = appComponentSpecs.secrets.replace(/\s+\r?\n|\r/, '').replace(/\W/g, '');
const appComponentSecrets = appComponentSpecs.secrets.replace(/\r?\n|\r/, '').replace(/\W/g, '').trim();
log.info(`checkAppSecrets - appComponentSecrets: ${appComponentSecrets}`);
// eslint-disable-next-line no-restricted-syntax
for (const app of results) {
if (app.version >= 7 && app.nodes.length > 0) {
// eslint-disable-next-line no-restricted-syntax
for (const component of app.compose) {
if (component.secrets && component.secrets.replace(/\s+\r?\n|\r/, '').replace(/\W/g, '') === appComponentSecrets) {
if (component.secrets && component.secrets.replace(/\r?\n|\r/, '').replace(/\W/g, '').trim() === appComponentSecrets) {
if (registration) {
throw new Error(`Provided component ${appComponentSpecs.name} secrets are not valid`);
} else if (app.name !== appName) {
Expand All @@ -4911,11 +4911,11 @@ async function checkAppSecrets(appName, appComponentSpecs, appOwner, registratio
log.info(`checkAppSecrets - permanentappmessagefound: ${permanentAppMessage.length}`);
// eslint-disable-next-line no-restricted-syntax
for (const message of permanentAppMessage) {
// eslint-disable-next-line no-restricted-syntax
// eslint-disable-next-line no-restricted-syntax, no-unreachable-loop
for (const component of message.appSpecifications.compose) {
log.info(`checkAppSecrets - component secret: ${component.secrets.replace(/\s+\r?\n|\r/, '').replace(/\W/g, '')}`);
log.info(`checkAppSecrets - component secret: ${component.secrets.replace(/\r?\n|\r/, '').replace(/\W/g, '').trim()}`);
if (component.secrets) {
const componentSecrets = component.secrets.replace(/\s+\r?\n|\r/, '').replace(/\W/g, '');
const componentSecrets = component.secrets.replace(/\r?\n|\r/, '').replace(/\W/g, '').trim();
if (componentSecrets.length !== appComponentSecrets.length) {
log.info('checkAppSecrets - lengths are different');
}
Expand All @@ -4932,8 +4932,8 @@ async function checkAppSecrets(appName, appComponentSpecs, appOwner, registratio
throw new Error(`Provided component ${appComponentSpecs.name} secrets are not valid`);
}
}
break;
}
break;
}
}
}
Expand Down

0 comments on commit 6f55aab

Please sign in to comment.