mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-23 22:20:23 +09:00
Enhance encryption security with additional safeguards.
This commit is contained in:
parent
7830b37a90
commit
4b2f447474
@ -32,14 +32,10 @@ async function getBedrockCredentials(
|
|||||||
const [encryptedRegion, encryptedAccessKey, encryptedSecretKey] =
|
const [encryptedRegion, encryptedAccessKey, encryptedSecretKey] =
|
||||||
credentials.split(":");
|
credentials.split(":");
|
||||||
|
|
||||||
// console.log("===========encryptedRegion",encryptedRegion);
|
|
||||||
// console.log("===========encryptedAccessKey",encryptedAccessKey);
|
|
||||||
// console.log("===========encryptedSecretKey",encryptedSecretKey);
|
|
||||||
if (!encryptedRegion || !encryptedAccessKey || !encryptedSecretKey) {
|
if (!encryptedRegion || !encryptedAccessKey || !encryptedSecretKey) {
|
||||||
throw new Error("Invalid Authorization header format");
|
throw new Error("Invalid Authorization header format");
|
||||||
}
|
}
|
||||||
const encryptionKey = req.headers.get("XEncryptionKey") || "";
|
const encryptionKey = req.headers.get("XEncryptionKey") || "";
|
||||||
// console.log("===========encryptionKey",encryptionKey);
|
|
||||||
// Decrypt the credentials
|
// Decrypt the credentials
|
||||||
[awsRegion, awsAccessKey, awsSecretKey] = await Promise.all([
|
[awsRegion, awsAccessKey, awsSecretKey] = await Promise.all([
|
||||||
decrypt(encryptedRegion, encryptionKey),
|
decrypt(encryptedRegion, encryptionKey),
|
||||||
|
Loading…
Reference in New Issue
Block a user