Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Cabecinha84 committed Jan 14, 2025
1 parent c0bf904 commit 2330026
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ZelBack/src/services/appsService.js
Original file line number Diff line number Diff line change
Expand Up @@ -4883,13 +4883,13 @@ async function checkAppSecrets(appName, appComponentSpecs, appOwner, registratio
const results = await dbHelper.findInDatabase(database, globalAppsInformation, query, projection);
let foundSecretsWithSameAppName = false;
let foundSecretsWithDifferentAppName = false;
const appComponentSecrets = JSON.stringify(appComponentSpecs.secrets.replace(/\r?\n|\r/, '').replace(/\W/g, ''));
const appComponentSecrets = appComponentSpecs.secrets.replace(/\r?\n|\r/, '').replace(/\W/g, '');
// 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.length > 0 && JSON.stringify(component.secrets.replace(/\r?\n|\r/, '').replace(/\W/g, '')) === appComponentSecrets) {
if (component.secrets.length > 0 && component.secrets.replace(/\r?\n|\r/, '').replace(/\W/g, '') === appComponentSecrets) {
if (registration) {
throw new Error(`Provided component ${appComponentSpecs.name} secrets are not valid`);
} else if (app.name !== appName) {
Expand All @@ -4913,7 +4913,7 @@ async function checkAppSecrets(appName, appComponentSpecs, appOwner, registratio
// eslint-disable-next-line no-restricted-syntax
for (const component of message.appSpecifications.compose) {
if (component.secrets.length > 0
&& JSON.stringify(component.secrets.replace(/\r?\n|\r/, '').replace(/\W/g, '')) === appComponentSecrets) {
&& component.secrets.replace(/\r?\n|\r/, '').replace(/\W/g, '') === appComponentSecrets) {
log.info('checkAppSecrets - found same secret');
log.info(`checkAppSecrets - appOwner: ${appOwner}`);
log.info(`checkAppSecrets - appOwner: ${message.appSpecifications.owner}`);
Expand Down

0 comments on commit 2330026

Please sign in to comment.