Remove detailed error logging in decryption function.
This commit is contained in:
parent
448babd27f
commit
b39b3f7a5e
|
@ -42,19 +42,16 @@ export function encrypt(data: string, encryptionKey: string): string {
|
||||||
export function decrypt(encryptedData: string, encryptionKey: string): string {
|
export function decrypt(encryptedData: string, encryptionKey: string): string {
|
||||||
if (!encryptedData) return "";
|
if (!encryptedData) return "";
|
||||||
if (!encryptionKey) {
|
if (!encryptionKey) {
|
||||||
console.error("[AWS Decryption Error] Encryption key is required");
|
|
||||||
throw new Error("Encryption key is required for AWS credential decryption");
|
throw new Error("Encryption key is required for AWS credential decryption");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const bytes = AES.decrypt(encryptedData, encryptionKey);
|
const bytes = AES.decrypt(encryptedData, encryptionKey);
|
||||||
const decrypted = bytes.toString(enc.Utf8);
|
const decrypted = bytes.toString(enc.Utf8);
|
||||||
if (!decrypted && encryptedData) {
|
if (!decrypted && encryptedData) {
|
||||||
console.error("[AWS Decryption Error] Failed to decrypt data");
|
|
||||||
throw new Error("Failed to decrypt AWS credentials");
|
throw new Error("Failed to decrypt AWS credentials");
|
||||||
}
|
}
|
||||||
return decrypted;
|
return decrypted;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("[AWS Decryption Error]:", error);
|
|
||||||
throw new Error("Failed to decrypt AWS credentials");
|
throw new Error("Failed to decrypt AWS credentials");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue