mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Merge pull request #2237 from akhilmhdh/fix/bot-creation-failing
fix: resolved auto bot create failing on update
This commit is contained in:
@@ -66,10 +66,10 @@ export const getBotKeyFnFactory = (
|
|||||||
await projectBotDAL.create({
|
await projectBotDAL.create({
|
||||||
name: "Infisical Bot (Ghost)",
|
name: "Infisical Bot (Ghost)",
|
||||||
projectId,
|
projectId,
|
||||||
|
isActive: true,
|
||||||
tag,
|
tag,
|
||||||
iv,
|
iv,
|
||||||
encryptedPrivateKey: ciphertext,
|
encryptedPrivateKey: ciphertext,
|
||||||
isActive: true,
|
|
||||||
publicKey: botKey.publicKey,
|
publicKey: botKey.publicKey,
|
||||||
algorithm,
|
algorithm,
|
||||||
keyEncoding: encoding,
|
keyEncoding: encoding,
|
||||||
@@ -80,6 +80,12 @@ export const getBotKeyFnFactory = (
|
|||||||
} else {
|
} else {
|
||||||
await projectBotDAL.updateById(bot.id, {
|
await projectBotDAL.updateById(bot.id, {
|
||||||
isActive: true,
|
isActive: true,
|
||||||
|
tag,
|
||||||
|
iv,
|
||||||
|
encryptedPrivateKey: ciphertext,
|
||||||
|
publicKey: botKey.publicKey,
|
||||||
|
algorithm,
|
||||||
|
keyEncoding: encoding,
|
||||||
encryptedProjectKey: encryptedWorkspaceKey.ciphertext,
|
encryptedProjectKey: encryptedWorkspaceKey.ciphertext,
|
||||||
encryptedProjectKeyNonce: encryptedWorkspaceKey.nonce,
|
encryptedProjectKeyNonce: encryptedWorkspaceKey.nonce,
|
||||||
senderId: projectV1Keys.userId
|
senderId: projectV1Keys.userId
|
||||||
@@ -89,7 +95,6 @@ export const getBotKeyFnFactory = (
|
|||||||
}
|
}
|
||||||
|
|
||||||
const botPrivateKey = getBotPrivateKey({ bot });
|
const botPrivateKey = getBotPrivateKey({ bot });
|
||||||
|
|
||||||
const botKey = decryptAsymmetric({
|
const botKey = decryptAsymmetric({
|
||||||
ciphertext: bot.encryptedProjectKey,
|
ciphertext: bot.encryptedProjectKey,
|
||||||
privateKey: botPrivateKey,
|
privateKey: botPrivateKey,
|
||||||
|
|||||||
Reference in New Issue
Block a user