,
21 | fallback: SuspenseProps["fallback"] = null,
22 | ) {
23 | function ComponentWithSuspense(props: P) {
24 | return (
25 |
26 |
27 |
28 | );
29 | }
30 |
31 | return ComponentWithSuspense;
32 | }
33 |
34 | export default withSuspense;
35 |
--------------------------------------------------------------------------------
/web-app/src/screens/Console/Common/FormComponents/common/styleLibrary.ts:
--------------------------------------------------------------------------------
1 | // This file is part of MinIO Console Server
2 | // Copyright (c) 2021 MinIO, Inc.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU Affero General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Affero General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU Affero General Public License
15 | // along with this program. If not, see .
16 |
17 | // This object contains variables that will be used across form components.
18 |
19 | export const modalStyleUtils: any = {
20 | modalButtonBar: {
21 | marginTop: 15,
22 | display: "flex",
23 | alignItems: "center",
24 | justifyContent: "flex-end",
25 | gap: 10,
26 | },
27 | modalFormScrollable: {
28 | maxHeight: "calc(100vh - 300px)",
29 | overflowY: "auto",
30 | paddingTop: 10,
31 | },
32 | };
33 |
--------------------------------------------------------------------------------
/web-app/src/screens/Console/Common/Hooks/useApi.tsx:
--------------------------------------------------------------------------------
1 | import { useState } from "react";
2 | import api from "../../../../common/api";
3 | import { ErrorResponseHandler } from "../../../../common/types";
4 |
5 | type NoReturnFunction = (param?: any) => void;
6 | type ApiMethodToInvoke = (method: string, url: string, data?: any) => void;
7 | type IsApiInProgress = boolean;
8 |
9 | const useApi = (
10 | onSuccess: NoReturnFunction,
11 | onError: NoReturnFunction,
12 | ): [IsApiInProgress, ApiMethodToInvoke] => {
13 | const [isLoading, setIsLoading] = useState(false);
14 |
15 | const callApi = (method: string, url: string, data?: any, headers?: any) => {
16 | setIsLoading(true);
17 | api
18 | .invoke(method, url, data, headers)
19 | .then((res: any) => {
20 | setIsLoading(false);
21 | onSuccess(res);
22 | })
23 | .catch((err: ErrorResponseHandler) => {
24 | setIsLoading(false);
25 | onError(err);
26 | });
27 | };
28 |
29 | return [isLoading, callApi];
30 | };
31 |
32 | export default useApi;
33 |
--------------------------------------------------------------------------------
/web-app/src/screens/Console/Common/PageHeaderWrapper/PageHeaderWrapper.tsx:
--------------------------------------------------------------------------------
1 | // This file is part of MinIO Console Server
2 | // Copyright (c) 2021 MinIO, Inc.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU Affero General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Affero General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU Affero General Public License
15 | // along with this program. If not, see .
16 |
17 | import React, { Fragment } from "react";
18 | import { PageHeader } from "mds";
19 | import ObjectManagerButton from "../ObjectManager/ObjectManagerButton";
20 | import DarkModeActivator from "../DarkModeActivator/DarkModeActivator";
21 |
22 | interface IPageHeaderWrapper {
23 | label: React.ReactNode;
24 | middleComponent?: React.ReactNode;
25 | actions?: React.ReactNode;
26 | }
27 |
28 | const PageHeaderWrapper = ({
29 | label,
30 | actions,
31 | middleComponent,
32 | }: IPageHeaderWrapper) => {
33 | return (
34 |
38 | {actions}
39 |
40 |
41 |
42 | }
43 | middleComponent={middleComponent}
44 | />
45 | );
46 | };
47 |
48 | export default PageHeaderWrapper;
49 |
--------------------------------------------------------------------------------
/web-app/src/screens/Console/Common/SearchBox.tsx:
--------------------------------------------------------------------------------
1 | // This file is part of MinIO Console Server
2 | // Copyright (c) 2022 MinIO, Inc.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU Affero General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Affero General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU Affero General Public License
15 | // along with this program. If not, see .
16 |
17 | import React from "react";
18 | import { InputBox, SearchIcon } from "mds";
19 | import { CSSObject } from "styled-components";
20 |
21 | type SearchBoxProps = {
22 | placeholder?: string;
23 | value: string;
24 | onChange: (value: string) => void;
25 | overrideClass?: any;
26 | id?: string;
27 | label?: string;
28 | sx?: CSSObject;
29 | };
30 |
31 | const SearchBox = ({
32 | placeholder = "",
33 | onChange,
34 | overrideClass,
35 | value,
36 | id = "search-resource",
37 | label = "",
38 | sx,
39 | }: SearchBoxProps) => {
40 | return (
41 | {
47 | onChange(e.target.value);
48 | }}
49 | value={value}
50 | startIcon={}
51 | sx={sx}
52 | />
53 | );
54 | };
55 |
56 | export default SearchBox;
57 |
--------------------------------------------------------------------------------
/web-app/src/screens/Console/Common/TooltipWrapper/TooltipWrapper.tsx:
--------------------------------------------------------------------------------
1 | // This file is part of MinIO Console Server
2 | // Copyright (c) 2022 MinIO, Inc.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU Affero General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Affero General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU Affero General Public License
15 | // along with this program. If not, see .
16 |
17 | import React, { cloneElement } from "react";
18 | import { Tooltip } from "mds";
19 |
20 | interface ITooltipWrapperProps {
21 | tooltip: string;
22 | children: any;
23 | errorProps?: any;
24 | placement?: "bottom" | "left" | "right" | "top";
25 | }
26 |
27 | const TooltipWrapper = ({
28 | tooltip,
29 | children,
30 | errorProps = null,
31 | placement,
32 | }: ITooltipWrapperProps) => {
33 | return (
34 |
35 |
36 | {errorProps ? cloneElement(children, { ...errorProps }) : children}
37 |
38 |
39 | );
40 | };
41 |
42 | export default TooltipWrapper;
43 |
--------------------------------------------------------------------------------
/web-app/src/screens/Console/HelpMenu.types.ts:
--------------------------------------------------------------------------------
1 | // This file is part of MinIO Console Server
2 | // Copyright (c) 2023 MinIO, Inc.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU Affero General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Affero General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU Affero General Public License
15 | // along with this program. If not, see .
16 |
17 | export interface DocItem {
18 | img?: string;
19 | title: string;
20 | url: string;
21 | body: string;
22 | }
23 |
--------------------------------------------------------------------------------
/web-app/src/screens/Console/License/CheckIcon.tsx:
--------------------------------------------------------------------------------
1 | // This file is part of MinIO Console Server
2 | // Copyright (c) 2024 MinIO, Inc.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU Affero General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Affero General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU Affero General Public License
15 | // along with this program. If not, see .
16 |
17 | import * as React from "react";
18 | import { SVGProps } from "react";
19 |
20 | const CheckIcon = (props: SVGProps) => (
21 |
30 | );
31 |
32 | export default CheckIcon;
33 |
--------------------------------------------------------------------------------
/web-app/src/screens/Console/License/License.tsx:
--------------------------------------------------------------------------------
1 | // This file is part of MinIO Console Server
2 | // Copyright (c) 2021 MinIO, Inc.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU Affero General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Affero General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU Affero General Public License
15 | // along with this program. If not, see .
16 |
17 | import React, { Fragment, useEffect } from "react";
18 | import { PageLayout } from "mds";
19 | import LicensePlans from "./LicensePlans";
20 | import PageHeaderWrapper from "../Common/PageHeaderWrapper/PageHeaderWrapper";
21 | import { setHelpName } from "../../../systemSlice";
22 | import { useAppDispatch } from "../../../store";
23 |
24 | const License = () => {
25 | const dispatch = useAppDispatch();
26 | useEffect(() => {
27 | dispatch(setHelpName("license"));
28 | // eslint-disable-next-line react-hooks/exhaustive-deps
29 | }, []);
30 |
31 | return (
32 |
33 |
34 |
35 |
36 |
37 |
38 | );
39 | };
40 |
41 | export default License;
42 |
--------------------------------------------------------------------------------
/web-app/src/screens/Console/License/LicenseLink.tsx:
--------------------------------------------------------------------------------
1 | // This file is part of MinIO Console Server
2 | // Copyright (c) 2022 MinIO, Inc.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU Affero General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Affero General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU Affero General Public License
15 | // along with this program. If not, see .
16 |
17 | import React from "react";
18 |
19 | const LicenseLink = () => {
20 | return (
21 |
22 | GNU AGPL v3
23 |
24 | );
25 | };
26 | export default LicenseLink;
27 |
--------------------------------------------------------------------------------
/web-app/src/screens/Console/License/licenseSlice.ts:
--------------------------------------------------------------------------------
1 | // This file is part of MinIO Console Server
2 | // Copyright (c) 2023 MinIO, Inc.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU Affero General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Affero General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU Affero General Public License
15 | // along with this program. If not, see .
16 |
17 | import { createSlice } from "@reduxjs/toolkit";
18 |
19 | interface IAddPool {
20 | faqModalOpen: boolean;
21 | }
22 |
23 | const initialState: IAddPool = {
24 | faqModalOpen: false,
25 | };
26 |
27 | const licenseSlice = createSlice({
28 | name: "license",
29 | initialState,
30 | reducers: {
31 | openFAQModal: (state) => {
32 | state.faqModalOpen = true;
33 | },
34 | closeFAQModal: (state) => {
35 | state.faqModalOpen = false;
36 | },
37 | },
38 | });
39 |
40 | export default licenseSlice.reducer;
41 |
--------------------------------------------------------------------------------
/web-app/src/screens/Console/License/types.tsx:
--------------------------------------------------------------------------------
1 | // This file is part of MinIO Console Server
2 | // Copyright (c) 2021 MinIO, Inc.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU Affero General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Affero General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU Affero General Public License
15 | // along with this program. If not, see .
16 |
17 | export interface SubnetInfo {
18 | account_id: number;
19 | email: string;
20 | expires_at: string;
21 | plan: string;
22 | storage_capacity: number;
23 | organization: string;
24 | }
25 |
--------------------------------------------------------------------------------
/web-app/src/screens/Console/Menu/Listing/BucketListItem.tsx:
--------------------------------------------------------------------------------
1 | // This file is part of MinIO Console Server
2 | // Copyright (c) 2021 MinIO, Inc.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU Affero General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Affero General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU Affero General Public License
15 | // along with this program. If not, see .
16 |
17 | import React from "react";
18 | import { useNavigate } from "react-router-dom";
19 | import { BucketsIcon, MenuItem } from "mds";
20 | import { Bucket } from "../../../../api/consoleApi";
21 |
22 | interface IBucketListItem {
23 | bucket: Bucket;
24 | }
25 |
26 | const BucketListItem = ({ bucket }: IBucketListItem) => {
27 | const navigate = useNavigate();
28 |
29 | return (
30 | }
33 | onClick={() => navigate(`/browser/${bucket.name}`)}
34 | id={`manageBucket-${bucket.name}`}
35 | />
36 | );
37 | };
38 |
39 | export default BucketListItem;
40 |
--------------------------------------------------------------------------------
/web-app/src/screens/Console/Menu/types.ts:
--------------------------------------------------------------------------------
1 | // This file is part of MinIO Console Server
2 | // Copyright (c) 2021 MinIO, Inc.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU Affero General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Affero General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU Affero General Public License
15 | // along with this program. If not, see .
16 |
17 | export interface IRouteRule {
18 | component: any;
19 | path: string;
20 | forceDisplay?: boolean;
21 | fsHidden?: boolean;
22 | customPermissionFnc?: any;
23 | }
24 |
--------------------------------------------------------------------------------
/web-app/src/screens/Console/ObjectBrowser/FilterObjectsSB.tsx:
--------------------------------------------------------------------------------
1 | // This file is part of MinIO Console Server
2 | // Copyright (c) 2023 MinIO, Inc.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU Affero General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Affero General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU Affero General Public License
15 | // along with this program. If not, see .
16 |
17 | import React from "react";
18 | import { setSearchObjects } from "./objectBrowserSlice";
19 | import SearchBox from "../Common/SearchBox";
20 | import { AppState, useAppDispatch } from "../../../store";
21 | import { useSelector } from "react-redux";
22 |
23 | const FilterObjectsSB = () => {
24 | const dispatch = useAppDispatch();
25 |
26 | const searchObjects = useSelector(
27 | (state: AppState) => state.objectBrowser.searchObjects,
28 | );
29 | return (
30 | {
33 | dispatch(setSearchObjects(value));
34 | }}
35 | value={searchObjects}
36 | />
37 | );
38 | };
39 | export default FilterObjectsSB;
40 |
--------------------------------------------------------------------------------
/web-app/src/screens/Console/ObjectBrowser/transferManager.ts:
--------------------------------------------------------------------------------
1 | // This file is part of MinIO Console Server
2 | // Copyright (c) 2022 MinIO, Inc.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU Affero General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Affero General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU Affero General Public License
15 | // along with this program. If not, see .
16 |
17 | let objectCalls: { [key: string]: XMLHttpRequest } = {};
18 | let formDataElements: { [key: string]: FormData } = {};
19 |
20 | export const storeCallForObjectWithID = (id: string, call: any) => {
21 | objectCalls[id] = call;
22 | };
23 |
24 | export const callForObjectID = (id: string): any => {
25 | return objectCalls[id];
26 | };
27 |
28 | export const storeFormDataWithID = (id: string, formData: FormData) => {
29 | formDataElements[id] = formData;
30 | };
31 |
32 | export const formDataFromID = (id: string): FormData => {
33 | return formDataElements[id];
34 | };
35 |
36 | export const removeTrace = (id: string) => {
37 | delete objectCalls[id];
38 | delete formDataElements[id];
39 | };
40 |
41 | export const makeid = (length: number) => {
42 | var result = "";
43 | var characters =
44 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
45 | var charactersLength = characters.length;
46 | for (var i = 0; i < length; i++) {
47 | result += characters.charAt(Math.floor(Math.random() * charactersLength));
48 | }
49 | return result;
50 | };
51 |
--------------------------------------------------------------------------------
/web-app/src/screens/Console/consoleSlice.types.ts:
--------------------------------------------------------------------------------
1 | // This file is part of MinIO Console Server
2 | // Copyright (c) 2023 MinIO, Inc.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU Affero General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Affero General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU Affero General Public License
15 | // along with this program. If not, see .
16 |
17 | export enum SessionCallStates {
18 | Initial = "initial",
19 | Loading = "loading",
20 | Done = "done",
21 | }
22 |
--------------------------------------------------------------------------------
/web-app/src/screens/Console/kbar-actions.tsx:
--------------------------------------------------------------------------------
1 | // This file is part of MinIO Console Server
2 | // Copyright (c) 2022 MinIO, Inc.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU Affero General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Affero General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU Affero General Public License
15 | // along with this program. If not, see .
16 |
17 | import { Action } from "kbar/lib/types";
18 | import { BucketsIcon } from "mds";
19 | import { Bucket } from "../../api/consoleApi";
20 |
21 | export const routesAsKbarActions = (
22 | buckets: Bucket[],
23 | navigate: (url: string) => void,
24 | ) => {
25 | const initialActions: Action[] = [];
26 |
27 | if (buckets) {
28 | buckets.map((buck) => [
29 | initialActions.push({
30 | id: buck.name,
31 | name: buck.name,
32 | section: "List of Buckets",
33 | perform: () => {
34 | navigate(`/browser/${buck.name}`);
35 | },
36 | icon: ,
37 | }),
38 | ]);
39 | }
40 |
41 | return initialActions;
42 | };
43 |
--------------------------------------------------------------------------------
/web-app/src/screens/LoginPage/login.types.ts:
--------------------------------------------------------------------------------
1 | // This file is part of MinIO Console Server
2 | // Copyright (c) 2021 MinIO, Inc.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU Affero General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Affero General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU Affero General Public License
15 | // along with this program. If not, see .
16 |
17 | export enum loginStrategyType {
18 | unknown = "unknown",
19 | form = "form",
20 | redirect = "redirect",
21 | serviceAccount = "service-account",
22 | redirectServiceAccount = "redirect-service-account",
23 | }
24 |
--------------------------------------------------------------------------------
/web-app/src/screens/LoginPage/login.utils.ts:
--------------------------------------------------------------------------------
1 | // This file is part of MinIO Console Server
2 | // Copyright (c) 2023 MinIO, Inc.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU Affero General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Affero General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU Affero General Public License
15 | // along with this program. If not, see .
16 |
17 | import { RedirectRule } from "api/consoleApi";
18 |
19 | export const redirectRules = (a: RedirectRule, b: RedirectRule) => {
20 | if (a.displayName && b.displayName) {
21 | if (a.displayName > b.displayName) {
22 | return 1;
23 | }
24 | if (a.displayName < b.displayName) {
25 | return -1;
26 | }
27 | }
28 | return 0;
29 | };
30 |
--------------------------------------------------------------------------------
/web-app/src/types.ts:
--------------------------------------------------------------------------------
1 | // This file is part of MinIO Console Server
2 | // Copyright (c) 2021 MinIO, Inc.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU Affero General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Affero General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU Affero General Public License
15 |
16 | // along with this program. If not, see .
17 | export interface snackBarMessage {
18 | message: string;
19 | detailedErrorMsg: string;
20 | type: "message" | "error";
21 | }
22 |
23 | export interface SRInfoStateType {
24 | enabled: boolean;
25 | curSite: boolean;
26 | siteName: string;
27 | }
28 |
--------------------------------------------------------------------------------
/web-app/src/utils/matchMedia.js:
--------------------------------------------------------------------------------
1 | Object.defineProperty(window, "matchMedia", {
2 | writable: true,
3 | value: jest.fn().mockImplementation((query) => ({
4 | matches: false,
5 | media: query,
6 | onchange: null,
7 | addListener: jest.fn(), // Deprecated
8 | removeListener: jest.fn(), // Deprecated
9 | addEventListener: jest.fn(),
10 | removeEventListener: jest.fn(),
11 | dispatchEvent: jest.fn(),
12 | })),
13 | });
14 |
--------------------------------------------------------------------------------
/web-app/src/utils/validationFunctions.ts:
--------------------------------------------------------------------------------
1 | // This file is part of MinIO Console Server
2 | // Copyright (c) 2021 MinIO, Inc.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU Affero General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Affero General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU Affero General Public License
15 | // along with this program. If not, see .
16 |
17 | export const isVersionedMode = (status: string | undefined) => {
18 | return status === "Enabled" || status === "Suspended";
19 | };
20 |
--------------------------------------------------------------------------------
/web-app/src/utils/wsUtils.ts:
--------------------------------------------------------------------------------
1 | // This file is part of MinIO Console Server
2 | // Copyright (c) 2021 MinIO, Inc.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU Affero General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Affero General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU Affero General Public License
15 | // along with this program. If not, see .
16 |
17 | export const wsProtocol = (protocol: string): string => {
18 | let wsProtocol = "ws";
19 | if (protocol === "https:") {
20 | wsProtocol = "wss";
21 | }
22 | return wsProtocol;
23 | };
24 |
--------------------------------------------------------------------------------
/web-app/tests/constants/timestamp.txt:
--------------------------------------------------------------------------------
1 | 1737352766
2 |
--------------------------------------------------------------------------------
/web-app/tests/policies/bucketAssignPolicy.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Action": [
6 | "s3:PutBucketPolicy",
7 | "s3:DeleteBucketPolicy",
8 | "s3:GetBucketPolicy",
9 | "s3:ListBucket"
10 | ],
11 | "Effect": "Allow",
12 | "Resource": ["arn:aws:s3:::*"],
13 | "Sid": ""
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/web-app/tests/policies/bucketCannotTag.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Effect": "Allow",
6 | "Action": ["s3:*"],
7 | "Resource": ["arn:aws:s3:::*"]
8 | },
9 | {
10 | "Action": ["s3:PutObjectTagging", "s3:DeleteObjectTagging"],
11 | "Effect": "Deny",
12 | "Sid": "Deny_Tagging_Actions",
13 | "Resource": ["arn:aws:s3:::*"]
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/web-app/tests/policies/bucketRead.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Action": [
6 | "s3:ListMultipartUploadParts",
7 | "s3:ListBucketMultipartUploads",
8 | "s3:ListBucket",
9 | "s3:HeadBucket",
10 | "s3:GetObject",
11 | "s3:GetBucketLocation"
12 | ],
13 | "Effect": "Allow",
14 | "Resource": ["arn:aws:s3:::*"],
15 | "Sid": ""
16 | }
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/web-app/tests/policies/bucketReadWrite.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Effect": "Allow",
6 | "Action": ["s3:*"],
7 | "Resource": ["arn:aws:s3:::*"]
8 | }
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/web-app/tests/policies/bucketSpecific.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Effect": "Allow",
6 | "Action": ["s3:*"],
7 | "Resource": [
8 | "arn:aws:s3:::specific-bucket-1/*",
9 | "arn:aws:s3:::specific-bucket-2/*",
10 | "arn:aws:s3:::specific-bucket-3/*",
11 | "arn:aws:s3:::specific-bucket-4/*",
12 | "arn:aws:s3:::specific-bucket-5/*",
13 | "arn:aws:s3:::specific-bucket-6/*",
14 | "arn:aws:s3:::specific-bucket-7/*",
15 | "arn:aws:s3:::specific-bucket-8/*",
16 | "arn:aws:s3:::specific-bucket-9/*",
17 | "arn:aws:s3:::specific-bucket-10/*"
18 | ]
19 | },
20 | {
21 | "Effect": "Allow",
22 | "Action": ["s3:GetBucketLocation", "s3:ListAllMyBuckets"],
23 | "Resource": ["arn:aws:s3:::specific-bucket-11/*"]
24 | },
25 | {
26 | "Effect": "Allow",
27 | "Action": ["s3:CreateBucket"],
28 | "Resource": [
29 | "arn:aws:s3:::specific-bucket-1",
30 | "arn:aws:s3:::specific-bucket-2",
31 | "arn:aws:s3:::specific-bucket-3",
32 | "arn:aws:s3:::specific-bucket-4",
33 | "arn:aws:s3:::specific-bucket-5",
34 | "arn:aws:s3:::specific-bucket-6",
35 | "arn:aws:s3:::specific-bucket-7",
36 | "arn:aws:s3:::specific-bucket-8",
37 | "arn:aws:s3:::specific-bucket-9",
38 | "arn:aws:s3:::specific-bucket-10",
39 | "arn:aws:s3:::specific-bucket-11"
40 | ]
41 | }
42 | ]
43 | }
44 |
--------------------------------------------------------------------------------
/web-app/tests/policies/bucketWrite.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Action": [
6 | "s3:AbortMultipartUpload",
7 | "s3:CreateBucket",
8 | "s3:PutObject",
9 | "s3:DeleteObject",
10 | "s3:DeleteBucket"
11 | ],
12 | "Effect": "Allow",
13 | "Resource": ["arn:aws:s3:::*"],
14 | "Sid": ""
15 | }
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/web-app/tests/policies/bucketWritePrefixOnlyPolicy.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Action": ["s3:ListBucket", "s3:GetBucketLocation"],
6 | "Effect": "Allow",
7 | "Resource": ["arn:aws:s3:::testcafe"]
8 | },
9 | {
10 | "Action": ["s3:ListBucket", "s3:GetObject"],
11 | "Effect": "Allow",
12 | "Resource": ["arn:aws:s3:::testcafe/*"]
13 | },
14 | {
15 | "Action": [
16 | "s3:ListBucket",
17 | "s3:GetObject",
18 | "s3:PutObject",
19 | "s3:DeleteObject"
20 | ],
21 | "Effect": "Allow",
22 | "Resource": ["arn:aws:s3:::testcafe/write/*"]
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/web-app/tests/policies/conditionsPolicy.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Sid": "read-only",
6 | "Effect": "Allow",
7 | "Action": ["s3:GetBucketLocation"],
8 | "Resource": ["arn:aws:s3:::testcondition"]
9 | },
10 | {
11 | "Sid": "read",
12 | "Effect": "Allow",
13 | "Action": ["s3:GetObject"],
14 | "Resource": ["arn:aws:s3:::testcondition/firstlevel/*"]
15 | },
16 | {
17 | "Sid": "statement2",
18 | "Effect": "Allow",
19 | "Action": ["s3:ListBucket"],
20 | "Resource": ["arn:aws:s3:::testcondition"],
21 | "Condition": {
22 | "StringLike": {
23 | "s3:prefix": ["firstlevel/*"]
24 | }
25 | }
26 | }
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/web-app/tests/policies/conditionsPolicy2.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Sid": "read-only",
6 | "Effect": "Allow",
7 | "Action": ["s3:GetBucketLocation"],
8 | "Resource": ["arn:aws:s3:::testcondition"]
9 | },
10 | {
11 | "Sid": "read",
12 | "Effect": "Allow",
13 | "Action": ["s3:GetObject"],
14 | "Resource": ["arn:aws:s3:::testcondition/firstlevel/*"]
15 | },
16 | {
17 | "Sid": "statement2",
18 | "Effect": "Allow",
19 | "Action": ["s3:ListBucket"],
20 | "Resource": ["arn:aws:s3:::testcondition"],
21 | "Condition": {
22 | "StringLike": {
23 | "s3:prefix": ["firstlevel/secondlevel/thirdlevel/*"]
24 | }
25 | }
26 | }
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/web-app/tests/policies/conditionsPolicy3.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Sid": "AllowUserToSeeBucketListInTheConsole",
6 | "Action": ["s3:ListAllMyBuckets", "s3:GetBucketLocation"],
7 | "Effect": "Allow",
8 | "Resource": ["arn:aws:s3:::*"]
9 | },
10 | {
11 | "Sid": "AllowRootAndHomeListingOfCompanyBucket",
12 | "Action": ["s3:ListBucket"],
13 | "Effect": "Allow",
14 | "Resource": ["arn:aws:s3:::my-company"],
15 | "Condition": {
16 | "StringEquals": {
17 | "s3:prefix": ["", "home/", "home/User"],
18 | "s3:delimiter": ["/"]
19 | }
20 | }
21 | },
22 | {
23 | "Sid": "AllowListingOfUserFolder",
24 | "Action": ["s3:ListBucket"],
25 | "Effect": "Allow",
26 | "Resource": ["arn:aws:s3:::my-company"],
27 | "Condition": { "StringLike": { "s3:prefix": ["home/User/*"] } }
28 | },
29 | {
30 | "Sid": "AllowAllS3ActionsInUserFolder",
31 | "Effect": "Allow",
32 | "Action": ["s3:*"],
33 | "Resource": ["arn:aws:s3:::my-company/home/User/*"]
34 | }
35 | ]
36 | }
37 |
--------------------------------------------------------------------------------
/web-app/tests/policies/conditionsPolicy4.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Sid": "AllowUserToSeeBucketListInTheConsole",
6 | "Action": [
7 | "s3:ListAllMyBuckets",
8 | "s3:GetBucketLocation",
9 | "s3:GetBucketVersioning"
10 | ],
11 | "Effect": "Allow",
12 | "Resource": ["arn:aws:s3:::*"]
13 | },
14 | {
15 | "Sid": "AllowRootAndHomeListingOfCompanyBucket",
16 | "Action": ["s3:ListBucket", "s3:List*"],
17 | "Effect": "Allow",
18 | "Resource": ["arn:aws:s3:::my-company2"],
19 | "Condition": {
20 | "StringEquals": {
21 | "s3:prefix": ["", "home/", "home/User"],
22 | "s3:delimiter": ["/"]
23 | }
24 | }
25 | },
26 | {
27 | "Sid": "AllowListingOfUserFolder",
28 | "Action": ["s3:ListBucket", "s3:List*"],
29 | "Effect": "Allow",
30 | "Resource": ["arn:aws:s3:::my-company2"],
31 | "Condition": {
32 | "StringLike": {
33 | "s3:prefix": ["home/User/*"]
34 | }
35 | }
36 | },
37 | {
38 | "Sid": "AllowAllS3ActionsInUserFolder",
39 | "Effect": "Allow",
40 | "Action": ["s3:*"],
41 | "Resource": ["arn:aws:s3:::my-company2/home/User/*"]
42 | }
43 | ]
44 | }
45 |
--------------------------------------------------------------------------------
/web-app/tests/policies/dashboard.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Action": ["admin:ServerInfo"],
6 | "Effect": "Allow",
7 | "Sid": ""
8 | }
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/web-app/tests/policies/deleteObjectWithPrefix.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Effect": "Allow",
6 | "Action": ["s3:ListBucket"],
7 | "Resource": ["arn:aws:s3:::testbucket-*-test-1/*"]
8 | },
9 | {
10 | "Effect": "Allow",
11 | "Action": ["s3:GetBucketLocation"],
12 | "Resource": ["arn:aws:s3:::testbucket-*-test-1"]
13 | },
14 | {
15 | "Effect": "Allow",
16 | "Action": ["s3:*"],
17 | "Resource": [
18 | "arn:aws:s3:::testbucket-*-test-1/digitalinsights/xref_cust_guid_actd*"
19 | ]
20 | },
21 |
22 | {
23 | "Effect": "Allow",
24 | "Action": ["s3:ListBucket"],
25 | "Resource": ["arn:aws:s3:::testbucket-*-test-2/*"]
26 | },
27 | {
28 | "Effect": "Allow",
29 | "Action": ["s3:GetBucketLocation"],
30 | "Resource": ["arn:aws:s3:::testbucket-*-test-2"]
31 | },
32 | {
33 | "Effect": "Allow",
34 | "Action": ["s3:*"],
35 | "Resource": [
36 | "arn:aws:s3:::testbucket-*-test-2/digitalinsights/xref_cust_guid_actd*"
37 | ]
38 | },
39 |
40 | {
41 | "Effect": "Allow",
42 | "Action": ["s3:ListBucket"],
43 | "Resource": ["arn:aws:s3:::testbucket-*-test-3/*"]
44 | },
45 | {
46 | "Effect": "Allow",
47 | "Action": ["s3:GetBucketLocation"],
48 | "Resource": ["arn:aws:s3:::testbucket-*-test-3"]
49 | },
50 | {
51 | "Effect": "Allow",
52 | "Action": ["s3:*"],
53 | "Resource": [
54 | "arn:aws:s3:::testbucket-*-test-3/digitalinsights/xref_cust_guid_actd*"
55 | ]
56 | }
57 | ]
58 | }
59 |
--------------------------------------------------------------------------------
/web-app/tests/policies/diagnostics.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Action": ["admin:OBDInfo"],
6 | "Effect": "Allow",
7 | "Sid": ""
8 | }
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/web-app/tests/policies/fix-prefix-policy-ui-crash.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Effect": "Deny",
6 | "Action": ["admin:*"]
7 | },
8 | {
9 | "Effect": "Allow",
10 | "Action": ["s3:GetBucketLocation", "s3:ListBucket"],
11 | "Resource": ["arn:aws:s3:::*testcafe/*"]
12 | },
13 | {
14 | "Effect": "Allow",
15 | "Action": ["s3:GetObject", "s3:ListBucket"],
16 | "Resource": ["arn:aws:s3:::*testcafe/write/*"]
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/web-app/tests/policies/groups.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Action": [
6 | "admin:ListGroups",
7 | "admin:AddUserToGroup",
8 | "admin:EnableGroup",
9 | "admin:DisableGroup",
10 | "admin:RemoveUserFromGroup",
11 | "admin:GetGroup",
12 | "admin:ListUsers"
13 | ],
14 | "Effect": "Allow",
15 | "Sid": ""
16 | }
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/web-app/tests/policies/iamPolicies.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Action": [
6 | "admin:GetPolicy",
7 | "admin:DeletePolicy",
8 | "admin:CreatePolicy",
9 | "admin:AttachUserOrGroupPolicy",
10 | "admin:ListUserPolicies"
11 | ],
12 | "Effect": "Allow",
13 | "Sid": ""
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/web-app/tests/policies/inspect-allowed.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Action": ["admin:*"],
6 | "Effect": "Allow",
7 | "Sid": "Allow_Admin_Actions"
8 | },
9 | {
10 | "Action": ["s3:*"],
11 | "Effect": "Allow",
12 | "Resource": ["arn:aws:s3:::*"],
13 | "Sid": "Allow_S3_Actions"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/web-app/tests/policies/inspect-not-allowed.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Action": ["admin:*"],
6 | "Effect": "Deny",
7 | "Sid": "Deny_Admin_Actions"
8 | },
9 | {
10 | "Action": ["s3:*"],
11 | "Effect": "Allow",
12 | "Resource": ["arn:aws:s3:::*"],
13 | "Sid": "Allow_S3_Actions"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/web-app/tests/policies/logs.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Action": ["admin:ConsoleLog"],
6 | "Effect": "Allow",
7 | "Sid": ""
8 | }
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/web-app/tests/policies/notificationEndpoints.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Action": ["admin:ConfigUpdate"],
6 | "Effect": "Allow",
7 | "Sid": ""
8 | }
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/web-app/tests/policies/rewind-allowed.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Effect": "Deny",
6 | "Action": ["s3:CreateBucket", "s3:DeleteBucket"],
7 | "Resource": ["arn:aws:s3:::*"]
8 | },
9 | {
10 | "Effect": "Allow",
11 | "Action": ["s3:ListBucket"],
12 | "Resource": ["arn:aws:s3:::bucketname"]
13 | },
14 | {
15 | "Effect": "Allow",
16 | "Action": ["s3:GetBucketLocation", "s3:GetBucketVersioning"],
17 | "Resource": ["arn:aws:s3:::bucketname"]
18 | },
19 | {
20 | "Effect": "Allow",
21 | "Action": ["s3:GetObject"],
22 | "Resource": [
23 | "arn:aws:s3:::bucketname/firstlevel",
24 | "arn:aws:s3:::bucketname/firstlevel/*"
25 | ]
26 | },
27 | {
28 | "Effect": "Allow",
29 | "Action": ["s3:*"],
30 | "Resource": [
31 | "arn:aws:s3:::bucketname/firstlevel/secondlevel*",
32 | "arn:aws:s3:::bucketname/firstlevel/secondlevel/*"
33 | ]
34 | }
35 | ]
36 | }
37 |
--------------------------------------------------------------------------------
/web-app/tests/policies/rewind-not-allowed.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Effect": "Deny",
6 | "Action": ["s3:CreateBucket", "s3:DeleteBucket"],
7 | "Resource": ["arn:aws:s3:::*"]
8 | },
9 | {
10 | "Effect": "Allow",
11 | "Action": ["s3:ListBucket"],
12 | "Resource": ["arn:aws:s3:::bucketname"]
13 | },
14 | {
15 | "Effect": "Allow",
16 | "Action": ["s3:GetBucketLocation"],
17 | "Resource": ["arn:aws:s3:::bucketname"]
18 | },
19 | {
20 | "Effect": "Allow",
21 | "Action": ["s3:GetObject"],
22 | "Resource": [
23 | "arn:aws:s3:::bucketname/firstlevel",
24 | "arn:aws:s3:::bucketname/firstlevel/*"
25 | ]
26 | },
27 | {
28 | "Effect": "Allow",
29 | "Action": ["s3:*"],
30 | "Resource": [
31 | "arn:aws:s3:::bucketname/firstlevel/secondlevel*",
32 | "arn:aws:s3:::bucketname/firstlevel/secondlevel/*"
33 | ]
34 | }
35 | ]
36 | }
37 |
--------------------------------------------------------------------------------
/web-app/tests/policies/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Action": ["admin:ConfigUpdate"],
6 | "Effect": "Allow",
7 | "Sid": ""
8 | }
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/web-app/tests/policies/tiers.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Action": ["admin:ListTier", "admin:SetTier"],
6 | "Effect": "Allow",
7 | "Sid": ""
8 | }
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/web-app/tests/policies/trace.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Action": ["admin:ServerTrace"],
6 | "Effect": "Allow",
7 | "Sid": ""
8 | }
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/web-app/tests/policies/users.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Action": [
6 | "admin:ListUsers",
7 | "admin:CreateUser",
8 | "admin:DeleteUser",
9 | "admin:GetUser",
10 | "admin:EnableUser",
11 | "admin:DisableUser",
12 | "admin:ListUserPolicies",
13 | "admin:ListGroups",
14 | "admin:GetPolicy",
15 | "admin:AttachUserOrGroupPolicy",
16 | "admin:AddUserToGroup",
17 | "admin:RemoveUserFromGroup",
18 | "admin:GetGroup"
19 | ],
20 | "Effect": "Allow",
21 | "Resource": ["arn:aws:s3:::*"],
22 | "Sid": ""
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/web-app/tests/policies/watch.json:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Statement": [
4 | {
5 | "Action": ["s3:ListenBucketNotification", "s3:ListBucket"],
6 | "Effect": "Allow",
7 | "Resource": ["arn:aws:s3:::*"],
8 | "Sid": ""
9 | }
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/web-app/tests/scripts/resources/kustomization.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: kustomize.config.k8s.io/v1beta1
2 | kind: Kustomization
3 | namespace: minio-operator
4 |
5 | images:
6 | - name: minio/operator
7 |
8 | resources:
9 | - github.com/minio/operator/resources/
10 |
--------------------------------------------------------------------------------
/web-app/tests/scripts/tenant-kes-encryption/kustomization.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: kustomize.config.k8s.io/v1beta1
2 | kind: Kustomization
3 | namespace: tenant-kms-encrypted
4 |
5 | images:
6 | - name: minio/operator
7 |
8 | resources:
9 | - github.com/minio/operator/examples/kustomization/tenant-kes-encryption
10 |
--------------------------------------------------------------------------------
/web-app/tests/scripts/tenant-lite/kustomization.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: kustomize.config.k8s.io/v1beta1
2 | kind: Kustomization
3 | namespace: tenant-lite
4 |
5 | images:
6 | - name: minio/operator
7 |
8 | resources:
9 | - github.com/minio/operator/examples/kustomization/tenant-lite
10 |
--------------------------------------------------------------------------------
/web-app/tests/subpath-nginx/nginx.conf:
--------------------------------------------------------------------------------
1 | events { worker_connections 1024; }
2 | http {
3 | server {
4 | listen 8000;
5 | location /console/subpath/ {
6 | rewrite ^/console/subpath/(.*) /$1 break;
7 | proxy_pass http://host.docker.internal:9090;
8 |
9 | proxy_http_version 1.1;
10 | proxy_set_header Upgrade $http_upgrade;
11 | proxy_set_header Connection "Upgrade";
12 | proxy_set_header Host $host;
13 | proxy_set_header X-Real-IP $remote_addr;
14 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
15 | proxy_set_header X-Forwarded-Proto $scheme;
16 |
17 | # This allows WebSocket connections
18 | proxy_set_header Upgrade $http_upgrade;
19 | proxy_set_header Connection "upgrade";
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/web-app/tests/subpath-nginx/test-unauthenticated-user.ts:
--------------------------------------------------------------------------------
1 | // This file is part of MinIO Console Server
2 | // Copyright (c) 2023 MinIO, Inc.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU Affero General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Affero General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU Affero General Public License
15 | // along with this program. If not, see .
16 |
17 | import * as elements from "../utils/elements";
18 |
19 | // Using subpath defined in `MINIO_BROWSER_REDIRECT_URL`
20 | const appBaseUrl = "http://localhost:8000/console/subpath";
21 | let rootUrl = `${appBaseUrl}/`;
22 |
23 | fixture("Tests using subpath").page(appBaseUrl);
24 |
25 | test("RootUrl redirects to Login Page", async (t) => {
26 | const loginButtonExists = elements.loginButton.exists;
27 | await t.navigateTo(rootUrl).expect(loginButtonExists).ok().wait(2000);
28 | });
29 |
--------------------------------------------------------------------------------
/web-app/tests/uploads/file1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minio/object-browser/ecce0930624eca719cb7fd44c4758751d8718432/web-app/tests/uploads/file1.pdf
--------------------------------------------------------------------------------
/web-app/tests/uploads/filescript.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minio/object-browser/ecce0930624eca719cb7fd44c4758751d8718432/web-app/tests/uploads/filescript.pdf
--------------------------------------------------------------------------------
/web-app/tests/uploads/internode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/minio/object-browser/ecce0930624eca719cb7fd44c4758751d8718432/web-app/tests/uploads/internode.png
--------------------------------------------------------------------------------
/web-app/tests/uploads/noextension:
--------------------------------------------------------------------------------
1 | a demo file
2 |
--------------------------------------------------------------------------------
/web-app/tests/uploads/test.txt:
--------------------------------------------------------------------------------
1 | test
--------------------------------------------------------------------------------
/web-app/tests/utils/constants.ts:
--------------------------------------------------------------------------------
1 | // This file is part of MinIO Console Server
2 | // Copyright (c) 2022 MinIO, Inc.
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU Affero General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU Affero General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU Affero General Public License
15 | // along with this program. If not, see .
16 | import { readFileSync } from "fs";
17 |
18 | const data = readFileSync(__dirname + "/../constants/timestamp.txt", "utf-8");
19 | const unixTimestamp = data.trim();
20 |
21 | export const TEST_BUCKET_NAME = "testbucket-" + unixTimestamp;
22 | export const TEST_GROUP_NAME = "testgroup-" + unixTimestamp;
23 | export const TEST_USER_NAME = "testuser-" + unixTimestamp;
24 | export const TEST_PASSWORD = "password";
25 | export const TEST_IAM_POLICY_NAME = "testpolicy-" + unixTimestamp;
26 | export const TEST_IAM_POLICY = JSON.stringify({
27 | Version: "2012-10-17",
28 | Statement: [
29 | {
30 | Action: ["admin:*"],
31 | Effect: "Allow",
32 | Sid: "",
33 | },
34 | {
35 | Action: ["s3:*"],
36 | Effect: "Allow",
37 | Resource: ["arn:aws:s3:::*"],
38 | Sid: "",
39 | },
40 | ],
41 | });
42 | export const TEST_ASSIGN_POLICY_NAME = "consoleAdmin";
43 |
--------------------------------------------------------------------------------
/web-app/tsconfig.dev.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "jsx": "react-jsxdev"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/web-app/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2015",
4 | "lib": ["dom", "dom.iterable", "esnext"],
5 | "allowJs": true,
6 | "skipLibCheck": true,
7 | "esModuleInterop": true,
8 | "allowSyntheticDefaultImports": true,
9 | "strict": true,
10 | "forceConsistentCasingInFileNames": true,
11 | "module": "esnext",
12 | "moduleResolution": "node",
13 | "resolveJsonModule": true,
14 | "isolatedModules": true,
15 | "noEmit": true,
16 | "jsx": "react-jsx",
17 | "downlevelIteration": true,
18 | "noFallthroughCasesInSwitch": true,
19 | "baseUrl": "./src",
20 | "rootDir": "./src"
21 | },
22 | "include": ["src"]
23 | }
24 |
--------------------------------------------------------------------------------
/yarn.lock:
--------------------------------------------------------------------------------
1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2 | # yarn lockfile v1
3 |
4 |
5 |
--------------------------------------------------------------------------------