mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-19 22:20:36 +00:00
feat(access-policies): Allow policy limits on access request times
This commit is contained in:
+18
@@ -220,6 +220,24 @@ export const SpecificPrivilegeSecretForm = ({
|
||||
return;
|
||||
}
|
||||
|
||||
const policy = policies.find(
|
||||
(p) =>
|
||||
p.environments.find((e) => e.slug === selectedEnvironment) && p.secretPath === secretPath
|
||||
);
|
||||
|
||||
if (
|
||||
policy?.maxTimePeriod &&
|
||||
(!data.temporaryAccess.isTemporary ||
|
||||
ms(data.temporaryAccess.temporaryRange) > ms(policy.maxTimePeriod))
|
||||
) {
|
||||
createNotification({
|
||||
type: "error",
|
||||
text: `Requested access time range is limited to ${policy.maxTimePeriod} by policy`,
|
||||
title: "Error"
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const actions = [
|
||||
{ action: ProjectPermissionActions.Read, allowed: data.read },
|
||||
{ action: ProjectPermissionActions.Create, allowed: data.create },
|
||||
|
||||
Reference in New Issue
Block a user