Browse Source

refactor: mark as encrypted if old secret and new env secret is same

pull/9499/head
Pranav C 2 months ago
parent
commit
5f292ca2f7
  1. 9
      packages/nocodb/src/version-upgrader/upgraders/0225002_ncDatasourceDecrypt.ts

9
packages/nocodb/src/version-upgrader/upgraders/0225002_ncDatasourceDecrypt.ts

@ -39,11 +39,18 @@ export default async function ({ ncMeta }: NcUpgraderCtx) {
)?.value;
}
// if encryption key is same as previous, return
// if encryption key is same as previous, just update is_encrypted flag and return
if (
process.env.NC_KEY_CREDENTIAL_ENCRYPT &&
process.env.NC_KEY_CREDENTIAL_ENCRYPT === encryptionKey
) {
logger.log('Encryption key is same as previous. Skipping decryption');
await ncMeta.knexConnection(MetaTable.SOURCES).update({
is_encrypted: true,
});
await ncMeta.knexConnection(MetaTable.INTEGRATIONS).update({
is_encrypted: true,
});
return;
}

Loading…
Cancel
Save