From 2ca752416d2bde964783ca12da790892ca7d2aef Mon Sep 17 00:00:00 2001 From: Anton SHEPILOV Date: Fri, 23 Feb 2024 18:05:22 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=92Do=20not=20expose=20application=20a?= =?UTF-8?q?pi=20into?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../applications/services/company-applications.ts | 4 ++++ tdrive/backend/node/test/e2e/users/users.quota.spec.ts | 2 +- .../components/search-popup/parts/drive-item-result.tsx | 8 -------- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/tdrive/backend/node/src/services/applications/services/company-applications.ts b/tdrive/backend/node/src/services/applications/services/company-applications.ts index ee1ed3213..c0cc59995 100644 --- a/tdrive/backend/node/src/services/applications/services/company-applications.ts +++ b/tdrive/backend/node/src/services/applications/services/company-applications.ts @@ -23,6 +23,8 @@ export class CompanyApplicationServiceImpl implements TdriveServiceProvider, Ini pk.application_id, context, ); + //do not expose application secret + application.api = null; if (!application?.id) { return null; @@ -62,6 +64,8 @@ export class CompanyApplicationServiceImpl implements TdriveServiceProvider, Ini companyApplication.application_id, context, ); + //do not expose application secret + application.api = null; if (application) applications.push({ ...companyApplication, diff --git a/tdrive/backend/node/test/e2e/users/users.quota.spec.ts b/tdrive/backend/node/test/e2e/users/users.quota.spec.ts index 177a1e734..b05ff1423 100644 --- a/tdrive/backend/node/test/e2e/users/users.quota.spec.ts +++ b/tdrive/backend/node/test/e2e/users/users.quota.spec.ts @@ -9,7 +9,7 @@ describe("The /users/quota API", () => { beforeEach(async () => { platform = await init(); currentUser = await TestHelpers.getInstance(platform); - }, 30000000); + }); afterEach(async () => { await platform.tearDown(); diff --git a/tdrive/frontend/src/app/components/search-popup/parts/drive-item-result.tsx b/tdrive/frontend/src/app/components/search-popup/parts/drive-item-result.tsx index 1e187f738..2aa5ffa2a 100644 --- a/tdrive/frontend/src/app/components/search-popup/parts/drive-item-result.tsx +++ b/tdrive/frontend/src/app/components/search-popup/parts/drive-item-result.tsx @@ -14,12 +14,10 @@ import { FileTypeUnknownIcon, } from '@atoms/icons-colored'; import * as Text from '@atoms/text'; -import { useCompanyApplications } from '@features/applications/hooks/use-company-applications'; import { DriveItem } from '@features/drive/types'; import FileUploadAPIClient from '@features/files/api/file-upload-api-client'; import { formatDate } from '@features/global/utils/format-date'; import { formatSize } from '@features/global/utils/format-file-size'; -import useRouterWorkspace from '@features/router/hooks/use-router-workspace'; import { useSearchModal } from '@features/search/hooks/use-search'; import { SearchInputState } from '@features/search/state/search-input'; import { UserType } from '@features/users/types/user'; @@ -34,14 +32,8 @@ import useRouterCompany from 'app/features/router/hooks/use-router-company'; export default (props: { driveItem: DriveItem & { user?: UserType }}) => { const history = useHistory(); const input = useRecoilValue(SearchInputState); - const currentWorkspaceId = useRouterWorkspace(); - const companyApplications = useCompanyApplications(); const { user } = useCurrentUser(); const [_, setParentId] = useRecoilState(DriveCurrentFolderAtom({ initialFolderId: 'user_'+user?.id })); - const tdriveDriveApplicationId = - companyApplications.applications.find(application => { - return application.identity.code === 'tdrive_drive'; - })?.id || ''; const file = props.driveItem; const name = file?.name; const extension = name?.split('.').pop();