Compare commits

..

90 Commits

Author SHA1 Message Date
Alex
1deb6371ed Release v0.19.4 (#2209)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-07-29 13:12:41 -07:00
Aditya Manthramurthy
3b11556f4b Fix build after swagger codegen (#2201) 2022-07-28 13:20:16 -07:00
Lenin Alevski
25f719b0e2 TLS Certificates help box and small bug fixes (#2206)
- Added TLSHelpBox component
- fix: Use the right `add` icon component in the security tab to be consistent
- fix: Add/Remove additional certificates button for custom certificates
- fix: Add/Remove additional users button for built-in IDP

Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
2022-07-28 14:18:28 -05:00
Alex
231b63f1b0 Added duration param to speedtest (#2205) 2022-07-27 21:00:54 -05:00
Javier Adriel
e73370cc8c Add dummy subnet handlers (#2198) 2022-07-27 16:34:19 -07:00
Javier Adriel
5d25dd4c06 Improve marketplace test coverage (#2202)
* Improve marketplace test coverage

* gofumpt
2022-07-27 16:33:56 -07:00
Kaan Kabalak
51a8bacc18 Implement WebSockets for Profile download (#2190) 2022-07-26 18:40:24 -07:00
Harshavardhana
db07f546a4 Release v0.19.3
Signed-off-by: Harshavardhana <harsha@minio.io>
2022-07-24 09:51:03 -07:00
Harshavardhana
255cf0bc85 fix: hard regression in console login from v0.19.2 release
fixes #2197
2022-07-24 09:41:55 -07:00
Harshavardhana
733e0b18e2 make sure build works for now 2022-07-22 22:47:08 -07:00
Daniel Valdivia
8d90e03992 Release v0.19.2 (#2194)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-07-22 22:15:03 -07:00
Cesar Celis Hernandez
1a1fae9ce3 Use intended console code in compiled MinIO (#2193) 2022-07-22 22:14:46 -07:00
Alex
f26786c904 Fixed Tiers load when information from tierStats is not available (#2191)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-07-22 12:40:38 -07:00
Javier Adriel
e0b6bf5aa6 Register api key section (#2180)
Split register section in tabs
Add register API key section
2022-07-22 11:27:53 -07:00
Daniel Valdivia
9655fc4490 Fix operator login not showing error (#2185)
* Fix operator login not showing error

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>

* Fix Test

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-07-22 12:21:25 -05:00
dependabot[bot]
417ea4d481 Bump terser from 5.14.0 to 5.14.2 in /portal-ui (#2187)
Bumps [terser](https://github.com/terser/terser) from 5.14.0 to 5.14.2.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/commits)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-22 11:57:54 -05:00
Daniel Valdivia
5a59f8e3f4 iFrame Header when embedding (#2189)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-07-22 00:03:52 -07:00
jinapurapu
48340d0010 Fixed jumpy switch for Proxy configuration on Register screen (#2186) 2022-07-21 19:12:01 -05:00
Lenin Alevski
251de9fe8a Add support for adding LDAP admins based on user/group DNs (#2178)
Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
2022-07-20 18:27:11 -07:00
Javier Adriel
c501df927b Split register section in tabs (#2176) 2022-07-20 18:26:43 -07:00
Daniel Valdivia
cdb1659506 Fix redirect to login base url. (#2182)
No longer needed due to baseUrl in the react router
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-07-20 16:23:24 -07:00
Lenin Alevski
558afe36ad Various fixes for Tenant details page (#2181)
- fixed refresh tenant details page after changing Domains and updating
  image
- Relax tenant domains to allow including port number

Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
2022-07-20 11:55:19 -05:00
Alex
712d3870eb Fixed storage class selectors for add & edit pool wizards (#2183)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-07-20 10:11:56 -05:00
NaccOll
c71f084531 feat: subpath support using reverse proxy (#2174) 2022-07-19 19:32:20 -07:00
jinapurapu
1c58a543b6 Monitoring and Audit Log config screen UI tests (#2179) 2022-07-19 19:10:21 -05:00
Alex
8e857dc563 Updated security issue with glob-parent dependency (#2177)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-07-18 19:00:48 -05:00
Javier Adriel
78d4d4c89e Add endpoint to get api key from subnet (#2175) 2022-07-18 17:51:07 -05:00
Alex
aea749d82f Added Loader in rewind enable function (#2172)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-07-18 15:39:14 -05:00
jinapurapu
ce3293b4e2 Added Testcafe test for Audit Logging text fields (#2173)
Added Testcafe test for Audit Logging text fields, fixed bug in setting serviceAccount
2022-07-15 17:06:33 -05:00
jinapurapu
0c12fbdd23 Tenant Monitoring Screen TestCafe UI tests (#2161) 2022-07-15 14:06:48 -05:00
Aditya Manthramurthy
118cf97e1d Allow multiple IDPs config to be passed via struct (#2167)
* Allow multiple IDPs config to be passed via struct

* This removes support for ENV based IDP configuration for console

* Ensure default scopes are used if none are given

* Add display name field for provider config
2022-07-14 07:27:45 -07:00
jinapurapu
abb668633b Added bucket naming rules to Add Bucket help text (#2171) 2022-07-13 14:05:37 -07:00
jinapurapu
dd2fffd3dc Tenant security context component (#2139)
Added edit Security Context component to Tenant Security screen, and updated API and backend to enable editing
2022-07-13 14:05:07 -07:00
Harshavardhana
64b13e9dc9 Remove pkg.MPSECRET unused value 2022-07-12 13:59:36 -07:00
Alex
58d7f1e8ae Release v0.19.1 (#2169)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-07-12 13:51:11 -07:00
dependabot[bot]
45e4a94416 Bump moment from 2.29.3 to 2.29.4 in /portal-ui (#2164)
Bumps [moment](https://github.com/moment/moment) from 2.29.3 to 2.29.4.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.29.3...2.29.4)

---
updated-dependencies:
- dependency-name: moment
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-07 14:53:04 -05:00
jinapurapu
cce054bbe8 Create security context component and add to edit Prometheus Monitoring (#2115) 2022-07-07 14:52:30 -05:00
Alex
cf0e326b82 Object Browser only mode (#2157)
- Added flag CONSOLE_OBJECT_BROWSER_ONLY=on to trigger between console mode & Object Browser only
- Hidden not necessary buttons for object browse
- STS Login

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-07-07 12:28:25 -07:00
Javier Adriel
e48958f5a0 Connect marketplace API to microservice (#2130) 2022-07-06 23:11:23 -05:00
Klaus Post
63e2793272 Update trace response and dependencies (#2141) 2022-07-05 13:36:12 -07:00
Prakash Senthil Vel
532e64b802 UI AGPL license consent (#2154) 2022-07-05 09:17:51 -07:00
Alex
64b3e965c6 Change Support menu positon (#2160)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-07-05 11:08:18 -05:00
Alex
9371c027f3 Added Prettier test to workflow (#2159)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-06-30 23:40:23 -05:00
jinapurapu
a8bc58a420 Add Audit Log and Log DB security context selector and split screen into tabs (#2156)
* Added security context selector for logging and log DB to Audit Log screen, split Audit Log screen into tabs
* Cleaned up tab titles, disabled Save button while loading
2022-06-30 14:28:08 -07:00
Javier Adriel
10c56a91da Check if user is in EU (#2143) 2022-06-30 14:27:36 -07:00
Javier Adriel
403972de39 Select not working without dispatch (#2152) 2022-06-29 19:02:38 -05:00
Paweł Kuffel
1c0632473a Add object-level error message display in Downloads/Uploads panel (#2150) 2022-06-29 08:26:22 -07:00
Harshavardhana
ff93109b57 simplify and optimize deleting multiple versions of object (#2153) 2022-06-28 20:25:50 -07:00
Cesar Celis Hernandez
b518810106 Avoid the crash in the test (#2147) 2022-06-24 18:51:52 -05:00
Prakash Senthil Vel
b4d2d65c5c UX Top bar height (#2146) 2022-06-24 10:25:30 -07:00
Alex
beeb188d7e Fixed issues in Replication rules screens (#2145) 2022-06-23 21:35:50 -07:00
jinapurapu
2830022ede Tenant log config screen (#2142)
* Created file for auditLogsScreen, connected to link in TenantDetails Audit Log tab
* Fixed input title formatting, confirmation modal logic
2022-06-23 16:43:23 -07:00
Javier Adriel
ba4103e03f Prompt email after login (#2108)
* Add new route to marketplace modal
* Add redux logic for showing and displaying marketplace modal
* Redirect to marketplace view if console is in operator and marketplace mode
* Add marketplace component
* Use navigate instead of redirect
2022-06-23 12:22:38 -07:00
Alex
f3d6638384 Added improvements to Rename modal in windows (#2140)
- Disabled button when filename is less than 200 characters long
- Selector to override & accept long name
- Added this behavior when one file is checked in objects list

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-06-23 10:17:52 -05:00
Alex
2ad42d660b Added Rename modal for filenames longer than 200 characters in Windows (#2137)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-06-22 12:43:57 -05:00
Cesar Celis Hernandez
618a00d775 Improving our Operator Test in console (#2138) 2022-06-22 11:07:40 -05:00
jinapurapu
d0b65ce297 Single screen to display and edit Prometheus monitoring configuration (#2134)
* Created new screen to display and edit Prometheus monitoring configuration
* Updated image name validation to include slash and colon
* Removed unused files
2022-06-21 09:39:32 -07:00
Cesar Celis Hernandez
41f640077b Delete Tenant Test (#2098) 2022-06-20 15:24:44 -07:00
Cesar Celis Hernandez
bfa05616b1 Wait until resource exist to wait on it (#2136) 2022-06-20 14:48:54 -07:00
Javier Adriel
f792d7a476 Remove unused deps (#2133) 2022-06-16 19:32:27 -07:00
jinapurapu
9b13cfdbe9 User Assign Policy UI test (#2129) 2022-06-16 14:43:08 -05:00
Cesar Celis Hernandez
02c274e117 Relaxing tests when play is down (#2131) 2022-06-16 08:49:53 -07:00
Daniel Valdivia
8993b40730 Release v0.19.0 (#2125)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-06-15 18:18:36 -07:00
Prakash Senthil Vel
1311b171f9 UX menu toggle and license badge icon (#2127) 2022-06-15 16:54:13 -07:00
Alex
7ecc1022b2 Added decimal support to bucket quota selectors (#2126)
- Fixed an issue with calculateBytes function
- Fixed add bucket validation form

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-06-15 16:35:47 -07:00
Javier Adriel
a5c14790b3 Fix describe test (#2128) 2022-06-15 14:58:35 -05:00
Javier Adriel
e5f7a03585 Remove unused code in marketplace API (#2124) 2022-06-15 09:21:59 -07:00
jinapurapu
a024a13f25 Policy selector fix (#2123) 2022-06-14 12:18:41 -05:00
Alex
4d876d0ce8 Remove of unused history props (#2122)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-06-13 16:40:58 -07:00
Javier Adriel
b02c37bf33 Remove history library (#2119)
* Use navigate instead of push
* Remove use navigate
* Remove import
* Remove history
2022-06-13 16:16:43 -07:00
Daniel Valdivia
1d17f11d2f Update AddUserScreen layout to fix padding (#2121)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-06-13 13:29:21 -05:00
Lenin Alevski
1dd9f7f363 Adding missing init container fields for Prometheus and Logsearch(Audit) UI (#2116)
Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
2022-06-11 20:20:57 -07:00
Cesar Celis Hernandez
618d95b76e Reduce renders in password when adding a user (#2120) 2022-06-11 18:09:55 -07:00
Daniel Valdivia
e416abe19b Updates to License page and Menu (#2118)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-06-10 20:11:33 -07:00
Javier Adriel
296f58f43d Use appDispatch instead (#2114) 2022-06-10 14:33:17 -07:00
Daniel Valdivia
0b5e3d5a10 Metrics tweaks for free space (#2113)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-06-10 13:26:50 -07:00
Cesar Celis Hernandez
5d591b18d9 Reduce renders in User Name when adding a user (#2106) 2022-06-10 14:57:52 -05:00
Daniel Valdivia
e68bc08fed License Page adjustments (#2109)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-06-10 11:22:29 -07:00
Alex
df38c84075 Changed useDispatch implementation to comply with TS specification (#2110)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-06-10 11:05:21 -07:00
Javier Adriel
c509e5db70 API to receive an email address and set it (#2095)
* Generate swagger code for new endpoints
* Implemetn swagger APIs
* Add unit tests
2022-06-09 16:13:46 -07:00
Alex
5a8e029005 Added Initial Time support to Prometheus dashboard (#2099)
Incremented initial time for data usage growth chart
2022-06-09 15:52:12 -07:00
Alex
e3d96b5bb3 Updated React router to V6 (#2107)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-06-09 15:37:21 -07:00
Daniel Valdivia
51afc337ff Fix Bucket Audit Acess width problem (#2105)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-06-08 11:44:28 -05:00
Cesar Celis Hernandez
617d41584e Get Tenant Details (#2097) 2022-06-08 09:05:42 -07:00
Kaan Kabalak
7a8e2caa50 Fix Invalid DOM property error (#2101)
As it is defined in a .tsx file, the AGPL Console logo was causing an
error to be displayed because the DOM property in question was not in
camel case.
2022-06-08 08:49:18 -07:00
adfost
fed58ec29a Delete remote bucket test (#2096) 2022-06-07 14:42:14 -05:00
Cesar Celis Hernandez
427a7516a3 Isolating users test in Testcafe (#2094) 2022-06-07 11:01:42 -05:00
Cesar Celis Hernandez
969feb8efa Adding Tenant Log Test (#2093) 2022-06-07 00:14:45 -05:00
jinapurapu
d09d6e1e99 Filtered list of policies being applied to group to remove duplicates (#2091) 2022-06-06 16:11:36 -07:00
Cesar Celis Hernandez
2d80638090 Add Tenant Logging Tests (#2090) 2022-06-06 13:31:27 -07:00
888 changed files with 17195 additions and 7859 deletions

View File

@@ -29,7 +29,7 @@ jobs:
strategy:
matrix:
go-version: [ 1.17.x ]
go-version: [ 1.18.x ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -98,7 +98,7 @@ jobs:
strategy:
matrix:
go-version: [ 1.17.x ]
go-version: [ 1.18.x ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -135,6 +135,7 @@ jobs:
run: |
echo "The idea is to build minio image from downloaded repository";
cd $GITHUB_WORKSPACE/minio_repository;
echo "replace github.com/minio/console => ../" >> go.mod
echo "Get git version to build MinIO Image";
VERSION=`git rev-parse HEAD`;
echo $VERSION;
@@ -167,7 +168,7 @@ jobs:
strategy:
matrix:
go-version: [ 1.17.x ]
go-version: [ 1.18.x ]
steps:
@@ -209,7 +210,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.17.x ]
go-version: [ 1.18.x ]
os: [ ubuntu-latest ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -233,7 +234,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.17.x ]
go-version: [ 1.18.x ]
os: [ ubuntu-latest ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -276,11 +277,11 @@ jobs:
semgrep --config semgrep.yaml $(pwd)/portal-ui --error
no-warnings-and-make-assets:
name: "React Code Has No Warnings and then Make Assets"
name: "React Code Has No Warnings & is Prettified, then Make Assets"
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.17.x ]
go-version: [ 1.18.x ]
os: [ ubuntu-latest ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -329,13 +330,18 @@ jobs:
continue-on-error: false
run: |
./check-warnings.sh
- name: Check if Files are Prettified
working-directory: ./portal-ui
continue-on-error: false
run: |
./check-prettier.sh
reuse-golang-dependencies:
name: reuse golang dependencies
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.17.x ]
go-version: [ 1.18.x ]
os: [ ubuntu-latest ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -373,7 +379,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.17.x ]
go-version: [ 1.18.x ]
os: [ ubuntu-latest ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -452,7 +458,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.17.x ]
go-version: [ 1.18.x ]
os: [ ubuntu-latest ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -531,7 +537,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.17.x ]
go-version: [ 1.18.x ]
os: [ ubuntu-latest ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -612,7 +618,7 @@ jobs:
timeout-minutes: 5
strategy:
matrix:
go-version: [ 1.17.x ]
go-version: [ 1.18.x ]
os: [ ubuntu-latest ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -681,7 +687,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.17.x ]
go-version: [ 1.18.x ]
os: [ ubuntu-latest ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -750,7 +756,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.17.x ]
go-version: [ 1.18.x ]
os: [ ubuntu-latest ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -819,7 +825,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.17.x ]
go-version: [ 1.18.x ]
os: [ ubuntu-latest ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -877,6 +883,154 @@ jobs:
with:
args: '"chrome:headless" portal-ui/tests/permissions-7/ --skip-js-errors'
all-permissions-8:
name: Permissions Tests Part 8
needs:
- lint-job
- no-warnings-and-make-assets
- reuse-golang-dependencies
- vulnerable-dependencies-checks
- semgrep-static-code-analysis
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.18.x ]
os: [ ubuntu-latest ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
id: go
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
name: Yarn Cache
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
./portal-ui/node_modules/
./portal-ui/build/
key: ${{ runner.os }}-yarn-${{ hashFiles('./portal-ui/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- uses: actions/cache@v2
id: assets-cache
name: Assets Cache
with:
path: |
./portal-ui/build/
key: ${{ runner.os }}-assets-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-assets-
- uses: actions/cache@v2
name: Go Mod Cache
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ github.run_id }}
- name: Build Console on ${{ matrix.os }}
env:
GO111MODULE: on
GOOS: linux
run: |
make console
- name: Start Console, front-end app and initialize users/policies
run: |
(./console server) & (make initialize-permissions)
- name: Run TestCafe Tests
timeout-minutes: 5
uses: DevExpress/testcafe-action@latest
with:
args: '"chrome:headless" portal-ui/tests/permissions-8/ --skip-js-errors'
all-permissions-9:
name: Permissions Tests Part 9
needs:
- lint-job
- no-warnings-and-make-assets
- reuse-golang-dependencies
- vulnerable-dependencies-checks
- semgrep-static-code-analysis
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.18.x ]
os: [ ubuntu-latest ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
id: go
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
name: Yarn Cache
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
./portal-ui/node_modules/
./portal-ui/build/
key: ${{ runner.os }}-yarn-${{ hashFiles('./portal-ui/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- uses: actions/cache@v2
id: assets-cache
name: Assets Cache
with:
path: |
./portal-ui/build/
key: ${{ runner.os }}-assets-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-assets-
- uses: actions/cache@v2
name: Go Mod Cache
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ github.run_id }}
- name: Build Console on ${{ matrix.os }}
env:
GO111MODULE: on
GOOS: linux
run: |
make console
- name: Start Console, front-end app and initialize users/policies
run: |
(./console server) & (make initialize-permissions)
- name: Run TestCafe Tests
uses: DevExpress/testcafe-action@latest
with:
args: '"chrome:headless" portal-ui/tests/permissions-9/ --skip-js-errors -c 3'
- name: Clean up users & policies
run: |
make cleanup-permissions
all-operator-tests:
name: Operator UI Tests
needs:
@@ -888,7 +1042,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.17.x ]
go-version: [ 1.18.x ]
os: [ ubuntu-latest ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -962,7 +1116,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.17.x ]
go-version: [ 1.18.x ]
os: [ ubuntu-latest ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -1000,7 +1154,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.17.x ]
go-version: [ 1.18.x ]
os: [ ubuntu-latest ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -1038,7 +1192,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.17.x ]
go-version: [ 1.18.x ]
os: [ ubuntu-latest ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -1076,7 +1230,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.17.x ]
go-version: [ 1.18.x ]
os: [ ubuntu-latest ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -1114,7 +1268,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.17.x ]
go-version: [ 1.18.x ]
os: [ ubuntu-latest ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -1152,7 +1306,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.17.x ]
go-version: [ 1.18.x ]
os: [ ubuntu-latest ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -1190,7 +1344,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.17.x ]
go-version: [ 1.18.x ]
os: [ ubuntu-latest ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -1228,7 +1382,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.17.x ]
go-version: [ 1.18.x ]
os: [ ubuntu-latest ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -1274,7 +1428,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.17.x ]
go-version: [ 1.18.x ]
os: [ ubuntu-latest ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -1321,7 +1475,7 @@ jobs:
strategy:
matrix:
go-version: [ 1.17.x ]
go-version: [ 1.18.x ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -1377,6 +1531,15 @@ jobs:
echo "Create the folder to put the all.out file"
TARGET_BUCKET=`echo $RANDOM | md5sum | head -c 20; echo;`
echo "TARGET_BUCKET: ${TARGET_BUCKET}"
echo "Only run our test if play is up and running..."
PLAY_IS_ON=`wget --spider --server-response https://play.min.io:9443/login 2>&1 | grep '200\ OK' | wc -l`
if [ $PLAY_IS_ON == 1 ]
then
echo "Play is up and running, we will proceed with the test"
else
echo "Play is down, please report it on hack channel"
exit
fi
./mc mb --ignore-existing play/${TARGET_BUCKET}/
./mc version enable play/${TARGET_BUCKET}
# Via API we are going to test:
@@ -1424,7 +1587,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.17.x ]
go-version: [ 1.18.x ]
os: [ ubuntu-latest ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -1519,24 +1682,32 @@ jobs:
wget -q https://dl.min.io/client/mc/release/linux-amd64/mc
echo "Change the permissions to execute mc command"
chmod +x mc
echo "Create the folder to put the all.out file"
./mc mb --ignore-existing play/builds/
echo "Copy the all.out file to play bucket"
echo ${{ github.repository }}
echo ${{ github.event.number }}
echo ${{ github.run_id }}
# mc cp can fail due to lack of space: mc: <ERROR> Failed to copy `all.out`.
# Storage backend has reached its minimum free disk threshold. Please delete a few objects to proceed.
./mc cp all.out play/builds/${{ github.repository }}/${{ github.event.number }}/${{ github.run_id }}/ || true
./mc cp all.out play/builds/${{ github.repository }}/${{ github.event.number }}/latest/ || true
go tool cover -html=all.out -o coverage.html
./mc cp coverage.html play/builds/${{ github.repository }}/${{ github.event.number }}/${{ github.run_id }}/ || true
./mc cp coverage.html play/builds/${{ github.repository }}/${{ github.event.number }}/latest/ || true
echo "Only run our test if play is up and running since we require it for replication tests here."
PLAY_IS_ON=`wget --spider --server-response https://play.min.io:9443/login 2>&1 | grep '200\ OK' | wc -l`
if [ $PLAY_IS_ON == 1 ]
then
echo "Play is up and running, we will proceed with the play part for coverage"
echo "Create the folder to put the all.out file"
./mc mb --ignore-existing play/builds/
echo "Copy the all.out file to play bucket"
echo ${{ github.repository }}
echo ${{ github.event.number }}
echo ${{ github.run_id }}
# mc cp can fail due to lack of space: mc: <ERROR> Failed to copy `all.out`.
# Storage backend has reached its minimum free disk threshold. Please delete a few objects to proceed.
./mc cp all.out play/builds/${{ github.repository }}/${{ github.event.number }}/${{ github.run_id }}/ || true
./mc cp all.out play/builds/${{ github.repository }}/${{ github.event.number }}/latest/ || true
go tool cover -html=all.out -o coverage.html
./mc cp coverage.html play/builds/${{ github.repository }}/${{ github.event.number }}/${{ github.run_id }}/ || true
./mc cp coverage.html play/builds/${{ github.repository }}/${{ github.event.number }}/latest/ || true
else
echo "Play is down, please report it on hack channel, no coverage is going to be uploaded!!!"
fi
echo "grep to obtain the result"
go tool cover -func=all.out | grep total > tmp2
result=`cat tmp2 | awk 'END {print $3}'`
result=${result%\%}
threshold=51.50
threshold=53.40
echo "Result:"
echo "$result%"
if (( $(echo "$result >= $threshold" |bc -l) )); then

View File

@@ -12,7 +12,7 @@ RUN make build-static
USER node
FROM golang:1.17 as golayer
FROM golang:1.18 as golayer
RUN apt-get update -y && apt-get install -y ca-certificates
@@ -31,7 +31,7 @@ ENV CGO_ENABLED=0
COPY --from=uilayer /app/build /go/src/github.com/minio/console/portal-ui/build
RUN go build --tags=kqueue,operator -ldflags "-w -s" -a -o console ./cmd/console
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.5
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.6
MAINTAINER MinIO Development "dev@min.io"
EXPOSE 9090

View File

@@ -21,7 +21,7 @@ k8sdev:
getdeps:
@mkdir -p ${GOPATH}/bin
@which golangci-lint 1>/dev/null || (echo "Installing golangci-lint" && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.43.0)
@echo "Installing golangci-lint" && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.45.2
verifiers: getdeps fmt lint

12
go.mod
View File

@@ -22,9 +22,9 @@ require (
github.com/minio/cli v1.22.0
github.com/minio/highwayhash v1.0.2
github.com/minio/kes v0.19.2
github.com/minio/madmin-go v1.3.14
github.com/minio/mc v0.0.0-20220512134321-aa60a8db1e4d
github.com/minio/minio-go/v7 v7.0.26
github.com/minio/madmin-go v1.4.3
github.com/minio/mc v0.0.0-20220705180830-01b87ecc02ff
github.com/minio/minio-go/v7 v7.0.30
github.com/minio/operator v0.0.0-20220414212219-ba4c097324b2
github.com/minio/pkg v1.1.23
github.com/minio/selfupdate v0.4.0
@@ -34,7 +34,7 @@ require (
github.com/stretchr/testify v1.7.1
github.com/tidwall/gjson v1.14.0
github.com/unrolled/secure v1.10.0
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e
golang.org/x/net v0.0.0-20220421235706-1d1ef9303861
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5
gopkg.in/yaml.v2 v2.4.0
@@ -48,7 +48,6 @@ require (
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/briandowns/spinner v1.18.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/charmbracelet/bubbles v0.10.3 // indirect
github.com/charmbracelet/bubbletea v0.20.0 // indirect
@@ -153,10 +152,9 @@ require (
gopkg.in/h2non/filetype.v1 v1.0.5 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.66.4 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.40.1 // indirect
k8s.io/kube-openapi v0.0.0-20220124234850-424119656bbf // indirect
maze.io/x/duration v0.0.0-20160924141736-faac084b6075 // indirect
sigs.k8s.io/controller-runtime v0.11.1 // indirect
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect

24
go.sum
View File

@@ -77,8 +77,6 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB
github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM=
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
github.com/briandowns/spinner v1.18.1 h1:yhQmQtM1zsqFsouh09Bk/jCjd50pC3EOGsh28gLVvwY=
github.com/briandowns/spinner v1.18.1/go.mod h1:mQak9GHqbspjC/5iUx3qMlIho8xBS/ppAL/hX5SmPJU=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
@@ -440,7 +438,6 @@ github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJ
github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE=
github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
@@ -477,16 +474,16 @@ github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLT
github.com/minio/kes v0.19.2 h1:0kdMAgLMSkiDA33k8pMHC7d6erDuseuLrZF+N3017SM=
github.com/minio/kes v0.19.2/go.mod h1:X2fMkDbAkjbSKDGOQZvyPkHxoG7nuzP6R78Jw+TzXtM=
github.com/minio/madmin-go v1.3.5/go.mod h1:vGKGboQgGIWx4DuDUaXixjlIEZOCIp6ivJkQoiVaACc=
github.com/minio/madmin-go v1.3.14 h1:9f9ZylP5Yn/TcplE/wowsBjb+Czt2+/NRCa2IqpNLcI=
github.com/minio/madmin-go v1.3.14/go.mod h1:ez87VmMtsxP7DRxjKJKD4RDNW+nhO2QF9KSzwxBDQ98=
github.com/minio/mc v0.0.0-20220512134321-aa60a8db1e4d h1:txmSSDiVFG69Hp/6Yjg5azKl96ObYL3pBQPW0i2uHIs=
github.com/minio/mc v0.0.0-20220512134321-aa60a8db1e4d/go.mod h1:g9jrk4AQ3yLaxDJzb5D+ww6sGiDC0w1k88LUH5lDR7M=
github.com/minio/madmin-go v1.4.3 h1:5/kBHjKTjYOQQHvyznu51weN5hJtFW67LB2VLz+hmzU=
github.com/minio/madmin-go v1.4.3/go.mod h1:ez87VmMtsxP7DRxjKJKD4RDNW+nhO2QF9KSzwxBDQ98=
github.com/minio/mc v0.0.0-20220705180830-01b87ecc02ff h1:b5XHy2gDZ+B3xQFhegHdSsQQUp82y6pKowwBCgD7SBU=
github.com/minio/mc v0.0.0-20220705180830-01b87ecc02ff/go.mod h1:z/hyvWFsn5ZLbSaJjr9TlCocFghHmhYuNrtpEpEIn48=
github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw=
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
github.com/minio/minio-go/v7 v7.0.23/go.mod h1:ei5JjmxwHaMrgsMrn4U/+Nmg+d8MKS1U2DAn1ou4+Do=
github.com/minio/minio-go/v7 v7.0.26 h1:D0HK+8793etZfRY/vHhDmFaP+vmT41K3K4JV9vmZCBQ=
github.com/minio/minio-go/v7 v7.0.26/go.mod h1:x81+AX5gHSfCSqw7jxRKHvxUXMlE5uKX0Vb75Xk5yYg=
github.com/minio/minio-go/v7 v7.0.30 h1:Re+qlwA+LB3mgFGYbztVPzlEjKtGzRVV5Sk38np858k=
github.com/minio/minio-go/v7 v7.0.30/go.mod h1:/sjRKkKIA75CKh1iu8E3qBy7ktBmCCDGII0zbXGwbUk=
github.com/minio/operator v0.0.0-20220414212219-ba4c097324b2 h1:GdjU5qV+Wv0P2Y/TVGRELapzBdph8Vyi6u9VjgvtVIs=
github.com/minio/operator v0.0.0-20220414212219-ba4c097324b2/go.mod h1:4Bo6a+XrBFEfCiiEtB14bw8l/nT3hcvZQKrZGZu27mA=
github.com/minio/pkg v1.1.20/go.mod h1:Xo7LQshlxGa9shKwJ7NzQbgW4s8T/Wc1cOStR/eUiMY=
@@ -744,8 +741,8 @@ golang.org/x/crypto v0.0.0-20201217014255-9d1352758620/go.mod h1:jdWPYTVW3xRLrWP
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 h1:kUhD7nTDoI3fVd9G4ORWrbV5NY0liEs/Jg2pv5f+bBA=
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e h1:T8NU3HyQ8ClP4SEE+KbFlg6n0NhuTsN4MyznaarGsZM=
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -1173,8 +1170,9 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
@@ -1201,8 +1199,6 @@ k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/
k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc=
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
maze.io/x/duration v0.0.0-20160924141736-faac084b6075 h1:4zVed9rL46683x3koxOYLzh8FlLFjnRrzTo2uvgA5D4=
maze.io/x/duration v0.0.0-20160924141736-faac084b6075/go.mod h1:1kfR2ph3CIvtfIQ8D8JhmAgePmnAUnR+AWYWUBo+l08=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=

View File

@@ -157,7 +157,7 @@ func TestBadLogin(t *testing.T) {
response, err := client.Do(request)
assert.Equal(response.StatusCode, 500, "Login request not rejected")
assert.Equal(401, response.StatusCode, "Login request not rejected")
assert.NotNil(response, "Login response is nil")
assert.Nil(err, "Login errored out")
}

View File

@@ -20,18 +20,16 @@ import (
"archive/zip"
"bytes"
"fmt"
"io"
"log"
"net/http"
"strings"
"testing"
"time"
"github.com/gorilla/websocket"
"github.com/stretchr/testify/assert"
)
func TestStartProfiling(t *testing.T) {
testAsser := assert.New(t)
testAssert := assert.New(t)
tests := []struct {
name string
@@ -58,53 +56,28 @@ func TestStartProfiling(t *testing.T) {
"profile-127.0.0.1:9000-mutex-before.pprof": false,
}
client := &http.Client{
Timeout: 3 * time.Second,
}
wsDestination := "/ws/profile?types=cpu,mem,block,mutex,trace,threads,goroutines"
wsFinalURL := fmt.Sprintf("ws://localhost:9090%s", wsDestination)
destination := "/api/v1/profiling/start"
finalURL := fmt.Sprintf("http://localhost:9090%s", destination)
request, err := http.NewRequest("POST", finalURL, strings.NewReader("{\"type\":\"cpu,mem,block,mutex,trace,threads,goroutines\"}"))
ws, _, err := websocket.DefaultDialer.Dial(wsFinalURL, nil)
if err != nil {
log.Println(err)
return
}
defer ws.Close()
_, zipFileBytes, err := ws.ReadMessage()
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)
testAsser.Nil(err, fmt.Sprintf("%s returned an error: %v", tt.name, err))
testAsser.Equal(201, response.StatusCode)
time.Sleep(5 * time.Second)
destination = "/api/v1/profiling/stop"
finalURL = fmt.Sprintf("http://localhost:9090%s", destination)
request, err = http.NewRequest("POST", finalURL, 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)
testAsser.Nil(err, fmt.Sprintf("%s returned an error: %v", tt.name, err))
testAsser.Equal(200, response.StatusCode)
zipFileBytes, err := io.ReadAll(response.Body)
if err != nil {
testAsser.Nil(err, fmt.Sprintf("%s returned an error: %v", tt.name, err))
}
filetype := http.DetectContentType(zipFileBytes)
testAsser.Equal("application/zip", filetype)
testAssert.Equal("application/zip", filetype)
zipReader, err := zip.NewReader(bytes.NewReader(zipFileBytes), int64(len(zipFileBytes)))
if err != nil {
testAsser.Nil(err, fmt.Sprintf("%s returned an error: %v", tt.name, err))
testAssert.Nil(err, fmt.Sprintf("%s returned an error: %v", tt.name, err))
}
// Read all the files from zip archive
@@ -113,7 +86,7 @@ func TestStartProfiling(t *testing.T) {
}
for k, v := range files {
testAsser.Equal(true, v, fmt.Sprintf("%s : compressed file expected to have %v file inside", tt.name, k))
testAssert.Equal(true, v, fmt.Sprintf("%s : compressed file expected to have %v file inside", tt.name, k))
}
})
}

View File

@@ -2787,10 +2787,7 @@ func TestReplication(t *testing.T) {
}
finalResponse := inspectHTTPResponse(response)
if response != nil {
// https://github.com/minio/minio/pull/14972
// Disallow deletion of arn when active replication config
// no longer 204 is expected due to above change
assert.Equal(500, response.StatusCode, finalResponse)
assert.Equal(204, response.StatusCode, finalResponse)
}
// 6. Delete 2nd rule only with dedicated end point for single rules:
@@ -2825,10 +2822,7 @@ func TestReplication(t *testing.T) {
}
finalResponse = inspectHTTPResponse(response)
if response != nil {
// https://github.com/minio/minio/pull/14972
// Disallow deletion of arn when active replication config
// 204 is no longer expected but 500
assert.Equal(500, response.StatusCode, finalResponse)
assert.Equal(204, response.StatusCode, finalResponse)
}
// 8. Get replication, at this point zero rules are expected
@@ -2850,7 +2844,7 @@ func TestReplication(t *testing.T) {
log.Println(err)
assert.Nil(err)
}
expected := 3 // none got deleted due to https://github.com/minio/minio/pull/14972
expected := 0
actual := len(structBucketRepl.Rules)
assert.Equal(expected, actual, "Delete failed")
}
@@ -3657,6 +3651,24 @@ func GetRemoteBucket() (*http.Response, error) {
return response, err
}
func GetRemoteBucketARN(sourceBucket string) (*http.Response, error) {
request, err := http.NewRequest(
"GET",
fmt.Sprintf("http://localhost:9090/api/v1/remote-buckets/%s", sourceBucket),
nil,
)
if err != nil {
log.Println(err)
}
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 AddRemoteBucket(accessKey, secretKey, targetURL, sourceBucket, targetBucket string) (*http.Response, error) {
// Needed Parameters for API Call
bucketsRelationArray := make([]map[string]interface{}, 1)
@@ -3707,6 +3719,27 @@ func AddRemoteBucket(accessKey, secretKey, targetURL, sourceBucket, targetBucket
return response, err
}
func DeleteRemoteBucket(sourceBucket string, arn string) (*http.Response, error) {
// Needed Parameters for API Call
request, err := http.NewRequest(
"DELETE",
fmt.Sprintf("http://localhost:9090/api/v1/remote-buckets/%s/%s", sourceBucket, arn),
nil,
)
if err != nil {
log.Println(err)
}
request.Header.Add("Cookie", fmt.Sprintf("token=%s", token))
request.Header.Add("Content-Type", "application/json")
// Performing the call
client := &http.Client{
Timeout: 2 * time.Second,
}
response, err := client.Do(request)
return response, err
}
func TestAddRemoteBucket(t *testing.T) {
// Variables
assert := assert.New(t)
@@ -3755,3 +3788,69 @@ func TestAddRemoteBucket(t *testing.T) {
fmt.Println("finalResponse: ", finalResponse)
assert.Equal(strings.Contains(finalResponse, targetBucket), true)
}
func TestDeleteRemoteBucket(t *testing.T) {
// Variables
assert := assert.New(t)
accessKey := "minioadmin"
secretKey := "minioadmin"
targetURL := "https://play.min.io"
sourceBucket := "deletesource"
targetBucket := os.Getenv("THETARGET")
fmt.Println("targetBucket: ", targetBucket)
// 1. Create bucket
if !BucketGotAdded("deletesource", true, true, nil, nil, assert, 201) {
return
}
// 2. Add Remote Bucket
resp, err := AddRemoteBucket(
accessKey,
secretKey,
targetURL,
sourceBucket,
targetBucket,
)
assert.Nil(err)
if err != nil {
log.Println(err)
return
}
if resp != nil {
assert.Equal(
201, resp.StatusCode, inspectHTTPResponse(resp))
}
// 3. Get ARN
resp, err = GetRemoteBucketARN(sourceBucket)
assert.Nil(err)
if err != nil {
log.Println(err)
return
}
bodyBytes, _ := ioutil.ReadAll(resp.Body)
remoteBucket := models.RemoteBucket{}
err = json.Unmarshal(bodyBytes, &remoteBucket)
if err != nil {
log.Println(err)
assert.Nil(err)
}
if resp != nil {
assert.Equal(
200, resp.StatusCode, inspectHTTPResponse(resp))
}
// 4. Delete Remote Bucket
resp, err = DeleteRemoteBucket(sourceBucket, *remoteBucket.RemoteARN)
assert.Nil(err)
if err != nil {
log.Println(err)
return
}
finalResponse := inspectHTTPResponse(resp)
if resp != nil {
assert.Equal(
204, resp.StatusCode, finalResponse)
}
}

View File

@@ -15,7 +15,7 @@ spec:
serviceAccountName: console-sa
containers:
- name: console
image: 'minio/console:v0.18.1'
image: 'minio/console:v0.19.4'
imagePullPolicy: "IfNotPresent"
env:
- name: CONSOLE_OPERATOR_MODE

View File

@@ -32,7 +32,7 @@ spec:
spec:
containers:
- name: console
image: 'minio/console:v0.18.1'
image: 'minio/console:v0.19.4'
imagePullPolicy: "IfNotPresent"
env:
- name: CONSOLE_MINIO_SERVER

67
models/api_key.go Normal file
View File

@@ -0,0 +1,67 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 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"
)
// APIKey api key
//
// swagger:model apiKey
type APIKey struct {
// api key
APIKey string `json:"apiKey,omitempty"`
}
// Validate validates this api key
func (m *APIKey) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this api key based on context it is used
func (m *APIKey) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *APIKey) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *APIKey) UnmarshalBinary(b []byte) error {
var res APIKey
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -28,7 +28,6 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// LoginRequest login request
@@ -37,48 +36,32 @@ import (
type LoginRequest struct {
// access key
// Required: true
AccessKey *string `json:"accessKey"`
AccessKey string `json:"accessKey,omitempty"`
// features
Features *LoginRequestFeatures `json:"features,omitempty"`
// secret key
// Required: true
SecretKey *string `json:"secretKey"`
SecretKey string `json:"secretKey,omitempty"`
// sts
Sts string `json:"sts,omitempty"`
}
// Validate validates this login request
func (m *LoginRequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAccessKey(formats); err != nil {
res = append(res, err)
}
if err := m.validateFeatures(formats); err != nil {
res = append(res, err)
}
if err := m.validateSecretKey(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *LoginRequest) validateAccessKey(formats strfmt.Registry) error {
if err := validate.Required("accessKey", "body", m.AccessKey); err != nil {
return err
}
return nil
}
func (m *LoginRequest) validateFeatures(formats strfmt.Registry) error {
if swag.IsZero(m.Features) { // not required
return nil
@@ -98,15 +81,6 @@ func (m *LoginRequest) validateFeatures(formats strfmt.Registry) error {
return nil
}
func (m *LoginRequest) validateSecretKey(formats strfmt.Registry) error {
if err := validate.Required("secretKey", "body", m.SecretKey); err != nil {
return err
}
return nil
}
// ContextValidate validate this login request based on the context it is used
func (m *LoginRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error

70
models/mp_integration.go Normal file
View File

@@ -0,0 +1,70 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 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"
)
// MpIntegration mp integration
//
// swagger:model mpIntegration
type MpIntegration struct {
// email
Email string `json:"email,omitempty"`
// is in e u
IsInEU bool `json:"isInEU,omitempty"`
}
// Validate validates this mp integration
func (m *MpIntegration) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this mp integration based on context it is used
func (m *MpIntegration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *MpIntegration) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *MpIntegration) UnmarshalBinary(b []byte) error {
var res MpIntegration
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,67 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 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"
)
// OperatorSubnetAPIKey operator subnet API key
//
// swagger:model operatorSubnetAPIKey
type OperatorSubnetAPIKey struct {
// api key
APIKey string `json:"apiKey,omitempty"`
}
// Validate validates this operator subnet API key
func (m *OperatorSubnetAPIKey) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this operator subnet API key based on context it is used
func (m *OperatorSubnetAPIKey) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *OperatorSubnetAPIKey) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *OperatorSubnetAPIKey) UnmarshalBinary(b []byte) error {
var res OperatorSubnetAPIKey
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,122 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 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/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// OperatorSubnetLoginMFARequest operator subnet login m f a request
//
// swagger:model operatorSubnetLoginMFARequest
type OperatorSubnetLoginMFARequest struct {
// mfa token
// Required: true
MfaToken *string `json:"mfa_token"`
// otp
// Required: true
Otp *string `json:"otp"`
// username
// Required: true
Username *string `json:"username"`
}
// Validate validates this operator subnet login m f a request
func (m *OperatorSubnetLoginMFARequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateMfaToken(formats); err != nil {
res = append(res, err)
}
if err := m.validateOtp(formats); err != nil {
res = append(res, err)
}
if err := m.validateUsername(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *OperatorSubnetLoginMFARequest) validateMfaToken(formats strfmt.Registry) error {
if err := validate.Required("mfa_token", "body", m.MfaToken); err != nil {
return err
}
return nil
}
func (m *OperatorSubnetLoginMFARequest) validateOtp(formats strfmt.Registry) error {
if err := validate.Required("otp", "body", m.Otp); err != nil {
return err
}
return nil
}
func (m *OperatorSubnetLoginMFARequest) validateUsername(formats strfmt.Registry) error {
if err := validate.Required("username", "body", m.Username); err != nil {
return err
}
return nil
}
// ContextValidate validates this operator subnet login m f a request based on context it is used
func (m *OperatorSubnetLoginMFARequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *OperatorSubnetLoginMFARequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *OperatorSubnetLoginMFARequest) UnmarshalBinary(b []byte) error {
var res OperatorSubnetLoginMFARequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,70 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 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"
)
// OperatorSubnetLoginRequest operator subnet login request
//
// swagger:model operatorSubnetLoginRequest
type OperatorSubnetLoginRequest struct {
// password
Password string `json:"password,omitempty"`
// username
Username string `json:"username,omitempty"`
}
// Validate validates this operator subnet login request
func (m *OperatorSubnetLoginRequest) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this operator subnet login request based on context it is used
func (m *OperatorSubnetLoginRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *OperatorSubnetLoginRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *OperatorSubnetLoginRequest) UnmarshalBinary(b []byte) error {
var res OperatorSubnetLoginRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,70 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 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"
)
// OperatorSubnetLoginResponse operator subnet login response
//
// swagger:model operatorSubnetLoginResponse
type OperatorSubnetLoginResponse struct {
// access token
AccessToken string `json:"access_token,omitempty"`
// mfa token
MfaToken string `json:"mfa_token,omitempty"`
}
// Validate validates this operator subnet login response
func (m *OperatorSubnetLoginResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this operator subnet login response based on context it is used
func (m *OperatorSubnetLoginResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *OperatorSubnetLoginResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *OperatorSubnetLoginResponse) UnmarshalBinary(b []byte) error {
var res OperatorSubnetLoginResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -48,6 +48,9 @@ type Principal struct {
// hm
Hm bool `json:"hm,omitempty"`
// ob
Ob bool `json:"ob,omitempty"`
}
// Validate validates this principal

View File

@@ -0,0 +1,70 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 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"
)
// SetAdministratorsRequest set administrators request
//
// swagger:model setAdministratorsRequest
type SetAdministratorsRequest struct {
// group dns
GroupDNS []string `json:"group_dns"`
// user dns
UserDNS []string `json:"user_dns"`
}
// Validate validates this set administrators request
func (m *SetAdministratorsRequest) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this set administrators request based on context it is used
func (m *SetAdministratorsRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *SetAdministratorsRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *SetAdministratorsRequest) UnmarshalBinary(b []byte) error {
var res SetAdministratorsRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -45,12 +45,18 @@ type TenantLogs struct {
// db image
DbImage string `json:"dbImage,omitempty"`
// db init image
DbInitImage string `json:"dbInitImage,omitempty"`
// db labels
DbLabels []*Label `json:"dbLabels"`
// db node selector
DbNodeSelector []*NodeSelector `json:"dbNodeSelector"`
// db security context
DbSecurityContext *SecurityContext `json:"dbSecurityContext,omitempty"`
// db service account name
DbServiceAccountName string `json:"dbServiceAccountName,omitempty"`
@@ -81,6 +87,9 @@ type TenantLogs struct {
// node selector
NodeSelector []*NodeSelector `json:"nodeSelector"`
// security context
SecurityContext *SecurityContext `json:"securityContext,omitempty"`
// service account name
ServiceAccountName string `json:"serviceAccountName,omitempty"`
}
@@ -105,6 +114,10 @@ func (m *TenantLogs) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
if err := m.validateDbSecurityContext(formats); err != nil {
res = append(res, err)
}
if err := m.validateLabels(formats); err != nil {
res = append(res, err)
}
@@ -113,6 +126,10 @@ func (m *TenantLogs) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
if err := m.validateSecurityContext(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
@@ -223,6 +240,25 @@ func (m *TenantLogs) validateDbNodeSelector(formats strfmt.Registry) error {
return nil
}
func (m *TenantLogs) validateDbSecurityContext(formats strfmt.Registry) error {
if swag.IsZero(m.DbSecurityContext) { // not required
return nil
}
if m.DbSecurityContext != nil {
if err := m.DbSecurityContext.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("dbSecurityContext")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("dbSecurityContext")
}
return err
}
}
return nil
}
func (m *TenantLogs) validateLabels(formats strfmt.Registry) error {
if swag.IsZero(m.Labels) { // not required
return nil
@@ -275,6 +311,25 @@ func (m *TenantLogs) validateNodeSelector(formats strfmt.Registry) error {
return nil
}
func (m *TenantLogs) validateSecurityContext(formats strfmt.Registry) error {
if swag.IsZero(m.SecurityContext) { // not required
return nil
}
if m.SecurityContext != nil {
if err := m.SecurityContext.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("securityContext")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("securityContext")
}
return err
}
}
return nil
}
// ContextValidate validate this tenant logs based on the context it is used
func (m *TenantLogs) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
@@ -295,6 +350,10 @@ func (m *TenantLogs) ContextValidate(ctx context.Context, formats strfmt.Registr
res = append(res, err)
}
if err := m.contextValidateDbSecurityContext(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateLabels(ctx, formats); err != nil {
res = append(res, err)
}
@@ -303,6 +362,10 @@ func (m *TenantLogs) ContextValidate(ctx context.Context, formats strfmt.Registr
res = append(res, err)
}
if err := m.contextValidateSecurityContext(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
@@ -389,6 +452,22 @@ func (m *TenantLogs) contextValidateDbNodeSelector(ctx context.Context, formats
return nil
}
func (m *TenantLogs) contextValidateDbSecurityContext(ctx context.Context, formats strfmt.Registry) error {
if m.DbSecurityContext != nil {
if err := m.DbSecurityContext.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("dbSecurityContext")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("dbSecurityContext")
}
return err
}
}
return nil
}
func (m *TenantLogs) contextValidateLabels(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Labels); i++ {
@@ -429,6 +508,22 @@ func (m *TenantLogs) contextValidateNodeSelector(ctx context.Context, formats st
return nil
}
func (m *TenantLogs) contextValidateSecurityContext(ctx context.Context, formats strfmt.Registry) error {
if m.SecurityContext != nil {
if err := m.SecurityContext.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("securityContext")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("securityContext")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *TenantLogs) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -63,6 +63,9 @@ type TenantMonitoringInfo struct {
// prometheus enabled
PrometheusEnabled bool `json:"prometheusEnabled,omitempty"`
// security context
SecurityContext *SecurityContext `json:"securityContext,omitempty"`
// service account name
ServiceAccountName string `json:"serviceAccountName,omitempty"`
@@ -92,6 +95,10 @@ func (m *TenantMonitoringInfo) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
if err := m.validateSecurityContext(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
@@ -176,6 +183,25 @@ func (m *TenantMonitoringInfo) validateNodeSelector(formats strfmt.Registry) err
return nil
}
func (m *TenantMonitoringInfo) validateSecurityContext(formats strfmt.Registry) error {
if swag.IsZero(m.SecurityContext) { // not required
return nil
}
if m.SecurityContext != nil {
if err := m.SecurityContext.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("securityContext")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("securityContext")
}
return err
}
}
return nil
}
// ContextValidate validate this tenant monitoring info based on the context it is used
func (m *TenantMonitoringInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
@@ -192,6 +218,10 @@ func (m *TenantMonitoringInfo) ContextValidate(ctx context.Context, formats strf
res = append(res, err)
}
if err := m.contextValidateSecurityContext(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
@@ -258,6 +288,22 @@ func (m *TenantMonitoringInfo) contextValidateNodeSelector(ctx context.Context,
return nil
}
func (m *TenantMonitoringInfo) contextValidateSecurityContext(ctx context.Context, formats strfmt.Registry) error {
if m.SecurityContext != nil {
if err := m.SecurityContext.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("securityContext")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("securityContext")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *TenantMonitoringInfo) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -41,6 +41,9 @@ type TenantSecurityResponse struct {
// custom certificates
CustomCertificates *TenantSecurityResponseCustomCertificates `json:"customCertificates,omitempty"`
// security context
SecurityContext *SecurityContext `json:"securityContext,omitempty"`
}
// Validate validates this tenant security response
@@ -51,6 +54,10 @@ func (m *TenantSecurityResponse) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
if err := m.validateSecurityContext(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
@@ -76,6 +83,25 @@ func (m *TenantSecurityResponse) validateCustomCertificates(formats strfmt.Regis
return nil
}
func (m *TenantSecurityResponse) validateSecurityContext(formats strfmt.Registry) error {
if swag.IsZero(m.SecurityContext) { // not required
return nil
}
if m.SecurityContext != nil {
if err := m.SecurityContext.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("securityContext")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("securityContext")
}
return err
}
}
return nil
}
// ContextValidate validate this tenant security response based on the context it is used
func (m *TenantSecurityResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
@@ -84,6 +110,10 @@ func (m *TenantSecurityResponse) ContextValidate(ctx context.Context, formats st
res = append(res, err)
}
if err := m.contextValidateSecurityContext(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
@@ -106,6 +136,22 @@ func (m *TenantSecurityResponse) contextValidateCustomCertificates(ctx context.C
return nil
}
func (m *TenantSecurityResponse) contextValidateSecurityContext(ctx context.Context, formats strfmt.Registry) error {
if m.SecurityContext != nil {
if err := m.SecurityContext.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("securityContext")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("securityContext")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *TenantSecurityResponse) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -41,6 +41,9 @@ type UpdateTenantSecurityRequest struct {
// custom certificates
CustomCertificates *UpdateTenantSecurityRequestCustomCertificates `json:"customCertificates,omitempty"`
// security context
SecurityContext *SecurityContext `json:"securityContext,omitempty"`
}
// Validate validates this update tenant security request
@@ -51,6 +54,10 @@ func (m *UpdateTenantSecurityRequest) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
if err := m.validateSecurityContext(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
@@ -76,6 +83,25 @@ func (m *UpdateTenantSecurityRequest) validateCustomCertificates(formats strfmt.
return nil
}
func (m *UpdateTenantSecurityRequest) validateSecurityContext(formats strfmt.Registry) error {
if swag.IsZero(m.SecurityContext) { // not required
return nil
}
if m.SecurityContext != nil {
if err := m.SecurityContext.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("securityContext")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("securityContext")
}
return err
}
}
return nil
}
// ContextValidate validate this update tenant security request based on the context it is used
func (m *UpdateTenantSecurityRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
@@ -84,6 +110,10 @@ func (m *UpdateTenantSecurityRequest) ContextValidate(ctx context.Context, forma
res = append(res, err)
}
if err := m.contextValidateSecurityContext(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
@@ -106,6 +136,22 @@ func (m *UpdateTenantSecurityRequest) contextValidateCustomCertificates(ctx cont
return nil
}
func (m *UpdateTenantSecurityRequest) contextValidateSecurityContext(ctx context.Context, formats strfmt.Registry) error {
if m.SecurityContext != nil {
if err := m.SecurityContext.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("securityContext")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("securityContext")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *UpdateTenantSecurityRequest) MarshalBinary() ([]byte, error) {
if m == nil {

73
models/user_s_as.go Normal file
View File

@@ -0,0 +1,73 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 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"
)
// UserSAs user s as
//
// swagger:model userSAs
type UserSAs struct {
// path
Path string `json:"path,omitempty"`
// recursive
Recursive bool `json:"recursive,omitempty"`
// version ID
VersionID string `json:"versionID,omitempty"`
}
// Validate validates this user s as
func (m *UserSAs) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this user s as based on context it is used
func (m *UserSAs) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *UserSAs) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *UserSAs) UnmarshalBinary(b []byte) error {
var res UserSAs
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -293,6 +293,29 @@ func CreateTenant(tenantName string, namespace string, accessKey string, secretK
return response, err
}
func DeleteTenant(nameSpace, tenant string) (*http.Response, error) {
/*
URL: /namespaces/{namespace}/tenants/{tenant}:
HTTP Verb: DELETE
Summary: Delete tenant and underlying pvcs
*/
request, err := http.NewRequest(
"DELETE",
"http://localhost:9090/api/v1/namespaces/"+nameSpace+"/tenants/"+tenant,
nil,
)
if err != nil {
log.Println(err)
}
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 TestCreateTenant(t *testing.T) {
printStartFunc("TestCreateTenant")
@@ -419,6 +442,159 @@ func TestCreateTenant(t *testing.T) {
printEndFunc("TestCreateTenant")
}
func TestDeleteTenant(t *testing.T) {
printStartFunc("TestCreateTenant")
// Variables
assert := assert.New(t)
erasureCodingParity := 2
tenantName := "new-tenant-3"
namespace := "new-namespace-3"
// 0. Create the namespace
resp, err := CreateNamespace(namespace)
assert.Nil(err)
if err != nil {
log.Println(err)
return
}
if resp != nil {
assert.Equal(
201, resp.StatusCode, inspectHTTPResponse(resp))
}
accessKey := ""
secretKey := ""
var accessKeys []string
var secretKeys []string
var minio []string
var caCertificates []string
var consoleCAcertificates []string
enableTLS := true
enableConsole := true
enablePrometheus := true
serviceName := ""
image := ""
exposeMinIO := true
exposeConsole := true
values := make([]string, 1)
values[0] = "new-tenant"
values2 := make([]string, 1)
values2[0] = "pool-0"
keys := make([]map[string]interface{}, 1)
keys[0] = map[string]interface{}{
"access_key": "IGLksSXdiU3fjcRI",
"secret_key": "EqeCPZ1xBYdnygizxxRWnkH09N2350nO",
}
pools := make([]map[string]interface{}, 1)
matchExpressions := make([]map[string]interface{}, 2)
matchExpressions[0] = map[string]interface{}{
"key": "v1.min.io/tenant",
"operator": "In",
"values": values,
}
matchExpressions[1] = map[string]interface{}{
"key": "v1.min.io/pool",
"operator": "In",
"values": values2,
}
requiredDuringSchedulingIgnoredDuringExecution := make([]map[string]interface{}, 1)
requiredDuringSchedulingIgnoredDuringExecution[0] = map[string]interface{}{
"labelSelector": map[string]interface{}{
"matchExpressions": matchExpressions,
},
"topologyKey": "kubernetes.io/hostname",
}
pools0 := map[string]interface{}{
"name": "pool-0",
"servers": 4,
"volumes_per_server": 1,
"volume_configuration": map[string]interface{}{
"size": 26843545600,
"storage_class_name": "standard",
},
"securityContext": nil,
"affinity": map[string]interface{}{
"podAntiAffinity": map[string]interface{}{
"requiredDuringSchedulingIgnoredDuringExecution": requiredDuringSchedulingIgnoredDuringExecution,
},
},
"resources": map[string]interface{}{
"requests": map[string]interface{}{
"cpu": 2,
"memory": 2,
},
},
}
logSearchConfiguration := map[string]interface{}{
"image": "",
"postgres_image": "",
"postgres_init_image": "",
}
prometheusConfiguration := map[string]interface{}{
"image": "",
"sidecar_image": "",
"init_image": "",
}
tls := map[string]interface{}{
"minio": minio,
"ca_certificates": caCertificates,
"console_ca_certificates": consoleCAcertificates,
}
idp := map[string]interface{}{
"keys": keys,
}
pools[0] = pools0
// 1. Create Tenant
resp, err = CreateTenant(
tenantName,
namespace,
accessKey,
secretKey,
accessKeys,
idp,
tls,
prometheusConfiguration,
logSearchConfiguration,
erasureCodingParity,
pools,
exposeConsole,
exposeMinIO,
image,
serviceName,
enablePrometheus,
enableConsole,
enableTLS,
secretKeys,
)
assert.Nil(err)
if err != nil {
log.Println(err)
return
}
if resp != nil {
assert.Equal(
200, resp.StatusCode, "Status Code is incorrect")
}
// 2. Delete tenant
resp, err = DeleteTenant(namespace, tenantName)
if err != nil {
log.Println(err)
return
}
if resp != nil {
assert.Equal(
204,
resp.StatusCode,
inspectHTTPResponse(resp),
)
}
printEndFunc("TestCreateTenant")
}
func ListTenantsByNameSpace(namespace string) (*http.Response, error) {
/*
Helper function to list buckets
@@ -459,7 +635,10 @@ func TestListTenantsByNameSpace(t *testing.T) {
log.Println(err)
assert.Nil(err)
}
TenantName := &result.Tenants[0].Name // The array has to be empty, no index accessible
if len(result.Tenants) == 0 {
assert.Fail("FAIL: There are no tenants in the array")
}
TenantName := &result.Tenants[0].Name
fmt.Println(*TenantName)
assert.Equal("new-tenant", *TenantName, *TenantName)
}
@@ -868,3 +1047,261 @@ func TestLogout(t *testing.T) {
assert.Fail("authentication token not found in cookies response")
}
}
func EnableTenantLogging(namespace, tenant string) (*http.Response, error) {
/*
Description: Enable Tenant Logging
HTTP Verb: POST
*/
request, err := http.NewRequest(
"POST",
"http://localhost:9090/api/v1/namespaces/"+namespace+"/tenants/"+tenant+"/enable-logging",
nil,
)
request.Header.Add("Cookie", fmt.Sprintf("token=%s", token))
request.Header.Add("Content-Type", "application/json")
if err != nil {
log.Println(err)
}
request.Header.Add("Content-Type", "application/json")
client := &http.Client{
Timeout: 2 * time.Second,
}
response, err := client.Do(request)
return response, err
}
func DisableTenantLogging(namespace, tenant string) (*http.Response, error) {
/*
Description: Disable Tenant Logging
*/
request, err := http.NewRequest(
"POST",
"http://localhost:9090/api/v1/namespaces/"+namespace+"/tenants/"+tenant+"/disable-logging",
nil,
)
request.Header.Add("Cookie", fmt.Sprintf("token=%s", token))
request.Header.Add("Content-Type", "application/json")
if err != nil {
log.Println(err)
}
request.Header.Add("Content-Type", "application/json")
client := &http.Client{
Timeout: 2 * time.Second,
}
response, err := client.Do(request)
return response, err
}
func TestEnableTenantLogging(t *testing.T) {
// Vars
assert := assert.New(t)
namespace := "tenant-lite"
tenant := "storage-lite"
// Enable tenant logging
resp, err := EnableTenantLogging(namespace, tenant)
if err != nil {
log.Println(err)
return
}
if resp != nil {
assert.Equal(
200,
resp.StatusCode,
inspectHTTPResponse(resp),
)
}
}
func TestDisableTenantLogging(t *testing.T) {
// Vars
assert := assert.New(t)
namespace := "tenant-lite"
tenant := "storage-lite"
// Disable tenant logging
resp, err := DisableTenantLogging(namespace, tenant)
if err != nil {
log.Println(err)
return
}
if resp != nil {
assert.Equal(
200,
resp.StatusCode,
inspectHTTPResponse(resp),
)
}
}
func GetTenantLogs(nameSpace, tenant string) (*http.Response, error) {
/*
URL: /namespaces/{namespace}/tenants/{tenant}/log
summary: Get Tenant Logs
HTTP Verb:GET
*/
request, err := http.NewRequest(
"GET",
"http://localhost:9090/api/v1/namespaces/"+nameSpace+"/tenants/"+tenant+"/log",
nil,
)
if err != nil {
log.Println(err)
}
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 SetTenantLogs(labels, annotations, nodeSelector, dbLabels, dbAnnotations, dbNodeSelector []string, nameSpace, tenant, dbServiceAccountName, logMemRequest, logDBMemRequest, diskCapacityGB, serviceAccountName string) (*http.Response, error) {
/*
URL: /namespaces/{namespace}/tenants/{tenant}/log
summary: Set Tenant Logs
HTTP Verb: PUT
*/
requestDataAdd := map[string]interface{}{
"labels": labels,
"annotations": annotations,
"dbAnnotations": dbAnnotations,
"dbLabels": dbLabels,
"dbNodeSelector": dbNodeSelector,
"diskCapacityGB": diskCapacityGB,
"nodeSelector": nodeSelector,
"serviceAccountName": serviceAccountName,
"dbServiceAccountName": dbServiceAccountName,
"logMemRequest": logMemRequest,
"logDBMemRequest": logDBMemRequest,
}
requestDataJSON, _ := json.Marshal(requestDataAdd)
requestDataBody := bytes.NewReader(requestDataJSON)
request, err := http.NewRequest(
"PUT",
"http://localhost:9090/api/v1/namespaces/"+nameSpace+"/tenants/"+tenant+"/log",
requestDataBody,
)
if err != nil {
log.Println(err)
}
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 TestGetTenantLogs(t *testing.T) {
// Vars
assert := assert.New(t)
namespace := "tenant-lite"
tenant := "storage-lite"
// Get Log Settings
resp, err := GetTenantLogs(namespace, tenant)
if err != nil {
log.Println(err)
return
}
if resp != nil {
assert.Equal(
200,
resp.StatusCode,
inspectHTTPResponse(resp),
)
}
}
func TestSetTenantLogs(t *testing.T) {
// Vars
assert := assert.New(t)
nameSpace := "tenant-lite"
tenant := "storage-lite"
var nodeSelector []string
var labels []string
var annotations []string
var dbAnnotations []string
var dbNodeSelector []string
var dbLabels []string
diskCapacityGB := "2"
dbServiceAccountName := ""
logMemRequest := "0Gi"
logDBMemRequest := "0Gi"
serviceAccountName := ""
// Set Tenant Logs
resp, err := SetTenantLogs(
labels,
annotations,
nodeSelector,
dbLabels,
dbAnnotations,
dbNodeSelector,
nameSpace,
tenant,
dbServiceAccountName,
logMemRequest,
logDBMemRequest,
diskCapacityGB,
serviceAccountName,
)
if err != nil {
log.Println(err)
return
}
if resp != nil {
assert.Equal(
200,
resp.StatusCode,
inspectHTTPResponse(resp),
)
}
}
func TenantDetails(nameSpace, tenant string) (*http.Response, error) {
/*
url: /namespaces/{namespace}/tenants/{tenant}
summary: Tenant Details
operationId: TenantDetails
HTTP Verb: GET
*/
request, err := http.NewRequest(
"GET",
"http://localhost:9090/api/v1/namespaces/"+nameSpace+"/tenants/"+tenant,
nil,
)
if err != nil {
log.Println(err)
}
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 TestTenantDetails(t *testing.T) {
// Vars
assert := assert.New(t)
nameSpace := "tenant-lite"
tenant := "storage-lite"
resp, err := TenantDetails(nameSpace, tenant)
if err != nil {
log.Println(err)
return
}
if resp != nil {
assert.Equal(
200,
resp.StatusCode,
inspectHTTPResponse(resp),
)
}
}

View File

@@ -89,6 +89,8 @@ func configureAPI(api *operations.OperatorAPI) http.Handler {
registerVolumesHandlers(api)
// Namespaces handlers
registerNamespaceHandlers(api)
registerMarketplaceHandlers(api)
registerOperatorSubnetHandlers(api)
api.PreServerShutdown = func() {}

View File

@@ -310,6 +310,62 @@ func init() {
}
}
},
"/mp-integration": {
"get": {
"tags": [
"OperatorAPI"
],
"summary": "Returns email registered for marketplace integration",
"operationId": "GetMPIntegration",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"type": "object",
"properties": {
"isEmailSet": {
"type": "boolean"
}
}
}
},
"default": {
"description": "Generic error response.",
"schema": {
"$ref": "#/definitions/error"
}
}
}
},
"post": {
"tags": [
"OperatorAPI"
],
"summary": "Set email to register for marketplace integration",
"operationId": "PostMPIntegration",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/mpIntegration"
}
}
],
"responses": {
"201": {
"description": "A successful response."
},
"default": {
"description": "Generic error response.",
"schema": {
"$ref": "#/definitions/error"
}
}
}
}
},
"/namespace": {
"post": {
"tags": [
@@ -1648,6 +1704,48 @@ func init() {
}
}
},
"/namespaces/{namespace}/tenants/{tenant}/set-administrators": {
"post": {
"tags": [
"OperatorAPI"
],
"summary": "Set the consoleAdmin policy to the specified users and groups",
"operationId": "SetTenantAdministrators",
"parameters": [
{
"type": "string",
"name": "namespace",
"in": "path",
"required": true
},
{
"type": "string",
"name": "tenant",
"in": "path",
"required": true
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/setAdministratorsRequest"
}
}
],
"responses": {
"204": {
"description": "A successful response."
},
"default": {
"description": "Generic error response.",
"schema": {
"$ref": "#/definitions/error"
}
}
}
}
},
"/namespaces/{namespace}/tenants/{tenant}/usage": {
"get": {
"tags": [
@@ -1808,6 +1906,133 @@ func init() {
}
}
},
"/subnet/apikey": {
"get": {
"tags": [
"OperatorAPI"
],
"summary": "Subnet api key",
"operationId": "OperatorSubnetApiKey",
"parameters": [
{
"type": "string",
"name": "token",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/operatorSubnetAPIKey"
}
},
"default": {
"description": "Generic error response.",
"schema": {
"$ref": "#/definitions/error"
}
}
}
}
},
"/subnet/apikey/register": {
"post": {
"tags": [
"OperatorAPI"
],
"summary": "Register Operator with Subnet",
"operationId": "OperatorSubnetRegisterAPIKey",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/operatorSubnetAPIKey"
}
}
],
"responses": {
"200": {
"description": "A successful response."
},
"default": {
"description": "Generic error response.",
"schema": {
"$ref": "#/definitions/error"
}
}
}
}
},
"/subnet/login": {
"post": {
"tags": [
"OperatorAPI"
],
"summary": "Login to subnet",
"operationId": "OperatorSubnetLogin",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/operatorSubnetLoginRequest"
}
}
],
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/operatorSubnetLoginResponse"
}
},
"default": {
"description": "Generic error response.",
"schema": {
"$ref": "#/definitions/error"
}
}
}
}
},
"/subnet/login/mfa": {
"post": {
"tags": [
"OperatorAPI"
],
"summary": "Login to subnet using mfa",
"operationId": "OperatorSubnetLoginMFA",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/operatorSubnetLoginMFARequest"
}
}
],
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/operatorSubnetLoginResponse"
}
},
"default": {
"description": "Generic error response.",
"schema": {
"$ref": "#/definitions/error"
}
}
}
}
},
"/subscription/info": {
"get": {
"tags": [
@@ -3232,10 +3457,6 @@ func init() {
},
"loginRequest": {
"type": "object",
"required": [
"accessKey",
"secretKey"
],
"properties": {
"accessKey": {
"type": "string"
@@ -3250,6 +3471,9 @@ func init() {
},
"secretKey": {
"type": "string"
},
"sts": {
"type": "string"
}
}
},
@@ -3302,6 +3526,17 @@ func init() {
}
}
},
"mpIntegration": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"isInEU": {
"type": "boolean"
}
}
},
"namespace": {
"type": "object",
"required": [
@@ -3439,6 +3674,55 @@ func init() {
}
}
},
"operatorSubnetAPIKey": {
"type": "object",
"properties": {
"apiKey": {
"type": "string"
}
}
},
"operatorSubnetLoginMFARequest": {
"type": "object",
"required": [
"username",
"otp",
"mfa_token"
],
"properties": {
"mfa_token": {
"type": "string"
},
"otp": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"operatorSubnetLoginRequest": {
"type": "object",
"properties": {
"password": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"operatorSubnetLoginResponse": {
"type": "object",
"properties": {
"access_token": {
"type": "string"
},
"mfa_token": {
"type": "string"
}
}
},
"parityResponse": {
"type": "array",
"items": {
@@ -3939,6 +4223,23 @@ func init() {
}
}
},
"setAdministratorsRequest": {
"type": "object",
"properties": {
"group_dns": {
"type": "array",
"items": {
"type": "string"
}
},
"user_dns": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"state": {
"type": "object",
"properties": {
@@ -4132,6 +4433,9 @@ func init() {
"dbImage": {
"type": "string"
},
"dbInitImage": {
"type": "string"
},
"dbLabels": {
"type": "array",
"items": {
@@ -4144,6 +4448,10 @@ func init() {
"$ref": "#/definitions/nodeSelector"
}
},
"dbSecurityContext": {
"type": "object",
"$ref": "#/definitions/securityContext"
},
"dbServiceAccountName": {
"type": "string"
},
@@ -4180,6 +4488,10 @@ func init() {
"$ref": "#/definitions/nodeSelector"
}
},
"securityContext": {
"type": "object",
"$ref": "#/definitions/securityContext"
},
"serviceAccountName": {
"type": "string"
}
@@ -4224,6 +4536,10 @@ func init() {
"prometheusEnabled": {
"type": "boolean"
},
"securityContext": {
"type": "object",
"$ref": "#/definitions/securityContext"
},
"serviceAccountName": {
"type": "string"
},
@@ -4300,6 +4616,10 @@ func init() {
}
}
}
},
"securityContext": {
"type": "object",
"$ref": "#/definitions/securityContext"
}
}
},
@@ -4475,6 +4795,10 @@ func init() {
}
}
}
},
"securityContext": {
"type": "object",
"$ref": "#/definitions/securityContext"
}
}
},
@@ -4914,6 +5238,62 @@ func init() {
}
}
},
"/mp-integration": {
"get": {
"tags": [
"OperatorAPI"
],
"summary": "Returns email registered for marketplace integration",
"operationId": "GetMPIntegration",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"type": "object",
"properties": {
"isEmailSet": {
"type": "boolean"
}
}
}
},
"default": {
"description": "Generic error response.",
"schema": {
"$ref": "#/definitions/error"
}
}
}
},
"post": {
"tags": [
"OperatorAPI"
],
"summary": "Set email to register for marketplace integration",
"operationId": "PostMPIntegration",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/mpIntegration"
}
}
],
"responses": {
"201": {
"description": "A successful response."
},
"default": {
"description": "Generic error response.",
"schema": {
"$ref": "#/definitions/error"
}
}
}
}
},
"/namespace": {
"post": {
"tags": [
@@ -6252,6 +6632,48 @@ func init() {
}
}
},
"/namespaces/{namespace}/tenants/{tenant}/set-administrators": {
"post": {
"tags": [
"OperatorAPI"
],
"summary": "Set the consoleAdmin policy to the specified users and groups",
"operationId": "SetTenantAdministrators",
"parameters": [
{
"type": "string",
"name": "namespace",
"in": "path",
"required": true
},
{
"type": "string",
"name": "tenant",
"in": "path",
"required": true
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/setAdministratorsRequest"
}
}
],
"responses": {
"204": {
"description": "A successful response."
},
"default": {
"description": "Generic error response.",
"schema": {
"$ref": "#/definitions/error"
}
}
}
}
},
"/namespaces/{namespace}/tenants/{tenant}/usage": {
"get": {
"tags": [
@@ -6412,6 +6834,133 @@ func init() {
}
}
},
"/subnet/apikey": {
"get": {
"tags": [
"OperatorAPI"
],
"summary": "Subnet api key",
"operationId": "OperatorSubnetApiKey",
"parameters": [
{
"type": "string",
"name": "token",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/operatorSubnetAPIKey"
}
},
"default": {
"description": "Generic error response.",
"schema": {
"$ref": "#/definitions/error"
}
}
}
}
},
"/subnet/apikey/register": {
"post": {
"tags": [
"OperatorAPI"
],
"summary": "Register Operator with Subnet",
"operationId": "OperatorSubnetRegisterAPIKey",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/operatorSubnetAPIKey"
}
}
],
"responses": {
"200": {
"description": "A successful response."
},
"default": {
"description": "Generic error response.",
"schema": {
"$ref": "#/definitions/error"
}
}
}
}
},
"/subnet/login": {
"post": {
"tags": [
"OperatorAPI"
],
"summary": "Login to subnet",
"operationId": "OperatorSubnetLogin",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/operatorSubnetLoginRequest"
}
}
],
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/operatorSubnetLoginResponse"
}
},
"default": {
"description": "Generic error response.",
"schema": {
"$ref": "#/definitions/error"
}
}
}
}
},
"/subnet/login/mfa": {
"post": {
"tags": [
"OperatorAPI"
],
"summary": "Login to subnet using mfa",
"operationId": "OperatorSubnetLoginMFA",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/operatorSubnetLoginMFARequest"
}
}
],
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/operatorSubnetLoginResponse"
}
},
"default": {
"description": "Generic error response.",
"schema": {
"$ref": "#/definitions/error"
}
}
}
}
},
"/subscription/info": {
"get": {
"tags": [
@@ -8667,10 +9216,6 @@ func init() {
},
"loginRequest": {
"type": "object",
"required": [
"accessKey",
"secretKey"
],
"properties": {
"accessKey": {
"type": "string"
@@ -8685,6 +9230,9 @@ func init() {
},
"secretKey": {
"type": "string"
},
"sts": {
"type": "string"
}
}
},
@@ -8737,6 +9285,17 @@ func init() {
}
}
},
"mpIntegration": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"isInEU": {
"type": "boolean"
}
}
},
"namespace": {
"type": "object",
"required": [
@@ -8830,6 +9389,55 @@ func init() {
}
}
},
"operatorSubnetAPIKey": {
"type": "object",
"properties": {
"apiKey": {
"type": "string"
}
}
},
"operatorSubnetLoginMFARequest": {
"type": "object",
"required": [
"username",
"otp",
"mfa_token"
],
"properties": {
"mfa_token": {
"type": "string"
},
"otp": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"operatorSubnetLoginRequest": {
"type": "object",
"properties": {
"password": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"operatorSubnetLoginResponse": {
"type": "object",
"properties": {
"access_token": {
"type": "string"
},
"mfa_token": {
"type": "string"
}
}
},
"parityResponse": {
"type": "array",
"items": {
@@ -9239,6 +9847,23 @@ func init() {
}
}
},
"setAdministratorsRequest": {
"type": "object",
"properties": {
"group_dns": {
"type": "array",
"items": {
"type": "string"
}
},
"user_dns": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"state": {
"type": "object",
"properties": {
@@ -9432,6 +10057,9 @@ func init() {
"dbImage": {
"type": "string"
},
"dbInitImage": {
"type": "string"
},
"dbLabels": {
"type": "array",
"items": {
@@ -9444,6 +10072,10 @@ func init() {
"$ref": "#/definitions/nodeSelector"
}
},
"dbSecurityContext": {
"type": "object",
"$ref": "#/definitions/securityContext"
},
"dbServiceAccountName": {
"type": "string"
},
@@ -9480,6 +10112,10 @@ func init() {
"$ref": "#/definitions/nodeSelector"
}
},
"securityContext": {
"type": "object",
"$ref": "#/definitions/securityContext"
},
"serviceAccountName": {
"type": "string"
}
@@ -9524,6 +10160,10 @@ func init() {
"prometheusEnabled": {
"type": "boolean"
},
"securityContext": {
"type": "object",
"$ref": "#/definitions/securityContext"
},
"serviceAccountName": {
"type": "string"
},
@@ -9600,6 +10240,10 @@ func init() {
}
}
}
},
"securityContext": {
"type": "object",
"$ref": "#/definitions/securityContext"
}
}
},
@@ -9775,6 +10419,10 @@ func init() {
}
}
}
},
"securityContext": {
"type": "object",
"$ref": "#/definitions/securityContext"
}
}
},

View File

@@ -39,6 +39,10 @@ type K8sClientI interface {
createSecret(ctx context.Context, namespace string, secret *v1.Secret, opts metav1.CreateOptions) (*v1.Secret, error)
updateSecret(ctx context.Context, namespace string, secret *v1.Secret, opts metav1.UpdateOptions) (*v1.Secret, error)
getPVC(ctx context.Context, namespace string, pvcName string, opts metav1.GetOptions) (*v1.PersistentVolumeClaim, error)
getConfigMap(ctx context.Context, namespace, configMap string, opts metav1.GetOptions) (*v1.ConfigMap, error)
createConfigMap(ctx context.Context, namespace string, cm *v1.ConfigMap, opts metav1.CreateOptions) (*v1.ConfigMap, error)
updateConfigMap(ctx context.Context, namespace string, cm *v1.ConfigMap, opts metav1.UpdateOptions) (*v1.ConfigMap, error)
deleteConfigMap(ctx context.Context, namespace string, name string, opts metav1.DeleteOptions) error
}
// Interface implementation
@@ -87,3 +91,19 @@ func (c *k8sClient) getStorageClasses(ctx context.Context, opts metav1.ListOptio
func (c *k8sClient) getPVC(ctx context.Context, namespace string, pvcName string, opts metav1.GetOptions) (*v1.PersistentVolumeClaim, error) {
return c.client.CoreV1().PersistentVolumeClaims(namespace).Get(ctx, pvcName, opts)
}
func (c *k8sClient) getConfigMap(ctx context.Context, namespace, name string, opts metav1.GetOptions) (*v1.ConfigMap, error) {
return c.client.CoreV1().ConfigMaps(namespace).Get(ctx, name, opts)
}
func (c *k8sClient) createConfigMap(ctx context.Context, namespace string, cm *v1.ConfigMap, opts metav1.CreateOptions) (*v1.ConfigMap, error) {
return c.client.CoreV1().ConfigMaps(namespace).Create(ctx, cm, opts)
}
func (c *k8sClient) updateConfigMap(ctx context.Context, namespace string, cm *v1.ConfigMap, opts metav1.UpdateOptions) (*v1.ConfigMap, error) {
return c.client.CoreV1().ConfigMaps(namespace).Update(ctx, cm, opts)
}
func (c *k8sClient) deleteConfigMap(ctx context.Context, namespace string, name string, opts metav1.DeleteOptions) error {
return c.client.CoreV1().ConfigMaps(namespace).Delete(ctx, name, opts)
}

194
operatorapi/marketplace.go Normal file
View File

@@ -0,0 +1,194 @@
// 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 operatorapi
import (
"context"
"fmt"
"io"
"net/http"
"os"
"strings"
"time"
"github.com/go-openapi/runtime/middleware"
"github.com/golang-jwt/jwt/v4"
"github.com/minio/console/cluster"
"github.com/minio/console/models"
"github.com/minio/console/operatorapi/operations"
"github.com/minio/console/operatorapi/operations/operator_api"
"github.com/minio/console/pkg"
errors "github.com/minio/console/restapi"
"github.com/minio/pkg/env"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
var (
mpConfigMapDefault = "mp-config"
mpConfigMapKey = "MP_CONFIG_KEY"
mpHostEnvVar = "MP_HOST"
defaultMPHost = "https://marketplace.apps.min.dev"
mpEUHostEnvVar = "MP_EU_HOST"
defaultEUMPHost = "https://marketplace-eu.apps.min.dev"
isMPEmailSet = "isEmailSet"
emailNotSetMsg = "Email was not sent in request"
)
func registerMarketplaceHandlers(api *operations.OperatorAPI) {
api.OperatorAPIGetMPIntegrationHandler = operator_api.GetMPIntegrationHandlerFunc(func(params operator_api.GetMPIntegrationParams, session *models.Principal) middleware.Responder {
payload, err := getMPIntegrationResponse(session, params)
if err != nil {
return operator_api.NewGetMPIntegrationDefault(int(err.Code)).WithPayload(err)
}
return operator_api.NewGetMPIntegrationOK().WithPayload(payload)
})
api.OperatorAPIPostMPIntegrationHandler = operator_api.PostMPIntegrationHandlerFunc(func(params operator_api.PostMPIntegrationParams, session *models.Principal) middleware.Responder {
err := postMPIntegrationResponse(session, params)
if err != nil {
return operator_api.NewPostMPIntegrationDefault(int(err.Code)).WithPayload(err)
}
return operator_api.NewPostMPIntegrationCreated()
})
}
func getMPIntegrationResponse(session *models.Principal, params operator_api.GetMPIntegrationParams) (*operator_api.GetMPIntegrationOKBody, *models.Error) {
clientSet, err := cluster.K8sClient(session.STSSessionToken)
ctx, cancel := context.WithCancel(params.HTTPRequest.Context())
defer cancel()
if err != nil {
return nil, errors.ErrorWithContext(ctx, err)
}
isMPEmailSet, err := getMPEmail(ctx, &k8sClient{client: clientSet})
if err != nil {
return nil, errors.ErrorWithContext(ctx, errors.ErrNotFound)
}
return &operator_api.GetMPIntegrationOKBody{
IsEmailSet: isMPEmailSet,
}, nil
}
func getMPEmail(ctx context.Context, clientSet K8sClientI) (bool, error) {
cm, err := clientSet.getConfigMap(ctx, "default", getMPConfigMapKey(mpConfigMapKey), metav1.GetOptions{})
if err != nil {
return false, err
}
return cm.Data[isMPEmailSet] == "true", nil
}
func postMPIntegrationResponse(session *models.Principal, params operator_api.PostMPIntegrationParams) *models.Error {
clientSet, err := cluster.K8sClient(session.STSSessionToken)
ctx, cancel := context.WithCancel(params.HTTPRequest.Context())
defer cancel()
if err != nil {
return errors.ErrorWithContext(ctx, err)
}
return setMPIntegration(ctx, params.Body.Email, params.Body.IsInEU, &k8sClient{client: clientSet})
}
func setMPIntegration(ctx context.Context, email string, isInEU bool, clientSet K8sClientI) *models.Error {
if email == "" {
return errors.ErrorWithContext(ctx, errors.ErrBadRequest, fmt.Errorf(emailNotSetMsg))
}
if _, err := setMPEmail(ctx, email, isInEU, clientSet); err != nil {
return errors.ErrorWithContext(ctx, err)
}
return nil
}
func setMPEmail(ctx context.Context, email string, isInEU bool, clientSet K8sClientI) (*corev1.ConfigMap, error) {
if err := postEmailToMP(email, isInEU); err != nil {
return nil, err
}
cm := createCM()
return clientSet.createConfigMap(ctx, "default", cm, metav1.CreateOptions{})
}
func postEmailToMP(email string, isInEU bool) error {
mpURL, err := getMPURL(isInEU)
if err != nil {
return err
}
return makePostRequestToMP(mpURL, email)
}
func getMPURL(isInEU bool) (string, error) {
mpHost := getMPHost(isInEU)
if mpHost == "" {
return "", fmt.Errorf("mp host not set")
}
return fmt.Sprintf("%s/mp-email", mpHost), nil
}
func getMPHost(isInEU bool) string {
if isInEU {
return env.Get(mpEUHostEnvVar, defaultEUMPHost)
}
return env.Get(mpHostEnvVar, defaultMPHost)
}
func makePostRequestToMP(url, email string) error {
request, err := createMPRequest(url, email)
if err != nil {
return err
}
client := &http.Client{Timeout: 3 * time.Second}
if res, err := client.Do(request); err != nil {
return err
} else if res.StatusCode >= http.StatusBadRequest {
b, _ := io.ReadAll(res.Body)
return fmt.Errorf("request to %s failed with status code %d and error %s", url, res.StatusCode, string(b))
}
return nil
}
func createMPRequest(url, email string) (*http.Request, error) {
request, err := http.NewRequest("POST", url, strings.NewReader(fmt.Sprintf("{\"email\":\"%s\"}", email)))
if err != nil {
return nil, err
}
jwtToken := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{})
jwtTokenString, err := jwtToken.SignedString([]byte(pkg.MPSecret))
if err != nil {
return nil, err
}
request.Header.Add("Cookie", fmt.Sprintf("jwtToken=%s", jwtTokenString))
request.Header.Add("Content-Type", "application/json")
return request, nil
}
func createCM() *corev1.ConfigMap {
return &corev1.ConfigMap{
TypeMeta: metav1.TypeMeta{
Kind: "ConfigMap",
APIVersion: "v1",
},
ObjectMeta: metav1.ObjectMeta{
Name: getMPConfigMapKey(mpConfigMapKey),
Namespace: "default",
},
Data: map[string]string{isMPEmailSet: "true"},
}
}
func getMPConfigMapKey(envVar string) string {
if mp := os.Getenv(envVar); mp != "" {
return mp
}
return mpConfigMapDefault
}

View File

@@ -0,0 +1,214 @@
// 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 operatorapi
import (
"context"
"errors"
"fmt"
"net/http"
"net/http/httptest"
"os"
"testing"
"github.com/minio/console/models"
"github.com/minio/console/operatorapi/operations"
"github.com/minio/console/operatorapi/operations/operator_api"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
var (
testWithError = false
testServerWithError = false
errMock = errors.New("mock error")
k8sClientGetConfigMapMock func(ctx context.Context, namespace, configMap string, opts metav1.GetOptions) (*corev1.ConfigMap, error)
k8sClientCreateConfigMapMock func(ctx context.Context, namespace string, cm *corev1.ConfigMap, opts metav1.CreateOptions) (*corev1.ConfigMap, error)
k8sClientUpdateConfigMapMock func(ctx context.Context, namespace string, cm *corev1.ConfigMap, opts metav1.UpdateOptions) (*corev1.ConfigMap, error)
k8sClientDeleteConfigMapMock func(ctx context.Context, namespace string, name string, opts metav1.DeleteOptions) error
)
type MarketplaceTestSuite struct {
suite.Suite
assert *assert.Assertions
kClient k8sClientMock
namespace string
postServer *httptest.Server
}
func (c k8sClientMock) getConfigMap(ctx context.Context, namespace, configMap string, opts metav1.GetOptions) (*corev1.ConfigMap, error) {
return k8sClientGetConfigMapMock(ctx, namespace, configMap, opts)
}
func (c k8sClientMock) createConfigMap(ctx context.Context, namespace string, cm *corev1.ConfigMap, opts metav1.CreateOptions) (*corev1.ConfigMap, error) {
return k8sClientCreateConfigMapMock(ctx, namespace, cm, opts)
}
func (c k8sClientMock) updateConfigMap(ctx context.Context, namespace string, cm *corev1.ConfigMap, opts metav1.UpdateOptions) (*corev1.ConfigMap, error) {
return k8sClientUpdateConfigMapMock(ctx, namespace, cm, opts)
}
func (c k8sClientMock) deleteConfigMap(ctx context.Context, namespace string, name string, opts metav1.DeleteOptions) error {
return k8sClientDeleteConfigMapMock(ctx, namespace, name, opts)
}
func (suite *MarketplaceTestSuite) SetupSuite() {
suite.assert = assert.New(suite.T())
suite.namespace = "default"
k8sClientGetConfigMapMock = suite.getConfigMapMock
k8sClientCreateConfigMapMock = suite.createConfigMapMock
k8sClientUpdateConfigMapMock = suite.updateConfigMapMock
k8sClientDeleteConfigMapMock = suite.deleteConfigMapMock
os.Setenv(mpConfigMapKey, "mp-mock-config")
suite.postServer = httptest.NewServer(http.HandlerFunc(suite.postHandler))
}
func (suite *MarketplaceTestSuite) postHandler(
w http.ResponseWriter, r *http.Request,
) {
if testServerWithError {
w.WriteHeader(400)
} else {
fmt.Fprintf(w, `{"post": "Post response"}`)
}
}
func (suite *MarketplaceTestSuite) TearDownSuite() {
os.Unsetenv(mpConfigMapKey)
}
func (suite *MarketplaceTestSuite) getConfigMapMock(ctx context.Context, namespace, configMap string, opts metav1.GetOptions) (*corev1.ConfigMap, error) {
if testWithError {
return nil, errMock
}
return &corev1.ConfigMap{Data: map[string]string{isMPEmailSet: "true"}}, nil
}
func (suite *MarketplaceTestSuite) createConfigMapMock(ctx context.Context, namespace string, cm *corev1.ConfigMap, opts metav1.CreateOptions) (*corev1.ConfigMap, error) {
if testWithError {
return nil, errMock
}
return &corev1.ConfigMap{}, nil
}
func (suite *MarketplaceTestSuite) updateConfigMapMock(ctx context.Context, namespace string, cm *corev1.ConfigMap, opts metav1.UpdateOptions) (*corev1.ConfigMap, error) {
if testWithError {
return nil, errMock
}
return &corev1.ConfigMap{}, nil
}
func (suite *MarketplaceTestSuite) deleteConfigMapMock(ctx context.Context, namespace string, name string, opts metav1.DeleteOptions) error {
if testWithError {
return errMock
}
return nil
}
func (suite *MarketplaceTestSuite) TestRegisterMarketplaceHandlers() {
api := &operations.OperatorAPI{}
suite.assert.Nil(api.OperatorAPIGetMPIntegrationHandler)
suite.assert.Nil(api.OperatorAPIPostMPIntegrationHandler)
registerMarketplaceHandlers(api)
suite.assert.NotNil(api.OperatorAPIGetMPIntegrationHandler)
suite.assert.NotNil(api.OperatorAPIPostMPIntegrationHandler)
}
func (suite *MarketplaceTestSuite) TestGetMPIntegrationHandlerWithError() {
api := &operations.OperatorAPI{}
registerMarketplaceHandlers(api)
params := operator_api.NewGetMPIntegrationParams()
params.HTTPRequest = &http.Request{}
response := api.OperatorAPIGetMPIntegrationHandler.Handle(params, &models.Principal{})
_, ok := response.(*operator_api.GetMPIntegrationDefault)
suite.assert.True(ok)
}
func (suite *MarketplaceTestSuite) TestPostMPIntegrationHandlerWithError() {
api := &operations.OperatorAPI{}
registerMarketplaceHandlers(api)
params := operator_api.NewPostMPIntegrationParams()
params.Body = &models.MpIntegration{Email: ""}
params.HTTPRequest = &http.Request{}
params.HTTPRequest.Header = map[string][]string{}
params.HTTPRequest.AddCookie(&http.Cookie{Value: "token", Name: "token"})
response := api.OperatorAPIPostMPIntegrationHandler.Handle(params, &models.Principal{})
_, ok := response.(*operator_api.PostMPIntegrationDefault)
suite.assert.True(ok)
}
func (suite *MarketplaceTestSuite) TestGetMPEmailWithError() {
testWithError = true
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
email, err := getMPEmail(ctx, &suite.kClient)
suite.assert.NotNil(err)
suite.assert.Empty(email)
}
func (suite *MarketplaceTestSuite) TestGetMPEmailNoError() {
testWithError = false
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
isSet, err := getMPEmail(ctx, &suite.kClient)
suite.assert.Nil(err)
suite.assert.True(isSet)
}
func (suite *MarketplaceTestSuite) TestSetMPIntegrationNoEmail() {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
err := setMPIntegration(ctx, "", false, &suite.kClient)
suite.assert.NotNil(err)
}
func (suite *MarketplaceTestSuite) TestSetMPIntegrationWithError() {
testWithError = true
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
os.Setenv(mpHostEnvVar, " ")
err := setMPIntegration(ctx, "mock@mock.com", false, &suite.kClient)
suite.assert.NotNil(err)
os.Unsetenv(mpHostEnvVar)
}
func (suite *MarketplaceTestSuite) TestSetMPIntegrationNoError() {
testWithError = false
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
os.Setenv(mpHostEnvVar, suite.postServer.URL)
err := setMPIntegration(ctx, "mock@mock.com", false, &suite.kClient)
suite.assert.Nil(err)
os.Unsetenv(mpHostEnvVar)
}
func (suite *MarketplaceTestSuite) TestSetMPIntegrationWithRequestError() {
testWithError = false
testServerWithError = true
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
os.Setenv(mpHostEnvVar, suite.postServer.URL)
err := setMPIntegration(ctx, "mock@mock.com", false, &suite.kClient)
suite.assert.NotNil(err)
os.Unsetenv(mpHostEnvVar)
}
func TestMarketplace(t *testing.T) {
suite.Run(t, new(MarketplaceTestSuite))
}

View File

@@ -94,6 +94,9 @@ func NewOperatorAPI(spec *loads.Document) *OperatorAPI {
OperatorAPIGetAllocatableResourcesHandler: operator_api.GetAllocatableResourcesHandlerFunc(func(params operator_api.GetAllocatableResourcesParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation operator_api.GetAllocatableResources has not yet been implemented")
}),
OperatorAPIGetMPIntegrationHandler: operator_api.GetMPIntegrationHandlerFunc(func(params operator_api.GetMPIntegrationParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation operator_api.GetMPIntegration has not yet been implemented")
}),
OperatorAPIGetMaxAllocatableMemHandler: operator_api.GetMaxAllocatableMemHandlerFunc(func(params operator_api.GetMaxAllocatableMemParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation operator_api.GetMaxAllocatableMem has not yet been implemented")
}),
@@ -163,12 +166,30 @@ func NewOperatorAPI(spec *loads.Document) *OperatorAPI {
AuthLogoutHandler: auth.LogoutHandlerFunc(func(params auth.LogoutParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation auth.Logout has not yet been implemented")
}),
OperatorAPIOperatorSubnetAPIKeyHandler: operator_api.OperatorSubnetAPIKeyHandlerFunc(func(params operator_api.OperatorSubnetAPIKeyParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation operator_api.OperatorSubnetAPIKey has not yet been implemented")
}),
OperatorAPIOperatorSubnetLoginHandler: operator_api.OperatorSubnetLoginHandlerFunc(func(params operator_api.OperatorSubnetLoginParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation operator_api.OperatorSubnetLogin has not yet been implemented")
}),
OperatorAPIOperatorSubnetLoginMFAHandler: operator_api.OperatorSubnetLoginMFAHandlerFunc(func(params operator_api.OperatorSubnetLoginMFAParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation operator_api.OperatorSubnetLoginMFA has not yet been implemented")
}),
OperatorAPIOperatorSubnetRegisterAPIKeyHandler: operator_api.OperatorSubnetRegisterAPIKeyHandlerFunc(func(params operator_api.OperatorSubnetRegisterAPIKeyParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation operator_api.OperatorSubnetRegisterAPIKey has not yet been implemented")
}),
OperatorAPIPostMPIntegrationHandler: operator_api.PostMPIntegrationHandlerFunc(func(params operator_api.PostMPIntegrationParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation operator_api.PostMPIntegration has not yet been implemented")
}),
OperatorAPIPutTenantYAMLHandler: operator_api.PutTenantYAMLHandlerFunc(func(params operator_api.PutTenantYAMLParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation operator_api.PutTenantYAML has not yet been implemented")
}),
AuthSessionCheckHandler: auth.SessionCheckHandlerFunc(func(params auth.SessionCheckParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation auth.SessionCheck has not yet been implemented")
}),
OperatorAPISetTenantAdministratorsHandler: operator_api.SetTenantAdministratorsHandlerFunc(func(params operator_api.SetTenantAdministratorsParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation operator_api.SetTenantAdministrators has not yet been implemented")
}),
OperatorAPISetTenantLogsHandler: operator_api.SetTenantLogsHandlerFunc(func(params operator_api.SetTenantLogsParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation operator_api.SetTenantLogs has not yet been implemented")
}),
@@ -295,6 +316,8 @@ type OperatorAPI struct {
OperatorAPIEnableTenantLoggingHandler operator_api.EnableTenantLoggingHandler
// OperatorAPIGetAllocatableResourcesHandler sets the operation handler for the get allocatable resources operation
OperatorAPIGetAllocatableResourcesHandler operator_api.GetAllocatableResourcesHandler
// OperatorAPIGetMPIntegrationHandler sets the operation handler for the get m p integration operation
OperatorAPIGetMPIntegrationHandler operator_api.GetMPIntegrationHandler
// OperatorAPIGetMaxAllocatableMemHandler sets the operation handler for the get max allocatable mem operation
OperatorAPIGetMaxAllocatableMemHandler operator_api.GetMaxAllocatableMemHandler
// OperatorAPIGetPVCDescribeHandler sets the operation handler for the get p v c describe operation
@@ -341,10 +364,22 @@ type OperatorAPI struct {
AuthLoginOperatorHandler auth.LoginOperatorHandler
// AuthLogoutHandler sets the operation handler for the logout operation
AuthLogoutHandler auth.LogoutHandler
// OperatorAPIOperatorSubnetAPIKeyHandler sets the operation handler for the operator subnet Api key operation
OperatorAPIOperatorSubnetAPIKeyHandler operator_api.OperatorSubnetAPIKeyHandler
// OperatorAPIOperatorSubnetLoginHandler sets the operation handler for the operator subnet login operation
OperatorAPIOperatorSubnetLoginHandler operator_api.OperatorSubnetLoginHandler
// OperatorAPIOperatorSubnetLoginMFAHandler sets the operation handler for the operator subnet login m f a operation
OperatorAPIOperatorSubnetLoginMFAHandler operator_api.OperatorSubnetLoginMFAHandler
// OperatorAPIOperatorSubnetRegisterAPIKeyHandler sets the operation handler for the operator subnet register API key operation
OperatorAPIOperatorSubnetRegisterAPIKeyHandler operator_api.OperatorSubnetRegisterAPIKeyHandler
// OperatorAPIPostMPIntegrationHandler sets the operation handler for the post m p integration operation
OperatorAPIPostMPIntegrationHandler operator_api.PostMPIntegrationHandler
// OperatorAPIPutTenantYAMLHandler sets the operation handler for the put tenant y a m l operation
OperatorAPIPutTenantYAMLHandler operator_api.PutTenantYAMLHandler
// AuthSessionCheckHandler sets the operation handler for the session check operation
AuthSessionCheckHandler auth.SessionCheckHandler
// OperatorAPISetTenantAdministratorsHandler sets the operation handler for the set tenant administrators operation
OperatorAPISetTenantAdministratorsHandler operator_api.SetTenantAdministratorsHandler
// OperatorAPISetTenantLogsHandler sets the operation handler for the set tenant logs operation
OperatorAPISetTenantLogsHandler operator_api.SetTenantLogsHandler
// OperatorAPISetTenantMonitoringHandler sets the operation handler for the set tenant monitoring operation
@@ -494,6 +529,9 @@ func (o *OperatorAPI) Validate() error {
if o.OperatorAPIGetAllocatableResourcesHandler == nil {
unregistered = append(unregistered, "operator_api.GetAllocatableResourcesHandler")
}
if o.OperatorAPIGetMPIntegrationHandler == nil {
unregistered = append(unregistered, "operator_api.GetMPIntegrationHandler")
}
if o.OperatorAPIGetMaxAllocatableMemHandler == nil {
unregistered = append(unregistered, "operator_api.GetMaxAllocatableMemHandler")
}
@@ -563,12 +601,30 @@ func (o *OperatorAPI) Validate() error {
if o.AuthLogoutHandler == nil {
unregistered = append(unregistered, "auth.LogoutHandler")
}
if o.OperatorAPIOperatorSubnetAPIKeyHandler == nil {
unregistered = append(unregistered, "operator_api.OperatorSubnetAPIKeyHandler")
}
if o.OperatorAPIOperatorSubnetLoginHandler == nil {
unregistered = append(unregistered, "operator_api.OperatorSubnetLoginHandler")
}
if o.OperatorAPIOperatorSubnetLoginMFAHandler == nil {
unregistered = append(unregistered, "operator_api.OperatorSubnetLoginMFAHandler")
}
if o.OperatorAPIOperatorSubnetRegisterAPIKeyHandler == nil {
unregistered = append(unregistered, "operator_api.OperatorSubnetRegisterAPIKeyHandler")
}
if o.OperatorAPIPostMPIntegrationHandler == nil {
unregistered = append(unregistered, "operator_api.PostMPIntegrationHandler")
}
if o.OperatorAPIPutTenantYAMLHandler == nil {
unregistered = append(unregistered, "operator_api.PutTenantYAMLHandler")
}
if o.AuthSessionCheckHandler == nil {
unregistered = append(unregistered, "auth.SessionCheckHandler")
}
if o.OperatorAPISetTenantAdministratorsHandler == nil {
unregistered = append(unregistered, "operator_api.SetTenantAdministratorsHandler")
}
if o.OperatorAPISetTenantLogsHandler == nil {
unregistered = append(unregistered, "operator_api.SetTenantLogsHandler")
}
@@ -767,6 +823,10 @@ func (o *OperatorAPI) initHandlerCache() {
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
}
o.handlers["GET"]["/mp-integration"] = operator_api.NewGetMPIntegration(o.context, o.OperatorAPIGetMPIntegrationHandler)
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
}
o.handlers["GET"]["/cluster/max-allocatable-memory"] = operator_api.NewGetMaxAllocatableMem(o.context, o.OperatorAPIGetMaxAllocatableMemHandler)
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
@@ -856,6 +916,26 @@ func (o *OperatorAPI) initHandlerCache() {
o.handlers["POST"] = make(map[string]http.Handler)
}
o.handlers["POST"]["/logout"] = auth.NewLogout(o.context, o.AuthLogoutHandler)
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
}
o.handlers["GET"]["/subnet/apikey"] = operator_api.NewOperatorSubnetAPIKey(o.context, o.OperatorAPIOperatorSubnetAPIKeyHandler)
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)
}
o.handlers["POST"]["/subnet/login"] = operator_api.NewOperatorSubnetLogin(o.context, o.OperatorAPIOperatorSubnetLoginHandler)
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)
}
o.handlers["POST"]["/subnet/login/mfa"] = operator_api.NewOperatorSubnetLoginMFA(o.context, o.OperatorAPIOperatorSubnetLoginMFAHandler)
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)
}
o.handlers["POST"]["/subnet/apikey/register"] = operator_api.NewOperatorSubnetRegisterAPIKey(o.context, o.OperatorAPIOperatorSubnetRegisterAPIKeyHandler)
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)
}
o.handlers["POST"]["/mp-integration"] = operator_api.NewPostMPIntegration(o.context, o.OperatorAPIPostMPIntegrationHandler)
if o.handlers["PUT"] == nil {
o.handlers["PUT"] = make(map[string]http.Handler)
}
@@ -864,6 +944,10 @@ func (o *OperatorAPI) initHandlerCache() {
o.handlers["GET"] = make(map[string]http.Handler)
}
o.handlers["GET"]["/session"] = auth.NewSessionCheck(o.context, o.AuthSessionCheckHandler)
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)
}
o.handlers["POST"]["/namespaces/{namespace}/tenants/{tenant}/set-administrators"] = operator_api.NewSetTenantAdministrators(o.context, o.OperatorAPISetTenantAdministratorsHandler)
if o.handlers["PUT"] == nil {
o.handlers["PUT"] = make(map[string]http.Handler)
}

View File

@@ -0,0 +1,128 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"context"
"net/http"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/minio/console/models"
)
// GetMPIntegrationHandlerFunc turns a function with the right signature into a get m p integration handler
type GetMPIntegrationHandlerFunc func(GetMPIntegrationParams, *models.Principal) middleware.Responder
// Handle executing the request and returning a response
func (fn GetMPIntegrationHandlerFunc) Handle(params GetMPIntegrationParams, principal *models.Principal) middleware.Responder {
return fn(params, principal)
}
// GetMPIntegrationHandler interface for that can handle valid get m p integration params
type GetMPIntegrationHandler interface {
Handle(GetMPIntegrationParams, *models.Principal) middleware.Responder
}
// NewGetMPIntegration creates a new http.Handler for the get m p integration operation
func NewGetMPIntegration(ctx *middleware.Context, handler GetMPIntegrationHandler) *GetMPIntegration {
return &GetMPIntegration{Context: ctx, Handler: handler}
}
/* GetMPIntegration swagger:route GET /mp-integration OperatorAPI getMPIntegration
Returns email registered for marketplace integration
*/
type GetMPIntegration struct {
Context *middleware.Context
Handler GetMPIntegrationHandler
}
func (o *GetMPIntegration) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, rCtx, _ := o.Context.RouteInfo(r)
if rCtx != nil {
*r = *rCtx
}
var Params = NewGetMPIntegrationParams()
uprinc, aCtx, err := o.Context.Authorize(r, route)
if err != nil {
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
if aCtx != nil {
*r = *aCtx
}
var principal *models.Principal
if uprinc != nil {
principal = uprinc.(*models.Principal) // this is really a models.Principal, I promise
}
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params, principal) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}
// GetMPIntegrationOKBody get m p integration o k body
//
// swagger:model GetMPIntegrationOKBody
type GetMPIntegrationOKBody struct {
// is email set
IsEmailSet bool `json:"isEmailSet,omitempty"`
}
// Validate validates this get m p integration o k body
func (o *GetMPIntegrationOKBody) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this get m p integration o k body based on context it is used
func (o *GetMPIntegrationOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *GetMPIntegrationOKBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *GetMPIntegrationOKBody) UnmarshalBinary(b []byte) error {
var res GetMPIntegrationOKBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}

View File

@@ -0,0 +1,63 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime/middleware"
)
// NewGetMPIntegrationParams creates a new GetMPIntegrationParams object
//
// There are no default values defined in the spec.
func NewGetMPIntegrationParams() GetMPIntegrationParams {
return GetMPIntegrationParams{}
}
// GetMPIntegrationParams contains all the bound params for the get m p integration operation
// typically these are obtained from a http.Request
//
// swagger:parameters GetMPIntegration
type GetMPIntegrationParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
// To ensure default values, the struct must have been initialized with NewGetMPIntegrationParams() beforehand.
func (o *GetMPIntegrationParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,133 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/runtime"
"github.com/minio/console/models"
)
// GetMPIntegrationOKCode is the HTTP code returned for type GetMPIntegrationOK
const GetMPIntegrationOKCode int = 200
/*GetMPIntegrationOK A successful response.
swagger:response getMPIntegrationOK
*/
type GetMPIntegrationOK struct {
/*
In: Body
*/
Payload *GetMPIntegrationOKBody `json:"body,omitempty"`
}
// NewGetMPIntegrationOK creates GetMPIntegrationOK with default headers values
func NewGetMPIntegrationOK() *GetMPIntegrationOK {
return &GetMPIntegrationOK{}
}
// WithPayload adds the payload to the get m p integration o k response
func (o *GetMPIntegrationOK) WithPayload(payload *GetMPIntegrationOKBody) *GetMPIntegrationOK {
o.Payload = payload
return o
}
// SetPayload sets the payload to the get m p integration o k response
func (o *GetMPIntegrationOK) SetPayload(payload *GetMPIntegrationOKBody) {
o.Payload = payload
}
// WriteResponse to the client
func (o *GetMPIntegrationOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(200)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
}
/*GetMPIntegrationDefault Generic error response.
swagger:response getMPIntegrationDefault
*/
type GetMPIntegrationDefault struct {
_statusCode int
/*
In: Body
*/
Payload *models.Error `json:"body,omitempty"`
}
// NewGetMPIntegrationDefault creates GetMPIntegrationDefault with default headers values
func NewGetMPIntegrationDefault(code int) *GetMPIntegrationDefault {
if code <= 0 {
code = 500
}
return &GetMPIntegrationDefault{
_statusCode: code,
}
}
// WithStatusCode adds the status to the get m p integration default response
func (o *GetMPIntegrationDefault) WithStatusCode(code int) *GetMPIntegrationDefault {
o._statusCode = code
return o
}
// SetStatusCode sets the status to the get m p integration default response
func (o *GetMPIntegrationDefault) SetStatusCode(code int) {
o._statusCode = code
}
// WithPayload adds the payload to the get m p integration default response
func (o *GetMPIntegrationDefault) WithPayload(payload *models.Error) *GetMPIntegrationDefault {
o.Payload = payload
return o
}
// SetPayload sets the payload to the get m p integration default response
func (o *GetMPIntegrationDefault) SetPayload(payload *models.Error) {
o.Payload = payload
}
// WriteResponse to the client
func (o *GetMPIntegrationDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(o._statusCode)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
}

View File

@@ -0,0 +1,104 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"errors"
"net/url"
golangswaggerpaths "path"
)
// GetMPIntegrationURL generates an URL for the get m p integration operation
type GetMPIntegrationURL struct {
_basePath string
}
// WithBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *GetMPIntegrationURL) WithBasePath(bp string) *GetMPIntegrationURL {
o.SetBasePath(bp)
return o
}
// SetBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *GetMPIntegrationURL) SetBasePath(bp string) {
o._basePath = bp
}
// Build a url path and query string
func (o *GetMPIntegrationURL) Build() (*url.URL, error) {
var _result url.URL
var _path = "/mp-integration"
_basePath := o._basePath
if _basePath == "" {
_basePath = "/api/v1"
}
_result.Path = golangswaggerpaths.Join(_basePath, _path)
return &_result, nil
}
// Must is a helper function to panic when the url builder returns an error
func (o *GetMPIntegrationURL) Must(u *url.URL, err error) *url.URL {
if err != nil {
panic(err)
}
if u == nil {
panic("url can't be nil")
}
return u
}
// String returns the string representation of the path with query string
func (o *GetMPIntegrationURL) String() string {
return o.Must(o.Build()).String()
}
// BuildFull builds a full url with scheme, host, path and query string
func (o *GetMPIntegrationURL) BuildFull(scheme, host string) (*url.URL, error) {
if scheme == "" {
return nil, errors.New("scheme is required for a full url on GetMPIntegrationURL")
}
if host == "" {
return nil, errors.New("host is required for a full url on GetMPIntegrationURL")
}
base, err := o.Build()
if err != nil {
return nil, err
}
base.Scheme = scheme
base.Host = host
return base, nil
}
// StringFull returns the string representation of a complete url
func (o *GetMPIntegrationURL) StringFull(scheme, host string) string {
return o.Must(o.BuildFull(scheme, host)).String()
}

View File

@@ -0,0 +1,88 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"net/http"
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/models"
)
// OperatorSubnetAPIKeyHandlerFunc turns a function with the right signature into a operator subnet Api key handler
type OperatorSubnetAPIKeyHandlerFunc func(OperatorSubnetAPIKeyParams, *models.Principal) middleware.Responder
// Handle executing the request and returning a response
func (fn OperatorSubnetAPIKeyHandlerFunc) Handle(params OperatorSubnetAPIKeyParams, principal *models.Principal) middleware.Responder {
return fn(params, principal)
}
// OperatorSubnetAPIKeyHandler interface for that can handle valid operator subnet Api key params
type OperatorSubnetAPIKeyHandler interface {
Handle(OperatorSubnetAPIKeyParams, *models.Principal) middleware.Responder
}
// NewOperatorSubnetAPIKey creates a new http.Handler for the operator subnet Api key operation
func NewOperatorSubnetAPIKey(ctx *middleware.Context, handler OperatorSubnetAPIKeyHandler) *OperatorSubnetAPIKey {
return &OperatorSubnetAPIKey{Context: ctx, Handler: handler}
}
/* OperatorSubnetAPIKey swagger:route GET /subnet/apikey OperatorAPI operatorSubnetApiKey
Subnet api key
*/
type OperatorSubnetAPIKey struct {
Context *middleware.Context
Handler OperatorSubnetAPIKeyHandler
}
func (o *OperatorSubnetAPIKey) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, rCtx, _ := o.Context.RouteInfo(r)
if rCtx != nil {
*r = *rCtx
}
var Params = NewOperatorSubnetAPIKeyParams()
uprinc, aCtx, err := o.Context.Authorize(r, route)
if err != nil {
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
if aCtx != nil {
*r = *aCtx
}
var principal *models.Principal
if uprinc != nil {
principal = uprinc.(*models.Principal) // this is really a models.Principal, I promise
}
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params, principal) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}

View File

@@ -0,0 +1,99 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/validate"
)
// NewOperatorSubnetAPIKeyParams creates a new OperatorSubnetAPIKeyParams object
//
// There are no default values defined in the spec.
func NewOperatorSubnetAPIKeyParams() OperatorSubnetAPIKeyParams {
return OperatorSubnetAPIKeyParams{}
}
// OperatorSubnetAPIKeyParams contains all the bound params for the operator subnet Api key operation
// typically these are obtained from a http.Request
//
// swagger:parameters OperatorSubnetApiKey
type OperatorSubnetAPIKeyParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*
Required: true
In: query
*/
Token string
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
// To ensure default values, the struct must have been initialized with NewOperatorSubnetAPIKeyParams() beforehand.
func (o *OperatorSubnetAPIKeyParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
qs := runtime.Values(r.URL.Query())
qToken, qhkToken, _ := qs.GetOK("token")
if err := o.bindToken(qToken, qhkToken, route.Formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// bindToken binds and validates parameter Token from query.
func (o *OperatorSubnetAPIKeyParams) bindToken(rawData []string, hasKey bool, formats strfmt.Registry) error {
if !hasKey {
return errors.Required("token", "query", rawData)
}
var raw string
if len(rawData) > 0 {
raw = rawData[len(rawData)-1]
}
// Required: true
// AllowEmptyValue: false
if err := validate.RequiredString("token", "query", raw); err != nil {
return err
}
o.Token = raw
return nil
}

View File

@@ -0,0 +1,133 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/runtime"
"github.com/minio/console/models"
)
// OperatorSubnetAPIKeyOKCode is the HTTP code returned for type OperatorSubnetAPIKeyOK
const OperatorSubnetAPIKeyOKCode int = 200
/*OperatorSubnetAPIKeyOK A successful response.
swagger:response operatorSubnetApiKeyOK
*/
type OperatorSubnetAPIKeyOK struct {
/*
In: Body
*/
Payload *models.OperatorSubnetAPIKey `json:"body,omitempty"`
}
// NewOperatorSubnetAPIKeyOK creates OperatorSubnetAPIKeyOK with default headers values
func NewOperatorSubnetAPIKeyOK() *OperatorSubnetAPIKeyOK {
return &OperatorSubnetAPIKeyOK{}
}
// WithPayload adds the payload to the operator subnet Api key o k response
func (o *OperatorSubnetAPIKeyOK) WithPayload(payload *models.OperatorSubnetAPIKey) *OperatorSubnetAPIKeyOK {
o.Payload = payload
return o
}
// SetPayload sets the payload to the operator subnet Api key o k response
func (o *OperatorSubnetAPIKeyOK) SetPayload(payload *models.OperatorSubnetAPIKey) {
o.Payload = payload
}
// WriteResponse to the client
func (o *OperatorSubnetAPIKeyOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(200)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
}
/*OperatorSubnetAPIKeyDefault Generic error response.
swagger:response operatorSubnetApiKeyDefault
*/
type OperatorSubnetAPIKeyDefault struct {
_statusCode int
/*
In: Body
*/
Payload *models.Error `json:"body,omitempty"`
}
// NewOperatorSubnetAPIKeyDefault creates OperatorSubnetAPIKeyDefault with default headers values
func NewOperatorSubnetAPIKeyDefault(code int) *OperatorSubnetAPIKeyDefault {
if code <= 0 {
code = 500
}
return &OperatorSubnetAPIKeyDefault{
_statusCode: code,
}
}
// WithStatusCode adds the status to the operator subnet Api key default response
func (o *OperatorSubnetAPIKeyDefault) WithStatusCode(code int) *OperatorSubnetAPIKeyDefault {
o._statusCode = code
return o
}
// SetStatusCode sets the status to the operator subnet Api key default response
func (o *OperatorSubnetAPIKeyDefault) SetStatusCode(code int) {
o._statusCode = code
}
// WithPayload adds the payload to the operator subnet Api key default response
func (o *OperatorSubnetAPIKeyDefault) WithPayload(payload *models.Error) *OperatorSubnetAPIKeyDefault {
o.Payload = payload
return o
}
// SetPayload sets the payload to the operator subnet Api key default response
func (o *OperatorSubnetAPIKeyDefault) SetPayload(payload *models.Error) {
o.Payload = payload
}
// WriteResponse to the client
func (o *OperatorSubnetAPIKeyDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(o._statusCode)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
}

View File

@@ -0,0 +1,117 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"errors"
"net/url"
golangswaggerpaths "path"
)
// OperatorSubnetAPIKeyURL generates an URL for the operator subnet Api key operation
type OperatorSubnetAPIKeyURL struct {
Token string
_basePath string
// avoid unkeyed usage
_ struct{}
}
// WithBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *OperatorSubnetAPIKeyURL) WithBasePath(bp string) *OperatorSubnetAPIKeyURL {
o.SetBasePath(bp)
return o
}
// SetBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *OperatorSubnetAPIKeyURL) SetBasePath(bp string) {
o._basePath = bp
}
// Build a url path and query string
func (o *OperatorSubnetAPIKeyURL) Build() (*url.URL, error) {
var _result url.URL
var _path = "/subnet/apikey"
_basePath := o._basePath
if _basePath == "" {
_basePath = "/api/v1"
}
_result.Path = golangswaggerpaths.Join(_basePath, _path)
qs := make(url.Values)
tokenQ := o.Token
if tokenQ != "" {
qs.Set("token", tokenQ)
}
_result.RawQuery = qs.Encode()
return &_result, nil
}
// Must is a helper function to panic when the url builder returns an error
func (o *OperatorSubnetAPIKeyURL) Must(u *url.URL, err error) *url.URL {
if err != nil {
panic(err)
}
if u == nil {
panic("url can't be nil")
}
return u
}
// String returns the string representation of the path with query string
func (o *OperatorSubnetAPIKeyURL) String() string {
return o.Must(o.Build()).String()
}
// BuildFull builds a full url with scheme, host, path and query string
func (o *OperatorSubnetAPIKeyURL) BuildFull(scheme, host string) (*url.URL, error) {
if scheme == "" {
return nil, errors.New("scheme is required for a full url on OperatorSubnetAPIKeyURL")
}
if host == "" {
return nil, errors.New("host is required for a full url on OperatorSubnetAPIKeyURL")
}
base, err := o.Build()
if err != nil {
return nil, err
}
base.Scheme = scheme
base.Host = host
return base, nil
}
// StringFull returns the string representation of a complete url
func (o *OperatorSubnetAPIKeyURL) StringFull(scheme, host string) string {
return o.Must(o.BuildFull(scheme, host)).String()
}

View File

@@ -0,0 +1,88 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"net/http"
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/models"
)
// OperatorSubnetLoginHandlerFunc turns a function with the right signature into a operator subnet login handler
type OperatorSubnetLoginHandlerFunc func(OperatorSubnetLoginParams, *models.Principal) middleware.Responder
// Handle executing the request and returning a response
func (fn OperatorSubnetLoginHandlerFunc) Handle(params OperatorSubnetLoginParams, principal *models.Principal) middleware.Responder {
return fn(params, principal)
}
// OperatorSubnetLoginHandler interface for that can handle valid operator subnet login params
type OperatorSubnetLoginHandler interface {
Handle(OperatorSubnetLoginParams, *models.Principal) middleware.Responder
}
// NewOperatorSubnetLogin creates a new http.Handler for the operator subnet login operation
func NewOperatorSubnetLogin(ctx *middleware.Context, handler OperatorSubnetLoginHandler) *OperatorSubnetLogin {
return &OperatorSubnetLogin{Context: ctx, Handler: handler}
}
/* OperatorSubnetLogin swagger:route POST /subnet/login OperatorAPI operatorSubnetLogin
Login to subnet
*/
type OperatorSubnetLogin struct {
Context *middleware.Context
Handler OperatorSubnetLoginHandler
}
func (o *OperatorSubnetLogin) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, rCtx, _ := o.Context.RouteInfo(r)
if rCtx != nil {
*r = *rCtx
}
var Params = NewOperatorSubnetLoginParams()
uprinc, aCtx, err := o.Context.Authorize(r, route)
if err != nil {
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
if aCtx != nil {
*r = *aCtx
}
var principal *models.Principal
if uprinc != nil {
principal = uprinc.(*models.Principal) // this is really a models.Principal, I promise
}
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params, principal) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}

View File

@@ -0,0 +1,88 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"net/http"
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/models"
)
// OperatorSubnetLoginMFAHandlerFunc turns a function with the right signature into a operator subnet login m f a handler
type OperatorSubnetLoginMFAHandlerFunc func(OperatorSubnetLoginMFAParams, *models.Principal) middleware.Responder
// Handle executing the request and returning a response
func (fn OperatorSubnetLoginMFAHandlerFunc) Handle(params OperatorSubnetLoginMFAParams, principal *models.Principal) middleware.Responder {
return fn(params, principal)
}
// OperatorSubnetLoginMFAHandler interface for that can handle valid operator subnet login m f a params
type OperatorSubnetLoginMFAHandler interface {
Handle(OperatorSubnetLoginMFAParams, *models.Principal) middleware.Responder
}
// NewOperatorSubnetLoginMFA creates a new http.Handler for the operator subnet login m f a operation
func NewOperatorSubnetLoginMFA(ctx *middleware.Context, handler OperatorSubnetLoginMFAHandler) *OperatorSubnetLoginMFA {
return &OperatorSubnetLoginMFA{Context: ctx, Handler: handler}
}
/* OperatorSubnetLoginMFA swagger:route POST /subnet/login/mfa OperatorAPI operatorSubnetLoginMFA
Login to subnet using mfa
*/
type OperatorSubnetLoginMFA struct {
Context *middleware.Context
Handler OperatorSubnetLoginMFAHandler
}
func (o *OperatorSubnetLoginMFA) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, rCtx, _ := o.Context.RouteInfo(r)
if rCtx != nil {
*r = *rCtx
}
var Params = NewOperatorSubnetLoginMFAParams()
uprinc, aCtx, err := o.Context.Authorize(r, route)
if err != nil {
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
if aCtx != nil {
*r = *aCtx
}
var principal *models.Principal
if uprinc != nil {
principal = uprinc.(*models.Principal) // this is really a models.Principal, I promise
}
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params, principal) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}

View File

@@ -0,0 +1,102 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"io"
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/validate"
"github.com/minio/console/models"
)
// NewOperatorSubnetLoginMFAParams creates a new OperatorSubnetLoginMFAParams object
//
// There are no default values defined in the spec.
func NewOperatorSubnetLoginMFAParams() OperatorSubnetLoginMFAParams {
return OperatorSubnetLoginMFAParams{}
}
// OperatorSubnetLoginMFAParams contains all the bound params for the operator subnet login m f a operation
// typically these are obtained from a http.Request
//
// swagger:parameters OperatorSubnetLoginMFA
type OperatorSubnetLoginMFAParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*
Required: true
In: body
*/
Body *models.OperatorSubnetLoginMFARequest
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
// To ensure default values, the struct must have been initialized with NewOperatorSubnetLoginMFAParams() beforehand.
func (o *OperatorSubnetLoginMFAParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if runtime.HasBody(r) {
defer r.Body.Close()
var body models.OperatorSubnetLoginMFARequest
if err := route.Consumer.Consume(r.Body, &body); err != nil {
if err == io.EOF {
res = append(res, errors.Required("body", "body", ""))
} else {
res = append(res, errors.NewParseError("body", "body", "", err))
}
} else {
// validate body object
if err := body.Validate(route.Formats); err != nil {
res = append(res, err)
}
ctx := validate.WithOperationRequest(context.Background())
if err := body.ContextValidate(ctx, route.Formats); err != nil {
res = append(res, err)
}
if len(res) == 0 {
o.Body = &body
}
}
} else {
res = append(res, errors.Required("body", "body", ""))
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,133 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/runtime"
"github.com/minio/console/models"
)
// OperatorSubnetLoginMFAOKCode is the HTTP code returned for type OperatorSubnetLoginMFAOK
const OperatorSubnetLoginMFAOKCode int = 200
/*OperatorSubnetLoginMFAOK A successful response.
swagger:response operatorSubnetLoginMFAOK
*/
type OperatorSubnetLoginMFAOK struct {
/*
In: Body
*/
Payload *models.OperatorSubnetLoginResponse `json:"body,omitempty"`
}
// NewOperatorSubnetLoginMFAOK creates OperatorSubnetLoginMFAOK with default headers values
func NewOperatorSubnetLoginMFAOK() *OperatorSubnetLoginMFAOK {
return &OperatorSubnetLoginMFAOK{}
}
// WithPayload adds the payload to the operator subnet login m f a o k response
func (o *OperatorSubnetLoginMFAOK) WithPayload(payload *models.OperatorSubnetLoginResponse) *OperatorSubnetLoginMFAOK {
o.Payload = payload
return o
}
// SetPayload sets the payload to the operator subnet login m f a o k response
func (o *OperatorSubnetLoginMFAOK) SetPayload(payload *models.OperatorSubnetLoginResponse) {
o.Payload = payload
}
// WriteResponse to the client
func (o *OperatorSubnetLoginMFAOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(200)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
}
/*OperatorSubnetLoginMFADefault Generic error response.
swagger:response operatorSubnetLoginMFADefault
*/
type OperatorSubnetLoginMFADefault struct {
_statusCode int
/*
In: Body
*/
Payload *models.Error `json:"body,omitempty"`
}
// NewOperatorSubnetLoginMFADefault creates OperatorSubnetLoginMFADefault with default headers values
func NewOperatorSubnetLoginMFADefault(code int) *OperatorSubnetLoginMFADefault {
if code <= 0 {
code = 500
}
return &OperatorSubnetLoginMFADefault{
_statusCode: code,
}
}
// WithStatusCode adds the status to the operator subnet login m f a default response
func (o *OperatorSubnetLoginMFADefault) WithStatusCode(code int) *OperatorSubnetLoginMFADefault {
o._statusCode = code
return o
}
// SetStatusCode sets the status to the operator subnet login m f a default response
func (o *OperatorSubnetLoginMFADefault) SetStatusCode(code int) {
o._statusCode = code
}
// WithPayload adds the payload to the operator subnet login m f a default response
func (o *OperatorSubnetLoginMFADefault) WithPayload(payload *models.Error) *OperatorSubnetLoginMFADefault {
o.Payload = payload
return o
}
// SetPayload sets the payload to the operator subnet login m f a default response
func (o *OperatorSubnetLoginMFADefault) SetPayload(payload *models.Error) {
o.Payload = payload
}
// WriteResponse to the client
func (o *OperatorSubnetLoginMFADefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(o._statusCode)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
}

View File

@@ -0,0 +1,104 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"errors"
"net/url"
golangswaggerpaths "path"
)
// OperatorSubnetLoginMFAURL generates an URL for the operator subnet login m f a operation
type OperatorSubnetLoginMFAURL struct {
_basePath string
}
// WithBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *OperatorSubnetLoginMFAURL) WithBasePath(bp string) *OperatorSubnetLoginMFAURL {
o.SetBasePath(bp)
return o
}
// SetBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *OperatorSubnetLoginMFAURL) SetBasePath(bp string) {
o._basePath = bp
}
// Build a url path and query string
func (o *OperatorSubnetLoginMFAURL) Build() (*url.URL, error) {
var _result url.URL
var _path = "/subnet/login/mfa"
_basePath := o._basePath
if _basePath == "" {
_basePath = "/api/v1"
}
_result.Path = golangswaggerpaths.Join(_basePath, _path)
return &_result, nil
}
// Must is a helper function to panic when the url builder returns an error
func (o *OperatorSubnetLoginMFAURL) Must(u *url.URL, err error) *url.URL {
if err != nil {
panic(err)
}
if u == nil {
panic("url can't be nil")
}
return u
}
// String returns the string representation of the path with query string
func (o *OperatorSubnetLoginMFAURL) String() string {
return o.Must(o.Build()).String()
}
// BuildFull builds a full url with scheme, host, path and query string
func (o *OperatorSubnetLoginMFAURL) BuildFull(scheme, host string) (*url.URL, error) {
if scheme == "" {
return nil, errors.New("scheme is required for a full url on OperatorSubnetLoginMFAURL")
}
if host == "" {
return nil, errors.New("host is required for a full url on OperatorSubnetLoginMFAURL")
}
base, err := o.Build()
if err != nil {
return nil, err
}
base.Scheme = scheme
base.Host = host
return base, nil
}
// StringFull returns the string representation of a complete url
func (o *OperatorSubnetLoginMFAURL) StringFull(scheme, host string) string {
return o.Must(o.BuildFull(scheme, host)).String()
}

View File

@@ -0,0 +1,102 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"io"
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/validate"
"github.com/minio/console/models"
)
// NewOperatorSubnetLoginParams creates a new OperatorSubnetLoginParams object
//
// There are no default values defined in the spec.
func NewOperatorSubnetLoginParams() OperatorSubnetLoginParams {
return OperatorSubnetLoginParams{}
}
// OperatorSubnetLoginParams contains all the bound params for the operator subnet login operation
// typically these are obtained from a http.Request
//
// swagger:parameters OperatorSubnetLogin
type OperatorSubnetLoginParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*
Required: true
In: body
*/
Body *models.OperatorSubnetLoginRequest
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
// To ensure default values, the struct must have been initialized with NewOperatorSubnetLoginParams() beforehand.
func (o *OperatorSubnetLoginParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if runtime.HasBody(r) {
defer r.Body.Close()
var body models.OperatorSubnetLoginRequest
if err := route.Consumer.Consume(r.Body, &body); err != nil {
if err == io.EOF {
res = append(res, errors.Required("body", "body", ""))
} else {
res = append(res, errors.NewParseError("body", "body", "", err))
}
} else {
// validate body object
if err := body.Validate(route.Formats); err != nil {
res = append(res, err)
}
ctx := validate.WithOperationRequest(context.Background())
if err := body.ContextValidate(ctx, route.Formats); err != nil {
res = append(res, err)
}
if len(res) == 0 {
o.Body = &body
}
}
} else {
res = append(res, errors.Required("body", "body", ""))
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,133 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/runtime"
"github.com/minio/console/models"
)
// OperatorSubnetLoginOKCode is the HTTP code returned for type OperatorSubnetLoginOK
const OperatorSubnetLoginOKCode int = 200
/*OperatorSubnetLoginOK A successful response.
swagger:response operatorSubnetLoginOK
*/
type OperatorSubnetLoginOK struct {
/*
In: Body
*/
Payload *models.OperatorSubnetLoginResponse `json:"body,omitempty"`
}
// NewOperatorSubnetLoginOK creates OperatorSubnetLoginOK with default headers values
func NewOperatorSubnetLoginOK() *OperatorSubnetLoginOK {
return &OperatorSubnetLoginOK{}
}
// WithPayload adds the payload to the operator subnet login o k response
func (o *OperatorSubnetLoginOK) WithPayload(payload *models.OperatorSubnetLoginResponse) *OperatorSubnetLoginOK {
o.Payload = payload
return o
}
// SetPayload sets the payload to the operator subnet login o k response
func (o *OperatorSubnetLoginOK) SetPayload(payload *models.OperatorSubnetLoginResponse) {
o.Payload = payload
}
// WriteResponse to the client
func (o *OperatorSubnetLoginOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(200)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
}
/*OperatorSubnetLoginDefault Generic error response.
swagger:response operatorSubnetLoginDefault
*/
type OperatorSubnetLoginDefault struct {
_statusCode int
/*
In: Body
*/
Payload *models.Error `json:"body,omitempty"`
}
// NewOperatorSubnetLoginDefault creates OperatorSubnetLoginDefault with default headers values
func NewOperatorSubnetLoginDefault(code int) *OperatorSubnetLoginDefault {
if code <= 0 {
code = 500
}
return &OperatorSubnetLoginDefault{
_statusCode: code,
}
}
// WithStatusCode adds the status to the operator subnet login default response
func (o *OperatorSubnetLoginDefault) WithStatusCode(code int) *OperatorSubnetLoginDefault {
o._statusCode = code
return o
}
// SetStatusCode sets the status to the operator subnet login default response
func (o *OperatorSubnetLoginDefault) SetStatusCode(code int) {
o._statusCode = code
}
// WithPayload adds the payload to the operator subnet login default response
func (o *OperatorSubnetLoginDefault) WithPayload(payload *models.Error) *OperatorSubnetLoginDefault {
o.Payload = payload
return o
}
// SetPayload sets the payload to the operator subnet login default response
func (o *OperatorSubnetLoginDefault) SetPayload(payload *models.Error) {
o.Payload = payload
}
// WriteResponse to the client
func (o *OperatorSubnetLoginDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(o._statusCode)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
}

View File

@@ -0,0 +1,104 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"errors"
"net/url"
golangswaggerpaths "path"
)
// OperatorSubnetLoginURL generates an URL for the operator subnet login operation
type OperatorSubnetLoginURL struct {
_basePath string
}
// WithBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *OperatorSubnetLoginURL) WithBasePath(bp string) *OperatorSubnetLoginURL {
o.SetBasePath(bp)
return o
}
// SetBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *OperatorSubnetLoginURL) SetBasePath(bp string) {
o._basePath = bp
}
// Build a url path and query string
func (o *OperatorSubnetLoginURL) Build() (*url.URL, error) {
var _result url.URL
var _path = "/subnet/login"
_basePath := o._basePath
if _basePath == "" {
_basePath = "/api/v1"
}
_result.Path = golangswaggerpaths.Join(_basePath, _path)
return &_result, nil
}
// Must is a helper function to panic when the url builder returns an error
func (o *OperatorSubnetLoginURL) Must(u *url.URL, err error) *url.URL {
if err != nil {
panic(err)
}
if u == nil {
panic("url can't be nil")
}
return u
}
// String returns the string representation of the path with query string
func (o *OperatorSubnetLoginURL) String() string {
return o.Must(o.Build()).String()
}
// BuildFull builds a full url with scheme, host, path and query string
func (o *OperatorSubnetLoginURL) BuildFull(scheme, host string) (*url.URL, error) {
if scheme == "" {
return nil, errors.New("scheme is required for a full url on OperatorSubnetLoginURL")
}
if host == "" {
return nil, errors.New("host is required for a full url on OperatorSubnetLoginURL")
}
base, err := o.Build()
if err != nil {
return nil, err
}
base.Scheme = scheme
base.Host = host
return base, nil
}
// StringFull returns the string representation of a complete url
func (o *OperatorSubnetLoginURL) StringFull(scheme, host string) string {
return o.Must(o.BuildFull(scheme, host)).String()
}

View File

@@ -0,0 +1,88 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"net/http"
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/models"
)
// OperatorSubnetRegisterAPIKeyHandlerFunc turns a function with the right signature into a operator subnet register API key handler
type OperatorSubnetRegisterAPIKeyHandlerFunc func(OperatorSubnetRegisterAPIKeyParams, *models.Principal) middleware.Responder
// Handle executing the request and returning a response
func (fn OperatorSubnetRegisterAPIKeyHandlerFunc) Handle(params OperatorSubnetRegisterAPIKeyParams, principal *models.Principal) middleware.Responder {
return fn(params, principal)
}
// OperatorSubnetRegisterAPIKeyHandler interface for that can handle valid operator subnet register API key params
type OperatorSubnetRegisterAPIKeyHandler interface {
Handle(OperatorSubnetRegisterAPIKeyParams, *models.Principal) middleware.Responder
}
// NewOperatorSubnetRegisterAPIKey creates a new http.Handler for the operator subnet register API key operation
func NewOperatorSubnetRegisterAPIKey(ctx *middleware.Context, handler OperatorSubnetRegisterAPIKeyHandler) *OperatorSubnetRegisterAPIKey {
return &OperatorSubnetRegisterAPIKey{Context: ctx, Handler: handler}
}
/* OperatorSubnetRegisterAPIKey swagger:route POST /subnet/apikey/register OperatorAPI operatorSubnetRegisterApiKey
Register Operator with Subnet
*/
type OperatorSubnetRegisterAPIKey struct {
Context *middleware.Context
Handler OperatorSubnetRegisterAPIKeyHandler
}
func (o *OperatorSubnetRegisterAPIKey) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, rCtx, _ := o.Context.RouteInfo(r)
if rCtx != nil {
*r = *rCtx
}
var Params = NewOperatorSubnetRegisterAPIKeyParams()
uprinc, aCtx, err := o.Context.Authorize(r, route)
if err != nil {
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
if aCtx != nil {
*r = *aCtx
}
var principal *models.Principal
if uprinc != nil {
principal = uprinc.(*models.Principal) // this is really a models.Principal, I promise
}
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params, principal) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}

View File

@@ -0,0 +1,102 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"io"
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/validate"
"github.com/minio/console/models"
)
// NewOperatorSubnetRegisterAPIKeyParams creates a new OperatorSubnetRegisterAPIKeyParams object
//
// There are no default values defined in the spec.
func NewOperatorSubnetRegisterAPIKeyParams() OperatorSubnetRegisterAPIKeyParams {
return OperatorSubnetRegisterAPIKeyParams{}
}
// OperatorSubnetRegisterAPIKeyParams contains all the bound params for the operator subnet register API key operation
// typically these are obtained from a http.Request
//
// swagger:parameters OperatorSubnetRegisterAPIKey
type OperatorSubnetRegisterAPIKeyParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*
Required: true
In: body
*/
Body *models.OperatorSubnetAPIKey
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
// To ensure default values, the struct must have been initialized with NewOperatorSubnetRegisterAPIKeyParams() beforehand.
func (o *OperatorSubnetRegisterAPIKeyParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if runtime.HasBody(r) {
defer r.Body.Close()
var body models.OperatorSubnetAPIKey
if err := route.Consumer.Consume(r.Body, &body); err != nil {
if err == io.EOF {
res = append(res, errors.Required("body", "body", ""))
} else {
res = append(res, errors.NewParseError("body", "body", "", err))
}
} else {
// validate body object
if err := body.Validate(route.Formats); err != nil {
res = append(res, err)
}
ctx := validate.WithOperationRequest(context.Background())
if err := body.ContextValidate(ctx, route.Formats); err != nil {
res = append(res, err)
}
if len(res) == 0 {
o.Body = &body
}
}
} else {
res = append(res, errors.Required("body", "body", ""))
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,113 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/runtime"
"github.com/minio/console/models"
)
// OperatorSubnetRegisterAPIKeyOKCode is the HTTP code returned for type OperatorSubnetRegisterAPIKeyOK
const OperatorSubnetRegisterAPIKeyOKCode int = 200
/*OperatorSubnetRegisterAPIKeyOK A successful response.
swagger:response operatorSubnetRegisterApiKeyOK
*/
type OperatorSubnetRegisterAPIKeyOK struct {
}
// NewOperatorSubnetRegisterAPIKeyOK creates OperatorSubnetRegisterAPIKeyOK with default headers values
func NewOperatorSubnetRegisterAPIKeyOK() *OperatorSubnetRegisterAPIKeyOK {
return &OperatorSubnetRegisterAPIKeyOK{}
}
// WriteResponse to the client
func (o *OperatorSubnetRegisterAPIKeyOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(200)
}
/*OperatorSubnetRegisterAPIKeyDefault Generic error response.
swagger:response operatorSubnetRegisterApiKeyDefault
*/
type OperatorSubnetRegisterAPIKeyDefault struct {
_statusCode int
/*
In: Body
*/
Payload *models.Error `json:"body,omitempty"`
}
// NewOperatorSubnetRegisterAPIKeyDefault creates OperatorSubnetRegisterAPIKeyDefault with default headers values
func NewOperatorSubnetRegisterAPIKeyDefault(code int) *OperatorSubnetRegisterAPIKeyDefault {
if code <= 0 {
code = 500
}
return &OperatorSubnetRegisterAPIKeyDefault{
_statusCode: code,
}
}
// WithStatusCode adds the status to the operator subnet register API key default response
func (o *OperatorSubnetRegisterAPIKeyDefault) WithStatusCode(code int) *OperatorSubnetRegisterAPIKeyDefault {
o._statusCode = code
return o
}
// SetStatusCode sets the status to the operator subnet register API key default response
func (o *OperatorSubnetRegisterAPIKeyDefault) SetStatusCode(code int) {
o._statusCode = code
}
// WithPayload adds the payload to the operator subnet register API key default response
func (o *OperatorSubnetRegisterAPIKeyDefault) WithPayload(payload *models.Error) *OperatorSubnetRegisterAPIKeyDefault {
o.Payload = payload
return o
}
// SetPayload sets the payload to the operator subnet register API key default response
func (o *OperatorSubnetRegisterAPIKeyDefault) SetPayload(payload *models.Error) {
o.Payload = payload
}
// WriteResponse to the client
func (o *OperatorSubnetRegisterAPIKeyDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(o._statusCode)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
}

View File

@@ -0,0 +1,104 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"errors"
"net/url"
golangswaggerpaths "path"
)
// OperatorSubnetRegisterAPIKeyURL generates an URL for the operator subnet register API key operation
type OperatorSubnetRegisterAPIKeyURL struct {
_basePath string
}
// WithBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *OperatorSubnetRegisterAPIKeyURL) WithBasePath(bp string) *OperatorSubnetRegisterAPIKeyURL {
o.SetBasePath(bp)
return o
}
// SetBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *OperatorSubnetRegisterAPIKeyURL) SetBasePath(bp string) {
o._basePath = bp
}
// Build a url path and query string
func (o *OperatorSubnetRegisterAPIKeyURL) Build() (*url.URL, error) {
var _result url.URL
var _path = "/subnet/apikey/register"
_basePath := o._basePath
if _basePath == "" {
_basePath = "/api/v1"
}
_result.Path = golangswaggerpaths.Join(_basePath, _path)
return &_result, nil
}
// Must is a helper function to panic when the url builder returns an error
func (o *OperatorSubnetRegisterAPIKeyURL) Must(u *url.URL, err error) *url.URL {
if err != nil {
panic(err)
}
if u == nil {
panic("url can't be nil")
}
return u
}
// String returns the string representation of the path with query string
func (o *OperatorSubnetRegisterAPIKeyURL) String() string {
return o.Must(o.Build()).String()
}
// BuildFull builds a full url with scheme, host, path and query string
func (o *OperatorSubnetRegisterAPIKeyURL) BuildFull(scheme, host string) (*url.URL, error) {
if scheme == "" {
return nil, errors.New("scheme is required for a full url on OperatorSubnetRegisterAPIKeyURL")
}
if host == "" {
return nil, errors.New("host is required for a full url on OperatorSubnetRegisterAPIKeyURL")
}
base, err := o.Build()
if err != nil {
return nil, err
}
base.Scheme = scheme
base.Host = host
return base, nil
}
// StringFull returns the string representation of a complete url
func (o *OperatorSubnetRegisterAPIKeyURL) StringFull(scheme, host string) string {
return o.Must(o.BuildFull(scheme, host)).String()
}

View File

@@ -0,0 +1,88 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"net/http"
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/models"
)
// PostMPIntegrationHandlerFunc turns a function with the right signature into a post m p integration handler
type PostMPIntegrationHandlerFunc func(PostMPIntegrationParams, *models.Principal) middleware.Responder
// Handle executing the request and returning a response
func (fn PostMPIntegrationHandlerFunc) Handle(params PostMPIntegrationParams, principal *models.Principal) middleware.Responder {
return fn(params, principal)
}
// PostMPIntegrationHandler interface for that can handle valid post m p integration params
type PostMPIntegrationHandler interface {
Handle(PostMPIntegrationParams, *models.Principal) middleware.Responder
}
// NewPostMPIntegration creates a new http.Handler for the post m p integration operation
func NewPostMPIntegration(ctx *middleware.Context, handler PostMPIntegrationHandler) *PostMPIntegration {
return &PostMPIntegration{Context: ctx, Handler: handler}
}
/* PostMPIntegration swagger:route POST /mp-integration OperatorAPI postMPIntegration
Set email to register for marketplace integration
*/
type PostMPIntegration struct {
Context *middleware.Context
Handler PostMPIntegrationHandler
}
func (o *PostMPIntegration) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, rCtx, _ := o.Context.RouteInfo(r)
if rCtx != nil {
*r = *rCtx
}
var Params = NewPostMPIntegrationParams()
uprinc, aCtx, err := o.Context.Authorize(r, route)
if err != nil {
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
if aCtx != nil {
*r = *aCtx
}
var principal *models.Principal
if uprinc != nil {
principal = uprinc.(*models.Principal) // this is really a models.Principal, I promise
}
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params, principal) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}

View File

@@ -0,0 +1,102 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"io"
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/validate"
"github.com/minio/console/models"
)
// NewPostMPIntegrationParams creates a new PostMPIntegrationParams object
//
// There are no default values defined in the spec.
func NewPostMPIntegrationParams() PostMPIntegrationParams {
return PostMPIntegrationParams{}
}
// PostMPIntegrationParams contains all the bound params for the post m p integration operation
// typically these are obtained from a http.Request
//
// swagger:parameters PostMPIntegration
type PostMPIntegrationParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*
Required: true
In: body
*/
Body *models.MpIntegration
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
// To ensure default values, the struct must have been initialized with NewPostMPIntegrationParams() beforehand.
func (o *PostMPIntegrationParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if runtime.HasBody(r) {
defer r.Body.Close()
var body models.MpIntegration
if err := route.Consumer.Consume(r.Body, &body); err != nil {
if err == io.EOF {
res = append(res, errors.Required("body", "body", ""))
} else {
res = append(res, errors.NewParseError("body", "body", "", err))
}
} else {
// validate body object
if err := body.Validate(route.Formats); err != nil {
res = append(res, err)
}
ctx := validate.WithOperationRequest(context.Background())
if err := body.ContextValidate(ctx, route.Formats); err != nil {
res = append(res, err)
}
if len(res) == 0 {
o.Body = &body
}
}
} else {
res = append(res, errors.Required("body", "body", ""))
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,113 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/runtime"
"github.com/minio/console/models"
)
// PostMPIntegrationCreatedCode is the HTTP code returned for type PostMPIntegrationCreated
const PostMPIntegrationCreatedCode int = 201
/*PostMPIntegrationCreated A successful response.
swagger:response postMPIntegrationCreated
*/
type PostMPIntegrationCreated struct {
}
// NewPostMPIntegrationCreated creates PostMPIntegrationCreated with default headers values
func NewPostMPIntegrationCreated() *PostMPIntegrationCreated {
return &PostMPIntegrationCreated{}
}
// WriteResponse to the client
func (o *PostMPIntegrationCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(201)
}
/*PostMPIntegrationDefault Generic error response.
swagger:response postMPIntegrationDefault
*/
type PostMPIntegrationDefault struct {
_statusCode int
/*
In: Body
*/
Payload *models.Error `json:"body,omitempty"`
}
// NewPostMPIntegrationDefault creates PostMPIntegrationDefault with default headers values
func NewPostMPIntegrationDefault(code int) *PostMPIntegrationDefault {
if code <= 0 {
code = 500
}
return &PostMPIntegrationDefault{
_statusCode: code,
}
}
// WithStatusCode adds the status to the post m p integration default response
func (o *PostMPIntegrationDefault) WithStatusCode(code int) *PostMPIntegrationDefault {
o._statusCode = code
return o
}
// SetStatusCode sets the status to the post m p integration default response
func (o *PostMPIntegrationDefault) SetStatusCode(code int) {
o._statusCode = code
}
// WithPayload adds the payload to the post m p integration default response
func (o *PostMPIntegrationDefault) WithPayload(payload *models.Error) *PostMPIntegrationDefault {
o.Payload = payload
return o
}
// SetPayload sets the payload to the post m p integration default response
func (o *PostMPIntegrationDefault) SetPayload(payload *models.Error) {
o.Payload = payload
}
// WriteResponse to the client
func (o *PostMPIntegrationDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(o._statusCode)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
}

View File

@@ -0,0 +1,104 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"errors"
"net/url"
golangswaggerpaths "path"
)
// PostMPIntegrationURL generates an URL for the post m p integration operation
type PostMPIntegrationURL struct {
_basePath string
}
// WithBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *PostMPIntegrationURL) WithBasePath(bp string) *PostMPIntegrationURL {
o.SetBasePath(bp)
return o
}
// SetBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *PostMPIntegrationURL) SetBasePath(bp string) {
o._basePath = bp
}
// Build a url path and query string
func (o *PostMPIntegrationURL) Build() (*url.URL, error) {
var _result url.URL
var _path = "/mp-integration"
_basePath := o._basePath
if _basePath == "" {
_basePath = "/api/v1"
}
_result.Path = golangswaggerpaths.Join(_basePath, _path)
return &_result, nil
}
// Must is a helper function to panic when the url builder returns an error
func (o *PostMPIntegrationURL) Must(u *url.URL, err error) *url.URL {
if err != nil {
panic(err)
}
if u == nil {
panic("url can't be nil")
}
return u
}
// String returns the string representation of the path with query string
func (o *PostMPIntegrationURL) String() string {
return o.Must(o.Build()).String()
}
// BuildFull builds a full url with scheme, host, path and query string
func (o *PostMPIntegrationURL) BuildFull(scheme, host string) (*url.URL, error) {
if scheme == "" {
return nil, errors.New("scheme is required for a full url on PostMPIntegrationURL")
}
if host == "" {
return nil, errors.New("host is required for a full url on PostMPIntegrationURL")
}
base, err := o.Build()
if err != nil {
return nil, err
}
base.Scheme = scheme
base.Host = host
return base, nil
}
// StringFull returns the string representation of a complete url
func (o *PostMPIntegrationURL) StringFull(scheme, host string) string {
return o.Must(o.BuildFull(scheme, host)).String()
}

View File

@@ -0,0 +1,88 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"net/http"
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/models"
)
// SetTenantAdministratorsHandlerFunc turns a function with the right signature into a set tenant administrators handler
type SetTenantAdministratorsHandlerFunc func(SetTenantAdministratorsParams, *models.Principal) middleware.Responder
// Handle executing the request and returning a response
func (fn SetTenantAdministratorsHandlerFunc) Handle(params SetTenantAdministratorsParams, principal *models.Principal) middleware.Responder {
return fn(params, principal)
}
// SetTenantAdministratorsHandler interface for that can handle valid set tenant administrators params
type SetTenantAdministratorsHandler interface {
Handle(SetTenantAdministratorsParams, *models.Principal) middleware.Responder
}
// NewSetTenantAdministrators creates a new http.Handler for the set tenant administrators operation
func NewSetTenantAdministrators(ctx *middleware.Context, handler SetTenantAdministratorsHandler) *SetTenantAdministrators {
return &SetTenantAdministrators{Context: ctx, Handler: handler}
}
/* SetTenantAdministrators swagger:route POST /namespaces/{namespace}/tenants/{tenant}/set-administrators OperatorAPI setTenantAdministrators
Set the consoleAdmin policy to the specified users and groups
*/
type SetTenantAdministrators struct {
Context *middleware.Context
Handler SetTenantAdministratorsHandler
}
func (o *SetTenantAdministrators) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, rCtx, _ := o.Context.RouteInfo(r)
if rCtx != nil {
*r = *rCtx
}
var Params = NewSetTenantAdministratorsParams()
uprinc, aCtx, err := o.Context.Authorize(r, route)
if err != nil {
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
if aCtx != nil {
*r = *aCtx
}
var principal *models.Principal
if uprinc != nil {
principal = uprinc.(*models.Principal) // this is really a models.Principal, I promise
}
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params, principal) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}

View File

@@ -0,0 +1,151 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"io"
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/validate"
"github.com/minio/console/models"
)
// NewSetTenantAdministratorsParams creates a new SetTenantAdministratorsParams object
//
// There are no default values defined in the spec.
func NewSetTenantAdministratorsParams() SetTenantAdministratorsParams {
return SetTenantAdministratorsParams{}
}
// SetTenantAdministratorsParams contains all the bound params for the set tenant administrators operation
// typically these are obtained from a http.Request
//
// swagger:parameters SetTenantAdministrators
type SetTenantAdministratorsParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*
Required: true
In: body
*/
Body *models.SetAdministratorsRequest
/*
Required: true
In: path
*/
Namespace string
/*
Required: true
In: path
*/
Tenant string
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
// To ensure default values, the struct must have been initialized with NewSetTenantAdministratorsParams() beforehand.
func (o *SetTenantAdministratorsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if runtime.HasBody(r) {
defer r.Body.Close()
var body models.SetAdministratorsRequest
if err := route.Consumer.Consume(r.Body, &body); err != nil {
if err == io.EOF {
res = append(res, errors.Required("body", "body", ""))
} else {
res = append(res, errors.NewParseError("body", "body", "", err))
}
} else {
// validate body object
if err := body.Validate(route.Formats); err != nil {
res = append(res, err)
}
ctx := validate.WithOperationRequest(context.Background())
if err := body.ContextValidate(ctx, route.Formats); err != nil {
res = append(res, err)
}
if len(res) == 0 {
o.Body = &body
}
}
} else {
res = append(res, errors.Required("body", "body", ""))
}
rNamespace, rhkNamespace, _ := route.Params.GetOK("namespace")
if err := o.bindNamespace(rNamespace, rhkNamespace, route.Formats); err != nil {
res = append(res, err)
}
rTenant, rhkTenant, _ := route.Params.GetOK("tenant")
if err := o.bindTenant(rTenant, rhkTenant, route.Formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// bindNamespace binds and validates parameter Namespace from path.
func (o *SetTenantAdministratorsParams) bindNamespace(rawData []string, hasKey bool, formats strfmt.Registry) error {
var raw string
if len(rawData) > 0 {
raw = rawData[len(rawData)-1]
}
// Required: true
// Parameter is provided by construction from the route
o.Namespace = raw
return nil
}
// bindTenant binds and validates parameter Tenant from path.
func (o *SetTenantAdministratorsParams) bindTenant(rawData []string, hasKey bool, formats strfmt.Registry) error {
var raw string
if len(rawData) > 0 {
raw = rawData[len(rawData)-1]
}
// Required: true
// Parameter is provided by construction from the route
o.Tenant = raw
return nil
}

View File

@@ -0,0 +1,113 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/runtime"
"github.com/minio/console/models"
)
// SetTenantAdministratorsNoContentCode is the HTTP code returned for type SetTenantAdministratorsNoContent
const SetTenantAdministratorsNoContentCode int = 204
/*SetTenantAdministratorsNoContent A successful response.
swagger:response setTenantAdministratorsNoContent
*/
type SetTenantAdministratorsNoContent struct {
}
// NewSetTenantAdministratorsNoContent creates SetTenantAdministratorsNoContent with default headers values
func NewSetTenantAdministratorsNoContent() *SetTenantAdministratorsNoContent {
return &SetTenantAdministratorsNoContent{}
}
// WriteResponse to the client
func (o *SetTenantAdministratorsNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(204)
}
/*SetTenantAdministratorsDefault Generic error response.
swagger:response setTenantAdministratorsDefault
*/
type SetTenantAdministratorsDefault struct {
_statusCode int
/*
In: Body
*/
Payload *models.Error `json:"body,omitempty"`
}
// NewSetTenantAdministratorsDefault creates SetTenantAdministratorsDefault with default headers values
func NewSetTenantAdministratorsDefault(code int) *SetTenantAdministratorsDefault {
if code <= 0 {
code = 500
}
return &SetTenantAdministratorsDefault{
_statusCode: code,
}
}
// WithStatusCode adds the status to the set tenant administrators default response
func (o *SetTenantAdministratorsDefault) WithStatusCode(code int) *SetTenantAdministratorsDefault {
o._statusCode = code
return o
}
// SetStatusCode sets the status to the set tenant administrators default response
func (o *SetTenantAdministratorsDefault) SetStatusCode(code int) {
o._statusCode = code
}
// WithPayload adds the payload to the set tenant administrators default response
func (o *SetTenantAdministratorsDefault) WithPayload(payload *models.Error) *SetTenantAdministratorsDefault {
o.Payload = payload
return o
}
// SetPayload sets the payload to the set tenant administrators default response
func (o *SetTenantAdministratorsDefault) SetPayload(payload *models.Error) {
o.Payload = payload
}
// WriteResponse to the client
func (o *SetTenantAdministratorsDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(o._statusCode)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
}

View File

@@ -0,0 +1,124 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"errors"
"net/url"
golangswaggerpaths "path"
"strings"
)
// SetTenantAdministratorsURL generates an URL for the set tenant administrators operation
type SetTenantAdministratorsURL struct {
Namespace string
Tenant string
_basePath string
// avoid unkeyed usage
_ struct{}
}
// WithBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *SetTenantAdministratorsURL) WithBasePath(bp string) *SetTenantAdministratorsURL {
o.SetBasePath(bp)
return o
}
// SetBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *SetTenantAdministratorsURL) SetBasePath(bp string) {
o._basePath = bp
}
// Build a url path and query string
func (o *SetTenantAdministratorsURL) Build() (*url.URL, error) {
var _result url.URL
var _path = "/namespaces/{namespace}/tenants/{tenant}/set-administrators"
namespace := o.Namespace
if namespace != "" {
_path = strings.Replace(_path, "{namespace}", namespace, -1)
} else {
return nil, errors.New("namespace is required on SetTenantAdministratorsURL")
}
tenant := o.Tenant
if tenant != "" {
_path = strings.Replace(_path, "{tenant}", tenant, -1)
} else {
return nil, errors.New("tenant is required on SetTenantAdministratorsURL")
}
_basePath := o._basePath
if _basePath == "" {
_basePath = "/api/v1"
}
_result.Path = golangswaggerpaths.Join(_basePath, _path)
return &_result, nil
}
// Must is a helper function to panic when the url builder returns an error
func (o *SetTenantAdministratorsURL) Must(u *url.URL, err error) *url.URL {
if err != nil {
panic(err)
}
if u == nil {
panic("url can't be nil")
}
return u
}
// String returns the string representation of the path with query string
func (o *SetTenantAdministratorsURL) String() string {
return o.Must(o.Build()).String()
}
// BuildFull builds a full url with scheme, host, path and query string
func (o *SetTenantAdministratorsURL) BuildFull(scheme, host string) (*url.URL, error) {
if scheme == "" {
return nil, errors.New("scheme is required for a full url on SetTenantAdministratorsURL")
}
if host == "" {
return nil, errors.New("host is required for a full url on SetTenantAdministratorsURL")
}
base, err := o.Build()
if err != nil {
return nil, err
}
base.Scheme = scheme
base.Host = host
return base, nil
}
// StringFull returns the string representation of a complete url
func (o *SetTenantAdministratorsURL) StringFull(scheme, host string) string {
return o.Must(o.BuildFull(scheme, host)).String()
}

43
operatorapi/subnet.go Normal file
View File

@@ -0,0 +1,43 @@
// 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 operatorapi
import (
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/models"
"github.com/minio/console/operatorapi/operations"
"github.com/minio/console/operatorapi/operations/operator_api"
)
func registerOperatorSubnetHandlers(api *operations.OperatorAPI) {
api.OperatorAPIOperatorSubnetLoginHandler = operator_api.OperatorSubnetLoginHandlerFunc(func(params operator_api.OperatorSubnetLoginParams, session *models.Principal) middleware.Responder {
// TODO: Implement
return operator_api.NewOperatorSubnetLoginOK()
})
api.OperatorAPIOperatorSubnetLoginMFAHandler = operator_api.OperatorSubnetLoginMFAHandlerFunc(func(params operator_api.OperatorSubnetLoginMFAParams, session *models.Principal) middleware.Responder {
// TODO: Implement
return operator_api.NewOperatorSubnetLoginMFAOK()
})
api.OperatorAPIOperatorSubnetAPIKeyHandler = operator_api.OperatorSubnetAPIKeyHandlerFunc(func(params operator_api.OperatorSubnetAPIKeyParams, session *models.Principal) middleware.Responder {
// TODO: Implement
return operator_api.NewOperatorSubnetAPIKeyOK()
})
api.OperatorAPIOperatorSubnetRegisterAPIKeyHandler = operator_api.OperatorSubnetRegisterAPIKeyHandlerFunc(func(params operator_api.OperatorSubnetRegisterAPIKeyParams, session *models.Principal) middleware.Responder {
// TODO: Implement
return operator_api.NewOperatorSubnetRegisterAPIKeyOK()
})
}

View File

@@ -128,6 +128,15 @@ func registerTenantHandlers(api *operations.OperatorAPI) {
return operator_api.NewUpdateTenantSecurityNoContent()
})
// Set Tenant Administrators
api.OperatorAPISetTenantAdministratorsHandler = operator_api.SetTenantAdministratorsHandlerFunc(func(params operator_api.SetTenantAdministratorsParams, session *models.Principal) middleware.Responder {
err := getSetTenantAdministratorsResponse(session, params)
if err != nil {
return operator_api.NewSetTenantAdministratorsDefault(int(err.Code)).WithPayload(err)
}
return operator_api.NewSetTenantAdministratorsNoContent()
})
// Tenant identity provider details
api.OperatorAPITenantIdentityProviderHandler = operator_api.TenantIdentityProviderHandlerFunc(func(params operator_api.TenantIdentityProviderParams, session *models.Principal) middleware.Responder {
resp, err := getTenantIdentityProviderResponse(session, params)
@@ -658,6 +667,7 @@ func parseTenantCertificates(ctx context.Context, clientSet K8sClientI, namespac
func getTenantSecurity(ctx context.Context, clientSet K8sClientI, tenant *miniov2.Tenant) (response *models.TenantSecurityResponse, err error) {
var minioExternalCertificates []*models.CertificateInfo
var minioExternalCaCertificates []*models.CertificateInfo
var tenantSecurityContext *models.SecurityContext
// Certificates used by MinIO server
if minioExternalCertificates, err = parseTenantCertificates(ctx, clientSet, tenant.Namespace, tenant.Spec.ExternalCertSecret); err != nil {
return nil, err
@@ -666,12 +676,17 @@ func getTenantSecurity(ctx context.Context, clientSet K8sClientI, tenant *miniov
if minioExternalCaCertificates, err = parseTenantCertificates(ctx, clientSet, tenant.Namespace, tenant.Spec.ExternalCaCertSecret); err != nil {
return nil, err
}
// Security Context used by MinIO server
if tenant.Spec.Pools[0].SecurityContext != nil {
tenantSecurityContext = convertK8sSCToModelSC(tenant.Spec.Pools[0].SecurityContext)
}
return &models.TenantSecurityResponse{
AutoCert: tenant.AutoCert(),
CustomCertificates: &models.TenantSecurityResponseCustomCertificates{
Minio: minioExternalCertificates,
MinioCAs: minioExternalCaCertificates,
},
SecurityContext: tenantSecurityContext,
}, nil
}
@@ -906,6 +921,58 @@ func getUpdateTenantIdentityProviderResponse(session *models.Principal, params o
return nil
}
func getSetTenantAdministratorsResponse(session *models.Principal, params operator_api.SetTenantAdministratorsParams) *models.Error {
ctx, cancel := context.WithCancel(params.HTTPRequest.Context())
defer cancel()
opClientClientSet, err := cluster.OperatorClient(session.STSSessionToken)
if err != nil {
return restapi.ErrorWithContext(ctx, err)
}
// get Kubernetes Client
clientSet, err := cluster.K8sClient(session.STSSessionToken)
if err != nil {
return restapi.ErrorWithContext(ctx, err)
}
k8sClient := &k8sClient{
client: clientSet,
}
opClient := &operatorClient{
client: opClientClientSet,
}
minTenant, err := getTenant(ctx, opClient, params.Namespace, params.Tenant)
if err != nil {
return restapi.ErrorWithContext(ctx, err)
}
minTenant.EnsureDefaults()
svcURL := GetTenantServiceURL(minTenant)
// getTenantAdminClient will use all certificates under ~/.console/certs/CAs to trust the TLS connections with MinIO tenants
mAdmin, err := getTenantAdminClient(
ctx,
k8sClient,
minTenant,
svcURL,
)
if err != nil {
return restapi.ErrorWithContext(ctx, err)
}
// create a minioClient interface implementation
// defining the client to be used
adminClient := restapi.AdminClient{Client: mAdmin}
for _, user := range params.Body.UserDNS {
if err := restapi.SetPolicy(ctx, adminClient, "consoleAdmin", user, "user"); err != nil {
return restapi.ErrorWithContext(ctx, err)
}
}
for _, group := range params.Body.GroupDNS {
if err := restapi.SetPolicy(ctx, adminClient, "consoleAdmin", group, "group"); err != nil {
return restapi.ErrorWithContext(ctx, err)
}
}
return nil
}
func getTenantSecurityResponse(session *models.Principal, params operator_api.TenantSecurityParams) (*models.TenantSecurityResponse, *models.Error) {
ctx, cancel := context.WithCancel(params.HTTPRequest.Context())
defer cancel()
@@ -1026,6 +1093,12 @@ func updateTenantSecurity(ctx context.Context, operatorClient OperatorClientI, c
}
newMinIOExternalCaCertSecret = append(newMinIOExternalCaCertSecret, certificateSecrets...)
}
// set Security Context
var newTenantSecurityContext *corev1.PodSecurityContext
newTenantSecurityContext, _ = convertModelSCToK8sSC(params.Body.SecurityContext)
minInst.Spec.Pools[0].SecurityContext = newTenantSecurityContext
// Update External Certificates
minInst.Spec.ExternalCertSecret = newMinIOExternalCertSecret
minInst.Spec.ExternalCaCertSecret = newMinIOExternalCaCertSecret
@@ -1033,6 +1106,7 @@ func updateTenantSecurity(ctx context.Context, operatorClient OperatorClientI, c
if err != nil {
return err
}
// restart all MinIO pods at the same time
err = client.deletePodCollection(ctx, namespace, metav1.DeleteOptions{}, metav1.ListOptions{
LabelSelector: fmt.Sprintf("%s=%s", miniov2.TenantLabel, minInst.Name),
@@ -1357,7 +1431,7 @@ func getTenantUsageResponse(session *models.Principal, params operator_api.GetTe
return info, nil
}
// getTenantLogsResponse returns the logs of a tenant
// getTenantLogsResponse returns the Audit Log and Log DB configuration of a tenant
func getTenantLogsResponse(session *models.Principal, params operator_api.GetTenantLogsParams) (*models.TenantLogs, *models.Error) {
ctx, cancel := context.WithCancel(params.HTTPRequest.Context())
defer cancel()
@@ -1376,10 +1450,9 @@ func getTenantLogsResponse(session *models.Principal, params operator_api.GetTen
return nil, restapi.ErrorWithContext(ctx, err, restapi.ErrUnableToGetTenantLogs)
}
if minTenant.Spec.Log == nil {
retval := &models.TenantLogs{
return &models.TenantLogs{
Disabled: true,
}
return retval, nil
}, nil
}
annotations := []*models.Annotation{}
for k, v := range minTenant.Spec.Log.Annotations {
@@ -1393,11 +1466,9 @@ func getTenantLogsResponse(session *models.Principal, params operator_api.GetTen
for k, v := range minTenant.Spec.Log.NodeSelector {
nodeSelector = append(nodeSelector, &models.NodeSelector{Key: k, Value: v})
}
if minTenant.Spec.Log.Db == nil {
minTenant.Spec.Log.Db = &miniov2.LogDbConfig{}
}
dbAnnotations := []*models.Annotation{}
for k, v := range minTenant.Spec.Log.Db.Annotations {
dbAnnotations = append(dbAnnotations, &models.Annotation{Key: k, Value: v})
@@ -1410,23 +1481,35 @@ func getTenantLogsResponse(session *models.Principal, params operator_api.GetTen
for k, v := range minTenant.Spec.Log.Db.NodeSelector {
dbNodeSelector = append(dbNodeSelector, &models.NodeSelector{Key: k, Value: v})
}
var logSecurityContext *models.SecurityContext
var logDBSecurityContext *models.SecurityContext
if minTenant.Spec.Log.SecurityContext != nil {
logSecurityContext = convertK8sSCToModelSC(minTenant.Spec.Log.SecurityContext)
}
if minTenant.Spec.Log.Db.SecurityContext != nil {
logDBSecurityContext = convertK8sSCToModelSC(minTenant.Spec.Log.Db.SecurityContext)
}
if minTenant.Spec.Log.Audit == nil || minTenant.Spec.Log.Audit.DiskCapacityGB == nil {
minTenant.Spec.Log.Audit = &miniov2.AuditConfig{DiskCapacityGB: swag.Int(0)}
}
retval := &models.TenantLogs{
tenantLoggingConfiguration := &models.TenantLogs{
Image: minTenant.Spec.Log.Image,
DiskCapacityGB: fmt.Sprintf("%d", *minTenant.Spec.Log.Audit.DiskCapacityGB),
Annotations: annotations,
Labels: labels,
NodeSelector: nodeSelector,
ServiceAccountName: minTenant.Spec.Log.ServiceAccountName,
SecurityContext: logSecurityContext,
DbImage: minTenant.Spec.Log.Db.Image,
DbInitImage: minTenant.Spec.Log.Db.InitImage,
DbAnnotations: dbAnnotations,
DbLabels: dbLabels,
DbNodeSelector: dbNodeSelector,
DbServiceAccountName: minTenant.Spec.Log.Db.ServiceAccountName,
DbSecurityContext: logDBSecurityContext,
Disabled: false,
}
@@ -1434,6 +1517,7 @@ func getTenantLogsResponse(session *models.Principal, params operator_api.GetTen
var requestedMem string
var requestedDBCPU string
var requestedDBMem string
if minTenant.Spec.Log.Resources.Requests != nil {
requestedCPUQ := minTenant.Spec.Log.Resources.Requests["cpu"]
requestedCPU = strconv.FormatInt(requestedCPUQ.Value(), 10)
@@ -1445,15 +1529,15 @@ func getTenantLogsResponse(session *models.Principal, params operator_api.GetTen
requestedDBMemQ := minTenant.Spec.Log.Db.Resources.Requests["memory"]
requestedDBMem = strconv.FormatInt(requestedDBMemQ.Value(), 10)
retval.LogCPURequest = requestedCPU
retval.LogMemRequest = requestedMem
retval.LogDBCPURequest = requestedDBCPU
retval.LogDBMemRequest = requestedDBMem
tenantLoggingConfiguration.LogCPURequest = requestedCPU
tenantLoggingConfiguration.LogMemRequest = requestedMem
tenantLoggingConfiguration.LogDBCPURequest = requestedDBCPU
tenantLoggingConfiguration.LogDBMemRequest = requestedDBMem
}
return retval, nil
return tenantLoggingConfiguration, nil
}
// setTenantLogsResponse returns the logs of a tenant
// setTenantLogsResponse updates the Audit Log and Log DB configuration for the tenant
func setTenantLogsResponse(session *models.Principal, params operator_api.SetTenantLogsParams) (bool, *models.Error) {
ctx, cancel := context.WithCancel(params.HTTPRequest.Context())
defer cancel()
@@ -1473,44 +1557,54 @@ func setTenantLogsResponse(session *models.Principal, params operator_api.SetTen
}
labels := make(map[string]string)
for i := 0; i < len(params.Data.Labels); i++ {
if params.Data.Labels[i] != nil {
labels[params.Data.Labels[i].Key] = params.Data.Labels[i].Value
if params.Data.Labels != nil {
for i := 0; i < len(params.Data.Labels); i++ {
if params.Data.Labels[i] != nil {
labels[params.Data.Labels[i].Key] = params.Data.Labels[i].Value
}
}
minTenant.Spec.Log.Labels = labels
}
minTenant.Spec.Log.Labels = labels
annotations := make(map[string]string)
for i := 0; i < len(params.Data.Annotations); i++ {
if params.Data.Annotations[i] != nil {
annotations[params.Data.Annotations[i].Key] = params.Data.Annotations[i].Value
if params.Data.Annotations != nil {
annotations := make(map[string]string)
for i := 0; i < len(params.Data.Annotations); i++ {
if params.Data.Annotations[i] != nil {
annotations[params.Data.Annotations[i].Key] = params.Data.Annotations[i].Value
}
}
minTenant.Spec.Log.Annotations = annotations
}
minTenant.Spec.Log.Annotations = annotations
nodeSelector := make(map[string]string)
for i := 0; i < len(params.Data.NodeSelector); i++ {
if params.Data.NodeSelector[i] != nil {
nodeSelector[params.Data.NodeSelector[i].Key] = params.Data.NodeSelector[i].Value
if params.Data.NodeSelector != nil {
nodeSelector := make(map[string]string)
for i := 0; i < len(params.Data.NodeSelector); i++ {
if params.Data.NodeSelector[i] != nil {
nodeSelector[params.Data.NodeSelector[i].Key] = params.Data.NodeSelector[i].Value
}
}
minTenant.Spec.Log.NodeSelector = nodeSelector
}
minTenant.Spec.Log.NodeSelector = nodeSelector
logResourceRequest := make(corev1.ResourceList)
if reflect.TypeOf(params.Data.LogCPURequest).Kind() == reflect.String && params.Data.LogCPURequest != "0Gi" && params.Data.LogCPURequest != "" {
cpuQuantity, err := resource.ParseQuantity(params.Data.LogCPURequest)
if err != nil {
return false, restapi.ErrorWithContext(ctx, err)
if len(params.Data.LogCPURequest) > 0 {
if reflect.TypeOf(params.Data.LogCPURequest).Kind() == reflect.String && params.Data.LogCPURequest != "0Gi" && params.Data.LogCPURequest != "" {
cpuQuantity, err := resource.ParseQuantity(params.Data.LogCPURequest)
if err != nil {
return false, restapi.ErrorWithContext(ctx, err)
}
logResourceRequest["cpu"] = cpuQuantity
minTenant.Spec.Log.Resources.Requests = logResourceRequest
}
logResourceRequest["cpu"] = cpuQuantity
minTenant.Spec.Log.Resources.Requests = logResourceRequest
}
if reflect.TypeOf(params.Data.LogMemRequest).Kind() == reflect.String {
memQuantity, err := resource.ParseQuantity(params.Data.LogMemRequest)
if err != nil {
return false, restapi.ErrorWithContext(ctx, err)
}
if len(params.Data.LogMemRequest) > 0 {
if reflect.TypeOf(params.Data.LogMemRequest).Kind() == reflect.String && params.Data.LogMemRequest != "" {
memQuantity, err := resource.ParseQuantity(params.Data.LogMemRequest)
if err != nil {
return false, restapi.ErrorWithContext(ctx, err)
}
logResourceRequest["memory"] = memQuantity
minTenant.Spec.Log.Resources.Requests = logResourceRequest
logResourceRequest["memory"] = memQuantity
minTenant.Spec.Log.Resources.Requests = logResourceRequest
}
}
modified := false
@@ -1518,97 +1612,125 @@ func setTenantLogsResponse(session *models.Principal, params operator_api.SetTen
modified = true
}
dbLabels := make(map[string]string)
for i := 0; i < len(params.Data.DbLabels); i++ {
if params.Data.DbLabels[i] != nil {
dbLabels[params.Data.DbLabels[i].Key] = params.Data.DbLabels[i].Value
if params.Data.DbLabels != nil {
for i := 0; i < len(params.Data.DbLabels); i++ {
if params.Data.DbLabels[i] != nil {
dbLabels[params.Data.DbLabels[i].Key] = params.Data.DbLabels[i].Value
}
modified = true
}
modified = true
}
dbAnnotations := make(map[string]string)
for i := 0; i < len(params.Data.DbAnnotations); i++ {
if params.Data.DbAnnotations[i] != nil {
dbAnnotations[params.Data.DbAnnotations[i].Key] = params.Data.DbAnnotations[i].Value
if params.Data.DbAnnotations != nil {
for i := 0; i < len(params.Data.DbAnnotations); i++ {
if params.Data.DbAnnotations[i] != nil {
dbAnnotations[params.Data.DbAnnotations[i].Key] = params.Data.DbAnnotations[i].Value
}
modified = true
}
modified = true
}
dbNodeSelector := make(map[string]string)
for i := 0; i < len(params.Data.DbNodeSelector); i++ {
if params.Data.DbNodeSelector[i] != nil {
dbNodeSelector[params.Data.DbNodeSelector[i].Key] = params.Data.DbNodeSelector[i].Value
}
modified = true
}
logDBResourceRequest := make(corev1.ResourceList)
if reflect.TypeOf(params.Data.LogDBCPURequest).Kind() == reflect.String && params.Data.LogDBCPURequest != "0Gi" && params.Data.LogDBCPURequest != "" {
dbCPUQuantity, err := resource.ParseQuantity(params.Data.LogDBCPURequest)
if err != nil {
return false, restapi.ErrorWithContext(ctx, err)
}
logDBResourceRequest["cpu"] = dbCPUQuantity
minTenant.Spec.Log.Db.Resources.Requests = logDBResourceRequest
}
if reflect.TypeOf(params.Data.LogDBMemRequest).Kind() == reflect.String {
dbMemQuantity, err := resource.ParseQuantity(params.Data.LogDBMemRequest)
if err != nil {
return false, restapi.ErrorWithContext(ctx, err)
}
logDBResourceRequest["memory"] = dbMemQuantity
minTenant.Spec.Log.Db.Resources.Requests = logDBResourceRequest
}
minTenant.Spec.Log.Image = params.Data.Image
diskCapacityGB, err := strconv.Atoi(params.Data.DiskCapacityGB)
if err == nil {
if minTenant.Spec.Log.Audit != nil && minTenant.Spec.Log.Audit.DiskCapacityGB != nil {
*minTenant.Spec.Log.Audit.DiskCapacityGB = diskCapacityGB
} else {
minTenant.Spec.Log.Audit = &miniov2.AuditConfig{DiskCapacityGB: swag.Int(diskCapacityGB)}
}
}
minTenant.Spec.Log.ServiceAccountName = params.Data.ServiceAccountName
if params.Data.DbImage != "" || params.Data.DbServiceAccountName != "" {
modified = true
}
if modified {
if minTenant.Spec.Log.Db == nil {
// Default class name for Log search
diskSpaceFromAPI := int64(5) * humanize.GiByte // Default is 5Gi
logSearchStorageClass := "standard"
logSearchDiskSpace := resource.NewQuantity(diskSpaceFromAPI, resource.DecimalExponent)
minTenant.Spec.Log.Db = &miniov2.LogDbConfig{
VolumeClaimTemplate: &corev1.PersistentVolumeClaim{
ObjectMeta: metav1.ObjectMeta{
Name: params.Tenant + "-log",
},
Spec: corev1.PersistentVolumeClaimSpec{
AccessModes: []corev1.PersistentVolumeAccessMode{
corev1.ReadWriteOnce,
},
Resources: corev1.ResourceRequirements{
Requests: corev1.ResourceList{
corev1.ResourceStorage: *logSearchDiskSpace,
},
},
StorageClassName: &logSearchStorageClass,
},
},
Labels: dbLabels,
Annotations: dbAnnotations,
NodeSelector: dbNodeSelector,
Image: params.Data.DbImage,
ServiceAccountName: params.Data.DbServiceAccountName,
Resources: corev1.ResourceRequirements{
Requests: minTenant.Spec.Log.Db.Resources.Requests,
},
if params.Data.DbNodeSelector != nil {
for i := 0; i < len(params.Data.DbNodeSelector); i++ {
if params.Data.DbNodeSelector[i] != nil {
dbNodeSelector[params.Data.DbNodeSelector[i].Key] = params.Data.DbNodeSelector[i].Value
}
modified = true
}
}
logDBResourceRequest := make(corev1.ResourceList)
if len(params.Data.LogDBCPURequest) > 0 {
if reflect.TypeOf(params.Data.LogDBCPURequest).Kind() == reflect.String && params.Data.LogDBCPURequest != "0Gi" && params.Data.LogDBCPURequest != "" {
dbCPUQuantity, err := resource.ParseQuantity(params.Data.LogDBCPURequest)
if err != nil {
return false, restapi.ErrorWithContext(ctx, err)
}
logDBResourceRequest["cpu"] = dbCPUQuantity
minTenant.Spec.Log.Db.Resources.Requests = logDBResourceRequest
}
}
if len(params.Data.LogDBMemRequest) > 0 {
if reflect.TypeOf(params.Data.LogDBMemRequest).Kind() == reflect.String && params.Data.LogDBMemRequest != "" {
dbMemQuantity, err := resource.ParseQuantity(params.Data.LogDBMemRequest)
if err != nil {
return false, restapi.ErrorWithContext(ctx, err)
}
logDBResourceRequest["memory"] = dbMemQuantity
minTenant.Spec.Log.Db.Resources.Requests = logDBResourceRequest
}
}
if len(params.Data.Image) > 0 {
minTenant.Spec.Log.Image = params.Data.Image
}
if params.Data.SecurityContext != nil {
minTenant.Spec.Log.SecurityContext, err = convertModelSCToK8sSC(params.Data.SecurityContext)
if err != nil {
return false, restapi.ErrorWithContext(ctx, err)
}
}
if len(params.Data.DiskCapacityGB) > 0 {
diskCapacityGB, err := strconv.Atoi(params.Data.DiskCapacityGB)
if err == nil {
if minTenant.Spec.Log.Audit != nil && minTenant.Spec.Log.Audit.DiskCapacityGB != nil {
*minTenant.Spec.Log.Audit.DiskCapacityGB = diskCapacityGB
} else {
minTenant.Spec.Log.Audit = &miniov2.AuditConfig{DiskCapacityGB: swag.Int(diskCapacityGB)}
}
}
}
if len(params.Data.ServiceAccountName) > 0 {
minTenant.Spec.Log.ServiceAccountName = params.Data.ServiceAccountName
}
if params.Data.DbLabels != nil {
if params.Data.DbImage != "" || params.Data.DbServiceAccountName != "" {
modified = true
}
if modified {
if minTenant.Spec.Log.Db == nil {
// Default class name for Log search
diskSpaceFromAPI := int64(5) * humanize.GiByte // Default is 5Gi
logSearchStorageClass := "standard"
logSearchDiskSpace := resource.NewQuantity(diskSpaceFromAPI, resource.DecimalExponent)
minTenant.Spec.Log.Db = &miniov2.LogDbConfig{
VolumeClaimTemplate: &corev1.PersistentVolumeClaim{
ObjectMeta: metav1.ObjectMeta{
Name: params.Tenant + "-log",
},
Spec: corev1.PersistentVolumeClaimSpec{
AccessModes: []corev1.PersistentVolumeAccessMode{
corev1.ReadWriteOnce,
},
Resources: corev1.ResourceRequirements{
Requests: corev1.ResourceList{
corev1.ResourceStorage: *logSearchDiskSpace,
},
},
StorageClassName: &logSearchStorageClass,
},
},
Labels: dbLabels,
Annotations: dbAnnotations,
NodeSelector: dbNodeSelector,
Image: params.Data.DbImage,
ServiceAccountName: params.Data.DbServiceAccountName,
Resources: corev1.ResourceRequirements{
Requests: minTenant.Spec.Log.Db.Resources.Requests,
},
}
} else {
minTenant.Spec.Log.Db.Labels = dbLabels
minTenant.Spec.Log.Db.Annotations = dbAnnotations
minTenant.Spec.Log.Db.NodeSelector = dbNodeSelector
minTenant.Spec.Log.Db.Image = params.Data.DbImage
minTenant.Spec.Log.Db.ServiceAccountName = params.Data.DbServiceAccountName
minTenant.Spec.Log.Db.SecurityContext, err = convertModelSCToK8sSC(params.Data.DbSecurityContext)
if err != nil {
return false, restapi.ErrorWithContext(ctx, err)
}
}
} else {
minTenant.Spec.Log.Db.Labels = dbLabels
minTenant.Spec.Log.Db.Annotations = dbAnnotations
minTenant.Spec.Log.Db.NodeSelector = dbNodeSelector
minTenant.Spec.Log.Db.Image = params.Data.DbImage
minTenant.Spec.Log.Db.ServiceAccountName = params.Data.DbServiceAccountName
}
}
@@ -1638,7 +1760,6 @@ func enableTenantLoggingResponse(session *models.Principal, params operator_api.
return false, restapi.ErrorWithContext(ctx, err, restapi.ErrUnableToGetTenantUsage)
}
minTenant.EnsureDefaults()
// Default class name for Log search
diskSpaceFromAPI := int64(5) * humanize.GiByte // Default is 5Gi
logSearchStorageClass := "standard"
@@ -2093,11 +2214,10 @@ func getTenantMonitoringResponse(session *models.Principal, params operator_api.
client: opClientClientSet,
}
minInst, err := opClient.TenantGet(ctx, params.Namespace, params.Tenant, metav1.GetOptions{})
minInst, err := getTenant(ctx, opClient, params.Namespace, params.Tenant)
if err != nil {
return nil, restapi.ErrorWithContext(ctx, err)
}
monitoringInfo := &models.TenantMonitoringInfo{}
if minInst.Spec.Prometheus != nil {
@@ -2168,7 +2288,9 @@ func getTenantMonitoringResponse(session *models.Principal, params operator_api.
if len(minInst.Spec.Prometheus.SideCarImage) != 0 {
monitoringInfo.SidecarImage = minInst.Spec.Prometheus.SideCarImage
}
if minInst.Spec.Prometheus.SecurityContext != nil {
monitoringInfo.SecurityContext = convertK8sSCToModelSC(minInst.Spec.Prometheus.SecurityContext)
}
return monitoringInfo, nil
}
@@ -2262,12 +2384,16 @@ func setTenantMonitoringResponse(session *models.Principal, params operator_api.
if err == nil {
*minTenant.Spec.Prometheus.DiskCapacityDB = diskCapacityGB
}
minTenant.Spec.Prometheus.ServiceAccountName = params.Data.ServiceAccountName
minTenant.Spec.Prometheus.SecurityContext, err = convertModelSCToK8sSC(params.Data.SecurityContext)
if err != nil {
return false, restapi.ErrorWithContext(ctx, err)
}
_, err = opClient.TenantUpdate(ctx, minTenant, metav1.UpdateOptions{})
if err != nil {
return false, restapi.ErrorWithContext(ctx, err)
}
return true, nil
}

View File

@@ -25,6 +25,22 @@ import (
"github.com/minio/pkg/env"
)
// ProviderConfig - OpenID IDP Configuration for console.
type ProviderConfig struct {
URL string
DisplayName string // user-provided - can be empty
ClientID, ClientSecret string
HMACSalt, HMACPassphrase string
Scopes string
Userinfo bool
RedirectCallbackDynamic bool
RedirectCallback string
}
type OpenIDPCfg map[string]ProviderConfig
var DefaultIDPConfig = "_"
func GetSTSEndpoint() string {
return strings.TrimSpace(env.Get(ConsoleMinIOServer, "http://localhost:9000"))
}

View File

@@ -206,6 +206,79 @@ func NewOauth2ProviderClient(scopes []string, r *http.Request, httpClient *http.
return client, nil
}
var defaultScopes = []string{"openid", "profile", "email"}
// NewOauth2ProviderClient instantiates a new oauth2 client using the
// `OpenIDPCfg` configuration struct. It returns a *Provider object that
// contains the necessary configuration to initiate an oauth2 authentication
// flow.
//
// We only support Authentication with the Authorization Code Flow - spec:
// https://openid.net/specs/openid-connect-core-1_0.html#CodeFlowAuth
func (o OpenIDPCfg) NewOauth2ProviderClient(name string, scopes []string, r *http.Request, httpClient *http.Client) (*Provider, error) {
ddoc, err := parseDiscoveryDoc(o[name].URL, httpClient)
if err != nil {
return nil, err
}
supportedResponseTypes := set.NewStringSet()
for _, responseType := range ddoc.ResponseTypesSupported {
// FIXME: ResponseTypesSupported is a JSON array of strings - it
// may not actually have strings with spaces inside them -
// making the following code unnecessary.
for _, s := range strings.Fields(responseType) {
supportedResponseTypes.Add(s)
}
}
isSupported := requiredResponseTypes.Difference(supportedResponseTypes).IsEmpty()
if !isSupported {
return nil, fmt.Errorf("expected 'code' response type - got %s, login not allowed", ddoc.ResponseTypesSupported)
}
// If provided scopes are empty we use the user configured list or a default
// list.
if len(scopes) == 0 {
scopesTmp := strings.Split(o[name].Scopes, ",")
for _, s := range scopesTmp {
w := strings.TrimSpace(s)
if w != "" {
scopes = append(scopes, w)
}
}
if len(scopes) == 0 {
scopes = defaultScopes
}
}
redirectURL := o[name].RedirectCallback
if o[name].RedirectCallbackDynamic {
// dynamic redirect if set, will generate redirect URLs
// dynamically based on incoming requests.
redirectURL = getLoginCallbackURL(r)
}
// add "openid" scope always.
scopes = append(scopes, "openid")
client := new(Provider)
client.oauth2Config = &xoauth2.Config{
ClientID: o[name].ClientID,
ClientSecret: o[name].ClientSecret,
RedirectURL: redirectURL,
Endpoint: oauth2.Endpoint{
AuthURL: ddoc.AuthEndpoint,
TokenURL: ddoc.TokenEndpoint,
},
Scopes: scopes,
}
client.ClientID = o[name].ClientID
client.UserInfo = o[name].Userinfo
client.provHTTPClient = httpClient
return client, nil
}
type User struct {
AppMetadata map[string]interface{} `json:"app_metadata"`
Blocked bool `json:"blocked"`

View File

@@ -67,11 +67,18 @@ type TokenClaims struct {
STSSessionToken string `json:"stsSessionToken,omitempty"`
AccountAccessKey string `json:"accountAccessKey,omitempty"`
HideMenu bool `json:"hm,omitempty"`
ObjectBrowser bool `json:"ob,omitempty"`
}
// STSClaims claims struct for STS Token
type STSClaims struct {
AccessKey string `json:"accessKey,omitempty"`
}
// SessionFeatures represents features stored in the session
type SessionFeatures struct {
HideMenu bool
HideMenu bool
ObjectBrowser bool
}
// SessionTokenAuthenticate takes a session token, decode it, extract claims and validate the signature
@@ -115,6 +122,7 @@ func NewEncryptedTokenForClient(credentials *credentials.Value, accountAccessKey
}
if features != nil {
tokenClaims.HideMenu = features.HideMenu
tokenClaims.ObjectBrowser = features.ObjectBrowser
}
encryptedClaims, err := encryptClaims(tokenClaims)
if err != nil {

View File

@@ -27,4 +27,5 @@ var (
CommitID = "(dev)"
// ShortCommitID - first 12 characters from CommitID.
ShortCommitID = "(dev)"
MPSecret = "(dev)"
)

View File

@@ -165,3 +165,13 @@ func ParseLicense(client http.ClientI, license string) (*licverifier.LicenseInfo
return licenseInfo, nil
}
func GetAPIKey(client http.ClientI, token string) (string, error) {
resp, err := subnetGetReq(client, subnetAPIKeyURL(), subnetAuthHeaders(token))
if err != nil {
return "", err
}
respJSON := gjson.Parse(resp)
apiKey := respJSON.Get("api_key").String()
return apiKey, nil
}

View File

@@ -56,6 +56,10 @@ func subnetMFAURL() string {
return subnetBaseURL() + "/api/auth/mfa-login"
}
func subnetAPIKeyURL() string {
return subnetBaseURL() + "/api/auth/api-key"
}
func GenerateRegToken(clusterRegInfo mc.ClusterRegistrationInfo) (string, error) {
token, e := json.Marshal(clusterRegInfo)
if e != nil {

View File

@@ -6,3 +6,9 @@ build-static:
test-warnings:
./check-warnings.sh
test-prettier:
./check-prettier.sh
prettify:
yarn prettier --write . --loglevel warn

View File

@@ -1,299 +1,287 @@
{
"files": {
"main.css": "./static/css/main.90d417ae.css",
"main.js": "./static/js/main.efb70fdf.js",
"static/js/2483.fc3f6e02.chunk.js": "./static/js/2483.fc3f6e02.chunk.js",
"static/js/6914.c9671304.chunk.js": "./static/js/6914.c9671304.chunk.js",
"static/js/4209.1785b76b.chunk.js": "./static/js/4209.1785b76b.chunk.js",
"static/js/1829.082a42b0.chunk.js": "./static/js/1829.082a42b0.chunk.js",
"static/js/4455.62d5739d.chunk.js": "./static/js/4455.62d5739d.chunk.js",
"static/js/5088.43224960.chunk.js": "./static/js/5088.43224960.chunk.js",
"static/js/5140.e9043b63.chunk.js": "./static/js/5140.e9043b63.chunk.js",
"static/js/5997.78c91d41.chunk.js": "./static/js/5997.78c91d41.chunk.js",
"static/js/3176.43953acc.chunk.js": "./static/js/3176.43953acc.chunk.js",
"static/js/6137.7c3483b1.chunk.js": "./static/js/6137.7c3483b1.chunk.js",
"static/js/7045.ca5a5aae.chunk.js": "./static/js/7045.ca5a5aae.chunk.js",
"static/js/9251.6b7b3ee3.chunk.js": "./static/js/9251.6b7b3ee3.chunk.js",
"static/js/2338.edf0a361.chunk.js": "./static/js/2338.edf0a361.chunk.js",
"static/js/4335.8f37144a.chunk.js": "./static/js/4335.8f37144a.chunk.js",
"static/js/3061.5a2c926b.chunk.js": "./static/js/3061.5a2c926b.chunk.js",
"static/js/6763.e408c6ad.chunk.js": "./static/js/6763.e408c6ad.chunk.js",
"static/js/3543.e36f8103.chunk.js": "./static/js/3543.e36f8103.chunk.js",
"static/js/4061.18b19aa0.chunk.js": "./static/js/4061.18b19aa0.chunk.js",
"static/js/2249.d85d7c19.chunk.js": "./static/js/2249.d85d7c19.chunk.js",
"main.js": "./static/js/main.ccc73c66.js",
"static/js/6914.ed2f1662.chunk.js": "./static/js/6914.ed2f1662.chunk.js",
"static/js/4209.05b25520.chunk.js": "./static/js/4209.05b25520.chunk.js",
"static/js/1829.223fb198.chunk.js": "./static/js/1829.223fb198.chunk.js",
"static/js/4455.596f5a0d.chunk.js": "./static/js/4455.596f5a0d.chunk.js",
"static/js/5088.7692271b.chunk.js": "./static/js/5088.7692271b.chunk.js",
"static/js/5140.b1dd0e23.chunk.js": "./static/js/5140.b1dd0e23.chunk.js",
"static/js/1260.5eb8500b.chunk.js": "./static/js/1260.5eb8500b.chunk.js",
"static/js/3176.121f3468.chunk.js": "./static/js/3176.121f3468.chunk.js",
"static/js/6137.2c486126.chunk.js": "./static/js/6137.2c486126.chunk.js",
"static/js/7045.bc049940.chunk.js": "./static/js/7045.bc049940.chunk.js",
"static/js/9251.4a7c5817.chunk.js": "./static/js/9251.4a7c5817.chunk.js",
"static/js/2338.56b092f8.chunk.js": "./static/js/2338.56b092f8.chunk.js",
"static/js/4335.7187f6a6.chunk.js": "./static/js/4335.7187f6a6.chunk.js",
"static/js/3061.bb1cfd70.chunk.js": "./static/js/3061.bb1cfd70.chunk.js",
"static/js/6763.16fe0032.chunk.js": "./static/js/6763.16fe0032.chunk.js",
"static/js/4575.5b10a969.chunk.js": "./static/js/4575.5b10a969.chunk.js",
"static/js/4061.1e4b2694.chunk.js": "./static/js/4061.1e4b2694.chunk.js",
"static/js/5112.30236fa2.chunk.js": "./static/js/5112.30236fa2.chunk.js",
"static/js/9611.c217768e.chunk.js": "./static/js/9611.c217768e.chunk.js",
"static/js/2637.4946ae96.chunk.js": "./static/js/2637.4946ae96.chunk.js",
"static/css/5503.d0badeac.chunk.css": "./static/css/5503.d0badeac.chunk.css",
"static/js/5503.5d36120f.chunk.js": "./static/js/5503.5d36120f.chunk.js",
"static/js/5926.1ba3b5eb.chunk.js": "./static/js/5926.1ba3b5eb.chunk.js",
"static/js/701.1602597e.chunk.js": "./static/js/701.1602597e.chunk.js",
"static/js/7821.060b10cd.chunk.js": "./static/js/7821.060b10cd.chunk.js",
"static/css/2850.d0badeac.chunk.css": "./static/css/2850.d0badeac.chunk.css",
"static/js/2850.e1485c70.chunk.js": "./static/js/2850.e1485c70.chunk.js",
"static/js/1182.f9bcec67.chunk.js": "./static/js/1182.f9bcec67.chunk.js",
"static/css/343.d0badeac.chunk.css": "./static/css/343.d0badeac.chunk.css",
"static/js/343.9bef5ddd.chunk.js": "./static/js/343.9bef5ddd.chunk.js",
"static/css/1199.d0badeac.chunk.css": "./static/css/1199.d0badeac.chunk.css",
"static/js/1199.84ef2065.chunk.js": "./static/js/1199.84ef2065.chunk.js",
"static/css/8614.d0badeac.chunk.css": "./static/css/8614.d0badeac.chunk.css",
"static/js/8614.e007e045.chunk.js": "./static/js/8614.e007e045.chunk.js",
"static/css/1395.d0badeac.chunk.css": "./static/css/1395.d0badeac.chunk.css",
"static/js/1395.f8a4acb9.chunk.js": "./static/js/1395.f8a4acb9.chunk.js",
"static/js/2555.bce2711c.chunk.js": "./static/js/2555.bce2711c.chunk.js",
"static/js/7585.23c3cb6d.chunk.js": "./static/js/7585.23c3cb6d.chunk.js",
"static/js/4847.7c89dc57.chunk.js": "./static/js/4847.7c89dc57.chunk.js",
"static/js/4653.04094e61.chunk.js": "./static/js/4653.04094e61.chunk.js",
"static/js/692.c8593ab8.chunk.js": "./static/js/692.c8593ab8.chunk.js",
"static/js/8626.7ac959a6.chunk.js": "./static/js/8626.7ac959a6.chunk.js",
"static/js/736.30689e5a.chunk.js": "./static/js/736.30689e5a.chunk.js",
"static/js/6577.451bf5a2.chunk.js": "./static/js/6577.451bf5a2.chunk.js",
"static/js/9561.2fa4c7be.chunk.js": "./static/js/9561.2fa4c7be.chunk.js",
"static/js/4394.9b95db79.chunk.js": "./static/js/4394.9b95db79.chunk.js",
"static/js/2637.97fe472e.chunk.js": "./static/js/2637.97fe472e.chunk.js",
"static/css/5503.90c9cdc7.chunk.css": "./static/css/5503.90c9cdc7.chunk.css",
"static/js/5503.79a2f464.chunk.js": "./static/js/5503.79a2f464.chunk.js",
"static/js/5926.c0387455.chunk.js": "./static/js/5926.c0387455.chunk.js",
"static/js/701.05206868.chunk.js": "./static/js/701.05206868.chunk.js",
"static/js/7821.bda18452.chunk.js": "./static/js/7821.bda18452.chunk.js",
"static/css/2850.90c9cdc7.chunk.css": "./static/css/2850.90c9cdc7.chunk.css",
"static/js/2850.92a58310.chunk.js": "./static/js/2850.92a58310.chunk.js",
"static/js/1182.264ec55e.chunk.js": "./static/js/1182.264ec55e.chunk.js",
"static/css/343.90c9cdc7.chunk.css": "./static/css/343.90c9cdc7.chunk.css",
"static/js/343.ce17ca62.chunk.js": "./static/js/343.ce17ca62.chunk.js",
"static/css/1199.90c9cdc7.chunk.css": "./static/css/1199.90c9cdc7.chunk.css",
"static/js/1199.ae4c29a1.chunk.js": "./static/js/1199.ae4c29a1.chunk.js",
"static/css/5517.90c9cdc7.chunk.css": "./static/css/5517.90c9cdc7.chunk.css",
"static/js/5517.84805a10.chunk.js": "./static/js/5517.84805a10.chunk.js",
"static/js/2555.247780d4.chunk.js": "./static/js/2555.247780d4.chunk.js",
"static/js/7585.90e7c2ed.chunk.js": "./static/js/7585.90e7c2ed.chunk.js",
"static/js/4902.8927358d.chunk.js": "./static/js/4902.8927358d.chunk.js",
"static/js/7847.6c81d37f.chunk.js": "./static/js/7847.6c81d37f.chunk.js",
"static/js/4653.0d13044c.chunk.js": "./static/js/4653.0d13044c.chunk.js",
"static/js/692.c28b1b9b.chunk.js": "./static/js/692.c28b1b9b.chunk.js",
"static/js/8626.58e34c6f.chunk.js": "./static/js/8626.58e34c6f.chunk.js",
"static/js/736.66a05831.chunk.js": "./static/js/736.66a05831.chunk.js",
"static/js/6577.06d06144.chunk.js": "./static/js/6577.06d06144.chunk.js",
"static/js/9561.bf1e32db.chunk.js": "./static/js/9561.bf1e32db.chunk.js",
"static/js/6860.f8ff9efd.chunk.js": "./static/js/6860.f8ff9efd.chunk.js",
"static/js/4781.f4794912.chunk.js": "./static/js/4781.f4794912.chunk.js",
"static/js/9478.dca1d314.chunk.js": "./static/js/9478.dca1d314.chunk.js",
"static/js/7164.3762a0c0.chunk.js": "./static/js/7164.3762a0c0.chunk.js",
"static/js/4414.d499a576.chunk.js": "./static/js/4414.d499a576.chunk.js",
"static/js/7798.4523255f.chunk.js": "./static/js/7798.4523255f.chunk.js",
"static/js/8833.435c57c9.chunk.js": "./static/js/8833.435c57c9.chunk.js",
"static/js/471.468250ea.chunk.js": "./static/js/471.468250ea.chunk.js",
"static/js/483.96dc1806.chunk.js": "./static/js/483.96dc1806.chunk.js",
"static/js/9467.89303883.chunk.js": "./static/js/9467.89303883.chunk.js",
"static/js/6895.a780402b.chunk.js": "./static/js/6895.a780402b.chunk.js",
"static/js/7925.17b70ce9.chunk.js": "./static/js/7925.17b70ce9.chunk.js",
"static/js/6331.4b9c378c.chunk.js": "./static/js/6331.4b9c378c.chunk.js",
"static/js/4133.e423ad64.chunk.js": "./static/js/4133.e423ad64.chunk.js",
"static/css/1367.d0badeac.chunk.css": "./static/css/1367.d0badeac.chunk.css",
"static/js/1367.570f471e.chunk.js": "./static/js/1367.570f471e.chunk.js",
"static/js/3956.04add457.chunk.js": "./static/js/3956.04add457.chunk.js",
"static/js/9221.74babab3.chunk.js": "./static/js/9221.74babab3.chunk.js",
"static/js/8896.a985f858.chunk.js": "./static/js/8896.a985f858.chunk.js",
"static/js/9134.9bb207a3.chunk.js": "./static/js/9134.9bb207a3.chunk.js",
"static/css/1268.d0badeac.chunk.css": "./static/css/1268.d0badeac.chunk.css",
"static/js/1268.444486ab.chunk.js": "./static/js/1268.444486ab.chunk.js",
"static/js/1030.d7679dcf.chunk.js": "./static/js/1030.d7679dcf.chunk.js",
"static/js/9145.d907d493.chunk.js": "./static/js/9145.d907d493.chunk.js",
"static/js/1379.ed19d5b2.chunk.js": "./static/js/1379.ed19d5b2.chunk.js",
"static/js/1501.82aa601c.chunk.js": "./static/js/1501.82aa601c.chunk.js",
"static/js/9605.0d9d8909.chunk.js": "./static/js/9605.0d9d8909.chunk.js",
"static/js/426.31bab58a.chunk.js": "./static/js/426.31bab58a.chunk.js",
"static/js/4298.cc4b772e.chunk.js": "./static/js/4298.cc4b772e.chunk.js",
"static/js/2878.f17e395f.chunk.js": "./static/js/2878.f17e395f.chunk.js",
"static/js/8495.71a61743.chunk.js": "./static/js/8495.71a61743.chunk.js",
"static/js/4934.064b787d.chunk.js": "./static/js/4934.064b787d.chunk.js",
"static/js/9942.51a9de47.chunk.js": "./static/js/9942.51a9de47.chunk.js",
"static/js/7021.148329a1.chunk.js": "./static/js/7021.148329a1.chunk.js",
"static/js/2684.ff523cc8.chunk.js": "./static/js/2684.ff523cc8.chunk.js",
"static/js/6683.ee501f75.chunk.js": "./static/js/6683.ee501f75.chunk.js",
"static/js/8350.8858e924.chunk.js": "./static/js/8350.8858e924.chunk.js",
"static/js/4873.ab307a49.chunk.js": "./static/js/4873.ab307a49.chunk.js",
"static/js/9449.27ca290f.chunk.js": "./static/js/9449.27ca290f.chunk.js",
"static/js/7659.425b0e4f.chunk.js": "./static/js/7659.425b0e4f.chunk.js",
"static/js/9968.10689a81.chunk.js": "./static/js/9968.10689a81.chunk.js",
"static/js/2180.d8b0a783.chunk.js": "./static/js/2180.d8b0a783.chunk.js",
"static/js/8253.78199b7c.chunk.js": "./static/js/8253.78199b7c.chunk.js",
"static/js/3328.d653fd74.chunk.js": "./static/js/3328.d653fd74.chunk.js",
"static/js/1440.e5771fc7.chunk.js": "./static/js/1440.e5771fc7.chunk.js",
"static/js/9179.4664c118.chunk.js": "./static/js/9179.4664c118.chunk.js",
"static/js/51.fe31a1b5.chunk.js": "./static/js/51.fe31a1b5.chunk.js",
"static/js/711.29c4e77f.chunk.js": "./static/js/711.29c4e77f.chunk.js",
"static/js/6901.0d9858c2.chunk.js": "./static/js/6901.0d9858c2.chunk.js",
"static/js/2185.a4530a2b.chunk.js": "./static/js/2185.a4530a2b.chunk.js",
"static/js/312.b28428a0.chunk.js": "./static/js/312.b28428a0.chunk.js",
"static/js/2112.d99282a3.chunk.js": "./static/js/2112.d99282a3.chunk.js",
"static/js/4619.774f2ac4.chunk.js": "./static/js/4619.774f2ac4.chunk.js",
"static/js/8990.1d656f02.chunk.js": "./static/js/8990.1d656f02.chunk.js",
"static/js/8455.c317ba9a.chunk.js": "./static/js/8455.c317ba9a.chunk.js",
"static/css/1913.d0badeac.chunk.css": "./static/css/1913.d0badeac.chunk.css",
"static/js/1913.cea66f73.chunk.js": "./static/js/1913.cea66f73.chunk.js",
"static/js/1604.c298cecf.chunk.js": "./static/js/1604.c298cecf.chunk.js",
"static/js/8391.024d90c0.chunk.js": "./static/js/8391.024d90c0.chunk.js",
"static/js/402.aec3e2df.chunk.js": "./static/js/402.aec3e2df.chunk.js",
"static/js/1705.58e59f26.chunk.js": "./static/js/1705.58e59f26.chunk.js",
"static/js/1581.b3df67cf.chunk.js": "./static/js/1581.b3df67cf.chunk.js",
"static/js/455.13bb7aa6.chunk.js": "./static/js/455.13bb7aa6.chunk.js",
"static/js/2661.10751b4b.chunk.js": "./static/js/2661.10751b4b.chunk.js",
"static/js/889.2a763545.chunk.js": "./static/js/889.2a763545.chunk.js",
"static/js/9088.8b721a73.chunk.js": "./static/js/9088.8b721a73.chunk.js",
"static/js/247.b749bae6.chunk.js": "./static/js/247.b749bae6.chunk.js",
"static/js/2763.700b8a36.chunk.js": "./static/js/2763.700b8a36.chunk.js",
"static/js/4414.34edf059.chunk.js": "./static/js/4414.34edf059.chunk.js",
"static/js/7798.b974925d.chunk.js": "./static/js/7798.b974925d.chunk.js",
"static/js/8833.8e4bf585.chunk.js": "./static/js/8833.8e4bf585.chunk.js",
"static/js/9388.20842728.chunk.js": "./static/js/9388.20842728.chunk.js",
"static/js/483.ef8155e7.chunk.js": "./static/js/483.ef8155e7.chunk.js",
"static/js/9467.e157f032.chunk.js": "./static/js/9467.e157f032.chunk.js",
"static/js/6895.5d78f23b.chunk.js": "./static/js/6895.5d78f23b.chunk.js",
"static/js/1379.7e93fe73.chunk.js": "./static/js/1379.7e93fe73.chunk.js",
"static/js/6331.9d5ff423.chunk.js": "./static/js/6331.9d5ff423.chunk.js",
"static/js/4133.45077897.chunk.js": "./static/js/4133.45077897.chunk.js",
"static/css/1367.90c9cdc7.chunk.css": "./static/css/1367.90c9cdc7.chunk.css",
"static/js/1367.79a7a1e1.chunk.js": "./static/js/1367.79a7a1e1.chunk.js",
"static/js/3956.d3b4cd02.chunk.js": "./static/js/3956.d3b4cd02.chunk.js",
"static/js/9221.14d6096a.chunk.js": "./static/js/9221.14d6096a.chunk.js",
"static/js/8896.86116952.chunk.js": "./static/js/8896.86116952.chunk.js",
"static/js/9134.3cd624c6.chunk.js": "./static/js/9134.3cd624c6.chunk.js",
"static/css/1268.90c9cdc7.chunk.css": "./static/css/1268.90c9cdc7.chunk.css",
"static/js/1268.cb6b69cf.chunk.js": "./static/js/1268.cb6b69cf.chunk.js",
"static/js/1030.e86b3822.chunk.js": "./static/js/1030.e86b3822.chunk.js",
"static/js/9145.82dff7c3.chunk.js": "./static/js/9145.82dff7c3.chunk.js",
"static/js/8998.9a18741c.chunk.js": "./static/js/8998.9a18741c.chunk.js",
"static/js/1501.3b54336e.chunk.js": "./static/js/1501.3b54336e.chunk.js",
"static/js/7770.5dad74f3.chunk.js": "./static/js/7770.5dad74f3.chunk.js",
"static/js/426.9fd80f88.chunk.js": "./static/js/426.9fd80f88.chunk.js",
"static/js/4298.e8216a7e.chunk.js": "./static/js/4298.e8216a7e.chunk.js",
"static/js/2878.caa1771d.chunk.js": "./static/js/2878.caa1771d.chunk.js",
"static/js/8495.b1689c2d.chunk.js": "./static/js/8495.b1689c2d.chunk.js",
"static/js/4934.72071d47.chunk.js": "./static/js/4934.72071d47.chunk.js",
"static/js/9942.406de82c.chunk.js": "./static/js/9942.406de82c.chunk.js",
"static/js/7021.2df7e2e0.chunk.js": "./static/js/7021.2df7e2e0.chunk.js",
"static/js/2684.52b792c0.chunk.js": "./static/js/2684.52b792c0.chunk.js",
"static/js/6683.993a0cfc.chunk.js": "./static/js/6683.993a0cfc.chunk.js",
"static/js/8350.ee721e94.chunk.js": "./static/js/8350.ee721e94.chunk.js",
"static/js/4873.6fb2072e.chunk.js": "./static/js/4873.6fb2072e.chunk.js",
"static/js/5367.991f75c4.chunk.js": "./static/js/5367.991f75c4.chunk.js",
"static/js/5223.750c796e.chunk.js": "./static/js/5223.750c796e.chunk.js",
"static/js/7659.8b358177.chunk.js": "./static/js/7659.8b358177.chunk.js",
"static/js/9968.14f204ee.chunk.js": "./static/js/9968.14f204ee.chunk.js",
"static/js/2180.03cd0c4b.chunk.js": "./static/js/2180.03cd0c4b.chunk.js",
"static/js/8253.ec0f3d9f.chunk.js": "./static/js/8253.ec0f3d9f.chunk.js",
"static/js/3328.c7470c38.chunk.js": "./static/js/3328.c7470c38.chunk.js",
"static/js/1440.b9a2f19f.chunk.js": "./static/js/1440.b9a2f19f.chunk.js",
"static/js/9179.3874e070.chunk.js": "./static/js/9179.3874e070.chunk.js",
"static/js/51.f85def1c.chunk.js": "./static/js/51.f85def1c.chunk.js",
"static/js/711.be9f8284.chunk.js": "./static/js/711.be9f8284.chunk.js",
"static/js/6901.5afa1e6f.chunk.js": "./static/js/6901.5afa1e6f.chunk.js",
"static/js/2185.12707550.chunk.js": "./static/js/2185.12707550.chunk.js",
"static/js/312.cd77f5db.chunk.js": "./static/js/312.cd77f5db.chunk.js",
"static/js/2112.e0047ff5.chunk.js": "./static/js/2112.e0047ff5.chunk.js",
"static/js/4619.8d9ee17c.chunk.js": "./static/js/4619.8d9ee17c.chunk.js",
"static/js/8990.194642a8.chunk.js": "./static/js/8990.194642a8.chunk.js",
"static/js/8455.6f71a45b.chunk.js": "./static/js/8455.6f71a45b.chunk.js",
"static/css/1913.90c9cdc7.chunk.css": "./static/css/1913.90c9cdc7.chunk.css",
"static/js/1913.549c180b.chunk.js": "./static/js/1913.549c180b.chunk.js",
"static/js/1604.25690eb1.chunk.js": "./static/js/1604.25690eb1.chunk.js",
"static/js/8391.968204ad.chunk.js": "./static/js/8391.968204ad.chunk.js",
"static/js/402.5c660ae6.chunk.js": "./static/js/402.5c660ae6.chunk.js",
"static/js/1705.32ce00fc.chunk.js": "./static/js/1705.32ce00fc.chunk.js",
"static/js/1581.c60c0082.chunk.js": "./static/js/1581.c60c0082.chunk.js",
"static/js/455.6aa5b756.chunk.js": "./static/js/455.6aa5b756.chunk.js",
"static/js/2661.7fe77f72.chunk.js": "./static/js/2661.7fe77f72.chunk.js",
"static/js/889.43037296.chunk.js": "./static/js/889.43037296.chunk.js",
"static/js/9088.1edd5d6a.chunk.js": "./static/js/9088.1edd5d6a.chunk.js",
"static/js/247.9ce190b5.chunk.js": "./static/js/247.9ce190b5.chunk.js",
"static/js/2763.ec4b0ce6.chunk.js": "./static/js/2763.ec4b0ce6.chunk.js",
"static/js/5171.e8fc646a.chunk.js": "./static/js/5171.e8fc646a.chunk.js",
"static/js/2426.a889403c.chunk.js": "./static/js/2426.a889403c.chunk.js",
"static/js/2426.ab27f6f9.chunk.js": "./static/js/2426.ab27f6f9.chunk.js",
"static/js/3691.ef93d563.chunk.js": "./static/js/3691.ef93d563.chunk.js",
"static/js/3762.52bd15d3.chunk.js": "./static/js/3762.52bd15d3.chunk.js",
"static/js/5561.80af3962.chunk.js": "./static/js/5561.80af3962.chunk.js",
"static/js/3801.64b6e473.chunk.js": "./static/js/3801.64b6e473.chunk.js",
"static/js/1918.4309a619.chunk.js": "./static/js/1918.4309a619.chunk.js",
"static/js/6523.fb65841b.chunk.js": "./static/js/6523.fb65841b.chunk.js",
"static/js/1373.c65e2a03.chunk.js": "./static/js/1373.c65e2a03.chunk.js",
"static/js/6431.5f2e5e6e.chunk.js": "./static/js/6431.5f2e5e6e.chunk.js",
"static/js/2011.f505a73d.chunk.js": "./static/js/2011.f505a73d.chunk.js",
"static/js/1416.8f4d72a9.chunk.js": "./static/js/1416.8f4d72a9.chunk.js",
"static/js/4814.6d9edd38.chunk.js": "./static/js/4814.6d9edd38.chunk.js",
"static/js/3909.cdbddaab.chunk.js": "./static/js/3909.cdbddaab.chunk.js",
"static/js/137.08d76dda.chunk.js": "./static/js/137.08d76dda.chunk.js",
"static/js/8152.3b829286.chunk.js": "./static/js/8152.3b829286.chunk.js",
"static/js/1267.ee70805c.chunk.js": "./static/js/1267.ee70805c.chunk.js",
"static/js/6172.b49c709f.chunk.js": "./static/js/6172.b49c709f.chunk.js",
"static/js/6852.10dc5cb9.chunk.js": "./static/js/6852.10dc5cb9.chunk.js",
"static/js/3388.f53bd1d3.chunk.js": "./static/js/3388.f53bd1d3.chunk.js",
"static/js/7576.5695ff4d.chunk.js": "./static/js/7576.5695ff4d.chunk.js",
"static/js/7002.4064675c.chunk.js": "./static/js/7002.4064675c.chunk.js",
"static/js/2567.a2b3cd1e.chunk.js": "./static/js/2567.a2b3cd1e.chunk.js",
"static/js/7438.f6bf1a0d.chunk.js": "./static/js/7438.f6bf1a0d.chunk.js",
"static/js/6484.3a2447c1.chunk.js": "./static/js/6484.3a2447c1.chunk.js",
"static/js/6903.f1bd0701.chunk.js": "./static/js/6903.f1bd0701.chunk.js",
"static/js/7142.4191cc91.chunk.js": "./static/js/7142.4191cc91.chunk.js",
"static/js/7923.f624f038.chunk.js": "./static/js/7923.f624f038.chunk.js",
"static/js/9785.7383f4d2.chunk.js": "./static/js/9785.7383f4d2.chunk.js",
"static/js/8735.bf97f464.chunk.js": "./static/js/8735.bf97f464.chunk.js",
"static/js/63.c9bf3400.chunk.js": "./static/js/63.c9bf3400.chunk.js",
"static/js/264.58e9bb70.chunk.js": "./static/js/264.58e9bb70.chunk.js",
"static/js/8959.f30c25e0.chunk.js": "./static/js/8959.f30c25e0.chunk.js",
"static/js/2983.689a9d39.chunk.js": "./static/js/2983.689a9d39.chunk.js",
"static/js/5289.649f8767.chunk.js": "./static/js/5289.649f8767.chunk.js",
"static/js/5026.69171baa.chunk.js": "./static/js/5026.69171baa.chunk.js",
"static/js/2691.53531251.chunk.js": "./static/js/2691.53531251.chunk.js",
"static/js/7472.f63abe1f.chunk.js": "./static/js/7472.f63abe1f.chunk.js",
"static/js/2983.e938a4fe.chunk.js": "./static/js/2983.e938a4fe.chunk.js",
"static/js/5289.39c9d169.chunk.js": "./static/js/5289.39c9d169.chunk.js",
"index.html": "./index.html",
"main.90d417ae.css.map": "./static/css/main.90d417ae.css.map",
"main.efb70fdf.js.map": "./static/js/main.efb70fdf.js.map",
"2483.fc3f6e02.chunk.js.map": "./static/js/2483.fc3f6e02.chunk.js.map",
"6914.c9671304.chunk.js.map": "./static/js/6914.c9671304.chunk.js.map",
"4209.1785b76b.chunk.js.map": "./static/js/4209.1785b76b.chunk.js.map",
"1829.082a42b0.chunk.js.map": "./static/js/1829.082a42b0.chunk.js.map",
"4455.62d5739d.chunk.js.map": "./static/js/4455.62d5739d.chunk.js.map",
"5088.43224960.chunk.js.map": "./static/js/5088.43224960.chunk.js.map",
"5140.e9043b63.chunk.js.map": "./static/js/5140.e9043b63.chunk.js.map",
"5997.78c91d41.chunk.js.map": "./static/js/5997.78c91d41.chunk.js.map",
"3176.43953acc.chunk.js.map": "./static/js/3176.43953acc.chunk.js.map",
"6137.7c3483b1.chunk.js.map": "./static/js/6137.7c3483b1.chunk.js.map",
"7045.ca5a5aae.chunk.js.map": "./static/js/7045.ca5a5aae.chunk.js.map",
"9251.6b7b3ee3.chunk.js.map": "./static/js/9251.6b7b3ee3.chunk.js.map",
"2338.edf0a361.chunk.js.map": "./static/js/2338.edf0a361.chunk.js.map",
"4335.8f37144a.chunk.js.map": "./static/js/4335.8f37144a.chunk.js.map",
"3061.5a2c926b.chunk.js.map": "./static/js/3061.5a2c926b.chunk.js.map",
"6763.e408c6ad.chunk.js.map": "./static/js/6763.e408c6ad.chunk.js.map",
"3543.e36f8103.chunk.js.map": "./static/js/3543.e36f8103.chunk.js.map",
"4061.18b19aa0.chunk.js.map": "./static/js/4061.18b19aa0.chunk.js.map",
"2249.d85d7c19.chunk.js.map": "./static/js/2249.d85d7c19.chunk.js.map",
"main.ccc73c66.js.map": "./static/js/main.ccc73c66.js.map",
"6914.ed2f1662.chunk.js.map": "./static/js/6914.ed2f1662.chunk.js.map",
"4209.05b25520.chunk.js.map": "./static/js/4209.05b25520.chunk.js.map",
"1829.223fb198.chunk.js.map": "./static/js/1829.223fb198.chunk.js.map",
"4455.596f5a0d.chunk.js.map": "./static/js/4455.596f5a0d.chunk.js.map",
"5088.7692271b.chunk.js.map": "./static/js/5088.7692271b.chunk.js.map",
"5140.b1dd0e23.chunk.js.map": "./static/js/5140.b1dd0e23.chunk.js.map",
"1260.5eb8500b.chunk.js.map": "./static/js/1260.5eb8500b.chunk.js.map",
"3176.121f3468.chunk.js.map": "./static/js/3176.121f3468.chunk.js.map",
"6137.2c486126.chunk.js.map": "./static/js/6137.2c486126.chunk.js.map",
"7045.bc049940.chunk.js.map": "./static/js/7045.bc049940.chunk.js.map",
"9251.4a7c5817.chunk.js.map": "./static/js/9251.4a7c5817.chunk.js.map",
"2338.56b092f8.chunk.js.map": "./static/js/2338.56b092f8.chunk.js.map",
"4335.7187f6a6.chunk.js.map": "./static/js/4335.7187f6a6.chunk.js.map",
"3061.bb1cfd70.chunk.js.map": "./static/js/3061.bb1cfd70.chunk.js.map",
"6763.16fe0032.chunk.js.map": "./static/js/6763.16fe0032.chunk.js.map",
"4575.5b10a969.chunk.js.map": "./static/js/4575.5b10a969.chunk.js.map",
"4061.1e4b2694.chunk.js.map": "./static/js/4061.1e4b2694.chunk.js.map",
"5112.30236fa2.chunk.js.map": "./static/js/5112.30236fa2.chunk.js.map",
"9611.c217768e.chunk.js.map": "./static/js/9611.c217768e.chunk.js.map",
"2637.4946ae96.chunk.js.map": "./static/js/2637.4946ae96.chunk.js.map",
"5503.d0badeac.chunk.css.map": "./static/css/5503.d0badeac.chunk.css.map",
"5503.5d36120f.chunk.js.map": "./static/js/5503.5d36120f.chunk.js.map",
"5926.1ba3b5eb.chunk.js.map": "./static/js/5926.1ba3b5eb.chunk.js.map",
"701.1602597e.chunk.js.map": "./static/js/701.1602597e.chunk.js.map",
"7821.060b10cd.chunk.js.map": "./static/js/7821.060b10cd.chunk.js.map",
"2850.d0badeac.chunk.css.map": "./static/css/2850.d0badeac.chunk.css.map",
"2850.e1485c70.chunk.js.map": "./static/js/2850.e1485c70.chunk.js.map",
"1182.f9bcec67.chunk.js.map": "./static/js/1182.f9bcec67.chunk.js.map",
"343.d0badeac.chunk.css.map": "./static/css/343.d0badeac.chunk.css.map",
"343.9bef5ddd.chunk.js.map": "./static/js/343.9bef5ddd.chunk.js.map",
"1199.d0badeac.chunk.css.map": "./static/css/1199.d0badeac.chunk.css.map",
"1199.84ef2065.chunk.js.map": "./static/js/1199.84ef2065.chunk.js.map",
"8614.d0badeac.chunk.css.map": "./static/css/8614.d0badeac.chunk.css.map",
"8614.e007e045.chunk.js.map": "./static/js/8614.e007e045.chunk.js.map",
"1395.d0badeac.chunk.css.map": "./static/css/1395.d0badeac.chunk.css.map",
"1395.f8a4acb9.chunk.js.map": "./static/js/1395.f8a4acb9.chunk.js.map",
"2555.bce2711c.chunk.js.map": "./static/js/2555.bce2711c.chunk.js.map",
"7585.23c3cb6d.chunk.js.map": "./static/js/7585.23c3cb6d.chunk.js.map",
"4847.7c89dc57.chunk.js.map": "./static/js/4847.7c89dc57.chunk.js.map",
"4653.04094e61.chunk.js.map": "./static/js/4653.04094e61.chunk.js.map",
"692.c8593ab8.chunk.js.map": "./static/js/692.c8593ab8.chunk.js.map",
"8626.7ac959a6.chunk.js.map": "./static/js/8626.7ac959a6.chunk.js.map",
"736.30689e5a.chunk.js.map": "./static/js/736.30689e5a.chunk.js.map",
"6577.451bf5a2.chunk.js.map": "./static/js/6577.451bf5a2.chunk.js.map",
"9561.2fa4c7be.chunk.js.map": "./static/js/9561.2fa4c7be.chunk.js.map",
"4394.9b95db79.chunk.js.map": "./static/js/4394.9b95db79.chunk.js.map",
"2637.97fe472e.chunk.js.map": "./static/js/2637.97fe472e.chunk.js.map",
"5503.90c9cdc7.chunk.css.map": "./static/css/5503.90c9cdc7.chunk.css.map",
"5503.79a2f464.chunk.js.map": "./static/js/5503.79a2f464.chunk.js.map",
"5926.c0387455.chunk.js.map": "./static/js/5926.c0387455.chunk.js.map",
"701.05206868.chunk.js.map": "./static/js/701.05206868.chunk.js.map",
"7821.bda18452.chunk.js.map": "./static/js/7821.bda18452.chunk.js.map",
"2850.90c9cdc7.chunk.css.map": "./static/css/2850.90c9cdc7.chunk.css.map",
"2850.92a58310.chunk.js.map": "./static/js/2850.92a58310.chunk.js.map",
"1182.264ec55e.chunk.js.map": "./static/js/1182.264ec55e.chunk.js.map",
"343.90c9cdc7.chunk.css.map": "./static/css/343.90c9cdc7.chunk.css.map",
"343.ce17ca62.chunk.js.map": "./static/js/343.ce17ca62.chunk.js.map",
"1199.90c9cdc7.chunk.css.map": "./static/css/1199.90c9cdc7.chunk.css.map",
"1199.ae4c29a1.chunk.js.map": "./static/js/1199.ae4c29a1.chunk.js.map",
"5517.90c9cdc7.chunk.css.map": "./static/css/5517.90c9cdc7.chunk.css.map",
"5517.84805a10.chunk.js.map": "./static/js/5517.84805a10.chunk.js.map",
"2555.247780d4.chunk.js.map": "./static/js/2555.247780d4.chunk.js.map",
"7585.90e7c2ed.chunk.js.map": "./static/js/7585.90e7c2ed.chunk.js.map",
"4902.8927358d.chunk.js.map": "./static/js/4902.8927358d.chunk.js.map",
"7847.6c81d37f.chunk.js.map": "./static/js/7847.6c81d37f.chunk.js.map",
"4653.0d13044c.chunk.js.map": "./static/js/4653.0d13044c.chunk.js.map",
"692.c28b1b9b.chunk.js.map": "./static/js/692.c28b1b9b.chunk.js.map",
"8626.58e34c6f.chunk.js.map": "./static/js/8626.58e34c6f.chunk.js.map",
"736.66a05831.chunk.js.map": "./static/js/736.66a05831.chunk.js.map",
"6577.06d06144.chunk.js.map": "./static/js/6577.06d06144.chunk.js.map",
"9561.bf1e32db.chunk.js.map": "./static/js/9561.bf1e32db.chunk.js.map",
"6860.f8ff9efd.chunk.js.map": "./static/js/6860.f8ff9efd.chunk.js.map",
"4781.f4794912.chunk.js.map": "./static/js/4781.f4794912.chunk.js.map",
"9478.dca1d314.chunk.js.map": "./static/js/9478.dca1d314.chunk.js.map",
"7164.3762a0c0.chunk.js.map": "./static/js/7164.3762a0c0.chunk.js.map",
"4414.d499a576.chunk.js.map": "./static/js/4414.d499a576.chunk.js.map",
"7798.4523255f.chunk.js.map": "./static/js/7798.4523255f.chunk.js.map",
"8833.435c57c9.chunk.js.map": "./static/js/8833.435c57c9.chunk.js.map",
"471.468250ea.chunk.js.map": "./static/js/471.468250ea.chunk.js.map",
"483.96dc1806.chunk.js.map": "./static/js/483.96dc1806.chunk.js.map",
"9467.89303883.chunk.js.map": "./static/js/9467.89303883.chunk.js.map",
"6895.a780402b.chunk.js.map": "./static/js/6895.a780402b.chunk.js.map",
"7925.17b70ce9.chunk.js.map": "./static/js/7925.17b70ce9.chunk.js.map",
"6331.4b9c378c.chunk.js.map": "./static/js/6331.4b9c378c.chunk.js.map",
"4133.e423ad64.chunk.js.map": "./static/js/4133.e423ad64.chunk.js.map",
"1367.d0badeac.chunk.css.map": "./static/css/1367.d0badeac.chunk.css.map",
"1367.570f471e.chunk.js.map": "./static/js/1367.570f471e.chunk.js.map",
"3956.04add457.chunk.js.map": "./static/js/3956.04add457.chunk.js.map",
"9221.74babab3.chunk.js.map": "./static/js/9221.74babab3.chunk.js.map",
"8896.a985f858.chunk.js.map": "./static/js/8896.a985f858.chunk.js.map",
"9134.9bb207a3.chunk.js.map": "./static/js/9134.9bb207a3.chunk.js.map",
"1268.d0badeac.chunk.css.map": "./static/css/1268.d0badeac.chunk.css.map",
"1268.444486ab.chunk.js.map": "./static/js/1268.444486ab.chunk.js.map",
"1030.d7679dcf.chunk.js.map": "./static/js/1030.d7679dcf.chunk.js.map",
"9145.d907d493.chunk.js.map": "./static/js/9145.d907d493.chunk.js.map",
"1379.ed19d5b2.chunk.js.map": "./static/js/1379.ed19d5b2.chunk.js.map",
"1501.82aa601c.chunk.js.map": "./static/js/1501.82aa601c.chunk.js.map",
"9605.0d9d8909.chunk.js.map": "./static/js/9605.0d9d8909.chunk.js.map",
"426.31bab58a.chunk.js.map": "./static/js/426.31bab58a.chunk.js.map",
"4298.cc4b772e.chunk.js.map": "./static/js/4298.cc4b772e.chunk.js.map",
"2878.f17e395f.chunk.js.map": "./static/js/2878.f17e395f.chunk.js.map",
"8495.71a61743.chunk.js.map": "./static/js/8495.71a61743.chunk.js.map",
"4934.064b787d.chunk.js.map": "./static/js/4934.064b787d.chunk.js.map",
"9942.51a9de47.chunk.js.map": "./static/js/9942.51a9de47.chunk.js.map",
"7021.148329a1.chunk.js.map": "./static/js/7021.148329a1.chunk.js.map",
"2684.ff523cc8.chunk.js.map": "./static/js/2684.ff523cc8.chunk.js.map",
"6683.ee501f75.chunk.js.map": "./static/js/6683.ee501f75.chunk.js.map",
"8350.8858e924.chunk.js.map": "./static/js/8350.8858e924.chunk.js.map",
"4873.ab307a49.chunk.js.map": "./static/js/4873.ab307a49.chunk.js.map",
"9449.27ca290f.chunk.js.map": "./static/js/9449.27ca290f.chunk.js.map",
"7659.425b0e4f.chunk.js.map": "./static/js/7659.425b0e4f.chunk.js.map",
"9968.10689a81.chunk.js.map": "./static/js/9968.10689a81.chunk.js.map",
"2180.d8b0a783.chunk.js.map": "./static/js/2180.d8b0a783.chunk.js.map",
"8253.78199b7c.chunk.js.map": "./static/js/8253.78199b7c.chunk.js.map",
"3328.d653fd74.chunk.js.map": "./static/js/3328.d653fd74.chunk.js.map",
"1440.e5771fc7.chunk.js.map": "./static/js/1440.e5771fc7.chunk.js.map",
"9179.4664c118.chunk.js.map": "./static/js/9179.4664c118.chunk.js.map",
"51.fe31a1b5.chunk.js.map": "./static/js/51.fe31a1b5.chunk.js.map",
"711.29c4e77f.chunk.js.map": "./static/js/711.29c4e77f.chunk.js.map",
"6901.0d9858c2.chunk.js.map": "./static/js/6901.0d9858c2.chunk.js.map",
"2185.a4530a2b.chunk.js.map": "./static/js/2185.a4530a2b.chunk.js.map",
"312.b28428a0.chunk.js.map": "./static/js/312.b28428a0.chunk.js.map",
"2112.d99282a3.chunk.js.map": "./static/js/2112.d99282a3.chunk.js.map",
"4619.774f2ac4.chunk.js.map": "./static/js/4619.774f2ac4.chunk.js.map",
"8990.1d656f02.chunk.js.map": "./static/js/8990.1d656f02.chunk.js.map",
"8455.c317ba9a.chunk.js.map": "./static/js/8455.c317ba9a.chunk.js.map",
"1913.d0badeac.chunk.css.map": "./static/css/1913.d0badeac.chunk.css.map",
"1913.cea66f73.chunk.js.map": "./static/js/1913.cea66f73.chunk.js.map",
"1604.c298cecf.chunk.js.map": "./static/js/1604.c298cecf.chunk.js.map",
"8391.024d90c0.chunk.js.map": "./static/js/8391.024d90c0.chunk.js.map",
"402.aec3e2df.chunk.js.map": "./static/js/402.aec3e2df.chunk.js.map",
"1705.58e59f26.chunk.js.map": "./static/js/1705.58e59f26.chunk.js.map",
"1581.b3df67cf.chunk.js.map": "./static/js/1581.b3df67cf.chunk.js.map",
"455.13bb7aa6.chunk.js.map": "./static/js/455.13bb7aa6.chunk.js.map",
"2661.10751b4b.chunk.js.map": "./static/js/2661.10751b4b.chunk.js.map",
"889.2a763545.chunk.js.map": "./static/js/889.2a763545.chunk.js.map",
"9088.8b721a73.chunk.js.map": "./static/js/9088.8b721a73.chunk.js.map",
"247.b749bae6.chunk.js.map": "./static/js/247.b749bae6.chunk.js.map",
"2763.700b8a36.chunk.js.map": "./static/js/2763.700b8a36.chunk.js.map",
"4414.34edf059.chunk.js.map": "./static/js/4414.34edf059.chunk.js.map",
"7798.b974925d.chunk.js.map": "./static/js/7798.b974925d.chunk.js.map",
"8833.8e4bf585.chunk.js.map": "./static/js/8833.8e4bf585.chunk.js.map",
"9388.20842728.chunk.js.map": "./static/js/9388.20842728.chunk.js.map",
"483.ef8155e7.chunk.js.map": "./static/js/483.ef8155e7.chunk.js.map",
"9467.e157f032.chunk.js.map": "./static/js/9467.e157f032.chunk.js.map",
"6895.5d78f23b.chunk.js.map": "./static/js/6895.5d78f23b.chunk.js.map",
"1379.7e93fe73.chunk.js.map": "./static/js/1379.7e93fe73.chunk.js.map",
"6331.9d5ff423.chunk.js.map": "./static/js/6331.9d5ff423.chunk.js.map",
"4133.45077897.chunk.js.map": "./static/js/4133.45077897.chunk.js.map",
"1367.90c9cdc7.chunk.css.map": "./static/css/1367.90c9cdc7.chunk.css.map",
"1367.79a7a1e1.chunk.js.map": "./static/js/1367.79a7a1e1.chunk.js.map",
"3956.d3b4cd02.chunk.js.map": "./static/js/3956.d3b4cd02.chunk.js.map",
"9221.14d6096a.chunk.js.map": "./static/js/9221.14d6096a.chunk.js.map",
"8896.86116952.chunk.js.map": "./static/js/8896.86116952.chunk.js.map",
"9134.3cd624c6.chunk.js.map": "./static/js/9134.3cd624c6.chunk.js.map",
"1268.90c9cdc7.chunk.css.map": "./static/css/1268.90c9cdc7.chunk.css.map",
"1268.cb6b69cf.chunk.js.map": "./static/js/1268.cb6b69cf.chunk.js.map",
"1030.e86b3822.chunk.js.map": "./static/js/1030.e86b3822.chunk.js.map",
"9145.82dff7c3.chunk.js.map": "./static/js/9145.82dff7c3.chunk.js.map",
"8998.9a18741c.chunk.js.map": "./static/js/8998.9a18741c.chunk.js.map",
"1501.3b54336e.chunk.js.map": "./static/js/1501.3b54336e.chunk.js.map",
"7770.5dad74f3.chunk.js.map": "./static/js/7770.5dad74f3.chunk.js.map",
"426.9fd80f88.chunk.js.map": "./static/js/426.9fd80f88.chunk.js.map",
"4298.e8216a7e.chunk.js.map": "./static/js/4298.e8216a7e.chunk.js.map",
"2878.caa1771d.chunk.js.map": "./static/js/2878.caa1771d.chunk.js.map",
"8495.b1689c2d.chunk.js.map": "./static/js/8495.b1689c2d.chunk.js.map",
"4934.72071d47.chunk.js.map": "./static/js/4934.72071d47.chunk.js.map",
"9942.406de82c.chunk.js.map": "./static/js/9942.406de82c.chunk.js.map",
"7021.2df7e2e0.chunk.js.map": "./static/js/7021.2df7e2e0.chunk.js.map",
"2684.52b792c0.chunk.js.map": "./static/js/2684.52b792c0.chunk.js.map",
"6683.993a0cfc.chunk.js.map": "./static/js/6683.993a0cfc.chunk.js.map",
"8350.ee721e94.chunk.js.map": "./static/js/8350.ee721e94.chunk.js.map",
"4873.6fb2072e.chunk.js.map": "./static/js/4873.6fb2072e.chunk.js.map",
"5367.991f75c4.chunk.js.map": "./static/js/5367.991f75c4.chunk.js.map",
"5223.750c796e.chunk.js.map": "./static/js/5223.750c796e.chunk.js.map",
"7659.8b358177.chunk.js.map": "./static/js/7659.8b358177.chunk.js.map",
"9968.14f204ee.chunk.js.map": "./static/js/9968.14f204ee.chunk.js.map",
"2180.03cd0c4b.chunk.js.map": "./static/js/2180.03cd0c4b.chunk.js.map",
"8253.ec0f3d9f.chunk.js.map": "./static/js/8253.ec0f3d9f.chunk.js.map",
"3328.c7470c38.chunk.js.map": "./static/js/3328.c7470c38.chunk.js.map",
"1440.b9a2f19f.chunk.js.map": "./static/js/1440.b9a2f19f.chunk.js.map",
"9179.3874e070.chunk.js.map": "./static/js/9179.3874e070.chunk.js.map",
"51.f85def1c.chunk.js.map": "./static/js/51.f85def1c.chunk.js.map",
"711.be9f8284.chunk.js.map": "./static/js/711.be9f8284.chunk.js.map",
"6901.5afa1e6f.chunk.js.map": "./static/js/6901.5afa1e6f.chunk.js.map",
"2185.12707550.chunk.js.map": "./static/js/2185.12707550.chunk.js.map",
"312.cd77f5db.chunk.js.map": "./static/js/312.cd77f5db.chunk.js.map",
"2112.e0047ff5.chunk.js.map": "./static/js/2112.e0047ff5.chunk.js.map",
"4619.8d9ee17c.chunk.js.map": "./static/js/4619.8d9ee17c.chunk.js.map",
"8990.194642a8.chunk.js.map": "./static/js/8990.194642a8.chunk.js.map",
"8455.6f71a45b.chunk.js.map": "./static/js/8455.6f71a45b.chunk.js.map",
"1913.90c9cdc7.chunk.css.map": "./static/css/1913.90c9cdc7.chunk.css.map",
"1913.549c180b.chunk.js.map": "./static/js/1913.549c180b.chunk.js.map",
"1604.25690eb1.chunk.js.map": "./static/js/1604.25690eb1.chunk.js.map",
"8391.968204ad.chunk.js.map": "./static/js/8391.968204ad.chunk.js.map",
"402.5c660ae6.chunk.js.map": "./static/js/402.5c660ae6.chunk.js.map",
"1705.32ce00fc.chunk.js.map": "./static/js/1705.32ce00fc.chunk.js.map",
"1581.c60c0082.chunk.js.map": "./static/js/1581.c60c0082.chunk.js.map",
"455.6aa5b756.chunk.js.map": "./static/js/455.6aa5b756.chunk.js.map",
"2661.7fe77f72.chunk.js.map": "./static/js/2661.7fe77f72.chunk.js.map",
"889.43037296.chunk.js.map": "./static/js/889.43037296.chunk.js.map",
"9088.1edd5d6a.chunk.js.map": "./static/js/9088.1edd5d6a.chunk.js.map",
"247.9ce190b5.chunk.js.map": "./static/js/247.9ce190b5.chunk.js.map",
"2763.ec4b0ce6.chunk.js.map": "./static/js/2763.ec4b0ce6.chunk.js.map",
"5171.e8fc646a.chunk.js.map": "./static/js/5171.e8fc646a.chunk.js.map",
"2426.a889403c.chunk.js.map": "./static/js/2426.a889403c.chunk.js.map",
"2426.ab27f6f9.chunk.js.map": "./static/js/2426.ab27f6f9.chunk.js.map",
"3691.ef93d563.chunk.js.map": "./static/js/3691.ef93d563.chunk.js.map",
"3762.52bd15d3.chunk.js.map": "./static/js/3762.52bd15d3.chunk.js.map",
"5561.80af3962.chunk.js.map": "./static/js/5561.80af3962.chunk.js.map",
"3801.64b6e473.chunk.js.map": "./static/js/3801.64b6e473.chunk.js.map",
"1918.4309a619.chunk.js.map": "./static/js/1918.4309a619.chunk.js.map",
"6523.fb65841b.chunk.js.map": "./static/js/6523.fb65841b.chunk.js.map",
"1373.c65e2a03.chunk.js.map": "./static/js/1373.c65e2a03.chunk.js.map",
"6431.5f2e5e6e.chunk.js.map": "./static/js/6431.5f2e5e6e.chunk.js.map",
"2011.f505a73d.chunk.js.map": "./static/js/2011.f505a73d.chunk.js.map",
"1416.8f4d72a9.chunk.js.map": "./static/js/1416.8f4d72a9.chunk.js.map",
"4814.6d9edd38.chunk.js.map": "./static/js/4814.6d9edd38.chunk.js.map",
"3909.cdbddaab.chunk.js.map": "./static/js/3909.cdbddaab.chunk.js.map",
"137.08d76dda.chunk.js.map": "./static/js/137.08d76dda.chunk.js.map",
"8152.3b829286.chunk.js.map": "./static/js/8152.3b829286.chunk.js.map",
"1267.ee70805c.chunk.js.map": "./static/js/1267.ee70805c.chunk.js.map",
"6172.b49c709f.chunk.js.map": "./static/js/6172.b49c709f.chunk.js.map",
"6852.10dc5cb9.chunk.js.map": "./static/js/6852.10dc5cb9.chunk.js.map",
"3388.f53bd1d3.chunk.js.map": "./static/js/3388.f53bd1d3.chunk.js.map",
"7576.5695ff4d.chunk.js.map": "./static/js/7576.5695ff4d.chunk.js.map",
"7002.4064675c.chunk.js.map": "./static/js/7002.4064675c.chunk.js.map",
"2567.a2b3cd1e.chunk.js.map": "./static/js/2567.a2b3cd1e.chunk.js.map",
"7438.f6bf1a0d.chunk.js.map": "./static/js/7438.f6bf1a0d.chunk.js.map",
"6484.3a2447c1.chunk.js.map": "./static/js/6484.3a2447c1.chunk.js.map",
"6903.f1bd0701.chunk.js.map": "./static/js/6903.f1bd0701.chunk.js.map",
"7142.4191cc91.chunk.js.map": "./static/js/7142.4191cc91.chunk.js.map",
"7923.f624f038.chunk.js.map": "./static/js/7923.f624f038.chunk.js.map",
"9785.7383f4d2.chunk.js.map": "./static/js/9785.7383f4d2.chunk.js.map",
"8735.bf97f464.chunk.js.map": "./static/js/8735.bf97f464.chunk.js.map",
"63.c9bf3400.chunk.js.map": "./static/js/63.c9bf3400.chunk.js.map",
"264.58e9bb70.chunk.js.map": "./static/js/264.58e9bb70.chunk.js.map",
"8959.f30c25e0.chunk.js.map": "./static/js/8959.f30c25e0.chunk.js.map",
"2983.689a9d39.chunk.js.map": "./static/js/2983.689a9d39.chunk.js.map",
"5289.649f8767.chunk.js.map": "./static/js/5289.649f8767.chunk.js.map",
"5026.69171baa.chunk.js.map": "./static/js/5026.69171baa.chunk.js.map"
"2691.53531251.chunk.js.map": "./static/js/2691.53531251.chunk.js.map",
"7472.f63abe1f.chunk.js.map": "./static/js/7472.f63abe1f.chunk.js.map",
"2983.e938a4fe.chunk.js.map": "./static/js/2983.e938a4fe.chunk.js.map",
"5289.39c9d169.chunk.js.map": "./static/js/5289.39c9d169.chunk.js.map"
},
"entrypoints": [
"static/css/main.90d417ae.css",
"static/js/main.efb70fdf.js"
"static/js/main.ccc73c66.js"
]
}

View File

@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><base href="/"/><meta content="width=device-width,initial-scale=1" name="viewport"/><meta content="#081C42" media="(prefers-color-scheme: light)" name="theme-color"/><meta content="#081C42" media="(prefers-color-scheme: dark)" name="theme-color"/><meta content="MinIO Console" name="description"/><link href="./styles/root-styles.css" rel="stylesheet"/><link href="./apple-icon-180x180.png" rel="apple-touch-icon" sizes="180x180"/><link href="./favicon-32x32.png" rel="icon" sizes="32x32" type="image/png"/><link href="./favicon-96x96.png" rel="icon" sizes="96x96" type="image/png"/><link href="./favicon-16x16.png" rel="icon" sizes="16x16" type="image/png"/><link href="./manifest.json" rel="manifest"/><link color="#3a4e54" href="./safari-pinned-tab.svg" rel="mask-icon"/><title>MinIO Console</title><script defer="defer" src="./static/js/main.efb70fdf.js"></script><link href="./static/css/main.90d417ae.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"><div id="preload"><img src="./images/background.svg"/> <img src="./images/background-wave-orig2.svg"/></div><div id="loader-block"><img src="./Loader.svg"/></div></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><base href="/"/><meta content="width=device-width,initial-scale=1" name="viewport"/><meta content="#081C42" media="(prefers-color-scheme: light)" name="theme-color"/><meta content="#081C42" media="(prefers-color-scheme: dark)" name="theme-color"/><meta content="MinIO Console" name="description"/><link href="./styles/root-styles.css" rel="stylesheet"/><link href="./apple-icon-180x180.png" rel="apple-touch-icon" sizes="180x180"/><link href="./favicon-32x32.png" rel="icon" sizes="32x32" type="image/png"/><link href="./favicon-96x96.png" rel="icon" sizes="96x96" type="image/png"/><link href="./favicon-16x16.png" rel="icon" sizes="16x16" type="image/png"/><link href="./manifest.json" rel="manifest"/><link color="#3a4e54" href="./safari-pinned-tab.svg" rel="mask-icon"/><title>MinIO Console</title><script defer="defer" src="./static/js/main.ccc73c66.js"></script><link href="./static/css/main.90d417ae.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"><div id="preload"><img src="./images/background.svg"/> <img src="./images/background-wave-orig2.svg"/></div><div id="loader-block"><img src="./Loader.svg"/></div></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More