mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 15:27:27 +00:00
misc: removed creation limits completely
This commit is contained in:
@@ -0,0 +1,21 @@
|
|||||||
|
import { Knex } from "knex";
|
||||||
|
|
||||||
|
import { TableName } from "../schemas";
|
||||||
|
|
||||||
|
export async function up(knex: Knex): Promise<void> {
|
||||||
|
const hasCreationLimitCol = await knex.schema.hasColumn(TableName.RateLimit, "creationLimit");
|
||||||
|
await knex.schema.alterTable(TableName.RateLimit, (t) => {
|
||||||
|
if (hasCreationLimitCol) {
|
||||||
|
t.dropColumn("creationLimit");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function down(knex: Knex): Promise<void> {
|
||||||
|
const hasCreationLimitCol = await knex.schema.hasColumn(TableName.RateLimit, "creationLimit");
|
||||||
|
await knex.schema.alterTable(TableName.RateLimit, (t) => {
|
||||||
|
if (!hasCreationLimitCol) {
|
||||||
|
t.integer("creationLimit").defaultTo(30).notNullable();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -15,7 +15,6 @@ export const RateLimitSchema = z.object({
|
|||||||
authRateLimit: z.number().default(60),
|
authRateLimit: z.number().default(60),
|
||||||
inviteUserRateLimit: z.number().default(30),
|
inviteUserRateLimit: z.number().default(30),
|
||||||
mfaRateLimit: z.number().default(20),
|
mfaRateLimit: z.number().default(20),
|
||||||
creationLimit: z.number().default(30),
|
|
||||||
publicEndpointLimit: z.number().default(30),
|
publicEndpointLimit: z.number().default(30),
|
||||||
createdAt: z.date(),
|
createdAt: z.date(),
|
||||||
updatedAt: z.date()
|
updatedAt: z.date()
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ export const registerRateLimitRouter = async (server: FastifyZodProvider) => {
|
|||||||
authRateLimit: z.number(),
|
authRateLimit: z.number(),
|
||||||
inviteUserRateLimit: z.number(),
|
inviteUserRateLimit: z.number(),
|
||||||
mfaRateLimit: z.number(),
|
mfaRateLimit: z.number(),
|
||||||
creationLimit: z.number(),
|
|
||||||
publicEndpointLimit: z.number()
|
publicEndpointLimit: z.number()
|
||||||
}),
|
}),
|
||||||
response: {
|
response: {
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ export type TRateLimitUpdateDTO = {
|
|||||||
authRateLimit: number;
|
authRateLimit: number;
|
||||||
inviteUserRateLimit: number;
|
inviteUserRateLimit: number;
|
||||||
mfaRateLimit: number;
|
mfaRateLimit: number;
|
||||||
creationLimit: number;
|
|
||||||
publicEndpointLimit: number;
|
publicEndpointLimit: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,5 @@ export type TRateLimit = {
|
|||||||
authRateLimit: number;
|
authRateLimit: number;
|
||||||
inviteUserRateLimit: number;
|
inviteUserRateLimit: number;
|
||||||
mfaRateLimit: number;
|
mfaRateLimit: number;
|
||||||
creationLimit: number;
|
|
||||||
publicEndpointLimit: number;
|
publicEndpointLimit: number;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ const formSchema = z.object({
|
|||||||
authRateLimit: z.number(),
|
authRateLimit: z.number(),
|
||||||
inviteUserRateLimit: z.number(),
|
inviteUserRateLimit: z.number(),
|
||||||
mfaRateLimit: z.number(),
|
mfaRateLimit: z.number(),
|
||||||
creationLimit: z.number(),
|
|
||||||
publicEndpointLimit: z.number()
|
publicEndpointLimit: z.number()
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -41,7 +40,6 @@ export const RateLimitPanel = () => {
|
|||||||
authRateLimit: rateLimit?.authRateLimit ?? 60,
|
authRateLimit: rateLimit?.authRateLimit ?? 60,
|
||||||
inviteUserRateLimit: rateLimit?.inviteUserRateLimit ?? 30,
|
inviteUserRateLimit: rateLimit?.inviteUserRateLimit ?? 30,
|
||||||
mfaRateLimit: rateLimit?.mfaRateLimit ?? 20,
|
mfaRateLimit: rateLimit?.mfaRateLimit ?? 20,
|
||||||
creationLimit: rateLimit?.creationLimit ?? 30,
|
|
||||||
publicEndpointLimit: rateLimit?.publicEndpointLimit ?? 30
|
publicEndpointLimit: rateLimit?.publicEndpointLimit ?? 30
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -60,7 +58,6 @@ export const RateLimitPanel = () => {
|
|||||||
authRateLimit,
|
authRateLimit,
|
||||||
inviteUserRateLimit,
|
inviteUserRateLimit,
|
||||||
mfaRateLimit,
|
mfaRateLimit,
|
||||||
creationLimit,
|
|
||||||
publicEndpointLimit
|
publicEndpointLimit
|
||||||
} = formData;
|
} = formData;
|
||||||
|
|
||||||
@@ -71,7 +68,6 @@ export const RateLimitPanel = () => {
|
|||||||
authRateLimit,
|
authRateLimit,
|
||||||
inviteUserRateLimit,
|
inviteUserRateLimit,
|
||||||
mfaRateLimit,
|
mfaRateLimit,
|
||||||
creationLimit,
|
|
||||||
publicEndpointLimit
|
publicEndpointLimit
|
||||||
});
|
});
|
||||||
createNotification({
|
createNotification({
|
||||||
@@ -210,25 +206,6 @@ export const RateLimitPanel = () => {
|
|||||||
</FormControl>
|
</FormControl>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<Controller
|
|
||||||
control={control}
|
|
||||||
defaultValue={300}
|
|
||||||
name="creationLimit"
|
|
||||||
render={({ field, fieldState: { error } }) => (
|
|
||||||
<FormControl
|
|
||||||
label="New resource creation requests per minute"
|
|
||||||
className="w-72"
|
|
||||||
isError={Boolean(error)}
|
|
||||||
errorText={error?.message}
|
|
||||||
>
|
|
||||||
<Input
|
|
||||||
{...field}
|
|
||||||
value={field.value || ""}
|
|
||||||
onChange={(e) => field.onChange(Number(e.target.value))}
|
|
||||||
/>
|
|
||||||
</FormControl>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
defaultValue={300}
|
defaultValue={300}
|
||||||
|
|||||||
Reference in New Issue
Block a user