feat(infisical-pg): completed integration, integration auth and project bot api migration

This commit is contained in:
Akhil Mohan
2024-01-27 12:38:23 +05:30
parent 010963a80c
commit 771bec6d6d
36 changed files with 5245 additions and 9 deletions
+30 -1
View File
@@ -3,6 +3,8 @@ import { z } from "zod";
import { zpStr } from "../zod";
export const GITLAB_URL = "https://gitlab.com";
const zodStrBool = z
.enum(["true", "false"])
.optional()
@@ -46,7 +48,34 @@ const envSchema = z
CLIENT_SECRET_GITHUB_LOGIN: zpStr(z.string().optional()),
CLIENT_ID_GITLAB_LOGIN: zpStr(z.string().optional()),
CLIENT_SECRET_GITLAB_LOGIN: zpStr(z.string().optional()),
CLIENT_GITLAB_LOGIN_URL: zpStr(z.string().optional())
CLIENT_GITLAB_LOGIN_URL: zpStr(z.string().optional().default(GITLAB_URL)),
// integration client secrets
// heroku
CLIENT_ID_HEROKU: zpStr(z.string().optional()),
CLIENT_SECRET_HEROKU: zpStr(z.string().optional()),
// vercel
CLIENT_ID_VERCEL: zpStr(z.string().optional()),
CLIENT_SECRET_VERCEL: zpStr(z.string().optional()),
CLIENT_SLUG_VERCEL: zpStr(z.string().optional()),
// netlify
CLIENT_ID_NETLIFY: zpStr(z.string().optional()),
CLIENT_SECRET_NETLIFY: zpStr(z.string().optional()),
// bit bucket
CLIENT_ID_BITBUCKET: zpStr(z.string().optional()),
CLIENT_SECRET_BITBUCKET: zpStr(z.string().optional()),
// gcp secret manager
CLIENT_ID_GCP_SECRET_MANAGER: zpStr(z.string().optional()),
CLIENT_SECRET_GCP_SECRET_MANAGER: zpStr(z.string().optional()),
// github
CLIENT_ID_GITHUB: zpStr(z.string().optional()),
CLIENT_SECRET_GITHUB: zpStr(z.string().optional()),
// azure
CLIENT_ID_AZURE: zpStr(z.string().optional()),
CLIENT_SECRET_AZURE: zpStr(z.string().optional()),
// google
CLIENT_ID_GITLAB: zpStr(z.string().optional()),
CLIENT_SECRET_GITLAB: zpStr(z.string().optional()),
URL_GITLAB_URL: zpStr(z.string().optional().default(GITLAB_URL))
})
.transform((data) => ({ ...data, isSmtpConfigured: Boolean(data.SMTP_HOST) }));
+9
View File
@@ -120,6 +120,15 @@ export const decryptAsymmetric = ({
return naclUtils.encodeUTF8(plaintext);
};
export const generateAsymmetricKeyPair = () => {
const pair = nacl.box.keyPair();
return {
publicKey: naclUtils.encodeBase64(pair.publicKey),
privateKey: naclUtils.encodeBase64(pair.secretKey)
};
};
export type TGenSecretBlindIndex = {
secretName: string;
keyEncoding: SecretKeyEncoding;
+2 -1
View File
@@ -6,6 +6,7 @@ export {
decryptSymmetric128BitHexKeyUTF8,
encryptAsymmetric,
encryptSymmetric,
encryptSymmetric128BitHexKeyUTF8
encryptSymmetric128BitHexKeyUTF8,
generateAsymmetricKeyPair
} from "./encryption";
export { generateSrpServerKey, srpCheckClientProof } from "./srp";
+2 -3
View File
@@ -1,5 +1,4 @@
import { Knex } from "knex";
import { Tables } from "knex/types/tables";
export const selectAllTableCols = <Tname extends keyof Tables>(db: Knex, tableName: Tname) =>
db.ref("*").withSchema(tableName) as unknown as keyof Tables[Tname];
export const selectAllTableCols = <Tname extends keyof Tables>(tableName: Tname) =>
`${tableName}.*` as keyof Tables[Tname]["base"];