github.com/minio/console@v1.4.1/web-app/tests/utils/constants.ts (about)

     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 <http://www.gnu.org/licenses/>.
    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";