feat(infisical-pg): auth injection completed and validation in password router

This commit is contained in:
Akhil Mohan
2024-01-27 12:38:22 +05:30
parent fcfd6b3fb2
commit f3b37de3f3
196 changed files with 1871 additions and 624 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
export type APIKeyDataV2 = {
_id: string;
id: string;
name: string;
user: string;
lastUsed?: string;
+1 -1
View File
@@ -1,5 +1,5 @@
export type TBot = {
_id: string;
id: string;
name: string;
workspace: string;
isActive: boolean;
@@ -1,5 +1,5 @@
export type IncidentContact = {
_id: string;
id: string;
email: string;
organization: string;
__v: number;
@@ -1,5 +1,5 @@
export type IntegrationAuth = {
_id: string;
id: string;
integration: string;
workspace: string;
__v: number;
+1 -1
View File
@@ -10,7 +10,7 @@ export type TCloudIntegration = {
};
export type TIntegration = {
_id: string;
id: string;
workspace: string;
environment: string;
isActive: boolean;
+2 -2
View File
@@ -1,5 +1,5 @@
export type UserWsKeyPair = {
_id: string;
id: string;
encryptedKey: string;
nonce: string;
sender: Sender;
@@ -11,7 +11,7 @@ export type UserWsKeyPair = {
};
export type Sender = {
_id: string;
id: string;
email: string;
createdAt: string;
updatedAt: string;
+5 -5
View File
@@ -1,5 +1,5 @@
export type Organization = {
_id: string;
id: string;
name: string;
createAt: string;
updatedAt: string;
@@ -25,7 +25,7 @@ export type PlanBillingInfo = {
}
export type Invoice = {
_id: string;
id: string;
created: number;
invoice_pdf: string;
number: string;
@@ -34,7 +34,7 @@ export type Invoice = {
}
export type PmtMethod = {
_id: string;
id: string;
brand: string;
exp_month: number;
exp_year: number;
@@ -43,14 +43,14 @@ export type PmtMethod = {
}
export type TaxID = {
_id: string;
id: string;
country: string;
type: string;
value: string;
}
export type License = {
_id: string;
id: string;
customerId: string;
prefix: string;
licenseKey: string;
+1 -1
View File
@@ -4,7 +4,7 @@ export type TGetRolesDTO = {
};
export type TRole<T extends string | undefined> = {
_id: string;
id: string;
organization: string;
workspace: T;
name: string;
@@ -1,5 +1,5 @@
export type TSecretApprovalPolicy = {
_id: string;
id: string;
workspace: string;
name: string;
environment: string;
@@ -78,7 +78,7 @@ export const decryptSecretApprovalSecret = (
key
});
return {
_id: encSecret._id,
id: encSecret.id,
version: encSecret.version,
secretKey,
secretValue,
@@ -16,7 +16,7 @@ export enum CommitType {
}
export type TSecretApprovalSecChangeData = {
_id: string;
id: string;
secretKeyCiphertext: string;
secretKeyIV: string;
secretKeyTag: string;
@@ -34,7 +34,7 @@ export type TSecretApprovalSecChangeData = {
};
export type TSecretApprovalSecChange = {
_id: string;
id: string;
version: number;
secretKey: string;
secretValue: string;
@@ -46,7 +46,7 @@ export type TSecretApprovalRequest<
T extends unknown = TSecretApprovalSecChangeData,
J extends unknown = EncryptedSecret
> = {
_id: string;
id: string;
slug: string;
createdAt: string;
committer: string;
@@ -142,7 +142,7 @@ export const useGetImportedSecrets = ({
});
return {
_id: encSecret._id,
id: encSecret.id,
env: encSecret.environment,
key: secretKey,
value: secretValue,
@@ -2,7 +2,7 @@ import { UserWsKeyPair } from "../keys/types";
import { EncryptedSecret } from "../secrets/types";
export type TSecretImports = {
_id: string;
id: string;
workspaceId: string;
environment: string;
folderId: string;
@@ -71,7 +71,7 @@ export type TProviderTemplate = {
};
export type TSecretRotation<T extends unknown = EncryptedSecret> = {
_id: string;
id: string;
interval: number;
provider: string;
customProvider: string;
@@ -102,7 +102,7 @@ export const useGetSnapshotSecrets = ({ decryptFileKey, env, snapshotId }: TSnap
const secretComment = "";
const decryptedSecret = {
_id: encSecret.secret,
id: encSecret.secret,
env: encSecret.environment,
key: secretKey,
value: secretValue,
@@ -2,7 +2,7 @@ import { UserWsKeyPair } from "../keys/types";
import { EncryptedSecretVersion } from "../secrets/types";
export type TSecretSnapshot = {
_id: string;
id: string;
workspace: string;
version: number;
secretVersions: string[];
+3 -3
View File
@@ -63,7 +63,7 @@ export const decryptSecrets = (
});
const decryptedSecret: DecryptedSecret = {
_id: encSecret._id,
id: encSecret.id,
env: encSecret.environment,
key: secretKey,
value: secretValue,
@@ -79,7 +79,7 @@ export const decryptSecrets = (
if (encSecret.type === "personal") {
personalSecrets[decryptedSecret.key] = {
id: encSecret._id,
id: encSecret.id,
value: secretValue
};
} else {
@@ -225,7 +225,7 @@ export const useGetSecretVersion = (dto: GetSecretVersionsDTO) =>
return data
.map((el) => ({
createdAt: el.createdAt,
id: el._id,
id: el.id,
value: decryptSymmetric({
ciphertext: el.secretValueCiphertext,
iv: el.secretValueIV,
+3 -3
View File
@@ -2,7 +2,7 @@ import type { UserWsKeyPair } from "../keys/types";
import type { WsTag } from "../tags/types";
export type EncryptedSecret = {
_id: string;
id: string;
version: number;
workspace: string;
type: "shared" | "personal";
@@ -26,7 +26,7 @@ export type EncryptedSecret = {
};
export type DecryptedSecret = {
_id: string;
id: string;
version: number;
key: string;
value: string;
@@ -45,7 +45,7 @@ export type DecryptedSecret = {
};
export type EncryptedSecretVersion = {
_id: string;
id: string;
secret: string;
version: number;
workspace: string;
@@ -1,5 +1,5 @@
export type SubscriptionPlan = {
_id: string;
id: string;
membersUsed: number;
memberLimit: number;
auditLogs: boolean;
+5 -5
View File
@@ -1,7 +1,7 @@
export type UserWsTags = WsTag[];
export type WsTag = {
_id: string;
id: string;
name: string;
slug: string;
tagColor?: string;
@@ -11,7 +11,7 @@ export type WsTag = {
__v: number;
}
export type WorkspaceTag = { _id: string; name: string; slug: string };
export type WorkspaceTag = { id: string; name: string; slug: string };
export type CreateTagDTO = {
workspaceID: string;
@@ -27,7 +27,7 @@ export type CreateTagRes = {
createdAt: string;
tagColor?: string;
user: string;
_id: string;
id: string;
};
export type DeleteTagDTO = { tagID: string; };
@@ -38,12 +38,12 @@ export type DeleteWsTagRes = {
workspace: string;
createdAt: string;
user: string;
_id: string;
id: string;
};
export type SecretTags = {
id: string;
_id: string;
id: string;
slug: string;
tagColor: string;
}
+1 -1
View File
@@ -1,5 +1,5 @@
export type TrustedIp = {
_id: string;
id: string;
workspace: string;
ipAddress: string;
type: "ipv4" | "ipv6";
+1 -1
View File
@@ -1,5 +1,5 @@
export type TWebhook = {
_id: string;
id: string;
workspace: string;
environment: string;
secretPath: string;
+3 -3
View File
@@ -1,6 +1,6 @@
export type Workspace = {
__v: number;
_id: string;
id: string;
name: string;
organization: string;
autoCapitalization: boolean;
@@ -14,13 +14,13 @@ export type WorkspaceEnv = {
isWriteDenied: boolean;
};
export type WorkspaceTag = { _id: string; name: string; slug: string };
export type WorkspaceTag = { id: string; name: string; slug: string };
export type NameWorkspaceSecretsDTO = {
workspaceId: string;
secretsToUpdate: {
secretName: string;
_id: string;
id: string;
}[];
}