mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-18 17:41:16 +00:00
Refactor infisical-node to config file for birds eye view of envars
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import * as Sentry from '@sentry/node';
|
||||
import infisical from 'infisical-node';
|
||||
import {
|
||||
Bot,
|
||||
BotKey,
|
||||
@@ -14,6 +13,7 @@ import {
|
||||
decryptAsymmetric
|
||||
} from '../utils/crypto';
|
||||
import { SECRET_SHARED } from '../variables';
|
||||
import { getEncryptionKey } from '../config';
|
||||
|
||||
/**
|
||||
* Create an inactive bot with name [name] for workspace with id [workspaceId]
|
||||
@@ -33,7 +33,7 @@ const createBot = async ({
|
||||
const { publicKey, privateKey } = generateKeyPair();
|
||||
const { ciphertext, iv, tag } = encryptSymmetric({
|
||||
plaintext: privateKey,
|
||||
key: infisical.get('ENCRYPTION_KEY')!
|
||||
key: getEncryptionKey()
|
||||
});
|
||||
|
||||
bot = await new Bot({
|
||||
@@ -130,7 +130,7 @@ const getKey = async ({ workspaceId }: { workspaceId: string }) => {
|
||||
ciphertext: bot.encryptedPrivateKey,
|
||||
iv: bot.iv,
|
||||
tag: bot.tag,
|
||||
key: infisical.get('ENCRYPTION_KEY')!
|
||||
key: getEncryptionKey()
|
||||
});
|
||||
|
||||
key = decryptAsymmetric({
|
||||
|
||||
Reference in New Issue
Block a user