Compare commits
175 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 |
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'"
|
||||
356
.github/workflows/jobs.yaml
vendored
356
.github/workflows/jobs.yaml
vendored
@@ -22,7 +22,7 @@ jobs:
|
||||
runs-on: [ubuntu-latest]
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.20.x]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
@@ -42,26 +42,6 @@ jobs:
|
||||
run: |
|
||||
make verifiers
|
||||
|
||||
vulnerable-dependencies-checks:
|
||||
name: "Check for vulnerable dependencies"
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.20.x]
|
||||
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
|
||||
@@ -85,7 +65,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.20.x]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
@@ -130,7 +110,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.20.x]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
@@ -153,7 +133,7 @@ jobs:
|
||||
runs-on: [ubuntu-latest]
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.20.x]
|
||||
go-version: [1.21.x]
|
||||
steps:
|
||||
# To build minio image, we need to clone the repository first
|
||||
- name: Clone github.com/minio/minio
|
||||
@@ -188,7 +168,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.20.x]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
@@ -220,14 +200,15 @@ jobs:
|
||||
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.20.x]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
@@ -235,13 +216,38 @@ jobs:
|
||||
- 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
|
||||
@@ -251,7 +257,7 @@ jobs:
|
||||
timeout-minutes: 10
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.20.x]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
@@ -281,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: |
|
||||
@@ -298,7 +305,7 @@ jobs:
|
||||
timeout-minutes: 10
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.20.x]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
@@ -327,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: |
|
||||
@@ -344,7 +352,7 @@ jobs:
|
||||
timeout-minutes: 10
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.20.x]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
@@ -373,10 +381,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-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: |
|
||||
@@ -390,7 +399,7 @@ jobs:
|
||||
timeout-minutes: 15
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.20.x]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
@@ -418,11 +427,14 @@ 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:
|
||||
@@ -430,7 +442,7 @@ jobs:
|
||||
runs-on: [ubuntu-latest]
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.20.x]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
@@ -458,11 +470,14 @@ 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:
|
||||
@@ -470,7 +485,7 @@ jobs:
|
||||
runs-on: [ubuntu-latest]
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.20.x]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
@@ -498,11 +513,14 @@ 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:
|
||||
@@ -510,7 +528,7 @@ jobs:
|
||||
runs-on: [ubuntu-latest]
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.20.x]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
@@ -538,11 +556,13 @@ 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:
|
||||
@@ -550,7 +570,7 @@ jobs:
|
||||
runs-on: [ubuntu-latest]
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.20.x]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
@@ -578,11 +598,14 @@ 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:
|
||||
@@ -590,7 +613,7 @@ jobs:
|
||||
runs-on: [ubuntu-latest]
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.20.x]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
@@ -619,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: |
|
||||
@@ -635,7 +659,7 @@ jobs:
|
||||
runs-on: [ubuntu-latest]
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.20.x]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
@@ -664,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: |
|
||||
@@ -680,7 +705,7 @@ jobs:
|
||||
runs-on: [ubuntu-latest]
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.20.x]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
@@ -709,164 +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.20.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.20.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.20.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.20.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.20.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:
|
||||
@@ -877,7 +754,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.20.x]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
@@ -914,7 +791,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.20.x]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
@@ -953,7 +830,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.20.x]
|
||||
go-version: [1.21.x]
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
@@ -1042,7 +919,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.20.x]
|
||||
go-version: [1.21.x]
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
@@ -1117,7 +994,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.20.x]
|
||||
go-version: [1.21.x]
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
@@ -1188,7 +1065,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.20.x]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
@@ -1292,7 +1169,7 @@ jobs:
|
||||
go tool cover -func=all.out | grep total > tmp2
|
||||
result=`cat tmp2 | awk 'END {print $3}'`
|
||||
result=${result%\%}
|
||||
threshold=71.4
|
||||
threshold=71.3
|
||||
echo "Result:"
|
||||
echo "$result%"
|
||||
if (( $(echo "$result >= $threshold" |bc -l) )); then
|
||||
@@ -1307,7 +1184,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.19.x]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
@@ -1337,11 +1214,6 @@ jobs:
|
||||
continue-on-error: false
|
||||
run: |
|
||||
./check-warnings-istanbul-coverage.sh
|
||||
- name: Check if Files are Prettified
|
||||
working-directory: ./portal-ui
|
||||
continue-on-error: false
|
||||
run: |
|
||||
./check-prettier.sh
|
||||
|
||||
compile-binary-istanbul-coverage:
|
||||
name: "Compile Console Binary with Istanbul Plugin for Coverage"
|
||||
@@ -1353,7 +1225,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.19.x]
|
||||
go-version: [1.21.x]
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Check out code
|
||||
|
||||
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
|
||||
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
|
||||
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,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"]
|
||||
|
||||
25
Makefile
25
Makefile
@@ -55,6 +55,7 @@ swagger-console:
|
||||
@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:
|
||||
@@ -229,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)
|
||||
|
||||
47
README.md
47
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
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
116
go.mod
116
go.mod
@@ -1,60 +1,65 @@
|
||||
module github.com/minio/console
|
||||
|
||||
go 1.20
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
github.com/blang/semver/v4 v4.0.0
|
||||
github.com/cheggaaa/pb/v3 v3.1.2
|
||||
github.com/cheggaaa/pb/v3 v3.1.4
|
||||
github.com/dustin/go-humanize v1.0.1
|
||||
github.com/fatih/color v1.15.0
|
||||
github.com/go-openapi/errors v0.20.3
|
||||
github.com/go-openapi/errors v0.20.4
|
||||
github.com/go-openapi/loads v0.21.2
|
||||
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.3
|
||||
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.16.5
|
||||
github.com/klauspost/compress v1.16.7
|
||||
github.com/minio/cli v1.24.2
|
||||
github.com/minio/highwayhash v1.0.2
|
||||
github.com/minio/kes v0.22.3
|
||||
github.com/minio/madmin-go/v2 v2.2.0
|
||||
github.com/minio/mc v0.0.0-20230526175537-0fac0e006eae
|
||||
github.com/minio/minio-go/v7 v7.0.55-0.20230525060734-b7836f021bfb
|
||||
github.com/minio/pkg v1.6.5
|
||||
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.5.0
|
||||
github.com/secure-io/sio-go v0.3.1
|
||||
github.com/stretchr/testify v1.8.4
|
||||
github.com/tidwall/gjson v1.14.4
|
||||
github.com/tidwall/gjson v1.16.0
|
||||
github.com/unrolled/secure v1.13.0
|
||||
golang.org/x/crypto v0.9.0
|
||||
golang.org/x/net v0.10.0
|
||||
golang.org/x/oauth2 v0.7.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.9.0 // indirect
|
||||
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/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.2 // indirect
|
||||
github.com/charmbracelet/lipgloss v0.7.1 // 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
|
||||
@@ -63,9 +68,9 @@ require (
|
||||
github.com/fatih/structs v1.1.0 // indirect
|
||||
github.com/gdamore/encoding v1.0.0 // indirect
|
||||
github.com/gdamore/tcell/v2 v2.6.0 // indirect
|
||||
github.com/go-ole/go-ole v1.2.6 // 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.6 // 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
|
||||
@@ -74,11 +79,11 @@ require (
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
github.com/jedib0t/go-pretty/v6 v6.4.6 // 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/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
|
||||
@@ -89,23 +94,22 @@ require (
|
||||
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.18 // 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/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.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/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.15.1 // 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
|
||||
@@ -115,38 +119,40 @@ require (
|
||||
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.42.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-20230406072732-e22ce9588bb4 // 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/rogpeppe/go-internal v1.10.0 // indirect
|
||||
github.com/shirou/gopsutil/v3 v3.23.3 // indirect
|
||||
github.com/shoenig/go-m1cpu v0.1.5 // indirect
|
||||
github.com/sirupsen/logrus v1.9.2 // 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.11.3 // indirect
|
||||
go.uber.org/atomic v1.10.0 // 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.24.0 // indirect
|
||||
golang.org/x/sync v0.1.0 // indirect
|
||||
golang.org/x/sys v0.8.0 // indirect
|
||||
golang.org/x/term v0.8.0 // indirect
|
||||
google.golang.org/appengine v1.6.7 // indirect
|
||||
google.golang.org/genproto v0.0.0-20230403163135-c38d8f061ccd // indirect
|
||||
google.golang.org/grpc v1.54.0 // indirect
|
||||
google.golang.org/protobuf v1.30.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/ini.v1 v1.67.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // 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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,6 +21,7 @@ package integration
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
@@ -33,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"
|
||||
)
|
||||
@@ -42,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,
|
||||
@@ -142,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.
|
||||
@@ -394,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 {
|
||||
@@ -420,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",
|
||||
@@ -487,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 {
|
||||
@@ -725,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 {
|
||||
@@ -746,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, 200) {
|
||||
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 {
|
||||
@@ -775,7 +782,7 @@ func TestPutObjectsLegalholdStatus(t *testing.T) {
|
||||
}
|
||||
|
||||
// Get versionID
|
||||
listResponse, _ := ListObjects(bucketName, prefix, "true")
|
||||
listResponse, _ := ListObjects(bucketName, "", "true")
|
||||
bodyBytes, _ := io.ReadAll(listResponse.Body)
|
||||
listObjs := models.ListObjectsResponse{}
|
||||
err := json.Unmarshal(bodyBytes, &listObjs)
|
||||
@@ -813,7 +820,7 @@ func TestPutObjectsLegalholdStatus(t *testing.T) {
|
||||
// 3. Put Objects Legal Status
|
||||
putResponse, putError := PutObjectsLegalholdStatus(
|
||||
bucketName,
|
||||
prefix,
|
||||
objectNameEncoded,
|
||||
status,
|
||||
tt.args.versionID,
|
||||
)
|
||||
@@ -838,7 +845,7 @@ func TestGetBucketQuota(t *testing.T) {
|
||||
validBucket := "testgetbucketquota"
|
||||
|
||||
// 1. Create bucket
|
||||
if !setupBucket(validBucket, true, true, nil, nil, assert, 200) {
|
||||
if !setupBucket(validBucket, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -915,7 +922,7 @@ func TestPutBucketQuota(t *testing.T) {
|
||||
validBucket := "testputbucketquota"
|
||||
|
||||
// 1. Create bucket
|
||||
if !setupBucket(validBucket, true, true, nil, nil, assert, 200) {
|
||||
if !setupBucket(validBucket, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -974,7 +981,7 @@ func TestListBucketEvents(t *testing.T) {
|
||||
validBucket := "testlistbucketevents"
|
||||
|
||||
// 1. Create bucket
|
||||
if !setupBucket(validBucket, true, true, nil, nil, assert, 200) {
|
||||
if !setupBucket(validBucket, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1032,7 +1039,7 @@ func TestDeleteObjectsRetentionStatus(t *testing.T) {
|
||||
validPrefix := encodeBase64(fileName)
|
||||
|
||||
// 1. Create bucket
|
||||
if !setupBucket(bucketName, true, true, nil, nil, assert, 200) {
|
||||
if !setupBucket(bucketName, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1139,7 +1146,7 @@ func TestBucketSetPolicy(t *testing.T) {
|
||||
validBucketName := "testbucketsetpolicy"
|
||||
|
||||
// 1. Create bucket
|
||||
if !setupBucket(validBucketName, true, true, nil, nil, assert, 200) {
|
||||
if !setupBucket(validBucketName, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1200,7 +1207,7 @@ func TestRestoreObjectToASelectedVersion(t *testing.T) {
|
||||
validPrefix := encodeBase64(fileName)
|
||||
|
||||
// 1. Create bucket
|
||||
if !setupBucket(bucketName, true, true, nil, nil, assert, 200) {
|
||||
if !setupBucket(bucketName, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1288,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, 200) {
|
||||
if !setupBucket(validBucketName, false, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1346,7 +1353,7 @@ func TestGetsTheMetadataOfAnObject(t *testing.T) {
|
||||
tags["tag"] = "testputobjecttagbucketonetagone"
|
||||
|
||||
// 1. Create the bucket
|
||||
if !setupBucket(bucketName, false, false, nil, nil, assert, 200) {
|
||||
if !setupBucket(bucketName, false, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1417,7 +1424,7 @@ func TestPutObjectsRetentionStatus(t *testing.T) {
|
||||
prefix := encodeBase64(fileName)
|
||||
|
||||
// 1. Create bucket
|
||||
if !setupBucket(bucketName, true, true, nil, nil, assert, 200) {
|
||||
if !setupBucket(bucketName, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1515,7 +1522,7 @@ func TestShareObjectOnURL(t *testing.T) {
|
||||
versionID := "null"
|
||||
|
||||
// 1. Create the bucket
|
||||
if !setupBucket(bucketName, false, false, nil, nil, assert, 200) {
|
||||
if !setupBucket(bucketName, false, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1589,7 +1596,7 @@ func TestListObjects(t *testing.T) {
|
||||
fileName := "testlistobjecttobucket1.txt"
|
||||
|
||||
// 1. Create the bucket
|
||||
if !setupBucket(bucketName, false, false, nil, nil, assert, 200) {
|
||||
if !setupBucket(bucketName, false, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1633,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, 200) {
|
||||
if !setupBucket(bucketName, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1656,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)
|
||||
@@ -1703,7 +1710,7 @@ func TestUploadObjectToBucket(t *testing.T) {
|
||||
fileName := "sample.txt"
|
||||
|
||||
// 1. Create the bucket
|
||||
if !setupBucket(bucketName, false, false, nil, nil, assert, 200) {
|
||||
if !setupBucket(bucketName, false, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1738,7 +1745,7 @@ func TestDownloadObject(t *testing.T) {
|
||||
}
|
||||
|
||||
// 1. Create the bucket
|
||||
if !setupBucket(bucketName, true, true, nil, nil, assert, 200) {
|
||||
if !setupBucket(bucketName, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1800,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, 200) {
|
||||
if !setupBucket(bucketName, false, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1877,7 +1884,7 @@ func TestPutObjectTag(t *testing.T) {
|
||||
versionID := "null"
|
||||
|
||||
// 1. Create the bucket
|
||||
if !setupBucket(bucketName, false, false, nil, nil, assert, 200) {
|
||||
if !setupBucket(bucketName, false, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1951,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, 200) {
|
||||
if !setupBucket("setbucketretention1", true, map[string]interface{}{"enabled": true}, nil, retention, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -2002,7 +2009,7 @@ func TestBucketInformationGenericErrorResponse(t *testing.T) {
|
||||
|
||||
// 1. Create the bucket
|
||||
assert := assert.New(t)
|
||||
if !setupBucket("bucketinformation2", false, false, nil, nil, assert, 200) {
|
||||
if !setupBucket("bucketinformation2", false, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -2047,7 +2054,7 @@ func TestBucketInformationSuccessfulResponse(t *testing.T) {
|
||||
|
||||
// 1. Create the bucket
|
||||
assert := assert.New(t)
|
||||
if !setupBucket("bucketinformation1", false, false, nil, nil, assert, 200) {
|
||||
if !setupBucket("bucketinformation1", false, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -2160,11 +2167,14 @@ 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, 200) {
|
||||
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)
|
||||
@@ -2267,7 +2277,7 @@ func TestBucketVersioning(t *testing.T) {
|
||||
|
||||
requestDataBody := bytes.NewReader(requestDataJSON)
|
||||
|
||||
if !setupBucket("test2", true, false, nil, nil, assert, 200) {
|
||||
if !setupBucket("test2", true, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -2335,7 +2345,7 @@ func TestSetBucketTags(t *testing.T) {
|
||||
}
|
||||
|
||||
// put bucket
|
||||
if !setupBucket("test4", false, false, nil, nil, assert, 200) {
|
||||
if !setupBucket("test4", false, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -2402,7 +2412,7 @@ func TestGetBucket(t *testing.T) {
|
||||
Timeout: 2 * time.Second,
|
||||
}
|
||||
|
||||
if !setupBucket("test3", false, false, nil, nil, assert, 200) {
|
||||
if !setupBucket("test3", false, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -2455,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
|
||||
}
|
||||
})
|
||||
@@ -3000,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
|
||||
*/
|
||||
@@ -3037,7 +3047,7 @@ 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, 200) {
|
||||
@@ -3045,7 +3055,7 @@ func TestSetBucketVersioning(t *testing.T) {
|
||||
}
|
||||
|
||||
// 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)
|
||||
@@ -3118,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, 200) {
|
||||
if !setupBucket(bucketName, locking, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -3183,13 +3192,13 @@ func TestEnableBucketEncryption(t *testing.T) {
|
||||
404, resp.StatusCode, "Status Code is incorrect")
|
||||
}
|
||||
bodyBytes, _ = io.ReadAll(resp.Body)
|
||||
result2 := models.Error{}
|
||||
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)
|
||||
}
|
||||
|
||||
@@ -3381,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 := ""
|
||||
@@ -3392,7 +3400,7 @@ func TestBucketLifeCycle(t *testing.T) {
|
||||
var noncurrentversionExpirationDays int64
|
||||
|
||||
// 1. Add bucket
|
||||
if !setupBucket(bucketName, locking, versioning, nil, nil, assert, 200) {
|
||||
if !setupBucket(bucketName, locking, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -3597,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, 200) {
|
||||
if !setupBucket(bucketName, locking, nil, nil, nil, assert, 200) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -3846,16 +3853,16 @@ func TestAddRemoteBucket(t *testing.T) {
|
||||
fmt.Println("targetBucket: ", targetBucket)
|
||||
|
||||
// 1. Create bucket
|
||||
if !setupBucket("source", true, true, nil, nil, assert, 200) {
|
||||
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, 200, &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")
|
||||
}
|
||||
@@ -3905,16 +3912,16 @@ func TestDeleteRemoteBucket(t *testing.T) {
|
||||
fmt.Println("targetBucket: ", targetBucket)
|
||||
|
||||
// 1. Create bucket
|
||||
if !setupBucket("deletesource", true, true, nil, nil, assert, 200) {
|
||||
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, 200, &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")
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -29,30 +29,30 @@ import (
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// CheckVersionResponse check version response
|
||||
// APIError Api error
|
||||
//
|
||||
// swagger:model checkVersionResponse
|
||||
type CheckVersionResponse struct {
|
||||
// swagger:model ApiError
|
||||
type APIError struct {
|
||||
|
||||
// current version
|
||||
CurrentVersion string `json:"current_version,omitempty"`
|
||||
// detailed message
|
||||
DetailedMessage string `json:"detailedMessage,omitempty"`
|
||||
|
||||
// latest version
|
||||
LatestVersion string `json:"latest_version,omitempty"`
|
||||
// message
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this check version response
|
||||
func (m *CheckVersionResponse) Validate(formats strfmt.Registry) error {
|
||||
// Validate validates this Api error
|
||||
func (m *APIError) 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 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 *CheckVersionResponse) MarshalBinary() ([]byte, error) {
|
||||
func (m *APIError) 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 *APIError) UnmarshalBinary(b []byte) error {
|
||||
var res APIError
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -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")
|
||||
|
||||
@@ -108,6 +108,11 @@ 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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -176,6 +176,11 @@ func (m *LdapEntities) contextValidateGroups(ctx context.Context, formats strfmt
|
||||
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))
|
||||
@@ -196,6 +201,11 @@ func (m *LdapEntities) contextValidatePolicies(ctx context.Context, formats strf
|
||||
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))
|
||||
@@ -216,6 +226,11 @@ func (m *LdapEntities) contextValidateUsers(ctx context.Context, formats strfmt.
|
||||
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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -112,6 +112,11 @@ func (m *SetConfigRequest) contextValidateKeyValues(ctx context.Context, formats
|
||||
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))
|
||||
|
||||
@@ -133,6 +133,7 @@ func (m *SetNotificationEndpointResponse) ContextValidate(ctx context.Context, f
|
||||
func (m *SetNotificationEndpointResponse) 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")
|
||||
|
||||
@@ -128,6 +128,10 @@ func (m *SetPolicyMultipleNameRequest) contextValidateGroups(ctx context.Context
|
||||
|
||||
for i := 0; i < len(m.Groups); i++ {
|
||||
|
||||
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))
|
||||
@@ -146,6 +150,10 @@ func (m *SetPolicyMultipleNameRequest) contextValidateUsers(ctx context.Context,
|
||||
|
||||
for i := 0; i < len(m.Users); i++ {
|
||||
|
||||
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))
|
||||
|
||||
@@ -130,6 +130,7 @@ func (m *SetPolicyNameRequest) ContextValidate(ctx context.Context, formats strf
|
||||
func (m *SetPolicyNameRequest) contextValidateEntityType(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.EntityType != nil {
|
||||
|
||||
if err := m.EntityType.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("entityType")
|
||||
|
||||
@@ -113,6 +113,7 @@ func (m *SetPolicyRequest) ContextValidate(ctx context.Context, formats strfmt.R
|
||||
func (m *SetPolicyRequest) contextValidateEntityType(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.EntityType != nil {
|
||||
|
||||
if err := m.EntityType.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("entityType")
|
||||
|
||||
@@ -71,6 +71,11 @@ func (m SiteReplicationAddRequest) ContextValidate(ctx context.Context, formats
|
||||
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))
|
||||
|
||||
@@ -108,6 +108,11 @@ func (m *SiteReplicationInfoResponse) contextValidateSites(ctx context.Context,
|
||||
for i := 0; i < len(m.Sites); i++ {
|
||||
|
||||
if m.Sites[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Sites[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Sites[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("sites" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -102,6 +102,11 @@ func (m *StartProfilingList) contextValidateStartResults(ctx context.Context, fo
|
||||
for i := 0; i < len(m.StartResults); i++ {
|
||||
|
||||
if m.StartResults[i] != nil {
|
||||
|
||||
if swag.IsZero(m.StartResults[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.StartResults[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("startResults" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -108,6 +108,11 @@ func (m *SubnetLoginResponse) contextValidateOrganizations(ctx context.Context,
|
||||
for i := 0; i < len(m.Organizations); i++ {
|
||||
|
||||
if m.Organizations[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Organizations[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Organizations[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("organizations" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -243,6 +243,11 @@ func (m *Tier) ContextValidate(ctx context.Context, formats strfmt.Registry) err
|
||||
func (m *Tier) contextValidateAzure(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Azure != nil {
|
||||
|
||||
if swag.IsZero(m.Azure) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Azure.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("azure")
|
||||
@@ -259,6 +264,11 @@ func (m *Tier) contextValidateAzure(ctx context.Context, formats strfmt.Registry
|
||||
func (m *Tier) contextValidateGcs(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Gcs != nil {
|
||||
|
||||
if swag.IsZero(m.Gcs) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Gcs.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("gcs")
|
||||
@@ -275,6 +285,11 @@ func (m *Tier) contextValidateGcs(ctx context.Context, formats strfmt.Registry)
|
||||
func (m *Tier) contextValidateMinio(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Minio != nil {
|
||||
|
||||
if swag.IsZero(m.Minio) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Minio.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("minio")
|
||||
@@ -291,6 +306,11 @@ func (m *Tier) contextValidateMinio(ctx context.Context, formats strfmt.Registry
|
||||
func (m *Tier) contextValidateS3(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.S3 != nil {
|
||||
|
||||
if swag.IsZero(m.S3) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.S3.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("s3")
|
||||
|
||||
@@ -99,6 +99,11 @@ func (m *TierListResponse) contextValidateItems(ctx context.Context, formats str
|
||||
for i := 0; i < len(m.Items); i++ {
|
||||
|
||||
if m.Items[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Items[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Items[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("items" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -31,18 +31,33 @@ import (
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// AddServiceAccountPolicyRequest add service account policy request
|
||||
// UpdateServiceAccountRequest update service account request
|
||||
//
|
||||
// swagger:model addServiceAccountPolicyRequest
|
||||
type AddServiceAccountPolicyRequest struct {
|
||||
// swagger:model updateServiceAccountRequest
|
||||
type UpdateServiceAccountRequest struct {
|
||||
|
||||
// description
|
||||
Description string `json:"description,omitempty"`
|
||||
|
||||
// expiry
|
||||
Expiry string `json:"expiry,omitempty"`
|
||||
|
||||
// name
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
// policy
|
||||
// Required: true
|
||||
Policy *string `json:"policy"`
|
||||
|
||||
// secret key
|
||||
SecretKey string `json:"secretKey,omitempty"`
|
||||
|
||||
// status
|
||||
Status string `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this add service account policy request
|
||||
func (m *AddServiceAccountPolicyRequest) Validate(formats strfmt.Registry) error {
|
||||
// Validate validates this update service account request
|
||||
func (m *UpdateServiceAccountRequest) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validatePolicy(formats); err != nil {
|
||||
@@ -55,7 +70,7 @@ func (m *AddServiceAccountPolicyRequest) Validate(formats strfmt.Registry) error
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *AddServiceAccountPolicyRequest) validatePolicy(formats strfmt.Registry) error {
|
||||
func (m *UpdateServiceAccountRequest) validatePolicy(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("policy", "body", m.Policy); err != nil {
|
||||
return err
|
||||
@@ -64,13 +79,13 @@ func (m *AddServiceAccountPolicyRequest) validatePolicy(formats strfmt.Registry)
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this add service account policy request based on context it is used
|
||||
func (m *AddServiceAccountPolicyRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
// ContextValidate validates this update service account request based on context it is used
|
||||
func (m *UpdateServiceAccountRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *AddServiceAccountPolicyRequest) MarshalBinary() ([]byte, error) {
|
||||
func (m *UpdateServiceAccountRequest) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
@@ -78,8 +93,8 @@ func (m *AddServiceAccountPolicyRequest) MarshalBinary() ([]byte, error) {
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *AddServiceAccountPolicyRequest) UnmarshalBinary(b []byte) error {
|
||||
var res AddServiceAccountPolicyRequest
|
||||
func (m *UpdateServiceAccountRequest) UnmarshalBinary(b []byte) error {
|
||||
var res UpdateServiceAccountRequest
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -102,6 +102,11 @@ func (m *UserServiceAccountSummary) contextValidateUserServiceAccountList(ctx co
|
||||
for i := 0; i < len(m.UserServiceAccountList); i++ {
|
||||
|
||||
if m.UserServiceAccountList[i] != nil {
|
||||
|
||||
if swag.IsZero(m.UserServiceAccountList[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.UserServiceAccountList[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("userServiceAccountList" + "." + strconv.Itoa(i))
|
||||
|
||||
@@ -136,6 +136,11 @@ func (m *Widget) ContextValidate(ctx context.Context, formats strfmt.Registry) e
|
||||
func (m *Widget) contextValidateOptions(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Options != nil {
|
||||
|
||||
if swag.IsZero(m.Options) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Options.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("options")
|
||||
@@ -154,6 +159,11 @@ func (m *Widget) contextValidateTargets(ctx context.Context, formats strfmt.Regi
|
||||
for i := 0; i < len(m.Targets); i++ {
|
||||
|
||||
if m.Targets[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Targets[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Targets[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("targets" + "." + strconv.Itoa(i))
|
||||
@@ -246,6 +256,11 @@ func (m *WidgetOptions) ContextValidate(ctx context.Context, formats strfmt.Regi
|
||||
func (m *WidgetOptions) contextValidateReduceOptions(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.ReduceOptions != nil {
|
||||
|
||||
if swag.IsZero(m.ReduceOptions) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.ReduceOptions.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("options" + "." + "reduceOptions")
|
||||
|
||||
@@ -136,6 +136,11 @@ func (m *WidgetDetails) ContextValidate(ctx context.Context, formats strfmt.Regi
|
||||
func (m *WidgetDetails) contextValidateOptions(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Options != nil {
|
||||
|
||||
if swag.IsZero(m.Options) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Options.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("options")
|
||||
@@ -154,6 +159,11 @@ func (m *WidgetDetails) contextValidateTargets(ctx context.Context, formats strf
|
||||
for i := 0; i < len(m.Targets); i++ {
|
||||
|
||||
if m.Targets[i] != nil {
|
||||
|
||||
if swag.IsZero(m.Targets[i]) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.Targets[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("targets" + "." + strconv.Itoa(i))
|
||||
@@ -246,6 +256,11 @@ func (m *WidgetDetailsOptions) ContextValidate(ctx context.Context, formats strf
|
||||
func (m *WidgetDetailsOptions) contextValidateReduceOptions(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.ReduceOptions != nil {
|
||||
|
||||
if swag.IsZero(m.ReduceOptions) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := m.ReduceOptions.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("options" + "." + "reduceOptions")
|
||||
|
||||
@@ -20,10 +20,12 @@ package oauth2
|
||||
|
||||
import (
|
||||
"crypto/sha1"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/minio/console/pkg/auth/token"
|
||||
"github.com/minio/pkg/env"
|
||||
"github.com/minio/pkg/v2/env"
|
||||
"golang.org/x/crypto/pbkdf2"
|
||||
)
|
||||
|
||||
@@ -105,7 +107,14 @@ func getIDPScopes() string {
|
||||
return env.Get(ConsoleIDPScopes, "openid,profile,email")
|
||||
}
|
||||
|
||||
// getIDPTokenExpiration return default token expiration for access token (in seconds)
|
||||
func getIDPTokenExpiration() string {
|
||||
return env.Get(ConsoleIDPTokenExpiration, "3600")
|
||||
// getIDPTokenExpiration return default token expiration for access token
|
||||
func getIDPTokenExpiration() time.Duration {
|
||||
expiration := 12 * 3600
|
||||
if expStr := env.Get(ConsoleIDPTokenExpiration, ""); expStr != "" {
|
||||
if exp, err := strconv.Atoi(expStr); err == nil {
|
||||
expiration = exp
|
||||
}
|
||||
}
|
||||
|
||||
return time.Duration(expiration) * time.Second
|
||||
}
|
||||
|
||||
@@ -25,13 +25,13 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/minio/minio-go/v7/pkg/credentials"
|
||||
"github.com/minio/minio-go/v7/pkg/set"
|
||||
|
||||
"github.com/minio/console/pkg/auth/token"
|
||||
"github.com/minio/console/pkg/auth/utils"
|
||||
"golang.org/x/crypto/pbkdf2"
|
||||
"golang.org/x/oauth2"
|
||||
@@ -323,30 +323,37 @@ func (client *Provider) VerifyIdentity(ctx context.Context, code, state, roleARN
|
||||
getWebTokenExpiry := func() (*credentials.WebIdentityToken, error) {
|
||||
customCtx := context.WithValue(ctx, oauth2.HTTPClient, client.provHTTPClient)
|
||||
oauth2Token, err := client.oauth2Config.Exchange(customCtx, code)
|
||||
client.RefreshToken = oauth2Token.RefreshToken
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !oauth2Token.Valid() {
|
||||
return nil, errors.New("invalid token")
|
||||
}
|
||||
client.RefreshToken = oauth2Token.RefreshToken
|
||||
|
||||
// expiration configured in the token itself
|
||||
expiration := int(oauth2Token.Expiry.Sub(time.Now().UTC()).Seconds())
|
||||
|
||||
// check if user configured a hardcoded expiration for console via env variables
|
||||
// and override the incoming expiration
|
||||
userConfiguredExpiration := getIDPTokenExpiration()
|
||||
if userConfiguredExpiration != "" {
|
||||
expiration, _ = strconv.Atoi(userConfiguredExpiration)
|
||||
expiration := token.GetConsoleSTSDuration()
|
||||
if exp := getIDPTokenExpiration(); exp > 0 {
|
||||
expiration = exp
|
||||
}
|
||||
|
||||
// Use the expiration configured in the token itself if it is closer than the configured value
|
||||
if exp := oauth2Token.Expiry.Sub(time.Now().UTC()); exp < expiration {
|
||||
expiration = exp
|
||||
}
|
||||
|
||||
// Minimum duration in S3 spec is 15 minutes, do not bother returning
|
||||
// an error to the user and force the minimum duration instead
|
||||
if expiration < 900*time.Second {
|
||||
expiration = 900 * time.Second
|
||||
}
|
||||
|
||||
idToken := oauth2Token.Extra("id_token")
|
||||
if idToken == nil {
|
||||
return nil, errors.New("missing id_token")
|
||||
}
|
||||
token := &credentials.WebIdentityToken{
|
||||
Token: idToken.(string),
|
||||
Expiry: expiration,
|
||||
Expiry: int(expiration.Seconds()),
|
||||
}
|
||||
if client.UserInfo { // look for access_token only if userinfo is requested.
|
||||
accessToken := oauth2Token.Extra("access_token")
|
||||
|
||||
@@ -19,7 +19,7 @@ package ldap
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/minio/pkg/env"
|
||||
"github.com/minio/pkg/v2/env"
|
||||
)
|
||||
|
||||
func GetLDAPEnabled() bool {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user