mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-20 22:17:52 +00:00
feat(access-policies): Allow policy limits on access request times
This commit is contained in:
+21
-1
@@ -91,7 +91,8 @@ const formSchema = z
|
||||
})
|
||||
.array()
|
||||
.default([])
|
||||
.optional()
|
||||
.optional(),
|
||||
maxTimePeriod: z.string().trim().optional()
|
||||
})
|
||||
.superRefine((data, ctx) => {
|
||||
if (data.policyType === PolicyType.ChangePolicy) {
|
||||
@@ -440,6 +441,25 @@ const Form = ({
|
||||
</FormControl>
|
||||
)}
|
||||
/>
|
||||
|
||||
{isAccessPolicyType && (
|
||||
<Controller
|
||||
control={control}
|
||||
name="maxTimePeriod"
|
||||
render={({ field, fieldState: { error } }) => (
|
||||
<FormControl
|
||||
label="Max. Time Period"
|
||||
tooltipText="The maximum amount of time someone can request access for. Ex: 1h, 3w, 30d"
|
||||
isError={Boolean(error)}
|
||||
errorText={error?.message}
|
||||
className="flex-shrink"
|
||||
>
|
||||
<Input {...field} value={field.value} placeholder="permanent" />
|
||||
</FormControl>
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
|
||||
{!isAccessPolicyType && (
|
||||
<Controller
|
||||
control={control}
|
||||
|
||||
+10
-3
@@ -27,7 +27,10 @@ import { twMerge } from "tailwind-merge";
|
||||
import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
|
||||
import { createNotification } from "@app/components/notifications";
|
||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||
import { hasSecretReference, SecretReferenceTree } from "@app/components/secrets/SecretReferenceDetails";
|
||||
import {
|
||||
hasSecretReference,
|
||||
SecretReferenceTree
|
||||
} from "@app/components/secrets/SecretReferenceDetails";
|
||||
import {
|
||||
Button,
|
||||
Drawer,
|
||||
@@ -49,8 +52,12 @@ import {
|
||||
Tooltip
|
||||
} from "@app/components/v2";
|
||||
import { InfisicalSecretInput } from "@app/components/v2/InfisicalSecretInput";
|
||||
import { ProjectPermissionActions, ProjectPermissionSub, useProjectPermission, useWorkspace } from "@app/context";
|
||||
|
||||
import {
|
||||
ProjectPermissionActions,
|
||||
ProjectPermissionSub,
|
||||
useProjectPermission,
|
||||
useWorkspace
|
||||
} from "@app/context";
|
||||
import { ProjectPermissionSecretActions } from "@app/context/ProjectPermissionContext/types";
|
||||
import { getProjectBaseURL } from "@app/helpers/project";
|
||||
import { usePopUp } from "@app/hooks";
|
||||
|
||||
Reference in New Issue
Block a user