Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
RunOnFluxBot committed Jan 14, 2025
1 parent ecc5749 commit a6f7678
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions services/appsService.js
Original file line number Diff line number Diff line change
Expand Up @@ -4890,7 +4890,7 @@ async function checkAppSecrets(appName, appComponentSpecs, appOwner, registratio
for (const component of app.compose) {
if (component.secrets.length > 0 && JSON.stringify(component.secrets.replace(/(\r\n|\n|\r)/gm, '').replace(/\\/g, '')) === JSON.stringify(appComponentSpecs.secrets.replace(/(\r\n|\n|\r)/gm, '').replace(/\\/g, ''))) {
if (registration) {
throw new Error(`Provided component ${component.name} secrets are not valid`);
throw new Error(`Provided component ${appComponentSpecs.name} secrets are not valid`);
} else if (app.name !== appName) {
foundSecretsWithDifferentAppName = true;
} else if (app.name === appName) {
Expand All @@ -4912,9 +4912,13 @@ 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|\n|\r)/gm, '').replace(/\\/g, '')) === JSON.stringify(appComponentSpecs.secrets.replace(/(\r\n|\n|\r)/gm, '').replace(/\\/g, ''))
&& message.appSpecifications.owner !== appOwner) {
throw new Error(`Provided component ${component.name} secrets are not valid`);
&& JSON.stringify(component.secrets.replace(/(\r\n|\n|\r)/gm, '').replace(/\\/g, '')) === JSON.stringify(appComponentSpecs.secrets.replace(/(\r\n|\n|\r)/gm, '').replace(/\\/g, ''))) {
log.info('checkAppSecrets - found same secret');
log.info(`checkAppSecrets - appOwner: ${appOwner}`);
log.info(`checkAppSecrets - appOwner: ${message.appSpecifications.owner}`);
if (message.appSpecifications.owner !== appOwner) {
throw new Error(`Provided component ${appComponentSpecs.name} secrets are not valid`);
}
}
}
}
Expand Down

0 comments on commit a6f7678

Please sign in to comment.