mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 21:27:10 +00:00
Fix lint/type issues
This commit is contained in:
@@ -15,7 +15,7 @@ export type TListProjectAuditLogDTO = {
|
|||||||
|
|
||||||
export type TCreateAuditLogDTO = {
|
export type TCreateAuditLogDTO = {
|
||||||
event: Event;
|
event: Event;
|
||||||
actor: UserActor | IdentityActor | ServiceActor;
|
actor: UserActor | IdentityActor | ServiceActor | ScimClientActor;
|
||||||
orgId?: string;
|
orgId?: string;
|
||||||
projectId?: string;
|
projectId?: string;
|
||||||
} & BaseAuthData;
|
} & BaseAuthData;
|
||||||
@@ -105,6 +105,8 @@ interface IdentityActorMetadata {
|
|||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface ScimClientActorMetadata {}
|
||||||
|
|
||||||
export interface UserActor {
|
export interface UserActor {
|
||||||
type: ActorType.USER;
|
type: ActorType.USER;
|
||||||
metadata: UserActorMetadata;
|
metadata: UserActorMetadata;
|
||||||
@@ -122,6 +124,7 @@ export interface IdentityActor {
|
|||||||
|
|
||||||
export interface ScimClientActor {
|
export interface ScimClientActor {
|
||||||
type: ActorType.SCIM_CLIENT;
|
type: ActorType.SCIM_CLIENT;
|
||||||
|
metadata: ScimClientActorMetadata;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Actor = UserActor | ServiceActor | IdentityActor | ScimClientActor;
|
export type Actor = UserActor | ServiceActor | IdentityActor | ScimClientActor;
|
||||||
|
|||||||
@@ -65,7 +65,8 @@ export const injectAuditLogInfo = fp(async (server: FastifyZodProvider) => {
|
|||||||
};
|
};
|
||||||
} else if (req.auth.actor === ActorType.SCIM_CLIENT) {
|
} else if (req.auth.actor === ActorType.SCIM_CLIENT) {
|
||||||
payload.actor = {
|
payload.actor = {
|
||||||
type: ActorType.SCIM_CLIENT
|
type: ActorType.SCIM_CLIENT,
|
||||||
|
metadata: {}
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
throw new BadRequestError({ message: "Missing logic for other actor" });
|
throw new BadRequestError({ message: "Missing logic for other actor" });
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
export { useGetScimTokens } from "./queries";
|
|
||||||
export {
|
export {
|
||||||
useCreateScimToken,
|
useCreateScimToken,
|
||||||
useDeleteScimToken
|
useDeleteScimToken
|
||||||
} from "./mutations";
|
} from "./mutations";
|
||||||
|
export { useGetScimTokens } from "./queries";
|
||||||
@@ -1,11 +1,13 @@
|
|||||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||||
|
|
||||||
import { apiRequest } from "@app/config/request";
|
import { apiRequest } from "@app/config/request";
|
||||||
|
|
||||||
|
import { scimKeys } from "./queries";
|
||||||
import {
|
import {
|
||||||
CreateScimTokenDTO,
|
CreateScimTokenDTO,
|
||||||
CreateScimTokenRes,
|
CreateScimTokenRes,
|
||||||
DeleteScimTokenDTO
|
DeleteScimTokenDTO
|
||||||
} from "./types";
|
} from "./types";
|
||||||
import { scimKeys } from "./queries";
|
|
||||||
|
|
||||||
export const useCreateScimToken = () => {
|
export const useCreateScimToken = () => {
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
@@ -32,10 +34,7 @@ export const useCreateScimToken = () => {
|
|||||||
export const useDeleteScimToken = () => {
|
export const useDeleteScimToken = () => {
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
return useMutation<CreateScimTokenRes, {}, DeleteScimTokenDTO>({
|
return useMutation<CreateScimTokenRes, {}, DeleteScimTokenDTO>({
|
||||||
mutationFn: async ({
|
mutationFn: async ({ scimTokenId }) => {
|
||||||
organizationId,
|
|
||||||
scimTokenId
|
|
||||||
}) => {
|
|
||||||
const { data } = await apiRequest.delete(`/api/v1/scim/scim-tokens/${scimTokenId}`);
|
const { data } = await apiRequest.delete(`/api/v1/scim/scim-tokens/${scimTokenId}`);
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
|
||||||
import { apiRequest } from "@app/config/request";
|
import { apiRequest } from "@app/config/request";
|
||||||
|
|
||||||
import { ScimTokenData } from "./types";
|
import { ScimTokenData } from "./types";
|
||||||
|
|
||||||
export const scimKeys = {
|
export const scimKeys = {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { OrgPermissionActions, OrgPermissionSubjects } from "@app/context";
|
import { OrgPermissionActions, OrgPermissionSubjects } from "@app/context";
|
||||||
import { withPermission } from "@app/hoc";
|
import { withPermission } from "@app/hoc";
|
||||||
|
|
||||||
import { OrgScimSection } from "./OrgScimSection";
|
|
||||||
import { OrgGeneralAuthSection } from "./OrgGeneralAuthSection";
|
import { OrgGeneralAuthSection } from "./OrgGeneralAuthSection";
|
||||||
|
import { OrgScimSection } from "./OrgSCIMSection";
|
||||||
import { OrgSSOSection } from "./OrgSSOSection";
|
import { OrgSSOSection } from "./OrgSSOSection";
|
||||||
|
|
||||||
export const OrgAuthTab = withPermission(
|
export const OrgAuthTab = withPermission(
|
||||||
|
|||||||
+5
-6
@@ -26,14 +26,13 @@ import {
|
|||||||
THead,
|
THead,
|
||||||
Tr
|
Tr
|
||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
|
import { useOrganization } from "@app/context";
|
||||||
import { useToggle } from "@app/hooks";
|
import { useToggle } from "@app/hooks";
|
||||||
import {
|
import {
|
||||||
useGetScimTokens,
|
|
||||||
useCreateScimToken,
|
useCreateScimToken,
|
||||||
useDeleteScimToken
|
useDeleteScimToken,
|
||||||
} from "@app/hooks/api";
|
useGetScimTokens} from "@app/hooks/api";
|
||||||
import { UsePopUpState } from "@app/hooks/usePopUp";
|
import { UsePopUpState } from "@app/hooks/usePopUp";
|
||||||
import { useOrganization } from "@app/context";
|
|
||||||
|
|
||||||
const schema = yup.object({
|
const schema = yup.object({
|
||||||
description: yup.string(),
|
description: yup.string(),
|
||||||
@@ -162,7 +161,7 @@ export const ScimTokenModal = ({
|
|||||||
setToken("");
|
setToken("");
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ModalContent title={`Manage SCIM credentials`}>
|
<ModalContent title="Manage SCIM credentials">
|
||||||
<h2 className="mb-4">SCIM URL</h2>
|
<h2 className="mb-4">SCIM URL</h2>
|
||||||
<div className="mb-8 flex items-center justify-between rounded-md bg-white/[0.07] p-2 text-base text-gray-400">
|
<div className="mb-8 flex items-center justify-between rounded-md bg-white/[0.07] p-2 text-base text-gray-400">
|
||||||
<p className="mr-4 break-all">{scimUrl}</p>
|
<p className="mr-4 break-all">{scimUrl}</p>
|
||||||
@@ -326,7 +325,7 @@ export const ScimTokenModal = ({
|
|||||||
</TableContainer>
|
</TableContainer>
|
||||||
<DeleteActionModal
|
<DeleteActionModal
|
||||||
isOpen={popUp.deleteScimToken.isOpen}
|
isOpen={popUp.deleteScimToken.isOpen}
|
||||||
title={"Are you sure want to delete the SCIM token?"}
|
title="Are you sure want to delete the SCIM token?"
|
||||||
onChange={(isOpen) => handlePopUpToggle("scimToken", isOpen)}
|
onChange={(isOpen) => handlePopUpToggle("scimToken", isOpen)}
|
||||||
deleteKey="confirm"
|
deleteKey="confirm"
|
||||||
onDeleteApproved={() => {
|
onDeleteApproved={() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user