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
@@ -16,7 +16,7 @@ export class UnauthorizedError extends Error {
error: unknown;
constructor({ name, error, message }: { message?: string; name: string; error: unknown }) {
constructor({ name, error, message }: { message?: string; name: string; error?: unknown }) {
super(message ?? "You are not allowed to access this resourve");
this.name = name;
this.error = error;
+10
View File
@@ -0,0 +1,10 @@
import { Knex } from "knex";
export const withTransaction = <K extends object>(db: Knex, dal: K) => ({
transaction: async <T>(cb: (tx: Knex) => T) =>
db.transaction(async (trx) => {
const res = await cb(trx);
return res;
}),
...dal
});
+2 -2
View File
@@ -1,7 +1,7 @@
import { z } from "zod";
import { z,ZodTypeAny } from "zod";
// this is a patched zod string to remove empty string to undefined
export const zpStr = <T extends z.ZodString>(
export const zpStr = <T extends ZodTypeAny>(
schema: T,
opt: { stripNull: boolean } = { stripNull: true }
) =>