Deprecate legacy encryption (#21831)
# Introduction Still preserving the cross-upgrade flow close https://github.com/twentyhq/core-team-issues/issues/2465 <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/twentyhq/twenty/pull/21831?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
This commit is contained in:
+1
-1
@@ -255,7 +255,7 @@ export class ApplicationRegistrationVariableService {
|
||||
encryptedValue !== ''
|
||||
? variable.isSecret
|
||||
? '•••••••••••••'
|
||||
: this.encryptionService.decryptVersioned(encryptedValue)
|
||||
: this.encryptionService.decryptVersionedOrThrow(encryptedValue)
|
||||
: null,
|
||||
};
|
||||
}
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ describe('ApplicationVariableEntityService', () => {
|
||||
(value: string, opts?: { workspaceId?: string }) =>
|
||||
`enc:v2:deadbeef:${value}|${opts?.workspaceId ?? 'instance'}`,
|
||||
),
|
||||
decryptVersioned: jest.fn(
|
||||
decryptVersionedOrThrow: jest.fn(
|
||||
(value: string, _opts?: { workspaceId?: string }) =>
|
||||
value.replace(/^enc:v2:[0-9a-f]+:/, '').replace(/\|.*$/, ''),
|
||||
),
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ export class ApplicationVariableEntityService {
|
||||
});
|
||||
}
|
||||
|
||||
return this.secretEncryptionService.decryptVersioned(
|
||||
return this.secretEncryptionService.decryptVersionedOrThrow(
|
||||
applicationVariable.value,
|
||||
{ workspaceId: applicationVariable.workspaceId },
|
||||
);
|
||||
|
||||
+3
-1
@@ -53,7 +53,9 @@ export class ConnectionProviderService {
|
||||
variables.map((v) => [
|
||||
v.key,
|
||||
v.encryptedValue !== ''
|
||||
? this.secretEncryptionService.decryptVersioned(v.encryptedValue)
|
||||
? this.secretEncryptionService.decryptVersionedOrThrow(
|
||||
v.encryptedValue,
|
||||
)
|
||||
: '',
|
||||
]),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user