mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 10:35:17 +00:00
feat(policies): Bypass Approval Rework
This commit is contained in:
@@ -21,6 +21,7 @@ export const useCreateAccessApprovalPolicy = () => {
|
||||
projectSlug,
|
||||
approvals,
|
||||
approvers,
|
||||
bypassers,
|
||||
name,
|
||||
secretPath,
|
||||
enforcementLevel,
|
||||
@@ -30,6 +31,7 @@ export const useCreateAccessApprovalPolicy = () => {
|
||||
environment,
|
||||
projectSlug,
|
||||
approvals,
|
||||
bypassers,
|
||||
approvers,
|
||||
secretPath,
|
||||
name,
|
||||
@@ -53,6 +55,7 @@ export const useUpdateAccessApprovalPolicy = () => {
|
||||
mutationFn: async ({
|
||||
id,
|
||||
approvers,
|
||||
bypassers,
|
||||
approvals,
|
||||
name,
|
||||
secretPath,
|
||||
@@ -62,6 +65,7 @@ export const useUpdateAccessApprovalPolicy = () => {
|
||||
const { data } = await apiRequest.patch(`/api/v1/access-approvals/policies/${id}`, {
|
||||
approvals,
|
||||
approvers,
|
||||
bypassers,
|
||||
secretPath,
|
||||
name,
|
||||
enforcementLevel,
|
||||
|
||||
@@ -16,6 +16,7 @@ export type TAccessApprovalPolicy = {
|
||||
enforcementLevel: EnforcementLevel;
|
||||
updatedAt: Date;
|
||||
approvers?: Approver[];
|
||||
bypassers?: Bypasser[];
|
||||
allowedSelfApprovals: boolean;
|
||||
};
|
||||
|
||||
@@ -24,11 +25,21 @@ export enum ApproverType {
|
||||
Group = "group"
|
||||
}
|
||||
|
||||
export enum BypasserType {
|
||||
User = "user",
|
||||
Group = "group"
|
||||
}
|
||||
|
||||
export type Approver = {
|
||||
id: string;
|
||||
type: ApproverType;
|
||||
};
|
||||
|
||||
export type Bypasser = {
|
||||
id: string;
|
||||
type: BypasserType;
|
||||
};
|
||||
|
||||
export type TAccessApprovalRequest = {
|
||||
id: string;
|
||||
policyId: string;
|
||||
@@ -68,6 +79,7 @@ export type TAccessApprovalRequest = {
|
||||
name: string;
|
||||
approvals: number;
|
||||
approvers: string[];
|
||||
bypassers: string[];
|
||||
secretPath?: string | null;
|
||||
envId: string;
|
||||
enforcementLevel: EnforcementLevel;
|
||||
@@ -146,6 +158,7 @@ export type TCreateAccessPolicyDTO = {
|
||||
name?: string;
|
||||
environment: string;
|
||||
approvers?: Approver[];
|
||||
bypassers?: Bypasser[];
|
||||
approvals?: number;
|
||||
secretPath?: string;
|
||||
enforcementLevel?: EnforcementLevel;
|
||||
@@ -156,6 +169,7 @@ export type TUpdateAccessPolicyDTO = {
|
||||
id: string;
|
||||
name?: string;
|
||||
approvers?: Approver[];
|
||||
bypassers?: Bypasser[];
|
||||
secretPath?: string;
|
||||
environment?: string;
|
||||
approvals?: number;
|
||||
|
||||
@@ -14,6 +14,7 @@ export const useCreateSecretApprovalPolicy = () => {
|
||||
workspaceId,
|
||||
approvals,
|
||||
approvers,
|
||||
bypassers,
|
||||
secretPath,
|
||||
name,
|
||||
enforcementLevel,
|
||||
@@ -24,6 +25,7 @@ export const useCreateSecretApprovalPolicy = () => {
|
||||
workspaceId,
|
||||
approvals,
|
||||
approvers,
|
||||
bypassers,
|
||||
secretPath,
|
||||
name,
|
||||
enforcementLevel,
|
||||
@@ -46,6 +48,7 @@ export const useUpdateSecretApprovalPolicy = () => {
|
||||
mutationFn: async ({
|
||||
id,
|
||||
approvers,
|
||||
bypassers,
|
||||
approvals,
|
||||
secretPath,
|
||||
name,
|
||||
@@ -55,6 +58,7 @@ export const useUpdateSecretApprovalPolicy = () => {
|
||||
const { data } = await apiRequest.patch(`/api/v1/secret-approvals/${id}`, {
|
||||
approvals,
|
||||
approvers,
|
||||
bypassers,
|
||||
secretPath,
|
||||
name,
|
||||
enforcementLevel,
|
||||
|
||||
@@ -25,6 +25,16 @@ export type Approver = {
|
||||
type: ApproverType;
|
||||
};
|
||||
|
||||
export enum BypasserType {
|
||||
User = "user",
|
||||
Group = "group"
|
||||
}
|
||||
|
||||
export type Bypasser = {
|
||||
id: string;
|
||||
type: BypasserType;
|
||||
};
|
||||
|
||||
export type TGetSecretApprovalPoliciesDTO = {
|
||||
workspaceId: string;
|
||||
};
|
||||
@@ -41,6 +51,7 @@ export type TCreateSecretPolicyDTO = {
|
||||
environment: string;
|
||||
secretPath?: string | null;
|
||||
approvers?: Approver[];
|
||||
bypassers?: Bypasser[];
|
||||
approvals?: number;
|
||||
enforcementLevel: EnforcementLevel;
|
||||
allowedSelfApprovals: boolean;
|
||||
@@ -50,6 +61,7 @@ export type TUpdateSecretPolicyDTO = {
|
||||
id: string;
|
||||
name?: string;
|
||||
approvers?: Approver[];
|
||||
bypassers?: Bypasser[];
|
||||
secretPath?: string | null;
|
||||
approvals?: number;
|
||||
allowedSelfApprovals?: boolean;
|
||||
|
||||
@@ -57,7 +57,7 @@ export type TSecretApprovalRequest = {
|
||||
secretPath: string;
|
||||
hasMerged: boolean;
|
||||
status: "open" | "close";
|
||||
policy: Omit<TSecretApprovalPolicy, "approvers"> & {
|
||||
policy: Omit<TSecretApprovalPolicy, "approvers" | "bypassers"> & {
|
||||
approvers: {
|
||||
userId: string;
|
||||
email: string;
|
||||
@@ -65,6 +65,13 @@ export type TSecretApprovalRequest = {
|
||||
lastName: string;
|
||||
username: string;
|
||||
}[];
|
||||
bypassers: {
|
||||
userId: string;
|
||||
email: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
username: string;
|
||||
}[];
|
||||
};
|
||||
statusChangedByUserId: string;
|
||||
statusChangedByUser?: {
|
||||
|
||||
Reference in New Issue
Block a user