Compare commits
287 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74030aa067 | ||
|
|
07b8c745e6 | ||
|
|
6767bfa2d2 | ||
|
|
607d94fef4 | ||
|
|
83b060ef94 | ||
|
|
cb14cb94ce | ||
|
|
2b9de49fbe | ||
|
|
290f273bdf | ||
|
|
7b43779fb0 | ||
|
|
924c38faa6 | ||
|
|
e4d5f9610e | ||
|
|
04e9cb0ac8 | ||
|
|
da53daff37 | ||
|
|
8c26eff2c1 | ||
|
|
044c265423 | ||
|
|
0053658d5d | ||
|
|
99cf3b378f | ||
|
|
78293eab62 | ||
|
|
1a84be5782 | ||
|
|
178f82b675 | ||
|
|
ec5fbbcd1e | ||
|
|
78164054d4 | ||
|
|
6d5d11d5b4 | ||
|
|
9e3b93d385 | ||
|
|
d77cf93193 | ||
|
|
2cca3f3722 | ||
|
|
36d96a1791 | ||
|
|
82e34a5df2 | ||
|
|
7b83f4b1dc | ||
|
|
7d9910d1ca | ||
|
|
7a63f6da56 | ||
|
|
0043833f36 | ||
|
|
3ad3bccadb | ||
|
|
39e94c890e | ||
|
|
701039454a | ||
|
|
ec77a03d7c | ||
|
|
8dbad84a58 | ||
|
|
1767a37162 | ||
|
|
622c3a067a | ||
|
|
4389548b64 | ||
|
|
8cb0f1e558 | ||
|
|
faafb77c73 | ||
|
|
0ecd1c73c1 | ||
|
|
88bf40f9a6 | ||
|
|
a025163b34 | ||
|
|
07c80462b7 | ||
|
|
79ac2277d4 | ||
|
|
1c27bee9d0 | ||
|
|
56dc58b0b8 | ||
|
|
4018addd79 | ||
|
|
429dfb4314 | ||
|
|
1d7bb0bb2b | ||
|
|
476eb673bb | ||
|
|
71681b710c | ||
|
|
fb02a7da06 | ||
|
|
5fdc341138 | ||
|
|
15de6caf75 | ||
|
|
77bc2d5006 | ||
|
|
972f5fca9d | ||
|
|
083314ee2d | ||
|
|
078ce0e546 | ||
|
|
9beca2c226 | ||
|
|
451f23ae24 | ||
|
|
300ebfa19f | ||
|
|
1ce2846c95 | ||
|
|
7fb8c11a9d | ||
|
|
e7993c2d1b | ||
|
|
3e93f7ff88 | ||
|
|
f0580956db | ||
|
|
65b0bab26d | ||
|
|
a559421293 | ||
|
|
6ef35c26a4 | ||
|
|
8a918324aa | ||
|
|
d30c0c8cbb | ||
|
|
1697c826c0 | ||
|
|
b378b8c8ef | ||
|
|
2c42d7ff81 | ||
|
|
e1f36ee54a | ||
|
|
698f72f828 | ||
|
|
8dd94f5336 | ||
|
|
1dc21b9a21 | ||
|
|
248215cc77 | ||
|
|
a6eee73c11 | ||
|
|
50d6a39312 | ||
|
|
467b6b9bcb | ||
|
|
6e6246797c | ||
|
|
f8e4f747f5 | ||
|
|
9acd49fcc6 | ||
|
|
636d12d43f | ||
|
|
5e9383de95 | ||
|
|
4863af863e | ||
|
|
b6d4c62edd | ||
|
|
bf733f3822 | ||
|
|
bbf4027418 | ||
|
|
dbffc5fc22 | ||
|
|
f4a9420002 | ||
|
|
657854bd29 | ||
|
|
cdc9e7d921 | ||
|
|
b125121ac8 | ||
|
|
0c480dd5ec | ||
|
|
c07b8dcf73 | ||
|
|
912a4b216f | ||
|
|
e7fb205c31 | ||
|
|
a2ba20e12f | ||
|
|
f515dd82fe | ||
|
|
61d3193c41 | ||
|
|
430ae66955 | ||
|
|
3abbbc82b2 | ||
|
|
854181f63e | ||
|
|
df996794ed | ||
|
|
2d94018e3c | ||
|
|
72bb9d0ca1 | ||
|
|
93bd0d65e2 | ||
|
|
495b0f0068 | ||
|
|
3275b6a6d8 | ||
|
|
fed5aa1599 | ||
|
|
6bc4efbac1 | ||
|
|
cc0164a67b | ||
|
|
b968cc25ad | ||
|
|
d116a35a6d | ||
|
|
49f856bdd5 | ||
|
|
0d628f589a | ||
|
|
4387b2149f | ||
|
|
8cc602434e | ||
|
|
6411dc9504 | ||
|
|
32c34b0a11 | ||
|
|
6e8f5e0fc2 | ||
|
|
3ce377dbd1 | ||
|
|
ad502b9f18 | ||
|
|
fde186a5a3 | ||
|
|
0823f623c8 | ||
|
|
6cec113304 | ||
|
|
cd42d77a46 | ||
|
|
35907beaca | ||
|
|
a062a59288 | ||
|
|
842c2decd0 | ||
|
|
d1069ed359 | ||
|
|
6d81a1b1f8 | ||
|
|
b2fe478dae | ||
|
|
02ed6a6e8b | ||
|
|
1b271ab467 | ||
|
|
bacb5f8901 | ||
|
|
ae7371da95 | ||
|
|
60f5eb603b | ||
|
|
420ed00f55 | ||
|
|
b975871e9d | ||
|
|
803ffe2960 | ||
|
|
c96c95924c | ||
|
|
f02786001c | ||
|
|
542b7192c3 | ||
|
|
b31aa10b52 | ||
|
|
1eba59954d | ||
|
|
b71d9f05c5 | ||
|
|
fc5e94d55f | ||
|
|
3875fb3eaa | ||
|
|
b3d4132fe6 | ||
|
|
21f20bb9ea | ||
|
|
df937467a0 | ||
|
|
d1ae271111 | ||
|
|
e7fb3e0e45 | ||
|
|
b7b0271ec7 | ||
|
|
9935b839b7 | ||
|
|
0e11098c31 | ||
|
|
c55e0a069b | ||
|
|
c3da876b04 | ||
|
|
643a9c6c7c | ||
|
|
0c3a94172d | ||
|
|
527eb16700 | ||
|
|
e3aec3f094 | ||
|
|
eac2734df4 | ||
|
|
a411e7c977 | ||
|
|
28c4abe2d0 | ||
|
|
a9ef6ebf5f | ||
|
|
c12415c12d | ||
|
|
1f481e690b | ||
|
|
58aad859e1 | ||
|
|
b9ebfe09ee | ||
|
|
864cf7af99 | ||
|
|
b76f460979 | ||
|
|
cbd2c4682d | ||
|
|
d49bdf7d49 | ||
|
|
559a7278a0 | ||
|
|
4a172fae97 | ||
|
|
fc4263e2f9 | ||
|
|
c1b9b4c81b | ||
|
|
aa9b73522e | ||
|
|
0904f83627 | ||
|
|
253053cc23 | ||
|
|
08a3ff65c7 | ||
|
|
ee8fac8be8 | ||
|
|
9fa49b40b3 | ||
|
|
de13119e02 | ||
|
|
bf9acd7691 | ||
|
|
a5066fecc8 | ||
|
|
6432681440 | ||
|
|
b3b6df9d82 | ||
|
|
fe7be4ef62 | ||
|
|
b4603547f6 | ||
|
|
b33b9315ea | ||
|
|
6ae03fa028 | ||
|
|
e1bb1e0472 | ||
|
|
411670e4f5 | ||
|
|
1c55932f84 | ||
|
|
5a77054d6b | ||
|
|
84c5fd58f9 | ||
|
|
98979911ee | ||
|
|
c0cf7358c7 | ||
|
|
9053e64dff | ||
|
|
57bfe97d08 | ||
|
|
028570279c | ||
|
|
bda1cd1f25 | ||
|
|
7a9b775b09 | ||
|
|
17e791afb9 | ||
|
|
920fc7d937 | ||
|
|
6e314a2fa5 | ||
|
|
dc90db6591 | ||
|
|
beed4895c1 | ||
|
|
629dd669c4 | ||
|
|
fc9319e55b | ||
|
|
58b64a5739 | ||
|
|
d93537261e | ||
|
|
22ec87d00e | ||
|
|
b87b4156e7 | ||
|
|
93f010b880 | ||
|
|
c5d4cdf1bc | ||
|
|
c117601e53 | ||
|
|
f78f838ed9 | ||
|
|
1583b69fb7 | ||
|
|
cde6d1b0e0 | ||
|
|
be60569a14 | ||
|
|
51226a74d0 | ||
|
|
e983473a54 | ||
|
|
211ab3fd9d | ||
|
|
90c8ea7f09 | ||
|
|
fb5193d896 | ||
|
|
f7a7f01d7d | ||
|
|
2c84a52937 | ||
|
|
6020590b2f | ||
|
|
1477def4fe | ||
|
|
8882f1da0e | ||
|
|
056d487f1c | ||
|
|
b8083215b3 | ||
|
|
61c864e748 | ||
|
|
0e0f5030da | ||
|
|
0dacc4d49e | ||
|
|
4d783c5e42 | ||
|
|
75b3a6bea4 | ||
|
|
29507cda7e | ||
|
|
81e0c82fee | ||
|
|
7519fad6dd | ||
|
|
248a59ee8c | ||
|
|
cefb6d3c95 | ||
|
|
543076eaac | ||
|
|
cbf1ddeb4c | ||
|
|
3746adcc13 | ||
|
|
854b984850 | ||
|
|
62fa0e2043 | ||
|
|
4f5b1b0aa7 | ||
|
|
0e362c2106 | ||
|
|
6ac5be32b2 | ||
|
|
6966183bc8 | ||
|
|
60d70e3668 | ||
|
|
5e65f2aced | ||
|
|
1e345364cf | ||
|
|
502a6c462f | ||
|
|
ceafdb9cb4 | ||
|
|
a6d8f6beaa | ||
|
|
fa1f84bd0a | ||
|
|
72a1e5eefb | ||
|
|
f20fa0b1c8 | ||
|
|
07b7af59b6 | ||
|
|
c9ac525358 | ||
|
|
8b1b2b1e2d | ||
|
|
ad0591ec17 | ||
|
|
59c47d98dd | ||
|
|
cb38a545ce | ||
|
|
dd356b6ea9 | ||
|
|
c1d39a910f | ||
|
|
eb3913ba48 | ||
|
|
f7efbc66f7 | ||
|
|
f368d9936a | ||
|
|
5cb4e6f651 | ||
|
|
f7f7b087c4 | ||
|
|
4cceee8936 | ||
|
|
5262c02a28 | ||
|
|
fd81529ddc | ||
|
|
383341ad61 |
48
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
48
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: community, triage
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
## NOTE
|
||||
If this case is urgent, please subscribe to [Subnet](https://min.io/pricing) so that our 24/7 support team may help you faster.
|
||||
|
||||
<!--- Provide a general summary of the issue in the title above -->
|
||||
|
||||
## Expected Behavior
|
||||
<!--- If you're describing a bug, tell us what should happen -->
|
||||
<!--- If you're suggesting a change/improvement, tell us how it should work -->
|
||||
|
||||
## Current Behavior
|
||||
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
|
||||
<!--- If suggesting a change/improvement, explain the difference from current behavior -->
|
||||
|
||||
## Possible Solution
|
||||
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
|
||||
<!--- or ideas how to implement the addition or change -->
|
||||
|
||||
## Steps to Reproduce (for bugs)
|
||||
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
|
||||
<!--- reproduce this bug. Include code to reproduce, if relevant -->
|
||||
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
4.
|
||||
|
||||
## Context
|
||||
<!--- How has this issue affected you? What are you trying to accomplish? -->
|
||||
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
|
||||
|
||||
## Regression
|
||||
<!-- Is this issue a regression? (Yes / No) -->
|
||||
<!-- If Yes, optionally please include the MinIO version or commit id or PR# that caused this regression, if you have these details. -->
|
||||
|
||||
## Your Environment
|
||||
<!--- Include as many relevant details about the environment you experienced the bug in -->
|
||||
* MinIO version used (`minio --version`):
|
||||
* Server setup and configuration:
|
||||
* Operating System and version (`uname -a`):
|
||||
166
.github/workflows/cross-compile.yaml
vendored
Normal file
166
.github/workflows/cross-compile.yaml
vendored
Normal file
@@ -0,0 +1,166 @@
|
||||
# @format
|
||||
|
||||
name: Cross Compile
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- go.sum
|
||||
|
||||
# This ensures that previous jobs for the PR are canceled when the PR is
|
||||
# updated.
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
cross-compile-1:
|
||||
name: Cross compile
|
||||
needs:
|
||||
- lint-job
|
||||
- ui-assets
|
||||
- reuse-golang-dependencies
|
||||
- semgrep-static-code-analysis
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.21.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
cache: true
|
||||
id: go
|
||||
|
||||
- name: Build on ${{ matrix.os }}
|
||||
env:
|
||||
GO111MODULE: on
|
||||
GOOS: linux
|
||||
run: |
|
||||
make crosscompile arg1="'linux/ppc64le linux/mips64'"
|
||||
|
||||
cross-compile-2:
|
||||
name: Cross compile 2
|
||||
needs:
|
||||
- lint-job
|
||||
- ui-assets
|
||||
- reuse-golang-dependencies
|
||||
- semgrep-static-code-analysis
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.21.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
cache: true
|
||||
id: go
|
||||
|
||||
- name: Build on ${{ matrix.os }}
|
||||
env:
|
||||
GO111MODULE: on
|
||||
GOOS: linux
|
||||
run: |
|
||||
make crosscompile arg1="'linux/arm64 linux/s390x'"
|
||||
|
||||
cross-compile-3:
|
||||
name: Cross compile 3
|
||||
needs:
|
||||
- lint-job
|
||||
- ui-assets
|
||||
- reuse-golang-dependencies
|
||||
- semgrep-static-code-analysis
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.21.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
cache: true
|
||||
id: go
|
||||
|
||||
- name: Build on ${{ matrix.os }}
|
||||
env:
|
||||
GO111MODULE: on
|
||||
GOOS: linux
|
||||
run: |
|
||||
make crosscompile arg1="'darwin/amd64 freebsd/amd64'"
|
||||
|
||||
cross-compile-4:
|
||||
name: Cross compile 4
|
||||
needs:
|
||||
- lint-job
|
||||
- ui-assets
|
||||
- reuse-golang-dependencies
|
||||
- semgrep-static-code-analysis
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.21.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
cache: true
|
||||
id: go
|
||||
|
||||
- name: Build on ${{ matrix.os }}
|
||||
env:
|
||||
GO111MODULE: on
|
||||
GOOS: linux
|
||||
run: |
|
||||
make crosscompile arg1="'windows/amd64 linux/arm'"
|
||||
|
||||
cross-compile-5:
|
||||
name: Cross compile 5
|
||||
needs:
|
||||
- lint-job
|
||||
- ui-assets
|
||||
- reuse-golang-dependencies
|
||||
- semgrep-static-code-analysis
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.21.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
cache: true
|
||||
id: go
|
||||
|
||||
- name: Build on ${{ matrix.os }}
|
||||
env:
|
||||
GO111MODULE: on
|
||||
GOOS: linux
|
||||
run: |
|
||||
make crosscompile arg1="'linux/386 netbsd/amd64'"
|
||||
18
.github/workflows/issues.yaml
vendored
Normal file
18
.github/workflows/issues.yaml
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
# @format
|
||||
|
||||
name: Issue Workflow
|
||||
|
||||
on:
|
||||
issues:
|
||||
types:
|
||||
- opened
|
||||
|
||||
jobs:
|
||||
add-to-project:
|
||||
name: Add issue to project
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/add-to-project@v0.5.0
|
||||
with:
|
||||
project-url: https://github.com/orgs/miniohq/projects/2
|
||||
github-token: ${{ secrets.BOT_PAT }}
|
||||
591
.github/workflows/jobs.yaml
vendored
591
.github/workflows/jobs.yaml
vendored
@@ -1,3 +1,5 @@
|
||||
# @format
|
||||
|
||||
name: Workflow
|
||||
|
||||
on:
|
||||
@@ -15,15 +17,13 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
|
||||
|
||||
lint-job:
|
||||
name: Checking Lint
|
||||
runs-on: [ ubuntu-latest ]
|
||||
runs-on: [ubuntu-latest]
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
@@ -42,32 +42,12 @@ jobs:
|
||||
run: |
|
||||
make verifiers
|
||||
|
||||
vulnerable-dependencies-checks:
|
||||
name: "Check for vulnerable dependencies"
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19 ]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
cache: true
|
||||
check-latest: true
|
||||
- name: Get govulncheck
|
||||
run: go install golang.org/x/vuln/cmd/govulncheck@latest
|
||||
shell: bash
|
||||
- name: Run govulncheck
|
||||
run: govulncheck ./...
|
||||
shell: bash
|
||||
semgrep-static-code-analysis:
|
||||
name: "semgrep checks"
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ ubuntu-latest ]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out source code
|
||||
uses: actions/checkout@v3
|
||||
@@ -80,14 +60,13 @@ jobs:
|
||||
pip3 install semgrep
|
||||
semgrep --config semgrep.yaml $(pwd)/portal-ui --error
|
||||
|
||||
|
||||
ui-assets:
|
||||
name: "React Code Has No Warnings & Prettified"
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
@@ -97,7 +76,7 @@ jobs:
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ env.NVMRC }}
|
||||
cache: 'yarn'
|
||||
cache: "yarn"
|
||||
cache-dependency-path: portal-ui/yarn.lock
|
||||
- uses: actions/cache@v3
|
||||
id: assets-cache
|
||||
@@ -121,13 +100,18 @@ jobs:
|
||||
continue-on-error: false
|
||||
run: |
|
||||
./check-prettier.sh
|
||||
- name: Check for dead code
|
||||
working-directory: ./portal-ui
|
||||
continue-on-error: false
|
||||
run: |
|
||||
./check-deadcode.sh
|
||||
reuse-golang-dependencies:
|
||||
name: reuse golang dependencies
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
@@ -146,10 +130,10 @@ jobs:
|
||||
|
||||
latest-minio:
|
||||
name: Build latest MinIO
|
||||
runs-on: [ ubuntu-latest ]
|
||||
runs-on: [ubuntu-latest]
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
go-version: [1.21.x]
|
||||
steps:
|
||||
# To build minio image, we need to clone the repository first
|
||||
- name: Clone github.com/minio/minio
|
||||
@@ -184,8 +168,8 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
@@ -215,42 +199,66 @@ jobs:
|
||||
GOOS: linux
|
||||
run: |
|
||||
make console
|
||||
|
||||
|
||||
|
||||
react-code-known-vulnerabilities:
|
||||
name: "React Code Has No Known Vulnerable Deps"
|
||||
|
||||
test-nginx-subpath:
|
||||
name: Test Subpath with Nginx
|
||||
needs:
|
||||
- ui-assets
|
||||
runs-on: ubuntu-latest
|
||||
- compile-binary
|
||||
runs-on: [ubuntu-latest]
|
||||
timeout-minutes: 10
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ env.NVMRC }}
|
||||
cache: 'yarn'
|
||||
cache-dependency-path: portal-ui/yarn.lock
|
||||
- name: Checks for known security issues with the installed packages
|
||||
working-directory: ./portal-ui
|
||||
- name: Install MinIO JS
|
||||
working-directory: ./
|
||||
continue-on-error: false
|
||||
run: |
|
||||
yarn audit
|
||||
yarn add minio
|
||||
|
||||
- uses: actions/cache@v3
|
||||
name: Console Binary Cache
|
||||
with:
|
||||
path: |
|
||||
./console
|
||||
key: ${{ runner.os }}-binary-${{ github.run_id }}
|
||||
|
||||
- name: clean-previous-containers-if-any
|
||||
run: |
|
||||
docker stop minio || true;
|
||||
docker container prune -f || true;
|
||||
|
||||
- name: Start Console, MinIO and Nginx
|
||||
run: |
|
||||
(CONSOLE_SUBPATH=/console/subpath ./console server ) & (make test-initialize-minio-nginx)
|
||||
|
||||
- name: Install TestCafe
|
||||
run: npm install testcafe@3.0.0
|
||||
|
||||
- name: Run TestCafe Tests
|
||||
run: npx testcafe "chrome:headless" portal-ui/tests/subpath-nginx/ -q --skip-js-errors -c 3
|
||||
|
||||
- name: Clean up docker
|
||||
if: always()
|
||||
run: |
|
||||
make cleanup-minio-nginx
|
||||
|
||||
all-permissions-1:
|
||||
name: Permissions Tests Part 1
|
||||
needs:
|
||||
- compile-binary
|
||||
runs-on: [ ubuntu-latest ]
|
||||
runs-on: [ubuntu-latest]
|
||||
timeout-minutes: 10
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
@@ -279,10 +287,11 @@ jobs:
|
||||
run: |
|
||||
(./console server) & (make initialize-permissions)
|
||||
|
||||
- name: Install TestCafe
|
||||
run: npm install testcafe@3.0.0
|
||||
|
||||
- name: Run TestCafe Tests
|
||||
uses: DevExpress/testcafe-action@latest
|
||||
with:
|
||||
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-1/ --skip-js-errors -c 3'
|
||||
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-1/ -q --skip-js-errors -c 3
|
||||
|
||||
- name: Clean up users & policies
|
||||
run: |
|
||||
@@ -292,12 +301,12 @@ jobs:
|
||||
name: Permissions Tests Part 2
|
||||
needs:
|
||||
- compile-binary
|
||||
runs-on: [ ubuntu-latest ]
|
||||
runs-on: [ubuntu-latest]
|
||||
timeout-minutes: 10
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
@@ -325,10 +334,11 @@ jobs:
|
||||
run: |
|
||||
(./console server) & (make initialize-permissions)
|
||||
|
||||
- name: Install TestCafe
|
||||
run: npm install testcafe@3.0.0
|
||||
|
||||
- name: Run TestCafe Tests
|
||||
uses: DevExpress/testcafe-action@latest
|
||||
with:
|
||||
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-2/ --skip-js-errors -c 3'
|
||||
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-2/ -q --skip-js-errors -c 3
|
||||
|
||||
- name: Clean up users & policies
|
||||
run: |
|
||||
@@ -338,12 +348,12 @@ jobs:
|
||||
name: Permissions Tests Part 3
|
||||
needs:
|
||||
- compile-binary
|
||||
runs-on: [ ubuntu-latest ]
|
||||
runs-on: [ubuntu-latest]
|
||||
timeout-minutes: 10
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
@@ -371,26 +381,26 @@ jobs:
|
||||
run: |
|
||||
(./console server) & (make initialize-permissions)
|
||||
|
||||
- name: Install TestCafe
|
||||
run: npm install testcafe@3.0.0
|
||||
|
||||
- name: Run TestCafe Tests
|
||||
uses: DevExpress/testcafe-action@latest
|
||||
with:
|
||||
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-3/ --skip-js-errors -c 3'
|
||||
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-3/ -q --skip-js-errors -c 3
|
||||
|
||||
- name: Clean up users & policies
|
||||
run: |
|
||||
make cleanup-permissions
|
||||
|
||||
|
||||
all-permissions-4:
|
||||
name: Permissions Tests Part 4
|
||||
needs:
|
||||
- compile-binary
|
||||
runs-on: [ ubuntu-latest ]
|
||||
runs-on: [ubuntu-latest]
|
||||
timeout-minutes: 15
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
@@ -417,20 +427,23 @@ jobs:
|
||||
- name: Start Console, front-end app and initialize users/policies
|
||||
run: |
|
||||
(./console server) & (make initialize-permissions)
|
||||
|
||||
- name: Install TestCafe
|
||||
run: npm install testcafe@3.0.0
|
||||
|
||||
- name: Run TestCafe Tests
|
||||
timeout-minutes: 10
|
||||
uses: DevExpress/testcafe-action@latest
|
||||
with:
|
||||
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-4/ --skip-js-errors'
|
||||
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-4/ --skip-js-errors
|
||||
|
||||
all-permissions-5:
|
||||
name: Permissions Tests Part 5
|
||||
needs:
|
||||
- compile-binary
|
||||
runs-on: [ ubuntu-latest ]
|
||||
runs-on: [ubuntu-latest]
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
@@ -457,20 +470,23 @@ jobs:
|
||||
- name: Start Console, front-end app and initialize users/policies
|
||||
run: |
|
||||
(./console server) & (make initialize-permissions)
|
||||
|
||||
- name: Install TestCafe
|
||||
run: npm install testcafe@3.0.0
|
||||
|
||||
- name: Run TestCafe Tests
|
||||
timeout-minutes: 5
|
||||
uses: DevExpress/testcafe-action@latest
|
||||
with:
|
||||
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-5/ --skip-js-errors'
|
||||
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-5/ --skip-js-errors
|
||||
|
||||
all-permissions-6:
|
||||
name: Permissions Tests Part 6
|
||||
needs:
|
||||
- compile-binary
|
||||
runs-on: [ ubuntu-latest ]
|
||||
runs-on: [ubuntu-latest]
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
@@ -497,20 +513,23 @@ jobs:
|
||||
- name: Start Console, front-end app and initialize users/policies
|
||||
run: |
|
||||
(./console server) & (make initialize-permissions)
|
||||
|
||||
- name: Install TestCafe
|
||||
run: npm install testcafe@3.0.0
|
||||
|
||||
- name: Run TestCafe Tests
|
||||
timeout-minutes: 5
|
||||
uses: DevExpress/testcafe-action@latest
|
||||
with:
|
||||
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-6/ --skip-js-errors'
|
||||
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-6/ --skip-js-errors
|
||||
|
||||
all-permissions-7:
|
||||
name: Permissions Tests Part 7
|
||||
needs:
|
||||
- compile-binary
|
||||
runs-on: [ ubuntu-latest ]
|
||||
runs-on: [ubuntu-latest]
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
@@ -537,20 +556,22 @@ jobs:
|
||||
- name: Start Console, front-end app and initialize users/policies
|
||||
run: |
|
||||
(./console server) & (make initialize-permissions)
|
||||
- name: Install TestCafe
|
||||
run: npm install testcafe@3.0.0
|
||||
|
||||
- name: Run TestCafe Tests
|
||||
timeout-minutes: 5
|
||||
uses: DevExpress/testcafe-action@latest
|
||||
with:
|
||||
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-7/ --skip-js-errors'
|
||||
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-7/ --skip-js-errors
|
||||
|
||||
all-permissions-8:
|
||||
name: Permissions Tests Part 8
|
||||
needs:
|
||||
- compile-binary
|
||||
runs-on: [ ubuntu-latest ]
|
||||
runs-on: [ubuntu-latest]
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
@@ -577,20 +598,23 @@ jobs:
|
||||
- name: Start Console, front-end app and initialize users/policies
|
||||
run: |
|
||||
(./console server) & (make initialize-permissions)
|
||||
|
||||
- name: Install TestCafe
|
||||
run: npm install testcafe@3.0.0
|
||||
|
||||
- name: Run TestCafe Tests
|
||||
timeout-minutes: 5
|
||||
uses: DevExpress/testcafe-action@latest
|
||||
with:
|
||||
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-8/ --skip-js-errors'
|
||||
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-8/ --skip-js-errors
|
||||
|
||||
all-permissions-9:
|
||||
name: Permissions Tests Part 9
|
||||
needs:
|
||||
- compile-binary
|
||||
runs-on: [ ubuntu-latest ]
|
||||
runs-on: [ubuntu-latest]
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
@@ -618,10 +642,11 @@ jobs:
|
||||
run: |
|
||||
(./console server) & (make initialize-permissions)
|
||||
|
||||
- name: Install TestCafe
|
||||
run: npm install testcafe@3.0.0
|
||||
|
||||
- name: Run TestCafe Tests
|
||||
uses: DevExpress/testcafe-action@latest
|
||||
with:
|
||||
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-9/ --skip-js-errors -c 3'
|
||||
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-9/ --skip-js-errors -c 3
|
||||
|
||||
- name: Clean up users & policies
|
||||
run: |
|
||||
@@ -631,11 +656,11 @@ jobs:
|
||||
name: Permissions Tests Part A
|
||||
needs:
|
||||
- compile-binary
|
||||
runs-on: [ ubuntu-latest ]
|
||||
runs-on: [ubuntu-latest]
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
@@ -663,10 +688,11 @@ jobs:
|
||||
run: |
|
||||
(./console server) & (make initialize-permissions)
|
||||
|
||||
- name: Install TestCafe
|
||||
run: npm install testcafe@3.0.0
|
||||
|
||||
- name: Run TestCafe Tests
|
||||
uses: DevExpress/testcafe-action@latest
|
||||
with:
|
||||
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-A/ --skip-js-errors -c 3'
|
||||
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-A/ --skip-js-errors -c 3
|
||||
|
||||
- name: Clean up users & policies
|
||||
run: |
|
||||
@@ -676,11 +702,11 @@ jobs:
|
||||
name: Permissions Tests Part B
|
||||
needs:
|
||||
- compile-binary
|
||||
runs-on: [ ubuntu-latest ]
|
||||
runs-on: [ubuntu-latest]
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
@@ -708,169 +734,16 @@ jobs:
|
||||
run: |
|
||||
(./console server) & (make initialize-permissions)
|
||||
|
||||
- name: Install TestCafe
|
||||
run: npm install testcafe@3.0.0
|
||||
|
||||
- name: Run TestCafe Tests
|
||||
uses: DevExpress/testcafe-action@latest
|
||||
with:
|
||||
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-B/ --skip-js-errors -c 3'
|
||||
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-B/ --skip-js-errors -c 3
|
||||
|
||||
- name: Clean up users & policies
|
||||
run: |
|
||||
make cleanup-permissions
|
||||
|
||||
cross-compile-1:
|
||||
name: Cross compile
|
||||
needs:
|
||||
- lint-job
|
||||
- ui-assets
|
||||
- reuse-golang-dependencies
|
||||
- semgrep-static-code-analysis
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
cache: true
|
||||
id: go
|
||||
|
||||
|
||||
- name: Build on ${{ matrix.os }}
|
||||
env:
|
||||
GO111MODULE: on
|
||||
GOOS: linux
|
||||
run: |
|
||||
make crosscompile arg1="'linux/ppc64le linux/mips64'"
|
||||
|
||||
cross-compile-2:
|
||||
name: Cross compile 2
|
||||
needs:
|
||||
- lint-job
|
||||
- ui-assets
|
||||
- reuse-golang-dependencies
|
||||
- semgrep-static-code-analysis
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
cache: true
|
||||
id: go
|
||||
|
||||
|
||||
- name: Build on ${{ matrix.os }}
|
||||
env:
|
||||
GO111MODULE: on
|
||||
GOOS: linux
|
||||
run: |
|
||||
make crosscompile arg1="'linux/arm64 linux/s390x'"
|
||||
|
||||
cross-compile-3:
|
||||
name: Cross compile 3
|
||||
needs:
|
||||
- lint-job
|
||||
- ui-assets
|
||||
- reuse-golang-dependencies
|
||||
- semgrep-static-code-analysis
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
cache: true
|
||||
id: go
|
||||
|
||||
|
||||
- name: Build on ${{ matrix.os }}
|
||||
env:
|
||||
GO111MODULE: on
|
||||
GOOS: linux
|
||||
run: |
|
||||
make crosscompile arg1="'darwin/amd64 freebsd/amd64'"
|
||||
|
||||
cross-compile-4:
|
||||
name: Cross compile 4
|
||||
needs:
|
||||
- lint-job
|
||||
- ui-assets
|
||||
- reuse-golang-dependencies
|
||||
- semgrep-static-code-analysis
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
cache: true
|
||||
id: go
|
||||
|
||||
|
||||
- name: Build on ${{ matrix.os }}
|
||||
env:
|
||||
GO111MODULE: on
|
||||
GOOS: linux
|
||||
run: |
|
||||
make crosscompile arg1="'windows/amd64 linux/arm'"
|
||||
|
||||
cross-compile-5:
|
||||
name: Cross compile 5
|
||||
needs:
|
||||
- lint-job
|
||||
- ui-assets
|
||||
- reuse-golang-dependencies
|
||||
- semgrep-static-code-analysis
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
cache: true
|
||||
id: go
|
||||
|
||||
|
||||
- name: Build on ${{ matrix.os }}
|
||||
env:
|
||||
GO111MODULE: on
|
||||
GOOS: linux
|
||||
run: |
|
||||
make crosscompile arg1="'linux/386 netbsd/amd64'"
|
||||
|
||||
test-pkg-on-go:
|
||||
name: Test Pkg on Go ${{ matrix.go-version }} and ${{ matrix.os }}
|
||||
needs:
|
||||
@@ -881,8 +754,8 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
@@ -918,8 +791,8 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
@@ -931,7 +804,6 @@ jobs:
|
||||
cache: true
|
||||
id: go
|
||||
|
||||
|
||||
- name: Build on ${{ matrix.os }}
|
||||
env:
|
||||
GO111MODULE: on
|
||||
@@ -958,7 +830,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
go-version: [1.21.x]
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
@@ -967,7 +839,7 @@ jobs:
|
||||
uses: actions/checkout@master
|
||||
with:
|
||||
repository: minio/minio
|
||||
path: 'minio_repository'
|
||||
path: "minio_repository"
|
||||
- uses: actions/cache@v3
|
||||
id: minio-latest-cache
|
||||
name: MinIO Latest Cache
|
||||
@@ -1003,7 +875,7 @@ jobs:
|
||||
echo "We are going to use the built image on test-integration";
|
||||
VERSION="minio/minio:$VERSION";
|
||||
echo $VERSION;
|
||||
|
||||
|
||||
echo "Create bucket for replication with versioning"
|
||||
echo "Download mc for Ubuntu"
|
||||
wget -q https://dl.min.io/client/mc/release/linux-amd64/mc
|
||||
@@ -1036,7 +908,6 @@ jobs:
|
||||
working-directory: ./portal-ui
|
||||
run: yarn test
|
||||
replication:
|
||||
|
||||
name: Site Replication Test
|
||||
needs:
|
||||
- lint-job
|
||||
@@ -1044,11 +915,11 @@ jobs:
|
||||
- reuse-golang-dependencies
|
||||
- semgrep-static-code-analysis
|
||||
- latest-minio
|
||||
runs-on: [ ubuntu-latest ]
|
||||
runs-on: [ubuntu-latest]
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
go-version: [1.21.x]
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
@@ -1065,7 +936,7 @@ jobs:
|
||||
uses: actions/checkout@master
|
||||
with:
|
||||
repository: minio/minio
|
||||
path: 'minio_repository'
|
||||
path: "minio_repository"
|
||||
- uses: actions/cache@v3
|
||||
id: minio-latest-cache
|
||||
name: MinIO Latest Cache
|
||||
@@ -1110,8 +981,8 @@ jobs:
|
||||
with:
|
||||
name: replication-artifact
|
||||
path: ./replication/coverage/replication.out
|
||||
if-no-files-found: error
|
||||
sso-integration:
|
||||
|
||||
name: SSO Integration Test
|
||||
needs:
|
||||
- lint-job
|
||||
@@ -1123,7 +994,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
go-version: [1.21.x]
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
@@ -1140,7 +1011,7 @@ jobs:
|
||||
uses: actions/checkout@master
|
||||
with:
|
||||
repository: minio/minio
|
||||
path: 'minio_repository'
|
||||
path: "minio_repository"
|
||||
- uses: actions/cache@v3
|
||||
id: minio-latest-cache
|
||||
name: MinIO Latest Cache
|
||||
@@ -1194,8 +1065,8 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.19.x ]
|
||||
os: [ ubuntu-latest ]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
@@ -1298,7 +1169,7 @@ jobs:
|
||||
go tool cover -func=all.out | grep total > tmp2
|
||||
result=`cat tmp2 | awk 'END {print $3}'`
|
||||
result=${result%\%}
|
||||
threshold=69.4
|
||||
threshold=71.3
|
||||
echo "Result:"
|
||||
echo "$result%"
|
||||
if (( $(echo "$result >= $threshold" |bc -l) )); then
|
||||
@@ -1307,3 +1178,145 @@ jobs:
|
||||
echo "It is smaller than threshold ($threshold%) value, failed!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ui-assets-istanbul-coverage:
|
||||
name: "Assets with Istanbul Plugin for coverage"
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
- name: Read .nvmrc
|
||||
id: node_version
|
||||
run: echo "$(cat .nvmrc)" && echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_ENV
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ env.NVMRC }}
|
||||
cache: "yarn"
|
||||
cache-dependency-path: portal-ui/yarn.lock
|
||||
- uses: actions/cache@v3
|
||||
id: assets-cache-istanbul-coverage
|
||||
name: Assets Cache Istanbul Coverage
|
||||
with:
|
||||
path: |
|
||||
./portal-ui/build/
|
||||
key: ${{ runner.os }}-assets-istanbul-coverage-${{ github.run_id }}
|
||||
- name: Install Dependencies
|
||||
working-directory: ./portal-ui
|
||||
continue-on-error: false
|
||||
run: |
|
||||
yarn install --frozen-lockfile --immutable
|
||||
- name: Check for Warnings in build output
|
||||
working-directory: ./portal-ui
|
||||
continue-on-error: false
|
||||
run: |
|
||||
./check-warnings-istanbul-coverage.sh
|
||||
|
||||
compile-binary-istanbul-coverage:
|
||||
name: "Compile Console Binary with Istanbul Plugin for Coverage"
|
||||
needs:
|
||||
- lint-job
|
||||
- ui-assets-istanbul-coverage
|
||||
- reuse-golang-dependencies
|
||||
- semgrep-static-code-analysis
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
cache: true
|
||||
id: go
|
||||
- uses: actions/cache@v3
|
||||
name: Console Binary Cache Istanbul Coverage
|
||||
with:
|
||||
path: |
|
||||
./console
|
||||
key: ${{ runner.os }}-binary-istanbul-coverage-${{ github.run_id }}
|
||||
- uses: actions/cache@v3
|
||||
id: assets-cache-istanbul-coverage
|
||||
name: Assets Cache Istanbul Coverage
|
||||
with:
|
||||
path: |
|
||||
./portal-ui/build/
|
||||
key: ${{ runner.os }}-assets-istanbul-coverage-${{ github.run_id }}
|
||||
- name: Build on ${{ matrix.os }}
|
||||
env:
|
||||
GO111MODULE: on
|
||||
GOOS: linux
|
||||
run: |
|
||||
make console
|
||||
|
||||
playwright:
|
||||
needs:
|
||||
- compile-binary-istanbul-coverage
|
||||
timeout-minutes: 60
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
echo "Install dependencies"
|
||||
cd $GITHUB_WORKSPACE/portal-ui
|
||||
yarn add -D playwright
|
||||
yarn add -D babel-plugin-istanbul
|
||||
yarn add -D nyc
|
||||
yarn add -D react-app-rewired
|
||||
yarn add -D create-react-app
|
||||
yarn add -D @playwright/test
|
||||
yarn init -y
|
||||
echo "yarn install"
|
||||
yarn install
|
||||
|
||||
- name: Install Playwright Browsers
|
||||
run: npx playwright install --with-deps
|
||||
|
||||
- uses: actions/cache@v3
|
||||
name: Console Binary Cache Istanbul Coverage
|
||||
with:
|
||||
path: |
|
||||
./console
|
||||
key: ${{ runner.os }}-binary-istanbul-coverage-${{ github.run_id }}
|
||||
|
||||
- name: Start Console, front-end app and initialize users/policies
|
||||
run: |
|
||||
(./console server) & (make initialize-permissions)
|
||||
|
||||
- name: Run Playwright tests
|
||||
run: |
|
||||
echo "Run tests under playwright folder only"
|
||||
cd $GITHUB_WORKSPACE/portal-ui
|
||||
yarn remove playwright
|
||||
yarn add --dev @playwright/test
|
||||
echo "npx playwright test"
|
||||
npx playwright test # To run the tests
|
||||
echo "npx nyc report"
|
||||
npx nyc report # To see report printed in logs as text
|
||||
echo "npx nyc report --reporter=html"
|
||||
npx nyc report --reporter=html # to see report in ./coverage/index.html
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
name: playwright-report
|
||||
path: playwright-report/
|
||||
retention-days: 30
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage/
|
||||
retention-days: 30
|
||||
|
||||
53
.github/workflows/vulncheck.yaml
vendored
Normal file
53
.github/workflows/vulncheck.yaml
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
# @format
|
||||
|
||||
name: Vulnerability Check
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
permissions:
|
||||
contents: read # to fetch code (actions/checkout)
|
||||
|
||||
jobs:
|
||||
vulncheck:
|
||||
name: Analysis
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 1.21.5
|
||||
check-latest: true
|
||||
- name: Get official govulncheck
|
||||
run: go install golang.org/x/vuln/cmd/govulncheck@latest
|
||||
shell: bash
|
||||
- name: Run govulncheck
|
||||
run: govulncheck ./...
|
||||
shell: bash
|
||||
|
||||
react-code-known-vulnerabilities:
|
||||
name: "React Code Has No Known Vulnerable Deps"
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.21.5 ]
|
||||
os: [ ubuntu-latest ]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ env.NVMRC }}
|
||||
cache: "yarn"
|
||||
cache-dependency-path: portal-ui/yarn.lock
|
||||
- name: Checks for known security issues with the installed packages
|
||||
working-directory: ./portal-ui
|
||||
continue-on-error: false
|
||||
run: |
|
||||
yarn audit --groups dependencies
|
||||
10
.gitignore
vendored
10
.gitignore
vendored
@@ -1,3 +1,13 @@
|
||||
# Playwright Data
|
||||
portal-ui/storage/
|
||||
portal-ui/playwright/.auth/admin.json
|
||||
|
||||
# Report from Playwright
|
||||
portal-ui/playwright-report/
|
||||
|
||||
# Coverage from Playwright
|
||||
portal-ui/.nyc_output/
|
||||
|
||||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.exe~
|
||||
|
||||
@@ -23,8 +23,8 @@ linters:
|
||||
- gomodguard
|
||||
- gofmt
|
||||
- unused
|
||||
- staticcheck
|
||||
- unconvert
|
||||
- varcheck
|
||||
- gocritic
|
||||
- gofumpt
|
||||
- durationcheck
|
||||
|
||||
191
.goreleaser.yml
191
.goreleaser.yml
@@ -1,191 +0,0 @@
|
||||
# This is an example goreleaser.yaml file with some sane defaults.
|
||||
# Make sure to check the documentation at http://goreleaser.com
|
||||
project_name: console
|
||||
|
||||
release:
|
||||
name_template: "Release version {{.Tag}}"
|
||||
github:
|
||||
owner: minio
|
||||
name: console
|
||||
extra_files:
|
||||
- glob: "*.minisig"
|
||||
|
||||
before:
|
||||
hooks:
|
||||
# you may remove this if you don't use vgo
|
||||
- go mod tidy -compat=1.19
|
||||
|
||||
builds:
|
||||
- goos:
|
||||
- linux
|
||||
- darwin
|
||||
- windows
|
||||
goarch:
|
||||
- amd64
|
||||
- ppc64le
|
||||
- s390x
|
||||
- arm64
|
||||
ignore:
|
||||
- goos: darwin
|
||||
goarch: arm
|
||||
- goos: windows
|
||||
goarch: arm64
|
||||
- goos: windows
|
||||
goarch: arm
|
||||
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
|
||||
main: ./cmd/console/
|
||||
|
||||
flags:
|
||||
- -trimpath
|
||||
- --tags=kqueue,operator
|
||||
|
||||
ldflags:
|
||||
- -s -w -X github.com/minio/console/pkg.ReleaseTag={{.Tag}} -X github.com/minio/console/pkg.CommitID={{.FullCommit}} -X github.com/minio/console/pkg.Version={{.Version}} -X github.com/minio/console/pkg.ShortCommitID={{.ShortCommit}} -X github.com/minio/console/pkg.ReleaseTime={{.Date}}
|
||||
|
||||
archives:
|
||||
- name_template: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}"
|
||||
format: binary
|
||||
replacements:
|
||||
arm: arm
|
||||
|
||||
signs:
|
||||
- signature: "${artifact}.minisig"
|
||||
cmd: "sh"
|
||||
args:
|
||||
- '-c'
|
||||
- 'minisign -s /media/${USER}/minio/minisign.key -Sm ${artifact} < /media/${USER}/minio/minisign-passphrase'
|
||||
artifacts: all
|
||||
|
||||
snapshot:
|
||||
name_template: v0.0.0@{{.ShortCommit}}
|
||||
|
||||
changelog:
|
||||
sort: asc
|
||||
|
||||
nfpms:
|
||||
- vendor: MinIO, Inc.
|
||||
homepage: https://github.com/minio/console
|
||||
maintainer: MinIO Development <dev@min.io>
|
||||
description: MinIO Console Server
|
||||
license: GNU Affero General Public License v3.0
|
||||
formats:
|
||||
- deb
|
||||
- rpm
|
||||
contents:
|
||||
# Basic file that applies to all packagers
|
||||
- src: systemd/console.service
|
||||
dst: /etc/systemd/system/minio-console.service
|
||||
|
||||
dockers:
|
||||
- image_templates:
|
||||
- "minio/console:{{ .Tag }}-amd64"
|
||||
use: buildx
|
||||
goarch: amd64
|
||||
dockerfile: Dockerfile.release
|
||||
extra_files:
|
||||
- LICENSE
|
||||
- CREDITS
|
||||
build_flag_templates:
|
||||
- "--platform=linux/amd64"
|
||||
- "--build-arg=TAG={{ .Tag }}"
|
||||
- image_templates:
|
||||
- "minio/console:{{ .Tag }}-ppc64le"
|
||||
use: buildx
|
||||
goarch: ppc64le
|
||||
dockerfile: Dockerfile.release
|
||||
extra_files:
|
||||
- LICENSE
|
||||
- CREDITS
|
||||
build_flag_templates:
|
||||
- "--platform=linux/ppc64le"
|
||||
- "--build-arg=TAG={{ .Tag }}"
|
||||
- image_templates:
|
||||
- "minio/console:{{ .Tag }}-s390x"
|
||||
use: buildx
|
||||
goarch: s390x
|
||||
dockerfile: Dockerfile.release
|
||||
extra_files:
|
||||
- LICENSE
|
||||
- CREDITS
|
||||
build_flag_templates:
|
||||
- "--platform=linux/s390x"
|
||||
- "--build-arg=TAG={{ .Tag }}"
|
||||
- image_templates:
|
||||
- "minio/console:{{ .Tag }}-arm64"
|
||||
use: buildx
|
||||
goarch: arm64
|
||||
goos: linux
|
||||
dockerfile: Dockerfile.release
|
||||
extra_files:
|
||||
- LICENSE
|
||||
- CREDITS
|
||||
build_flag_templates:
|
||||
- "--platform=linux/arm64"
|
||||
- "--build-arg=TAG={{ .Tag }}"
|
||||
- image_templates:
|
||||
- "quay.io/minio/console:{{ .Tag }}-amd64"
|
||||
use: buildx
|
||||
goarch: amd64
|
||||
dockerfile: Dockerfile.release
|
||||
extra_files:
|
||||
- LICENSE
|
||||
- CREDITS
|
||||
build_flag_templates:
|
||||
- "--platform=linux/amd64"
|
||||
- "--build-arg=TAG={{ .Tag }}"
|
||||
- image_templates:
|
||||
- "quay.io/minio/console:{{ .Tag }}-ppc64le"
|
||||
use: buildx
|
||||
goarch: ppc64le
|
||||
dockerfile: Dockerfile.release
|
||||
extra_files:
|
||||
- LICENSE
|
||||
- CREDITS
|
||||
build_flag_templates:
|
||||
- "--platform=linux/ppc64le"
|
||||
- "--build-arg=TAG={{ .Tag }}"
|
||||
- image_templates:
|
||||
- "quay.io/minio/console:{{ .Tag }}-s390x"
|
||||
use: buildx
|
||||
goarch: s390x
|
||||
dockerfile: Dockerfile.release
|
||||
extra_files:
|
||||
- LICENSE
|
||||
- CREDITS
|
||||
build_flag_templates:
|
||||
- "--platform=linux/s390x"
|
||||
- "--build-arg=TAG={{ .Tag }}"
|
||||
- image_templates:
|
||||
- "quay.io/minio/console:{{ .Tag }}-arm64"
|
||||
use: buildx
|
||||
goarch: arm64
|
||||
goos: linux
|
||||
dockerfile: Dockerfile.release
|
||||
extra_files:
|
||||
- LICENSE
|
||||
- CREDITS
|
||||
build_flag_templates:
|
||||
- "--platform=linux/arm64"
|
||||
- "--build-arg=TAG={{ .Tag }}"
|
||||
docker_manifests:
|
||||
- name_template: minio/console:{{ .Tag }}
|
||||
image_templates:
|
||||
- minio/console:{{ .Tag }}-amd64
|
||||
- minio/console:{{ .Tag }}-arm64
|
||||
- minio/console:{{ .Tag }}-ppc64le
|
||||
- minio/console:{{ .Tag }}-s390x
|
||||
- name_template: quay.io/minio/console:{{ .Tag }}
|
||||
image_templates:
|
||||
- quay.io/minio/console:{{ .Tag }}-amd64
|
||||
- quay.io/minio/console:{{ .Tag }}-arm64
|
||||
- quay.io/minio/console:{{ .Tag }}-ppc64le
|
||||
- quay.io/minio/console:{{ .Tag }}-s390x
|
||||
- name_template: minio/console:latest
|
||||
image_templates:
|
||||
- minio/console:{{ .Tag }}-amd64
|
||||
- minio/console:{{ .Tag }}-arm64
|
||||
- minio/console:{{ .Tag }}-ppc64le
|
||||
- minio/console:{{ .Tag }}-s390x
|
||||
@@ -30,4 +30,6 @@ tests/
|
||||
.vscode/
|
||||
*.code-workspace
|
||||
*~
|
||||
.eslintcache
|
||||
.eslintcache
|
||||
|
||||
consoleApi.ts
|
||||
186
CHANGELOG.md
Normal file
186
CHANGELOG.md
Normal file
@@ -0,0 +1,186 @@
|
||||
<!-- @format -->
|
||||
|
||||
# Changelog
|
||||
|
||||
## Release v0.42.0
|
||||
|
||||
Features:
|
||||
|
||||
- Introducing Dark Mode
|
||||
|
||||
Bug Fix:
|
||||
|
||||
- Fixed vulnerabilities
|
||||
- Changes on Upload and Delete object urls
|
||||
- Fixed blocking subpath creation if not enough permissions
|
||||
- Removed share object option at prefix level
|
||||
- Updated allowed actions for a deleted object
|
||||
|
||||
## Release v0.41.0
|
||||
|
||||
Features:
|
||||
|
||||
- Updated pages to use mds components
|
||||
- support for resolving IPv4/IPv6
|
||||
|
||||
Bug Fix:
|
||||
|
||||
- Remove cache for ClientIP
|
||||
- Fixed override environment variables display in settings page
|
||||
- Fixed daylight savings time support in share modal
|
||||
|
||||
## Release v0.40.0
|
||||
|
||||
Features:
|
||||
|
||||
- Updated OpenID page
|
||||
- Added New bucket event types support
|
||||
|
||||
Bug Fix:
|
||||
|
||||
- Fixed crash in access keys page
|
||||
- Fixed AuditLog filters issue
|
||||
- Fixed multiple issues with Object Browser
|
||||
|
||||
## Release v0.39.0
|
||||
|
||||
Features:
|
||||
|
||||
- Migrated metrics page to mds
|
||||
- Migrated Register page to mds
|
||||
|
||||
Bug Fix:
|
||||
|
||||
- Fixed LDAP configuration page issues
|
||||
- Load available certificates in logout
|
||||
- Updated dependencies & go version
|
||||
- Fixed delete objects functionality
|
||||
|
||||
## Release v0.38.0
|
||||
|
||||
Features:
|
||||
|
||||
- Added extra information to Service Accounts page
|
||||
- Updated Tiers, Site Replication, Speedtest, Heal & Watch pages components
|
||||
|
||||
Bug Fix:
|
||||
|
||||
- Fixed IDP expiry time errors
|
||||
- Updated project Dependencies
|
||||
|
||||
## Release v0.37.0
|
||||
|
||||
Features:
|
||||
|
||||
- Updated Trace and Logs page components
|
||||
- Updated Prometheus metrics
|
||||
|
||||
Bug Fix:
|
||||
|
||||
- Disabled input fields for Subscription features if MinIO is not registered
|
||||
|
||||
## Release v0.36.0
|
||||
|
||||
Features:
|
||||
|
||||
- Updated Settings page components
|
||||
|
||||
Bug Fix:
|
||||
|
||||
- Show LDAP Enabled value LDAP configuration
|
||||
- Download multiple objects in same path as they were selected
|
||||
|
||||
## Release v0.35.1
|
||||
|
||||
Bug Fix:
|
||||
|
||||
- Change timestamp format for zip creation
|
||||
|
||||
## Release v0.35.0
|
||||
|
||||
Features:
|
||||
|
||||
- Add Exclude Folders and Exclude Prefixes during bucket creation
|
||||
- Download multiple selected objects as zip and ignore deleted objects
|
||||
- Updated Call Home, Inspet, Profile and Health components
|
||||
|
||||
Bug Fix:
|
||||
|
||||
- Remove extra white spaces for configuration strings
|
||||
- Allow Create New Path in bucket view when having right permissions
|
||||
|
||||
## Release v0.34.0
|
||||
|
||||
Features:
|
||||
|
||||
- Updated Buckets components
|
||||
|
||||
Bug Fix:
|
||||
|
||||
- Fixed SUBNET Health report upload
|
||||
- Updated Download Handler
|
||||
- Fixes issue with rewind
|
||||
- Avoid 1 hour expiration for IDP credentials
|
||||
|
||||
---
|
||||
|
||||
## Release v0.33.0
|
||||
|
||||
Features:
|
||||
|
||||
- Updated OpenID, LDAP components
|
||||
|
||||
Bug Fix:
|
||||
|
||||
- Fixed security issues
|
||||
- Fixed navigation issues in Object Browser
|
||||
- Fixed Dashboard metrics
|
||||
|
||||
---
|
||||
|
||||
## Release v0.32.0
|
||||
|
||||
Features:
|
||||
|
||||
- Updated Users and Groups components
|
||||
- Added placeholder image for Help Menu
|
||||
|
||||
Bug Fix:
|
||||
|
||||
- Fixed memory leak in WebSocket API for Object Browser
|
||||
|
||||
---
|
||||
|
||||
## Release v0.31.0
|
||||
|
||||
**Breaking Changes:**
|
||||
|
||||
- **Removed support for Standalone Deployments**
|
||||
|
||||
Features:
|
||||
|
||||
- Updated way files are displayed in uploading component
|
||||
- Updated Audit Logs and Policies components
|
||||
|
||||
Bug Fix:
|
||||
|
||||
- Fixed Download folders issue in Object Browser
|
||||
- Added missing Notification Events (ILM & REPLICA) in Events Notification Page
|
||||
- Fixed Security Vulnerability for `semver` dependency
|
||||
|
||||
---
|
||||
|
||||
## Release v0.30.0
|
||||
|
||||
Features:
|
||||
|
||||
- Added MinIO Console Help Menu
|
||||
- Updated UI Menu components
|
||||
|
||||
Bug Fix:
|
||||
|
||||
- Disable the Upload button on Object Browser if the user is not allowed
|
||||
- Fixed security vulnerability for `lestrrat-go/jwx` and `fast-xml-parser`
|
||||
- Fixed bug on sub-paths for Object Browser
|
||||
- Reduce the number of calls to `/session` API endpoint to improve performance
|
||||
- Rolled back the previous change for the Share File feature to no longer ask for Service Account access keys
|
||||
@@ -1,3 +1,27 @@
|
||||
# Developing MinIO Console
|
||||
|
||||
The MinIO Console requires the [MinIO Server](https://github.com/minio/minio). For development purposes, you also need to run both the MinIO Console web app and the MinIO Console server.
|
||||
|
||||
## Running MinIO Console server
|
||||
|
||||
Build the server in the main folder by running:
|
||||
```
|
||||
make
|
||||
```
|
||||
> Note: If it's the first time running the server, you might need to run `go mod tidy` to ensure you have all modules required.
|
||||
To start the server run:
|
||||
```
|
||||
CONSOLE_ACCESS_KEY=<your-access-key>
|
||||
CONSOLE_SECRET_KEY=<your-secret-key>
|
||||
CONSOLE_MINIO_SERVER=<minio-server-endpoint>
|
||||
CONSOLE_DEV_MODE=on
|
||||
./console server
|
||||
```
|
||||
|
||||
## Running MinIO Console web app
|
||||
Refer to `/portal-ui` [instructions](/portal-ui/README.md) to run the web app locally.
|
||||
|
||||
|
||||
# Building with MinIO
|
||||
|
||||
To test console in its shipping format, you need to build it from the MinIO repository, the following step will guide
|
||||
@@ -137,8 +161,8 @@ $ cat > consoleAdmin.json << EOF
|
||||
]
|
||||
}
|
||||
EOF
|
||||
$ mc admin policy add myminio consoleAdmin consoleAdmin.json
|
||||
$ mc admin policy set myminio consoleAdmin user="uid=billy,dc=example,dc=org"
|
||||
$ mc admin policy create myminio consoleAdmin consoleAdmin.json
|
||||
$ mc admin policy attach myminio consoleAdmin --user="uid=billy,dc=example,dc=org"
|
||||
```
|
||||
|
||||
## Run MinIO
|
||||
|
||||
@@ -1,17 +1,10 @@
|
||||
FROM --platform=linux/amd64 registry.access.redhat.com/ubi8/ubi-minimal:8.7 as build
|
||||
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.2 as build
|
||||
|
||||
RUN microdnf update --nodocs && microdnf install ca-certificates --nodocs
|
||||
RUN curl -s -q https://raw.githubusercontent.com/minio/kes/master/LICENSE -o LICENSE
|
||||
RUN curl -s -q https://raw.githubusercontent.com/minio/kes/master/CREDITS -o CREDITS
|
||||
|
||||
FROM registry.access.redhat.com/ubi8/ubi-micro:8.7
|
||||
FROM registry.access.redhat.com/ubi9/ubi-micro:9.2
|
||||
|
||||
# On RHEL the certificate bundle is located at:
|
||||
# - /etc/pki/tls/certs/ca-bundle.crt (RHEL 6)
|
||||
# - /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem (RHEL 7)
|
||||
COPY --from=build /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /etc/pki/ca-trust/extracted/pem/
|
||||
COPY --from=build LICENSE /LICENSE
|
||||
COPY --from=build CREDITS /CREDITS
|
||||
ARG TAG
|
||||
|
||||
LABEL name="MinIO" \
|
||||
vendor="MinIO Inc <dev@min.io>" \
|
||||
@@ -21,7 +14,14 @@ LABEL name="MinIO" \
|
||||
summary="A graphical user interface for MinIO" \
|
||||
description="MinIO object storage is fundamentally different. Designed for performance and the S3 API, it is 100% open-source. MinIO is ideal for large, private cloud environments with stringent security requirements and delivers mission-critical availability across a diverse range of workloads."
|
||||
|
||||
EXPOSE 9090
|
||||
# On RHEL the certificate bundle is located at:
|
||||
# - /etc/pki/tls/certs/ca-bundle.crt (RHEL 6)
|
||||
# - /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem (RHEL 7)
|
||||
COPY --from=build /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /etc/pki/ca-trust/extracted/pem/
|
||||
COPY LICENSE /LICENSE
|
||||
COPY CREDITS /CREDITS
|
||||
COPY console /console
|
||||
|
||||
EXPOSE 9090
|
||||
|
||||
ENTRYPOINT ["/console"]
|
||||
|
||||
29
Makefile
29
Makefile
@@ -53,6 +53,9 @@ clean-swagger:
|
||||
swagger-console:
|
||||
@echo "Generating swagger server code from yaml"
|
||||
@swagger generate server -A console --main-package=management --server-package=restapi --exclude-main -P models.Principal -f ./swagger.yml -r NOTICE
|
||||
@echo "Generating typescript api"
|
||||
@npx swagger-typescript-api -p ./swagger.yml -o ./portal-ui/src/api -n consoleApi.ts
|
||||
@git restore restapi/server.go
|
||||
|
||||
|
||||
assets:
|
||||
@@ -171,7 +174,7 @@ test-sso-integration:
|
||||
@(docker run --name minio-client --network my-net -dit --entrypoint=/bin/sh minio/mc)
|
||||
@(docker exec minio-client mc alias set myminio/ http://minio:9000 minio minio123)
|
||||
@echo "adding policy to Dillon Harper to be able to login:"
|
||||
@(cd sso-integration && docker cp allaccess.json minio-client:/ && docker exec minio-client mc admin policy add myminio "Dillon Harper" allaccess.json)
|
||||
@(cd sso-integration && docker cp allaccess.json minio-client:/ && docker exec minio-client mc admin policy create myminio "Dillon Harper" allaccess.json)
|
||||
@echo "starting bash script"
|
||||
@(env bash $(PWD)/sso-integration/set-sso.sh)
|
||||
@echo "add python module"
|
||||
@@ -227,6 +230,30 @@ cleanup-permissions:
|
||||
@(env bash $(PWD)/portal-ui/tests/scripts/cleanup-env.sh)
|
||||
@(docker stop minio)
|
||||
|
||||
initialize-docker-network:
|
||||
@(docker network create test-network)
|
||||
|
||||
test-start-docker-minio-w-redirect-url: initialize-docker-network
|
||||
@(docker run \
|
||||
-e MINIO_BROWSER_REDIRECT_URL='http://localhost:8000/console/subpath/' \
|
||||
-e MINIO_SERVER_URL='http://localhost:9000' \
|
||||
-v /data1 -v /data2 -v /data3 -v /data4 \
|
||||
-d --network host --name minio --rm\
|
||||
quay.io/minio/minio:latest server /data{1...4})
|
||||
|
||||
test-start-docker-nginx-w-subpath:
|
||||
@(docker run \
|
||||
--network host \
|
||||
-d --rm \
|
||||
--add-host=host.docker.internal:host-gateway \
|
||||
-v ./portal-ui/tests/subpath-nginx/nginx.conf:/etc/nginx/nginx.conf \
|
||||
--name test-nginx nginx)
|
||||
|
||||
test-initialize-minio-nginx: test-start-docker-minio-w-redirect-url test-start-docker-nginx-w-subpath
|
||||
|
||||
cleanup-minio-nginx:
|
||||
@(docker stop minio test-nginx & docker network rm test-network)
|
||||
|
||||
test:
|
||||
@echo "execute test and get coverage"
|
||||
@(cd restapi && mkdir coverage && GO111MODULE=on go test -test.v -coverprofile=coverage/coverage.out)
|
||||
|
||||
51
README.md
51
README.md
@@ -12,48 +12,25 @@ A graphical user interface for [MinIO](https://github.com/minio/minio)
|
||||
**Table of Contents**
|
||||
|
||||
- [MinIO Console](#minio-console)
|
||||
- [Install](#install)
|
||||
- [Binary Releases](#binary-releases)
|
||||
- [Docker](#docker)
|
||||
- [Build from source](#build-from-source)
|
||||
- [Setup](#setup)
|
||||
- [1. Create a user `console` using `mc`](#1-create-a-user-console-using-mc)
|
||||
- [2. Create a policy for `console` with admin access to all resources (for testing)](#2-create-a-policy-for-console-with-admin-access-to-all-resources-for-testing)
|
||||
- [3. Set the policy for the new `console` user](#3-set-the-policy-for-the-new-console-user)
|
||||
- [Start Console service:](#start-console-service)
|
||||
- [Start Console service with TLS:](#start-console-service-with-tls)
|
||||
- [Connect Console to a Minio using TLS and a self-signed certificate](#connect-console-to-a-minio-using-tls-and-a-self-signed-certificate)
|
||||
- [Install](#install)
|
||||
- [Build from source](#build-from-source)
|
||||
- [Setup](#setup)
|
||||
- [1. Create a user `console` using `mc`](#1-create-a-user-console-using-mc)
|
||||
- [2. Create a policy for `console` with admin access to all resources (for testing)](#2-create-a-policy-for-console-with-admin-access-to-all-resources-for-testing)
|
||||
- [3. Set the policy for the new `console` user](#3-set-the-policy-for-the-new-console-user)
|
||||
- [Start Console service:](#start-console-service)
|
||||
- [Start Console service with TLS:](#start-console-service-with-tls)
|
||||
- [Connect Console to a Minio using TLS and a self-signed certificate](#connect-console-to-a-minio-using-tls-and-a-self-signed-certificate)
|
||||
- [Contribute to console Project](#contribute-to-console-project)
|
||||
|
||||
<!-- markdown-toc end -->
|
||||
|
||||
## Install
|
||||
|
||||
### Binary Releases
|
||||
MinIO Console is a library that provides a management and browser UI overlay for the MinIO Server.
|
||||
The standalone binary installation path has been removed.
|
||||
|
||||
| OS | ARCH | Binary |
|
||||
|:-------:|:-------:|:----------------------------------------------------------------------------------------------------:|
|
||||
| Linux | amd64 | [linux-amd64](https://github.com/minio/console/releases/latest/download/console-linux-amd64) |
|
||||
| Linux | arm64 | [linux-arm64](https://github.com/minio/console/releases/latest/download/console-linux-arm64) |
|
||||
| Linux | ppc64le | [linux-ppc64le](https://github.com/minio/console/releases/latest/download/console-linux-ppc64le) |
|
||||
| Linux | s390x | [linux-s390x](https://github.com/minio/console/releases/latest/download/console-linux-s390x) |
|
||||
| Apple | amd64 | [darwin-amd64](https://github.com/minio/console/releases/latest/download/console-darwin-amd64) |
|
||||
| Windows | amd64 | [windows-amd64](https://github.com/minio/console/releases/latest/download/console-windows-amd64.exe) |
|
||||
|
||||
You can also verify the binary with [minisign](https://jedisct1.github.io/minisign/) by downloading the
|
||||
corresponding [`.minisig`](https://github.com/minio/console/releases/latest) signature file. Then run:
|
||||
|
||||
```
|
||||
minisign -Vm console-<OS>-<ARCH> -P RWTx5Zr1tiHQLwG9keckT0c45M3AGeHD6IvimQHpyRywVWGbP1aVSGav
|
||||
```
|
||||
|
||||
### Docker
|
||||
|
||||
Pull the latest release via:
|
||||
|
||||
```
|
||||
docker pull minio/console
|
||||
```
|
||||
In case a Console standalone binary is needed, it can be generated by building this package from source as follows:
|
||||
|
||||
### Build from source
|
||||
|
||||
@@ -107,13 +84,13 @@ EOF
|
||||
```
|
||||
|
||||
```sh
|
||||
mc admin policy add myminio/ consoleAdmin admin.json
|
||||
mc admin policy create myminio/ consoleAdmin admin.json
|
||||
```
|
||||
|
||||
### 3. Set the policy for the new `console` user
|
||||
|
||||
```sh
|
||||
mc admin policy set myminio consoleAdmin user=console
|
||||
mc admin policy attach myminio consoleAdmin --user=console
|
||||
```
|
||||
|
||||
> NOTE: Additionally, you can create policies to limit the privileges for other `console` users, for example, if you
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
// This file is part of MinIO Console Server
|
||||
// Copyright (c) 2021 MinIO, Inc.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package cluster
|
||||
|
||||
import (
|
||||
directpvclient "github.com/minio/directpv/pkg/client"
|
||||
operator "github.com/minio/operator/pkg/client/clientset/versioned"
|
||||
"k8s.io/client-go/kubernetes"
|
||||
"k8s.io/client-go/rest"
|
||||
certutil "k8s.io/client-go/util/cert"
|
||||
)
|
||||
|
||||
// getTLSClientConfig will return the right TLS configuration for the K8S client based on the configured TLS certificate
|
||||
func getTLSClientConfig() rest.TLSClientConfig {
|
||||
defaultRootCAFile := "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
|
||||
customRootCAFile := getK8sAPIServerTLSRootCA()
|
||||
tlsClientConfig := rest.TLSClientConfig{}
|
||||
// if console is running inside k8s by default he will have access to the CA Cert from the k8s local authority
|
||||
if _, err := certutil.NewPool(defaultRootCAFile); err == nil {
|
||||
tlsClientConfig.CAFile = defaultRootCAFile
|
||||
}
|
||||
// if the user explicitly define a custom CA certificate, instead, we will use that
|
||||
if customRootCAFile != "" {
|
||||
if _, err := certutil.NewPool(customRootCAFile); err == nil {
|
||||
tlsClientConfig.CAFile = customRootCAFile
|
||||
}
|
||||
}
|
||||
return tlsClientConfig
|
||||
}
|
||||
|
||||
// This operation will run only once at console startup
|
||||
var tlsClientConfig = getTLSClientConfig()
|
||||
|
||||
func GetK8sConfig(token string) *rest.Config {
|
||||
config := &rest.Config{
|
||||
Host: GetK8sAPIServer(),
|
||||
TLSClientConfig: tlsClientConfig,
|
||||
APIPath: "/",
|
||||
BearerToken: token,
|
||||
}
|
||||
return config
|
||||
}
|
||||
|
||||
// OperatorClient returns an operator client using GetK8sConfig for its config
|
||||
func OperatorClient(token string) (*operator.Clientset, error) {
|
||||
return operator.NewForConfig(GetK8sConfig(token))
|
||||
}
|
||||
|
||||
// K8sClient returns kubernetes client using GetK8sConfig for its config
|
||||
func K8sClient(token string) (*kubernetes.Clientset, error) {
|
||||
return kubernetes.NewForConfig(GetK8sConfig(token))
|
||||
}
|
||||
|
||||
// DirectPV interfaces required to fetch information
|
||||
|
||||
func DirectPVDriveInterface(token string) (*directpvclient.DirectCSIDriveInterface, error) {
|
||||
return directpvclient.DirectCSIDriveInterfaceForConfig(GetK8sConfig(token))
|
||||
}
|
||||
|
||||
func DirectPVVolumeInterface(token string) (*directpvclient.DirectCSIVolumeInterface, error) {
|
||||
return directpvclient.DirectCSIVolumeInterfaceForConfig(GetK8sConfig(token))
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
// This file is part of MinIO Console Server
|
||||
// Copyright (c) 2021 MinIO, Inc.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package cluster
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
xhttp "github.com/minio/console/pkg/http"
|
||||
"github.com/minio/console/restapi"
|
||||
|
||||
"github.com/minio/console/pkg/utils"
|
||||
|
||||
"github.com/minio/pkg/env"
|
||||
)
|
||||
|
||||
func GetK8sAPIServer() string {
|
||||
// if console is running inside a k8s pod KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT will contain the k8s api server apiServerAddress
|
||||
// if console is not running inside k8s by default will look for the k8s api server on localhost:8001 (kubectl proxy)
|
||||
// NOTE: using kubectl proxy is for local development only, since every request send to localhost:8001 will bypass service account authentication
|
||||
// more info here: https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#directly-accessing-the-rest-api
|
||||
// you can override this using CONSOLE_K8S_API_SERVER, ie use the k8s cluster from `kubectl config view`
|
||||
host, port := env.Get("KUBERNETES_SERVICE_HOST", ""), env.Get("KUBERNETES_SERVICE_PORT", "")
|
||||
apiServerAddress := "http://localhost:8001"
|
||||
if host != "" && port != "" {
|
||||
apiServerAddress = "https://" + net.JoinHostPort(host, port)
|
||||
}
|
||||
return env.Get(ConsoleK8sAPIServer, apiServerAddress)
|
||||
}
|
||||
|
||||
// If CONSOLE_K8S_API_SERVER_TLS_ROOT_CA is true console will load the certificate into the
|
||||
// http.client rootCAs pool, this is useful for testing an k8s ApiServer or when working with self-signed certificates
|
||||
func getK8sAPIServerTLSRootCA() string {
|
||||
return strings.TrimSpace(env.Get(ConsoleK8SAPIServerTLSRootCA, ""))
|
||||
}
|
||||
|
||||
// GetNsFromFile assumes console is running inside a k8s pod and extract the current namespace from the
|
||||
// /var/run/secrets/kubernetes.io/serviceaccount/namespace file
|
||||
func GetNsFromFile() string {
|
||||
dat, err := ioutil.ReadFile("/var/run/secrets/kubernetes.io/serviceaccount/namespace")
|
||||
if err != nil {
|
||||
return "default"
|
||||
}
|
||||
return string(dat)
|
||||
}
|
||||
|
||||
// GetMinioImage returns the image URL to be used when deploying a MinIO instance, if there is
|
||||
// a preferred image to be used (configured via ENVIRONMENT VARIABLES) GetMinioImage will return that
|
||||
// if not, GetMinioImage will try to obtain the image URL for the latest version of MinIO and return that
|
||||
func GetMinioImage() (*string, error) {
|
||||
image := strings.TrimSpace(env.Get(ConsoleMinioImage, ""))
|
||||
// if there is a preferred image configured by the user we'll always return that
|
||||
if image != "" {
|
||||
return &image, nil
|
||||
}
|
||||
client := restapi.GetConsoleHTTPClient("")
|
||||
client.Timeout = 5 * time.Second
|
||||
latestMinIOImage, errLatestMinIOImage := utils.GetLatestMinIOImage(
|
||||
&xhttp.Client{
|
||||
Client: client,
|
||||
})
|
||||
|
||||
if errLatestMinIOImage != nil {
|
||||
return nil, errLatestMinIOImage
|
||||
}
|
||||
return latestMinIOImage, nil
|
||||
}
|
||||
@@ -41,8 +41,9 @@ func StartServer(ctx *cli.Context) error {
|
||||
}
|
||||
|
||||
xctx := context.Background()
|
||||
transport := restapi.PrepareSTSClientTransport(false)
|
||||
if err := logger.InitializeLogger(xctx, transport); err != nil {
|
||||
|
||||
transport := restapi.PrepareSTSClientTransport(false, restapi.LocalAddress)
|
||||
if err := logger.InitializeLogger(xctx, transport.Transport); err != nil {
|
||||
fmt.Println("error InitializeLogger", err)
|
||||
logger.CriticalIf(xctx, err)
|
||||
}
|
||||
|
||||
@@ -25,9 +25,9 @@ import (
|
||||
|
||||
"github.com/minio/cli"
|
||||
"github.com/minio/console/pkg"
|
||||
"github.com/minio/pkg/console"
|
||||
"github.com/minio/pkg/trie"
|
||||
"github.com/minio/pkg/words"
|
||||
"github.com/minio/pkg/v2/console"
|
||||
"github.com/minio/pkg/v2/trie"
|
||||
"github.com/minio/pkg/v2/words"
|
||||
)
|
||||
|
||||
// Help template for Console.
|
||||
|
||||
@@ -18,7 +18,7 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"syscall"
|
||||
|
||||
@@ -163,7 +163,7 @@ func loadAllCerts(ctx *cli.Context) error {
|
||||
|
||||
// load ca cert from swagger server tls-ca flag
|
||||
if swaggerServerCACertificate != "" {
|
||||
caCert, caCertErr := ioutil.ReadFile(swaggerServerCACertificate)
|
||||
caCert, caCertErr := os.ReadFile(swaggerServerCACertificate)
|
||||
if caCertErr == nil {
|
||||
restapi.GlobalRootCAs.AppendCertsFromPEM(caCert)
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ var updateCmd = cli.Command{
|
||||
Action: updateInplace,
|
||||
}
|
||||
|
||||
func updateInplace(ctx *cli.Context) error {
|
||||
func updateInplace(_ *cli.Context) error {
|
||||
transport := getUpdateTransport(30 * time.Second)
|
||||
rel, err := getLatestRelease(transport)
|
||||
if err != nil {
|
||||
|
||||
196
go.mod
196
go.mod
@@ -1,191 +1,159 @@
|
||||
module github.com/minio/console
|
||||
|
||||
go 1.19
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
github.com/blang/semver/v4 v4.0.0
|
||||
github.com/cheggaaa/pb/v3 v3.1.0
|
||||
github.com/cheggaaa/pb/v3 v3.1.4
|
||||
github.com/dustin/go-humanize v1.0.1
|
||||
github.com/fatih/color v1.14.1
|
||||
github.com/go-openapi/errors v0.20.3
|
||||
github.com/fatih/color v1.15.0
|
||||
github.com/go-openapi/errors v0.20.4
|
||||
github.com/go-openapi/loads v0.21.2
|
||||
github.com/go-openapi/runtime v0.25.0
|
||||
github.com/go-openapi/spec v0.20.8
|
||||
github.com/go-openapi/strfmt v0.21.3
|
||||
github.com/go-openapi/swag v0.22.3
|
||||
github.com/go-openapi/runtime v0.26.0
|
||||
github.com/go-openapi/spec v0.20.9
|
||||
github.com/go-openapi/strfmt v0.21.7
|
||||
github.com/go-openapi/swag v0.22.4
|
||||
github.com/go-openapi/validate v0.22.1
|
||||
github.com/golang-jwt/jwt/v4 v4.5.0
|
||||
github.com/google/uuid v1.3.0
|
||||
github.com/google/uuid v1.3.1
|
||||
github.com/jessevdk/go-flags v1.5.0
|
||||
github.com/klauspost/compress v1.15.15
|
||||
github.com/klauspost/compress v1.16.7
|
||||
github.com/minio/cli v1.24.2
|
||||
github.com/minio/directpv v1.4.4-0.20220805090942-948ca4731651
|
||||
github.com/minio/highwayhash v1.0.2
|
||||
github.com/minio/kes v0.22.3
|
||||
github.com/minio/madmin-go/v2 v2.0.14
|
||||
github.com/minio/mc v0.0.0-20230221142751-40e51ee9affb
|
||||
github.com/minio/minio-go/v7 v7.0.49
|
||||
github.com/minio/operator v0.0.0-20230228004026-ad024a9dffe5
|
||||
github.com/minio/pkg v1.6.3
|
||||
github.com/minio/madmin-go/v3 v3.0.29
|
||||
github.com/minio/mc v0.0.0-20231030184332-9f2fb2b6a9f8
|
||||
github.com/minio/minio-go/v7 v7.0.64-0.20230920204636-e783c9ba11b3
|
||||
github.com/minio/selfupdate v0.6.0
|
||||
github.com/minio/websocket v1.6.0
|
||||
github.com/mitchellh/go-homedir v1.1.0
|
||||
github.com/rs/xid v1.4.0
|
||||
github.com/rs/xid v1.5.0
|
||||
github.com/secure-io/sio-go v0.3.1
|
||||
github.com/stretchr/testify v1.8.1
|
||||
github.com/tidwall/gjson v1.14.4
|
||||
github.com/stretchr/testify v1.8.4
|
||||
github.com/tidwall/gjson v1.16.0
|
||||
github.com/unrolled/secure v1.13.0
|
||||
golang.org/x/crypto v0.6.0
|
||||
golang.org/x/net v0.7.0
|
||||
golang.org/x/oauth2 v0.5.0
|
||||
golang.org/x/crypto v0.14.0
|
||||
golang.org/x/net v0.17.0
|
||||
golang.org/x/oauth2 v0.12.0
|
||||
// Added to include security fix for
|
||||
// https://github.com/golang/go/issues/56152
|
||||
golang.org/x/text v0.7.0 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0
|
||||
k8s.io/api v0.26.1
|
||||
k8s.io/apimachinery v0.26.1
|
||||
k8s.io/client-go v0.26.1
|
||||
k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5
|
||||
golang.org/x/text v0.13.0 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/mattn/go-ieproxy v0.0.11
|
||||
github.com/minio/pkg/v2 v2.0.2
|
||||
)
|
||||
|
||||
require (
|
||||
aead.dev/mem v0.2.0 // indirect
|
||||
aead.dev/minisign v0.2.0 // indirect
|
||||
github.com/VividCortex/ewma v1.2.0 // indirect
|
||||
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect
|
||||
github.com/aymanbagabas/go-osc52 v1.2.1 // indirect
|
||||
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
|
||||
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
||||
github.com/charmbracelet/bubbles v0.15.0 // indirect
|
||||
github.com/charmbracelet/bubbletea v0.23.1 // indirect
|
||||
github.com/charmbracelet/lipgloss v0.6.0 // indirect
|
||||
github.com/charmbracelet/bubbles v0.16.1 // indirect
|
||||
github.com/charmbracelet/bubbletea v0.24.2 // indirect
|
||||
github.com/charmbracelet/lipgloss v0.8.0 // indirect
|
||||
github.com/cheggaaa/pb v1.0.29 // indirect
|
||||
github.com/containerd/console v1.0.3 // indirect
|
||||
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect
|
||||
github.com/coreos/go-semver v0.3.1 // indirect
|
||||
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
|
||||
github.com/docker/go-units v0.4.0 // indirect
|
||||
github.com/emicklei/go-restful/v3 v3.10.0 // indirect
|
||||
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
|
||||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
|
||||
github.com/docker/go-units v0.5.0 // indirect
|
||||
github.com/fatih/structs v1.1.0 // indirect
|
||||
github.com/fsnotify/fsnotify v1.5.4 // indirect
|
||||
github.com/gdamore/encoding v1.0.0 // indirect
|
||||
github.com/gdamore/tcell/v2 v2.5.4 // indirect
|
||||
github.com/go-logr/logr v1.2.3 // indirect
|
||||
github.com/go-ole/go-ole v1.2.6 // indirect
|
||||
github.com/gdamore/tcell/v2 v2.6.0 // indirect
|
||||
github.com/go-ole/go-ole v1.3.0 // indirect
|
||||
github.com/go-openapi/analysis v0.21.4 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.19.5 // indirect
|
||||
github.com/go-openapi/jsonreference v0.20.0 // indirect
|
||||
github.com/goccy/go-json v0.10.0 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.20.0 // indirect
|
||||
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
||||
github.com/goccy/go-json v0.10.2 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/golang/protobuf v1.5.2 // indirect
|
||||
github.com/google/gnostic v0.6.9 // indirect
|
||||
github.com/google/go-cmp v0.5.9 // indirect
|
||||
github.com/google/gofuzz v1.2.0 // indirect
|
||||
github.com/golang/protobuf v1.5.3 // indirect
|
||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/imdario/mergo v0.3.12 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
github.com/jedib0t/go-pretty/v6 v6.4.4 // indirect
|
||||
github.com/jedib0t/go-pretty/v6 v6.4.7 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/juju/ratelimit v1.0.2 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
|
||||
github.com/kr/pretty v0.3.0 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
|
||||
github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect
|
||||
github.com/lestrrat-go/blackmagic v1.0.1 // indirect
|
||||
github.com/lestrrat-go/httpcc v1.0.1 // indirect
|
||||
github.com/lestrrat-go/iter v1.0.2 // indirect
|
||||
github.com/lestrrat-go/jwx v1.2.25 // indirect
|
||||
github.com/lestrrat-go/jwx v1.2.26 // indirect
|
||||
github.com/lestrrat-go/option v1.0.1 // indirect
|
||||
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
|
||||
github.com/lufia/plan9stats v0.0.0-20230110061619-bbe2e5e100de // indirect
|
||||
github.com/magiconair/properties v1.8.5 // indirect
|
||||
github.com/lufia/plan9stats v0.0.0-20230326075908-cb1d2100619a // indirect
|
||||
github.com/mailru/easyjson v0.7.7 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-ieproxy v0.0.1 // indirect
|
||||
github.com/mattn/go-isatty v0.0.17 // indirect
|
||||
github.com/mattn/go-isatty v0.0.19 // indirect
|
||||
github.com/mattn/go-localereader v0.0.1 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.14 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.15 // indirect
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
|
||||
github.com/mb0/glob v0.0.0-20160210091149-1eb79d2de6c4 // indirect
|
||||
github.com/miekg/dns v1.1.50 // indirect
|
||||
github.com/minio/colorjson v1.0.4 // indirect
|
||||
github.com/minio/colorjson v1.0.6 // indirect
|
||||
github.com/minio/filepath v1.0.0 // indirect
|
||||
github.com/minio/md5-simd v1.1.2 // indirect
|
||||
github.com/minio/sha256-simd v1.0.0 // indirect
|
||||
github.com/mitchellh/mapstructure v1.4.3 // indirect
|
||||
github.com/minio/sha256-simd v1.0.1 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/montanaflynn/stats v0.7.0 // indirect
|
||||
github.com/muesli/ansi v0.0.0-20221106050444-61f0cd9a192a // indirect
|
||||
github.com/montanaflynn/stats v0.7.1 // indirect
|
||||
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
|
||||
github.com/muesli/cancelreader v0.2.2 // indirect
|
||||
github.com/muesli/reflow v0.3.0 // indirect
|
||||
github.com/muesli/termenv v0.13.0 // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/muesli/termenv v0.15.2 // indirect
|
||||
github.com/navidys/tvxwidgets v0.3.0 // indirect
|
||||
github.com/oklog/ulid v1.3.1 // indirect
|
||||
github.com/olekukonko/tablewriter v0.0.5 // indirect
|
||||
github.com/pelletier/go-toml v1.9.4 // indirect
|
||||
github.com/philhofer/fwd v1.1.2 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/pkg/xattr v0.4.9 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/posener/complete v1.2.3 // indirect
|
||||
github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect
|
||||
github.com/prometheus/client_golang v1.14.0 // indirect
|
||||
github.com/prometheus/client_model v0.3.0 // indirect
|
||||
github.com/prometheus/common v0.39.0 // indirect
|
||||
github.com/prometheus/procfs v0.9.0 // indirect
|
||||
github.com/prometheus/prom2json v1.3.2 // indirect
|
||||
github.com/rivo/tview v0.0.0-20230130130022-4a1b7a76c01c // indirect
|
||||
github.com/prometheus/client_golang v1.16.0 // indirect
|
||||
github.com/prometheus/client_model v0.4.0 // indirect
|
||||
github.com/prometheus/common v0.44.0 // indirect
|
||||
github.com/prometheus/procfs v0.11.1 // indirect
|
||||
github.com/prometheus/prom2json v1.3.3 // indirect
|
||||
github.com/rivo/tview v0.0.0-20230909130259-ba6a2a345459 // indirect
|
||||
github.com/rivo/uniseg v0.4.4 // indirect
|
||||
github.com/rjeczalik/notify v0.9.3 // indirect
|
||||
github.com/shirou/gopsutil/v3 v3.23.1 // indirect
|
||||
github.com/sirupsen/logrus v1.9.0 // indirect
|
||||
github.com/spf13/afero v1.6.0 // indirect
|
||||
github.com/spf13/cast v1.4.1 // indirect
|
||||
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/spf13/viper v1.10.0 // indirect
|
||||
github.com/subosito/gotenv v1.2.0 // indirect
|
||||
github.com/safchain/ethtool v0.3.0 // indirect
|
||||
github.com/shirou/gopsutil/v3 v3.23.8 // indirect
|
||||
github.com/shoenig/go-m1cpu v0.1.6 // indirect
|
||||
github.com/sirupsen/logrus v1.9.3 // indirect
|
||||
github.com/tidwall/match v1.1.1 // indirect
|
||||
github.com/tidwall/pretty v1.2.1 // indirect
|
||||
github.com/tinylib/msgp v1.1.8 // indirect
|
||||
github.com/tklauser/go-sysconf v0.3.11 // indirect
|
||||
github.com/tklauser/numcpus v0.6.0 // indirect
|
||||
github.com/yusufpapurcu/wmi v1.2.2 // indirect
|
||||
go.etcd.io/etcd/api/v3 v3.5.7 // indirect
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.5.7 // indirect
|
||||
go.etcd.io/etcd/client/v3 v3.5.7 // indirect
|
||||
go.mongodb.org/mongo-driver v1.10.0 // indirect
|
||||
go.uber.org/atomic v1.10.0 // indirect
|
||||
go.uber.org/goleak v1.1.12 // indirect
|
||||
go.uber.org/multierr v1.9.0 // indirect
|
||||
go.uber.org/zap v1.24.0 // indirect
|
||||
golang.org/x/mod v0.7.0 // indirect
|
||||
golang.org/x/sync v0.1.0 // indirect
|
||||
golang.org/x/sys v0.5.0 // indirect
|
||||
golang.org/x/term v0.5.0 // indirect
|
||||
golang.org/x/time v0.3.0 // indirect
|
||||
golang.org/x/tools v0.4.0 // indirect
|
||||
google.golang.org/appengine v1.6.7 // indirect
|
||||
google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44 // indirect
|
||||
google.golang.org/grpc v1.53.0 // indirect
|
||||
google.golang.org/protobuf v1.28.1 // indirect
|
||||
github.com/tklauser/go-sysconf v0.3.12 // indirect
|
||||
github.com/tklauser/numcpus v0.6.1 // indirect
|
||||
github.com/vbauerster/mpb/v8 v8.6.2 // indirect
|
||||
github.com/yusufpapurcu/wmi v1.2.3 // indirect
|
||||
go.etcd.io/etcd/api/v3 v3.5.9 // indirect
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.5.9 // indirect
|
||||
go.etcd.io/etcd/client/v3 v3.5.9 // indirect
|
||||
go.mongodb.org/mongo-driver v1.12.1 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
go.uber.org/zap v1.25.0 // indirect
|
||||
golang.org/x/sync v0.3.0 // indirect
|
||||
golang.org/x/sys v0.13.0 // indirect
|
||||
golang.org/x/term v0.13.0 // indirect
|
||||
google.golang.org/appengine v1.6.8 // indirect
|
||||
google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20230913181813-007df8e322eb // indirect
|
||||
google.golang.org/grpc v1.58.3 // indirect
|
||||
google.golang.org/protobuf v1.31.0 // indirect
|
||||
gopkg.in/h2non/filetype.v1 v1.0.5 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/apiextensions-apiserver v0.25.4 // indirect
|
||||
k8s.io/klog/v2 v2.80.1 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20221110221610-a28e98eb7c70 // indirect
|
||||
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
|
||||
sigs.k8s.io/yaml v1.3.0 // indirect
|
||||
)
|
||||
|
||||
@@ -31,7 +31,7 @@ import (
|
||||
func Test_AddAccessRuleAPI(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
AddBucket("testaccessruleadd", false, false, nil, nil)
|
||||
AddBucket("testaccessruleadd", false, nil, nil, nil)
|
||||
|
||||
type args struct {
|
||||
bucket string
|
||||
@@ -111,7 +111,7 @@ func Test_AddAccessRuleAPI(t *testing.T) {
|
||||
func Test_GetAccessRulesAPI(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
AddBucket("testaccessruleget", false, false, nil, nil)
|
||||
AddBucket("testaccessruleget", false, nil, nil, nil)
|
||||
|
||||
type args struct {
|
||||
bucket string
|
||||
@@ -161,7 +161,7 @@ func Test_GetAccessRulesAPI(t *testing.T) {
|
||||
func Test_DeleteAccessRuleAPI(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
AddBucket("testaccessruledelete", false, false, nil, nil)
|
||||
AddBucket("testaccessruledelete", false, nil, nil, nil)
|
||||
|
||||
type args struct {
|
||||
prefix string
|
||||
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
"testing"
|
||||
@@ -56,7 +56,7 @@ func TestLoginStrategy(t *testing.T) {
|
||||
}
|
||||
|
||||
if response != nil {
|
||||
bodyBytes, _ := ioutil.ReadAll(response.Body)
|
||||
bodyBytes, _ := io.ReadAll(response.Body)
|
||||
|
||||
loginDetails := models.LoginDetails{}
|
||||
|
||||
|
||||
@@ -17,8 +17,10 @@
|
||||
package integration
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"math/rand"
|
||||
@@ -194,3 +196,86 @@ func TestObjectGet(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func downloadMultipleFiles(bucketName string, objects []string) (*http.Response, error) {
|
||||
requestURL := fmt.Sprintf("http://localhost:9090/api/v1/buckets/%s/objects/download-multiple", bucketName)
|
||||
|
||||
postReqParams, _ := json.Marshal(objects)
|
||||
reqBody := bytes.NewReader(postReqParams)
|
||||
|
||||
request, err := http.NewRequest(
|
||||
"POST", requestURL, reqBody)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
request.Header.Add("Cookie", fmt.Sprintf("token=%s", token))
|
||||
request.Header.Add("Content-Type", "application/json")
|
||||
client := &http.Client{
|
||||
Timeout: 2 * time.Second,
|
||||
}
|
||||
response, err := client.Do(request)
|
||||
return response, err
|
||||
}
|
||||
|
||||
func TestDownloadMultipleFiles(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
type args struct {
|
||||
bucketName string
|
||||
objectLis []string
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
expectedStatus int
|
||||
expectedError bool
|
||||
}{
|
||||
{
|
||||
name: "Test empty Bucket",
|
||||
args: args{
|
||||
bucketName: "",
|
||||
},
|
||||
expectedStatus: 400,
|
||||
expectedError: true,
|
||||
},
|
||||
{
|
||||
name: "Test empty object list",
|
||||
args: args{
|
||||
bucketName: "test-bucket",
|
||||
},
|
||||
expectedStatus: 400,
|
||||
expectedError: true,
|
||||
},
|
||||
{
|
||||
name: "Test with bucket and object list",
|
||||
args: args{
|
||||
bucketName: "test-bucket",
|
||||
objectLis: []string{
|
||||
"my-object.txt",
|
||||
"test-prefix/",
|
||||
"test-prefix/nested-prefix/",
|
||||
"test-prefix/nested-prefix/deep-nested/",
|
||||
},
|
||||
},
|
||||
expectedStatus: 200,
|
||||
expectedError: false,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
resp, err := downloadMultipleFiles(tt.args.bucketName, tt.args.objectLis)
|
||||
if tt.expectedError {
|
||||
assert.Nil(err)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return
|
||||
}
|
||||
}
|
||||
if resp != nil {
|
||||
assert.NotNil(resp)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
"testing"
|
||||
@@ -630,7 +630,7 @@ func Test_PolicyListUsersAPI(t *testing.T) {
|
||||
return
|
||||
}
|
||||
if response != nil {
|
||||
bodyBytes, _ := ioutil.ReadAll(response.Body)
|
||||
bodyBytes, _ := io.ReadAll(response.Body)
|
||||
assert.Equal(tt.expectedStatus, response.StatusCode, tt.name+" Failed")
|
||||
if response.StatusCode == 200 {
|
||||
assert.Equal("[\"policyuser4\"]\n", string(bodyBytes))
|
||||
@@ -709,7 +709,7 @@ func Test_PolicyListGroupsAPI(t *testing.T) {
|
||||
return
|
||||
}
|
||||
if response != nil {
|
||||
bodyBytes, _ := ioutil.ReadAll(response.Body)
|
||||
bodyBytes, _ := io.ReadAll(response.Body)
|
||||
assert.Equal(tt.expectedStatus, response.StatusCode, tt.name+" Failed")
|
||||
if response.StatusCode == 200 {
|
||||
assert.Equal("[\"testgroup12345\"]\n", string(bodyBytes))
|
||||
|
||||
@@ -28,7 +28,6 @@ import (
|
||||
|
||||
"github.com/go-openapi/swag"
|
||||
|
||||
iampolicy "github.com/minio/pkg/iam/policy"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
@@ -52,6 +51,21 @@ func TestAddServiceAccount(t *testing.T) {
|
||||
requestDataAddServiceAccount := map[string]interface{}{
|
||||
"accessKey": "testuser1",
|
||||
"secretKey": "password",
|
||||
"policy": `{
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Action": [
|
||||
"s3:GetBucketLocation",
|
||||
"s3:GetObject"
|
||||
],
|
||||
"Resource": [
|
||||
"arn:aws:s3:::*"
|
||||
]
|
||||
}
|
||||
]
|
||||
}`,
|
||||
}
|
||||
|
||||
requestDataJSON, _ := json.Marshal(requestDataAddServiceAccount)
|
||||
@@ -75,75 +89,6 @@ func TestAddServiceAccount(t *testing.T) {
|
||||
assert.Equal(201, response.StatusCode, "Status Code is incorrect")
|
||||
}
|
||||
|
||||
requestDataPolicy := map[string]interface{}{
|
||||
"policy": `
|
||||
{
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Action": [
|
||||
"s3:GetBucketLocation",
|
||||
"s3:GetObject"
|
||||
],
|
||||
"Resource": [
|
||||
"arn:aws:s3:::*"
|
||||
]
|
||||
}
|
||||
]
|
||||
}`,
|
||||
}
|
||||
requestDataJSON, _ = json.Marshal(requestDataPolicy)
|
||||
requestDataBody = bytes.NewReader(requestDataJSON)
|
||||
request, err = http.NewRequest(
|
||||
"PUT", "http://localhost:9090/api/v1/service-accounts/"+base64.StdEncoding.EncodeToString([]byte("testuser1"))+"/policy", requestDataBody)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return
|
||||
}
|
||||
request.Header.Add("Cookie", fmt.Sprintf("token=%s", token))
|
||||
request.Header.Add("Content-Type", "application/json")
|
||||
response, err = client.Do(request)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return
|
||||
}
|
||||
if response != nil {
|
||||
fmt.Println("POST StatusCode:", response.StatusCode)
|
||||
assert.Equal(200, response.StatusCode, "Status Code is incorrect")
|
||||
}
|
||||
|
||||
// Test policy
|
||||
request, err = http.NewRequest(
|
||||
"GET", "http://localhost:9090/api/v1/service-accounts/"+base64.StdEncoding.EncodeToString([]byte("testuser1"))+"/policy", nil)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return
|
||||
}
|
||||
request.Header.Add("Cookie", fmt.Sprintf("token=%s", token))
|
||||
request.Header.Add("Content-Type", "application/json")
|
||||
response, err = client.Do(request)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return
|
||||
}
|
||||
if response != nil {
|
||||
fmt.Println("POST StatusCode:", response.StatusCode)
|
||||
assert.Equal(200, response.StatusCode, "Status Code is incorrect")
|
||||
buf := new(bytes.Buffer)
|
||||
buf.ReadFrom(response.Body)
|
||||
var actual *iampolicy.Policy
|
||||
var expected *iampolicy.Policy
|
||||
json.Unmarshal(buf.Bytes(), actual)
|
||||
policy, err := json.Marshal(requestDataAddServiceAccount["policy"])
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return
|
||||
}
|
||||
json.Unmarshal(policy, expected)
|
||||
assert.Equal(expected, actual)
|
||||
}
|
||||
|
||||
// {{baseUrl}}/user?name=proident velit
|
||||
// Investiga como se borra en el browser.
|
||||
request, err = http.NewRequest(
|
||||
@@ -305,7 +250,6 @@ func TestCreateServiceAccountForUserWithCredentials(t *testing.T) {
|
||||
userName := "testcreateserviceaccountforuserwithcredentials1"
|
||||
assert := assert.New(t)
|
||||
policy := ""
|
||||
serviceAccountLengthInBytes := 40 // As observed, update as needed
|
||||
|
||||
// 1. Create the user
|
||||
groups := []string{}
|
||||
@@ -383,7 +327,6 @@ func TestCreateServiceAccountForUserWithCredentials(t *testing.T) {
|
||||
finalResponse,
|
||||
)
|
||||
}
|
||||
assert.Equal(len(finalResponse), serviceAccountLengthInBytes, finalResponse)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -21,11 +21,11 @@ package integration
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
@@ -34,8 +34,9 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/minio/console/models"
|
||||
"github.com/minio/minio-go/v7"
|
||||
|
||||
"github.com/minio/console/models"
|
||||
"github.com/minio/minio-go/v7/pkg/credentials"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
@@ -43,14 +44,14 @@ import (
|
||||
type AddBucketOps struct {
|
||||
Name string
|
||||
Locking bool
|
||||
Versioning bool
|
||||
Versioning map[string]interface{}
|
||||
Quota map[string]interface{}
|
||||
Retention map[string]interface{}
|
||||
Endpoint *string
|
||||
UseToken *string
|
||||
}
|
||||
|
||||
func AddBucket(name string, locking, versioning bool, quota, retention map[string]interface{}) (*http.Response, error) {
|
||||
func AddBucket(name string, locking bool, versioning, quota, retention map[string]interface{}) (*http.Response, error) {
|
||||
return AddBucketWithOpts(&AddBucketOps{
|
||||
Name: name,
|
||||
Locking: locking,
|
||||
@@ -143,11 +144,11 @@ func getTokenForEndpoint(endpoint string) string {
|
||||
return loginToken
|
||||
}
|
||||
|
||||
func setupBucket(name string, locking, versioning bool, quota, retention map[string]interface{}, assert *assert.Assertions, expected int) bool {
|
||||
func setupBucket(name string, locking bool, versioning, quota, retention map[string]interface{}, assert *assert.Assertions, expected int) bool {
|
||||
return setupBucketForEndpoint(name, locking, versioning, quota, retention, assert, expected, nil, nil)
|
||||
}
|
||||
|
||||
func setupBucketForEndpoint(name string, locking, versioning bool, quota, retention map[string]interface{}, assert *assert.Assertions, expected int, endpoint, endpointToken *string) bool {
|
||||
func setupBucketForEndpoint(name string, locking bool, versioning, quota, retention map[string]interface{}, assert *assert.Assertions, expected int, endpoint, endpointToken *string) bool {
|
||||
/*
|
||||
The intention of this function is to return either true or false to
|
||||
reduce the code by performing the verification in one place only.
|
||||
@@ -167,6 +168,10 @@ func setupBucketForEndpoint(name string, locking, versioning bool, quota, retent
|
||||
return false
|
||||
}
|
||||
if response != nil {
|
||||
if response.StatusCode >= 200 && response.StatusCode <= 299 {
|
||||
fmt.Println("setupBucketForEndpoint(): HTTP Status is in the 2xx range")
|
||||
return true
|
||||
}
|
||||
if response.StatusCode != expected {
|
||||
assert.Fail(inspectHTTPResponse(response))
|
||||
return false
|
||||
@@ -391,9 +396,10 @@ func UploadAnObject(bucketName, fileName string) (*http.Response, error) {
|
||||
contentType + boundaryEnd
|
||||
arrayOfBytes := []byte(file)
|
||||
requestDataBody := bytes.NewReader(arrayOfBytes)
|
||||
apiURL := "http://localhost:9090/api/v1/buckets/" + bucketName + "/objects/upload" + "?prefix=" + base64.StdEncoding.EncodeToString([]byte(fileName))
|
||||
request, err := http.NewRequest(
|
||||
"POST",
|
||||
"http://localhost:9090/api/v1/buckets/"+bucketName+"/objects/upload",
|
||||
apiURL,
|
||||
requestDataBody,
|
||||
)
|
||||
if err != nil {
|
||||
@@ -417,8 +423,9 @@ func DeleteObject(bucketName, path string, recursive, allVersions bool) (*http.R
|
||||
DELETE:
|
||||
{{baseUrl}}/buckets/bucketName/objects?path=Y2VzYXJpby50eHQ=&recursive=false&all_versions=false
|
||||
*/
|
||||
url := "http://localhost:9090/api/v1/buckets/" + bucketName + "/objects?path=" +
|
||||
path + "&recursive=" + strconv.FormatBool(recursive) + "&all_versions=" +
|
||||
prefixEncoded := base64.StdEncoding.EncodeToString([]byte(path))
|
||||
url := "http://localhost:9090/api/v1/buckets/" + bucketName + "/objects?prefix=" +
|
||||
prefixEncoded + "&recursive=" + strconv.FormatBool(recursive) + "&all_versions=" +
|
||||
strconv.FormatBool(allVersions)
|
||||
request, err := http.NewRequest(
|
||||
"DELETE",
|
||||
@@ -484,9 +491,11 @@ func PutObjectsRetentionStatus(bucketName, prefix, versionID, mode, expires stri
|
||||
}
|
||||
requestDataJSON, _ := json.Marshal(requestDataAdd)
|
||||
requestDataBody := bytes.NewReader(requestDataJSON)
|
||||
apiURL := "http://localhost:9090/api/v1/buckets/" + bucketName + "/objects/retention?prefix=" + prefix + "&version_id=" + versionID
|
||||
|
||||
request, err := http.NewRequest(
|
||||
"PUT",
|
||||
"http://localhost:9090/api/v1/buckets/"+bucketName+"/objects/retention?prefix="+prefix+"&version_id="+versionID,
|
||||
apiURL,
|
||||
requestDataBody,
|
||||
)
|
||||
if err != nil {
|
||||
@@ -722,9 +731,10 @@ func PutObjectsLegalholdStatus(bucketName, prefix, status, versionID string) (*h
|
||||
}
|
||||
requestDataJSON, _ := json.Marshal(requestDataAdd)
|
||||
requestDataBody := bytes.NewReader(requestDataJSON)
|
||||
apiURL := "http://localhost:9090/api/v1/buckets/" + bucketName + "/objects/legalhold?prefix=" + prefix + "&version_id=" + versionID
|
||||
request, err := http.NewRequest(
|
||||
"PUT",
|
||||
"http://localhost:9090/api/v1/buckets/"+bucketName+"/objects/legalhold?prefix="+prefix+"&version_id="+versionID,
|
||||
apiURL,
|
||||
requestDataBody,
|
||||
)
|
||||
if err != nil {
|
||||
@@ -743,19 +753,19 @@ func TestPutObjectsLegalholdStatus(t *testing.T) {
|
||||
// Variables
|
||||
assert := assert.New(t)
|
||||
bucketName := "testputobjectslegalholdstatus"
|
||||
fileName := "testputobjectslegalholdstatus.txt"
|
||||
prefix := "dGVzdHB1dG9iamVjdHNsZWdhbGhvbGRzdGF0dXMudHh0" // encoded base64
|
||||
objName := "testputobjectslegalholdstatus.txt" // // encoded base64 of testputobjectslegalholdstatus.txt = dGVzdHB1dG9iamVjdHNsZWdhbGhvbGRzdGF0dXMudHh0
|
||||
objectNameEncoded := "dGVzdHB1dG9iamVjdHNsZWdhbGhvbGRzdGF0dXMudHh0"
|
||||
status := "enabled"
|
||||
|
||||
// 1. Create bucket
|
||||
if !setupBucket(bucketName, true, true, nil, nil, assert, 201) {
|
||||
if !setupBucket(bucketName, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
// 2. Add object
|
||||
uploadResponse, uploadError := UploadAnObject(
|
||||
bucketName,
|
||||
fileName,
|
||||
objName,
|
||||
)
|
||||
assert.Nil(uploadError)
|
||||
if uploadError != nil {
|
||||
@@ -772,8 +782,8 @@ func TestPutObjectsLegalholdStatus(t *testing.T) {
|
||||
}
|
||||
|
||||
// Get versionID
|
||||
listResponse, _ := ListObjects(bucketName, prefix, "true")
|
||||
bodyBytes, _ := ioutil.ReadAll(listResponse.Body)
|
||||
listResponse, _ := ListObjects(bucketName, "", "true")
|
||||
bodyBytes, _ := io.ReadAll(listResponse.Body)
|
||||
listObjs := models.ListObjectsResponse{}
|
||||
err := json.Unmarshal(bodyBytes, &listObjs)
|
||||
if err != nil {
|
||||
@@ -810,7 +820,7 @@ func TestPutObjectsLegalholdStatus(t *testing.T) {
|
||||
// 3. Put Objects Legal Status
|
||||
putResponse, putError := PutObjectsLegalholdStatus(
|
||||
bucketName,
|
||||
prefix,
|
||||
objectNameEncoded,
|
||||
status,
|
||||
tt.args.versionID,
|
||||
)
|
||||
@@ -835,7 +845,7 @@ func TestGetBucketQuota(t *testing.T) {
|
||||
validBucket := "testgetbucketquota"
|
||||
|
||||
// 1. Create bucket
|
||||
if !setupBucket(validBucket, true, true, nil, nil, assert, 201) {
|
||||
if !setupBucket(validBucket, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -912,7 +922,7 @@ func TestPutBucketQuota(t *testing.T) {
|
||||
validBucket := "testputbucketquota"
|
||||
|
||||
// 1. Create bucket
|
||||
if !setupBucket(validBucket, true, true, nil, nil, assert, 201) {
|
||||
if !setupBucket(validBucket, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -971,7 +981,7 @@ func TestListBucketEvents(t *testing.T) {
|
||||
validBucket := "testlistbucketevents"
|
||||
|
||||
// 1. Create bucket
|
||||
if !setupBucket(validBucket, true, true, nil, nil, assert, 201) {
|
||||
if !setupBucket(validBucket, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1029,7 +1039,7 @@ func TestDeleteObjectsRetentionStatus(t *testing.T) {
|
||||
validPrefix := encodeBase64(fileName)
|
||||
|
||||
// 1. Create bucket
|
||||
if !setupBucket(bucketName, true, true, nil, nil, assert, 201) {
|
||||
if !setupBucket(bucketName, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1054,7 +1064,7 @@ func TestDeleteObjectsRetentionStatus(t *testing.T) {
|
||||
|
||||
// Get versionID
|
||||
listResponse, _ := ListObjects(bucketName, validPrefix, "true")
|
||||
bodyBytes, _ := ioutil.ReadAll(listResponse.Body)
|
||||
bodyBytes, _ := io.ReadAll(listResponse.Body)
|
||||
listObjs := models.ListObjectsResponse{}
|
||||
err := json.Unmarshal(bodyBytes, &listObjs)
|
||||
if err != nil {
|
||||
@@ -1136,7 +1146,7 @@ func TestBucketSetPolicy(t *testing.T) {
|
||||
validBucketName := "testbucketsetpolicy"
|
||||
|
||||
// 1. Create bucket
|
||||
if !setupBucket(validBucketName, true, true, nil, nil, assert, 201) {
|
||||
if !setupBucket(validBucketName, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1197,7 +1207,7 @@ func TestRestoreObjectToASelectedVersion(t *testing.T) {
|
||||
validPrefix := encodeBase64(fileName)
|
||||
|
||||
// 1. Create bucket
|
||||
if !setupBucket(bucketName, true, true, nil, nil, assert, 201) {
|
||||
if !setupBucket(bucketName, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1222,7 +1232,7 @@ func TestRestoreObjectToASelectedVersion(t *testing.T) {
|
||||
|
||||
// 3. Get versionID
|
||||
listResponse, _ := ListObjects(bucketName, validPrefix, "true")
|
||||
bodyBytes, _ := ioutil.ReadAll(listResponse.Body)
|
||||
bodyBytes, _ := io.ReadAll(listResponse.Body)
|
||||
listObjs := models.ListObjectsResponse{}
|
||||
err := json.Unmarshal(bodyBytes, &listObjs)
|
||||
if err != nil {
|
||||
@@ -1285,7 +1295,7 @@ func TestPutBucketsTags(t *testing.T) {
|
||||
// 1. Create the bucket
|
||||
assert := assert.New(t)
|
||||
validBucketName := "testputbuckettags1"
|
||||
if !setupBucket(validBucketName, false, false, nil, nil, assert, 201) {
|
||||
if !setupBucket(validBucketName, false, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1343,7 +1353,7 @@ func TestGetsTheMetadataOfAnObject(t *testing.T) {
|
||||
tags["tag"] = "testputobjecttagbucketonetagone"
|
||||
|
||||
// 1. Create the bucket
|
||||
if !setupBucket(bucketName, false, false, nil, nil, assert, 201) {
|
||||
if !setupBucket(bucketName, false, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1414,7 +1424,7 @@ func TestPutObjectsRetentionStatus(t *testing.T) {
|
||||
prefix := encodeBase64(fileName)
|
||||
|
||||
// 1. Create bucket
|
||||
if !setupBucket(bucketName, true, true, nil, nil, assert, 201) {
|
||||
if !setupBucket(bucketName, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1439,7 +1449,7 @@ func TestPutObjectsRetentionStatus(t *testing.T) {
|
||||
|
||||
// Get versionID
|
||||
listResponse, _ := ListObjects(bucketName, prefix, "true")
|
||||
bodyBytes, _ := ioutil.ReadAll(listResponse.Body)
|
||||
bodyBytes, _ := io.ReadAll(listResponse.Body)
|
||||
listObjs := models.ListObjectsResponse{}
|
||||
err := json.Unmarshal(bodyBytes, &listObjs)
|
||||
if err != nil {
|
||||
@@ -1512,7 +1522,7 @@ func TestShareObjectOnURL(t *testing.T) {
|
||||
versionID := "null"
|
||||
|
||||
// 1. Create the bucket
|
||||
if !setupBucket(bucketName, false, false, nil, nil, assert, 201) {
|
||||
if !setupBucket(bucketName, false, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1586,7 +1596,7 @@ func TestListObjects(t *testing.T) {
|
||||
fileName := "testlistobjecttobucket1.txt"
|
||||
|
||||
// 1. Create the bucket
|
||||
if !setupBucket(bucketName, false, false, nil, nil, assert, 201) {
|
||||
if !setupBucket(bucketName, false, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1630,11 +1640,10 @@ func TestDeleteObject(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
bucketName := "testdeleteobjectbucket1"
|
||||
fileName := "testdeleteobjectfile"
|
||||
path := "dGVzdGRlbGV0ZW9iamVjdGZpbGUxLnR4dA==" // fileName encoded base64
|
||||
numberOfFiles := 2
|
||||
|
||||
// 1. Create bucket
|
||||
if !setupBucket(bucketName, true, true, nil, nil, assert, 201) {
|
||||
if !setupBucket(bucketName, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1653,8 +1662,9 @@ func TestDeleteObject(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
objPathFull := fileName + "1.txt" // would be encoded in DeleteObject util method.
|
||||
// 3. Delete only one object from the bucket.
|
||||
deleteResponse, deleteError := DeleteObject(bucketName, path, false, false)
|
||||
deleteResponse, deleteError := DeleteObject(bucketName, objPathFull, false, false)
|
||||
assert.Nil(deleteError)
|
||||
if deleteError != nil {
|
||||
log.Println(deleteError)
|
||||
@@ -1700,7 +1710,7 @@ func TestUploadObjectToBucket(t *testing.T) {
|
||||
fileName := "sample.txt"
|
||||
|
||||
// 1. Create the bucket
|
||||
if !setupBucket(bucketName, false, false, nil, nil, assert, 201) {
|
||||
if !setupBucket(bucketName, false, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1735,7 +1745,7 @@ func TestDownloadObject(t *testing.T) {
|
||||
}
|
||||
|
||||
// 1. Create the bucket
|
||||
if !setupBucket(bucketName, true, true, nil, nil, assert, 201) {
|
||||
if !setupBucket(bucketName, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1772,7 +1782,7 @@ func TestDownloadObject(t *testing.T) {
|
||||
}
|
||||
|
||||
// 4. Verify the file was downloaded
|
||||
files, err := ioutil.ReadDir(workingDirectory)
|
||||
files, err := os.ReadDir(workingDirectory)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -1797,7 +1807,7 @@ func TestDeleteMultipleObjects(t *testing.T) {
|
||||
fileName := "testdeletemultipleobjs"
|
||||
|
||||
// 1. Create a bucket for this particular test
|
||||
if !setupBucket(bucketName, false, false, nil, nil, assert, 201) {
|
||||
if !setupBucket(bucketName, false, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1874,7 +1884,7 @@ func TestPutObjectTag(t *testing.T) {
|
||||
versionID := "null"
|
||||
|
||||
// 1. Create the bucket
|
||||
if !setupBucket(bucketName, false, false, nil, nil, assert, 201) {
|
||||
if !setupBucket(bucketName, false, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1948,7 +1958,7 @@ func TestBucketRetention(t *testing.T) {
|
||||
retention["mode"] = "compliance"
|
||||
retention["unit"] = "years"
|
||||
retention["validity"] = 2
|
||||
if !setupBucket("setbucketretention1", true, true, nil, retention, assert, 201) {
|
||||
if !setupBucket("setbucketretention1", true, map[string]interface{}{"enabled": true}, nil, retention, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1999,7 +2009,7 @@ func TestBucketInformationGenericErrorResponse(t *testing.T) {
|
||||
|
||||
// 1. Create the bucket
|
||||
assert := assert.New(t)
|
||||
if !setupBucket("bucketinformation2", false, false, nil, nil, assert, 201) {
|
||||
if !setupBucket("bucketinformation2", false, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -2044,7 +2054,7 @@ func TestBucketInformationSuccessfulResponse(t *testing.T) {
|
||||
|
||||
// 1. Create the bucket
|
||||
assert := assert.New(t)
|
||||
if !setupBucket("bucketinformation1", false, false, nil, nil, assert, 201) {
|
||||
if !setupBucket("bucketinformation1", false, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -2157,29 +2167,23 @@ func TestListBuckets(t *testing.T) {
|
||||
// 1. Create buckets
|
||||
numberOfBuckets := 3
|
||||
for i := 1; i <= numberOfBuckets; i++ {
|
||||
if !setupBucket("testlistbuckets"+strconv.Itoa(i), false, false, nil, nil, assert, 201) {
|
||||
if !setupBucket("testlistbuckets"+strconv.Itoa(i), false, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// Waiting to retrieve the new list of buckets
|
||||
time.Sleep(3 * time.Second)
|
||||
|
||||
// 2. List buckets
|
||||
listBucketsResponse, listBucketsError := ListBuckets()
|
||||
assert.Nil(listBucketsError)
|
||||
if listBucketsError != nil {
|
||||
log.Println(listBucketsError)
|
||||
assert.Fail("Error listing the buckets")
|
||||
return
|
||||
}
|
||||
|
||||
assert.NotNil(listBucketsResponse)
|
||||
assert.NotNil(listBucketsResponse.Body)
|
||||
// 3. Verify list of buckets
|
||||
b, err := io.ReadAll(listBucketsResponse.Body)
|
||||
if listBucketsResponse != nil {
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
assert.Equal(200, listBucketsResponse.StatusCode,
|
||||
"Status Code is incorrect: "+string(b))
|
||||
}
|
||||
b, _ := io.ReadAll(listBucketsResponse.Body)
|
||||
assert.Equal(200, listBucketsResponse.StatusCode,
|
||||
"Status Code is incorrect: "+string(b))
|
||||
for i := 1; i <= numberOfBuckets; i++ {
|
||||
assert.True(strings.Contains(string(b),
|
||||
"testlistbuckets"+strconv.Itoa(i)))
|
||||
@@ -2211,7 +2215,7 @@ func TestBucketsGet(t *testing.T) {
|
||||
|
||||
if response != nil {
|
||||
assert.Equal(200, response.StatusCode, "Status Code is incorrect")
|
||||
bodyBytes, _ := ioutil.ReadAll(response.Body)
|
||||
bodyBytes, _ := io.ReadAll(response.Body)
|
||||
|
||||
listBuckets := models.ListBucketsResponse{}
|
||||
err = json.Unmarshal(bodyBytes, &listBuckets)
|
||||
@@ -2251,7 +2255,7 @@ func TestBucketVersioning(t *testing.T) {
|
||||
|
||||
if response != nil {
|
||||
|
||||
bodyBytes, _ := ioutil.ReadAll(response.Body)
|
||||
bodyBytes, _ := io.ReadAll(response.Body)
|
||||
|
||||
sessionResponse := models.SessionResponse{}
|
||||
err = json.Unmarshal(bodyBytes, &sessionResponse)
|
||||
@@ -2273,7 +2277,7 @@ func TestBucketVersioning(t *testing.T) {
|
||||
|
||||
requestDataBody := bytes.NewReader(requestDataJSON)
|
||||
|
||||
if !setupBucket("test2", true, false, nil, nil, assert, 201) {
|
||||
if !setupBucket("test2", true, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -2288,7 +2292,7 @@ func TestBucketVersioning(t *testing.T) {
|
||||
assert.Equal(
|
||||
200, getVersioningResult.StatusCode, "Status Code is incorrect")
|
||||
}
|
||||
bodyBytes, _ := ioutil.ReadAll(getVersioningResult.Body)
|
||||
bodyBytes, _ := io.ReadAll(getVersioningResult.Body)
|
||||
structBucketRepl := models.BucketVersioningResponse{
|
||||
ExcludeFolders: false,
|
||||
ExcludedPrefixes: nil,
|
||||
@@ -2310,12 +2314,12 @@ func TestBucketVersioning(t *testing.T) {
|
||||
if distributedSystem {
|
||||
assert.Equal(200, response.StatusCode, "Versioning test Status Code is incorrect - bucket failed to create")
|
||||
} else {
|
||||
assert.NotEqual(201, response.StatusCode, "Versioning test Status Code is incorrect - versioned bucket created on non-distributed system")
|
||||
assert.NotEqual(200, response.StatusCode, "Versioning test Status Code is incorrect - versioned bucket created on non-distributed system")
|
||||
}
|
||||
|
||||
request, error := http.NewRequest("DELETE", "http://localhost:9090/api/v1/buckets/test2", requestDataBody)
|
||||
if error != nil {
|
||||
log.Println(error)
|
||||
request, err = http.NewRequest("DELETE", "http://localhost:9090/api/v1/buckets/test2", requestDataBody)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -2341,7 +2345,7 @@ func TestSetBucketTags(t *testing.T) {
|
||||
}
|
||||
|
||||
// put bucket
|
||||
if !setupBucket("test4", false, false, nil, nil, assert, 201) {
|
||||
if !setupBucket("test4", false, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -2365,7 +2369,7 @@ func TestSetBucketTags(t *testing.T) {
|
||||
request.Header.Add("Cookie", fmt.Sprintf("token=%s", token))
|
||||
request.Header.Add("Content-Type", "application/json")
|
||||
|
||||
response, err := client.Do(request)
|
||||
_, err = client.Do(request)
|
||||
assert.Nil(err)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
@@ -2383,14 +2387,14 @@ func TestSetBucketTags(t *testing.T) {
|
||||
request.Header.Add("Cookie", fmt.Sprintf("token=%s", token))
|
||||
request.Header.Add("Content-Type", "application/json")
|
||||
|
||||
response, err = client.Do(request)
|
||||
response, err := client.Do(request)
|
||||
assert.Nil(err)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return
|
||||
}
|
||||
|
||||
bodyBytes, _ := ioutil.ReadAll(response.Body)
|
||||
bodyBytes, _ := io.ReadAll(response.Body)
|
||||
|
||||
bucket := models.Bucket{}
|
||||
err = json.Unmarshal(bodyBytes, &bucket)
|
||||
@@ -2408,7 +2412,7 @@ func TestGetBucket(t *testing.T) {
|
||||
Timeout: 2 * time.Second,
|
||||
}
|
||||
|
||||
if !setupBucket("test3", false, false, nil, nil, assert, 201) {
|
||||
if !setupBucket("test3", false, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -2446,7 +2450,7 @@ func TestAddBucket(t *testing.T) {
|
||||
}{
|
||||
{
|
||||
name: "Add Bucket with valid name",
|
||||
expectedStatus: 201,
|
||||
expectedStatus: 200,
|
||||
args: args{
|
||||
bucketName: "test1",
|
||||
},
|
||||
@@ -2461,7 +2465,7 @@ func TestAddBucket(t *testing.T) {
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if !setupBucket(tt.args.bucketName, false, false, nil, nil, assert, tt.expectedStatus) {
|
||||
if !setupBucket(tt.args.bucketName, false, nil, nil, nil, assert, tt.expectedStatus) {
|
||||
return
|
||||
}
|
||||
})
|
||||
@@ -2843,7 +2847,7 @@ func TestReplication(t *testing.T) {
|
||||
}
|
||||
|
||||
// 3. Get rule ID and status from response's body
|
||||
bodyBytes, _ := ioutil.ReadAll(response.Body)
|
||||
bodyBytes, _ := io.ReadAll(response.Body)
|
||||
structBucketRepl := models.BucketReplicationResponse{}
|
||||
err = json.Unmarshal(bodyBytes, &structBucketRepl)
|
||||
if err != nil {
|
||||
@@ -2925,7 +2929,7 @@ func TestReplication(t *testing.T) {
|
||||
}
|
||||
|
||||
// 9. Get rule ID and status from response's body
|
||||
bodyBytes, _ = ioutil.ReadAll(response.Body)
|
||||
bodyBytes, _ = io.ReadAll(response.Body)
|
||||
structBucketRepl = models.BucketReplicationResponse{}
|
||||
err = json.Unmarshal(bodyBytes, &structBucketRepl)
|
||||
if err != nil {
|
||||
@@ -2992,7 +2996,7 @@ func TestReturnsTheStatusOfObjectLockingSupportOnTheBucket(t *testing.T) {
|
||||
}
|
||||
|
||||
// 2. Verify the status to be enabled for this bucket
|
||||
bodyBytes, _ := ioutil.ReadAll(response.Body)
|
||||
bodyBytes, _ := io.ReadAll(response.Body)
|
||||
structBucketLocking := models.BucketObLockingResponse{}
|
||||
err = json.Unmarshal(bodyBytes, &structBucketLocking)
|
||||
if err != nil {
|
||||
@@ -3006,7 +3010,7 @@ func TestReturnsTheStatusOfObjectLockingSupportOnTheBucket(t *testing.T) {
|
||||
)
|
||||
}
|
||||
|
||||
func SetBucketVersioning(bucketName string, versioning bool, endpoint, useToken *string) (*http.Response, error) {
|
||||
func SetBucketVersioning(bucketName string, versioning map[string]interface{}, endpoint, useToken *string) (*http.Response, error) {
|
||||
/*
|
||||
Helper function to set Bucket Versioning
|
||||
*/
|
||||
@@ -3043,15 +3047,15 @@ func TestSetBucketVersioning(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
bucket := "test-set-bucket-versioning"
|
||||
locking := false
|
||||
versioning := true
|
||||
versioning := map[string]interface{}{"enabled": true}
|
||||
|
||||
// 1. Create bucket with versioning as true and locking as false
|
||||
if !setupBucket(bucket, locking, versioning, nil, nil, assert, 201) {
|
||||
if !setupBucket(bucket, locking, versioning, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
// 2. Set versioning as False i.e Suspend versioning
|
||||
response, err := SetBucketVersioning(bucket, false, nil, nil)
|
||||
response, err := SetBucketVersioning(bucket, map[string]interface{}{"enabled": false}, nil, nil)
|
||||
assert.Nil(err)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
@@ -3073,7 +3077,7 @@ func TestSetBucketVersioning(t *testing.T) {
|
||||
assert.Equal(
|
||||
200, getVersioningResult.StatusCode, "Status Code is incorrect")
|
||||
}
|
||||
bodyBytes, _ := ioutil.ReadAll(getVersioningResult.Body)
|
||||
bodyBytes, _ := io.ReadAll(getVersioningResult.Body)
|
||||
result := models.BucketVersioningResponse{
|
||||
ExcludeFolders: false,
|
||||
ExcludedPrefixes: nil,
|
||||
@@ -3124,12 +3128,11 @@ func TestEnableBucketEncryption(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
bucketName := "test-enable-bucket-encryption"
|
||||
locking := false
|
||||
versioning := false
|
||||
encType := "sse-s3"
|
||||
kmsKeyID := ""
|
||||
|
||||
// 1. Add bucket
|
||||
if !setupBucket(bucketName, locking, versioning, nil, nil, assert, 201) {
|
||||
if !setupBucket(bucketName, locking, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -3156,7 +3159,7 @@ func TestEnableBucketEncryption(t *testing.T) {
|
||||
assert.Equal(
|
||||
200, resp.StatusCode, "Status Code is incorrect")
|
||||
}
|
||||
bodyBytes, _ := ioutil.ReadAll(resp.Body)
|
||||
bodyBytes, _ := io.ReadAll(resp.Body)
|
||||
result := models.BucketEncryptionInfo{}
|
||||
err = json.Unmarshal(bodyBytes, &result)
|
||||
if err != nil {
|
||||
@@ -3188,14 +3191,14 @@ func TestEnableBucketEncryption(t *testing.T) {
|
||||
assert.Equal(
|
||||
404, resp.StatusCode, "Status Code is incorrect")
|
||||
}
|
||||
bodyBytes, _ = ioutil.ReadAll(resp.Body)
|
||||
result2 := models.Error{}
|
||||
bodyBytes, _ = io.ReadAll(resp.Body)
|
||||
result2 := models.APIError{}
|
||||
err = json.Unmarshal(bodyBytes, &result2)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
assert.Nil(err)
|
||||
}
|
||||
dereferencedPointerDetailedMessage := *result2.DetailedMessage
|
||||
dereferencedPointerDetailedMessage := result2.DetailedMessage
|
||||
assert.Equal("error server side encryption configuration not found", dereferencedPointerDetailedMessage, dereferencedPointerDetailedMessage)
|
||||
}
|
||||
|
||||
@@ -3387,7 +3390,6 @@ func TestBucketLifeCycle(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
bucketName := "test-bucket-life-cycle"
|
||||
locking := false
|
||||
versioning := false
|
||||
ltype := "expiry"
|
||||
prefix := ""
|
||||
tags := ""
|
||||
@@ -3398,7 +3400,7 @@ func TestBucketLifeCycle(t *testing.T) {
|
||||
var noncurrentversionExpirationDays int64
|
||||
|
||||
// 1. Add bucket
|
||||
if !setupBucket(bucketName, locking, versioning, nil, nil, assert, 201) {
|
||||
if !setupBucket(bucketName, locking, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -3433,7 +3435,7 @@ func TestBucketLifeCycle(t *testing.T) {
|
||||
assert.Equal(
|
||||
200, resp.StatusCode, "Status Code is incorrect")
|
||||
}
|
||||
bodyBytes, _ := ioutil.ReadAll(resp.Body)
|
||||
bodyBytes, _ := io.ReadAll(resp.Body)
|
||||
result := models.BucketLifecycleResponse{}
|
||||
err = json.Unmarshal(bodyBytes, &result)
|
||||
if err != nil {
|
||||
@@ -3479,7 +3481,7 @@ func TestBucketLifeCycle(t *testing.T) {
|
||||
assert.Equal(
|
||||
200, resp.StatusCode, "Status Code is incorrect")
|
||||
}
|
||||
bodyBytes, _ = ioutil.ReadAll(resp.Body)
|
||||
bodyBytes, _ = io.ReadAll(resp.Body)
|
||||
result = models.BucketLifecycleResponse{}
|
||||
err = json.Unmarshal(bodyBytes, &result)
|
||||
if err != nil {
|
||||
@@ -3603,12 +3605,11 @@ func TestAccessRule(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
bucketName := "test-access-rule-bucket"
|
||||
locking := false
|
||||
versioning := false
|
||||
prefix := "prefix"
|
||||
access := "readonly"
|
||||
|
||||
// 1. Add bucket
|
||||
if !setupBucket(bucketName, locking, versioning, nil, nil, assert, 201) {
|
||||
if !setupBucket(bucketName, locking, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -3639,7 +3640,7 @@ func TestAccessRule(t *testing.T) {
|
||||
assert.Equal(
|
||||
200, resp.StatusCode, "Status Code is incorrect")
|
||||
}
|
||||
bodyBytes, _ := ioutil.ReadAll(resp.Body)
|
||||
bodyBytes, _ := io.ReadAll(resp.Body)
|
||||
result := models.ListAccessRulesResponse{}
|
||||
err = json.Unmarshal(bodyBytes, &result)
|
||||
if err != nil {
|
||||
@@ -3677,7 +3678,7 @@ func TestAccessRule(t *testing.T) {
|
||||
assert.Equal(
|
||||
200, resp.StatusCode, "Status Code is incorrect")
|
||||
}
|
||||
bodyBytes, _ = ioutil.ReadAll(resp.Body)
|
||||
bodyBytes, _ = io.ReadAll(resp.Body)
|
||||
result = models.ListAccessRulesResponse{}
|
||||
err = json.Unmarshal(bodyBytes, &result)
|
||||
if err != nil {
|
||||
@@ -3852,16 +3853,16 @@ func TestAddRemoteBucket(t *testing.T) {
|
||||
fmt.Println("targetBucket: ", targetBucket)
|
||||
|
||||
// 1. Create bucket
|
||||
if !setupBucket("source", true, true, nil, nil, assert, 201) {
|
||||
if !setupBucket("source", true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
// 1.1. Create target bucket
|
||||
targetEndpoint := "http://localhost:9092"
|
||||
targetToken := getTokenForEndpoint(targetEndpoint)
|
||||
if !setupBucketForEndpoint(targetBucket, true, true, nil, nil, assert, 201, &targetEndpoint, &targetToken) {
|
||||
if !setupBucketForEndpoint(targetBucket, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200, &targetEndpoint, &targetToken) {
|
||||
log.Println("bucket already exists")
|
||||
}
|
||||
_, err := SetBucketVersioning(targetBucket, false, &targetURL, &targetToken)
|
||||
_, err := SetBucketVersioning(targetBucket, map[string]interface{}{"enabled": false}, &targetURL, &targetToken)
|
||||
if err != nil {
|
||||
log.Println("bucket already has versioning")
|
||||
}
|
||||
@@ -3911,16 +3912,16 @@ func TestDeleteRemoteBucket(t *testing.T) {
|
||||
fmt.Println("targetBucket: ", targetBucket)
|
||||
|
||||
// 1. Create bucket
|
||||
if !setupBucket("deletesource", true, true, nil, nil, assert, 201) {
|
||||
if !setupBucket("deletesource", true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
// 1.1. Create target bucket
|
||||
targetEndpoint := "http://localhost:9092"
|
||||
targetToken := getTokenForEndpoint(targetEndpoint)
|
||||
if !setupBucketForEndpoint(targetBucket, true, true, nil, nil, assert, 201, &targetEndpoint, &targetToken) {
|
||||
if !setupBucketForEndpoint(targetBucket, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200, &targetEndpoint, &targetToken) {
|
||||
log.Println("bucket already exists")
|
||||
}
|
||||
_, err := SetBucketVersioning(targetBucket, false, &targetURL, &targetToken)
|
||||
_, err := SetBucketVersioning(targetBucket, map[string]interface{}{"enabled": false}, &targetURL, &targetToken)
|
||||
if err != nil {
|
||||
log.Println("bucket already has versioning")
|
||||
}
|
||||
@@ -3946,21 +3947,13 @@ func TestDeleteRemoteBucket(t *testing.T) {
|
||||
// 3. Get ARN
|
||||
resp, err = GetRemoteBucketARN(sourceBucket)
|
||||
assert.Nil(err)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return
|
||||
}
|
||||
bodyBytes, _ := ioutil.ReadAll(resp.Body)
|
||||
assert.NotNil(resp)
|
||||
assert.NotNil(resp.Body)
|
||||
bodyBytes, _ := io.ReadAll(resp.Body)
|
||||
remoteBucket := models.RemoteBucket{}
|
||||
err = json.Unmarshal(bodyBytes, &remoteBucket)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
assert.Nil(err)
|
||||
}
|
||||
if resp != nil {
|
||||
assert.Equal(
|
||||
200, resp.StatusCode, inspectHTTPResponse(resp))
|
||||
}
|
||||
assert.Nil(err)
|
||||
assert.Equal(200, resp.StatusCode, inspectHTTPResponse(resp))
|
||||
|
||||
// 4. Delete Remote Bucket
|
||||
if remoteBucket.RemoteARN != nil {
|
||||
|
||||
@@ -715,7 +715,6 @@ func TestCreateServiceAccountForUser(t *testing.T) {
|
||||
userName := "testcreateserviceaccountforuser1"
|
||||
assert := assert.New(t)
|
||||
policy := ""
|
||||
serviceAccountLengthInBytes := 40 // As observed, update as needed
|
||||
|
||||
// 1. Create the user
|
||||
groups := []string{}
|
||||
@@ -765,8 +764,6 @@ func TestCreateServiceAccountForUser(t *testing.T) {
|
||||
finalResponse,
|
||||
)
|
||||
}
|
||||
|
||||
assert.Equal(len(finalResponse), serviceAccountLengthInBytes, finalResponse)
|
||||
}
|
||||
|
||||
func TestUsersGroupsBulk(t *testing.T) {
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
// This file is part of MinIO Console Server
|
||||
// Copyright (c) 2022 MinIO, Inc.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package integration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func Test_VersionAPI(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
type args struct {
|
||||
api string
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
expectedStatus int
|
||||
expectedError error
|
||||
}{
|
||||
{
|
||||
name: "Check Version",
|
||||
args: args{
|
||||
api: "/check-version",
|
||||
},
|
||||
expectedStatus: 200,
|
||||
expectedError: nil,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
client := &http.Client{
|
||||
Timeout: 3 * time.Second,
|
||||
}
|
||||
request, err := http.NewRequest(
|
||||
"GET", fmt.Sprintf("http://localhost:9090/api/v1%s", tt.args.api), nil)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return
|
||||
}
|
||||
request.Header.Add("Content-Type", "application/json")
|
||||
response, err := client.Do(request)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return
|
||||
}
|
||||
if response != nil {
|
||||
assert.Equal(tt.expectedStatus, response.StatusCode, "Status Code is incorrect")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -46,6 +46,9 @@ type AddBucketLifecycle struct {
|
||||
// Required in case of expiry_date or transition fields are not set. it defines an expiry days for ILM
|
||||
ExpiryDays int32 `json:"expiry_days,omitempty"`
|
||||
|
||||
// Non required, can be set in case of expiration is enabled
|
||||
NewerNoncurrentversionExpirationVersions int32 `json:"newer_noncurrentversion_expiration_versions,omitempty"`
|
||||
|
||||
// Non required, can be set in case of expiration is enabled
|
||||
NoncurrentversionExpirationDays int32 `json:"noncurrentversion_expiration_days,omitempty"`
|
||||
|
||||
|
||||
@@ -228,6 +228,11 @@ func (m *AdminInfoResponse) ContextValidate(ctx context.Context, formats strfmt.
|
||||
func (m *AdminInfoResponse) contextValidateBackend(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Backend != nil {
|
||||
|
||||
if swag.IsZero(m.Backend) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Backend.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("backend")
|
||||
@@ -246,6 +251,11 @@ func (m *AdminInfoResponse) contextValidateServers(ctx context.Context, formats
|
||||
for i := 0; i < len(m.Servers); i++ {
|
||||
|
||||
if m.Servers[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Servers[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Servers[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("servers" + "." + strconv.Itoa(i))
|
||||
@@ -266,6 +276,11 @@ func (m *AdminInfoResponse) contextValidateWidgets(ctx context.Context, formats
|
||||
for i := 0; i < len(m.Widgets); i++ {
|
||||
|
||||
if m.Widgets[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Widgets[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Widgets[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("widgets" + "." + strconv.Itoa(i))
|
||||
|
||||
70
models/api_error.go
Normal file
70
models/api_error.go
Normal file
@@ -0,0 +1,70 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// This file is part of MinIO Console Server
|
||||
// Copyright (c) 2023 MinIO, Inc.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// APIError Api error
|
||||
//
|
||||
// swagger:model ApiError
|
||||
type APIError struct {
|
||||
|
||||
// detailed message
|
||||
DetailedMessage string `json:"detailedMessage,omitempty"`
|
||||
|
||||
// message
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this Api error
|
||||
func (m *APIError) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this Api error based on context it is used
|
||||
func (m *APIError) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *APIError) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *APIError) UnmarshalBinary(b []byte) error {
|
||||
var res APIError
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
@@ -37,6 +37,12 @@ type BackendProperties struct {
|
||||
// backend type
|
||||
BackendType string `json:"backendType,omitempty"`
|
||||
|
||||
// offline drives
|
||||
OfflineDrives int64 `json:"offlineDrives,omitempty"`
|
||||
|
||||
// online drives
|
||||
OnlineDrives int64 `json:"onlineDrives,omitempty"`
|
||||
|
||||
// rr s c parity
|
||||
RrSCParity int64 `json:"rrSCParity,omitempty"`
|
||||
|
||||
|
||||
@@ -185,6 +185,11 @@ func (m *Bucket) ContextValidate(ctx context.Context, formats strfmt.Registry) e
|
||||
func (m *Bucket) contextValidateAccess(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Access != nil {
|
||||
|
||||
if swag.IsZero(m.Access) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Access.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("access")
|
||||
@@ -201,6 +206,11 @@ func (m *Bucket) contextValidateAccess(ctx context.Context, formats strfmt.Regis
|
||||
func (m *Bucket) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Details != nil {
|
||||
|
||||
if swag.IsZero(m.Details) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Details.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("details")
|
||||
@@ -217,6 +227,11 @@ func (m *Bucket) contextValidateDetails(ctx context.Context, formats strfmt.Regi
|
||||
func (m *Bucket) contextValidateRwAccess(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.RwAccess != nil {
|
||||
|
||||
if swag.IsZero(m.RwAccess) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.RwAccess.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("rw_access")
|
||||
@@ -322,6 +337,11 @@ func (m *BucketDetails) ContextValidate(ctx context.Context, formats strfmt.Regi
|
||||
func (m *BucketDetails) contextValidateQuota(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Quota != nil {
|
||||
|
||||
if swag.IsZero(m.Quota) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Quota.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("details" + "." + "quota")
|
||||
|
||||
@@ -92,6 +92,11 @@ func (m *BucketEncryptionRequest) ContextValidate(ctx context.Context, formats s
|
||||
func (m *BucketEncryptionRequest) contextValidateEncType(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.EncType != nil {
|
||||
|
||||
if swag.IsZero(m.EncType) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.EncType.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("encType")
|
||||
|
||||
@@ -95,6 +95,7 @@ func (m *BucketEventRequest) ContextValidate(ctx context.Context, formats strfmt
|
||||
func (m *BucketEventRequest) contextValidateConfiguration(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Configuration != nil {
|
||||
|
||||
if err := m.Configuration.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("configuration")
|
||||
|
||||
@@ -99,6 +99,11 @@ func (m *BucketLifecycleResponse) contextValidateLifecycle(ctx context.Context,
|
||||
for i := 0; i < len(m.Lifecycle); i++ {
|
||||
|
||||
if m.Lifecycle[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Lifecycle[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Lifecycle[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("lifecycle" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -99,6 +99,11 @@ func (m *BucketReplicationResponse) contextValidateRules(ctx context.Context, fo
|
||||
for i := 0; i < len(m.Rules); i++ {
|
||||
|
||||
if m.Rules[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Rules[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Rules[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("rules" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -224,6 +224,11 @@ func (m *BucketReplicationRule) ContextValidate(ctx context.Context, formats str
|
||||
func (m *BucketReplicationRule) contextValidateDestination(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Destination != nil {
|
||||
|
||||
if swag.IsZero(m.Destination) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Destination.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("destination")
|
||||
|
||||
@@ -36,17 +36,17 @@ import (
|
||||
// swagger:model bucketVersioningResponse
|
||||
type BucketVersioningResponse struct {
|
||||
|
||||
// exclude folders
|
||||
ExcludeFolders bool `json:"ExcludeFolders,omitempty"`
|
||||
|
||||
// excluded prefixes
|
||||
ExcludedPrefixes []*BucketVersioningResponseExcludedPrefixesItems0 `json:"ExcludedPrefixes"`
|
||||
|
||||
// m f a delete
|
||||
MFADelete string `json:"MFADelete,omitempty"`
|
||||
|
||||
// exclude folders
|
||||
ExcludeFolders bool `json:"excludeFolders,omitempty"`
|
||||
|
||||
// excluded prefixes
|
||||
ExcludedPrefixes []*BucketVersioningResponseExcludedPrefixesItems0 `json:"excludedPrefixes"`
|
||||
|
||||
// status
|
||||
Status string `json:"Status,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this bucket versioning response
|
||||
@@ -76,9 +76,9 @@ func (m *BucketVersioningResponse) validateExcludedPrefixes(formats strfmt.Regis
|
||||
if m.ExcludedPrefixes[i] != nil {
|
||||
if err := m.ExcludedPrefixes[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("ExcludedPrefixes" + "." + strconv.Itoa(i))
|
||||
return ve.ValidateName("excludedPrefixes" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("ExcludedPrefixes" + "." + strconv.Itoa(i))
|
||||
return ce.ValidateName("excludedPrefixes" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
@@ -108,11 +108,16 @@ func (m *BucketVersioningResponse) contextValidateExcludedPrefixes(ctx context.C
|
||||
for i := 0; i < len(m.ExcludedPrefixes); i++ {
|
||||
|
||||
if m.ExcludedPrefixes[i] != nil {
|
||||
|
||||
if swag.IsZero(m.ExcludedPrefixes[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.ExcludedPrefixes[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("ExcludedPrefixes" + "." + strconv.Itoa(i))
|
||||
return ve.ValidateName("excludedPrefixes" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("ExcludedPrefixes" + "." + strconv.Itoa(i))
|
||||
return ce.ValidateName("excludedPrefixes" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
@@ -147,7 +152,7 @@ func (m *BucketVersioningResponse) UnmarshalBinary(b []byte) error {
|
||||
type BucketVersioningResponseExcludedPrefixesItems0 struct {
|
||||
|
||||
// prefix
|
||||
Prefix string `json:"Prefix,omitempty"`
|
||||
Prefix string `json:"prefix,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this bucket versioning response excluded prefixes items0
|
||||
|
||||
@@ -102,6 +102,11 @@ func (m *Configuration) contextValidateKeyValues(ctx context.Context, formats st
|
||||
for i := 0; i < len(m.KeyValues); i++ {
|
||||
|
||||
if m.KeyValues[i] != nil {
|
||||
|
||||
if swag.IsZero(m.KeyValues[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.KeyValues[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("key_values" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -95,6 +95,11 @@ func (m *ConfigurationKV) ContextValidate(ctx context.Context, formats strfmt.Re
|
||||
func (m *ConfigurationKV) contextValidateEnvOverride(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.EnvOverride != nil {
|
||||
|
||||
if swag.IsZero(m.EnvOverride) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.EnvOverride.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("env_override")
|
||||
|
||||
@@ -43,6 +43,9 @@ type ExpirationResponse struct {
|
||||
// delete marker
|
||||
DeleteMarker bool `json:"delete_marker,omitempty"`
|
||||
|
||||
// newer noncurrent expiration versions
|
||||
NewerNoncurrentExpirationVersions int64 `json:"newer_noncurrent_expiration_versions,omitempty"`
|
||||
|
||||
// noncurrent expiration days
|
||||
NoncurrentExpirationDays int64 `json:"noncurrent_expiration_days,omitempty"`
|
||||
}
|
||||
|
||||
@@ -117,6 +117,10 @@ func (m *GetBucketRetentionConfig) ContextValidate(ctx context.Context, formats
|
||||
|
||||
func (m *GetBucketRetentionConfig) contextValidateMode(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Mode) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Mode.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("mode")
|
||||
@@ -131,6 +135,10 @@ func (m *GetBucketRetentionConfig) contextValidateMode(ctx context.Context, form
|
||||
|
||||
func (m *GetBucketRetentionConfig) contextValidateUnit(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Unit) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Unit.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("unit")
|
||||
|
||||
@@ -102,6 +102,11 @@ func (m *IamPolicy) contextValidateStatement(ctx context.Context, formats strfmt
|
||||
for i := 0; i < len(m.Statement); i++ {
|
||||
|
||||
if m.Statement[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Statement[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Statement[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("statement" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -99,6 +99,11 @@ func (m *IdpListConfigurationsResponse) contextValidateResults(ctx context.Conte
|
||||
for i := 0; i < len(m.Results); i++ {
|
||||
|
||||
if m.Results[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Results[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Results[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("results" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -111,6 +111,11 @@ func (m *IdpServerConfiguration) contextValidateInfo(ctx context.Context, format
|
||||
for i := 0; i < len(m.Info); i++ {
|
||||
|
||||
if m.Info[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Info[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Info[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("info" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -99,6 +99,11 @@ func (m *KmsAPIsResponse) contextValidateResults(ctx context.Context, formats st
|
||||
for i := 0; i < len(m.Results); i++ {
|
||||
|
||||
if m.Results[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Results[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Results[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("results" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -104,6 +104,11 @@ func (m *KmsDescribeSelfIdentityResponse) ContextValidate(ctx context.Context, f
|
||||
func (m *KmsDescribeSelfIdentityResponse) contextValidatePolicy(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Policy != nil {
|
||||
|
||||
if swag.IsZero(m.Policy) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Policy.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("policy")
|
||||
|
||||
@@ -99,6 +99,11 @@ func (m *KmsListIdentitiesResponse) contextValidateResults(ctx context.Context,
|
||||
for i := 0; i < len(m.Results); i++ {
|
||||
|
||||
if m.Results[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Results[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Results[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("results" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -99,6 +99,11 @@ func (m *KmsListKeysResponse) contextValidateResults(ctx context.Context, format
|
||||
for i := 0; i < len(m.Results); i++ {
|
||||
|
||||
if m.Results[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Results[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Results[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("results" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -99,6 +99,11 @@ func (m *KmsListPoliciesResponse) contextValidateResults(ctx context.Context, fo
|
||||
for i := 0; i < len(m.Results); i++ {
|
||||
|
||||
if m.Results[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Results[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Results[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("results" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -309,6 +309,11 @@ func (m *KmsMetricsResponse) contextValidateLatencyHistogram(ctx context.Context
|
||||
for i := 0; i < len(m.LatencyHistogram); i++ {
|
||||
|
||||
if m.LatencyHistogram[i] != nil {
|
||||
|
||||
if swag.IsZero(m.LatencyHistogram[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.LatencyHistogram[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("latencyHistogram" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -105,6 +105,11 @@ func (m *KmsStatusResponse) contextValidateEndpoints(ctx context.Context, format
|
||||
for i := 0; i < len(m.Endpoints); i++ {
|
||||
|
||||
if m.Endpoints[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Endpoints[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Endpoints[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("endpoints" + "." + strconv.Itoa(i))
|
||||
|
||||
265
models/ldap_entities.go
Normal file
265
models/ldap_entities.go
Normal file
@@ -0,0 +1,265 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// This file is part of MinIO Console Server
|
||||
// Copyright (c) 2023 MinIO, Inc.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// LdapEntities ldap entities
|
||||
//
|
||||
// swagger:model ldapEntities
|
||||
type LdapEntities struct {
|
||||
|
||||
// groups
|
||||
Groups []*LdapGroupPolicyEntity `json:"groups"`
|
||||
|
||||
// policies
|
||||
Policies []*LdapPolicyEntity `json:"policies"`
|
||||
|
||||
// timestamp
|
||||
Timestamp string `json:"timestamp,omitempty"`
|
||||
|
||||
// users
|
||||
Users []*LdapUserPolicyEntity `json:"users"`
|
||||
}
|
||||
|
||||
// Validate validates this ldap entities
|
||||
func (m *LdapEntities) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateGroups(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validatePolicies(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateUsers(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *LdapEntities) validateGroups(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Groups) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Groups); i++ {
|
||||
if swag.IsZero(m.Groups[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Groups[i] != nil {
|
||||
if err := m.Groups[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("groups" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("groups" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *LdapEntities) validatePolicies(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Policies) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Policies); i++ {
|
||||
if swag.IsZero(m.Policies[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Policies[i] != nil {
|
||||
if err := m.Policies[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("policies" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("policies" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *LdapEntities) validateUsers(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Users) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Users); i++ {
|
||||
if swag.IsZero(m.Users[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.Users[i] != nil {
|
||||
if err := m.Users[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("users" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("users" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this ldap entities based on the context it is used
|
||||
func (m *LdapEntities) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.contextValidateGroups(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.contextValidatePolicies(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.contextValidateUsers(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *LdapEntities) contextValidateGroups(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.Groups); i++ {
|
||||
|
||||
if m.Groups[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Groups[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Groups[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("groups" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("groups" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *LdapEntities) contextValidatePolicies(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.Policies); i++ {
|
||||
|
||||
if m.Policies[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Policies[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Policies[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("policies" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("policies" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *LdapEntities) contextValidateUsers(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.Users); i++ {
|
||||
|
||||
if m.Users[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Users[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Users[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("users" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("users" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *LdapEntities) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *LdapEntities) UnmarshalBinary(b []byte) error {
|
||||
var res LdapEntities
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
73
models/ldap_entities_request.go
Normal file
73
models/ldap_entities_request.go
Normal file
@@ -0,0 +1,73 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// This file is part of MinIO Console Server
|
||||
// Copyright (c) 2023 MinIO, Inc.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// LdapEntitiesRequest ldap entities request
|
||||
//
|
||||
// swagger:model ldapEntitiesRequest
|
||||
type LdapEntitiesRequest struct {
|
||||
|
||||
// groups
|
||||
Groups []string `json:"groups"`
|
||||
|
||||
// policies
|
||||
Policies []string `json:"policies"`
|
||||
|
||||
// users
|
||||
Users []string `json:"users"`
|
||||
}
|
||||
|
||||
// Validate validates this ldap entities request
|
||||
func (m *LdapEntitiesRequest) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this ldap entities request based on context it is used
|
||||
func (m *LdapEntitiesRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *LdapEntitiesRequest) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *LdapEntitiesRequest) UnmarshalBinary(b []byte) error {
|
||||
var res LdapEntitiesRequest
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
70
models/ldap_group_policy_entity.go
Normal file
70
models/ldap_group_policy_entity.go
Normal file
@@ -0,0 +1,70 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// This file is part of MinIO Console Server
|
||||
// Copyright (c) 2023 MinIO, Inc.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// LdapGroupPolicyEntity ldap group policy entity
|
||||
//
|
||||
// swagger:model ldapGroupPolicyEntity
|
||||
type LdapGroupPolicyEntity struct {
|
||||
|
||||
// group
|
||||
Group string `json:"group,omitempty"`
|
||||
|
||||
// policies
|
||||
Policies []string `json:"policies"`
|
||||
}
|
||||
|
||||
// Validate validates this ldap group policy entity
|
||||
func (m *LdapGroupPolicyEntity) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this ldap group policy entity based on context it is used
|
||||
func (m *LdapGroupPolicyEntity) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *LdapGroupPolicyEntity) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *LdapGroupPolicyEntity) UnmarshalBinary(b []byte) error {
|
||||
var res LdapGroupPolicyEntity
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
73
models/ldap_policy_entity.go
Normal file
73
models/ldap_policy_entity.go
Normal file
@@ -0,0 +1,73 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// This file is part of MinIO Console Server
|
||||
// Copyright (c) 2023 MinIO, Inc.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// LdapPolicyEntity ldap policy entity
|
||||
//
|
||||
// swagger:model ldapPolicyEntity
|
||||
type LdapPolicyEntity struct {
|
||||
|
||||
// groups
|
||||
Groups []string `json:"groups"`
|
||||
|
||||
// policy
|
||||
Policy string `json:"policy,omitempty"`
|
||||
|
||||
// users
|
||||
Users []string `json:"users"`
|
||||
}
|
||||
|
||||
// Validate validates this ldap policy entity
|
||||
func (m *LdapPolicyEntity) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this ldap policy entity based on context it is used
|
||||
func (m *LdapPolicyEntity) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *LdapPolicyEntity) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *LdapPolicyEntity) UnmarshalBinary(b []byte) error {
|
||||
var res LdapPolicyEntity
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
@@ -29,30 +29,30 @@ import (
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// CheckVersionResponse check version response
|
||||
// LdapUserPolicyEntity ldap user policy entity
|
||||
//
|
||||
// swagger:model checkVersionResponse
|
||||
type CheckVersionResponse struct {
|
||||
// swagger:model ldapUserPolicyEntity
|
||||
type LdapUserPolicyEntity struct {
|
||||
|
||||
// current version
|
||||
CurrentVersion string `json:"current_version,omitempty"`
|
||||
// policies
|
||||
Policies []string `json:"policies"`
|
||||
|
||||
// latest version
|
||||
LatestVersion string `json:"latest_version,omitempty"`
|
||||
// user
|
||||
User string `json:"user,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this check version response
|
||||
func (m *CheckVersionResponse) Validate(formats strfmt.Registry) error {
|
||||
// Validate validates this ldap user policy entity
|
||||
func (m *LdapUserPolicyEntity) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this check version response based on context it is used
|
||||
func (m *CheckVersionResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
// ContextValidate validates this ldap user policy entity based on context it is used
|
||||
func (m *LdapUserPolicyEntity) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *CheckVersionResponse) MarshalBinary() ([]byte, error) {
|
||||
func (m *LdapUserPolicyEntity) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
@@ -60,8 +60,8 @@ func (m *CheckVersionResponse) MarshalBinary() ([]byte, error) {
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *CheckVersionResponse) UnmarshalBinary(b []byte) error {
|
||||
var res CheckVersionResponse
|
||||
func (m *LdapUserPolicyEntity) UnmarshalBinary(b []byte) error {
|
||||
var res LdapUserPolicyEntity
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -102,6 +102,11 @@ func (m *ListAccessRulesResponse) contextValidateAccessRules(ctx context.Context
|
||||
for i := 0; i < len(m.AccessRules); i++ {
|
||||
|
||||
if m.AccessRules[i] != nil {
|
||||
|
||||
if swag.IsZero(m.AccessRules[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.AccessRules[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("accessRules" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -102,6 +102,11 @@ func (m *ListBucketEventsResponse) contextValidateEvents(ctx context.Context, fo
|
||||
for i := 0; i < len(m.Events); i++ {
|
||||
|
||||
if m.Events[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Events[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Events[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("events" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -102,6 +102,11 @@ func (m *ListBucketsResponse) contextValidateBuckets(ctx context.Context, format
|
||||
for i := 0; i < len(m.Buckets); i++ {
|
||||
|
||||
if m.Buckets[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Buckets[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Buckets[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("buckets" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -102,6 +102,11 @@ func (m *ListConfigResponse) contextValidateConfigurations(ctx context.Context,
|
||||
for i := 0; i < len(m.Configurations); i++ {
|
||||
|
||||
if m.Configurations[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Configurations[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Configurations[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("configurations" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -102,6 +102,11 @@ func (m *ListObjectsResponse) contextValidateObjects(ctx context.Context, format
|
||||
for i := 0; i < len(m.Objects); i++ {
|
||||
|
||||
if m.Objects[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Objects[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Objects[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("objects" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -102,6 +102,11 @@ func (m *ListPoliciesResponse) contextValidatePolicies(ctx context.Context, form
|
||||
for i := 0; i < len(m.Policies); i++ {
|
||||
|
||||
if m.Policies[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Policies[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Policies[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("policies" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -102,6 +102,11 @@ func (m *ListRemoteBucketsResponse) contextValidateBuckets(ctx context.Context,
|
||||
for i := 0; i < len(m.Buckets); i++ {
|
||||
|
||||
if m.Buckets[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Buckets[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Buckets[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("buckets" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -99,6 +99,11 @@ func (m *ListUsersResponse) contextValidateUsers(ctx context.Context, formats st
|
||||
for i := 0; i < len(m.Users); i++ {
|
||||
|
||||
if m.Users[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Users[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Users[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("users" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -38,8 +38,8 @@ import (
|
||||
// swagger:model loginDetails
|
||||
type LoginDetails struct {
|
||||
|
||||
// is direct p v
|
||||
IsDirectPV bool `json:"isDirectPV,omitempty"`
|
||||
// animated login
|
||||
AnimatedLogin bool `json:"animatedLogin,omitempty"`
|
||||
|
||||
// is k8 s
|
||||
IsK8S bool `json:"isK8S,omitempty"`
|
||||
@@ -163,6 +163,11 @@ func (m *LoginDetails) contextValidateRedirectRules(ctx context.Context, formats
|
||||
for i := 0; i < len(m.RedirectRules); i++ {
|
||||
|
||||
if m.RedirectRules[i] != nil {
|
||||
|
||||
if swag.IsZero(m.RedirectRules[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.RedirectRules[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("redirectRules" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -98,6 +98,11 @@ func (m *LoginRequest) ContextValidate(ctx context.Context, formats strfmt.Regis
|
||||
func (m *LoginRequest) contextValidateFeatures(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Features != nil {
|
||||
|
||||
if swag.IsZero(m.Features) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Features.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("features")
|
||||
|
||||
@@ -50,7 +50,7 @@ type MakeBucketRequest struct {
|
||||
Retention *PutBucketRetentionRequest `json:"retention,omitempty"`
|
||||
|
||||
// versioning
|
||||
Versioning bool `json:"versioning,omitempty"`
|
||||
Versioning *SetBucketVersioning `json:"versioning,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this make bucket request
|
||||
@@ -69,6 +69,10 @@ func (m *MakeBucketRequest) Validate(formats strfmt.Registry) error {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateVersioning(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
@@ -122,6 +126,25 @@ func (m *MakeBucketRequest) validateRetention(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MakeBucketRequest) validateVersioning(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Versioning) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Versioning != nil {
|
||||
if err := m.Versioning.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("versioning")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("versioning")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this make bucket request based on the context it is used
|
||||
func (m *MakeBucketRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
@@ -134,6 +157,10 @@ func (m *MakeBucketRequest) ContextValidate(ctx context.Context, formats strfmt.
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.contextValidateVersioning(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
@@ -143,6 +170,11 @@ func (m *MakeBucketRequest) ContextValidate(ctx context.Context, formats strfmt.
|
||||
func (m *MakeBucketRequest) contextValidateQuota(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Quota != nil {
|
||||
|
||||
if swag.IsZero(m.Quota) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Quota.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("quota")
|
||||
@@ -159,6 +191,11 @@ func (m *MakeBucketRequest) contextValidateQuota(ctx context.Context, formats st
|
||||
func (m *MakeBucketRequest) contextValidateRetention(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Retention != nil {
|
||||
|
||||
if swag.IsZero(m.Retention) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Retention.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("retention")
|
||||
@@ -172,6 +209,27 @@ func (m *MakeBucketRequest) contextValidateRetention(ctx context.Context, format
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MakeBucketRequest) contextValidateVersioning(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Versioning != nil {
|
||||
|
||||
if swag.IsZero(m.Versioning) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Versioning.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("versioning")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("versioning")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *MakeBucketRequest) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
|
||||
67
models/make_buckets_response.go
Normal file
67
models/make_buckets_response.go
Normal file
@@ -0,0 +1,67 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// This file is part of MinIO Console Server
|
||||
// Copyright (c) 2023 MinIO, Inc.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// MakeBucketsResponse make buckets response
|
||||
//
|
||||
// swagger:model makeBucketsResponse
|
||||
type MakeBucketsResponse struct {
|
||||
|
||||
// bucket name
|
||||
BucketName string `json:"bucketName,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this make buckets response
|
||||
func (m *MakeBucketsResponse) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this make buckets response based on context it is used
|
||||
func (m *MakeBucketsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *MakeBucketsResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *MakeBucketsResponse) UnmarshalBinary(b []byte) error {
|
||||
var res MakeBucketsResponse
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
@@ -31,32 +31,21 @@ import (
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// Error error
|
||||
// MaxShareLinkExpResponse max share link exp response
|
||||
//
|
||||
// swagger:model error
|
||||
type Error struct {
|
||||
// swagger:model maxShareLinkExpResponse
|
||||
type MaxShareLinkExpResponse struct {
|
||||
|
||||
// code
|
||||
Code int32 `json:"code,omitempty"`
|
||||
|
||||
// detailed message
|
||||
// exp
|
||||
// Required: true
|
||||
DetailedMessage *string `json:"detailedMessage"`
|
||||
|
||||
// message
|
||||
// Required: true
|
||||
Message *string `json:"message"`
|
||||
Exp *int64 `json:"exp"`
|
||||
}
|
||||
|
||||
// Validate validates this error
|
||||
func (m *Error) Validate(formats strfmt.Registry) error {
|
||||
// Validate validates this max share link exp response
|
||||
func (m *MaxShareLinkExpResponse) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateDetailedMessage(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateMessage(formats); err != nil {
|
||||
if err := m.validateExp(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
@@ -66,31 +55,22 @@ func (m *Error) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Error) validateDetailedMessage(formats strfmt.Registry) error {
|
||||
func (m *MaxShareLinkExpResponse) validateExp(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("detailedMessage", "body", m.DetailedMessage); err != nil {
|
||||
if err := validate.Required("exp", "body", m.Exp); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Error) validateMessage(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("message", "body", m.Message); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this error based on context it is used
|
||||
func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
// ContextValidate validates this max share link exp response based on context it is used
|
||||
func (m *MaxShareLinkExpResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *Error) MarshalBinary() ([]byte, error) {
|
||||
func (m *MaxShareLinkExpResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
@@ -98,8 +78,8 @@ func (m *Error) MarshalBinary() ([]byte, error) {
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *Error) UnmarshalBinary(b []byte) error {
|
||||
var res Error
|
||||
func (m *MaxShareLinkExpResponse) UnmarshalBinary(b []byte) error {
|
||||
var res MaxShareLinkExpResponse
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -244,6 +244,11 @@ func (m *MultiBucketReplication) contextValidateBucketsRelation(ctx context.Cont
|
||||
for i := 0; i < len(m.BucketsRelation); i++ {
|
||||
|
||||
if m.BucketsRelation[i] != nil {
|
||||
|
||||
if swag.IsZero(m.BucketsRelation[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.BucketsRelation[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("bucketsRelation" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -99,6 +99,11 @@ func (m *MultiBucketResponseState) contextValidateReplicationState(ctx context.C
|
||||
for i := 0; i < len(m.ReplicationState); i++ {
|
||||
|
||||
if m.ReplicationState[i] != nil {
|
||||
|
||||
if swag.IsZero(m.ReplicationState[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.ReplicationState[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("replicationState" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -99,6 +99,11 @@ func (m *MultiLifecycleResult) contextValidateResults(ctx context.Context, forma
|
||||
for i := 0; i < len(m.Results); i++ {
|
||||
|
||||
if m.Results[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Results[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Results[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("results" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -99,6 +99,11 @@ func (m *NotifEndpointResponse) contextValidateNotificationEndpoints(ctx context
|
||||
for i := 0; i < len(m.NotificationEndpoints); i++ {
|
||||
|
||||
if m.NotificationEndpoints[i] != nil {
|
||||
|
||||
if swag.IsZero(m.NotificationEndpoints[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.NotificationEndpoints[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("notification_endpoints" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -120,6 +120,10 @@ func (m *NotificationConfig) contextValidateEvents(ctx context.Context, formats
|
||||
|
||||
for i := 0; i < len(m.Events); i++ {
|
||||
|
||||
if swag.IsZero(m.Events[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Events[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("events" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -130,6 +130,10 @@ func (m *NotificationDeleteRequest) contextValidateEvents(ctx context.Context, f
|
||||
|
||||
for i := 0; i < len(m.Events); i++ {
|
||||
|
||||
if swag.IsZero(m.Events[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Events[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("events" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -130,6 +130,7 @@ func (m *NotificationEndpoint) ContextValidate(ctx context.Context, formats strf
|
||||
func (m *NotificationEndpoint) contextValidateService(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Service != nil {
|
||||
|
||||
if err := m.Service.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("service")
|
||||
|
||||
@@ -92,6 +92,10 @@ func (m *NotificationEndpointItem) ContextValidate(ctx context.Context, formats
|
||||
|
||||
func (m *NotificationEndpointItem) contextValidateService(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Service) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Service.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("service")
|
||||
|
||||
@@ -55,6 +55,15 @@ const (
|
||||
|
||||
// NotificationEventTypeGet captures enum value "get"
|
||||
NotificationEventTypeGet NotificationEventType = "get"
|
||||
|
||||
// NotificationEventTypeReplica captures enum value "replica"
|
||||
NotificationEventTypeReplica NotificationEventType = "replica"
|
||||
|
||||
// NotificationEventTypeIlm captures enum value "ilm"
|
||||
NotificationEventTypeIlm NotificationEventType = "ilm"
|
||||
|
||||
// NotificationEventTypeScanner captures enum value "scanner"
|
||||
NotificationEventTypeScanner NotificationEventType = "scanner"
|
||||
)
|
||||
|
||||
// for schema
|
||||
@@ -62,7 +71,7 @@ var notificationEventTypeEnum []interface{}
|
||||
|
||||
func init() {
|
||||
var res []NotificationEventType
|
||||
if err := json.Unmarshal([]byte(`["put","delete","get"]`), &res); err != nil {
|
||||
if err := json.Unmarshal([]byte(`["put","delete","get","replica","ilm","scanner"]`), &res); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
for _, v := range res {
|
||||
|
||||
@@ -166,6 +166,11 @@ func (m *ObjectBucketLifecycle) ContextValidate(ctx context.Context, formats str
|
||||
func (m *ObjectBucketLifecycle) contextValidateExpiration(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Expiration != nil {
|
||||
|
||||
if swag.IsZero(m.Expiration) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Expiration.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("expiration")
|
||||
@@ -184,6 +189,11 @@ func (m *ObjectBucketLifecycle) contextValidateTags(ctx context.Context, formats
|
||||
for i := 0; i < len(m.Tags); i++ {
|
||||
|
||||
if m.Tags[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Tags[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Tags[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("tags" + "." + strconv.Itoa(i))
|
||||
@@ -202,6 +212,11 @@ func (m *ObjectBucketLifecycle) contextValidateTags(ctx context.Context, formats
|
||||
func (m *ObjectBucketLifecycle) contextValidateTransition(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Transition != nil {
|
||||
|
||||
if swag.IsZero(m.Transition) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Transition.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("transition")
|
||||
|
||||
@@ -149,6 +149,7 @@ func (m *PutBucketRetentionRequest) ContextValidate(ctx context.Context, formats
|
||||
func (m *PutBucketRetentionRequest) contextValidateMode(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Mode != nil {
|
||||
|
||||
if err := m.Mode.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("mode")
|
||||
@@ -165,6 +166,7 @@ func (m *PutBucketRetentionRequest) contextValidateMode(ctx context.Context, for
|
||||
func (m *PutBucketRetentionRequest) contextValidateUnit(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Unit != nil {
|
||||
|
||||
if err := m.Unit.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("unit")
|
||||
|
||||
@@ -96,6 +96,7 @@ func (m *PutObjectLegalHoldRequest) ContextValidate(ctx context.Context, formats
|
||||
func (m *PutObjectLegalHoldRequest) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Status != nil {
|
||||
|
||||
if err := m.Status.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("status")
|
||||
|
||||
@@ -116,6 +116,7 @@ func (m *PutObjectRetentionRequest) ContextValidate(ctx context.Context, formats
|
||||
func (m *PutObjectRetentionRequest) contextValidateMode(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Mode != nil {
|
||||
|
||||
if err := m.Mode.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("mode")
|
||||
|
||||
@@ -104,6 +104,11 @@ func (m *ReleaseInfo) ContextValidate(ctx context.Context, formats strfmt.Regist
|
||||
func (m *ReleaseInfo) contextValidateMetadata(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Metadata != nil {
|
||||
|
||||
if swag.IsZero(m.Metadata) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Metadata.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("metadata")
|
||||
|
||||
@@ -99,6 +99,11 @@ func (m *ReleaseListResponse) contextValidateResults(ctx context.Context, format
|
||||
for i := 0; i < len(m.Results); i++ {
|
||||
|
||||
if m.Results[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Results[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Results[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("results" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -134,6 +134,11 @@ func (m *ReleaseMetadata) ContextValidate(ctx context.Context, formats strfmt.Re
|
||||
func (m *ReleaseMetadata) contextValidateAuthor(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Author != nil {
|
||||
|
||||
if swag.IsZero(m.Author) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Author.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("author")
|
||||
|
||||
@@ -105,6 +105,11 @@ func (m *ResultTarget) contextValidateResult(ctx context.Context, formats strfmt
|
||||
for i := 0; i < len(m.Result); i++ {
|
||||
|
||||
if m.Result[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Result[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Result[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("result" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -99,6 +99,11 @@ func (m *RewindResponse) contextValidateObjects(ctx context.Context, formats str
|
||||
for i := 0; i < len(m.Objects); i++ {
|
||||
|
||||
if m.Objects[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Objects[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Objects[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("objects" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -120,6 +120,11 @@ func (m *ServerProperties) contextValidateDrives(ctx context.Context, formats st
|
||||
for i := 0; i < len(m.Drives); i++ {
|
||||
|
||||
if m.Drives[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Drives[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Drives[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("drives" + "." + strconv.Itoa(i))
|
||||
|
||||
85
models/service_account.go
Normal file
85
models/service_account.go
Normal file
@@ -0,0 +1,85 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// This file is part of MinIO Console Server
|
||||
// Copyright (c) 2023 MinIO, Inc.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// ServiceAccount service account
|
||||
//
|
||||
// swagger:model serviceAccount
|
||||
type ServiceAccount struct {
|
||||
|
||||
// account status
|
||||
AccountStatus string `json:"accountStatus,omitempty"`
|
||||
|
||||
// description
|
||||
Description string `json:"description,omitempty"`
|
||||
|
||||
// expiration
|
||||
Expiration string `json:"expiration,omitempty"`
|
||||
|
||||
// implied policy
|
||||
ImpliedPolicy bool `json:"impliedPolicy,omitempty"`
|
||||
|
||||
// name
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// parent user
|
||||
ParentUser string `json:"parentUser,omitempty"`
|
||||
|
||||
// policy
|
||||
Policy string `json:"policy,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this service account
|
||||
func (m *ServiceAccount) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this service account based on context it is used
|
||||
func (m *ServiceAccount) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ServiceAccount) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *ServiceAccount) UnmarshalBinary(b []byte) error {
|
||||
var res ServiceAccount
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
@@ -34,6 +34,18 @@ import (
|
||||
// swagger:model serviceAccountRequest
|
||||
type ServiceAccountRequest struct {
|
||||
|
||||
// comment
|
||||
Comment string `json:"comment,omitempty"`
|
||||
|
||||
// description
|
||||
Description string `json:"description,omitempty"`
|
||||
|
||||
// expiry
|
||||
Expiry string `json:"expiry,omitempty"`
|
||||
|
||||
// name
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// policy to be applied to the Service Account if any
|
||||
Policy string `json:"policy,omitempty"`
|
||||
}
|
||||
|
||||
@@ -37,6 +37,18 @@ type ServiceAccountRequestCreds struct {
|
||||
// access key
|
||||
AccessKey string `json:"accessKey,omitempty"`
|
||||
|
||||
// comment
|
||||
Comment string `json:"comment,omitempty"`
|
||||
|
||||
// description
|
||||
Description string `json:"description,omitempty"`
|
||||
|
||||
// expiry
|
||||
Expiry string `json:"expiry,omitempty"`
|
||||
|
||||
// name
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// policy to be applied to the Service Account if any
|
||||
Policy string `json:"policy,omitempty"`
|
||||
|
||||
|
||||
@@ -24,21 +24,121 @@ package models
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// ServiceAccounts service accounts
|
||||
//
|
||||
// swagger:model serviceAccounts
|
||||
type ServiceAccounts []string
|
||||
type ServiceAccounts []*ServiceAccountsItems0
|
||||
|
||||
// Validate validates this service accounts
|
||||
func (m ServiceAccounts) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
for i := 0; i < len(m); i++ {
|
||||
if swag.IsZero(m[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m[i] != nil {
|
||||
if err := m[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName(strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName(strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this service accounts based on context it is used
|
||||
// ContextValidate validate this service accounts based on the context it is used
|
||||
func (m ServiceAccounts) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
for i := 0; i < len(m); i++ {
|
||||
|
||||
if m[i] != nil {
|
||||
|
||||
if swag.IsZero(m[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName(strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName(strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ServiceAccountsItems0 service accounts items0
|
||||
//
|
||||
// swagger:model ServiceAccountsItems0
|
||||
type ServiceAccountsItems0 struct {
|
||||
|
||||
// access key
|
||||
AccessKey string `json:"accessKey,omitempty"`
|
||||
|
||||
// account status
|
||||
AccountStatus string `json:"accountStatus,omitempty"`
|
||||
|
||||
// description
|
||||
Description string `json:"description,omitempty"`
|
||||
|
||||
// expiration
|
||||
Expiration string `json:"expiration,omitempty"`
|
||||
|
||||
// name
|
||||
Name string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this service accounts items0
|
||||
func (m *ServiceAccountsItems0) Validate(formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this service accounts items0 based on context it is used
|
||||
func (m *ServiceAccountsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *ServiceAccountsItems0) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *ServiceAccountsItems0) UnmarshalBinary(b []byte) error {
|
||||
var res ServiceAccountsItems0
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -196,6 +196,11 @@ func (m *SessionResponse) contextValidateAllowResources(ctx context.Context, for
|
||||
for i := 0; i < len(m.AllowResources); i++ {
|
||||
|
||||
if m.AllowResources[i] != nil {
|
||||
|
||||
if swag.IsZero(m.AllowResources[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.AllowResources[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("allowResources" + "." + strconv.Itoa(i))
|
||||
@@ -214,6 +219,11 @@ func (m *SessionResponse) contextValidateAllowResources(ctx context.Context, for
|
||||
func (m *SessionResponse) contextValidateEnvConstants(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.EnvConstants != nil {
|
||||
|
||||
if swag.IsZero(m.EnvConstants) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.EnvConstants.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("envConstants")
|
||||
|
||||
@@ -99,6 +99,7 @@ func (m *SetBucketPolicyRequest) ContextValidate(ctx context.Context, formats st
|
||||
func (m *SetBucketPolicyRequest) contextValidateAccess(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Access != nil {
|
||||
|
||||
if err := m.Access.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("access")
|
||||
|
||||
@@ -34,8 +34,14 @@ import (
|
||||
// swagger:model setBucketVersioning
|
||||
type SetBucketVersioning struct {
|
||||
|
||||
// versioning
|
||||
Versioning bool `json:"versioning,omitempty"`
|
||||
// enabled
|
||||
Enabled bool `json:"enabled,omitempty"`
|
||||
|
||||
// exclude folders
|
||||
ExcludeFolders bool `json:"excludeFolders,omitempty"`
|
||||
|
||||
// exclude prefixes
|
||||
ExcludePrefixes []string `json:"excludePrefixes"`
|
||||
}
|
||||
|
||||
// Validate validates this set bucket versioning
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user