Compare commits

...

264 Commits

Author SHA1 Message Date
Alex
c31b311b4e Release v0.21.0 (#2389)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-10-14 21:30:21 -07:00
Aditya Manthramurthy
c316532fe9 fix: crosscompile windows build (#2391)
This is an attempt to fix the windows CI build issue.

The regression is appears to have been introduced in
d2d735c5c0
2022-10-14 21:29:36 -07:00
Aditya Manthramurthy
a65d6ba8f1 Add Role ARN as part of OIDC provider (#2382)
RoleARN needs to be used in the STS API call when present. 
Code to use this value needs to be added.
2022-10-14 15:46:25 -07:00
Kaan Kabalak
11f5d6aa0d Update Policy Summary once Raw Policy form is submitted (#2387) 2022-10-14 11:46:55 -05:00
jinapurapu
9532aa9500 Fixed handling of nil usage in getUsageWidgetsForDeployment (#2378) 2022-10-13 22:05:59 -05:00
Prakash Senthil Vel
ec3deed38e Site replication support for different accesskey and secretkey in different sites (#2350) 2022-10-13 17:11:29 -07:00
Alex
38015b4913 Updated golang.org/x/text dependency on console (#2381) 2022-10-13 16:10:16 -07:00
Cesar Celis Hernandez
e5508b5c5d Fix permission tests (#2379)
### Objective:

To fix Permission Tests

### Issue:

```
Cannot find module 'minio' or its corresponding type declarations.
```

### Solution:

To create the `assets` if there is no cache hit.

```sh
make assets
```

### Additional Information:

Update the version of the action.
2022-10-13 11:51:09 -07:00
Javier Adriel
9587e4105f Add missing KMS handlers for version, apis and metrics (#2376) 2022-10-12 12:00:48 -07:00
Harshavardhana
d2d735c5c0 upgrade all deps and keep go1.18 minimum (#2372) 2022-10-11 15:02:43 -07:00
Javier Adriel
915c10b4b8 Add kms to list of enable features if available (#2373) 2022-10-11 15:02:31 -07:00
Cesar Celis Hernandez
671530f5b4 Go back to Github runners while Datacenter is prepared (#2375) 2022-10-11 16:35:12 -05:00
Daniel Valdivia
0c778f57d3 Add Server Metrics Info Tab (#2340) 2022-10-07 21:19:40 -07:00
Cesar Celis Hernandez
43db7729c4 Splitting Operator UI Tests for faster execution (#2366) 2022-10-07 15:42:44 -05:00
jinapurapu
48b467a683 Added permission tooltips, UI and text improvements for Policies screens (#2368) 2022-10-07 12:58:08 -05:00
Javier Adriel
59b7406dd7 Implement KMS handlers (#2367) 2022-10-07 10:50:17 -07:00
Lenin Alevski
9e7a40abc8 Add support for manual edit of KES configuration file (#2354)
Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
2022-10-07 10:15:56 -05:00
Cesar Celis Hernandez
189331f465 Set timeout in all permission tests (#2369) 2022-10-07 00:18:52 -07:00
jinapurapu
e6a2364209 Added tooltips, button permission UI, for Groups, GroupDetails screens (#2353) 2022-10-06 22:53:31 -05:00
Alex
2b17aa598f Added basename & location origin to logout button (#2370)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-10-06 22:48:13 -05:00
jinapurapu
f10fdf4610 Show Tiers status (#2291)
closes https://github.com/miniohq/engineering/issues/681

Authored-by: Jillian Inapurapu <jillii@Jillians-MBP.attlocal.net>
2022-10-06 18:11:28 -07:00
Alex
4156fe0666 Removed position fixed to tenant size preview (#2364)
## What does this do?

Removed position fixed to tenant size preview to avoid overlap of create
buttons

## How does it look?
<img width="1698" alt="Screen Shot 2022-10-05 at 22 15 12"
src="https://user-images.githubusercontent.com/33497058/194206392-62718458-7417-4a01-a2e0-219d22a25483.png">



Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-10-06 00:55:18 -05:00
Alex
89bef6027c Fixed edit yaml buttons position (#2363)
## What does this do?

Fixes the position of save buttons in edit tenant YAML screen

## How does it look?
<img width="1442" alt="Screen Shot 2022-10-05 at 21 48 08"
src="https://user-images.githubusercontent.com/33497058/194203074-cd363ff4-02fd-4f60-ab52-6daca1d0fab5.png">


Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-10-05 22:16:42 -05:00
jinapurapu
333ca0a827 Permissions Tooltip guidance for ListUsers and UserDetails screens (#2347) 2022-10-05 18:34:31 -05:00
Cesar Celis Hernandez
de82a056e6 Improve Permissions Tests Part 1 (#2359)
### Objective:

To fix `Permissions Tests Part 1 (1.18.x, ubuntu-latest)`

### Strategy:

To make test more reliable, it has been isolated in folder `A` and `B`,
letting other tests to properly pass. And if new failure is observed, it
will be either in folder `A` or `B` for `iamPolicies.ts` and
`bucketWritePrefixOnly.ts` respectively.

### Root cause:

`iamPolicies.ts` and `bucketWritePrefixOnly.ts` are not stable tests
when running together with other tests, some sort of racing condition
that can be improved by isolating them.

### All tests are passing, same code:

<img width="435" alt="Screen Shot 2022-10-05 at 5 48 54 PM"
src="https://user-images.githubusercontent.com/6667358/194170348-cdba42ca-08a0-4db4-9543-f2f682ba6603.png">
2022-10-05 18:33:43 -05:00
Daniel Valdivia
a01b1ffe8c Update Favicon (#2360)
Signed-off-by: Daniel Valdivia
<18384552+dvaldivia@users.noreply.github.com>

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-10-05 14:31:55 -07:00
jinapurapu
61718a5915 Size handling for CounterCard long value (#2345)
Avoids overlap of counterValue text and Browse button.
![Screen Shot 2022-09-30 at 10 42 41
AM](https://user-images.githubusercontent.com/65002498/193326883-9379f6de-73c7-4fee-a5e5-0e50bd052359.png)

Co-authored-by: Jillian Inapurapu <jillii@Jillians-MBP.attlocal.net>
Co-authored-by: Alex <33497058+bexsoft@users.noreply.github.com>
2022-10-04 15:10:59 -07:00
Prakash Senthil Vel
2fed3572b2 License page updates (#2356)
How does it look:


![image](https://user-images.githubusercontent.com/23444145/193804863-3e3e7207-3284-4be9-bb49-de38a58f744c.png)

Fixes #https://github.com/miniohq/engineering/issues/983

Co-authored-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-10-04 14:57:20 -07:00
jinapurapu
af9e4fc150 Fixes for Permission tests (#2351)
Updates location of Policies screen, adds required policies to testing
profiles

Authored-by: Jillian Inapurapu <jillii@Jillians-MBP.attlocal.net>
2022-10-04 13:56:28 -07:00
Harshavardhana
f8475af5a6 do not log random errors using Go logger (#2355)
we need to make sure that we print in consistent
format for the logs, remove the unnecessary logs
everywhere used via `log.Print*`
2022-10-04 10:39:28 -07:00
Harshavardhana
413870e995 update madmin-go and mc deps for new changes (#2352) 2022-10-02 23:04:34 -07:00
Daniel Valdivia
cdd6f272ed Release v0.20.5 (#2349)
Signed-off-by: Daniel Valdivia
<18384552+dvaldivia@users.noreply.github.com>

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-09-30 01:51:41 -07:00
jinapurapu
5eddd0cd8d Permission Error handling and Tooltips for upload file, object action buttons (#2338)
![Screen Shot 2022-09-26 at 11 51 34
AM](https://user-images.githubusercontent.com/65002498/192357633-2f551441-8c27-450e-873e-1766d388cdb0.png)

<img width="706" alt="Screen Shot 2022-09-23 at 11 38 59 AM"
src="https://user-images.githubusercontent.com/65002498/192035299-093f814e-4821-4610-8fc5-c20565ea7c38.png">
<img width="642" alt="Screen Shot 2022-09-23 at 11 47 15 AM"
src="https://user-images.githubusercontent.com/65002498/192036512-f8891625-e050-42fd-9c43-173dd61c4df3.png">
2022-09-30 00:17:42 -07:00
Harshavardhana
5cf2b736e1 ignore configs with no KVs and simplify config builder (#2342)
convert all \n to ','
2022-09-30 00:16:47 -07:00
Daniel Valdivia
55330960e9 Move Access to Policies under Identity (#2348)
Signed-off-by: Daniel Valdivia
2022-09-29 22:55:21 -05:00
Lenin Alevski
a3b88567cc Add support for edit/add/remove environment variables to MinIO tenant (#2331)
![image](https://user-images.githubusercontent.com/1795553/191574784-69d55ca6-0a8c-41f3-b7f5-8526854cc8d2.png)


Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>

Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
2022-09-29 20:50:35 -07:00
Daniel Valdivia
73a687376a Fix IDP not having same salt/passphrase across pods (#2346)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-09-29 15:44:17 -07:00
jinapurapu
de4c08c2ff Fixed overhanging Browse button on Bucket card (#2343) 2022-09-29 14:14:31 -05:00
Harshavardhana
9396df2e20 remove unnecessary trace and threads profiling (#2341) 2022-09-28 14:32:14 -05:00
Alex
4143f50004 Release v0.20.4 (#2337)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-09-27 21:10:42 -07:00
Alex
d1511c5eb0 Limit concurrent downloads & uploads (#2313) 2022-09-23 10:35:55 -07:00
jinapurapu
c4c6d48abf Tooltips for Bucket Lifecycle, Delete bucket, Manage bucket (#2334) 2022-09-23 12:30:37 -05:00
Alex
43c5f9094a Tenant details navigation issues fix (#2336)
Fixes issues with Tenant details page navigation

- Back issue between tenant summary & tenants list page
- Not show the selected tab correctly on tenant details after clicking
back on browser's back button

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-09-23 12:30:18 -05:00
Javier Adriel
51ab9c59ae Update minio/pkg v1.4.0 (#2335) 2022-09-23 12:08:24 -05:00
Aditya Manthramurthy
fc95ab8658 Fix oauth state generation for OIDC login (#2333)
This is a regression from 118cf97e1d when
env var support for passing console configuration from MinIO was
removed.

This change ensures that all MinIO nodes in a cluster are able to verify
state tokens generated by other nodes in the cluster. Without this, it
is necessary to use sticky sessions in a loadbalancer to ensure that
OIDC authorization code login flow steps for a client happens on the
same minio node.

Fixes https://github.com/minio/minio/issues/15527
2022-09-23 10:30:45 -05:00
Daryl White
bebe860903 Updating documentation links to new URLs (#2325)
The new doc site has launched, and all docs have new URLs.
This PR updates the documentation URLs in the Console to point to the
new locations.
2022-09-22 22:37:32 -07:00
Kaan Kabalak
df4679ea55 Fix styling for Create New Path button in Buckets page (#2330)
Fixes #2329
2022-09-21 19:11:58 -05:00
Alex
2263eada70 Release v0.20.3 (#2328)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-09-20 23:54:10 -07:00
Lenin Alevski
368c9ee3d7 InputBoxWrapper automatically add hide/show behavior for password fields (#2327)
Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
2022-09-20 23:13:34 -05:00
jinapurapu
3513a01711 Add Bucket tooltip improvements (#2326) 2022-09-20 19:12:18 -07:00
Lenin Alevski
0af36a5757 Add: Allow to configure env variables during tenant creation (#2322)
Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
2022-09-20 18:58:31 -05:00
Daniel Valdivia
fdd5a94074 Fix NPE on Operator Login with SSO (#2324)
Signed-off-by: Daniel Valdivia
2022-09-20 18:57:48 -05:00
Javier Adriel
17ad2cfd14 Add dummy endpoints for kms integration (#2301)
Add dummy endpoints for kms integration

Implementation will come in another PR
2022-09-20 16:09:30 -07:00
Daniel Valdivia
67f509e2bb Release v0.20.2 (#2321)
Signed-off-by: Daniel Valdivia <hola@danielvaldivia.com>
2022-09-16 16:02:12 -07:00
Benjamin Marte
6102094c9e Adds a logout view which enables minio to logout when using OIDC (#2281)
* added logout view
* Fixed issues that arose after merging with master
* removed unused navigate and merged with master
* changes based on review feedback
Co-authored-by: Alex <33497058+bexsoft@users.noreply.github.com>
Co-authored-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-09-16 14:21:58 -07:00
Lenin Alevski
d84062b1b2 Fix: Labels for Node Selector in Pod Placement (#2320)
Enabling/disabling buttons correctly in pod placement > labels to be
consistent with all other screens in the application

Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
2022-09-16 13:24:45 -07:00
jinapurapu
a878440485 Added permissions guidance on ListBuckets and AddBuckets screens (#2319)
Added helpbox and tooltip guidance on ListBucketsand AddBuckets screens
Added bucketname to resource checking for bucket level config permissions
2022-09-16 13:22:20 -07:00
Kaan Kabalak
cd6e61e93b Don't show Bucket Name input error until field is touched (#2316) 2022-09-16 13:48:02 -05:00
jinapurapu
a77b56b522 Toggle Bucket Naming Rules display by clicking text (#2311) 2022-09-16 13:12:47 -05:00
Cesar Celis Hernandez
6ed5084691 To add missing file for coverage (#2318) 2022-09-15 19:36:00 -05:00
Daniel Valdivia
4ac6ecb558 Return 401 for Login Errors (#2312)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-09-15 15:33:53 -05:00
Alex
41671b4f25 Fixed crash in simple dashboard when one disk has failed (#2314)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-09-15 14:26:00 -05:00
jinapurapu
024ab1212b Add Minio tier type (#2302) 2022-09-15 14:00:39 -05:00
jinapurapu
77f62e11ef Tiers permission UI fix (#2310) 2022-09-15 11:36:30 -05:00
Cesar Celis Hernandez
0960835cd9 To migrate all testcafe (#2309) 2022-09-14 12:22:27 -07:00
Cesar Celis Hernandez
3746dd47f8 To migrate Permissions Tests Part 1 test (#2299)
migrate all-permissions-1
2022-09-12 20:59:33 -04:00
Cesar Celis Hernandez
ce255c5181 To migrate site replication test (#2276)
Migrate site replication test
2022-09-12 20:01:24 -04:00
Alex
7728cc734a Inherits error props to tooltip wrapper child buttons (#2307) 2022-09-11 23:29:30 -07:00
Lenin Alevski
cc581c6a9e fix: login function was returning fixed error (#2308) 2022-09-11 23:28:07 -07:00
Alex
f7b142e74a Replacing all buttons from console with mds (#2303)
Replaces buttons in console to start using MinIO Design System (mds)

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-09-09 17:42:30 -05:00
Harshavardhana
1108cee626 do not add preceding '/' for putRequests (#2306) 2022-09-09 15:33:58 -05:00
Javier Adriel
94fdba5990 Run lint in missing files (#2300) 2022-09-08 11:13:22 -05:00
Cesar Celis Hernandez
524258a9ea To migrate react warning test (#2273) 2022-09-06 17:49:45 -05:00
Alex
c0cf7a6d6a Release v0.20.1 (#2298)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-09-06 14:15:33 -07:00
Daniel Valdivia
f9916d1cd6 Update Site Replication Documentation link (#2297)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-09-06 12:39:14 -05:00
Cesar Celis Hernandez
52512c0ccc To repair the Operator API Tests & Operator UI Tests (#2292) 2022-09-06 09:19:31 -07:00
Lenin Alevski
989f041658 Support for providing Tenant client certificates (#2294) 2022-09-06 10:20:16 -05:00
Cesar Celis Hernandez
2f81b750a3 To repair SSO test (#2295) 2022-09-06 00:12:16 -07:00
Kaan Kabalak
035a5b88c2 Add support for Multiple IDPs on Login screen (#2258) 2022-09-03 11:02:48 -05:00
Alex
7702149962 Added missing prefix for downloads (#2286)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-09-03 10:01:45 -05:00
Alex
f3e24d62ca Fixed Visual height for Sites Replication (#2293) 2022-09-03 01:27:33 -05:00
jinapurapu
d663b9f346 Display configured logger_webhook endpoints (#2279) 2022-09-01 15:23:55 -05:00
Harshavardhana
ae147358b1 upgrade minio-go/v7 v7.0.35 (#2288)
changes LDAP/SSO to send login via
form body instead of query params
2022-08-31 21:59:40 -07:00
Alex
20bc53119e Filtered prefixes in versions list (#2285)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-30 18:28:16 -05:00
jinapurapu
3a3a4b2fea Interactive Bucket Naming Rules component (#2262) 2022-08-30 13:02:10 -05:00
Alex
497437729b Select User & Groups Policy modal updates (#2284)
Select User Policy modal updates

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-30 12:06:59 -05:00
Harshavardhana
1c37fcf398 update UBI base image to 8.6 2022-08-29 23:48:28 -07:00
Cesar Celis Hernandez
67af66fc55 Format all files after swagger-gen (#2283) 2022-08-29 22:53:50 -05:00
Cesar Celis Hernandez
288c843a17 Catch error in gofmt (#2266) 2022-08-29 19:28:39 -05:00
Cesar Celis Hernandez
9357c2db0e Formatting missing areas with gofmt (#2278)
Co-authored-by: Lenin Alevski <alevsk.8772@gmail.com>
2022-08-29 18:04:09 -04:00
Lenin Alevski
139771f4d4 Fixes and improvements for Tenant Security page (#2252)
- Tenant securityContext was only being applied to first pool
- Fixed style issues on tenant security page to be more consistent
- Added missing FsGroupChangePolicy in the SecurityContextSelector
  component

Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
2022-08-29 15:35:23 -05:00
Alex
b7783aaa1c Removed double border in raw policy / yaml containers (#2277)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-26 18:41:28 -05:00
Ashish Kumar Sinha
9821beb1de read license from envt variable (#2259) 2022-08-26 18:09:15 -05:00
Cesar Celis Hernandez
d279f722f8 Migrate reuse golang dependencies (#2275) 2022-08-26 16:57:27 -05:00
Cesar Celis Hernandez
9539a8e18a Migrate semgrep to datacenter (#2271) 2022-08-26 15:30:33 -05:00
Alex
f11b9bff17 Improved policy create policy screen (#2268)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-26 13:07:42 -05:00
Aditya Manthramurthy
06c282dd9a Fix config parsing bug with updated madmin helper (#2264) 2022-08-25 10:45:07 -07:00
Cesar Celis Hernandez
3e9fb853d9 Correct gofmt version 1.19 (#2267) 2022-08-25 11:44:55 -05:00
Alex
cd21ad2085 Fixed erratic behavior in configuration pages (#2269)
- Issue with fields being cleared in forms with CSV component present
- Load configuration panels on section change

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-25 09:22:05 -05:00
Cesar Celis Hernandez
729100ae16 Execute Lint Job with Self Hosted Runner (#2265) 2022-08-24 22:09:07 -05:00
Cesar Celis Hernandez
bcd29a4232 Migrate vulnerable-dependencies-checks to datacenter (#2263) 2022-08-24 19:34:16 -05:00
Minio Trusted
380a9d7faa update go mod tidy
Signed-off-by: Harshavardhana <harsha@minio.io>
2022-08-22 23:59:23 -07:00
Alex
9cd0033504 Release v0.20.0 (#2261)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-22 23:27:22 -07:00
Aditya Manthramurthy
483fe77a35 Fix config parsing using updated method (#2251)
Fix config parsing using madmin and mc bump up

- The config parsing client-side logic is updated in madmin-go

- This change also has fixes associated with breakage caused by bumping
up the mc dependency
2022-08-23 00:27:26 -05:00
jinapurapu
1742303ad7 Changed timestamp to date format in widgets CSV download (#2253) 2022-08-22 10:34:49 -05:00
jinapurapu
292fb3920f Created button to download Widget data as CSV or PNG file (#2241) 2022-08-19 12:48:15 -05:00
Javier Adriel
9ed8f11b22 Change register tabs (#2250)
Co-authored-by: Alex <33497058+bexsoft@users.noreply.github.com>
2022-08-17 18:32:10 -05:00
Prakash Senthil Vel
860d8c6b78 UI to delete configured notification targets (#2213) 2022-08-17 15:40:37 -05:00
Alex
99965805a6 Reimplemented DirectPV API in operator console (#2207)
- Updated API to use latest directpv library

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-17 13:05:07 -05:00
Alex
7036d1328e Added Color customization to embedded object browser (#2246)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-17 11:06:10 -05:00
Lenin Alevski
697910c7b2 fix: buckets browse button was not clickable (#2249)
Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
2022-08-16 18:23:48 -05:00
Kaan Kabalak
64dc605843 Fix inconsistencies in Health Diagnostics UI (#2239) 2022-08-12 22:45:08 -05:00
jinapurapu
75fa88e6e2 Added delay to Audit Log tests to reduce failure (#2245) 2022-08-12 22:44:27 -05:00
Alex
2857b8c586 Release v0.19.5 (#2243) 2022-08-10 20:43:36 -07:00
Alex
b1788c29db Disabled Object Locking button when permissions are not set (#2226)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-10 22:15:18 -05:00
jinapurapu
2e1401f013 Increased delay to reduce failure of Operator UI test (#2240) 2022-08-10 16:12:55 -05:00
Alex
1e1c11b13c Added FSGroupChangePolicy support to create tenant screen (#2233)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-10 13:28:15 -05:00
Javier Adriel
25c1c854b1 Add new section to register tenants with API key in operator (#2222) 2022-08-09 13:23:15 -05:00
Javier Adriel
5be2cc1965 Implement register handlers (#2219) 2022-08-09 13:22:53 -05:00
Alex
4aa3f40792 Removed permanent scrollbar in embedded object browser (#2237)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-09 12:02:09 -05:00
jinapurapu
3f41a82fd3 Image field fix (#2231) 2022-08-09 11:04:43 -05:00
Harshavardhana
1b641b4222 return bad request instead of 403's (#2229)
S3 API requests '403' as valid error
in some situations when client is probing
the server for valid S3 endpoint.

return '400 Bad Request' instead.
2022-08-08 15:37:01 -05:00
jinapurapu
85aabebbb4 Added text to AddBuckets Helpbox advising to enable versioning to enable retention (#2235)
Added hepbox guidance text to enable versioning in order to set retention on bucket creation
2022-08-08 14:08:08 -05:00
Pedro Juarez
919232261d switch to node version specified in .nvmrc file (#2225) 2022-08-05 17:54:47 -07:00
Harshavardhana
ddd25a20eb update CREDITS and enable builds for go1.19 (#2227) 2022-08-05 10:07:38 -05:00
Harshavardhana
84b8f9d6fa support P-384, P-512 constant time implementations (#2224)
fixes #2223
2022-08-04 15:36:38 -07:00
jinapurapu
46af0ff74c Protocol Logos for Add Tenant - Identity Provider (#2210) 2022-08-04 09:14:38 -07:00
Javier Adriel
b3651ed0a3 Auto register API key once it is retrieved from subnet (#2217) 2022-08-03 09:43:22 -07:00
Alex
78c4fa393a Changed x axis notation to display date indicator in zoom mode (#2221)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-02 22:23:27 -07:00
Kaan Kabalak
84c4159062 Fix anchors and update links for License page features (#2220) 2022-08-02 20:30:16 -05:00
Javier Adriel
ac2888fc4e Implement login and api key handlers (#2204) 2022-08-02 10:41:12 -05:00
Alex
c311847dcf Changed wrong button structure un buckets list page (#2218)
Also fixed issue with tests part 3 workflow

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-01 22:04:51 -05:00
Harshavardhana
cb6cda7265 fix: crash in operator console for missing fsGroup (#2211)
Bonus: Add support for "fsGroupChangePolicy"
Bonus: keep only github actions in workflow folder
2022-08-01 19:04:00 -07:00
Cesar Celis Hernandez
16fd5470db Correcting response on invalid login attempt (#2216)
Verifying detailed message error from bad login in SSO Test
2022-08-01 18:12:39 -05:00
jiuker
ea0cac2a92 fix:Incorrect template (#2196)
The formatting template is incorrectly formatted.
2022-08-01 17:44:35 -05:00
Alex
33b041ef34 Fixed incompatibility with some base64 strings & React Router v6 (#2208)
* Fixed incompatibility with some base64 strings & React Router v6

This affected Object Browser & certain Cyrillic / Chinese names

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-01 15:15:03 -05:00
Garen Chan
b692ea693f Fix error: setMultiBucketReplication healthCheckPeriod not work (#2212) 2022-08-01 13:12:54 -07:00
Cesar Celis Hernandez
fd39e50c08 Updating SSO Error Message on bad login (#2215)
Updating error message on bad sso login
2022-08-01 14:09:07 -05:00
Alex
ad4b9c050a Added DirectPV mode to Operator console (#2203)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-08-01 12:57:31 -05:00
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
Daniel Valdivia
2918d39ab7 Release v0.18.1 (#2088)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-06-04 10:12:11 -07:00
Cesar Celis Hernandez
fb2eb0ebf7 Test logout in Operator API (#2085) 2022-06-03 22:15:13 -07:00
jinapurapu
e7a36a1ff1 Assign policy for Multiple groups (#2086) 2022-06-03 21:54:06 -07:00
Daniel Valdivia
41e1b4a5d5 Add Bucket slice refactor to reduce re-renders (#2087)
* Add Bucket slice refactor to reduce re-renders
* Fix Button on object browser
* Update Logo

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-06-03 21:39:12 -07:00
Daniel Valdivia
6e205fa8ae Change editor to react-textarea-code-editor. Tenant YAML a page. (#2084)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-06-03 21:24:18 -07:00
jinapurapu
5b3f6ad76e Fixed formatting of Site Replication Helpbox text (#2080) 2022-06-03 21:19:01 -05:00
Daniel Valdivia
8396c3023e Have TenantItem charts use capacity instead of raw capacity (#2083)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-06-03 17:53:58 -07:00
jinapurapu
161d56db36 Added View action to groups table in UserDetails (#2081) 2022-06-03 18:01:15 -05:00
Cesar Celis Hernandez
a49a4e5513 Add bucket replication test (#2082) 2022-06-03 17:43:24 -05:00
Cesar Celis Hernandez
9741462e7b Accommodate Login Function (#2078) 2022-06-02 22:54:33 -05:00
jinapurapu
73f09e1af6 Tooltip capitalization fixes (#2079) 2022-06-02 22:20:33 -05:00
Daniel Valdivia
d41f6e57d2 Release v0.18.0 (#2076)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-06-02 15:36:22 -07:00
Cesar Celis Hernandez
93d041e55b Add test to create namespace (#2075)
Co-authored-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-06-02 12:24:49 -07:00
Daniel Valdivia
94e419e09c Add Pool Slice and Tenants Slice simplification (#2074)
Add Pool Slice and Tenants Slice simplification
Flatten Slice
AddPool Thunk
Return HMR support for Redux
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-06-02 12:11:31 -07:00
Daniel Valdivia
6c5f6934e7 Tenant Details Thunk (#2072)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-06-02 11:18:16 -05:00
Daniel Valdivia
41155b3f97 Show error when there's no storge classes (#2070)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-06-01 22:52:28 -05:00
Cesar Celis Hernandez
e41c80449d Test list of claims (#2069) 2022-06-01 20:23:14 -07:00
Alex
6f7a46e528 Disabled Servers & drives fields in edit pool (#2068)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-06-01 17:10:50 -07:00
Daniel Valdivia
ba48e0c5b8 Move EditPool redux state to it's own slice (#2063)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-06-01 15:14:31 -07:00
Lenin Alevski
3da636170f Fix MinIO expose service label (#2067) 2022-06-01 16:51:28 -05:00
Daniel Valdivia
7687a9e588 Fix Login Box height while loading (#2061)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-05-31 20:16:21 -07:00
Alex
692dc1a29e Remove react-hot-loader dependency (#2062)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-05-31 20:02:33 -07:00
jinapurapu
bb55f9f331 Disabled Assign Policy button if multiple groups selected (#2058) 2022-05-31 19:55:16 -05:00
Daniel Valdivia
dec7b138e9 Move New Credentials to separate component for Add Tenant (#2056)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-05-31 19:28:50 -05:00
Cesar Celis Hernandez
d3b1be80eb adjust threshold (#2066) 2022-05-31 17:05:30 -07:00
Alex
0339925d15 Added plan name icons to license page (#2060)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-05-31 15:29:55 -07:00
Cesar Celis Hernandez
d956ec65a2 Cover errors in registerAdminArnsHandlers (#2059)
To cover errors in registerAdminArnsHandlers
2022-05-31 12:42:16 -07:00
Alex
b02e649405 Fixed dashboards capacity Widgets (#2055)
- Added new calculation for prometheus capacity
- Added indicator colors to capacity widgets
- Adjusted capacity in drives for common dashboard

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2022-05-31 10:03:58 -05:00
Cesar Celis Hernandez
68e98be376 Add test for registerAdminArnsHandlers (#2053) 2022-05-30 21:39:55 -07:00
Cesar Celis Hernandez
c9d174df09 Wait for PVC to be bounded (#2054) 2022-05-30 21:15:03 -07:00
Daniel Valdivia
80391b867c Create Tenant Namespace Field move to Thunks (#2052)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2022-05-30 22:06:42 -05:00
Alex
45715293ea React 18 initial migration (#2044)
- Updated codemirror dependencies
- Updated react virtualized dependencies
- Fixed height of object actions buttons
- Fixed icon buttons styling
- Fixed boxIcon badge location
- Fixed actions panel buttons height
2022-05-28 15:08:22 -07:00
Cesar Celis Hernandez
dd4963e3aa Increment coverage & fix test on full disk (#2050) 2022-05-28 00:41:39 -05:00
jinapurapu
c7c7fe194c Added SA checking for DeleteUser button in UserDetails (#2049) 2022-05-27 18:51:16 -05:00
Prakash Senthil Vel
35fdaf1ddd UX license logo on sidebar (#2037) 2022-05-27 18:23:36 -05:00
1729 changed files with 62119 additions and 22327 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -5,50 +5,45 @@ linters-settings:
misspell:
locale: US
goheader:
values:
regexp:
copyright-holder: Copyright \(c\) (20\d\d\-20\d\d)|2021|({{year}})
template-path: .license.tmpl
linters:
disable-all: true
enable:
- typecheck
- goimports
- misspell
- govet
- revive
- ineffassign
- gosimple
- deadcode
- structcheck
- gomodguard
- gofmt
- unused
- structcheck
- unconvert
- varcheck
- gocritic
- gofumpt
- tenv
- durationcheck
linters-settings:
goheader:
values:
regexp:
copyright-holder: Copyright \(c\) (20\d\d\-20\d\d)|2021|({{year}})
template-path: .license.tmpl
service:
golangci-lint-version: 1.43.0 # use the fixed version to not introduce new linters unexpectedly
issues:
exclude-use-default: false
exclude:
- should have a package comment
# TODO(y4m4): Remove once all exported ident. have comments!
- comment on exported function
- comment on exported type
- should have comment
- use leading k in Go names
- comment on exported const
- should have a package comment
# TODO(y4m4): Remove once all exported ident. have comments!
- comment on exported function
- comment on exported type
- should have comment
- use leading k in Go names
- comment on exported const
run:
skip-dirs:
- pkg/clientgen
- pkg/apis/networking.gke.io
- restapi/operations

View File

@@ -13,7 +13,7 @@ release:
before:
hooks:
# you may remove this if you don't use vgo
- go mod tidy -compat=1.17
- go mod tidy -compat=1.18
builds:
-

1
.nvmrc Normal file
View File

@@ -0,0 +1 @@
17

2768
CREDITS

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,5 @@
FROM node:17 as uilayer
ARG NODE_VERSION
FROM node:$NODE_VERSION as uilayer
WORKDIR /app
@@ -12,7 +13,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 +32,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

@@ -1,4 +1,5 @@
FROM node:17 as uilayer
ARG NODE_VERSION
FROM node:$NODE_VERSION as uilayer
WORKDIR /app

View File

@@ -1,4 +1,4 @@
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.5
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.6
ARG TAG

View File

@@ -5,6 +5,8 @@ BUILD_VERSION:=$(shell git describe --exact-match --tags $(git log -n1 --pretty=
BUILD_TIME:=$(shell date 2>/dev/null)
TAG ?= "minio/console:$(BUILD_VERSION)-dev"
MINIO_VERSION ?= "quay.io/minio/minio:latest"
TARGET_BUCKET ?= "target"
NODE_VERSION := $(shell cat .nvmrc)
default: console
@@ -14,22 +16,19 @@ console:
@(GO111MODULE=on CGO_ENABLED=0 go build -trimpath --tags=kqueue,operator --ldflags "-s -w" -o console ./cmd/console)
k8sdev:
@docker build -t $(TAG) --build-arg build_version=$(BUILD_VERSION) --build-arg build_time='$(BUILD_TIME)' .
@docker build -t $(TAG) --build-arg build_version=$(BUILD_VERSION) --build-arg build_time='$(BUILD_TIME)' --build-arg NODE_VERSION='$(NODE_VERSION)' .
@kind load docker-image $(TAG)
@echo "Done, now restart your console deployment"
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
verifiers: getdeps fmt lint
fmt:
@echo "Running $@ check"
@GO111MODULE=on gofmt -d restapi/
@GO111MODULE=on gofmt -d pkg/
@GO111MODULE=on gofmt -d cmd/
@GO111MODULE=on gofmt -d cluster/
@(env bash $(PWD)/verify-gofmt.sh)
crosscompile:
@(env bash $(PWD)/cross-compile.sh $(arg1))
@@ -44,9 +43,13 @@ install: console
@mkdir -p $(GOPATH)/bin && cp -f $(PWD)/console $(GOPATH)/bin/console
@echo "Installation successful. To learn more, try \"console --help\"."
swagger-gen: clean-swagger swagger-console swagger-operator
swagger-gen: clean-swagger swagger-console swagger-operator apply-gofmt
@echo "Done Generating swagger server code from yaml"
apply-gofmt:
@echo "Applying gofmt to all generated an existing files"
@GO111MODULE=on gofmt -w .
clean-swagger:
@echo "cleaning"
@rm -rf models
@@ -62,7 +65,8 @@ swagger-operator:
@swagger generate server -A operator --main-package=operator --server-package=operatorapi --exclude-main -P models.Principal -f ./swagger-operator.yml -r NOTICE
assets:
@(cd portal-ui; yarn install --prefer-offline; make build-static; yarn prettier --write . --loglevel warn; cd ..)
@(if [ -f "${NVM_DIR}/nvm.sh" ]; then \. "${NVM_DIR}/nvm.sh" && nvm install && nvm use && npm install -g yarn ; fi &&\
cd portal-ui; yarn install --prefer-offline; make build-static; yarn prettier --write . --loglevel warn; cd ..)
test-integration:
@(docker stop pgsqlcontainer || true)
@@ -74,8 +78,8 @@ test-integration:
@echo $(MINIO_VERSION)
@(docker run -v /data1 -v /data2 -v /data3 -v /data4 --net=mynet123 -d --name minio --rm -p 9000:9000 -p 9001:9001 -e MINIO_KMS_SECRET_KEY=my-minio-key:OSMM+vkKUTCvQs9YL/CVMIMt43HFhkUpqJxTmGl6rYw= $(MINIO_VERSION) server /data{1...4} --console-address ':9001' && sleep 5)
@(docker run --net=mynet123 --ip=173.18.0.3 --name pgsqlcontainer --rm -p 5432:5432 -e POSTGRES_PASSWORD=password -d postgres && sleep 5)
@echo "execute test and get coverage"
@(cd integration && go test -coverpkg=../restapi -c -tags testrunmain . && mkdir -p coverage && ./integration.test -test.v -test.run "^Test*" -test.coverprofile=coverage/system.out)
@echo "execute test and get coverage for test-integration:"
@(cd integration && go test -coverpkg=../restapi -c -tags testrunmain . && mkdir -p coverage && export THETARGET=$(TARGET_BUCKET) && echo "THETARGET: ${THETARGET}" && ./integration.test -test.v -test.run "^Test*" -test.coverprofile=coverage/system.out)
@(docker stop pgsqlcontainer)
@(docker stop minio)
@(docker network rm mynet123)
@@ -260,7 +264,7 @@ clean:
@rm -vf console
docker:
@docker buildx build --output=type=docker --platform linux/amd64 -t $(TAG) --build-arg build_version=$(BUILD_VERSION) --build-arg build_time='$(BUILD_TIME)' .
@docker buildx build --output=type=docker --platform linux/amd64 -t $(TAG) --build-arg build_version=$(BUILD_VERSION) --build-arg build_time='$(BUILD_TIME)' --build-arg NODE_VERSION='$(NODE_VERSION)' .
release: swagger-gen
@echo "Generating Release: $(RELEASE)"

View File

@@ -54,7 +54,7 @@ docker pull minio/console
### Build from source
> You will need a working Go environment. Therefore, please follow [How to install Go](https://golang.org/doc/install).
> Minimum version required is go1.17
> Minimum version required is go1.18
```
go install github.com/minio/console/cmd/console@latest

View File

@@ -17,6 +17,7 @@
package cluster
import (
directpvclient "github.com/minio/directpv/pkg/client"
operator "github.com/minio/operator/pkg/client/clientset/versioned"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
@@ -63,3 +64,13 @@ func OperatorClient(token string) (*operator.Clientset, error) {
func K8sClient(token string) (*kubernetes.Clientset, error) {
return kubernetes.NewForConfig(GetK8sConfig(token))
}
// DirectPV interfaces required to fetch information
func DirectPVDriveInterface(token string) (*directpvclient.DirectCSIDriveInterface, error) {
return directpvclient.DirectCSIDriveInterfaceForConfig(GetK8sConfig(token))
}
func DirectPVVolumeInterface(token string) (*directpvclient.DirectCSIVolumeInterface, error) {
return directpvclient.DirectCSIVolumeInterfaceForConfig(GetK8sConfig(token))
}

127
go.mod
View File

@@ -1,54 +1,64 @@
module github.com/minio/console
go 1.17
go 1.18
require (
github.com/blang/semver/v4 v4.0.0
github.com/cheggaaa/pb/v3 v3.0.8
github.com/cheggaaa/pb/v3 v3.1.0
github.com/dustin/go-humanize v1.0.0
github.com/fatih/color v1.13.0
github.com/go-openapi/errors v0.20.2
github.com/go-openapi/loads v0.21.1
github.com/go-openapi/runtime v0.23.3
github.com/go-openapi/spec v0.20.5
github.com/go-openapi/strfmt v0.21.2
github.com/go-openapi/swag v0.21.1
github.com/go-openapi/validate v0.21.0
github.com/golang-jwt/jwt/v4 v4.4.1
github.com/go-openapi/errors v0.20.3
github.com/go-openapi/loads v0.21.2
github.com/go-openapi/runtime v0.24.1
github.com/go-openapi/spec v0.20.7
github.com/go-openapi/strfmt v0.21.3
github.com/go-openapi/swag v0.22.3
github.com/go-openapi/validate v0.22.0
github.com/golang-jwt/jwt/v4 v4.4.2
github.com/google/uuid v1.3.0
github.com/gorilla/websocket v1.5.0
github.com/jessevdk/go-flags v1.5.0
github.com/klauspost/compress v1.15.1
github.com/minio/cli v1.22.0
github.com/klauspost/compress v1.15.11
github.com/minio/cli v1.24.0
github.com/minio/directpv v1.4.4-0.20220805090942-948ca4731651
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/operator v0.0.0-20220414212219-ba4c097324b2
github.com/minio/pkg v1.1.23
github.com/minio/selfupdate v0.4.0
github.com/minio/kes v0.21.0
github.com/minio/madmin-go v1.6.3
github.com/minio/mc v0.0.0-20221007160339-ec8687d57e36
github.com/minio/minio-go/v7 v7.0.40
github.com/minio/operator v0.0.0-20220902184351-21e4073132b0
github.com/minio/pkg v1.5.1
github.com/minio/selfupdate v0.5.0
github.com/mitchellh/go-homedir v1.1.0
github.com/rs/xid v1.4.0
github.com/secure-io/sio-go v0.3.1
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/net v0.0.0-20220421235706-1d1ef9303861
github.com/stretchr/testify v1.8.0
github.com/tidwall/gjson v1.14.3
github.com/unrolled/secure v1.13.0
golang.org/x/crypto v0.0.0-20221005025214-4161e89ecf1b
golang.org/x/net v0.0.0-20220722155237-a158d28d115b
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5
// Added to include security fix for
// https://github.com/golang/go/issues/56152
golang.org/x/text v0.3.8 // indirect
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.23.5
k8s.io/apimachinery v0.23.5
k8s.io/client-go v0.23.5
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9
k8s.io/api v0.25.2
k8s.io/apimachinery v0.25.2
k8s.io/client-go v0.25.2
k8s.io/utils v0.0.0-20220922133306-665eaaec4324
)
require (
cloud.google.com/go v0.99.0 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.27 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
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
@@ -60,30 +70,35 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/emicklei/go-restful/v3 v3.8.0 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/gdamore/encoding v1.0.0 // indirect
github.com/gdamore/tcell/v2 v2.4.1-0.20210905002822-f057f0a857a1 // indirect
github.com/go-logr/logr v1.2.2 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-openapi/analysis v0.21.2 // indirect
github.com/go-openapi/analysis v0.21.4 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/goccy/go-json v0.9.4 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.7 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.0.11 // indirect
github.com/klauspost/cpuid/v2 v2.1.0 // indirect
github.com/kr/pretty v0.2.1 // indirect
github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect
github.com/lestrrat-go/blackmagic v1.0.0 // indirect
github.com/lestrrat-go/httpcc v1.0.0 // indirect
@@ -92,12 +107,15 @@ require (
github.com/lestrrat-go/option v1.0.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-ieproxy v0.0.1 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mb0/glob v0.0.0-20160210091149-1eb79d2de6c4 // indirect
github.com/miekg/dns v1.1.48 // indirect
github.com/minio/colorjson v1.0.2 // indirect
github.com/minio/filepath v1.0.0 // indirect
github.com/minio/md5-simd v1.1.2 // indirect
@@ -109,16 +127,18 @@ require (
github.com/muesli/ansi v0.0.0-20211031195517-c9f0611b6c70 // indirect
github.com/muesli/reflow v0.3.0 // indirect
github.com/muesli/termenv v0.11.1-0.20220212125758-44cd13922739 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/navidys/tvxwidgets v0.1.0 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/philhofer/fwd v1.1.2-0.20210722190033-5c56ac6d0bb9 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pkg/xattr v0.4.5 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/posener/complete v1.2.3 // indirect
github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect
github.com/prometheus/client_golang v1.12.1 // indirect
github.com/prometheus/client_golang v1.12.2 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.33.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
@@ -126,8 +146,14 @@ require (
github.com/rivo/tview v0.0.0-20220216162559-96063d6082f3 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rjeczalik/notify v0.9.2 // indirect
github.com/shirou/gopsutil/v3 v3.22.2 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/shirou/gopsutil/v3 v3.22.7 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.10.0 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
github.com/tinylib/msgp v1.1.7-0.20211026165309-e818a1881b0e // indirect
@@ -137,28 +163,29 @@ require (
go.etcd.io/etcd/api/v3 v3.5.2 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.2 // indirect
go.etcd.io/etcd/client/v3 v3.5.2 // indirect
go.mongodb.org/mongo-driver v1.8.4 // indirect
go.mongodb.org/mongo-driver v1.10.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.21.0 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20220224211638-0e9765cccd65 // indirect
golang.org/x/tools v0.1.12 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220302033224-9aa15565e42a // indirect
google.golang.org/grpc v1.44.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
google.golang.org/protobuf v1.28.0 // indirect
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
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
gopkg.in/ini.v1 v1.66.6 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.24.3 // indirect
k8s.io/klog/v2 v2.80.1 // indirect
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // 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
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

447
go.sum

File diff suppressed because it is too large Load Diff

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")
}
@@ -3638,3 +3632,225 @@ func TestGetBucketRewind(t *testing.T) {
200, resp.StatusCode, inspectHTTPResponse(resp))
}
}
func GetRemoteBucket() (*http.Response, error) {
request, err := http.NewRequest(
"GET",
"http://localhost:9090/api/v1/remote-buckets",
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 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)
bucketsRelationIndex0 := map[string]interface{}{
"originBucket": sourceBucket,
"destinationBucket": targetBucket,
}
bucketsRelationArray[0] = bucketsRelationIndex0
requestDataAdd := map[string]interface{}{
"accessKey": accessKey,
"secretKey": secretKey,
"targetURL": targetURL,
"sourceBucket": sourceBucket,
"targetBucket": targetBucket,
"region": "",
"bucketsRelation": bucketsRelationArray,
"syncMode": "async",
"bandwidth": 107374182400,
"healthCheckPeriod": 60,
"prefix": "",
"tags": "",
"replicateDeleteMarkers": true,
"replicateDeletes": true,
"priority": 1,
"storageClass": "",
"replicateMetadata": true,
}
// Creating the Call by adding the URL and Headers
requestDataJSON, _ := json.Marshal(requestDataAdd)
requestDataBody := bytes.NewReader(requestDataJSON)
request, err := http.NewRequest(
"POST",
"http://localhost:9090/api/v1/remote-buckets",
requestDataBody,
)
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 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)
accessKey := "minioadmin"
secretKey := "minioadmin"
targetURL := "https://play.min.io"
sourceBucket := "source"
targetBucket := os.Getenv("THETARGET")
fmt.Println("targetBucket: ", targetBucket)
// 1. Create bucket
if !BucketGotAdded("source", 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. Verify Remote Bucket was created
resp, err = GetRemoteBucket()
assert.Nil(err)
if err != nil {
log.Println(err)
return
}
finalResponse := inspectHTTPResponse(resp)
if resp != nil {
assert.Equal(
200, resp.StatusCode, finalResponse)
}
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.17.3'
image: 'minio/console:v0.21.0'
imagePullPolicy: "IfNotPresent"
env:
- name: CONSOLE_OPERATOR_MODE

View File

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

View File

@@ -24,11 +24,13 @@ package models
import (
"context"
"encoding/json"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// AdminInfoResponse admin info response
@@ -36,15 +38,16 @@ import (
// swagger:model adminInfoResponse
type AdminInfoResponse struct {
// advanced metrics status
// Enum: [not configured available unavailable]
AdvancedMetricsStatus string `json:"advancedMetricsStatus,omitempty"`
// buckets
Buckets int64 `json:"buckets,omitempty"`
// objects
Objects int64 `json:"objects,omitempty"`
// prometheus not ready
PrometheusNotReady bool `json:"prometheusNotReady,omitempty"`
// servers
Servers []*ServerProperties `json:"servers"`
@@ -59,6 +62,10 @@ type AdminInfoResponse struct {
func (m *AdminInfoResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAdvancedMetricsStatus(formats); err != nil {
res = append(res, err)
}
if err := m.validateServers(formats); err != nil {
res = append(res, err)
}
@@ -73,6 +80,51 @@ func (m *AdminInfoResponse) Validate(formats strfmt.Registry) error {
return nil
}
var adminInfoResponseTypeAdvancedMetricsStatusPropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["not configured","available","unavailable"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
adminInfoResponseTypeAdvancedMetricsStatusPropEnum = append(adminInfoResponseTypeAdvancedMetricsStatusPropEnum, v)
}
}
const (
// AdminInfoResponseAdvancedMetricsStatusNotConfigured captures enum value "not configured"
AdminInfoResponseAdvancedMetricsStatusNotConfigured string = "not configured"
// AdminInfoResponseAdvancedMetricsStatusAvailable captures enum value "available"
AdminInfoResponseAdvancedMetricsStatusAvailable string = "available"
// AdminInfoResponseAdvancedMetricsStatusUnavailable captures enum value "unavailable"
AdminInfoResponseAdvancedMetricsStatusUnavailable string = "unavailable"
)
// prop value enum
func (m *AdminInfoResponse) validateAdvancedMetricsStatusEnum(path, location string, value string) error {
if err := validate.EnumCase(path, location, value, adminInfoResponseTypeAdvancedMetricsStatusPropEnum, true); err != nil {
return err
}
return nil
}
func (m *AdminInfoResponse) validateAdvancedMetricsStatus(formats strfmt.Registry) error {
if swag.IsZero(m.AdvancedMetricsStatus) { // not required
return nil
}
// value enum
if err := m.validateAdvancedMetricsStatusEnum("advancedMetricsStatus", "body", m.AdvancedMetricsStatus); err != nil {
return err
}
return nil
}
func (m *AdminInfoResponse) validateServers(formats strfmt.Registry) error {
if swag.IsZero(m.Servers) { // not required
return nil

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

@@ -58,6 +58,9 @@ type CreateTenantRequest struct {
// encryption
Encryption *EncryptionConfiguration `json:"encryption,omitempty"`
// environment variables
EnvironmentVariables []*EnvironmentVariable `json:"environmentVariables"`
// erasure coding parity
ErasureCodingParity int64 `json:"erasureCodingParity,omitempty"`
@@ -85,8 +88,8 @@ type CreateTenantRequest struct {
// log search configuration
LogSearchConfiguration *LogSearchConfiguration `json:"logSearchConfiguration,omitempty"`
// mounth path
MounthPath string `json:"mounth_path,omitempty"`
// mount path
MountPath string `json:"mount_path,omitempty"`
// name
// Required: true
@@ -123,6 +126,10 @@ func (m *CreateTenantRequest) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
if err := m.validateEnvironmentVariables(formats); err != nil {
res = append(res, err)
}
if err := m.validateIdp(formats); err != nil {
res = append(res, err)
}
@@ -199,6 +206,32 @@ func (m *CreateTenantRequest) validateEncryption(formats strfmt.Registry) error
return nil
}
func (m *CreateTenantRequest) validateEnvironmentVariables(formats strfmt.Registry) error {
if swag.IsZero(m.EnvironmentVariables) { // not required
return nil
}
for i := 0; i < len(m.EnvironmentVariables); i++ {
if swag.IsZero(m.EnvironmentVariables[i]) { // not required
continue
}
if m.EnvironmentVariables[i] != nil {
if err := m.EnvironmentVariables[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("environmentVariables" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("environmentVariables" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *CreateTenantRequest) validateIdp(formats strfmt.Registry) error {
if swag.IsZero(m.Idp) { // not required
return nil
@@ -355,6 +388,10 @@ func (m *CreateTenantRequest) ContextValidate(ctx context.Context, formats strfm
res = append(res, err)
}
if err := m.contextValidateEnvironmentVariables(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateIdp(ctx, formats); err != nil {
res = append(res, err)
}
@@ -417,6 +454,26 @@ func (m *CreateTenantRequest) contextValidateEncryption(ctx context.Context, for
return nil
}
func (m *CreateTenantRequest) contextValidateEnvironmentVariables(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.EnvironmentVariables); i++ {
if m.EnvironmentVariables[i] != nil {
if err := m.EnvironmentVariables[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("environmentVariables" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("environmentVariables" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *CreateTenantRequest) contextValidateIdp(ctx context.Context, formats strfmt.Registry) error {
if m.Idp != nil {

View File

@@ -29,10 +29,10 @@ import (
"github.com/go-openapi/swag"
)
// DirectCSIDriveInfo direct c s i drive info
// DirectPVDriveInfo direct p v drive info
//
// swagger:model directCSIDriveInfo
type DirectCSIDriveInfo struct {
// swagger:model directPVDriveInfo
type DirectPVDriveInfo struct {
// allocated
Allocated int64 `json:"allocated,omitempty"`
@@ -56,18 +56,18 @@ type DirectCSIDriveInfo struct {
Volumes int64 `json:"volumes,omitempty"`
}
// Validate validates this direct c s i drive info
func (m *DirectCSIDriveInfo) Validate(formats strfmt.Registry) error {
// Validate validates this direct p v drive info
func (m *DirectPVDriveInfo) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this direct c s i drive info based on context it is used
func (m *DirectCSIDriveInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
// ContextValidate validates this direct p v drive info based on context it is used
func (m *DirectPVDriveInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *DirectCSIDriveInfo) MarshalBinary() ([]byte, error) {
func (m *DirectPVDriveInfo) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@@ -75,8 +75,8 @@ func (m *DirectCSIDriveInfo) MarshalBinary() ([]byte, error) {
}
// UnmarshalBinary interface implementation
func (m *DirectCSIDriveInfo) UnmarshalBinary(b []byte) error {
var res DirectCSIDriveInfo
func (m *DirectPVDriveInfo) UnmarshalBinary(b []byte) error {
var res DirectPVDriveInfo
if err := swag.ReadJSON(b, &res); err != nil {
return err
}

View File

@@ -29,10 +29,10 @@ import (
"github.com/go-openapi/swag"
)
// DirectCSIVolumeInfo direct c s i volume info
// DirectPVVolumeInfo direct p v volume info
//
// swagger:model directCSIVolumeInfo
type DirectCSIVolumeInfo struct {
// swagger:model directPVVolumeInfo
type DirectPVVolumeInfo struct {
// capacity
Capacity int64 `json:"capacity,omitempty"`
@@ -47,18 +47,18 @@ type DirectCSIVolumeInfo struct {
Volume string `json:"volume,omitempty"`
}
// Validate validates this direct c s i volume info
func (m *DirectCSIVolumeInfo) Validate(formats strfmt.Registry) error {
// Validate validates this direct p v volume info
func (m *DirectPVVolumeInfo) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this direct c s i volume info based on context it is used
func (m *DirectCSIVolumeInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
// ContextValidate validates this direct p v volume info based on context it is used
func (m *DirectPVVolumeInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *DirectCSIVolumeInfo) MarshalBinary() ([]byte, error) {
func (m *DirectPVVolumeInfo) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@@ -66,8 +66,8 @@ func (m *DirectCSIVolumeInfo) MarshalBinary() ([]byte, error) {
}
// UnmarshalBinary interface implementation
func (m *DirectCSIVolumeInfo) UnmarshalBinary(b []byte) error {
var res DirectCSIVolumeInfo
func (m *DirectPVVolumeInfo) UnmarshalBinary(b []byte) error {
var res DirectPVVolumeInfo
if err := swag.ReadJSON(b, &res); err != nil {
return err
}

View File

@@ -54,6 +54,9 @@ type EncryptionConfiguration struct {
// image
Image string `json:"image,omitempty"`
// raw
Raw string `json:"raw,omitempty"`
// replicas
Replicas string `json:"replicas,omitempty"`
@@ -93,6 +96,8 @@ func (m *EncryptionConfiguration) UnmarshalJSON(raw []byte) error {
Image string `json:"image,omitempty"`
Raw string `json:"raw,omitempty"`
Replicas string `json:"replicas,omitempty"`
SecretsToBeDeleted []string `json:"secretsToBeDeleted"`
@@ -119,6 +124,8 @@ func (m *EncryptionConfiguration) UnmarshalJSON(raw []byte) error {
m.Image = dataAO1.Image
m.Raw = dataAO1.Raw
m.Replicas = dataAO1.Replicas
m.SecretsToBeDeleted = dataAO1.SecretsToBeDeleted
@@ -154,6 +161,8 @@ func (m EncryptionConfiguration) MarshalJSON() ([]byte, error) {
Image string `json:"image,omitempty"`
Raw string `json:"raw,omitempty"`
Replicas string `json:"replicas,omitempty"`
SecretsToBeDeleted []string `json:"secretsToBeDeleted"`
@@ -177,6 +186,8 @@ func (m EncryptionConfiguration) MarshalJSON() ([]byte, error) {
dataAO1.Image = m.Image
dataAO1.Raw = m.Raw
dataAO1.Replicas = m.Replicas
dataAO1.SecretsToBeDeleted = m.SecretsToBeDeleted

View File

@@ -54,6 +54,9 @@ type EncryptionConfigurationResponse struct {
// mtls client
MtlsClient *CertificateInfo `json:"mtls_client,omitempty"`
// raw
Raw string `json:"raw,omitempty"`
// replicas
Replicas string `json:"replicas,omitempty"`
@@ -90,6 +93,8 @@ func (m *EncryptionConfigurationResponse) UnmarshalJSON(raw []byte) error {
MtlsClient *CertificateInfo `json:"mtls_client,omitempty"`
Raw string `json:"raw,omitempty"`
Replicas string `json:"replicas,omitempty"`
SecurityContext *SecurityContext `json:"securityContext,omitempty"`
@@ -114,6 +119,8 @@ func (m *EncryptionConfigurationResponse) UnmarshalJSON(raw []byte) error {
m.MtlsClient = dataAO1.MtlsClient
m.Raw = dataAO1.Raw
m.Replicas = dataAO1.Replicas
m.SecurityContext = dataAO1.SecurityContext
@@ -147,6 +154,8 @@ func (m EncryptionConfigurationResponse) MarshalJSON() ([]byte, error) {
MtlsClient *CertificateInfo `json:"mtls_client,omitempty"`
Raw string `json:"raw,omitempty"`
Replicas string `json:"replicas,omitempty"`
SecurityContext *SecurityContext `json:"securityContext,omitempty"`
@@ -168,6 +177,8 @@ func (m EncryptionConfigurationResponse) MarshalJSON() ([]byte, error) {
dataAO1.MtlsClient = m.MtlsClient
dataAO1.Raw = m.Raw
dataAO1.Replicas = m.Replicas
dataAO1.SecurityContext = m.SecurityContext

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"
)
// EnvironmentConstants environment constants
//
// swagger:model environmentConstants
type EnvironmentConstants struct {
// max concurrent downloads
MaxConcurrentDownloads int64 `json:"maxConcurrentDownloads,omitempty"`
// max concurrent uploads
MaxConcurrentUploads int64 `json:"maxConcurrentUploads,omitempty"`
}
// Validate validates this environment constants
func (m *EnvironmentConstants) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this environment constants based on context it is used
func (m *EnvironmentConstants) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *EnvironmentConstants) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *EnvironmentConstants) UnmarshalBinary(b []byte) error {
var res EnvironmentConstants
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -31,17 +31,17 @@ import (
"github.com/go-openapi/swag"
)
// FormatDirectCSIDrivesResponse format direct c s i drives response
// FormatDirectPVDrivesResponse format direct p v drives response
//
// swagger:model formatDirectCSIDrivesResponse
type FormatDirectCSIDrivesResponse struct {
// swagger:model formatDirectPVDrivesResponse
type FormatDirectPVDrivesResponse struct {
// format issues list
FormatIssuesList []*CsiFormatErrorResponse `json:"formatIssuesList"`
FormatIssuesList []*PvFormatErrorResponse `json:"formatIssuesList"`
}
// Validate validates this format direct c s i drives response
func (m *FormatDirectCSIDrivesResponse) Validate(formats strfmt.Registry) error {
// Validate validates this format direct p v drives response
func (m *FormatDirectPVDrivesResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateFormatIssuesList(formats); err != nil {
@@ -54,7 +54,7 @@ func (m *FormatDirectCSIDrivesResponse) Validate(formats strfmt.Registry) error
return nil
}
func (m *FormatDirectCSIDrivesResponse) validateFormatIssuesList(formats strfmt.Registry) error {
func (m *FormatDirectPVDrivesResponse) validateFormatIssuesList(formats strfmt.Registry) error {
if swag.IsZero(m.FormatIssuesList) { // not required
return nil
}
@@ -80,8 +80,8 @@ func (m *FormatDirectCSIDrivesResponse) validateFormatIssuesList(formats strfmt.
return nil
}
// ContextValidate validate this format direct c s i drives response based on the context it is used
func (m *FormatDirectCSIDrivesResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
// ContextValidate validate this format direct p v drives response based on the context it is used
func (m *FormatDirectPVDrivesResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateFormatIssuesList(ctx, formats); err != nil {
@@ -94,7 +94,7 @@ func (m *FormatDirectCSIDrivesResponse) ContextValidate(ctx context.Context, for
return nil
}
func (m *FormatDirectCSIDrivesResponse) contextValidateFormatIssuesList(ctx context.Context, formats strfmt.Registry) error {
func (m *FormatDirectPVDrivesResponse) contextValidateFormatIssuesList(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.FormatIssuesList); i++ {
@@ -115,7 +115,7 @@ func (m *FormatDirectCSIDrivesResponse) contextValidateFormatIssuesList(ctx cont
}
// MarshalBinary interface implementation
func (m *FormatDirectCSIDrivesResponse) MarshalBinary() ([]byte, error) {
func (m *FormatDirectPVDrivesResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@@ -123,8 +123,8 @@ func (m *FormatDirectCSIDrivesResponse) MarshalBinary() ([]byte, error) {
}
// UnmarshalBinary interface implementation
func (m *FormatDirectCSIDrivesResponse) UnmarshalBinary(b []byte) error {
var res FormatDirectCSIDrivesResponse
func (m *FormatDirectPVDrivesResponse) UnmarshalBinary(b []byte) error {
var res FormatDirectPVDrivesResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}

View File

@@ -31,17 +31,17 @@ import (
"github.com/go-openapi/swag"
)
// GetDirectCSIDriveListResponse get direct c s i drive list response
// GetDirectPVDriveListResponse get direct p v drive list response
//
// swagger:model getDirectCSIDriveListResponse
type GetDirectCSIDriveListResponse struct {
// swagger:model getDirectPVDriveListResponse
type GetDirectPVDriveListResponse struct {
// drives
Drives []*DirectCSIDriveInfo `json:"drives"`
Drives []*DirectPVDriveInfo `json:"drives"`
}
// Validate validates this get direct c s i drive list response
func (m *GetDirectCSIDriveListResponse) Validate(formats strfmt.Registry) error {
// Validate validates this get direct p v drive list response
func (m *GetDirectPVDriveListResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateDrives(formats); err != nil {
@@ -54,7 +54,7 @@ func (m *GetDirectCSIDriveListResponse) Validate(formats strfmt.Registry) error
return nil
}
func (m *GetDirectCSIDriveListResponse) validateDrives(formats strfmt.Registry) error {
func (m *GetDirectPVDriveListResponse) validateDrives(formats strfmt.Registry) error {
if swag.IsZero(m.Drives) { // not required
return nil
}
@@ -80,8 +80,8 @@ func (m *GetDirectCSIDriveListResponse) validateDrives(formats strfmt.Registry)
return nil
}
// ContextValidate validate this get direct c s i drive list response based on the context it is used
func (m *GetDirectCSIDriveListResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
// ContextValidate validate this get direct p v drive list response based on the context it is used
func (m *GetDirectPVDriveListResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateDrives(ctx, formats); err != nil {
@@ -94,7 +94,7 @@ func (m *GetDirectCSIDriveListResponse) ContextValidate(ctx context.Context, for
return nil
}
func (m *GetDirectCSIDriveListResponse) contextValidateDrives(ctx context.Context, formats strfmt.Registry) error {
func (m *GetDirectPVDriveListResponse) contextValidateDrives(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Drives); i++ {
@@ -115,7 +115,7 @@ func (m *GetDirectCSIDriveListResponse) contextValidateDrives(ctx context.Contex
}
// MarshalBinary interface implementation
func (m *GetDirectCSIDriveListResponse) MarshalBinary() ([]byte, error) {
func (m *GetDirectPVDriveListResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@@ -123,8 +123,8 @@ func (m *GetDirectCSIDriveListResponse) MarshalBinary() ([]byte, error) {
}
// UnmarshalBinary interface implementation
func (m *GetDirectCSIDriveListResponse) UnmarshalBinary(b []byte) error {
var res GetDirectCSIDriveListResponse
func (m *GetDirectPVDriveListResponse) UnmarshalBinary(b []byte) error {
var res GetDirectPVDriveListResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}

View File

@@ -31,17 +31,17 @@ import (
"github.com/go-openapi/swag"
)
// GetDirectCSIVolumeListResponse get direct c s i volume list response
// GetDirectPVVolumeListResponse get direct p v volume list response
//
// swagger:model getDirectCSIVolumeListResponse
type GetDirectCSIVolumeListResponse struct {
// swagger:model getDirectPVVolumeListResponse
type GetDirectPVVolumeListResponse struct {
// volumes
Volumes []*DirectCSIVolumeInfo `json:"volumes"`
Volumes []*DirectPVVolumeInfo `json:"volumes"`
}
// Validate validates this get direct c s i volume list response
func (m *GetDirectCSIVolumeListResponse) Validate(formats strfmt.Registry) error {
// Validate validates this get direct p v volume list response
func (m *GetDirectPVVolumeListResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateVolumes(formats); err != nil {
@@ -54,7 +54,7 @@ func (m *GetDirectCSIVolumeListResponse) Validate(formats strfmt.Registry) error
return nil
}
func (m *GetDirectCSIVolumeListResponse) validateVolumes(formats strfmt.Registry) error {
func (m *GetDirectPVVolumeListResponse) validateVolumes(formats strfmt.Registry) error {
if swag.IsZero(m.Volumes) { // not required
return nil
}
@@ -80,8 +80,8 @@ func (m *GetDirectCSIVolumeListResponse) validateVolumes(formats strfmt.Registry
return nil
}
// ContextValidate validate this get direct c s i volume list response based on the context it is used
func (m *GetDirectCSIVolumeListResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
// ContextValidate validate this get direct p v volume list response based on the context it is used
func (m *GetDirectPVVolumeListResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateVolumes(ctx, formats); err != nil {
@@ -94,7 +94,7 @@ func (m *GetDirectCSIVolumeListResponse) ContextValidate(ctx context.Context, fo
return nil
}
func (m *GetDirectCSIVolumeListResponse) contextValidateVolumes(ctx context.Context, formats strfmt.Registry) error {
func (m *GetDirectPVVolumeListResponse) contextValidateVolumes(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Volumes); i++ {
@@ -115,7 +115,7 @@ func (m *GetDirectCSIVolumeListResponse) contextValidateVolumes(ctx context.Cont
}
// MarshalBinary interface implementation
func (m *GetDirectCSIVolumeListResponse) MarshalBinary() ([]byte, error) {
func (m *GetDirectPVVolumeListResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@@ -123,8 +123,8 @@ func (m *GetDirectCSIVolumeListResponse) MarshalBinary() ([]byte, error) {
}
// UnmarshalBinary interface implementation
func (m *GetDirectCSIVolumeListResponse) UnmarshalBinary(b []byte) error {
var res GetDirectCSIVolumeListResponse
func (m *GetDirectPVVolumeListResponse) UnmarshalBinary(b []byte) error {
var res GetDirectPVVolumeListResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}

View File

@@ -0,0 +1,28 @@
// 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
// KmDeleteKeyRequest km delete key request
//
// swagger:model kmDeleteKeyRequest
type KmDeleteKeyRequest interface{}

View File

@@ -0,0 +1,28 @@
// 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
// KmListKeysRequest km list keys request
//
// swagger:model kmListKeysRequest
type KmListKeysRequest interface{}

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 models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// KmsAPIsResponse kms a p is response
//
// swagger:model kmsAPIsResponse
type KmsAPIsResponse struct {
// results
Results []*KmsAPI `json:"results"`
}
// Validate validates this kms a p is response
func (m *KmsAPIsResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateResults(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *KmsAPIsResponse) validateResults(formats strfmt.Registry) error {
if swag.IsZero(m.Results) { // not required
return nil
}
for i := 0; i < len(m.Results); i++ {
if swag.IsZero(m.Results[i]) { // not required
continue
}
if m.Results[i] != nil {
if err := m.Results[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("results" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("results" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this kms a p is response based on the context it is used
func (m *KmsAPIsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateResults(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *KmsAPIsResponse) contextValidateResults(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Results); i++ {
if m.Results[i] != nil {
if err := m.Results[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("results" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("results" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *KmsAPIsResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *KmsAPIsResponse) UnmarshalBinary(b []byte) error {
var res KmsAPIsResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

76
models/kms_api.go Normal file
View File

@@ -0,0 +1,76 @@
// 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"
)
// KmsAPI kms API
//
// swagger:model kmsAPI
type KmsAPI struct {
// max body
MaxBody int64 `json:"maxBody,omitempty"`
// method
Method string `json:"method,omitempty"`
// path
Path string `json:"path,omitempty"`
// timeout
Timeout int64 `json:"timeout,omitempty"`
}
// Validate validates this kms API
func (m *KmsAPI) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this kms API based on context it is used
func (m *KmsAPI) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *KmsAPI) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *KmsAPI) UnmarshalBinary(b []byte) error {
var res KmsAPI
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"
)
// KmsAssignPolicyRequest kms assign policy request
//
// swagger:model kmsAssignPolicyRequest
type KmsAssignPolicyRequest struct {
// identity
Identity string `json:"identity,omitempty"`
}
// Validate validates this kms assign policy request
func (m *KmsAssignPolicyRequest) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this kms assign policy request based on context it is used
func (m *KmsAssignPolicyRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *KmsAssignPolicyRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *KmsAssignPolicyRequest) UnmarshalBinary(b []byte) error {
var res KmsAssignPolicyRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

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 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"
)
// KmsCreateKeyRequest kms create key request
//
// swagger:model kmsCreateKeyRequest
type KmsCreateKeyRequest struct {
// key
// Required: true
Key *string `json:"key"`
}
// Validate validates this kms create key request
func (m *KmsCreateKeyRequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateKey(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *KmsCreateKeyRequest) validateKey(formats strfmt.Registry) error {
if err := validate.Required("key", "body", m.Key); err != nil {
return err
}
return nil
}
// ContextValidate validates this kms create key request based on context it is used
func (m *KmsCreateKeyRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *KmsCreateKeyRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *KmsCreateKeyRequest) UnmarshalBinary(b []byte) error {
var res KmsCreateKeyRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,28 @@
// 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
// KmsDescribeIdentityRequest kms describe identity request
//
// swagger:model kmsDescribeIdentityRequest
type KmsDescribeIdentityRequest interface{}

View File

@@ -0,0 +1,79 @@
// 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"
)
// KmsDescribeIdentityResponse kms describe identity response
//
// swagger:model kmsDescribeIdentityResponse
type KmsDescribeIdentityResponse struct {
// admin
Admin bool `json:"admin,omitempty"`
// created at
CreatedAt string `json:"createdAt,omitempty"`
// created by
CreatedBy string `json:"createdBy,omitempty"`
// identity
Identity string `json:"identity,omitempty"`
// policy
Policy string `json:"policy,omitempty"`
}
// Validate validates this kms describe identity response
func (m *KmsDescribeIdentityResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this kms describe identity response based on context it is used
func (m *KmsDescribeIdentityResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *KmsDescribeIdentityResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *KmsDescribeIdentityResponse) UnmarshalBinary(b []byte) error {
var res KmsDescribeIdentityResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,28 @@
// 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
// KmsDescribePolicyRequest kms describe policy request
//
// swagger:model kmsDescribePolicyRequest
type KmsDescribePolicyRequest interface{}

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"
)
// KmsDescribePolicyResponse kms describe policy response
//
// swagger:model kmsDescribePolicyResponse
type KmsDescribePolicyResponse struct {
// created at
CreatedAt string `json:"createdAt,omitempty"`
// created by
CreatedBy string `json:"createdBy,omitempty"`
// name
Name string `json:"name,omitempty"`
}
// Validate validates this kms describe policy response
func (m *KmsDescribePolicyResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this kms describe policy response based on context it is used
func (m *KmsDescribePolicyResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *KmsDescribePolicyResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *KmsDescribePolicyResponse) UnmarshalBinary(b []byte) error {
var res KmsDescribePolicyResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,28 @@
// 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
// KmsDescribeSelfIdentityRequest kms describe self identity request
//
// swagger:model kmsDescribeSelfIdentityRequest
type KmsDescribeSelfIdentityRequest interface{}

View File

@@ -0,0 +1,136 @@
// 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"
)
// KmsDescribeSelfIdentityResponse kms describe self identity response
//
// swagger:model kmsDescribeSelfIdentityResponse
type KmsDescribeSelfIdentityResponse struct {
// admin
Admin bool `json:"admin,omitempty"`
// created at
CreatedAt string `json:"createdAt,omitempty"`
// created by
CreatedBy string `json:"createdBy,omitempty"`
// identity
Identity string `json:"identity,omitempty"`
// policy
Policy *KmsGetPolicyResponse `json:"policy,omitempty"`
// policy name
PolicyName string `json:"policyName,omitempty"`
}
// Validate validates this kms describe self identity response
func (m *KmsDescribeSelfIdentityResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validatePolicy(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *KmsDescribeSelfIdentityResponse) validatePolicy(formats strfmt.Registry) error {
if swag.IsZero(m.Policy) { // not required
return nil
}
if m.Policy != nil {
if err := m.Policy.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("policy")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("policy")
}
return err
}
}
return nil
}
// ContextValidate validate this kms describe self identity response based on the context it is used
func (m *KmsDescribeSelfIdentityResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidatePolicy(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *KmsDescribeSelfIdentityResponse) contextValidatePolicy(ctx context.Context, formats strfmt.Registry) error {
if m.Policy != nil {
if err := m.Policy.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("policy")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("policy")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *KmsDescribeSelfIdentityResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *KmsDescribeSelfIdentityResponse) UnmarshalBinary(b []byte) error {
var res KmsDescribeSelfIdentityResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

70
models/kms_endpoint.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"
)
// KmsEndpoint kms endpoint
//
// swagger:model kmsEndpoint
type KmsEndpoint struct {
// status
Status string `json:"status,omitempty"`
// url
URL string `json:"url,omitempty"`
}
// Validate validates this kms endpoint
func (m *KmsEndpoint) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this kms endpoint based on context it is used
func (m *KmsEndpoint) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *KmsEndpoint) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *KmsEndpoint) UnmarshalBinary(b []byte) error {
var res KmsEndpoint
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,28 @@
// 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
// KmsGetPolicyRequest kms get policy request
//
// swagger:model kmsGetPolicyRequest
type KmsGetPolicyRequest interface{}

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"
)
// KmsGetPolicyResponse kms get policy response
//
// swagger:model kmsGetPolicyResponse
type KmsGetPolicyResponse struct {
// allow
Allow []string `json:"allow"`
// deny
Deny []string `json:"deny"`
}
// Validate validates this kms get policy response
func (m *KmsGetPolicyResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this kms get policy response based on context it is used
func (m *KmsGetPolicyResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *KmsGetPolicyResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *KmsGetPolicyResponse) UnmarshalBinary(b []byte) error {
var res KmsGetPolicyResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,79 @@
// 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"
)
// KmsIdentityInfo kms identity info
//
// swagger:model kmsIdentityInfo
type KmsIdentityInfo struct {
// created at
CreatedAt string `json:"createdAt,omitempty"`
// created by
CreatedBy string `json:"createdBy,omitempty"`
// error
Error string `json:"error,omitempty"`
// identity
Identity string `json:"identity,omitempty"`
// policy
Policy string `json:"policy,omitempty"`
}
// Validate validates this kms identity info
func (m *KmsIdentityInfo) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this kms identity info based on context it is used
func (m *KmsIdentityInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *KmsIdentityInfo) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *KmsIdentityInfo) UnmarshalBinary(b []byte) error {
var res KmsIdentityInfo
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

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 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"
)
// KmsImportKeyRequest kms import key request
//
// swagger:model kmsImportKeyRequest
type KmsImportKeyRequest struct {
// bytes
// Required: true
Bytes *string `json:"bytes"`
}
// Validate validates this kms import key request
func (m *KmsImportKeyRequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateBytes(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *KmsImportKeyRequest) validateBytes(formats strfmt.Registry) error {
if err := validate.Required("bytes", "body", m.Bytes); err != nil {
return err
}
return nil
}
// ContextValidate validates this kms import key request based on context it is used
func (m *KmsImportKeyRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *KmsImportKeyRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *KmsImportKeyRequest) UnmarshalBinary(b []byte) error {
var res KmsImportKeyRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

73
models/kms_key_info.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"
)
// KmsKeyInfo kms key info
//
// swagger:model kmsKeyInfo
type KmsKeyInfo struct {
// created at
CreatedAt string `json:"createdAt,omitempty"`
// created by
CreatedBy string `json:"createdBy,omitempty"`
// name
Name string `json:"name,omitempty"`
}
// Validate validates this kms key info
func (m *KmsKeyInfo) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this kms key info based on context it is used
func (m *KmsKeyInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *KmsKeyInfo) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *KmsKeyInfo) UnmarshalBinary(b []byte) error {
var res KmsKeyInfo
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,28 @@
// 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
// KmsKeyStatusRequest kms key status request
//
// swagger:model kmsKeyStatusRequest
type KmsKeyStatusRequest interface{}

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"
)
// KmsKeyStatusResponse kms key status response
//
// swagger:model kmsKeyStatusResponse
type KmsKeyStatusResponse struct {
// decryption err
DecryptionErr string `json:"decryptionErr,omitempty"`
// encryption err
EncryptionErr string `json:"encryptionErr,omitempty"`
// key ID
KeyID string `json:"keyID,omitempty"`
}
// Validate validates this kms key status response
func (m *KmsKeyStatusResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this kms key status response based on context it is used
func (m *KmsKeyStatusResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *KmsKeyStatusResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *KmsKeyStatusResponse) UnmarshalBinary(b []byte) error {
var res KmsKeyStatusResponse
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"
)
// KmsLatencyHistogram kms latency histogram
//
// swagger:model kmsLatencyHistogram
type KmsLatencyHistogram struct {
// duration
Duration int64 `json:"duration,omitempty"`
}
// Validate validates this kms latency histogram
func (m *KmsLatencyHistogram) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this kms latency histogram based on context it is used
func (m *KmsLatencyHistogram) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *KmsLatencyHistogram) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *KmsLatencyHistogram) UnmarshalBinary(b []byte) error {
var res KmsLatencyHistogram
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = 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 models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// KmsListIdentitiesResponse kms list identities response
//
// swagger:model kmsListIdentitiesResponse
type KmsListIdentitiesResponse struct {
// results
Results []*KmsIdentityInfo `json:"results"`
}
// Validate validates this kms list identities response
func (m *KmsListIdentitiesResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateResults(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *KmsListIdentitiesResponse) validateResults(formats strfmt.Registry) error {
if swag.IsZero(m.Results) { // not required
return nil
}
for i := 0; i < len(m.Results); i++ {
if swag.IsZero(m.Results[i]) { // not required
continue
}
if m.Results[i] != nil {
if err := m.Results[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("results" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("results" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this kms list identities response based on the context it is used
func (m *KmsListIdentitiesResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateResults(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *KmsListIdentitiesResponse) contextValidateResults(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Results); i++ {
if m.Results[i] != nil {
if err := m.Results[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("results" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("results" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *KmsListIdentitiesResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *KmsListIdentitiesResponse) UnmarshalBinary(b []byte) error {
var res KmsListIdentitiesResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = 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 models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// KmsListKeysResponse kms list keys response
//
// swagger:model kmsListKeysResponse
type KmsListKeysResponse struct {
// results
Results []*KmsKeyInfo `json:"results"`
}
// Validate validates this kms list keys response
func (m *KmsListKeysResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateResults(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *KmsListKeysResponse) validateResults(formats strfmt.Registry) error {
if swag.IsZero(m.Results) { // not required
return nil
}
for i := 0; i < len(m.Results); i++ {
if swag.IsZero(m.Results[i]) { // not required
continue
}
if m.Results[i] != nil {
if err := m.Results[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("results" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("results" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this kms list keys response based on the context it is used
func (m *KmsListKeysResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateResults(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *KmsListKeysResponse) contextValidateResults(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Results); i++ {
if m.Results[i] != nil {
if err := m.Results[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("results" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("results" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *KmsListKeysResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *KmsListKeysResponse) UnmarshalBinary(b []byte) error {
var res KmsListKeysResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,28 @@
// 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
// KmsListPoliciesRequest kms list policies request
//
// swagger:model kmsListPoliciesRequest
type KmsListPoliciesRequest interface{}

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 models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// KmsListPoliciesResponse kms list policies response
//
// swagger:model kmsListPoliciesResponse
type KmsListPoliciesResponse struct {
// results
Results []*KmsPolicyInfo `json:"results"`
}
// Validate validates this kms list policies response
func (m *KmsListPoliciesResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateResults(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *KmsListPoliciesResponse) validateResults(formats strfmt.Registry) error {
if swag.IsZero(m.Results) { // not required
return nil
}
for i := 0; i < len(m.Results); i++ {
if swag.IsZero(m.Results[i]) { // not required
continue
}
if m.Results[i] != nil {
if err := m.Results[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("results" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("results" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this kms list policies response based on the context it is used
func (m *KmsListPoliciesResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateResults(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *KmsListPoliciesResponse) contextValidateResults(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Results); i++ {
if m.Results[i] != nil {
if err := m.Results[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("results" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("results" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *KmsListPoliciesResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *KmsListPoliciesResponse) UnmarshalBinary(b []byte) error {
var res KmsListPoliciesResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,331 @@
// 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"
)
// KmsMetricsResponse kms metrics response
//
// swagger:model kmsMetricsResponse
type KmsMetricsResponse struct {
// audit events
// Required: true
AuditEvents *int64 `json:"auditEvents"`
// cpus
// Required: true
Cpus *int64 `json:"cpus"`
// error events
// Required: true
ErrorEvents *int64 `json:"errorEvents"`
// heap alloc
// Required: true
HeapAlloc *int64 `json:"heapAlloc"`
// heap objects
HeapObjects int64 `json:"heapObjects,omitempty"`
// latency histogram
// Required: true
LatencyHistogram *KmsLatencyHistogram `json:"latencyHistogram"`
// request active
// Required: true
RequestActive *int64 `json:"requestActive"`
// request err
// Required: true
RequestErr *int64 `json:"requestErr"`
// request fail
// Required: true
RequestFail *int64 `json:"requestFail"`
// request o k
// Required: true
RequestOK *int64 `json:"requestOK"`
// stack alloc
// Required: true
StackAlloc *int64 `json:"stackAlloc"`
// threads
// Required: true
Threads *int64 `json:"threads"`
// uptime
// Required: true
Uptime *int64 `json:"uptime"`
// usable c p us
// Required: true
UsableCPUs *int64 `json:"usableCPUs"`
}
// Validate validates this kms metrics response
func (m *KmsMetricsResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAuditEvents(formats); err != nil {
res = append(res, err)
}
if err := m.validateCpus(formats); err != nil {
res = append(res, err)
}
if err := m.validateErrorEvents(formats); err != nil {
res = append(res, err)
}
if err := m.validateHeapAlloc(formats); err != nil {
res = append(res, err)
}
if err := m.validateLatencyHistogram(formats); err != nil {
res = append(res, err)
}
if err := m.validateRequestActive(formats); err != nil {
res = append(res, err)
}
if err := m.validateRequestErr(formats); err != nil {
res = append(res, err)
}
if err := m.validateRequestFail(formats); err != nil {
res = append(res, err)
}
if err := m.validateRequestOK(formats); err != nil {
res = append(res, err)
}
if err := m.validateStackAlloc(formats); err != nil {
res = append(res, err)
}
if err := m.validateThreads(formats); err != nil {
res = append(res, err)
}
if err := m.validateUptime(formats); err != nil {
res = append(res, err)
}
if err := m.validateUsableCPUs(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *KmsMetricsResponse) validateAuditEvents(formats strfmt.Registry) error {
if err := validate.Required("auditEvents", "body", m.AuditEvents); err != nil {
return err
}
return nil
}
func (m *KmsMetricsResponse) validateCpus(formats strfmt.Registry) error {
if err := validate.Required("cpus", "body", m.Cpus); err != nil {
return err
}
return nil
}
func (m *KmsMetricsResponse) validateErrorEvents(formats strfmt.Registry) error {
if err := validate.Required("errorEvents", "body", m.ErrorEvents); err != nil {
return err
}
return nil
}
func (m *KmsMetricsResponse) validateHeapAlloc(formats strfmt.Registry) error {
if err := validate.Required("heapAlloc", "body", m.HeapAlloc); err != nil {
return err
}
return nil
}
func (m *KmsMetricsResponse) validateLatencyHistogram(formats strfmt.Registry) error {
if err := validate.Required("latencyHistogram", "body", m.LatencyHistogram); err != nil {
return err
}
if m.LatencyHistogram != nil {
if err := m.LatencyHistogram.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("latencyHistogram")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("latencyHistogram")
}
return err
}
}
return nil
}
func (m *KmsMetricsResponse) validateRequestActive(formats strfmt.Registry) error {
if err := validate.Required("requestActive", "body", m.RequestActive); err != nil {
return err
}
return nil
}
func (m *KmsMetricsResponse) validateRequestErr(formats strfmt.Registry) error {
if err := validate.Required("requestErr", "body", m.RequestErr); err != nil {
return err
}
return nil
}
func (m *KmsMetricsResponse) validateRequestFail(formats strfmt.Registry) error {
if err := validate.Required("requestFail", "body", m.RequestFail); err != nil {
return err
}
return nil
}
func (m *KmsMetricsResponse) validateRequestOK(formats strfmt.Registry) error {
if err := validate.Required("requestOK", "body", m.RequestOK); err != nil {
return err
}
return nil
}
func (m *KmsMetricsResponse) validateStackAlloc(formats strfmt.Registry) error {
if err := validate.Required("stackAlloc", "body", m.StackAlloc); err != nil {
return err
}
return nil
}
func (m *KmsMetricsResponse) validateThreads(formats strfmt.Registry) error {
if err := validate.Required("threads", "body", m.Threads); err != nil {
return err
}
return nil
}
func (m *KmsMetricsResponse) validateUptime(formats strfmt.Registry) error {
if err := validate.Required("uptime", "body", m.Uptime); err != nil {
return err
}
return nil
}
func (m *KmsMetricsResponse) validateUsableCPUs(formats strfmt.Registry) error {
if err := validate.Required("usableCPUs", "body", m.UsableCPUs); err != nil {
return err
}
return nil
}
// ContextValidate validate this kms metrics response based on the context it is used
func (m *KmsMetricsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateLatencyHistogram(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *KmsMetricsResponse) contextValidateLatencyHistogram(ctx context.Context, formats strfmt.Registry) error {
if m.LatencyHistogram != nil {
if err := m.LatencyHistogram.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("latencyHistogram")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("latencyHistogram")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *KmsMetricsResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *KmsMetricsResponse) UnmarshalBinary(b []byte) error {
var res KmsMetricsResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

73
models/kms_policy_info.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"
)
// KmsPolicyInfo kms policy info
//
// swagger:model kmsPolicyInfo
type KmsPolicyInfo struct {
// created at
CreatedAt string `json:"createdAt,omitempty"`
// created by
CreatedBy string `json:"createdBy,omitempty"`
// name
Name string `json:"name,omitempty"`
}
// Validate validates this kms policy info
func (m *KmsPolicyInfo) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this kms policy info based on context it is used
func (m *KmsPolicyInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *KmsPolicyInfo) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *KmsPolicyInfo) UnmarshalBinary(b []byte) error {
var res KmsPolicyInfo
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,94 @@
// 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"
)
// KmsSetPolicyRequest kms set policy request
//
// swagger:model kmsSetPolicyRequest
type KmsSetPolicyRequest struct {
// allow
Allow []string `json:"allow"`
// deny
Deny []string `json:"deny"`
// policy
// Required: true
Policy *string `json:"policy"`
}
// Validate validates this kms set policy request
func (m *KmsSetPolicyRequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validatePolicy(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *KmsSetPolicyRequest) validatePolicy(formats strfmt.Registry) error {
if err := validate.Required("policy", "body", m.Policy); err != nil {
return err
}
return nil
}
// ContextValidate validates this kms set policy request based on context it is used
func (m *KmsSetPolicyRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *KmsSetPolicyRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *KmsSetPolicyRequest) UnmarshalBinary(b []byte) error {
var res KmsSetPolicyRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,28 @@
// 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
// KmsStatusRequest kms status request
//
// swagger:model kmsStatusRequest
type KmsStatusRequest interface{}

View File

@@ -0,0 +1,139 @@
// 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"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// KmsStatusResponse kms status response
//
// swagger:model kmsStatusResponse
type KmsStatusResponse struct {
// default key ID
DefaultKeyID string `json:"defaultKeyID,omitempty"`
// endpoints
Endpoints []*KmsEndpoint `json:"endpoints"`
// name
Name string `json:"name,omitempty"`
}
// Validate validates this kms status response
func (m *KmsStatusResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateEndpoints(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *KmsStatusResponse) validateEndpoints(formats strfmt.Registry) error {
if swag.IsZero(m.Endpoints) { // not required
return nil
}
for i := 0; i < len(m.Endpoints); i++ {
if swag.IsZero(m.Endpoints[i]) { // not required
continue
}
if m.Endpoints[i] != nil {
if err := m.Endpoints[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("endpoints" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("endpoints" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this kms status response based on the context it is used
func (m *KmsStatusResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateEndpoints(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *KmsStatusResponse) contextValidateEndpoints(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Endpoints); i++ {
if m.Endpoints[i] != nil {
if err := m.Endpoints[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("endpoints" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("endpoints" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *KmsStatusResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *KmsStatusResponse) UnmarshalBinary(b []byte) error {
var res KmsStatusResponse
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"
)
// KmsVersionResponse kms version response
//
// swagger:model kmsVersionResponse
type KmsVersionResponse struct {
// version
Version string `json:"version,omitempty"`
}
// Validate validates this kms version response
func (m *KmsVersionResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this kms version response based on context it is used
func (m *KmsVersionResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *KmsVersionResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *KmsVersionResponse) UnmarshalBinary(b []byte) error {
var res KmsVersionResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -37,12 +37,18 @@ import (
// swagger:model loginDetails
type LoginDetails struct {
// display names
DisplayNames []string `json:"displayNames"`
// is direct p v
IsDirectPV bool `json:"isDirectPV,omitempty"`
// login strategy
// Enum: [form redirect service-account redirect-service-account]
LoginStrategy string `json:"loginStrategy,omitempty"`
// redirect
Redirect string `json:"redirect,omitempty"`
Redirect []string `json:"redirect"`
}
// Validate validates this login details

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

@@ -37,6 +37,9 @@ import (
// swagger:model operatorSessionResponse
type OperatorSessionResponse struct {
// direct p v
DirectPV bool `json:"directPV,omitempty"`
// features
Features []string `json:"features"`

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

@@ -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"
)
// OperatorSubnetRegisterAPIKeyResponse operator subnet register API key response
//
// swagger:model operatorSubnetRegisterAPIKeyResponse
type OperatorSubnetRegisterAPIKeyResponse struct {
// registered
Registered bool `json:"registered,omitempty"`
}
// Validate validates this operator subnet register API key response
func (m *OperatorSubnetRegisterAPIKeyResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this operator subnet register API key response based on context it is used
func (m *OperatorSubnetRegisterAPIKeyResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *OperatorSubnetRegisterAPIKeyResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *OperatorSubnetRegisterAPIKeyResponse) UnmarshalBinary(b []byte) error {
var res OperatorSubnetRegisterAPIKeyResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -46,8 +46,14 @@ type Principal struct {
// account access key
AccountAccessKey string `json:"accountAccessKey,omitempty"`
// custom style ob
CustomStyleOb string `json:"customStyleOb,omitempty"`
// hm
Hm bool `json:"hm,omitempty"`
// ob
Ob bool `json:"ob,omitempty"`
}
// Validate validates this principal

View File

@@ -29,10 +29,10 @@ import (
"github.com/go-openapi/swag"
)
// CsiFormatErrorResponse csi format error response
// PvFormatErrorResponse pv format error response
//
// swagger:model csiFormatErrorResponse
type CsiFormatErrorResponse struct {
// swagger:model pvFormatErrorResponse
type PvFormatErrorResponse struct {
// drive
Drive string `json:"drive,omitempty"`
@@ -44,18 +44,18 @@ type CsiFormatErrorResponse struct {
Node string `json:"node,omitempty"`
}
// Validate validates this csi format error response
func (m *CsiFormatErrorResponse) Validate(formats strfmt.Registry) error {
// Validate validates this pv format error response
func (m *PvFormatErrorResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this csi format error response based on context it is used
func (m *CsiFormatErrorResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
// ContextValidate validates this pv format error response based on context it is used
func (m *PvFormatErrorResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *CsiFormatErrorResponse) MarshalBinary() ([]byte, error) {
func (m *PvFormatErrorResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@@ -63,8 +63,8 @@ func (m *CsiFormatErrorResponse) MarshalBinary() ([]byte, error) {
}
// UnmarshalBinary interface implementation
func (m *CsiFormatErrorResponse) UnmarshalBinary(b []byte) error {
var res CsiFormatErrorResponse
func (m *PvFormatErrorResponse) UnmarshalBinary(b []byte) error {
var res PvFormatErrorResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}

View File

@@ -37,8 +37,10 @@ import (
type SecurityContext struct {
// fs group
// Required: true
FsGroup *string `json:"fsGroup"`
FsGroup string `json:"fsGroup,omitempty"`
// fs group change policy
FsGroupChangePolicy string `json:"fsGroupChangePolicy,omitempty"`
// run as group
// Required: true
@@ -57,10 +59,6 @@ type SecurityContext struct {
func (m *SecurityContext) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateFsGroup(formats); err != nil {
res = append(res, err)
}
if err := m.validateRunAsGroup(formats); err != nil {
res = append(res, err)
}
@@ -79,15 +77,6 @@ func (m *SecurityContext) Validate(formats strfmt.Registry) error {
return nil
}
func (m *SecurityContext) validateFsGroup(formats strfmt.Registry) error {
if err := validate.Required("fsGroup", "body", m.FsGroup); err != nil {
return err
}
return nil
}
func (m *SecurityContext) validateRunAsGroup(formats strfmt.Registry) error {
if err := validate.Required("runAsGroup", "body", m.RunAsGroup); err != nil {

View File

@@ -41,9 +41,15 @@ type SessionResponse struct {
// allow resources
AllowResources []*PermissionResource `json:"allowResources"`
// custom styles
CustomStyles string `json:"customStyles,omitempty"`
// distributed mode
DistributedMode bool `json:"distributedMode,omitempty"`
// env constants
EnvConstants *EnvironmentConstants `json:"envConstants,omitempty"`
// features
Features []string `json:"features"`
@@ -53,6 +59,9 @@ type SessionResponse struct {
// permissions
Permissions map[string][]string `json:"permissions,omitempty"`
// server end point
ServerEndPoint string `json:"serverEndPoint,omitempty"`
// status
// Enum: [ok]
Status string `json:"status,omitempty"`
@@ -66,6 +75,10 @@ func (m *SessionResponse) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
if err := m.validateEnvConstants(formats); err != nil {
res = append(res, err)
}
if err := m.validateStatus(formats); err != nil {
res = append(res, err)
}
@@ -102,6 +115,25 @@ func (m *SessionResponse) validateAllowResources(formats strfmt.Registry) error
return nil
}
func (m *SessionResponse) validateEnvConstants(formats strfmt.Registry) error {
if swag.IsZero(m.EnvConstants) { // not required
return nil
}
if m.EnvConstants != nil {
if err := m.EnvConstants.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("envConstants")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("envConstants")
}
return err
}
}
return nil
}
var sessionResponseTypeStatusPropEnum []interface{}
func init() {
@@ -149,6 +181,10 @@ func (m *SessionResponse) ContextValidate(ctx context.Context, formats strfmt.Re
res = append(res, err)
}
if err := m.contextValidateEnvConstants(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
@@ -175,6 +211,22 @@ func (m *SessionResponse) contextValidateAllowResources(ctx context.Context, for
return nil
}
func (m *SessionResponse) contextValidateEnvConstants(ctx context.Context, formats strfmt.Registry) error {
if m.EnvConstants != nil {
if err := m.EnvConstants.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("envConstants")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("envConstants")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *SessionResponse) MarshalBinary() ([]byte, error) {
if m == 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"
)
// 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

@@ -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 models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// TenantConfigurationResponse tenant configuration response
//
// swagger:model tenantConfigurationResponse
type TenantConfigurationResponse struct {
// environment variables
EnvironmentVariables []*EnvironmentVariable `json:"environmentVariables"`
}
// Validate validates this tenant configuration response
func (m *TenantConfigurationResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateEnvironmentVariables(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *TenantConfigurationResponse) validateEnvironmentVariables(formats strfmt.Registry) error {
if swag.IsZero(m.EnvironmentVariables) { // not required
return nil
}
for i := 0; i < len(m.EnvironmentVariables); i++ {
if swag.IsZero(m.EnvironmentVariables[i]) { // not required
continue
}
if m.EnvironmentVariables[i] != nil {
if err := m.EnvironmentVariables[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("environmentVariables" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("environmentVariables" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this tenant configuration response based on the context it is used
func (m *TenantConfigurationResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateEnvironmentVariables(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *TenantConfigurationResponse) contextValidateEnvironmentVariables(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.EnvironmentVariables); i++ {
if m.EnvironmentVariables[i] != nil {
if err := m.EnvironmentVariables[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("environmentVariables" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("environmentVariables" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *TenantConfigurationResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TenantConfigurationResponse) UnmarshalBinary(b []byte) error {
var res TenantConfigurationResponse
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 {
@@ -129,6 +175,9 @@ func (m *TenantSecurityResponse) UnmarshalBinary(b []byte) error {
// swagger:model TenantSecurityResponseCustomCertificates
type TenantSecurityResponseCustomCertificates struct {
// client
Client []*CertificateInfo `json:"client"`
// minio
Minio []*CertificateInfo `json:"minio"`
@@ -140,6 +189,10 @@ type TenantSecurityResponseCustomCertificates struct {
func (m *TenantSecurityResponseCustomCertificates) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateClient(formats); err != nil {
res = append(res, err)
}
if err := m.validateMinio(formats); err != nil {
res = append(res, err)
}
@@ -154,6 +207,32 @@ func (m *TenantSecurityResponseCustomCertificates) Validate(formats strfmt.Regis
return nil
}
func (m *TenantSecurityResponseCustomCertificates) validateClient(formats strfmt.Registry) error {
if swag.IsZero(m.Client) { // not required
return nil
}
for i := 0; i < len(m.Client); i++ {
if swag.IsZero(m.Client[i]) { // not required
continue
}
if m.Client[i] != nil {
if err := m.Client[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("customCertificates" + "." + "client" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("customCertificates" + "." + "client" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *TenantSecurityResponseCustomCertificates) validateMinio(formats strfmt.Registry) error {
if swag.IsZero(m.Minio) { // not required
return nil
@@ -210,6 +289,10 @@ func (m *TenantSecurityResponseCustomCertificates) validateMinioCAs(formats strf
func (m *TenantSecurityResponseCustomCertificates) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateClient(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateMinio(ctx, formats); err != nil {
res = append(res, err)
}
@@ -224,6 +307,26 @@ func (m *TenantSecurityResponseCustomCertificates) ContextValidate(ctx context.C
return nil
}
func (m *TenantSecurityResponseCustomCertificates) contextValidateClient(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Client); i++ {
if m.Client[i] != nil {
if err := m.Client[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("customCertificates" + "." + "client" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("customCertificates" + "." + "client" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *TenantSecurityResponseCustomCertificates) contextValidateMinio(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Minio); i++ {

View File

@@ -43,11 +43,14 @@ type Tier struct {
// gcs
Gcs *TierGcs `json:"gcs,omitempty"`
// minio
Minio *TierMinio `json:"minio,omitempty"`
// s3
S3 *TierS3 `json:"s3,omitempty"`
// type
// Enum: [s3 gcs azure unsupported]
// Enum: [s3 gcs azure minio unsupported]
Type string `json:"type,omitempty"`
}
@@ -63,6 +66,10 @@ func (m *Tier) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
if err := m.validateMinio(formats); err != nil {
res = append(res, err)
}
if err := m.validateS3(formats); err != nil {
res = append(res, err)
}
@@ -115,6 +122,25 @@ func (m *Tier) validateGcs(formats strfmt.Registry) error {
return nil
}
func (m *Tier) validateMinio(formats strfmt.Registry) error {
if swag.IsZero(m.Minio) { // not required
return nil
}
if m.Minio != nil {
if err := m.Minio.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("minio")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("minio")
}
return err
}
}
return nil
}
func (m *Tier) validateS3(formats strfmt.Registry) error {
if swag.IsZero(m.S3) { // not required
return nil
@@ -138,7 +164,7 @@ var tierTypeTypePropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["s3","gcs","azure","unsupported"]`), &res); err != nil {
if err := json.Unmarshal([]byte(`["s3","gcs","azure","minio","unsupported"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
@@ -157,6 +183,9 @@ const (
// TierTypeAzure captures enum value "azure"
TierTypeAzure string = "azure"
// TierTypeMinio captures enum value "minio"
TierTypeMinio string = "minio"
// TierTypeUnsupported captures enum value "unsupported"
TierTypeUnsupported string = "unsupported"
)
@@ -194,6 +223,10 @@ func (m *Tier) ContextValidate(ctx context.Context, formats strfmt.Registry) err
res = append(res, err)
}
if err := m.contextValidateMinio(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateS3(ctx, formats); err != nil {
res = append(res, err)
}
@@ -236,6 +269,22 @@ func (m *Tier) contextValidateGcs(ctx context.Context, formats strfmt.Registry)
return nil
}
func (m *Tier) contextValidateMinio(ctx context.Context, formats strfmt.Registry) error {
if m.Minio != nil {
if err := m.Minio.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("minio")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("minio")
}
return err
}
}
return nil
}
func (m *Tier) contextValidateS3(ctx context.Context, formats strfmt.Registry) error {
if m.S3 != nil {

97
models/tier_minio.go Normal file
View File

@@ -0,0 +1,97 @@
// 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"
)
// TierMinio tier minio
//
// swagger:model tier_minio
type TierMinio struct {
// accesskey
Accesskey string `json:"accesskey,omitempty"`
// bucket
Bucket string `json:"bucket,omitempty"`
// endpoint
Endpoint string `json:"endpoint,omitempty"`
// name
Name string `json:"name,omitempty"`
// objects
Objects string `json:"objects,omitempty"`
// prefix
Prefix string `json:"prefix,omitempty"`
// region
Region string `json:"region,omitempty"`
// secretkey
Secretkey string `json:"secretkey,omitempty"`
// storageclass
Storageclass string `json:"storageclass,omitempty"`
// usage
Usage string `json:"usage,omitempty"`
// versions
Versions string `json:"versions,omitempty"`
}
// Validate validates this tier minio
func (m *TierMinio) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this tier minio based on context it is used
func (m *TierMinio) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *TierMinio) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *TierMinio) UnmarshalBinary(b []byte) error {
var res TierMinio
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -36,18 +36,25 @@ import (
// swagger:model tlsConfiguration
type TLSConfiguration struct {
// ca certificates
CaCertificates []string `json:"ca_certificates"`
// minio c as certificates
MinioCAsCertificates []string `json:"minioCAsCertificates"`
// minio
Minio []*KeyPairConfiguration `json:"minio"`
// minio client certificates
MinioClientCertificates []*KeyPairConfiguration `json:"minioClientCertificates"`
// minio server certificates
MinioServerCertificates []*KeyPairConfiguration `json:"minioServerCertificates"`
}
// Validate validates this tls configuration
func (m *TLSConfiguration) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateMinio(formats); err != nil {
if err := m.validateMinioClientCertificates(formats); err != nil {
res = append(res, err)
}
if err := m.validateMinioServerCertificates(formats); err != nil {
res = append(res, err)
}
@@ -57,22 +64,48 @@ func (m *TLSConfiguration) Validate(formats strfmt.Registry) error {
return nil
}
func (m *TLSConfiguration) validateMinio(formats strfmt.Registry) error {
if swag.IsZero(m.Minio) { // not required
func (m *TLSConfiguration) validateMinioClientCertificates(formats strfmt.Registry) error {
if swag.IsZero(m.MinioClientCertificates) { // not required
return nil
}
for i := 0; i < len(m.Minio); i++ {
if swag.IsZero(m.Minio[i]) { // not required
for i := 0; i < len(m.MinioClientCertificates); i++ {
if swag.IsZero(m.MinioClientCertificates[i]) { // not required
continue
}
if m.Minio[i] != nil {
if err := m.Minio[i].Validate(formats); err != nil {
if m.MinioClientCertificates[i] != nil {
if err := m.MinioClientCertificates[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("minio" + "." + strconv.Itoa(i))
return ve.ValidateName("minioClientCertificates" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("minio" + "." + strconv.Itoa(i))
return ce.ValidateName("minioClientCertificates" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *TLSConfiguration) validateMinioServerCertificates(formats strfmt.Registry) error {
if swag.IsZero(m.MinioServerCertificates) { // not required
return nil
}
for i := 0; i < len(m.MinioServerCertificates); i++ {
if swag.IsZero(m.MinioServerCertificates[i]) { // not required
continue
}
if m.MinioServerCertificates[i] != nil {
if err := m.MinioServerCertificates[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("minioServerCertificates" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("minioServerCertificates" + "." + strconv.Itoa(i))
}
return err
}
@@ -87,7 +120,11 @@ func (m *TLSConfiguration) validateMinio(formats strfmt.Registry) error {
func (m *TLSConfiguration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateMinio(ctx, formats); err != nil {
if err := m.contextValidateMinioClientCertificates(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateMinioServerCertificates(ctx, formats); err != nil {
res = append(res, err)
}
@@ -97,16 +134,36 @@ func (m *TLSConfiguration) ContextValidate(ctx context.Context, formats strfmt.R
return nil
}
func (m *TLSConfiguration) contextValidateMinio(ctx context.Context, formats strfmt.Registry) error {
func (m *TLSConfiguration) contextValidateMinioClientCertificates(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Minio); i++ {
for i := 0; i < len(m.MinioClientCertificates); i++ {
if m.Minio[i] != nil {
if err := m.Minio[i].ContextValidate(ctx, formats); err != nil {
if m.MinioClientCertificates[i] != nil {
if err := m.MinioClientCertificates[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("minio" + "." + strconv.Itoa(i))
return ve.ValidateName("minioClientCertificates" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("minio" + "." + strconv.Itoa(i))
return ce.ValidateName("minioClientCertificates" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *TLSConfiguration) contextValidateMinioServerCertificates(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.MinioServerCertificates); i++ {
if m.MinioServerCertificates[i] != nil {
if err := m.MinioServerCertificates[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("minioServerCertificates" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("minioServerCertificates" + "." + strconv.Itoa(i))
}
return err
}

View File

@@ -0,0 +1,136 @@
// 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"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// UpdateTenantConfigurationRequest update tenant configuration request
//
// swagger:model updateTenantConfigurationRequest
type UpdateTenantConfigurationRequest struct {
// environment variables
EnvironmentVariables []*EnvironmentVariable `json:"environmentVariables"`
// keys to be deleted
KeysToBeDeleted []string `json:"keysToBeDeleted"`
}
// Validate validates this update tenant configuration request
func (m *UpdateTenantConfigurationRequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateEnvironmentVariables(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *UpdateTenantConfigurationRequest) validateEnvironmentVariables(formats strfmt.Registry) error {
if swag.IsZero(m.EnvironmentVariables) { // not required
return nil
}
for i := 0; i < len(m.EnvironmentVariables); i++ {
if swag.IsZero(m.EnvironmentVariables[i]) { // not required
continue
}
if m.EnvironmentVariables[i] != nil {
if err := m.EnvironmentVariables[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("environmentVariables" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("environmentVariables" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this update tenant configuration request based on the context it is used
func (m *UpdateTenantConfigurationRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateEnvironmentVariables(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *UpdateTenantConfigurationRequest) contextValidateEnvironmentVariables(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.EnvironmentVariables); i++ {
if m.EnvironmentVariables[i] != nil {
if err := m.EnvironmentVariables[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("environmentVariables" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("environmentVariables" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *UpdateTenantConfigurationRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *UpdateTenantConfigurationRequest) UnmarshalBinary(b []byte) error {
var res UpdateTenantConfigurationRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return 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 {
@@ -129,11 +175,14 @@ func (m *UpdateTenantSecurityRequest) UnmarshalBinary(b []byte) error {
// swagger:model UpdateTenantSecurityRequestCustomCertificates
type UpdateTenantSecurityRequestCustomCertificates struct {
// minio
Minio []*KeyPairConfiguration `json:"minio"`
// minio c as certificates
MinioCAsCertificates []string `json:"minioCAsCertificates"`
// minio c as
MinioCAs []string `json:"minioCAs"`
// minio client certificates
MinioClientCertificates []*KeyPairConfiguration `json:"minioClientCertificates"`
// minio server certificates
MinioServerCertificates []*KeyPairConfiguration `json:"minioServerCertificates"`
// secrets to be deleted
SecretsToBeDeleted []string `json:"secretsToBeDeleted"`
@@ -143,7 +192,11 @@ type UpdateTenantSecurityRequestCustomCertificates struct {
func (m *UpdateTenantSecurityRequestCustomCertificates) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateMinio(formats); err != nil {
if err := m.validateMinioClientCertificates(formats); err != nil {
res = append(res, err)
}
if err := m.validateMinioServerCertificates(formats); err != nil {
res = append(res, err)
}
@@ -153,22 +206,48 @@ func (m *UpdateTenantSecurityRequestCustomCertificates) Validate(formats strfmt.
return nil
}
func (m *UpdateTenantSecurityRequestCustomCertificates) validateMinio(formats strfmt.Registry) error {
if swag.IsZero(m.Minio) { // not required
func (m *UpdateTenantSecurityRequestCustomCertificates) validateMinioClientCertificates(formats strfmt.Registry) error {
if swag.IsZero(m.MinioClientCertificates) { // not required
return nil
}
for i := 0; i < len(m.Minio); i++ {
if swag.IsZero(m.Minio[i]) { // not required
for i := 0; i < len(m.MinioClientCertificates); i++ {
if swag.IsZero(m.MinioClientCertificates[i]) { // not required
continue
}
if m.Minio[i] != nil {
if err := m.Minio[i].Validate(formats); err != nil {
if m.MinioClientCertificates[i] != nil {
if err := m.MinioClientCertificates[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("customCertificates" + "." + "minio" + "." + strconv.Itoa(i))
return ve.ValidateName("customCertificates" + "." + "minioClientCertificates" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("customCertificates" + "." + "minio" + "." + strconv.Itoa(i))
return ce.ValidateName("customCertificates" + "." + "minioClientCertificates" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *UpdateTenantSecurityRequestCustomCertificates) validateMinioServerCertificates(formats strfmt.Registry) error {
if swag.IsZero(m.MinioServerCertificates) { // not required
return nil
}
for i := 0; i < len(m.MinioServerCertificates); i++ {
if swag.IsZero(m.MinioServerCertificates[i]) { // not required
continue
}
if m.MinioServerCertificates[i] != nil {
if err := m.MinioServerCertificates[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("customCertificates" + "." + "minioServerCertificates" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("customCertificates" + "." + "minioServerCertificates" + "." + strconv.Itoa(i))
}
return err
}
@@ -183,7 +262,11 @@ func (m *UpdateTenantSecurityRequestCustomCertificates) validateMinio(formats st
func (m *UpdateTenantSecurityRequestCustomCertificates) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateMinio(ctx, formats); err != nil {
if err := m.contextValidateMinioClientCertificates(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateMinioServerCertificates(ctx, formats); err != nil {
res = append(res, err)
}
@@ -193,16 +276,36 @@ func (m *UpdateTenantSecurityRequestCustomCertificates) ContextValidate(ctx cont
return nil
}
func (m *UpdateTenantSecurityRequestCustomCertificates) contextValidateMinio(ctx context.Context, formats strfmt.Registry) error {
func (m *UpdateTenantSecurityRequestCustomCertificates) contextValidateMinioClientCertificates(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Minio); i++ {
for i := 0; i < len(m.MinioClientCertificates); i++ {
if m.Minio[i] != nil {
if err := m.Minio[i].ContextValidate(ctx, formats); err != nil {
if m.MinioClientCertificates[i] != nil {
if err := m.MinioClientCertificates[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("customCertificates" + "." + "minio" + "." + strconv.Itoa(i))
return ve.ValidateName("customCertificates" + "." + "minioClientCertificates" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("customCertificates" + "." + "minio" + "." + strconv.Itoa(i))
return ce.ValidateName("customCertificates" + "." + "minioClientCertificates" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *UpdateTenantSecurityRequestCustomCertificates) contextValidateMinioServerCertificates(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.MinioServerCertificates); i++ {
if m.MinioServerCertificates[i] != nil {
if err := m.MinioServerCertificates[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("customCertificates" + "." + "minioServerCertificates" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("customCertificates" + "." + "minioServerCertificates" + "." + strconv.Itoa(i))
}
return err
}

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

@@ -39,7 +39,10 @@ import (
"github.com/stretchr/testify/assert"
)
var token string
var (
token string
jwt string
)
func inspectHTTPResponse(httpResponse *http.Response) string {
/*
@@ -143,9 +146,6 @@ func TestMain(m *testing.M) {
fmt.Println("after 2 seconds sleep")
fmt.Println("creating the client")
client := &http.Client{
Timeout: 2 * time.Second,
}
// SA_TOKEN=$(kubectl -n minio-operator get secret console-sa-secret -o jsonpath="{.data.token}" | base64 --decode)
fmt.Println("Where we have the secret already: ")
@@ -170,29 +170,12 @@ func TestMain(m *testing.M) {
return
}
secret2 := out2.String()
secret3 := decodeBase64(secret2[1 : len(secret2)-1])
if secret3 == "" {
jwt := decodeBase64(secret2[1 : len(secret2)-1])
if jwt == "" {
fmt.Println("jwt cannot be empty string")
os.Exit(-1)
}
requestData := map[string]string{
"jwt": secret3,
}
fmt.Println("requestData: ", requestData)
requestDataJSON, _ := json.Marshal(requestData)
requestDataBody := bytes.NewReader(requestDataJSON)
request, err := http.NewRequest("POST", "http://localhost:9090/api/v1/login/operator", requestDataBody)
if err != nil {
log.Println(err)
return
}
request.Header.Add("Content-Type", "application/json")
response, err := client.Do(request)
response, err := LoginOperator()
if err != nil {
log.Println(err)
return
@@ -310,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")
@@ -436,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
@@ -476,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)
}
@@ -673,3 +835,473 @@ func TestGetMultipleCSRs(t *testing.T) {
assert.Equal(strings.Contains(finalResponse, element), true)
}
}
func ListPVCsForTenant(nameSpace string, tenant string) (*http.Response, error) {
/*
URL: /namespaces/{namespace}/tenants/{tenant}/pvcs
HTTP Verb: GET
*/
request, err := http.NewRequest(
"GET", "http://localhost:9090/api/v1/namespaces/"+nameSpace+"/tenants/"+tenant+"/pvcs/", 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 TestListPVCsForTenant(t *testing.T) {
/*
Function to list and verify the Tenant's Persistent Volume Claims
*/
assert := assert.New(t)
namespace := "tenant-lite"
tenant := "storage-lite"
resp, err := ListPVCsForTenant(namespace, tenant)
bodyResponse := resp.Body
assert.Nil(err)
if err != nil {
log.Println(err)
return
}
if resp != nil {
assert.Equal(
200, resp.StatusCode, "failed")
}
bodyBytes, _ := ioutil.ReadAll(bodyResponse)
listObjs := models.ListPVCsResponse{}
err = json.Unmarshal(bodyBytes, &listObjs)
if err != nil {
log.Println(err)
assert.Nil(err)
}
var pvcArray [4]string
pvcArray[0] = "data0-storage-lite-pool-0-0"
pvcArray[1] = "data0-storage-lite-pool-0-1"
pvcArray[2] = "data0-storage-lite-pool-0-2"
pvcArray[3] = "data0-storage-lite-pool-0-3"
for i := 0; i < len(pvcArray); i++ {
assert.Equal(strings.Contains(listObjs.Pvcs[i].Name, pvcArray[i]), true)
}
}
func CreateNamespace(nameSpace string) (*http.Response, error) {
/*
Description: Creates a new Namespace with given information
URL: /namespace
HTTP Verb: POST
*/
requestDataAdd := map[string]interface{}{
"name": nameSpace,
}
requestDataJSON, _ := json.Marshal(requestDataAdd)
requestDataBody := bytes.NewReader(requestDataJSON)
request, err := http.NewRequest(
"POST",
"http://localhost:9090/api/v1/namespace/",
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 TestCreateNamespace(t *testing.T) {
/*
Function to Create a Namespace only once.
*/
assert := assert.New(t)
namespace := "new-namespace-thujun2208pm"
tests := []struct {
name string
nameSpace string
expectedStatus int
}{
{
name: "Create Namespace for the first time",
expectedStatus: 201,
nameSpace: namespace,
},
{
name: "Create repeated namespace for second time",
expectedStatus: 500,
nameSpace: namespace,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
resp, err := CreateNamespace(tt.nameSpace)
assert.Nil(err)
if err != nil {
log.Println(err)
return
}
if resp != nil {
assert.Equal(
tt.expectedStatus, resp.StatusCode, "failed")
} else {
assert.Fail("resp cannot be nil")
}
})
}
}
func LoginOperator() (*http.Response, error) {
/*
Description: Login to Operator Console.
URL: /login/operator
Params in the Body: jwt
*/
requestData := map[string]string{
"jwt": jwt,
}
fmt.Println("requestData: ", requestData)
requestDataJSON, _ := json.Marshal(requestData)
requestDataBody := bytes.NewReader(requestDataJSON)
request, err := http.NewRequest("POST", "http://localhost:9090/api/v1/login/operator", requestDataBody)
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 LogoutOperator() (*http.Response, error) {
/*
Description: Logout from Operator.
URL: /logout
*/
request, err := http.NewRequest(
"POST",
"http://localhost:9090/api/v1/logout",
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 TestLogout(t *testing.T) {
// Vars
assert := assert.New(t)
// 1. Logout
response, err := LogoutOperator()
if err != nil {
log.Println(err)
return
}
if response != nil {
assert.Equal(
200,
response.StatusCode,
inspectHTTPResponse(response),
)
}
// 2. Login to recover token
response, err = LoginOperator()
if err != nil {
log.Println(err)
return
}
if response != nil {
for _, cookie := range response.Cookies() {
if cookie.Name == "token" {
token = cookie.Value
break
}
}
}
// Verify token
if token == "" {
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

@@ -69,3 +69,10 @@ func getK8sSAToken() string {
func getMarketplace() string {
return env.Get(ConsoleMarketplace, "")
}
// Get DirectPVMode
func getDirectPVEnabled() bool {
currentMode := env.Get(DirectPVMode, "off")
return currentMode == "on"
}

View File

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

View File

@@ -25,6 +25,9 @@ const (
prometheusPath = "prometheus.io/path"
prometheusPort = "prometheus.io/port"
prometheusScrape = "prometheus.io/scrape"
// Constants for DirectPV
DirectPVMode = "DIRECTPV_MODE"
)
// Image versions

328
operatorapi/directpv.go Normal file
View File

@@ -0,0 +1,328 @@
// 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"
"sort"
"strings"
"github.com/minio/directpv/pkg/utils"
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/cluster"
"github.com/minio/console/models"
"github.com/minio/console/operatorapi/operations"
"github.com/minio/console/operatorapi/operations/operator_api"
xerrors "github.com/minio/console/restapi"
directcsi "github.com/minio/directpv/pkg/apis/direct.csi.min.io/v1beta4"
"github.com/minio/directpv/pkg/sys"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const XFS = "xfs"
func registerDirectPVHandlers(api *operations.OperatorAPI) {
api.OperatorAPIGetDirectPVDriveListHandler = operator_api.GetDirectPVDriveListHandlerFunc(func(params operator_api.GetDirectPVDriveListParams, session *models.Principal) middleware.Responder {
resp, err := getDirectPVDrivesListResponse(session)
if err != nil {
return operator_api.NewGetDirectPVDriveListDefault(int(err.Code)).WithPayload(err)
}
return operator_api.NewGetDirectPVDriveListOK().WithPayload(resp)
})
api.OperatorAPIGetDirectPVVolumeListHandler = operator_api.GetDirectPVVolumeListHandlerFunc(func(params operator_api.GetDirectPVVolumeListParams, session *models.Principal) middleware.Responder {
resp, err := getDirectPVVolumesListResponse(session)
if err != nil {
return operator_api.NewGetDirectPVVolumeListDefault(int(err.Code)).WithPayload(err)
}
return operator_api.NewGetDirectPVVolumeListOK().WithPayload(resp)
})
api.OperatorAPIDirectPVFormatDriveHandler = operator_api.DirectPVFormatDriveHandlerFunc(func(params operator_api.DirectPVFormatDriveParams, session *models.Principal) middleware.Responder {
resp, err := formatVolumesResponse(session, params)
if err != nil {
return operator_api.NewDirectPVFormatDriveDefault(int(err.Code)).WithPayload(err)
}
return operator_api.NewDirectPVFormatDriveOK().WithPayload(resp)
})
}
// getDirectPVVolumesList returns directPV drives
func getDirectPVDriveList(ctx context.Context, driveInterface DirectPVDrivesClientI) (*models.GetDirectPVDriveListResponse, error) {
drivesList, err := driveInterface.List(ctx, metav1.ListOptions{})
if err != nil {
return nil, err
}
res := &models.GetDirectPVDriveListResponse{}
// implementation same as directPV `drives ls` command
driveName := func(val string) string {
dr := strings.ReplaceAll(val, sys.DirectCSIDevRoot+"/", "")
dr = strings.ReplaceAll(dr, sys.HostDevRoot+"/", "")
return strings.ReplaceAll(dr, sys.DirectCSIPartitionInfix, "")
}
drivesSorted := drivesList.Items
// sort by nodename, path and status
sort.Slice(drivesSorted, func(i, j int) bool {
d1 := drivesSorted[i]
d2 := drivesSorted[j]
if v := strings.Compare(d1.Status.NodeName, d2.Status.NodeName); v != 0 {
return v < 0
}
if v := strings.Compare(d1.Status.Path, d2.Status.Path); v != 0 {
return v < 0
}
return strings.Compare(string(d1.Status.DriveStatus), string(d2.Status.DriveStatus)) < 0
})
for _, d := range drivesSorted {
volumes := 0
if len(d.Finalizers) > 1 {
volumes = len(d.Finalizers) - 1
}
dr := driveName(d.Status.Path)
dr = strings.ReplaceAll("/dev/"+dr, sys.DirectCSIPartitionInfix, "")
status := d.Status.DriveStatus
msg := ""
for _, c := range d.Status.Conditions {
switch c.Type {
case string(directcsi.DirectCSIDriveConditionInitialized), string(directcsi.DirectCSIDriveConditionOwned), string(directcsi.DirectCSIDriveConditionReady):
if c.Status != metav1.ConditionTrue {
msg = c.Message
if msg != "" {
status = d.Status.DriveStatus + "*"
msg = strings.ReplaceAll(msg, d.Name, "")
msg = strings.ReplaceAll(msg, sys.DirectCSIDevRoot, "/dev")
msg = strings.ReplaceAll(msg, sys.DirectCSIPartitionInfix, "")
msg = strings.Split(msg, "\n")[0]
}
}
}
}
var allocatedCapacity int64
if status == directcsi.DriveStatusInUse {
allocatedCapacity = d.Status.AllocatedCapacity
}
drStatus := d.Status.DriveStatus
driveInfo := &models.DirectPVDriveInfo{
Drive: dr,
Capacity: d.Status.TotalCapacity,
Allocated: allocatedCapacity,
Node: d.Status.NodeName,
Status: string(drStatus),
Message: msg,
Volumes: int64(volumes),
}
res.Drives = append(res.Drives, driveInfo)
}
return res, nil
}
func getDirectPVDrivesListResponse(session *models.Principal) (*models.GetDirectPVDriveListResponse, *models.Error) {
ctx := context.Background()
driveInterface, err := cluster.DirectPVDriveInterface(session.STSSessionToken)
if err != nil {
return nil, xerrors.ErrorWithContext(ctx, err)
}
directPVDrvClient := &directPVDrivesClient{
client: driveInterface,
}
drives, err := getDirectPVDriveList(ctx, directPVDrvClient)
if err != nil {
return nil, xerrors.ErrorWithContext(ctx, err)
}
return drives, nil
}
// getDirectPVVolumesList returns directPV volumes
func getDirectPVVolumesList(ctx context.Context, volumeInterface DirectPVVolumesClientI) (*models.GetDirectPVVolumeListResponse, error) {
volList, err := volumeInterface.List(ctx, metav1.ListOptions{})
if err != nil {
return nil, err
}
driveName := func(val string) string {
dr := strings.ReplaceAll(val, sys.DirectCSIDevRoot+"/", "")
return strings.ReplaceAll(dr, sys.HostDevRoot+"/", "")
}
getLabelValue := func(obj metav1.Object, key string) string {
if labels := obj.GetLabels(); labels != nil {
return labels[key]
}
return ""
}
var volumes []*models.DirectPVVolumeInfo
for _, v := range volList.Items {
vol := &models.DirectPVVolumeInfo{
Volume: v.Name,
Capacity: v.Status.TotalCapacity,
Drive: driveName(getLabelValue(&v, string(utils.DrivePathLabelKey))),
Node: v.Status.NodeName,
}
volumes = append(volumes, vol)
}
res := &models.GetDirectPVVolumeListResponse{
Volumes: volumes,
}
return res, nil
}
func getDirectPVVolumesListResponse(session *models.Principal) (*models.GetDirectPVVolumeListResponse, *models.Error) {
ctx := context.Background()
volumeInterface, err := cluster.DirectPVVolumeInterface(session.STSSessionToken)
if err != nil {
return nil, xerrors.ErrorWithContext(ctx, err)
}
directPVVolClient := &directPVVolumesClient{
client: volumeInterface,
}
volumes, err := getDirectPVVolumesList(ctx, directPVVolClient)
if err != nil {
return nil, xerrors.ErrorWithContext(ctx, err)
}
return volumes, nil
}
func formatDrives(ctx context.Context, driveInterface DirectPVDrivesClientI, drives []string, force bool) (*models.FormatDirectPVDrivesResponse, error) {
if len(drives) == 0 {
return nil, errors.New("at least one drive needs to be set")
}
driveList, err := driveInterface.List(ctx, metav1.ListOptions{})
if err != nil {
return nil, err
}
driveName := func(val string) string {
dr := strings.ReplaceAll(val, sys.DirectCSIDevRoot+"/", "")
dr = strings.ReplaceAll(dr, sys.HostDevRoot+"/", "")
return strings.ReplaceAll(dr, sys.DirectCSIPartitionInfix, "")
}
drivesArray := map[string]string{}
for _, driveFromAPI := range drives {
drivesArray[driveFromAPI] = driveFromAPI
}
if len(driveList.Items) == 0 {
return nil, errors.New("no resources found globally")
}
var errorResponses []*models.PvFormatErrorResponse
for _, driveItem := range driveList.Items {
drName := "/dev/" + driveName(driveItem.Status.Path)
driveName := driveItem.Status.NodeName + ":" + drName
base := &models.PvFormatErrorResponse{
Node: driveItem.Status.NodeName,
Drive: drName,
Error: "",
}
// Element is requested to be formatted
if _, ok := drivesArray[driveName]; ok {
if driveItem.Status.DriveStatus == directcsi.DriveStatusUnavailable {
base.Error = "Status is unavailable"
errorResponses = append(errorResponses, base)
continue
}
if driveItem.Status.DriveStatus == directcsi.DriveStatusInUse {
base.Error = "Drive in use. Cannot be formatted"
errorResponses = append(errorResponses, base)
continue
}
if driveItem.Status.DriveStatus == directcsi.DriveStatusReady {
base.Error = "Drive already owned and managed."
errorResponses = append(errorResponses, base)
continue
}
if driveItem.Status.Filesystem != "" && !force {
base.Error = "Drive already has a fs. Use force to overwrite"
errorResponses = append(errorResponses, base)
continue
}
if driveItem.Status.DriveStatus == directcsi.DriveStatusReleased {
base.Error = "Drive is in 'released state'. Please wait until it becomes available"
errorResponses = append(errorResponses, base)
continue
}
// Validation passes, we request format
driveItem.Spec.DirectCSIOwned = true
driveItem.Spec.RequestedFormat = &directcsi.RequestedFormat{
Filesystem: XFS,
Force: force,
}
_, err := driveInterface.Update(ctx, &driveItem, metav1.UpdateOptions{})
if err != nil {
base.Error = err.Error()
errorResponses = append(errorResponses, base)
}
}
}
returnErrors := &models.FormatDirectPVDrivesResponse{
FormatIssuesList: errorResponses,
}
return returnErrors, nil
}
func formatVolumesResponse(session *models.Principal, params operator_api.DirectPVFormatDriveParams) (*models.FormatDirectPVDrivesResponse, *models.Error) {
ctx := context.Background()
driveInterface, err := cluster.DirectPVDriveInterface(session.STSSessionToken)
if err != nil {
return nil, xerrors.ErrorWithContext(ctx, err)
}
directPVDrvClient := &directPVDrivesClient{
client: driveInterface,
}
formatResult, errFormat := formatDrives(ctx, directPVDrvClient, params.Body.Drives, *params.Body.Force)
if errFormat != nil {
return nil, xerrors.ErrorWithContext(ctx, errFormat)
}
return formatResult, nil
}

View File

@@ -0,0 +1,73 @@
// 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"
"github.com/minio/directpv/pkg/apis/direct.csi.min.io/v1beta4"
directPVClient "github.com/minio/directpv/pkg/client"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// DirectPVDrivesClientI interface with all functions to be implemented
// by mock when testing, it should include all DirectPVDrivesClientI respective api calls
// that are used within this project.
type DirectPVDrivesClientI interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1beta4.DirectCSIDriveList, error)
Update(ctx context.Context, driveItem *v1beta4.DirectCSIDrive, opts metav1.UpdateOptions) (*v1beta4.DirectCSIDriveList, error)
}
// Interface implementation
//
// Define the structure of directpv drive client and define the functions that are actually used
// from the minio operator / directpv interface.
type directPVDrivesClient struct {
client *directPVClient.DirectCSIDriveInterface
}
// List implements the listing for DirectPV Drives List functionality
func (dpd *directPVDrivesClient) List(ctx context.Context, opts metav1.ListOptions) (*v1beta4.DirectCSIDriveList, error) {
return dpd.List(ctx, opts)
}
// Update implements the listing for DirectPV Drives Update functionality
func (dpd *directPVDrivesClient) Update(ctx context.Context, driveItem *v1beta4.DirectCSIDrive, opts metav1.UpdateOptions) (*v1beta4.DirectCSIDriveList, error) {
return dpd.Update(ctx, driveItem, opts)
}
// DirectPVVolumesClientI interface with all functions to be implemented
// by mock when testing, it should include all DirectPVVolumesClientI respective api calls
// that are used within this project.
type DirectPVVolumesClientI interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1beta4.DirectCSIVolumeList, error)
}
// Interface implementation
//
// Define the structure of directpv volumes client and define the functions that are actually used
// from the minio operator / directpv interface.
type directPVVolumesClient struct {
client *directPVClient.DirectCSIVolumeInterface
}
// List implements the listing for DirectPV Volumes List functionality
func (dpv *directPVVolumesClient) List(ctx context.Context, opts metav1.ListOptions) (*v1beta4.DirectCSIVolumeList, error) {
return dpv.List(ctx, opts)
}

View File

@@ -0,0 +1,410 @@
// 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"
"testing"
"github.com/minio/directpv/pkg/apis/direct.csi.min.io/v1beta4"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
var (
dpdClientListMock func(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIDriveList, error)
dpdClientUpdateMock func(ctx context.Context, driveItem *v1beta4.DirectCSIDrive, opts v1.UpdateOptions) (*v1beta4.DirectCSIDriveList, error)
)
// mock function for drives List()
func (dpdm directPVDriveMock) List(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIDriveList, error) {
return dpdClientListMock(ctx, opts)
}
func (dpdm directPVDriveMock) Update(ctx context.Context, driveItem *v1beta4.DirectCSIDrive, opts v1.UpdateOptions) (*v1beta4.DirectCSIDriveList, error) {
return dpdClientUpdateMock(ctx, driveItem, opts)
}
var dpvClientListMock func(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIVolumeList, error)
// mock function for volumes List()
func (dpvm directPVVolumeMock) List(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIVolumeList, error) {
return dpvClientListMock(ctx, opts)
}
// DirectPVDrivesList
func Test_GetDirectPVDrives(t *testing.T) {
directPVDrvMock := directPVDriveMock{}
type args struct {
ctx context.Context
opts v1.ListOptions
}
tests := []struct {
name string
args args
client DirectPVDrivesClientI
mockListDrives func(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIDriveList, error)
wantErr bool
}{
{
name: "Can List Drives correctly",
args: args{
ctx: context.Background(),
opts: v1.ListOptions{},
},
client: directPVDrvMock,
mockListDrives: func(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIDriveList, error) {
items := []v1beta4.DirectCSIDrive{}
returnList := v1beta4.DirectCSIDriveList{
Items: items,
}
return &returnList, nil
},
wantErr: false,
},
{
name: "Drives request from DirectPV failed",
args: args{
ctx: context.Background(),
},
client: directPVDrvMock,
mockListDrives: func(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIDriveList, error) {
return nil, errors.New("some error occurred")
},
wantErr: true,
},
{
name: "Drives request from DirectPV has information and doesn't return errors",
args: args{
ctx: context.Background(),
},
client: directPVDrvMock,
mockListDrives: func(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIDriveList, error) {
items := []v1beta4.DirectCSIDrive{
{
Status: v1beta4.DirectCSIDriveStatus{
Path: "/var/lib/direct-csi/devices/test-part-dev0-directcsi",
AllocatedCapacity: 0,
FreeCapacity: 4772382377372,
RootPartition: "/",
PartitionNum: 0,
Filesystem: "nfs",
Mountpoint: "",
NodeName: "test-dev0-directcsi",
DriveStatus: v1beta4.DriveStatusReady,
ModelNumber: "testModel",
SerialNumber: "testSN",
TotalCapacity: 4772382377372,
PhysicalBlockSize: 1024,
LogicalBlockSize: 1024,
AccessTier: "",
FilesystemUUID: "",
PartitionUUID: "",
MajorNumber: 0,
MinorNumber: 0,
UeventSerial: "",
UeventFSUUID: "",
WWID: "",
Vendor: "",
DMName: "",
DMUUID: "",
MDUUID: "",
PartTableUUID: "",
PartTableType: "",
Virtual: false,
ReadOnly: false,
Partitioned: false,
SwapOn: false,
Master: "",
OtherMountsInfo: nil,
PCIPath: "",
SerialNumberLong: "",
Conditions: []v1.Condition{{
Type: "",
Status: "",
ObservedGeneration: 0,
LastTransitionTime: v1.Time{},
Reason: "",
Message: "",
}},
},
},
{
Status: v1beta4.DirectCSIDriveStatus{
Path: "/var/lib/direct-csi/devices/test-part-dev1-directcsi",
AllocatedCapacity: 0,
FreeCapacity: 4772382377372,
RootPartition: "/",
PartitionNum: 0,
Filesystem: "nfs",
Mountpoint: "",
NodeName: "test-dev1-directcsi",
DriveStatus: v1beta4.DriveStatus(v1beta4.DirectCSIDriveConditionOwned),
ModelNumber: "testModel",
SerialNumber: "testSN2",
TotalCapacity: 4772382377372,
PhysicalBlockSize: 1024,
LogicalBlockSize: 1024,
AccessTier: "",
FilesystemUUID: "",
PartitionUUID: "",
MajorNumber: 0,
MinorNumber: 0,
UeventSerial: "",
UeventFSUUID: "",
WWID: "",
Vendor: "",
DMName: "",
DMUUID: "",
MDUUID: "",
PartTableUUID: "",
PartTableType: "",
Virtual: false,
ReadOnly: false,
Partitioned: false,
SwapOn: false,
Master: "",
OtherMountsInfo: nil,
PCIPath: "",
SerialNumberLong: "",
Conditions: nil,
},
},
}
returnList := v1beta4.DirectCSIDriveList{
Items: items,
}
return &returnList, nil
},
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
dpdClientListMock = tt.mockListDrives
_, err := getDirectPVDriveList(tt.args.ctx, tt.client)
if (err != nil) != tt.wantErr {
t.Errorf("getNamespaceCreated() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}
// DirectPVVolumesList
func Test_GetDirectPVVolumes(t *testing.T) {
directPVVolMock := directPVVolumeMock{}
type args struct {
ctx context.Context
opts v1.ListOptions
}
tests := []struct {
name string
args args
volumesClient DirectPVVolumesClientI
mockListVolumes func(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIVolumeList, error)
wantErr bool
}{
{
name: "Can List Volumes correctly",
args: args{
ctx: context.Background(),
opts: v1.ListOptions{},
},
volumesClient: directPVVolMock,
mockListVolumes: func(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIVolumeList, error) {
items := []v1beta4.DirectCSIVolume{}
returnList := v1beta4.DirectCSIVolumeList{
Items: items,
}
return &returnList, nil
},
wantErr: false,
},
{
name: "Drives request from DirectPV is ok but volumes request failed",
args: args{
ctx: context.Background(),
},
volumesClient: directPVVolMock,
mockListVolumes: func(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIVolumeList, error) {
return nil, errors.New("some error occurred")
},
wantErr: true,
},
{
name: "Can List Volumes & Drives correctly without any issue",
args: args{
ctx: context.Background(),
opts: v1.ListOptions{},
},
volumesClient: directPVVolMock,
mockListVolumes: func(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIVolumeList, error) {
items := []v1beta4.DirectCSIVolume{{
Status: v1beta4.DirectCSIVolumeStatus{
Drive: "/var/lib/direct-csi/devices/test-part-dev1-directcsi",
NodeName: "testNodeName",
HostPath: "",
StagingPath: "",
ContainerPath: "",
TotalCapacity: 4772382377372,
AvailableCapacity: 4772382377372,
UsedCapacity: 0,
Conditions: nil,
},
}}
returnList := v1beta4.DirectCSIVolumeList{
Items: items,
}
return &returnList, nil
},
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
dpvClientListMock = tt.mockListVolumes
_, err := getDirectPVVolumesList(tt.args.ctx, tt.volumesClient)
if (err != nil) != tt.wantErr {
t.Errorf("getNamespaceCreated() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}
// FormatDrives
func Test_GetDirectPVFormatDrives(t *testing.T) {
directPVDrvMock := directPVDriveMock{}
type args struct {
ctx context.Context
opts v1.ListOptions
}
tests := []struct {
name string
args args
drivesClient DirectPVDrivesClientI
mockListDrives func(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIDriveList, error)
drives []string
force bool
wantErr bool
}{
{
name: "Format doesn't crash on empty list & returns error",
args: args{
ctx: context.Background(),
opts: v1.ListOptions{},
},
drivesClient: directPVDrvMock,
mockListDrives: func(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIDriveList, error) {
items := []v1beta4.DirectCSIDrive{}
returnList := v1beta4.DirectCSIDriveList{
Items: items,
}
return &returnList, nil
},
drives: []string{},
force: false,
wantErr: true,
},
{
name: "Can Format Selected drives",
args: args{
ctx: context.Background(),
opts: v1.ListOptions{},
},
drivesClient: directPVDrvMock,
mockListDrives: func(ctx context.Context, opts v1.ListOptions) (*v1beta4.DirectCSIDriveList, error) {
items := []v1beta4.DirectCSIDrive{
{
Status: v1beta4.DirectCSIDriveStatus{
Path: "/var/lib/direct-csi/devices/test-part-dev1-directcsi",
AllocatedCapacity: 0,
FreeCapacity: 4772382377372,
RootPartition: "/",
PartitionNum: 0,
Filesystem: "nfs",
Mountpoint: "",
NodeName: "test-dev1-directcsi",
DriveStatus: v1beta4.DriveStatusAvailable,
ModelNumber: "testModel",
SerialNumber: "testSN2",
TotalCapacity: 4772382377372,
PhysicalBlockSize: 1024,
LogicalBlockSize: 1024,
AccessTier: "",
FilesystemUUID: "",
PartitionUUID: "",
MajorNumber: 0,
MinorNumber: 0,
UeventSerial: "",
UeventFSUUID: "",
WWID: "",
Vendor: "",
DMName: "",
DMUUID: "",
MDUUID: "",
PartTableUUID: "",
PartTableType: "",
Virtual: false,
ReadOnly: false,
Partitioned: false,
SwapOn: false,
Master: "",
OtherMountsInfo: nil,
PCIPath: "",
SerialNumberLong: "",
Conditions: nil,
},
},
}
returnList := v1beta4.DirectCSIDriveList{
Items: items,
}
return &returnList, nil
},
drives: []string{"test-dev1-directcsi:/dev/testdev1-directcsi"},
force: false,
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
dpdClientListMock = tt.mockListDrives
_, err := formatDrives(tt.args.ctx, tt.drivesClient, tt.drives, tt.force)
if (err != nil) != tt.wantErr {
t.Errorf("getNamespaceCreated() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}

View File

@@ -18,18 +18,18 @@
// Package operatorapi MinIO Console Server
//
// Schemes:
// http
// ws
// Host: localhost
// BasePath: /api/v1
// Version: 0.1.0
// Schemes:
// http
// ws
// Host: localhost
// BasePath: /api/v1
// Version: 0.1.0
//
// Consumes:
// - application/json
// Consumes:
// - application/json
//
// Produces:
// - application/json
// Produces:
// - application/json
//
// swagger:meta
package operatorapi

File diff suppressed because it is too large Load Diff

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)
}

View File

@@ -101,7 +101,7 @@ func getLoginDetailsResponse(params authApi.LoginDetailParams) (*models.LoginDet
r := params.HTTPRequest
loginStrategy := models.LoginDetailsLoginStrategyServiceDashAccount
redirectURL := ""
redirectURL := []string{}
if oauth2.IsIDPEnabled() {
loginStrategy = models.LoginDetailsLoginStrategyRedirectDashServiceDashAccount
@@ -111,13 +111,17 @@ func getLoginDetailsResponse(params authApi.LoginDetailParams) (*models.LoginDet
return nil, restapi.ErrorWithContext(ctx, err)
}
// Validate user against IDP
identityProvider := &auth.IdentityProvider{Client: oauth2Client}
redirectURL = identityProvider.GenerateLoginURL()
identityProvider := &auth.IdentityProvider{
KeyFunc: oauth2.DefaultDerivedKey,
Client: oauth2Client,
}
redirectURL = append(redirectURL, identityProvider.GenerateLoginURL())
}
loginDetails := &models.LoginDetails{
LoginStrategy: loginStrategy,
Redirect: redirectURL,
IsDirectPV: getDirectPVEnabled(),
}
return loginDetails, nil
}
@@ -145,7 +149,10 @@ func getLoginOauth2AuthResponse(params authApi.LoginOauth2AuthParams) (*models.L
return nil, restapi.ErrorWithContext(ctx, err)
}
// initialize new identity provider
identityProvider := auth.IdentityProvider{Client: oauth2Client}
identityProvider := auth.IdentityProvider{
KeyFunc: oauth2.DefaultDerivedKey,
Client: oauth2Client,
}
// Validate user against IDP
_, err = verifyUserAgainstIDP(ctx, identityProvider, *lr.Code, *lr.State)
if err != nil {

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

@@ -22,8 +22,10 @@ import (
)
type (
opClientMock struct{}
httpClientMock struct{}
opClientMock struct{}
httpClientMock struct{}
directPVDriveMock struct{}
directPVVolumeMock struct{}
)
func createMockPVC(pvcMockName, pvcMockNamespace string) *v1.PersistentVolumeClaim {

View File

@@ -46,10 +46,10 @@ func NewLoginDetail(ctx *middleware.Context, handler LoginDetailHandler) *LoginD
return &LoginDetail{Context: ctx, Handler: handler}
}
/* LoginDetail swagger:route GET /login Auth loginDetail
/*
LoginDetail swagger:route GET /login Auth loginDetail
Returns login strategy, form or sso.
*/
type LoginDetail struct {
Context *middleware.Context

View File

@@ -33,7 +33,8 @@ import (
// LoginDetailOKCode is the HTTP code returned for type LoginDetailOK
const LoginDetailOKCode int = 200
/*LoginDetailOK A successful response.
/*
LoginDetailOK A successful response.
swagger:response loginDetailOK
*/
@@ -74,7 +75,8 @@ func (o *LoginDetailOK) WriteResponse(rw http.ResponseWriter, producer runtime.P
}
}
/*LoginDetailDefault Generic error response.
/*
LoginDetailDefault Generic error response.
swagger:response loginDetailDefault
*/

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