mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 14:27:59 +00:00
feat(frontend): add enforcementLevel into AccessPolicy
This commit is contained in:
@@ -16,14 +16,15 @@ export const useCreateAccessApprovalPolicy = () => {
|
|||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
return useMutation<{}, {}, TCreateAccessPolicyDTO>({
|
return useMutation<{}, {}, TCreateAccessPolicyDTO>({
|
||||||
mutationFn: async ({ environment, projectSlug, approvals, approvers, name, secretPath }) => {
|
mutationFn: async ({ environment, projectSlug, approvals, approvers, name, secretPath, enforcementLevel }) => {
|
||||||
const { data } = await apiRequest.post("/api/v1/access-approvals/policies", {
|
const { data } = await apiRequest.post("/api/v1/access-approvals/policies", {
|
||||||
environment,
|
environment,
|
||||||
projectSlug,
|
projectSlug,
|
||||||
approvals,
|
approvals,
|
||||||
approvers,
|
approvers,
|
||||||
secretPath,
|
secretPath,
|
||||||
name
|
name,
|
||||||
|
enforcementLevel
|
||||||
});
|
});
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
@@ -37,12 +38,13 @@ export const useUpdateAccessApprovalPolicy = () => {
|
|||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
return useMutation<{}, {}, TUpdateAccessPolicyDTO>({
|
return useMutation<{}, {}, TUpdateAccessPolicyDTO>({
|
||||||
mutationFn: async ({ id, approvers, approvals, name, secretPath }) => {
|
mutationFn: async ({ id, approvers, approvals, name, secretPath, enforcementLevel }) => {
|
||||||
const { data } = await apiRequest.patch(`/api/v1/access-approvals/policies/${id}`, {
|
const { data } = await apiRequest.patch(`/api/v1/access-approvals/policies/${id}`, {
|
||||||
approvals,
|
approvals,
|
||||||
approvers,
|
approvers,
|
||||||
secretPath,
|
secretPath,
|
||||||
name
|
name,
|
||||||
|
enforcementLevel
|
||||||
});
|
});
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -125,6 +125,7 @@ export type TCreateAccessPolicyDTO = {
|
|||||||
approvers?: string[];
|
approvers?: string[];
|
||||||
approvals?: number;
|
approvals?: number;
|
||||||
secretPath?: string;
|
secretPath?: string;
|
||||||
|
enforcementLevel?: EnforcementLevel;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TUpdateAccessPolicyDTO = {
|
export type TUpdateAccessPolicyDTO = {
|
||||||
@@ -134,6 +135,7 @@ export type TUpdateAccessPolicyDTO = {
|
|||||||
secretPath?: string;
|
secretPath?: string;
|
||||||
environment?: string;
|
environment?: string;
|
||||||
approvals?: number;
|
approvals?: number;
|
||||||
|
enforcementLevel?: EnforcementLevel;
|
||||||
// for invalidating list
|
// for invalidating list
|
||||||
projectSlug: string;
|
projectSlug: string;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ export type TSecretApprovalPolicy = {
|
|||||||
approvals: number;
|
approvals: number;
|
||||||
userApprovers: { userId: string }[];
|
userApprovers: { userId: string }[];
|
||||||
updatedAt: Date;
|
updatedAt: Date;
|
||||||
|
enforcementLevel: EnforcementLevel;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TGetSecretApprovalPoliciesDTO = {
|
export type TGetSecretApprovalPoliciesDTO = {
|
||||||
|
|||||||
Reference in New Issue
Block a user