mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 18:27:19 +00:00
Moved
This commit is contained in:
@@ -11,4 +11,10 @@ export {
|
|||||||
encryptSymmetric128BitHexKeyUTF8,
|
encryptSymmetric128BitHexKeyUTF8,
|
||||||
generateAsymmetricKeyPair
|
generateAsymmetricKeyPair
|
||||||
} from "./encryption";
|
} from "./encryption";
|
||||||
|
export {
|
||||||
|
decryptIntegrationAuths,
|
||||||
|
decryptSecretApprovals,
|
||||||
|
decryptSecrets,
|
||||||
|
decryptSecretVersions
|
||||||
|
} from "./secret-encryption";
|
||||||
export { generateSrpServerKey, srpCheckClientProof } from "./srp";
|
export { generateSrpServerKey, srpCheckClientProof } from "./srp";
|
||||||
|
|||||||
@@ -11,9 +11,8 @@ import {
|
|||||||
TSecretApprovalRequestsSecrets,
|
TSecretApprovalRequestsSecrets,
|
||||||
TSecrets,
|
TSecrets,
|
||||||
TSecretVersions
|
TSecretVersions
|
||||||
} from "@app/db/schemas";
|
} from "../../db/schemas";
|
||||||
|
import { decryptAsymmetric } from "./encryption";
|
||||||
import { decryptAsymmetric } from "../crypto";
|
|
||||||
|
|
||||||
const DecryptedValuesSchema = z.object({
|
const DecryptedValuesSchema = z.object({
|
||||||
id: z.string(),
|
id: z.string(),
|
||||||
@@ -42,15 +41,15 @@ const DecryptedSecretVersionsSchema = z.object({
|
|||||||
original: SecretVersionsSchema
|
original: SecretVersionsSchema
|
||||||
});
|
});
|
||||||
|
|
||||||
export const DecryptedSecretApprovalsSchema = z.object({
|
const DecryptedSecretApprovalsSchema = z.object({
|
||||||
decrypted: DecryptedValuesSchema,
|
decrypted: DecryptedValuesSchema,
|
||||||
original: SecretApprovalRequestsSecretsSchema
|
original: SecretApprovalRequestsSecretsSchema
|
||||||
});
|
});
|
||||||
|
|
||||||
export type DecryptedSecret = z.infer<typeof DecryptedSecretSchema>;
|
type DecryptedSecret = z.infer<typeof DecryptedSecretSchema>;
|
||||||
export type DecryptedSecretVersions = z.infer<typeof DecryptedSecretVersionsSchema>;
|
type DecryptedSecretVersions = z.infer<typeof DecryptedSecretVersionsSchema>;
|
||||||
export type DecryptedSecretApprovals = z.infer<typeof DecryptedSecretApprovalsSchema>;
|
type DecryptedSecretApprovals = z.infer<typeof DecryptedSecretApprovalsSchema>;
|
||||||
export type DecryptedIntegrationAuths = z.infer<typeof DecryptedIntegrationAuthsSchema>;
|
type DecryptedIntegrationAuths = z.infer<typeof DecryptedIntegrationAuthsSchema>;
|
||||||
|
|
||||||
type TLatestKey = TProjectKeys & {
|
type TLatestKey = TProjectKeys & {
|
||||||
sender: {
|
sender: {
|
||||||
@@ -79,7 +78,7 @@ const decryptCipher = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getDecryptedValues = (data: Array<{ ciphertext: string; iv: string; tag: string }>, key: string | Buffer) => {
|
const getDecryptedValues = (data: Array<{ ciphertext: string; iv: string; tag: string }>, key: string | Buffer) => {
|
||||||
const results = [];
|
const results: string[] = [];
|
||||||
|
|
||||||
for (const { ciphertext, iv, tag } of data) {
|
for (const { ciphertext, iv, tag } of data) {
|
||||||
if (!ciphertext || !iv || !tag) {
|
if (!ciphertext || !iv || !tag) {
|
||||||
@@ -16,6 +16,12 @@ import {
|
|||||||
import { TSecretApprovalRequestDALFactory } from "@app/ee/services/secret-approval-request/secret-approval-request-dal";
|
import { TSecretApprovalRequestDALFactory } from "@app/ee/services/secret-approval-request/secret-approval-request-dal";
|
||||||
import { TSecretApprovalRequestSecretDALFactory } from "@app/ee/services/secret-approval-request/secret-approval-request-secret-dal";
|
import { TSecretApprovalRequestSecretDALFactory } from "@app/ee/services/secret-approval-request/secret-approval-request-secret-dal";
|
||||||
import { RequestState } from "@app/ee/services/secret-approval-request/secret-approval-request-types";
|
import { RequestState } from "@app/ee/services/secret-approval-request/secret-approval-request-types";
|
||||||
|
import {
|
||||||
|
decryptIntegrationAuths,
|
||||||
|
decryptSecretApprovals,
|
||||||
|
decryptSecrets,
|
||||||
|
decryptSecretVersions
|
||||||
|
} from "@app/lib/crypto";
|
||||||
import {
|
import {
|
||||||
decryptAsymmetric,
|
decryptAsymmetric,
|
||||||
encryptSymmetric128BitHexKeyUTF8,
|
encryptSymmetric128BitHexKeyUTF8,
|
||||||
@@ -23,12 +29,6 @@ import {
|
|||||||
infisicalSymmetricEncypt
|
infisicalSymmetricEncypt
|
||||||
} from "@app/lib/crypto/encryption";
|
} from "@app/lib/crypto/encryption";
|
||||||
import { logger } from "@app/lib/logger";
|
import { logger } from "@app/lib/logger";
|
||||||
import {
|
|
||||||
decryptIntegrationAuths,
|
|
||||||
decryptSecretApprovals,
|
|
||||||
decryptSecrets,
|
|
||||||
decryptSecretVersions
|
|
||||||
} from "@app/lib/secret";
|
|
||||||
import { QueueJobs, QueueName, TQueueJobTypes, TQueueServiceFactory } from "@app/queue";
|
import { QueueJobs, QueueName, TQueueJobTypes, TQueueServiceFactory } from "@app/queue";
|
||||||
|
|
||||||
import { TIntegrationAuthDALFactory } from "../integration-auth/integration-auth-dal";
|
import { TIntegrationAuthDALFactory } from "../integration-auth/integration-auth-dal";
|
||||||
|
|||||||
Reference in New Issue
Block a user