mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 22:27:48 +00:00
Clean PR
This commit is contained in:
@@ -100,7 +100,7 @@ export const registerSecretSharingRouter = async (server: FastifyZodProvider) =>
|
|||||||
},
|
},
|
||||||
schema: {
|
schema: {
|
||||||
body: z.object({
|
body: z.object({
|
||||||
secretValue: z.string(),
|
secretValue: z.string().max(10_000),
|
||||||
password: z.string().optional(),
|
password: z.string().optional(),
|
||||||
expiresAt: z.string(),
|
expiresAt: z.string(),
|
||||||
expiresAfterViews: z.number().min(1).optional()
|
expiresAfterViews: z.number().min(1).optional()
|
||||||
|
|||||||
@@ -114,11 +114,6 @@ export const secretSharingServiceFactory = ({
|
|||||||
throw new BadRequestError({ message: "Expiration date cannot exceed more than 30 days" });
|
throw new BadRequestError({ message: "Expiration date cannot exceed more than 30 days" });
|
||||||
}
|
}
|
||||||
|
|
||||||
// Limit Input ciphertext length to 13000 (equivalent to 10,000 characters of Plaintext)n
|
|
||||||
if (secretValue.length > 10_000) {
|
|
||||||
throw new BadRequestError({ message: "Shared secret value too long" });
|
|
||||||
}
|
|
||||||
|
|
||||||
const encryptWithRoot = kmsService.encryptWithRootKey();
|
const encryptWithRoot = kmsService.encryptWithRootKey();
|
||||||
const encryptedSecret = encryptWithRoot(Buffer.from(secretValue));
|
const encryptedSecret = encryptWithRoot(Buffer.from(secretValue));
|
||||||
|
|
||||||
|
|||||||
@@ -53,9 +53,6 @@ export const ViewSecretPublicPage = () => {
|
|||||||
((error as AxiosError)?.response?.data as { message: string })?.message ===
|
((error as AxiosError)?.response?.data as { message: string })?.message ===
|
||||||
"Invalid credentials";
|
"Invalid credentials";
|
||||||
|
|
||||||
console.log("data", fetchSecret);
|
|
||||||
console.log("err", error);
|
|
||||||
|
|
||||||
const shouldShowPasswordPrompt =
|
const shouldShowPasswordPrompt =
|
||||||
isInvalidCredential || (fetchSecret?.isPasswordProtected && !fetchSecret.secret);
|
isInvalidCredential || (fetchSecret?.isPasswordProtected && !fetchSecret.secret);
|
||||||
const isValidatingPassword = Boolean(password) && isFetching;
|
const isValidatingPassword = Boolean(password) && isFetching;
|
||||||
|
|||||||
Reference in New Issue
Block a user