Compare commits

...

7 Commits

Author SHA1 Message Date
Maidul Islam
1980f802fa update rate limits 2024-01-27 19:05:17 -05:00
Maidul Islam
6ecd289e6c update rate limits 2024-01-27 18:38:57 -05:00
Maidul Islam
b8a6f5dc54 add email templates and disposable_emails.text to build 2024-01-27 18:15:12 -05:00
Maidul Islam
dedbc4fd60 remove unused imports 2024-01-27 17:11:40 -05:00
Maidul Islam
d14099990f remove notice 2024-01-27 17:04:53 -05:00
Maidul Islam
3f5ab2a09e remove console.log 2024-01-27 17:04:02 -05:00
Maidul Islam
a191f437e9 patch blind index route 2024-01-27 17:03:16 -05:00
5 changed files with 5 additions and 45 deletions

View File

@@ -7,7 +7,7 @@
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "tsx watch --clear-screen=false ./src/main.ts | pino-pretty --colorize --colorizeObjects --singleLine",
"dev:docker": "nodemon",
"build": "rimraf dist && tsup",
"build": "rimraf dist && tsup && cp -R ./src/lib/validator/disposable_emails.txt ./dist && cp -R ./src/services/smtp/templates ./dist",
"start": "node dist/main.mjs",
"type:check": "tsc --noEmit",
"lint:fix": "eslint --fix --ext js,ts ./src",

View File

@@ -11,7 +11,7 @@ export const globalRateLimiterCfg = (): RateLimitPluginOptions => {
return {
timeWindow: 60 * 1000,
max: 400,
max: 600,
redis,
allowList: (req) => req.url === "/healthcheck" || req.url === "/api/status",
keyGenerator: (req) => req.realIp
@@ -20,12 +20,12 @@ export const globalRateLimiterCfg = (): RateLimitPluginOptions => {
export const authRateLimit: RateLimitOptions = {
timeWindow: 60 * 1000,
max: 300,
max: 600,
keyGenerator: (req) => req.realIp
};
export const passwordRateLimit: RateLimitOptions = {
timeWindow: 60 * 1000,
max: 300,
max: 600,
keyGenerator: (req) => req.realIp
};

View File

@@ -59,7 +59,7 @@ export const registerSecretBlindIndexRouter = async (server: FastifyZodProvider)
});
server.route({
url: "/:projectId/secrets/name",
url: "/:projectId/secrets/names",
method: "POST",
schema: {
params: z.object({

View File

@@ -239,7 +239,6 @@ export const secretServiceFactory = ({
userId,
blindIndexCfg
}: TFnSecretBlindIndexCheck) => {
console.log(`inputSecrets=[${JSON.stringify(inputSecrets, null, 4)}] folderId=[${folderId}] isNew=[${isNew}] userId=[${userId}] blindIndexCfg=[${JSON.stringify(blindIndexCfg, null, 4)}] `)
const blindIndex2KeyName: Record<string, string> = {}; // used at audit log point
const keyName2BlindIndex = await Promise.all(
inputSecrets.map(({ secretName }) =>
@@ -254,8 +253,6 @@ export const secretServiceFactory = ({
}, {})
);
console.log("keyName2BlindIndex:", JSON.stringify(keyName2BlindIndex, null, 4))
if (inputSecrets.some(({ type }) => type === SecretType.Personal) && !userId) {
throw new BadRequestError({ message: "Missing user id for personal secret" });
}
@@ -269,9 +266,6 @@ export const secretServiceFactory = ({
userId
);
console.log("fnSecretBlindIndexCheck:", JSON.stringify(secrets, null, 4))
if (isNew) {
if (secrets.length) throw new BadRequestError({ message: "Secret already exist" });
} else if (secrets.length !== inputSecrets.length)

View File

@@ -24,8 +24,6 @@ import {
faPlug,
faPlus,
faUserPlus,
faWarning,
faXmark
} from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { yupResolver } from "@hookform/resolvers/yup";
@@ -58,7 +56,6 @@ import {
fetchOrgUsers,
useAddUserToWs,
useCreateWorkspace,
useGetUserAction,
useRegisterUserAction,
useUploadWsKey
} from "@app/hooks/api";
@@ -480,13 +477,6 @@ const OrganizationPage = withPermission(
const { createNotification } = useNotificationContext();
const addWsUser = useAddUserToWs();
const { data: updateClosed } = useGetUserAction("jan_2024_db_update_closed");
const registerUserAction = useRegisterUserAction();
const closeUpdate = async () => {
await registerUserAction.mutateAsync("jan_2024_db_update_closed");
};
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
"addNewWs",
"upgradePlan"
@@ -615,30 +605,6 @@ const OrganizationPage = withPermission(
</div>
)}
<div className="mb-4 flex flex-col items-start justify-start px-6 py-6 pb-0 text-3xl">
<div
className={`${
!updateClosed ? "block" : "hidden"
} mb-4 flex w-full flex-row items-center rounded-md border border-primary-600 bg-primary/10 p-2 text-base text-white`}
>
<FontAwesomeIcon icon={faWarning} className="p-6 text-4xl text-primary" />
<div className="text-sm">
<span className="text-lg font-semibold">Scheduled maintenance on January 27th</span>{" "}
<br />
We&apos;ve planned a database upgrade and need to pause certain functionality for
approximately 3 hours on Saturday, January 27th, 10am EST. During these hours, read
operations will continue to function normally but no resources will be editable. No
action is required on your end your applications can continue to fetch secrets.
<br />
</div>
<button
type="button"
onClick={() => closeUpdate()}
aria-label="close"
className="flex h-full items-start text-mineshaft-100 duration-200 hover:text-red-400"
>
<FontAwesomeIcon icon={faXmark} />
</button>
</div>
<p className="mr-4 font-semibold text-white">Projects</p>
<div className="mt-6 flex w-full flex-row">
<Input