Compare commits

...

180 Commits

Author SHA1 Message Date
Harshavardhana
fed5aa1599 fix: dateTime usage only available in go1.20 (#2982)
instead use a simpler normalizer for timestamp
to be user friendly without spaces.

For example

```
selected_files_20091110T230000Z.zip
```
2023-08-03 20:21:44 -07:00
Alex
6bc4efbac1 Release v0.35.0 (#2981) 2023-08-03 14:54:29 -07:00
Alex
cc0164a67b Initial Tools Pages Migrations (#2978)
Tools Pages Migrations

- Call Home
- Inspect
- Profile
- Health

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-08-03 15:26:17 -06:00
Prakash Senthil Vel
b968cc25ad feat: download multiple object selection as zip ignoring any deleted objects selected (#2965) 2023-08-02 18:28:25 -06:00
jinapurapu
d116a35a6d Fix subpath button (#2977)
Added bucketName to permissions check for subpath
2023-08-02 15:26:39 -07:00
Alex
49f856bdd5 Added Exclude Folders & Exclude Prefixes support (#2973)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-08-02 13:35:00 -06:00
Cesar Celis Hernandez
0d628f589a Removing white spaces from provided values (#2922) 2023-07-31 22:29:11 -06:00
Cesar N
4387b2149f Update Github jobs to use hardcoded testcafe version (#2972) 2023-07-31 16:11:28 -07:00
Alex
8cc602434e Release v0.34.0 (#2969)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-07-28 16:31:50 -07:00
Anis Eleuch
6411dc9504 auth: Avoid forcing one hour expiration for IDP sts creds (#2966) 2023-07-27 22:25:47 -06:00
Alex
32c34b0a11 Migrated Buckets Pages to mds (#2960) 2023-07-27 19:27:43 -07:00
jinapurapu
6e8f5e0fc2 Fixed subnet Health report upload (#2927)
Fixed subnet file upload to allow upload of different report types
2023-07-27 15:29:30 -07:00
Alex
3ce377dbd1 Changed Download Handler Behavior (#2964)
- Updated Handler for files with size of 49GB or less
- Used Browser Handler tor size of more than 50GB

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-07-26 21:08:35 -07:00
Alex
ad502b9f18 Fixed issue with folders named as the bucket in rewind mode (#2963)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-07-26 13:53:04 -07:00
Alex
fde186a5a3 Release v0.33.0 (#2956)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-07-20 22:26:32 -07:00
Prakash Senthil Vel
0823f623c8 fix configuration page to include configs based on supported config subsystems (#2946) 2023-07-20 14:43:17 -06:00
Prakash Senthil Vel
6cec113304 fix: add new dashboard metrics (#2952) 2023-07-20 07:57:41 -07:00
dependabot[bot]
cd42d77a46 Bump word-wrap from 1.2.3 to 1.2.4 in /portal-ui (#2953) 2023-07-19 11:40:03 -06:00
Alex
35907beaca Updated Prettier to v3.0.0 (#2949)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-07-18 09:58:21 -06:00
MinIO Bot
a062a59288 mds-released-v0.7.0 (#2948) 2023-07-18 09:53:53 +05:30
Prakash Senthil Vel
842c2decd0 fix console dashboard node io prometheus metric WChar and RChar (#2947) 2023-07-17 10:51:59 -07:00
Prakash Senthil Vel
d1069ed359 fix loading of objects at a path when url is shared opened elsewhere (#2944)
- fix loading of objects at a path when url is shared and opened elsewhere
- fix bug when a path is created and objects are uploaded it is not refreshed
2023-07-17 09:03:31 -07:00
Prakash Senthil Vel
6d81a1b1f8 add support for preview based on content type (#2930) 2023-07-13 18:29:56 -06:00
Alex
b2fe478dae Updated vulnerabilities checks & workflows (#2941) 2023-07-12 22:05:54 -06:00
Prakash Senthil Vel
02ed6a6e8b Fix delete share download options permission check in sidebar (#2935) 2023-07-12 11:07:18 -06:00
jinapurapu
1b271ab467 Removed extra 'Event Destination' text (#2938) 2023-07-12 10:35:39 -06:00
Prakash Senthil Vel
bacb5f8901 Preserve white space in breadcrumb disply and navigation (#2932) 2023-07-11 22:32:03 -06:00
MinIO Bot
ae7371da95 mds-released-v0.6.9 (#2934) 2023-07-10 22:56:44 -06:00
Prakash Senthil Vel
60f5eb603b remove warning message in delete bucket replication rule (#2931) 2023-07-10 14:29:23 -06:00
Prakash Senthil Vel
420ed00f55 Fix object metadata section crash due to un escaped characters (#2928) 2023-07-07 12:21:06 -06:00
Alex
b975871e9d Migrated remaining LDAP subcomponents to mds (#2926)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-07-06 22:21:19 -06:00
Alex
803ffe2960 Migrated OpenID module components to mds (#2925)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-07-06 14:14:10 -06:00
Cesar N
c96c95924c Release v0.32.0 (#2924) 2023-07-06 10:32:39 -07:00
Alex
f02786001c Migrated Groups Module components to mds (#2923)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-07-05 22:29:17 -06:00
Alex
542b7192c3 Migrated Users Module components to mds (#2920)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-07-05 17:21:07 -07:00
Javier Adriel
b31aa10b52 Refactor to swagger TS API (#2903) 2023-07-05 17:27:46 -06:00
jiuker
1eba59954d fix: websockets goroutine leak for object list UI (#2805)
listen on the done channel to ensure that we can clean up 
the WebSocket go-routine, once the caller is done with
writing the response.
2023-07-05 12:17:54 -07:00
jinapurapu
b71d9f05c5 Updated placeholderimage for offline HelpMenu items (#2916) 2023-06-30 18:35:04 -06:00
Daniel Valdivia
fc5e94d55f Remove Cross compile jobs (#2915) 2023-06-29 18:57:14 -06:00
Alex
3875fb3eaa Release v0.31.0 (#2912)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2023-06-29 12:21:34 -07:00
Aditya Manthramurthy
b3d4132fe6 Remove goreleaser (#2914)
Not needed any more as standalone console deploys are not supported any more.
2023-06-29 11:15:58 -06:00
Alex
21f20bb9ea Migrated Policies module to mds (#2911)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-06-28 18:23:58 -06:00
Alex
df937467a0 Fixed Bucket Events Notifications Page (#2906)
- Added missing ilm & replica supported types
- Fixed add screen crash when no arn is selected
- Migrated components to mds

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-06-28 15:39:02 -06:00
Alex
d1ae271111 Replaced CodeMirrorWrapper internal components (#2910)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-06-28 12:05:18 -07:00
Alex
e7fb3e0e45 Updated console dependencies (#2909)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-06-26 14:12:09 -06:00
dependabot[bot]
b7b0271ec7 Bump fast-xml-parser from 4.2.4 to 4.2.5 in /portal-ui (#2904)
Signed-off-by: dependabot[bot] <support@github.com>
2023-06-22 21:41:22 -06:00
jinapurapu
9935b839b7 Help menu cleanup (#2905) 2023-06-22 20:25:06 -06:00
Cesar N
0e11098c31 Upgrade semver version to address vulnerability (#2902) 2023-06-22 17:54:14 -04:00
Daniel Valdivia
c55e0a069b Format number of objects (#2901) 2023-06-22 12:59:16 -07:00
jinapurapu
c3da876b04 Added placeholder image to HelpMenu if links unavailable (#2899) 2023-06-22 12:12:13 -07:00
Alex
643a9c6c7c Updated Audit Logs page to use mds (#2897)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-06-21 14:32:19 -06:00
Aditya Manthramurthy
0c3a94172d Bump up madmin-go to v3.0.2 (#2896) 2023-06-21 10:51:12 -07:00
Javier Adriel
527eb16700 Refactor to swagger TS API (#2888)
Co-authored-by: Prakash Senthil Vel <23444145+prakashsvmx@users.noreply.github.com>
Co-authored-by: Alex <33497058+bexsoft@users.noreply.github.com>
2023-06-20 12:46:20 -07:00
Alex
e3aec3f094 Updated mds to v0.6.4 (#2895) 2023-06-20 11:49:58 -07:00
Alex
eac2734df4 Update mds to v0.6.2 (#2894) 2023-06-20 11:37:09 -06:00
Allan Roger Reid
a411e7c977 Create bug_report.md (#2893) 2023-06-19 19:58:26 -07:00
Prakash Senthil Vel
28c4abe2d0 audit only the dependencies and exclude dev dependencies in ci for ui (#2892) 2023-06-19 10:55:20 -06:00
Javier Adriel
a9ef6ebf5f Fix download of folders (#2891) 2023-06-19 10:54:18 -06:00
Ali Garajian
c12415c12d Virtualize download/upload object list (#2889) 2023-06-16 13:31:39 -06:00
Cesar N
1f481e690b Add CHANGELOG file for Releases (#2887) 2023-06-15 14:21:27 -07:00
Alex
58aad859e1 Release v0.30.0 (#2886) 2023-06-15 13:13:53 -07:00
jinapurapu
b9ebfe09ee Removed console.log (#2885) 2023-06-15 12:52:24 -06:00
Prakash Senthil Vel
864cf7af99 Apply policy resource restrictions for file extensions (#2842) 2023-06-15 11:33:52 -07:00
Javier Adriel
b76f460979 Remove dead code and add job in CI to find it (#2882) 2023-06-15 10:24:24 -06:00
Cesar N
cbd2c4682d Raise error on upload artifact if no files (#2884)
Raise error on artifact upload if no files to upload

Co-authored-by: cesnietor <>
2023-06-15 09:00:51 -07:00
Javier Adriel
d49bdf7d49 Add staticcheck to console API (#2883) 2023-06-14 21:35:00 -06:00
dependabot[bot]
559a7278a0 Bump github.com/lestrrat-go/jwx from 1.2.25 to 1.2.26 (#2879) 2023-06-14 17:16:17 -06:00
Daniel Valdivia
4a172fae97 Pass Client IP address to MinIO on x-forwarded-for header (#2864) 2023-06-14 12:36:48 -07:00
Cesar N
fc4263e2f9 Define action version to Git action (#2875) 2023-06-13 18:16:46 -06:00
Cesar N
c1b9b4c81b Add Git job to add new issues to project (#2873) 2023-06-13 17:36:21 -06:00
Javier Adriel
aa9b73522e Refactor to swagger ts API (#2860) 2023-06-13 15:00:56 -07:00
Alex
0904f83627 Fix playwright (#2867)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-06-13 14:43:28 -07:00
Cesar N
253053cc23 Refactor session to avoid duplicate calls to apis (#2868)
Co-authored-by: cesnietor <>
2023-06-13 14:27:48 -07:00
Alex
08a3ff65c7 Updated menu component to use mds (#2866)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-06-13 15:16:46 -06:00
jinapurapu
ee8fac8be8 Removed debugging line (#2870)
Co-authored-by: Jillian Inapurapu <jillii@Jillians-MacBook-Pro.local>
2023-06-13 11:48:25 -07:00
jinapurapu
9fa49b40b3 Console help menu (#2804)
Authored-by: Jillian Inapurapu <jillii@Jillians-MBP.attlocal.net>
2023-06-12 14:50:25 -07:00
Javier Adriel
de13119e02 Use swagger autogenerated ts API for session endpoint (#2859) 2023-06-12 15:00:40 -06:00
Alex
bf9acd7691 Share File access key / secret key rollback (#2863)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-06-12 14:02:38 -06:00
Alex
a5066fecc8 Update mds to v0.6.0 (#2862)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-06-12 11:55:23 -07:00
jinapurapu
6432681440 Minor tooltip fixes (#2861) 2023-06-12 09:54:07 -06:00
jinapurapu
b3b6df9d82 Minor fixes to Config screen tooltips (#2857) 2023-06-08 23:28:28 -06:00
Alex
fe7be4ef62 Fixed an issue with subpaths in resources policies (#2856)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-06-08 17:37:45 -06:00
Javier Adriel
b4603547f6 Add tests for remote buckets handlers (#2843) 2023-06-08 13:06:49 -06:00
Javier Adriel
b33b9315ea Fix fast-xml-parser vulnerability (#2855) 2023-06-06 11:55:23 -07:00
BlockListed
6ae03fa028 Fix spelling in file sharing menu (#2853) 2023-06-04 12:23:25 -06:00
MinIO Bot
e1bb1e0472 mds-released-v0.5.1 (#2851) 2023-06-02 20:45:08 -06:00
Alex
411670e4f5 Release v0.29.0 (#2850)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2023-06-02 13:51:48 -07:00
Alex
1c55932f84 Updated console dependencies (#2849) 2023-06-02 12:58:07 -06:00
Kaan Kabalak
5a77054d6b Update Service Acct fns based on new ListServiceAccounts type (#2824)
* Update Service Acct fns based on new ListServiceAccounts type
2023-05-30 10:30:02 -07:00
Alex
84c5fd58f9 Display error snack bar on raw policy edit error (#2841)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-05-29 18:05:42 -06:00
Daniel Valdivia
98979911ee Move Login to Typescript Swagger API (#2839)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2023-05-29 13:52:29 -07:00
Alex
c0cf7358c7 Removed hardcoded background in access keys table (#2837)
## What does this do?

Removed non required classes from access keys table

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-05-28 18:47:10 -07:00
Alex
9053e64dff Fixed multiselection of items after deleting one service account (#2836) 2023-05-26 16:58:01 -06:00
Alex
57bfe97d08 Release v0.28.0 (#2831) 2023-05-26 13:42:42 -07:00
Alex
028570279c Migrated Access Keys page components to mds (#2834)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-05-26 11:24:34 -06:00
MinIO Bot
bda1cd1f25 mds-released-V0.4.3 (#2830)
Co-authored-by: MinIO Bot <minio.bot@minio.io>
2023-05-24 11:37:48 -07:00
Alex
7a9b775b09 Changed Share Object logic to use Access Keys (#2827)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-05-24 10:52:40 -07:00
Daniel Valdivia
17e791afb9 Replace RIGHT-TO-LEFT OVERRIDE unicode (#2828)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2023-05-23 09:47:12 -06:00
Daniel Valdivia
920fc7d937 Fix Subpath behavior (#2818)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2023-05-22 12:30:59 -07:00
GeekTR
6e314a2fa5 Fix crash when backend has no rrSCParity property (#2826) 2023-05-22 13:14:41 -06:00
Alex
dc90db6591 Changed SSO Login screen to hide login form by default (#2807)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-05-22 11:20:45 -06:00
Prakash Senthil Vel
beed4895c1 Apply permission check for create accesskey button (#2822) 2023-05-22 09:26:31 -07:00
Prakash Senthil Vel
629dd669c4 Fix anonymous access rule not displayed due to style (#2820) 2023-05-18 10:54:21 -06:00
Alex
fc9319e55b Added identifier field to Event destinations page & migrated to mds (#2816) 2023-05-16 20:21:31 -06:00
Alex
58b64a5739 Fixed an issue with allowResources & KeyBar (#2817) 2023-05-16 16:53:32 -06:00
Javier Adriel
d93537261e Fix download of large files in Console (#2773) 2023-05-15 11:31:43 -07:00
Prakash Senthil Vel
22ec87d00e improve playwright tests with refactoring and clean up (#2809) 2023-05-15 10:02:40 -06:00
MinIO Bot
b87b4156e7 mds-released-v0.4.2 (#2815)
Co-authored-by: MinIO Bot <minio.bot@minio.io>
2023-05-12 18:55:23 -06:00
Alex
93f010b880 Release v0.27.0 (#2813)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2023-05-10 21:33:38 -07:00
Prakash Senthil Vel
c5d4cdf1bc fix to show or hide show deleted objects option based on versioning status (#2780) 2023-05-10 11:36:49 -06:00
Anis Eleuch
c117601e53 Update madmin-go to 2.1.1 (#2810)
Update madmin-go library + github.com/minio/mc

Also update the code to work with the library update

Co-authored-by: Anis Elleuch <anis@min.io>
2023-05-09 10:49:51 -07:00
MinIO Bot
f78f838ed9 mds-released-v0.4.1 (#2808)
Co-authored-by: MinIO Bot <minio.bot@minio.io>
2023-05-09 10:03:49 -06:00
Alex
1583b69fb7 Made Service Account creation consistent with mc (#2801) 2023-05-03 12:33:21 -06:00
Alex
cde6d1b0e0 Added Disable login animation with env variable (#2799)
Set CONSOLE_ANIMATED_LOGIN=off env variable before running Console binary

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-05-03 11:36:41 -06:00
Alex
be60569a14 Changed Object Browser components to use new mds components (#2796) 2023-05-02 17:29:21 -07:00
Alex
51226a74d0 Release v0.26.4 (#2798)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-05-02 18:01:09 -06:00
Daniel Valdivia
e983473a54 Upgrade Go Dependencies (#2786)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2023-05-02 14:35:22 -06:00
Kaan Kabalak
211ab3fd9d Fix incorrect logo appearing for Standard License holders (#2797) 2023-05-01 14:50:01 -06:00
Javier Adriel
90c8ea7f09 Use PageLayout from mds (#2789) 2023-04-29 21:16:09 -06:00
Alex
fb5193d896 Updated mds to v0.4.0 (#2794) 2023-04-27 19:50:21 -06:00
Alex
f7a7f01d7d Fixed issue while getting locking status of a bucket (#2790)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-04-26 09:59:58 -06:00
Javier Adriel
2c84a52937 Use FormLayout from mds (#2788) 2023-04-25 14:22:49 -06:00
Cesar Celis Hernandez
6020590b2f Make playwright run faster (#2737) 2023-04-25 09:19:00 -07:00
Alex
1477def4fe Updated Console UI dependencies (#2787)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-04-24 23:19:22 -07:00
Javier Adriel
8882f1da0e Fix yaml vulnerability (#2785)
Bump yaml package version to 2.2.2 to address unhandled exception [CVE-2023-2251](https://nvd.nist.gov/vuln/detail/CVE-2023-2251)

More details on https://github.com/advisories/GHSA-f9xv-q969-pqx4
2023-04-24 16:40:17 -07:00
Cesar N
056d487f1c Show progress bar when loading Usage Info (#2784) 2023-04-19 22:06:16 -06:00
Cesar N
b8083215b3 Update Dev Docs with MinIO naming conventions (#2783) 2023-04-19 11:12:21 -07:00
Cesar N
61c864e748 Update Dev Documentation (#2781) 2023-04-19 10:47:15 -06:00
Javier Adriel
0e0f5030da Remove health diagnostic warning (#2779) 2023-04-17 17:00:03 -06:00
Alex
0dacc4d49e Changed breadcrumbs back button behavior (#2776)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-04-12 17:23:04 -06:00
Alex
4d783c5e42 Added Object Version read-only field in Edit Lifecycle Modal (#2772) 2023-04-11 17:33:16 -06:00
Alex
75b3a6bea4 Fixed Object Version selector visibility in Add Lifecycle Rule modal (#2769)
- Fixed Object Version selector visibility in Add Lifecycle Rule modal
- Changed definition in swagger file to match camelCase standard
- Added a playwright test case to avoid this issue in the future

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-04-11 11:01:03 +02:00
Alex
29507cda7e Updated xml2js library (#2770)
## What does this do?

Updated xml2js library for tests in console. Will fix this in minio-js
as well in an upcoming PR

## How does it look?
<img width="391" alt="Screenshot 2023-04-10 at 21 58 04"
src="https://user-images.githubusercontent.com/33497058/231052457-dac4b376-d1b8-4fd2-80e2-10892f8a453d.png">

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2023-04-11 10:36:03 +02:00
Alex
81e0c82fee Changed GitHub labels (#2768)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-04-10 14:05:08 -06:00
Alex
7519fad6dd Release v0.26.3 (#2764)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-04-06 09:45:15 -07:00
Prakash Senthil Vel
248a59ee8c compliance license faq updated (#2762) 2023-04-06 10:11:34 -06:00
Alex
cefb6d3c95 Release v0.26.2 (#2761)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2023-04-05 14:12:30 -07:00
Alex
543076eaac Release v0.26.1 (#2759)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2023-04-05 13:11:39 -07:00
Alex
cbf1ddeb4c Added support for root credentials login with LDAP enabled (#2758)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-04-04 15:38:32 -06:00
Daniel Valdivia
3746adcc13 Update Login Message (#2757) 2023-04-04 12:24:10 +02:00
Alex
854b984850 Display explicit errors if websocket connection cannot be stablished (#2756)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-04-03 18:10:59 -06:00
Alex
62fa0e2043 Updated Entities results panel styles (#2753)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-03-31 22:09:37 -06:00
Javier Adriel
4f5b1b0aa7 Show modal to restart minio after subnet register (#2752) 2023-03-31 17:31:54 -06:00
MinIO Bot
0e362c2106 mds-released-v0.3.3 (#2750)
Co-authored-by: MinIO Bot <minio.bot@minio.io>
2023-03-30 14:11:56 +09:00
Alex
6ac5be32b2 Release v0.26.0 (#2746)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-03-27 17:12:21 -07:00
Harshavardhana
6966183bc8 Update deps and fix build issues (#2745) 2023-03-27 15:30:52 -06:00
Alex
60d70e3668 Added anonymous access modal in folder selection (#2736)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-03-23 12:05:16 -06:00
jinapurapu
5e65f2aced Fixed Drives offline card UI (#2732) 2023-03-23 09:53:21 -06:00
jinapurapu
1e345364cf Fixed refresh button on ListObjects screen (#2728) 2023-03-22 15:39:44 -06:00
jinapurapu
502a6c462f Fixed snackMessage to display if error returned creating policy (#2726) 2023-03-22 15:39:08 -06:00
Javier Adriel
ceafdb9cb4 Fix revive lint issues (#2730) 2023-03-22 15:06:04 -06:00
Alex
a6d8f6beaa Added Audit Kafka configuration panel (#2724) 2023-03-21 10:07:56 -06:00
Alex
fa1f84bd0a Release v0.25.1 (#2723)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-03-17 17:34:30 -07:00
Alex
72a1e5eefb Changed response type for Add bucket (#2721)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-03-17 17:36:42 -06:00
Cesar Celis Hernandez
f20fa0b1c8 Condensing Successful responses (#2722) 2023-03-17 17:12:59 -06:00
Alex
07b7af59b6 Minor Adjustments (#2719)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-03-17 11:28:12 -06:00
jinapurapu
c9ac525358 Tenant health info upload (#2606)
For registered clusters, after generating the Health Info report, Health Info is uploaded to Subnet, and latest metrics are visible in Subnet.
Authored-by: Jillian Inapurapu <jillii@Jillians-MBP.attlocal.net>
2023-03-17 09:42:01 -07:00
Daniel Valdivia
8b1b2b1e2d Introducer swagger typescript api (#2704)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2023-03-17 09:57:45 -06:00
Alex
ad0591ec17 Updated yarn packages (#2718)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-03-17 08:30:58 -07:00
Alex
59c47d98dd Reactivated Enable / Disable LDAP functionality (#2714)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-03-16 15:18:47 -07:00
Alex
cb38a545ce Fixed navigation after bucket creation (#2713)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-03-16 14:11:03 -06:00
Alex
dd356b6ea9 LDAP Page improvements (#2708)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-03-16 11:48:59 -06:00
Alex
c1d39a910f Display Menu Headers (#2712)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-03-16 09:42:58 -06:00
Alex
eb3913ba48 Fixed issues in Embeddable Object Browser (#2711)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-03-16 09:42:35 -06:00
dependabot[bot]
f7efbc66f7 Bump webpack from 5.75.0 to 5.76.1 in /portal-ui (#2707) 2023-03-14 12:58:33 -07:00
Alex
f368d9936a Adjusted dropdown box styles in login page (#2706)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-03-14 11:24:46 -06:00
Cesar Celis Hernandez
5cb4e6f651 Adopting Playwright (#2702) 2023-03-14 09:26:06 -06:00
Daniel Valdivia
f7f7b087c4 Hide Header and Padding on iframed Metrics (#2703)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2023-03-13 22:42:19 -06:00
Alex
4cceee8936 Added LDAP Entities API (#2700) 2023-03-10 09:16:29 -06:00
Prakash Senthil Vel
5262c02a28 improve airgap license update user experience (#2697) 2023-03-08 23:25:49 -06:00
Daniel Valdivia
fd81529ddc Upgrade Go Dependencies (#2699)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2023-03-08 23:24:46 -06:00
Daniel Valdivia
383341ad61 Update UI Dependencies (#2698)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2023-03-08 18:21:05 -06:00
Daniel Valdivia
66d0182825 Release v0.25.0 (#2696)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2023-03-08 09:17:03 -08:00
Alex
1fc9a40273 Changed IDP login support in console (#2695)
- Allowed to use External IDP + Built-in IDP at the same time
- Added IDP type to IDP listing
- Added IDP name when no display name is configured
- Changed STS login link into new menu
- Cleanup of Operator login strategies

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-03-07 14:10:21 -08:00
Daniel Valdivia
1953a98968 Ref Con for Login Page Links (#2694) 2023-03-06 16:12:25 -08:00
Cesar Celis Hernandez
3b5979d783 Compiling when cache is missing (#2688) 2023-03-03 09:11:00 -08:00
Harshavardhana
9aa1f43df7 move to UBI micro image (#2684)
Co-authored-by: Prakash Senthil Vel <23444145+prakashsvmx@users.noreply.github.com>
Co-authored-by: Alex <33497058+bexsoft@users.noreply.github.com>
2023-03-02 20:42:28 -08:00
Daniel Valdivia
bf89f09238 Removing Operator UI (#2692)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2023-03-02 21:35:08 -06:00
Prakash Senthil Vel
b8e14ee269 improve versioning status display and delete with versions when versioning is suspended (#2689) 2023-03-02 12:41:44 -06:00
Prakash Senthil Vel
c700ee491e fix luxon time parsing format to fix the invalid time in the logs screen (#2691) 2023-03-02 09:42:54 -08:00
1620 changed files with 32337 additions and 136108 deletions

48
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,48 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: community, triage
assignees: ''
---
## NOTE
If this case is urgent, please subscribe to [Subnet](https://min.io/pricing) so that our 24/7 support team may help you faster.
<!--- Provide a general summary of the issue in the title above -->
## Expected Behavior
<!--- If you're describing a bug, tell us what should happen -->
<!--- If you're suggesting a change/improvement, tell us how it should work -->
## Current Behavior
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
<!--- If suggesting a change/improvement, explain the difference from current behavior -->
## Possible Solution
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
<!--- or ideas how to implement the addition or change -->
## Steps to Reproduce (for bugs)
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
1.
2.
3.
4.
## Context
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
## Regression
<!-- Is this issue a regression? (Yes / No) -->
<!-- If Yes, optionally please include the MinIO version or commit id or PR# that caused this regression, if you have these details. -->
## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
* MinIO version used (`minio --version`):
* Server setup and configuration:
* Operating System and version (`uname -a`):

166
.github/workflows/cross-compile.yaml vendored Normal file
View File

@@ -0,0 +1,166 @@
# @format
name: Cross Compile
on:
pull_request:
branches:
- master
paths:
- go.sum
# This ensures that previous jobs for the PR are canceled when the PR is
# updated.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
cross-compile-1:
name: Cross compile
needs:
- lint-job
- ui-assets
- reuse-golang-dependencies
- semgrep-static-code-analysis
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.19.x, 1.20.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
cache: true
id: go
- name: Build on ${{ matrix.os }}
env:
GO111MODULE: on
GOOS: linux
run: |
make crosscompile arg1="'linux/ppc64le linux/mips64'"
cross-compile-2:
name: Cross compile 2
needs:
- lint-job
- ui-assets
- reuse-golang-dependencies
- semgrep-static-code-analysis
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.20.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
cache: true
id: go
- name: Build on ${{ matrix.os }}
env:
GO111MODULE: on
GOOS: linux
run: |
make crosscompile arg1="'linux/arm64 linux/s390x'"
cross-compile-3:
name: Cross compile 3
needs:
- lint-job
- ui-assets
- reuse-golang-dependencies
- semgrep-static-code-analysis
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.20.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
cache: true
id: go
- name: Build on ${{ matrix.os }}
env:
GO111MODULE: on
GOOS: linux
run: |
make crosscompile arg1="'darwin/amd64 freebsd/amd64'"
cross-compile-4:
name: Cross compile 4
needs:
- lint-job
- ui-assets
- reuse-golang-dependencies
- semgrep-static-code-analysis
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.20.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
cache: true
id: go
- name: Build on ${{ matrix.os }}
env:
GO111MODULE: on
GOOS: linux
run: |
make crosscompile arg1="'windows/amd64 linux/arm'"
cross-compile-5:
name: Cross compile 5
needs:
- lint-job
- ui-assets
- reuse-golang-dependencies
- semgrep-static-code-analysis
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.20.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
cache: true
id: go
- name: Build on ${{ matrix.os }}
env:
GO111MODULE: on
GOOS: linux
run: |
make crosscompile arg1="'linux/386 netbsd/amd64'"

18
.github/workflows/issues.yaml vendored Normal file
View File

@@ -0,0 +1,18 @@
# @format
name: Issue Workflow
on:
issues:
types:
- opened
jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v0.5.0
with:
project-url: https://github.com/orgs/miniohq/projects/2
github-token: ${{ secrets.BOT_PAT }}

File diff suppressed because it is too large Load Diff

51
.github/workflows/vulncheck.yaml vendored Normal file
View File

@@ -0,0 +1,51 @@
name: Vulnerability Check
on:
pull_request:
branches:
- master
push:
branches:
- master
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
vulncheck:
name: Analysis
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
check-latest: true
- name: Get official govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest
shell: bash
- name: Run govulncheck
run: govulncheck ./...
shell: bash
react-code-known-vulnerabilities:
name: "React Code Has No Known Vulnerable Deps"
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ 1.20.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NVMRC }}
cache: "yarn"
cache-dependency-path: portal-ui/yarn.lock
- name: Checks for known security issues with the installed packages
working-directory: ./portal-ui
continue-on-error: false
run: |
yarn audit --groups dependencies

10
.gitignore vendored
View File

@@ -1,3 +1,13 @@
# Playwright Data
portal-ui/storage/
portal-ui/playwright/.auth/admin.json
# Report from Playwright
portal-ui/playwright-report/
# Coverage from Playwright
portal-ui/.nyc_output/
# Binaries for programs and plugins
*.exe
*.exe~

View File

@@ -23,8 +23,8 @@ linters:
- gomodguard
- gofmt
- unused
- staticcheck
- unconvert
- varcheck
- gocritic
- gofumpt
- durationcheck

View File

@@ -1,191 +0,0 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
project_name: console
release:
name_template: "Release version {{.Tag}}"
github:
owner: minio
name: console
extra_files:
- glob: "*.minisig"
before:
hooks:
# you may remove this if you don't use vgo
- go mod tidy -compat=1.19
builds:
- goos:
- linux
- darwin
- windows
goarch:
- amd64
- ppc64le
- s390x
- arm64
ignore:
- goos: darwin
goarch: arm
- goos: windows
goarch: arm64
- goos: windows
goarch: arm
env:
- CGO_ENABLED=0
main: ./cmd/console/
flags:
- -trimpath
- --tags=kqueue,operator
ldflags:
- -s -w -X github.com/minio/console/pkg.ReleaseTag={{.Tag}} -X github.com/minio/console/pkg.CommitID={{.FullCommit}} -X github.com/minio/console/pkg.Version={{.Version}} -X github.com/minio/console/pkg.ShortCommitID={{.ShortCommit}} -X github.com/minio/console/pkg.ReleaseTime={{.Date}}
archives:
- name_template: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}"
format: binary
replacements:
arm: arm
signs:
- signature: "${artifact}.minisig"
cmd: "sh"
args:
- '-c'
- 'minisign -s /media/${USER}/minio/minisign.key -Sm ${artifact} < /media/${USER}/minio/minisign-passphrase'
artifacts: all
snapshot:
name_template: v0.0.0@{{.ShortCommit}}
changelog:
sort: asc
nfpms:
- vendor: MinIO, Inc.
homepage: https://github.com/minio/console
maintainer: MinIO Development <dev@min.io>
description: MinIO Console Server
license: GNU Affero General Public License v3.0
formats:
- deb
- rpm
contents:
# Basic file that applies to all packagers
- src: systemd/console.service
dst: /etc/systemd/system/minio-console.service
dockers:
- image_templates:
- "minio/console:{{ .Tag }}-amd64"
use: buildx
goarch: amd64
dockerfile: Dockerfile.release
extra_files:
- LICENSE
- CREDITS
build_flag_templates:
- "--platform=linux/amd64"
- "--build-arg=TAG={{ .Tag }}"
- image_templates:
- "minio/console:{{ .Tag }}-ppc64le"
use: buildx
goarch: ppc64le
dockerfile: Dockerfile.release
extra_files:
- LICENSE
- CREDITS
build_flag_templates:
- "--platform=linux/ppc64le"
- "--build-arg=TAG={{ .Tag }}"
- image_templates:
- "minio/console:{{ .Tag }}-s390x"
use: buildx
goarch: s390x
dockerfile: Dockerfile.release
extra_files:
- LICENSE
- CREDITS
build_flag_templates:
- "--platform=linux/s390x"
- "--build-arg=TAG={{ .Tag }}"
- image_templates:
- "minio/console:{{ .Tag }}-arm64"
use: buildx
goarch: arm64
goos: linux
dockerfile: Dockerfile.release
extra_files:
- LICENSE
- CREDITS
build_flag_templates:
- "--platform=linux/arm64"
- "--build-arg=TAG={{ .Tag }}"
- image_templates:
- "quay.io/minio/console:{{ .Tag }}-amd64"
use: buildx
goarch: amd64
dockerfile: Dockerfile.release
extra_files:
- LICENSE
- CREDITS
build_flag_templates:
- "--platform=linux/amd64"
- "--build-arg=TAG={{ .Tag }}"
- image_templates:
- "quay.io/minio/console:{{ .Tag }}-ppc64le"
use: buildx
goarch: ppc64le
dockerfile: Dockerfile.release
extra_files:
- LICENSE
- CREDITS
build_flag_templates:
- "--platform=linux/ppc64le"
- "--build-arg=TAG={{ .Tag }}"
- image_templates:
- "quay.io/minio/console:{{ .Tag }}-s390x"
use: buildx
goarch: s390x
dockerfile: Dockerfile.release
extra_files:
- LICENSE
- CREDITS
build_flag_templates:
- "--platform=linux/s390x"
- "--build-arg=TAG={{ .Tag }}"
- image_templates:
- "quay.io/minio/console:{{ .Tag }}-arm64"
use: buildx
goarch: arm64
goos: linux
dockerfile: Dockerfile.release
extra_files:
- LICENSE
- CREDITS
build_flag_templates:
- "--platform=linux/arm64"
- "--build-arg=TAG={{ .Tag }}"
docker_manifests:
- name_template: minio/console:{{ .Tag }}
image_templates:
- minio/console:{{ .Tag }}-amd64
- minio/console:{{ .Tag }}-arm64
- minio/console:{{ .Tag }}-ppc64le
- minio/console:{{ .Tag }}-s390x
- name_template: quay.io/minio/console:{{ .Tag }}
image_templates:
- quay.io/minio/console:{{ .Tag }}-amd64
- quay.io/minio/console:{{ .Tag }}-arm64
- quay.io/minio/console:{{ .Tag }}-ppc64le
- quay.io/minio/console:{{ .Tag }}-s390x
- name_template: minio/console:latest
image_templates:
- minio/console:{{ .Tag }}-amd64
- minio/console:{{ .Tag }}-arm64
- minio/console:{{ .Tag }}-ppc64le
- minio/console:{{ .Tag }}-s390x

View File

@@ -30,4 +30,6 @@ tests/
.vscode/
*.code-workspace
*~
.eslintcache
.eslintcache
consoleApi.ts

65
CHANGELOG.md Normal file
View File

@@ -0,0 +1,65 @@
<!-- @format -->
# Changelog
## Release v0.34.0
Features:
- Updated Buckets components
Bug Fix:
- Fixed SUBNET Health report upload
- Updated Download Handler
- Fixes issue with rewind
- Avoid 1 hour expiration for IDP credentials
---
## Release v0.33.0
Features:
- Updated OpenID, LDAP components
Bug Fix:
- Fixed security issues
- Fixed navigation issues in Object Browser
- Fixed Dashboard metrics
---
## Release v0.32.0
Features:
- Updated Users and Groups components
- Added placeholder image for Help Menu
Bug Fix:
- Fixed memory leak in WebSocket API for Object Browser
---
## Release v0.31.0
*Breaking Changes:*
- *Removed support for Standalone Deployments*
Features:
- Updated way files are displayed in uploading component
- Updated Audit Logs and Policies components
Bug Fix:
- Fixed Download folders issue in Object Browser
- Added missing Notification Events (ILM & REPLICA) in Events Notification Page
- Fixed Security Vulnerability for `semver` dependency
---
## Release v0.30.0
Features:
- Added MinIO Console Help Menu
- Updated UI Menu components
Bug Fix:
- Disable the Upload button on Object Browser if the user is not allowed
- Fixed security vulnerability for `lestrrat-go/jwx` and `fast-xml-parser`
- Fixed bug on sub-paths for Object Browser
- Reduce the number of calls to `/session` API endpoint to improve performance
- Rolled back the previous change for the Share File feature to no longer ask for Service Account access keys

View File

@@ -1,3 +1,96 @@
# Developing MinIO Console
The MinIO Console requires the [MinIO Server](https://github.com/minio/minio). For development purposes, you also need to run both the MinIO Console web app and the MinIO Console server.
## Running MinIO Console server
Build the server in the main folder by running:
```
make
```
> Note: If it's the first time running the server, you might need to run `go mod tidy` to ensure you have all modules required.
To start the server run:
```
CONSOLE_ACCESS_KEY=<your-access-key>
CONSOLE_SECRET_KEY=<your-secret-key>
CONSOLE_MINIO_SERVER=<minio-server-endpoint>
CONSOLE_DEV_MODE=on
./console server
```
## Running MinIO Console web app
Refer to `/portal-ui` [instructions](/portal-ui/README.md) to run the web app locally.
# Building with MinIO
To test console in its shipping format, you need to build it from the MinIO repository, the following step will guide
you to do that.
### 0. Building with UI Changes
If you are performing changes in the UI components of console and want to test inside the MinIO binary, you need to
build assets first.
In the console folder run
```shell
make assets
```
This will regenerate all the static assets that will be served by MinIO.
### 1. Clone the `MinIO` repository
In the parent folder of where you cloned this `console` repository, clone the MinIO Repository
```shell
git clone https://github.com/minio/minio.git
```
### 2. Update `go.mod` to use your local version
In the MinIO repository open `go.mod` and after the first `require()` directive add a `replace()` directive
```
...
)
replace (
github.com/minio/console => "../console"
)
require (
...
```
### 3. Build `MinIO`
Still in the MinIO folder, run
```shell
make build
```
# Testing on Kubernetes
If you want to test console on kubernetes, you can perform all the steps from `Building with MinIO`, but change `Step 3`
to the following:
```shell
TAG=miniodev/console:dev make docker
```
This will build a docker container image that can be used to test with your local kubernetes environment.
For example, if you are using kind:
```shell
kind load docker-image miniodev/console:dev
```
and then deploy any `Tenant` that uses this image
# LDAP authentication with Console
## Setup
@@ -15,7 +108,8 @@ $ docker cp console/docs/ldap/billy.ldif my-openldap-container:/container/servic
$ docker exec my-openldap-container ldapadd -x -D "cn=admin,dc=example,dc=org" -w admin -f /container/service/slapd/assets/test/billy.ldif -H ldap://localhost
```
Query the ldap server to check the user billy was created correctly and got assigned to the consoleAdmin group, you should get a list
Query the ldap server to check the user billy was created correctly and got assigned to the consoleAdmin group, you
should get a list
containing ldap users and groups.
```
@@ -30,7 +124,7 @@ $ docker exec my-openldap-container ldapsearch -x -H ldap://localhost -b uid=bil
### Change the password for user billy
Set the new password for `billy` to `minio123` and enter `admin` as the default `LDAP Password`
Set the new password for `billy` to `minio123` and enter `admin` as the default `LDAP Password`
```
$ docker exec -it my-openldap-container /bin/bash
@@ -41,6 +135,7 @@ Enter LDAP Password:
```
### Add the consoleAdmin policy to user billy on MinIO
```
$ cat > consoleAdmin.json << EOF
{
@@ -66,8 +161,8 @@ $ cat > consoleAdmin.json << EOF
]
}
EOF
$ mc admin policy add myminio consoleAdmin consoleAdmin.json
$ mc admin policy set myminio consoleAdmin user="uid=billy,dc=example,dc=org"
$ mc admin policy create myminio consoleAdmin consoleAdmin.json
$ mc admin policy attach myminio consoleAdmin --user="uid=billy,dc=example,dc=org"
```
## Run MinIO

View File

@@ -1,9 +1,17 @@
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7
FROM --platform=linux/amd64 registry.access.redhat.com/ubi8/ubi-minimal:8.7 as build
ARG TAG
RUN microdnf update --nodocs && microdnf install ca-certificates --nodocs
RUN curl -s -q https://raw.githubusercontent.com/minio/kes/master/LICENSE -o LICENSE
RUN curl -s -q https://raw.githubusercontent.com/minio/kes/master/CREDITS -o CREDITS
COPY CREDITS /licenses/CREDITS
COPY LICENSE /licenses/LICENSE
FROM registry.access.redhat.com/ubi8/ubi-micro:8.7
# On RHEL the certificate bundle is located at:
# - /etc/pki/tls/certs/ca-bundle.crt (RHEL 6)
# - /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem (RHEL 7)
COPY --from=build /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /etc/pki/ca-trust/extracted/pem/
COPY --from=build LICENSE /LICENSE
COPY --from=build CREDITS /CREDITS
LABEL name="MinIO" \
vendor="MinIO Inc <dev@min.io>" \
@@ -13,10 +21,6 @@ LABEL name="MinIO" \
summary="A graphical user interface for MinIO" \
description="MinIO object storage is fundamentally different. Designed for performance and the S3 API, it is 100% open-source. MinIO is ideal for large, private cloud environments with stringent security requirements and delivers mission-critical availability across a diverse range of workloads."
RUN \
microdnf update --nodocs && \
microdnf install ca-certificates --nodocs
EXPOSE 9090
COPY console /console

View File

@@ -13,12 +13,7 @@ default: console
.PHONY: console
console:
@echo "Building Console binary to './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)' --build-arg NODE_VERSION='$(NODE_VERSION)' .
@kind load docker-image $(TAG)
@echo "Done, now restart your console deployment"
@(GO111MODULE=on CGO_ENABLED=0 go build -trimpath --tags=kqueue --ldflags "-s -w" -o console ./cmd/console)
getdeps:
@mkdir -p ${GOPATH}/bin
@@ -43,7 +38,7 @@ 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 apply-gofmt
swagger-gen: clean-swagger swagger-console apply-gofmt
@echo "Done Generating swagger server code from yaml"
apply-gofmt:
@@ -54,15 +49,13 @@ clean-swagger:
@echo "cleaning"
@rm -rf models
@rm -rf restapi/operations
@rm -rf operatorapi/operations
swagger-console:
@echo "Generating swagger server code from yaml"
@swagger generate server -A console --main-package=management --server-package=restapi --exclude-main -P models.Principal -f ./swagger-console.yml -r NOTICE
@swagger generate server -A console --main-package=management --server-package=restapi --exclude-main -P models.Principal -f ./swagger.yml -r NOTICE
@echo "Generating typescript api"
@npx swagger-typescript-api -p ./swagger.yml -o ./portal-ui/src/api -n consoleApi.ts
swagger-operator:
@echo "Generating swagger server code from yaml"
@swagger generate server -A operator --main-package=operator --server-package=operatorapi --exclude-main -P models.Principal -f ./swagger-operator.yml -r NOTICE
assets:
@(if [ -f "${NVM_DIR}/nvm.sh" ]; then \. "${NVM_DIR}/nvm.sh" && nvm install && nvm use && npm install -g yarn ; fi &&\
@@ -180,7 +173,7 @@ test-sso-integration:
@(docker run --name minio-client --network my-net -dit --entrypoint=/bin/sh minio/mc)
@(docker exec minio-client mc alias set myminio/ http://minio:9000 minio minio123)
@echo "adding policy to Dillon Harper to be able to login:"
@(cd sso-integration && docker cp allaccess.json minio-client:/ && docker exec minio-client mc admin policy add myminio "Dillon Harper" allaccess.json)
@(cd sso-integration && docker cp allaccess.json minio-client:/ && docker exec minio-client mc admin policy create myminio "Dillon Harper" allaccess.json)
@echo "starting bash script"
@(env bash $(PWD)/sso-integration/set-sso.sh)
@echo "add python module"
@@ -188,15 +181,6 @@ test-sso-integration:
@echo "Executing the test:"
@(cd sso-integration && go test -coverpkg=../restapi -c -tags testrunmain . && mkdir -p coverage && ./sso-integration.test -test.v -test.run "^Test*" -test.coverprofile=coverage/sso-system.out)
test-operator-integration:
@(echo "Start cd operator-integration && go test:")
@(pwd)
@(cd operator-integration && go test -coverpkg=../operatorapi -c -tags testrunmain . && mkdir -p coverage && ./operator-integration.test -test.v -test.run "^Test*" -test.coverprofile=coverage/operator-api.out)
test-operator:
@(env bash $(PWD)/portal-ui/tests/scripts/operator.sh)
@(docker stop minio)
test-permissions-1:
@(docker run -v /data1 -v /data2 -v /data3 -v /data4 -d --name minio --rm -p 9000:9000 quay.io/minio/minio:latest server /data{1...4})
@(env bash $(PWD)/portal-ui/tests/scripts/permissions.sh "portal-ui/tests/permissions-1/")
@@ -238,9 +222,6 @@ test-apply-permissions:
test-start-docker-minio:
@(docker run -v /data1 -v /data2 -v /data3 -v /data4 -d --name minio --rm -p 9000:9000 quay.io/minio/minio:latest server /data{1...4})
initialize-operator:
@echo "Done initializing operator test"
initialize-permissions: test-start-docker-minio test-apply-permissions
@echo "Done initializing permissions test"
@@ -252,9 +233,6 @@ test:
@echo "execute test and get coverage"
@(cd restapi && mkdir coverage && GO111MODULE=on go test -test.v -coverprofile=coverage/coverage.out)
test-unit-test-operator:
@echo "execute unit test and get coverage for operatorapi"
@(cd operatorapi && mkdir coverage && GO111MODULE=on go test -test.v -coverprofile=coverage/coverage-unit-test-operatorapi.out)
test-pkg:
@echo "execute test and get coverage"
@@ -275,7 +253,5 @@ docker:
release: swagger-gen
@echo "Generating Release: $(RELEASE)"
@make assets
@yq -i e '.spec.template.spec.containers[0].image |= "minio/console:$(RELEASE)"' k8s/operator-console/base/console-deployment.yaml
@yq -i e 'select(.kind == "Deployment").spec.template.spec.containers[0].image |= "minio/console:$(RELEASE)"' k8s/operator-console/standalone/console-deployment.yaml
@git add -u .
@git add portal-ui/build/

View File

@@ -107,13 +107,13 @@ EOF
```
```sh
mc admin policy add myminio/ consoleAdmin admin.json
mc admin policy create myminio/ consoleAdmin admin.json
```
### 3. Set the policy for the new `console` user
```sh
mc admin policy set myminio consoleAdmin user=console
mc admin policy attach myminio consoleAdmin --user=console
```
> NOTE: Additionally, you can create policies to limit the privileges for other `console` users, for example, if you

View File

@@ -18,9 +18,10 @@ you need access credentials for a successful exploit).
If you have not received a reply to your email within 48 hours or you have not heard from the security team
for the past five days please contact the security team directly:
- Primary security coordinator: lenin@min.io
- Secondary coordinator: security@min.io
- If you receive no response: dev@min.io
- Primary security coordinator: daniel@min.io
- Secondary coordinator: security@min.io
- If you receive no response: dev@min.io
### Disclosure Process

View File

@@ -1,76 +0,0 @@
// This file is part of MinIO Console Server
// Copyright (c) 2021 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package cluster
import (
directpvclient "github.com/minio/directpv/pkg/client"
operator "github.com/minio/operator/pkg/client/clientset/versioned"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
certutil "k8s.io/client-go/util/cert"
)
// getTLSClientConfig will return the right TLS configuration for the K8S client based on the configured TLS certificate
func getTLSClientConfig() rest.TLSClientConfig {
defaultRootCAFile := "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
customRootCAFile := getK8sAPIServerTLSRootCA()
tlsClientConfig := rest.TLSClientConfig{}
// if console is running inside k8s by default he will have access to the CA Cert from the k8s local authority
if _, err := certutil.NewPool(defaultRootCAFile); err == nil {
tlsClientConfig.CAFile = defaultRootCAFile
}
// if the user explicitly define a custom CA certificate, instead, we will use that
if customRootCAFile != "" {
if _, err := certutil.NewPool(customRootCAFile); err == nil {
tlsClientConfig.CAFile = customRootCAFile
}
}
return tlsClientConfig
}
// This operation will run only once at console startup
var tlsClientConfig = getTLSClientConfig()
func GetK8sConfig(token string) *rest.Config {
config := &rest.Config{
Host: GetK8sAPIServer(),
TLSClientConfig: tlsClientConfig,
APIPath: "/",
BearerToken: token,
}
return config
}
// OperatorClient returns an operator client using GetK8sConfig for its config
func OperatorClient(token string) (*operator.Clientset, error) {
return operator.NewForConfig(GetK8sConfig(token))
}
// K8sClient returns kubernetes client using GetK8sConfig for its config
func K8sClient(token string) (*kubernetes.Clientset, error) {
return kubernetes.NewForConfig(GetK8sConfig(token))
}
// DirectPV interfaces required to fetch information
func DirectPVDriveInterface(token string) (*directpvclient.DirectCSIDriveInterface, error) {
return directpvclient.DirectCSIDriveInterfaceForConfig(GetK8sConfig(token))
}
func DirectPVVolumeInterface(token string) (*directpvclient.DirectCSIVolumeInterface, error) {
return directpvclient.DirectCSIVolumeInterfaceForConfig(GetK8sConfig(token))
}

View File

@@ -1,83 +0,0 @@
// This file is part of MinIO Console Server
// Copyright (c) 2021 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package cluster
import (
"io/ioutil"
"net"
"strings"
"time"
xhttp "github.com/minio/console/pkg/http"
"github.com/minio/console/restapi"
"github.com/minio/console/pkg/utils"
"github.com/minio/pkg/env"
)
func GetK8sAPIServer() string {
// if console is running inside a k8s pod KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT will contain the k8s api server apiServerAddress
// if console is not running inside k8s by default will look for the k8s api server on localhost:8001 (kubectl proxy)
// NOTE: using kubectl proxy is for local development only, since every request send to localhost:8001 will bypass service account authentication
// more info here: https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#directly-accessing-the-rest-api
// you can override this using CONSOLE_K8S_API_SERVER, ie use the k8s cluster from `kubectl config view`
host, port := env.Get("KUBERNETES_SERVICE_HOST", ""), env.Get("KUBERNETES_SERVICE_PORT", "")
apiServerAddress := "http://localhost:8001"
if host != "" && port != "" {
apiServerAddress = "https://" + net.JoinHostPort(host, port)
}
return env.Get(ConsoleK8sAPIServer, apiServerAddress)
}
// If CONSOLE_K8S_API_SERVER_TLS_ROOT_CA is true console will load the certificate into the
// http.client rootCAs pool, this is useful for testing an k8s ApiServer or when working with self-signed certificates
func getK8sAPIServerTLSRootCA() string {
return strings.TrimSpace(env.Get(ConsoleK8SAPIServerTLSRootCA, ""))
}
// GetNsFromFile assumes console is running inside a k8s pod and extract the current namespace from the
// /var/run/secrets/kubernetes.io/serviceaccount/namespace file
func GetNsFromFile() string {
dat, err := ioutil.ReadFile("/var/run/secrets/kubernetes.io/serviceaccount/namespace")
if err != nil {
return "default"
}
return string(dat)
}
// GetMinioImage returns the image URL to be used when deploying a MinIO instance, if there is
// a preferred image to be used (configured via ENVIRONMENT VARIABLES) GetMinioImage will return that
// if not, GetMinioImage will try to obtain the image URL for the latest version of MinIO and return that
func GetMinioImage() (*string, error) {
image := strings.TrimSpace(env.Get(ConsoleMinioImage, ""))
// if there is a preferred image configured by the user we'll always return that
if image != "" {
return &image, nil
}
client := restapi.GetConsoleHTTPClient("")
client.Timeout = 5 * time.Second
latestMinIOImage, errLatestMinIOImage := utils.GetLatestMinIOImage(
&xhttp.Client{
Client: client,
})
if errLatestMinIOImage != nil {
return nil, errLatestMinIOImage
}
return latestMinIOImage, nil
}

View File

@@ -1,23 +0,0 @@
// This file is part of MinIO Console Server
// Copyright (c) 2021 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package cluster
const (
ConsoleK8sAPIServer = "CONSOLE_K8S_API_SERVER"
ConsoleK8SAPIServerTLSRootCA = "CONSOLE_K8S_API_SERVER_TLS_ROOT_CA"
ConsoleMinioImage = "CONSOLE_MINIO_IMAGE"
)

View File

@@ -1,6 +1,3 @@
//go:build operator
// +build operator
// This file is part of MinIO Console Server
// Copyright (c) 2021 MinIO, Inc.
//
@@ -22,7 +19,6 @@ package main
import (
"context"
"fmt"
"os"
"strconv"
"time"
@@ -35,20 +31,19 @@ import (
var appCmds = []cli.Command{
serverCmd,
updateCmd,
operatorCmd,
}
// StartServer starts the console service
func StartServer(ctx *cli.Context) error {
// Load all certificates
if err := loadAllCerts(ctx); err != nil {
// Log this as a warning and continue running console without TLS certificates
restapi.LogError("Unable to load certs: %v", err)
}
xctx := context.Background()
transport := restapi.PrepareSTSClientTransport(false)
if err := logger.InitializeLogger(xctx, transport); err != nil {
transport := restapi.PrepareSTSClientTransport(false, restapi.LocalAddress)
if err := logger.InitializeLogger(xctx, transport.Transport); err != nil {
fmt.Println("error InitializeLogger", err)
logger.CriticalIf(xctx, err)
}
@@ -57,10 +52,6 @@ func StartServer(ctx *cli.Context) error {
restapi.LogError = logger.Error
restapi.LogIf = logger.LogIf
if os.Getenv("CONSOLE_OPERATOR_MODE") != "" && os.Getenv("CONSOLE_OPERATOR_MODE") == "on" {
return startOperatorServer(ctx)
}
var rctx restapi.Context
if err := rctx.Load(ctx); err != nil {
restapi.LogError("argument validation failed: %v", err)

View File

@@ -1,92 +0,0 @@
// This file is part of MinIO Console Server
// Copyright (c) 2021 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//go:build !operator
// +build !operator
package main
import (
"context"
"fmt"
"strconv"
"time"
"github.com/minio/console/pkg/logger"
"github.com/minio/cli"
"github.com/minio/console/restapi"
)
var appCmds = []cli.Command{
serverCmd,
updateCmd,
}
// StartServer starts the console service
func StartServer(ctx *cli.Context) error {
if err := loadAllCerts(ctx); err != nil {
// Log this as a warning and continue running console without TLS certificates
restapi.LogError("Unable to load certs: %v", err)
}
xctx := context.Background()
transport := restapi.PrepareSTSClientTransport(false)
if err := logger.InitializeLogger(xctx, transport); err != nil {
fmt.Println("error InitializeLogger", err)
logger.CriticalIf(xctx, err)
}
// custom error configuration
restapi.LogInfo = logger.Info
restapi.LogError = logger.Error
restapi.LogIf = logger.LogIf
var rctx restapi.Context
if err := rctx.Load(ctx); err != nil {
restapi.LogError("argument validation failed: %v", err)
return err
}
server, err := buildServer()
if err != nil {
restapi.LogError("Unable to initialize console server: %v", err)
return err
}
server.Host = rctx.Host
server.Port = rctx.HTTPPort
// set conservative timesout for uploads
server.ReadTimeout = 1 * time.Hour
// no timeouts for response for downloads
server.WriteTimeout = 0
restapi.Port = strconv.Itoa(server.Port)
restapi.Hostname = server.Host
if len(restapi.GlobalPublicCerts) > 0 {
// If TLS certificates are provided enforce the HTTPS schema, meaning console will redirect
// plain HTTP connections to HTTPS server
server.EnabledListeners = []string{"http", "https"}
server.TLSPort = rctx.HTTPSPort
// Need to store tls-port, tls-host un config variables so secure.middleware can read from there
restapi.TLSPort = strconv.Itoa(server.TLSPort)
restapi.Hostname = rctx.Host
restapi.TLSRedirect = rctx.TLSRedirect
}
defer server.Shutdown()
return server.Serve()
}

View File

@@ -1,188 +0,0 @@
//go:build operator
// +build operator
// 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 main
import (
"context"
"fmt"
"strconv"
"time"
"github.com/minio/console/pkg/logger"
"github.com/minio/console/restapi"
"github.com/go-openapi/loads"
"github.com/jessevdk/go-flags"
"github.com/minio/cli"
"github.com/minio/console/operatorapi"
"github.com/minio/console/operatorapi/operations"
"github.com/minio/console/pkg/certs"
)
// starts the server
var operatorCmd = cli.Command{
Name: "operator",
Aliases: []string{"opr"},
Usage: "Start MinIO Operator UI server",
Action: startOperatorServer,
Flags: []cli.Flag{
cli.StringFlag{
Name: "host",
Value: restapi.GetHostname(),
Usage: "bind to a specific HOST, HOST can be an IP or hostname",
},
cli.IntFlag{
Name: "port",
Value: restapi.GetPort(),
Usage: "bind to specific HTTP port",
},
// This is kept here for backward compatibility,
// hostname's do not have HTTP or HTTPs
// hostnames are opaque so using --host
// works for both HTTP and HTTPS setup.
cli.StringFlag{
Name: "tls-host",
Value: restapi.GetHostname(),
Hidden: true,
},
cli.StringFlag{
Name: "certs-dir",
Value: certs.GlobalCertsCADir.Get(),
Usage: "path to certs directory",
},
cli.IntFlag{
Name: "tls-port",
Value: restapi.GetTLSPort(),
Usage: "bind to specific HTTPS port",
},
cli.StringFlag{
Name: "tls-redirect",
Value: restapi.GetTLSRedirect(),
Usage: "toggle HTTP->HTTPS redirect",
},
cli.StringFlag{
Name: "tls-certificate",
Value: "",
Usage: "path to TLS public certificate",
Hidden: true,
},
cli.StringFlag{
Name: "tls-key",
Value: "",
Usage: "path to TLS private key",
Hidden: true,
},
cli.StringFlag{
Name: "tls-ca",
Value: "",
Usage: "path to TLS Certificate Authority",
Hidden: true,
},
},
}
func buildOperatorServer() (*operatorapi.Server, error) {
swaggerSpec, err := loads.Embedded(operatorapi.SwaggerJSON, operatorapi.FlatSwaggerJSON)
if err != nil {
return nil, err
}
api := operations.NewOperatorAPI(swaggerSpec)
api.Logger = restapi.LogInfo
server := operatorapi.NewServer(api)
parser := flags.NewParser(server, flags.Default)
parser.ShortDescription = "MinIO Console Server"
parser.LongDescription = swaggerSpec.Spec().Info.Description
server.ConfigureFlags()
// register all APIs
server.ConfigureAPI()
for _, optsGroup := range api.CommandLineOptionsGroups {
_, err := parser.AddGroup(optsGroup.ShortDescription, optsGroup.LongDescription, optsGroup.Options)
if err != nil {
return nil, err
}
}
if _, err := parser.Parse(); err != nil {
return nil, err
}
return server, nil
}
// StartServer starts the console service
func startOperatorServer(ctx *cli.Context) error {
if err := loadAllCerts(ctx); err != nil {
// Log this as a warning and continue running console without TLS certificates
restapi.LogError("Unable to load certs: %v", err)
}
xctx := context.Background()
transport := restapi.PrepareSTSClientTransport(false)
if err := logger.InitializeLogger(xctx, transport); err != nil {
fmt.Println("error InitializeLogger", err)
logger.CriticalIf(xctx, err)
}
// custom error configuration
restapi.LogInfo = logger.Info
restapi.LogError = logger.Error
restapi.LogIf = logger.LogIf
var rctx operatorapi.Context
if err := rctx.Load(ctx); err != nil {
restapi.LogError("argument validation failed: %v", err)
return err
}
server, err := buildOperatorServer()
if err != nil {
restapi.LogError("Unable to initialize console server: %v", err)
return err
}
server.Host = rctx.Host
server.Port = rctx.HTTPPort
// set conservative timesout for uploads
server.ReadTimeout = 1 * time.Hour
// no timeouts for response for downloads
server.WriteTimeout = 0
operatorapi.Port = strconv.Itoa(server.Port)
operatorapi.Hostname = server.Host
if len(restapi.GlobalPublicCerts) > 0 {
// If TLS certificates are provided enforce the HTTPS schema, meaning console will redirect
// plain HTTP connections to HTTPS server
server.EnabledListeners = []string{"http", "https"}
server.TLSPort = rctx.HTTPSPort
// Need to store tls-port, tls-host un config variables so secure.middleware can read from there
operatorapi.TLSPort = strconv.Itoa(server.TLSPort)
operatorapi.Hostname = rctx.Host
operatorapi.TLSRedirect = rctx.TLSRedirect
}
defer server.Shutdown()
return server.Serve()
}

View File

@@ -18,7 +18,7 @@ package main
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"syscall"
@@ -163,7 +163,7 @@ func loadAllCerts(ctx *cli.Context) error {
// load ca cert from swagger server tls-ca flag
if swaggerServerCACertificate != "" {
caCert, caCertErr := ioutil.ReadFile(swaggerServerCACertificate)
caCert, caCertErr := os.ReadFile(swaggerServerCACertificate)
if caCertErr == nil {
restapi.GlobalRootCAs.AppendCertsFromPEM(caCert)
}

View File

@@ -96,7 +96,7 @@ var updateCmd = cli.Command{
Action: updateInplace,
}
func updateInplace(ctx *cli.Context) error {
func updateInplace(_ *cli.Context) error {
transport := getUpdateTransport(30 * time.Second)
rel, err := getLatestRelease(transport)
if err != nil {

View File

@@ -1,39 +0,0 @@
# Running Console in Operator mode
`Console` will authenticate against `Kubernetes`using bearer tokens via HTTP `Authorization` header. The user will provide this token once
in the login form, Console will validate it against Kubernetes (list apis) and if valid will generate and return a new Console sessions
with encrypted claims (the user Service account token will be inside the session encrypted token
# Kubernetes
The provided `JWT token` corresponds to the `Kubernetes service account` that `Console` will use to run tasks on behalf of the
user, ie: list, create, edit, delete tenants, storage class, etc.
# Development
If console is running inside a k8s pod `KUBERNETES_SERVICE_HOST` and `KUBERNETES_SERVICE_PORT` will contain the k8s api server apiServerAddress
if console is not running inside k8s by default will look for the k8s api server on `localhost:8001` (kubectl proxy)
If you are running console in your local environment and wish to make request to `Kubernetes` you can set `CONSOLE_K8S_API_SERVER`, if
the environment variable is not present by default `Console` will use `"http://localhost:8001"`, additionally you will need to set the
`CONSOLE_OPERATOR_MODE=on` variable to make Console display the Operator UI.
NOTE: using `kubectl` proxy is for local development only, since every request send to localhost:8001 will bypass service account authentication
more info here: https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#directly-accessing-the-rest-api
you can override this using `CONSOLE_K8S_API_SERVER`, ie use the k8s cluster from `kubectl config view`
## Extract the Service account token and use it with Console
For local development you can use the jwt associated to the `console-sa` service account, you can get the token running
the following command in your terminal:
```
kubectl get secret $(kubectl get serviceaccount console-sa -o jsonpath="{.secrets[0].name}") -o jsonpath="{.data.token}" | base64 --decode
```
Then run the Console server
```
CONSOLE_OPERATOR_MODE=on ./console server
```

143
go.mod
View File

@@ -1,137 +1,115 @@
module github.com/minio/console
go 1.19
go 1.20
require (
github.com/blang/semver/v4 v4.0.0
github.com/cheggaaa/pb/v3 v3.1.0
github.com/cheggaaa/pb/v3 v3.1.2
github.com/dustin/go-humanize v1.0.1
github.com/fatih/color v1.14.1
github.com/fatih/color v1.15.0
github.com/go-openapi/errors v0.20.3
github.com/go-openapi/loads v0.21.2
github.com/go-openapi/runtime v0.25.0
github.com/go-openapi/spec v0.20.8
github.com/go-openapi/strfmt v0.21.3
github.com/go-openapi/runtime v0.26.0
github.com/go-openapi/spec v0.20.9
github.com/go-openapi/strfmt v0.21.7
github.com/go-openapi/swag v0.22.3
github.com/go-openapi/validate v0.22.1
github.com/golang-jwt/jwt/v4 v4.5.0
github.com/google/uuid v1.3.0
github.com/jessevdk/go-flags v1.5.0
github.com/klauspost/compress v1.15.15
github.com/klauspost/compress v1.16.5
github.com/minio/cli v1.24.2
github.com/minio/directpv v1.4.4-0.20220805090942-948ca4731651
github.com/minio/highwayhash v1.0.2
github.com/minio/kes v0.22.3
github.com/minio/madmin-go/v2 v2.0.14
github.com/minio/mc v0.0.0-20230221142751-40e51ee9affb
github.com/minio/minio-go/v7 v7.0.49
github.com/minio/operator v0.0.0-20230228004026-ad024a9dffe5
github.com/minio/pkg v1.6.3
github.com/minio/madmin-go/v3 v3.0.2
github.com/minio/mc v0.0.0-20230619193119-5f39522e6902
github.com/minio/minio-go/v7 v7.0.58-0.20230622175401-7048a16cfbca
github.com/minio/pkg v1.7.5
github.com/minio/selfupdate v0.6.0
github.com/minio/websocket v1.6.0
github.com/mitchellh/go-homedir v1.1.0
github.com/rs/xid v1.4.0
github.com/rs/xid v1.5.0
github.com/secure-io/sio-go v0.3.1
github.com/stretchr/testify v1.8.1
github.com/stretchr/testify v1.8.4
github.com/tidwall/gjson v1.14.4
github.com/unrolled/secure v1.13.0
golang.org/x/crypto v0.6.0
golang.org/x/net v0.7.0
golang.org/x/oauth2 v0.5.0
golang.org/x/crypto v0.9.0
golang.org/x/net v0.10.0
golang.org/x/oauth2 v0.7.0
// Added to include security fix for
// https://github.com/golang/go/issues/56152
golang.org/x/text v0.7.0 // indirect
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.26.1
k8s.io/apimachinery v0.26.1
k8s.io/client-go v0.26.1
k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5
golang.org/x/text v0.9.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
require github.com/mattn/go-ieproxy v0.0.1
require (
aead.dev/mem v0.2.0 // indirect
aead.dev/minisign v0.2.0 // indirect
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect
github.com/aymanbagabas/go-osc52 v1.2.1 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/charmbracelet/bubbles v0.15.0 // indirect
github.com/charmbracelet/bubbletea v0.23.1 // indirect
github.com/charmbracelet/lipgloss v0.6.0 // indirect
github.com/charmbracelet/bubbletea v0.23.2 // indirect
github.com/charmbracelet/lipgloss v0.7.1 // indirect
github.com/cheggaaa/pb v1.0.29 // indirect
github.com/containerd/console v1.0.3 // indirect
github.com/coreos/go-semver v0.3.1 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/emicklei/go-restful/v3 v3.10.0 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/gdamore/encoding v1.0.0 // indirect
github.com/gdamore/tcell/v2 v2.5.4 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/gdamore/tcell/v2 v2.6.0 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-openapi/analysis v0.21.4 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/goccy/go-json v0.10.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jedib0t/go-pretty/v6 v6.4.4 // indirect
github.com/jedib0t/go-pretty/v6 v6.4.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/juju/ratelimit v1.0.2 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/kr/pretty v0.3.0 // indirect
github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect
github.com/lestrrat-go/blackmagic v1.0.1 // indirect
github.com/lestrrat-go/httpcc v1.0.1 // indirect
github.com/lestrrat-go/iter v1.0.2 // indirect
github.com/lestrrat-go/jwx v1.2.25 // indirect
github.com/lestrrat-go/jwx v1.2.26 // indirect
github.com/lestrrat-go/option v1.0.1 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/lufia/plan9stats v0.0.0-20230110061619-bbe2e5e100de // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/lufia/plan9stats v0.0.0-20230326075908-cb1d2100619a // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-ieproxy v0.0.1 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-isatty v0.0.18 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mb0/glob v0.0.0-20160210091149-1eb79d2de6c4 // indirect
github.com/miekg/dns v1.1.50 // indirect
github.com/minio/colorjson v1.0.4 // indirect
github.com/minio/colorjson v1.0.5 // indirect
github.com/minio/filepath v1.0.0 // indirect
github.com/minio/md5-simd v1.1.2 // indirect
github.com/minio/sha256-simd v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/montanaflynn/stats v0.7.0 // indirect
github.com/muesli/ansi v0.0.0-20221106050444-61f0cd9a192a // indirect
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/muesli/reflow v0.3.0 // indirect
github.com/muesli/termenv v0.13.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/muesli/termenv v0.15.1 // indirect
github.com/navidys/tvxwidgets v0.3.0 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/philhofer/fwd v1.1.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pkg/xattr v0.4.9 // indirect
@@ -140,20 +118,16 @@ require (
github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.39.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/prometheus/prom2json v1.3.2 // indirect
github.com/rivo/tview v0.0.0-20230130130022-4a1b7a76c01c // indirect
github.com/rivo/tview v0.0.0-20230406072732-e22ce9588bb4 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rjeczalik/notify v0.9.3 // indirect
github.com/shirou/gopsutil/v3 v3.23.1 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.10.0 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/shirou/gopsutil/v3 v3.23.3 // indirect
github.com/shoenig/go-m1cpu v0.1.5 // indirect
github.com/sirupsen/logrus v1.9.2 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tinylib/msgp v1.1.8 // indirect
@@ -163,29 +137,18 @@ require (
go.etcd.io/etcd/api/v3 v3.5.7 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.7 // indirect
go.etcd.io/etcd/client/v3 v3.5.7 // indirect
go.mongodb.org/mongo-driver v1.10.0 // indirect
go.mongodb.org/mongo-driver v1.11.3 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/goleak v1.1.12 // indirect
go.uber.org/multierr v1.9.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/mod v0.7.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/term v0.5.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.4.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/term v0.8.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44 // indirect
google.golang.org/grpc v1.53.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
google.golang.org/genproto v0.0.0-20230403163135-c38d8f061ccd // indirect
google.golang.org/grpc v1.54.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/h2non/filetype.v1 v1.0.5 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.25.4 // indirect
k8s.io/klog/v2 v2.80.1 // indirect
k8s.io/kube-openapi v0.0.0-20221110221610-a28e98eb7c70 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

1204
go.sum

File diff suppressed because it is too large Load Diff

View File

@@ -31,7 +31,7 @@ import (
func Test_AddAccessRuleAPI(t *testing.T) {
assert := assert.New(t)
AddBucket("testaccessruleadd", false, false, nil, nil)
AddBucket("testaccessruleadd", false, nil, nil, nil)
type args struct {
bucket string
@@ -111,7 +111,7 @@ func Test_AddAccessRuleAPI(t *testing.T) {
func Test_GetAccessRulesAPI(t *testing.T) {
assert := assert.New(t)
AddBucket("testaccessruleget", false, false, nil, nil)
AddBucket("testaccessruleget", false, nil, nil, nil)
type args struct {
bucket string
@@ -161,7 +161,7 @@ func Test_GetAccessRulesAPI(t *testing.T) {
func Test_DeleteAccessRuleAPI(t *testing.T) {
assert := assert.New(t)
AddBucket("testaccessruledelete", false, false, nil, nil)
AddBucket("testaccessruledelete", false, nil, nil, nil)
type args struct {
prefix string

View File

@@ -20,7 +20,7 @@ import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"log"
"net/http"
"testing"
@@ -56,7 +56,7 @@ func TestLoginStrategy(t *testing.T) {
}
if response != nil {
bodyBytes, _ := ioutil.ReadAll(response.Body)
bodyBytes, _ := io.ReadAll(response.Body)
loginDetails := models.LoginDetails{}

View File

@@ -17,8 +17,10 @@
package integration
import (
"bytes"
"context"
"encoding/base64"
"encoding/json"
"fmt"
"log"
"math/rand"
@@ -194,3 +196,86 @@ func TestObjectGet(t *testing.T) {
})
}
}
func downloadMultipleFiles(bucketName string, objects []string) (*http.Response, error) {
requestURL := fmt.Sprintf("http://localhost:9090/api/v1/buckets/%s/objects/download-multiple", bucketName)
postReqParams, _ := json.Marshal(objects)
reqBody := bytes.NewReader(postReqParams)
request, err := http.NewRequest(
"POST", requestURL, reqBody)
if err != nil {
log.Println(err)
return nil, nil
}
request.Header.Add("Cookie", fmt.Sprintf("token=%s", token))
request.Header.Add("Content-Type", "application/json")
client := &http.Client{
Timeout: 2 * time.Second,
}
response, err := client.Do(request)
return response, err
}
func TestDownloadMultipleFiles(t *testing.T) {
assert := assert.New(t)
type args struct {
bucketName string
objectLis []string
}
tests := []struct {
name string
args args
expectedStatus int
expectedError bool
}{
{
name: "Test empty Bucket",
args: args{
bucketName: "",
},
expectedStatus: 400,
expectedError: true,
},
{
name: "Test empty object list",
args: args{
bucketName: "test-bucket",
},
expectedStatus: 400,
expectedError: true,
},
{
name: "Test with bucket and object list",
args: args{
bucketName: "test-bucket",
objectLis: []string{
"my-object.txt",
"test-prefix/",
"test-prefix/nested-prefix/",
"test-prefix/nested-prefix/deep-nested/",
},
},
expectedStatus: 200,
expectedError: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
resp, err := downloadMultipleFiles(tt.args.bucketName, tt.args.objectLis)
if tt.expectedError {
assert.Nil(err)
if err != nil {
log.Println(err)
return
}
}
if resp != nil {
assert.NotNil(resp)
}
})
}
}

View File

@@ -21,7 +21,7 @@ import (
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"log"
"net/http"
"testing"
@@ -630,7 +630,7 @@ func Test_PolicyListUsersAPI(t *testing.T) {
return
}
if response != nil {
bodyBytes, _ := ioutil.ReadAll(response.Body)
bodyBytes, _ := io.ReadAll(response.Body)
assert.Equal(tt.expectedStatus, response.StatusCode, tt.name+" Failed")
if response.StatusCode == 200 {
assert.Equal("[\"policyuser4\"]\n", string(bodyBytes))
@@ -709,7 +709,7 @@ func Test_PolicyListGroupsAPI(t *testing.T) {
return
}
if response != nil {
bodyBytes, _ := ioutil.ReadAll(response.Body)
bodyBytes, _ := io.ReadAll(response.Body)
assert.Equal(tt.expectedStatus, response.StatusCode, tt.name+" Failed")
if response.StatusCode == 200 {
assert.Equal("[\"testgroup12345\"]\n", string(bodyBytes))

View File

@@ -25,7 +25,6 @@ import (
"errors"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"os"
@@ -43,14 +42,14 @@ import (
type AddBucketOps struct {
Name string
Locking bool
Versioning bool
Versioning map[string]interface{}
Quota map[string]interface{}
Retention map[string]interface{}
Endpoint *string
UseToken *string
}
func AddBucket(name string, locking, versioning bool, quota, retention map[string]interface{}) (*http.Response, error) {
func AddBucket(name string, locking bool, versioning, quota, retention map[string]interface{}) (*http.Response, error) {
return AddBucketWithOpts(&AddBucketOps{
Name: name,
Locking: locking,
@@ -143,11 +142,11 @@ func getTokenForEndpoint(endpoint string) string {
return loginToken
}
func setupBucket(name string, locking, versioning bool, quota, retention map[string]interface{}, assert *assert.Assertions, expected int) bool {
func setupBucket(name string, locking bool, versioning, quota, retention map[string]interface{}, assert *assert.Assertions, expected int) bool {
return setupBucketForEndpoint(name, locking, versioning, quota, retention, assert, expected, nil, nil)
}
func setupBucketForEndpoint(name string, locking, versioning bool, quota, retention map[string]interface{}, assert *assert.Assertions, expected int, endpoint, endpointToken *string) bool {
func setupBucketForEndpoint(name string, locking bool, versioning, quota, retention map[string]interface{}, assert *assert.Assertions, expected int, endpoint, endpointToken *string) bool {
/*
The intention of this function is to return either true or false to
reduce the code by performing the verification in one place only.
@@ -167,6 +166,10 @@ func setupBucketForEndpoint(name string, locking, versioning bool, quota, retent
return false
}
if response != nil {
if response.StatusCode >= 200 && response.StatusCode <= 299 {
fmt.Println("setupBucketForEndpoint(): HTTP Status is in the 2xx range")
return true
}
if response.StatusCode != expected {
assert.Fail(inspectHTTPResponse(response))
return false
@@ -748,7 +751,7 @@ func TestPutObjectsLegalholdStatus(t *testing.T) {
status := "enabled"
// 1. Create bucket
if !setupBucket(bucketName, true, true, nil, nil, assert, 201) {
if !setupBucket(bucketName, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
return
}
@@ -773,7 +776,7 @@ func TestPutObjectsLegalholdStatus(t *testing.T) {
// Get versionID
listResponse, _ := ListObjects(bucketName, prefix, "true")
bodyBytes, _ := ioutil.ReadAll(listResponse.Body)
bodyBytes, _ := io.ReadAll(listResponse.Body)
listObjs := models.ListObjectsResponse{}
err := json.Unmarshal(bodyBytes, &listObjs)
if err != nil {
@@ -835,7 +838,7 @@ func TestGetBucketQuota(t *testing.T) {
validBucket := "testgetbucketquota"
// 1. Create bucket
if !setupBucket(validBucket, true, true, nil, nil, assert, 201) {
if !setupBucket(validBucket, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
return
}
@@ -912,7 +915,7 @@ func TestPutBucketQuota(t *testing.T) {
validBucket := "testputbucketquota"
// 1. Create bucket
if !setupBucket(validBucket, true, true, nil, nil, assert, 201) {
if !setupBucket(validBucket, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
return
}
@@ -971,7 +974,7 @@ func TestListBucketEvents(t *testing.T) {
validBucket := "testlistbucketevents"
// 1. Create bucket
if !setupBucket(validBucket, true, true, nil, nil, assert, 201) {
if !setupBucket(validBucket, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
return
}
@@ -1029,7 +1032,7 @@ func TestDeleteObjectsRetentionStatus(t *testing.T) {
validPrefix := encodeBase64(fileName)
// 1. Create bucket
if !setupBucket(bucketName, true, true, nil, nil, assert, 201) {
if !setupBucket(bucketName, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
return
}
@@ -1054,7 +1057,7 @@ func TestDeleteObjectsRetentionStatus(t *testing.T) {
// Get versionID
listResponse, _ := ListObjects(bucketName, validPrefix, "true")
bodyBytes, _ := ioutil.ReadAll(listResponse.Body)
bodyBytes, _ := io.ReadAll(listResponse.Body)
listObjs := models.ListObjectsResponse{}
err := json.Unmarshal(bodyBytes, &listObjs)
if err != nil {
@@ -1136,7 +1139,7 @@ func TestBucketSetPolicy(t *testing.T) {
validBucketName := "testbucketsetpolicy"
// 1. Create bucket
if !setupBucket(validBucketName, true, true, nil, nil, assert, 201) {
if !setupBucket(validBucketName, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
return
}
@@ -1197,7 +1200,7 @@ func TestRestoreObjectToASelectedVersion(t *testing.T) {
validPrefix := encodeBase64(fileName)
// 1. Create bucket
if !setupBucket(bucketName, true, true, nil, nil, assert, 201) {
if !setupBucket(bucketName, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
return
}
@@ -1222,7 +1225,7 @@ func TestRestoreObjectToASelectedVersion(t *testing.T) {
// 3. Get versionID
listResponse, _ := ListObjects(bucketName, validPrefix, "true")
bodyBytes, _ := ioutil.ReadAll(listResponse.Body)
bodyBytes, _ := io.ReadAll(listResponse.Body)
listObjs := models.ListObjectsResponse{}
err := json.Unmarshal(bodyBytes, &listObjs)
if err != nil {
@@ -1285,7 +1288,7 @@ func TestPutBucketsTags(t *testing.T) {
// 1. Create the bucket
assert := assert.New(t)
validBucketName := "testputbuckettags1"
if !setupBucket(validBucketName, false, false, nil, nil, assert, 201) {
if !setupBucket(validBucketName, false, nil, nil, nil, assert, 200) {
return
}
@@ -1343,7 +1346,7 @@ func TestGetsTheMetadataOfAnObject(t *testing.T) {
tags["tag"] = "testputobjecttagbucketonetagone"
// 1. Create the bucket
if !setupBucket(bucketName, false, false, nil, nil, assert, 201) {
if !setupBucket(bucketName, false, nil, nil, nil, assert, 200) {
return
}
@@ -1414,7 +1417,7 @@ func TestPutObjectsRetentionStatus(t *testing.T) {
prefix := encodeBase64(fileName)
// 1. Create bucket
if !setupBucket(bucketName, true, true, nil, nil, assert, 201) {
if !setupBucket(bucketName, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
return
}
@@ -1439,7 +1442,7 @@ func TestPutObjectsRetentionStatus(t *testing.T) {
// Get versionID
listResponse, _ := ListObjects(bucketName, prefix, "true")
bodyBytes, _ := ioutil.ReadAll(listResponse.Body)
bodyBytes, _ := io.ReadAll(listResponse.Body)
listObjs := models.ListObjectsResponse{}
err := json.Unmarshal(bodyBytes, &listObjs)
if err != nil {
@@ -1512,7 +1515,7 @@ func TestShareObjectOnURL(t *testing.T) {
versionID := "null"
// 1. Create the bucket
if !setupBucket(bucketName, false, false, nil, nil, assert, 201) {
if !setupBucket(bucketName, false, nil, nil, nil, assert, 200) {
return
}
@@ -1586,7 +1589,7 @@ func TestListObjects(t *testing.T) {
fileName := "testlistobjecttobucket1.txt"
// 1. Create the bucket
if !setupBucket(bucketName, false, false, nil, nil, assert, 201) {
if !setupBucket(bucketName, false, nil, nil, nil, assert, 200) {
return
}
@@ -1634,7 +1637,7 @@ func TestDeleteObject(t *testing.T) {
numberOfFiles := 2
// 1. Create bucket
if !setupBucket(bucketName, true, true, nil, nil, assert, 201) {
if !setupBucket(bucketName, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
return
}
@@ -1700,7 +1703,7 @@ func TestUploadObjectToBucket(t *testing.T) {
fileName := "sample.txt"
// 1. Create the bucket
if !setupBucket(bucketName, false, false, nil, nil, assert, 201) {
if !setupBucket(bucketName, false, nil, nil, nil, assert, 200) {
return
}
@@ -1735,7 +1738,7 @@ func TestDownloadObject(t *testing.T) {
}
// 1. Create the bucket
if !setupBucket(bucketName, true, true, nil, nil, assert, 201) {
if !setupBucket(bucketName, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
return
}
@@ -1772,7 +1775,7 @@ func TestDownloadObject(t *testing.T) {
}
// 4. Verify the file was downloaded
files, err := ioutil.ReadDir(workingDirectory)
files, err := os.ReadDir(workingDirectory)
if err != nil {
log.Fatal(err)
}
@@ -1797,7 +1800,7 @@ func TestDeleteMultipleObjects(t *testing.T) {
fileName := "testdeletemultipleobjs"
// 1. Create a bucket for this particular test
if !setupBucket(bucketName, false, false, nil, nil, assert, 201) {
if !setupBucket(bucketName, false, nil, nil, nil, assert, 200) {
return
}
@@ -1874,7 +1877,7 @@ func TestPutObjectTag(t *testing.T) {
versionID := "null"
// 1. Create the bucket
if !setupBucket(bucketName, false, false, nil, nil, assert, 201) {
if !setupBucket(bucketName, false, nil, nil, nil, assert, 200) {
return
}
@@ -1948,7 +1951,7 @@ func TestBucketRetention(t *testing.T) {
retention["mode"] = "compliance"
retention["unit"] = "years"
retention["validity"] = 2
if !setupBucket("setbucketretention1", true, true, nil, retention, assert, 201) {
if !setupBucket("setbucketretention1", true, map[string]interface{}{"enabled": true}, nil, retention, assert, 200) {
return
}
@@ -1999,7 +2002,7 @@ func TestBucketInformationGenericErrorResponse(t *testing.T) {
// 1. Create the bucket
assert := assert.New(t)
if !setupBucket("bucketinformation2", false, false, nil, nil, assert, 201) {
if !setupBucket("bucketinformation2", false, nil, nil, nil, assert, 200) {
return
}
@@ -2044,7 +2047,7 @@ func TestBucketInformationSuccessfulResponse(t *testing.T) {
// 1. Create the bucket
assert := assert.New(t)
if !setupBucket("bucketinformation1", false, false, nil, nil, assert, 201) {
if !setupBucket("bucketinformation1", false, nil, nil, nil, assert, 200) {
return
}
@@ -2157,7 +2160,7 @@ func TestListBuckets(t *testing.T) {
// 1. Create buckets
numberOfBuckets := 3
for i := 1; i <= numberOfBuckets; i++ {
if !setupBucket("testlistbuckets"+strconv.Itoa(i), false, false, nil, nil, assert, 201) {
if !setupBucket("testlistbuckets"+strconv.Itoa(i), false, nil, nil, nil, assert, 200) {
return
}
}
@@ -2165,21 +2168,12 @@ func TestListBuckets(t *testing.T) {
// 2. List buckets
listBucketsResponse, listBucketsError := ListBuckets()
assert.Nil(listBucketsError)
if listBucketsError != nil {
log.Println(listBucketsError)
assert.Fail("Error listing the buckets")
return
}
assert.NotNil(listBucketsResponse)
assert.NotNil(listBucketsResponse.Body)
// 3. Verify list of buckets
b, err := io.ReadAll(listBucketsResponse.Body)
if listBucketsResponse != nil {
if err != nil {
log.Fatalln(err)
}
assert.Equal(200, listBucketsResponse.StatusCode,
"Status Code is incorrect: "+string(b))
}
b, _ := io.ReadAll(listBucketsResponse.Body)
assert.Equal(200, listBucketsResponse.StatusCode,
"Status Code is incorrect: "+string(b))
for i := 1; i <= numberOfBuckets; i++ {
assert.True(strings.Contains(string(b),
"testlistbuckets"+strconv.Itoa(i)))
@@ -2211,7 +2205,7 @@ func TestBucketsGet(t *testing.T) {
if response != nil {
assert.Equal(200, response.StatusCode, "Status Code is incorrect")
bodyBytes, _ := ioutil.ReadAll(response.Body)
bodyBytes, _ := io.ReadAll(response.Body)
listBuckets := models.ListBucketsResponse{}
err = json.Unmarshal(bodyBytes, &listBuckets)
@@ -2251,7 +2245,7 @@ func TestBucketVersioning(t *testing.T) {
if response != nil {
bodyBytes, _ := ioutil.ReadAll(response.Body)
bodyBytes, _ := io.ReadAll(response.Body)
sessionResponse := models.SessionResponse{}
err = json.Unmarshal(bodyBytes, &sessionResponse)
@@ -2273,7 +2267,7 @@ func TestBucketVersioning(t *testing.T) {
requestDataBody := bytes.NewReader(requestDataJSON)
if !setupBucket("test2", true, false, nil, nil, assert, 201) {
if !setupBucket("test2", true, nil, nil, nil, assert, 200) {
return
}
@@ -2288,29 +2282,34 @@ func TestBucketVersioning(t *testing.T) {
assert.Equal(
200, getVersioningResult.StatusCode, "Status Code is incorrect")
}
bodyBytes, _ := ioutil.ReadAll(getVersioningResult.Body)
structBucketRepl := models.BucketVersioningResponse{}
bodyBytes, _ := io.ReadAll(getVersioningResult.Body)
structBucketRepl := models.BucketVersioningResponse{
ExcludeFolders: false,
ExcludedPrefixes: nil,
MFADelete: "",
Status: "",
}
err = json.Unmarshal(bodyBytes, &structBucketRepl)
if err != nil {
log.Println(err)
assert.Nil(err)
}
assert.Equal(
structBucketRepl.IsVersioned,
true,
structBucketRepl.IsVersioned,
structBucketRepl.Status,
"Enabled",
structBucketRepl.Status,
)
fmt.Println("Versioned bucket creation test status:", response.Status)
if distributedSystem {
assert.Equal(200, response.StatusCode, "Versioning test Status Code is incorrect - bucket failed to create")
} else {
assert.NotEqual(201, response.StatusCode, "Versioning test Status Code is incorrect - versioned bucket created on non-distributed system")
assert.NotEqual(200, response.StatusCode, "Versioning test Status Code is incorrect - versioned bucket created on non-distributed system")
}
request, error := http.NewRequest("DELETE", "http://localhost:9090/api/v1/buckets/test2", requestDataBody)
if error != nil {
log.Println(error)
request, err = http.NewRequest("DELETE", "http://localhost:9090/api/v1/buckets/test2", requestDataBody)
if err != nil {
log.Println(err)
return
}
@@ -2336,7 +2335,7 @@ func TestSetBucketTags(t *testing.T) {
}
// put bucket
if !setupBucket("test4", false, false, nil, nil, assert, 201) {
if !setupBucket("test4", false, nil, nil, nil, assert, 200) {
return
}
@@ -2360,7 +2359,7 @@ func TestSetBucketTags(t *testing.T) {
request.Header.Add("Cookie", fmt.Sprintf("token=%s", token))
request.Header.Add("Content-Type", "application/json")
response, err := client.Do(request)
_, err = client.Do(request)
assert.Nil(err)
if err != nil {
log.Println(err)
@@ -2378,14 +2377,14 @@ func TestSetBucketTags(t *testing.T) {
request.Header.Add("Cookie", fmt.Sprintf("token=%s", token))
request.Header.Add("Content-Type", "application/json")
response, err = client.Do(request)
response, err := client.Do(request)
assert.Nil(err)
if err != nil {
log.Println(err)
return
}
bodyBytes, _ := ioutil.ReadAll(response.Body)
bodyBytes, _ := io.ReadAll(response.Body)
bucket := models.Bucket{}
err = json.Unmarshal(bodyBytes, &bucket)
@@ -2403,7 +2402,7 @@ func TestGetBucket(t *testing.T) {
Timeout: 2 * time.Second,
}
if !setupBucket("test3", false, false, nil, nil, assert, 201) {
if !setupBucket("test3", false, nil, nil, nil, assert, 200) {
return
}
@@ -2441,7 +2440,7 @@ func TestAddBucket(t *testing.T) {
}{
{
name: "Add Bucket with valid name",
expectedStatus: 201,
expectedStatus: 200,
args: args{
bucketName: "test1",
},
@@ -2456,7 +2455,7 @@ func TestAddBucket(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if !setupBucket(tt.args.bucketName, false, false, nil, nil, assert, tt.expectedStatus) {
if !setupBucket(tt.args.bucketName, false, nil, nil, nil, assert, tt.expectedStatus) {
return
}
})
@@ -2838,7 +2837,7 @@ func TestReplication(t *testing.T) {
}
// 3. Get rule ID and status from response's body
bodyBytes, _ := ioutil.ReadAll(response.Body)
bodyBytes, _ := io.ReadAll(response.Body)
structBucketRepl := models.BucketReplicationResponse{}
err = json.Unmarshal(bodyBytes, &structBucketRepl)
if err != nil {
@@ -2920,7 +2919,7 @@ func TestReplication(t *testing.T) {
}
// 9. Get rule ID and status from response's body
bodyBytes, _ = ioutil.ReadAll(response.Body)
bodyBytes, _ = io.ReadAll(response.Body)
structBucketRepl = models.BucketReplicationResponse{}
err = json.Unmarshal(bodyBytes, &structBucketRepl)
if err != nil {
@@ -2987,7 +2986,7 @@ func TestReturnsTheStatusOfObjectLockingSupportOnTheBucket(t *testing.T) {
}
// 2. Verify the status to be enabled for this bucket
bodyBytes, _ := ioutil.ReadAll(response.Body)
bodyBytes, _ := io.ReadAll(response.Body)
structBucketLocking := models.BucketObLockingResponse{}
err = json.Unmarshal(bodyBytes, &structBucketLocking)
if err != nil {
@@ -3001,7 +3000,7 @@ func TestReturnsTheStatusOfObjectLockingSupportOnTheBucket(t *testing.T) {
)
}
func SetBucketVersioning(bucketName string, versioning bool, endpoint, useToken *string) (*http.Response, error) {
func SetBucketVersioning(bucketName string, versioning map[string]interface{}, endpoint, useToken *string) (*http.Response, error) {
/*
Helper function to set Bucket Versioning
*/
@@ -3038,15 +3037,15 @@ func TestSetBucketVersioning(t *testing.T) {
assert := assert.New(t)
bucket := "test-set-bucket-versioning"
locking := false
versioning := true
versioning := map[string]interface{}{"enabled": true}
// 1. Create bucket with versioning as true and locking as false
if !setupBucket(bucket, locking, versioning, nil, nil, assert, 201) {
if !setupBucket(bucket, locking, versioning, nil, nil, assert, 200) {
return
}
// 2. Set versioning as False
response, err := SetBucketVersioning(bucket, false, nil, nil)
// 2. Set versioning as False i.e Suspend versioning
response, err := SetBucketVersioning(bucket, map[string]interface{}{"enabled": false}, nil, nil)
assert.Nil(err)
if err != nil {
log.Println(err)
@@ -3068,14 +3067,19 @@ func TestSetBucketVersioning(t *testing.T) {
assert.Equal(
200, getVersioningResult.StatusCode, "Status Code is incorrect")
}
bodyBytes, _ := ioutil.ReadAll(getVersioningResult.Body)
result := models.BucketVersioningResponse{}
bodyBytes, _ := io.ReadAll(getVersioningResult.Body)
result := models.BucketVersioningResponse{
ExcludeFolders: false,
ExcludedPrefixes: nil,
MFADelete: "",
Status: "",
}
err = json.Unmarshal(bodyBytes, &result)
if err != nil {
log.Println(err)
assert.Nil(err)
}
assert.Equal(false, result.IsVersioned, result)
assert.Equal("Suspended", result.Status, result)
}
func EnableBucketEncryption(bucketName, encType, kmsKeyID string) (*http.Response, error) {
@@ -3114,12 +3118,11 @@ func TestEnableBucketEncryption(t *testing.T) {
assert := assert.New(t)
bucketName := "test-enable-bucket-encryption"
locking := false
versioning := false
encType := "sse-s3"
kmsKeyID := ""
// 1. Add bucket
if !setupBucket(bucketName, locking, versioning, nil, nil, assert, 201) {
if !setupBucket(bucketName, locking, nil, nil, nil, assert, 200) {
return
}
@@ -3146,7 +3149,7 @@ func TestEnableBucketEncryption(t *testing.T) {
assert.Equal(
200, resp.StatusCode, "Status Code is incorrect")
}
bodyBytes, _ := ioutil.ReadAll(resp.Body)
bodyBytes, _ := io.ReadAll(resp.Body)
result := models.BucketEncryptionInfo{}
err = json.Unmarshal(bodyBytes, &result)
if err != nil {
@@ -3178,7 +3181,7 @@ func TestEnableBucketEncryption(t *testing.T) {
assert.Equal(
404, resp.StatusCode, "Status Code is incorrect")
}
bodyBytes, _ = ioutil.ReadAll(resp.Body)
bodyBytes, _ = io.ReadAll(resp.Body)
result2 := models.Error{}
err = json.Unmarshal(bodyBytes, &result2)
if err != nil {
@@ -3377,7 +3380,6 @@ func TestBucketLifeCycle(t *testing.T) {
assert := assert.New(t)
bucketName := "test-bucket-life-cycle"
locking := false
versioning := false
ltype := "expiry"
prefix := ""
tags := ""
@@ -3388,7 +3390,7 @@ func TestBucketLifeCycle(t *testing.T) {
var noncurrentversionExpirationDays int64
// 1. Add bucket
if !setupBucket(bucketName, locking, versioning, nil, nil, assert, 201) {
if !setupBucket(bucketName, locking, nil, nil, nil, assert, 200) {
return
}
@@ -3423,7 +3425,7 @@ func TestBucketLifeCycle(t *testing.T) {
assert.Equal(
200, resp.StatusCode, "Status Code is incorrect")
}
bodyBytes, _ := ioutil.ReadAll(resp.Body)
bodyBytes, _ := io.ReadAll(resp.Body)
result := models.BucketLifecycleResponse{}
err = json.Unmarshal(bodyBytes, &result)
if err != nil {
@@ -3469,7 +3471,7 @@ func TestBucketLifeCycle(t *testing.T) {
assert.Equal(
200, resp.StatusCode, "Status Code is incorrect")
}
bodyBytes, _ = ioutil.ReadAll(resp.Body)
bodyBytes, _ = io.ReadAll(resp.Body)
result = models.BucketLifecycleResponse{}
err = json.Unmarshal(bodyBytes, &result)
if err != nil {
@@ -3593,12 +3595,11 @@ func TestAccessRule(t *testing.T) {
assert := assert.New(t)
bucketName := "test-access-rule-bucket"
locking := false
versioning := false
prefix := "prefix"
access := "readonly"
// 1. Add bucket
if !setupBucket(bucketName, locking, versioning, nil, nil, assert, 201) {
if !setupBucket(bucketName, locking, nil, nil, nil, assert, 200) {
return
}
@@ -3629,7 +3630,7 @@ func TestAccessRule(t *testing.T) {
assert.Equal(
200, resp.StatusCode, "Status Code is incorrect")
}
bodyBytes, _ := ioutil.ReadAll(resp.Body)
bodyBytes, _ := io.ReadAll(resp.Body)
result := models.ListAccessRulesResponse{}
err = json.Unmarshal(bodyBytes, &result)
if err != nil {
@@ -3667,7 +3668,7 @@ func TestAccessRule(t *testing.T) {
assert.Equal(
200, resp.StatusCode, "Status Code is incorrect")
}
bodyBytes, _ = ioutil.ReadAll(resp.Body)
bodyBytes, _ = io.ReadAll(resp.Body)
result = models.ListAccessRulesResponse{}
err = json.Unmarshal(bodyBytes, &result)
if err != nil {
@@ -3842,16 +3843,16 @@ func TestAddRemoteBucket(t *testing.T) {
fmt.Println("targetBucket: ", targetBucket)
// 1. Create bucket
if !setupBucket("source", true, true, nil, nil, assert, 201) {
if !setupBucket("source", true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
return
}
// 1.1. Create target bucket
targetEndpoint := "http://localhost:9092"
targetToken := getTokenForEndpoint(targetEndpoint)
if !setupBucketForEndpoint(targetBucket, true, true, nil, nil, assert, 201, &targetEndpoint, &targetToken) {
if !setupBucketForEndpoint(targetBucket, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200, &targetEndpoint, &targetToken) {
log.Println("bucket already exists")
}
_, err := SetBucketVersioning(targetBucket, false, &targetURL, &targetToken)
_, err := SetBucketVersioning(targetBucket, map[string]interface{}{"enabled": false}, &targetURL, &targetToken)
if err != nil {
log.Println("bucket already has versioning")
}
@@ -3901,16 +3902,16 @@ func TestDeleteRemoteBucket(t *testing.T) {
fmt.Println("targetBucket: ", targetBucket)
// 1. Create bucket
if !setupBucket("deletesource", true, true, nil, nil, assert, 201) {
if !setupBucket("deletesource", true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
return
}
// 1.1. Create target bucket
targetEndpoint := "http://localhost:9092"
targetToken := getTokenForEndpoint(targetEndpoint)
if !setupBucketForEndpoint(targetBucket, true, true, nil, nil, assert, 201, &targetEndpoint, &targetToken) {
if !setupBucketForEndpoint(targetBucket, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200, &targetEndpoint, &targetToken) {
log.Println("bucket already exists")
}
_, err := SetBucketVersioning(targetBucket, false, &targetURL, &targetToken)
_, err := SetBucketVersioning(targetBucket, map[string]interface{}{"enabled": false}, &targetURL, &targetToken)
if err != nil {
log.Println("bucket already has versioning")
}
@@ -3936,21 +3937,13 @@ func TestDeleteRemoteBucket(t *testing.T) {
// 3. Get ARN
resp, err = GetRemoteBucketARN(sourceBucket)
assert.Nil(err)
if err != nil {
log.Println(err)
return
}
bodyBytes, _ := ioutil.ReadAll(resp.Body)
assert.NotNil(resp)
assert.NotNil(resp.Body)
bodyBytes, _ := io.ReadAll(resp.Body)
remoteBucket := models.RemoteBucket{}
err = json.Unmarshal(bodyBytes, &remoteBucket)
if err != nil {
log.Println(err)
assert.Nil(err)
}
if resp != nil {
assert.Equal(
200, resp.StatusCode, inspectHTTPResponse(resp))
}
assert.Nil(err)
assert.Equal(200, resp.StatusCode, inspectHTTPResponse(resp))
// 4. Delete Remote Bucket
if remoteBucket.RemoteARN != nil {

View File

@@ -1,44 +0,0 @@
#!/bin/bash
# setup environment variables based on flags to see if we should build the docker containers again
CONSOLE_DOCKER="true"
# evaluate flags
# `-m` for console
while getopts ":m:" opt; do
case $opt in
m)
CONSOLE_DOCKER="$OPTARG"
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
:)
echo "Option -$OPTARG requires an argument." >&2
exit 1
;;
esac
done
echo "Provisioning Kind"
kind create cluster --config kind-cluster.yaml
echo "Remove Master Taint"
kubectl taint nodes --all node-role.kubernetes.io/master-
echo "Install Contour"
kubectl apply -f https://projectcontour.io/quickstart/contour.yaml
kubectl patch daemonsets -n projectcontour envoy -p '{"spec":{"template":{"spec":{"nodeSelector":{"ingress-ready":"true"},"tolerations":[{"key":"node-role.kubernetes.io/master","operator":"Equal","effect":"NoSchedule"}]}}}}'
echo "install metrics server"
kubectl apply -f metrics-dev.yaml
# Whether or not to build the m3 container and load it to kind or just load it
if [[ $CONSOLE_DOCKER == "true" ]]; then
# Build mkube
make --directory=".." k8sdev TAG=minio/console:latest
else
kind load docker-image minio/console:latest
fi
echo "done"

View File

@@ -1,22 +0,0 @@
# three node (two workers) cluster config
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "ingress-ready=true"
extraPortMappings:
- containerPort: 80
hostPort: 8844
protocol: TCP
- containerPort: 443
hostPort: 8843
protocol: TCP
#- role: worker
#- role: worker
#- role: worker
#- role: worker

View File

@@ -1,153 +0,0 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: system:aggregated-metrics-reader
labels:
rbac.authorization.k8s.io/aggregate-to-view: "true"
rbac.authorization.k8s.io/aggregate-to-edit: "true"
rbac.authorization.k8s.io/aggregate-to-admin: "true"
rules:
- apiGroups: ["metrics.k8s.io"]
resources: ["pods", "nodes"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: metrics-server:system:auth-delegator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:auth-delegator
subjects:
- kind: ServiceAccount
name: metrics-server
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: metrics-server-auth-reader
namespace: kube-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: extension-apiserver-authentication-reader
subjects:
- kind: ServiceAccount
name: metrics-server
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: system:metrics-server
rules:
- apiGroups:
- ""
resources:
- pods
- nodes
- nodes/stats
- namespaces
- configmaps
verbs:
- get
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: system:metrics-server
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:metrics-server
subjects:
- kind: ServiceAccount
name: metrics-server
namespace: kube-system
---
apiVersion: apiregistration.k8s.io/v1beta1
kind: APIService
metadata:
name: v1beta1.metrics.k8s.io
spec:
service:
name: metrics-server
namespace: kube-system
group: metrics.k8s.io
version: v1beta1
insecureSkipTLSVerify: true
groupPriorityMinimum: 100
versionPriority: 100
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: metrics-server
namespace: kube-system
---
apiVersion: v1
kind: Service
metadata:
name: metrics-server
namespace: kube-system
labels:
kubernetes.io/name: "Metrics-server"
kubernetes.io/cluster-service: "true"
spec:
selector:
k8s-app: metrics-server
ports:
- port: 443
protocol: TCP
targetPort: main-port
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: metrics-server
namespace: kube-system
labels:
k8s-app: metrics-server
spec:
selector:
matchLabels:
k8s-app: metrics-server
template:
metadata:
name: metrics-server
labels:
k8s-app: metrics-server
spec:
serviceAccountName: metrics-server
volumes:
# mount in tmp so we can safely use from-scratch images and/or read-only containers
- name: tmp-dir
emptyDir: {}
containers:
- name: metrics-server
image: k8s.gcr.io/metrics-server-amd64:v0.3.6
args:
- --cert-dir=/tmp
- --secure-port=4443
- --kubelet-insecure-tls
- --kubelet-preferred-address-types=InternalIP
ports:
- name: main-port
containerPort: 4443
protocol: TCP
securityContext:
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
imagePullPolicy: Always
volumeMounts:
- name: tmp-dir
mountPath: /tmp
nodeSelector:
kubernetes.io/os: linux
kubernetes.io/arch: "amd64"

View File

@@ -1,12 +0,0 @@
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: console-sa-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: console-sa-role
subjects:
- kind: ServiceAccount
name: console-sa
namespace: default

View File

@@ -1,234 +0,0 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: console-sa-role
rules:
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- watch
- create
- list
- patch
- update
- deletecollection
- apiGroups:
- ""
resources:
- namespaces
- services
- events
- resourcequotas
- nodes
verbs:
- get
- watch
- create
- list
- patch
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- watch
- create
- list
- patch
- delete
- deletecollection
- apiGroups:
- ""
resources:
- persistentvolumeclaims
verbs:
- deletecollection
- list
- get
- watch
- update
- apiGroups:
- "storage.k8s.io"
resources:
- storageclasses
verbs:
- get
- watch
- create
- list
- patch
- apiGroups:
- apps
resources:
- statefulsets
- deployments
verbs:
- get
- create
- list
- patch
- watch
- update
- delete
- apiGroups:
- batch
resources:
- jobs
verbs:
- get
- create
- list
- patch
- watch
- update
- delete
- apiGroups:
- "certificates.k8s.io"
resources:
- "certificatesigningrequests"
- "certificatesigningrequests/approval"
- "certificatesigningrequests/status"
verbs:
- update
- create
- get
- apiGroups:
- minio.min.io
resources:
- "*"
verbs:
- "*"
- apiGroups:
- min.io
resources:
- "*"
verbs:
- "*"
- apiGroups:
- ""
resources:
- persistentvolumes
verbs:
- get
- list
- watch
- create
- delete
- apiGroups:
- ""
resources:
- persistentvolumeclaims
verbs:
- get
- list
- watch
- update
- apiGroups:
- ""
resources:
- events
verbs:
- create
- list
- watch
- update
- patch
- apiGroups:
- snapshot.storage.k8s.io
resources:
- volumesnapshots
verbs:
- get
- list
- apiGroups:
- snapshot.storage.k8s.io
resources:
- volumesnapshotcontents
verbs:
- get
- list
- apiGroups:
- storage.k8s.io
resources:
- csinodes
verbs:
- get
- list
- watch
- apiGroups:
- storage.k8s.io
resources:
- volumeattachments
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- endpoints
verbs:
- get
- list
- watch
- create
- update
- delete
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- list
- watch
- create
- update
- delete
- apiGroups:
- direct.csi.min.io
resources:
- volumes
verbs:
- get
- list
- watch
- create
- update
- delete
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- get
- list
- watch
- create
- update
- delete
- apiGroups:
- direct.csi.min.io
resources:
- directcsidrives
- directcsivolumes
verbs:
- get
- list
- watch
- create
- update
- delete
- apiGroups:
- ""
resources:
- pod
- pods/log
verbs:
- get
- list
- watch

View File

@@ -1,7 +0,0 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: console-env
data:
CONSOLE_PORT: "9090"
CONSOLE_TLS_PORT: "9443"

View File

@@ -1,29 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: console
spec:
replicas: 1
selector:
matchLabels:
app: console
template:
metadata:
labels:
app: console
spec:
serviceAccountName: console-sa
containers:
- name: console
image: 'minio/console:v0.24.0'
imagePullPolicy: "IfNotPresent"
env:
- name: CONSOLE_OPERATOR_MODE
value: "on"
args:
- server
ports:
- containerPort: 9090
name: http
- containerPort: 9433
name: https

View File

@@ -1,5 +0,0 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: console-sa
namespace: default

View File

@@ -1,14 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: console
labels:
name: console
spec:
ports:
- port: 9090
name: http
- port: 9443
name: https
selector:
app: console

View File

@@ -1,10 +0,0 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
# beginning of customizations
resources:
- console-service-account.yaml
- console-cluster-role.yaml
- console-cluster-role-binding.yaml
- console-configmap.yaml
- console-service.yaml
- console-deployment.yaml

View File

@@ -1,46 +0,0 @@
---
apiVersion: v1
kind: Service
metadata:
name: console
namespace: default
labels:
name: console
spec:
ports:
- port: 9090
name: http
- port: 9443
name: https
selector:
app: console-standalone
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: console
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: console-standalone
template:
metadata:
labels:
app: console-standalone
spec:
containers:
- name: console
image: 'minio/console:v0.24.0'
imagePullPolicy: "IfNotPresent"
env:
- name: CONSOLE_MINIO_SERVER
value: "https://minio.default.svc.cluster.local"
args:
- server
ports:
- containerPort: 9090
name: http
- containerPort: 9433
name: https

View File

@@ -1,20 +0,0 @@
// This file is part of MinIO Console Server
// Copyright (c) 2021 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// Package k8s - this package imports things required by build scripts, to force `go mod` to see them as dependencies
package k8s
// import _ "k8s.io/code-generator"

View File

@@ -1,35 +0,0 @@
#!/usr/bin/env bash
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -o errexit
set -o nounset
set -o pipefail
SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)}
# generate the code with:
# --output-base because this script should also be able to run inside the vendor dir of
# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir
# instead of the $GOPATH directly. For normal projects this can be dropped.
bash "${CODEGEN_PKG}"/generate-groups.sh "all" \
github.com/minio/console/pkg/generated \
github.com/minio/console/pkg/apis \
mkube:v1 \
--go-header-file "${SCRIPT_ROOT}"/k8s/boilerplate.go.txt
# To use your own boilerplate text append:
# --go-header-file "${SCRIPT_ROOT}"/hack/custom-boilerplate.go.txt

View File

@@ -1,173 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// AllocatableResourcesResponse allocatable resources response
//
// swagger:model allocatableResourcesResponse
type AllocatableResourcesResponse struct {
// cpu priority
CPUPriority *NodeMaxAllocatableResources `json:"cpu_priority,omitempty"`
// mem priority
MemPriority *NodeMaxAllocatableResources `json:"mem_priority,omitempty"`
// min allocatable cpu
MinAllocatableCPU int64 `json:"min_allocatable_cpu,omitempty"`
// min allocatable mem
MinAllocatableMem int64 `json:"min_allocatable_mem,omitempty"`
}
// Validate validates this allocatable resources response
func (m *AllocatableResourcesResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCPUPriority(formats); err != nil {
res = append(res, err)
}
if err := m.validateMemPriority(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *AllocatableResourcesResponse) validateCPUPriority(formats strfmt.Registry) error {
if swag.IsZero(m.CPUPriority) { // not required
return nil
}
if m.CPUPriority != nil {
if err := m.CPUPriority.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("cpu_priority")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("cpu_priority")
}
return err
}
}
return nil
}
func (m *AllocatableResourcesResponse) validateMemPriority(formats strfmt.Registry) error {
if swag.IsZero(m.MemPriority) { // not required
return nil
}
if m.MemPriority != nil {
if err := m.MemPriority.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("mem_priority")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("mem_priority")
}
return err
}
}
return nil
}
// ContextValidate validate this allocatable resources response based on the context it is used
func (m *AllocatableResourcesResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateCPUPriority(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateMemPriority(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *AllocatableResourcesResponse) contextValidateCPUPriority(ctx context.Context, formats strfmt.Registry) error {
if m.CPUPriority != nil {
if err := m.CPUPriority.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("cpu_priority")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("cpu_priority")
}
return err
}
}
return nil
}
func (m *AllocatableResourcesResponse) contextValidateMemPriority(ctx context.Context, formats strfmt.Registry) error {
if m.MemPriority != nil {
if err := m.MemPriority.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("mem_priority")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("mem_priority")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *AllocatableResourcesResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *AllocatableResourcesResponse) UnmarshalBinary(b []byte) error {
var res AllocatableResourcesResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,70 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// Annotation annotation
//
// swagger:model annotation
type Annotation struct {
// key
Key string `json:"key,omitempty"`
// value
Value string `json:"value,omitempty"`
}
// Validate validates this annotation
func (m *Annotation) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this annotation based on context it is used
func (m *Annotation) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *Annotation) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Annotation) UnmarshalBinary(b []byte) error {
var res Annotation
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,329 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// AwsConfiguration aws configuration
//
// swagger:model awsConfiguration
type AwsConfiguration struct {
// secretsmanager
// Required: true
Secretsmanager *AwsConfigurationSecretsmanager `json:"secretsmanager"`
}
// Validate validates this aws configuration
func (m *AwsConfiguration) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateSecretsmanager(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *AwsConfiguration) validateSecretsmanager(formats strfmt.Registry) error {
if err := validate.Required("secretsmanager", "body", m.Secretsmanager); err != nil {
return err
}
if m.Secretsmanager != nil {
if err := m.Secretsmanager.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("secretsmanager")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("secretsmanager")
}
return err
}
}
return nil
}
// ContextValidate validate this aws configuration based on the context it is used
func (m *AwsConfiguration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateSecretsmanager(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *AwsConfiguration) contextValidateSecretsmanager(ctx context.Context, formats strfmt.Registry) error {
if m.Secretsmanager != nil {
if err := m.Secretsmanager.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("secretsmanager")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("secretsmanager")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *AwsConfiguration) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *AwsConfiguration) UnmarshalBinary(b []byte) error {
var res AwsConfiguration
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// AwsConfigurationSecretsmanager aws configuration secretsmanager
//
// swagger:model AwsConfigurationSecretsmanager
type AwsConfigurationSecretsmanager struct {
// credentials
// Required: true
Credentials *AwsConfigurationSecretsmanagerCredentials `json:"credentials"`
// endpoint
// Required: true
Endpoint *string `json:"endpoint"`
// kmskey
Kmskey string `json:"kmskey,omitempty"`
// region
// Required: true
Region *string `json:"region"`
}
// Validate validates this aws configuration secretsmanager
func (m *AwsConfigurationSecretsmanager) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCredentials(formats); err != nil {
res = append(res, err)
}
if err := m.validateEndpoint(formats); err != nil {
res = append(res, err)
}
if err := m.validateRegion(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *AwsConfigurationSecretsmanager) validateCredentials(formats strfmt.Registry) error {
if err := validate.Required("secretsmanager"+"."+"credentials", "body", m.Credentials); err != nil {
return err
}
if m.Credentials != nil {
if err := m.Credentials.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("secretsmanager" + "." + "credentials")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("secretsmanager" + "." + "credentials")
}
return err
}
}
return nil
}
func (m *AwsConfigurationSecretsmanager) validateEndpoint(formats strfmt.Registry) error {
if err := validate.Required("secretsmanager"+"."+"endpoint", "body", m.Endpoint); err != nil {
return err
}
return nil
}
func (m *AwsConfigurationSecretsmanager) validateRegion(formats strfmt.Registry) error {
if err := validate.Required("secretsmanager"+"."+"region", "body", m.Region); err != nil {
return err
}
return nil
}
// ContextValidate validate this aws configuration secretsmanager based on the context it is used
func (m *AwsConfigurationSecretsmanager) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateCredentials(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *AwsConfigurationSecretsmanager) contextValidateCredentials(ctx context.Context, formats strfmt.Registry) error {
if m.Credentials != nil {
if err := m.Credentials.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("secretsmanager" + "." + "credentials")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("secretsmanager" + "." + "credentials")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *AwsConfigurationSecretsmanager) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *AwsConfigurationSecretsmanager) UnmarshalBinary(b []byte) error {
var res AwsConfigurationSecretsmanager
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// AwsConfigurationSecretsmanagerCredentials aws configuration secretsmanager credentials
//
// swagger:model AwsConfigurationSecretsmanagerCredentials
type AwsConfigurationSecretsmanagerCredentials struct {
// accesskey
// Required: true
Accesskey *string `json:"accesskey"`
// secretkey
// Required: true
Secretkey *string `json:"secretkey"`
// token
Token string `json:"token,omitempty"`
}
// Validate validates this aws configuration secretsmanager credentials
func (m *AwsConfigurationSecretsmanagerCredentials) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAccesskey(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 *AwsConfigurationSecretsmanagerCredentials) validateAccesskey(formats strfmt.Registry) error {
if err := validate.Required("secretsmanager"+"."+"credentials"+"."+"accesskey", "body", m.Accesskey); err != nil {
return err
}
return nil
}
func (m *AwsConfigurationSecretsmanagerCredentials) validateSecretkey(formats strfmt.Registry) error {
if err := validate.Required("secretsmanager"+"."+"credentials"+"."+"secretkey", "body", m.Secretkey); err != nil {
return err
}
return nil
}
// ContextValidate validates this aws configuration secretsmanager credentials based on context it is used
func (m *AwsConfigurationSecretsmanagerCredentials) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *AwsConfigurationSecretsmanagerCredentials) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *AwsConfigurationSecretsmanagerCredentials) UnmarshalBinary(b []byte) error {
var res AwsConfigurationSecretsmanagerCredentials
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,321 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// AzureConfiguration azure configuration
//
// swagger:model azureConfiguration
type AzureConfiguration struct {
// keyvault
// Required: true
Keyvault *AzureConfigurationKeyvault `json:"keyvault"`
}
// Validate validates this azure configuration
func (m *AzureConfiguration) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateKeyvault(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *AzureConfiguration) validateKeyvault(formats strfmt.Registry) error {
if err := validate.Required("keyvault", "body", m.Keyvault); err != nil {
return err
}
if m.Keyvault != nil {
if err := m.Keyvault.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("keyvault")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("keyvault")
}
return err
}
}
return nil
}
// ContextValidate validate this azure configuration based on the context it is used
func (m *AzureConfiguration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateKeyvault(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *AzureConfiguration) contextValidateKeyvault(ctx context.Context, formats strfmt.Registry) error {
if m.Keyvault != nil {
if err := m.Keyvault.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("keyvault")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("keyvault")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *AzureConfiguration) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *AzureConfiguration) UnmarshalBinary(b []byte) error {
var res AzureConfiguration
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// AzureConfigurationKeyvault azure configuration keyvault
//
// swagger:model AzureConfigurationKeyvault
type AzureConfigurationKeyvault struct {
// credentials
Credentials *AzureConfigurationKeyvaultCredentials `json:"credentials,omitempty"`
// endpoint
// Required: true
Endpoint *string `json:"endpoint"`
}
// Validate validates this azure configuration keyvault
func (m *AzureConfigurationKeyvault) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCredentials(formats); err != nil {
res = append(res, err)
}
if err := m.validateEndpoint(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *AzureConfigurationKeyvault) validateCredentials(formats strfmt.Registry) error {
if swag.IsZero(m.Credentials) { // not required
return nil
}
if m.Credentials != nil {
if err := m.Credentials.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("keyvault" + "." + "credentials")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("keyvault" + "." + "credentials")
}
return err
}
}
return nil
}
func (m *AzureConfigurationKeyvault) validateEndpoint(formats strfmt.Registry) error {
if err := validate.Required("keyvault"+"."+"endpoint", "body", m.Endpoint); err != nil {
return err
}
return nil
}
// ContextValidate validate this azure configuration keyvault based on the context it is used
func (m *AzureConfigurationKeyvault) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateCredentials(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *AzureConfigurationKeyvault) contextValidateCredentials(ctx context.Context, formats strfmt.Registry) error {
if m.Credentials != nil {
if err := m.Credentials.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("keyvault" + "." + "credentials")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("keyvault" + "." + "credentials")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *AzureConfigurationKeyvault) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *AzureConfigurationKeyvault) UnmarshalBinary(b []byte) error {
var res AzureConfigurationKeyvault
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// AzureConfigurationKeyvaultCredentials azure configuration keyvault credentials
//
// swagger:model AzureConfigurationKeyvaultCredentials
type AzureConfigurationKeyvaultCredentials struct {
// client id
// Required: true
ClientID *string `json:"client_id"`
// client secret
// Required: true
ClientSecret *string `json:"client_secret"`
// tenant id
// Required: true
TenantID *string `json:"tenant_id"`
}
// Validate validates this azure configuration keyvault credentials
func (m *AzureConfigurationKeyvaultCredentials) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateClientID(formats); err != nil {
res = append(res, err)
}
if err := m.validateClientSecret(formats); err != nil {
res = append(res, err)
}
if err := m.validateTenantID(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *AzureConfigurationKeyvaultCredentials) validateClientID(formats strfmt.Registry) error {
if err := validate.Required("keyvault"+"."+"credentials"+"."+"client_id", "body", m.ClientID); err != nil {
return err
}
return nil
}
func (m *AzureConfigurationKeyvaultCredentials) validateClientSecret(formats strfmt.Registry) error {
if err := validate.Required("keyvault"+"."+"credentials"+"."+"client_secret", "body", m.ClientSecret); err != nil {
return err
}
return nil
}
func (m *AzureConfigurationKeyvaultCredentials) validateTenantID(formats strfmt.Registry) error {
if err := validate.Required("keyvault"+"."+"credentials"+"."+"tenant_id", "body", m.TenantID); err != nil {
return err
}
return nil
}
// ContextValidate validates this azure configuration keyvault credentials based on context it is used
func (m *AzureConfigurationKeyvaultCredentials) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *AzureConfigurationKeyvaultCredentials) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *AzureConfigurationKeyvaultCredentials) UnmarshalBinary(b []byte) error {
var res AzureConfigurationKeyvaultCredentials
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -37,6 +37,12 @@ type BackendProperties struct {
// backend type
BackendType string `json:"backendType,omitempty"`
// offline drives
OfflineDrives int64 `json:"offlineDrives,omitempty"`
// online drives
OnlineDrives int64 `json:"onlineDrives,omitempty"`
// rr s c parity
RrSCParity int64 `json:"rrSCParity,omitempty"`

View File

@@ -24,7 +24,9 @@ package models
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
@@ -34,17 +36,90 @@ import (
// swagger:model bucketVersioningResponse
type BucketVersioningResponse struct {
// is versioned
IsVersioned bool `json:"is_versioned,omitempty"`
// m f a delete
MFADelete string `json:"MFADelete,omitempty"`
// exclude folders
ExcludeFolders bool `json:"excludeFolders,omitempty"`
// excluded prefixes
ExcludedPrefixes []*BucketVersioningResponseExcludedPrefixesItems0 `json:"excludedPrefixes"`
// status
Status string `json:"status,omitempty"`
}
// Validate validates this bucket versioning response
func (m *BucketVersioningResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateExcludedPrefixes(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// ContextValidate validates this bucket versioning response based on context it is used
func (m *BucketVersioningResponse) validateExcludedPrefixes(formats strfmt.Registry) error {
if swag.IsZero(m.ExcludedPrefixes) { // not required
return nil
}
for i := 0; i < len(m.ExcludedPrefixes); i++ {
if swag.IsZero(m.ExcludedPrefixes[i]) { // not required
continue
}
if m.ExcludedPrefixes[i] != nil {
if err := m.ExcludedPrefixes[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("excludedPrefixes" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("excludedPrefixes" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this bucket versioning response based on the context it is used
func (m *BucketVersioningResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateExcludedPrefixes(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *BucketVersioningResponse) contextValidateExcludedPrefixes(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.ExcludedPrefixes); i++ {
if m.ExcludedPrefixes[i] != nil {
if err := m.ExcludedPrefixes[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("excludedPrefixes" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("excludedPrefixes" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
@@ -65,3 +140,40 @@ func (m *BucketVersioningResponse) UnmarshalBinary(b []byte) error {
*m = res
return nil
}
// BucketVersioningResponseExcludedPrefixesItems0 bucket versioning response excluded prefixes items0
//
// swagger:model BucketVersioningResponseExcludedPrefixesItems0
type BucketVersioningResponseExcludedPrefixesItems0 struct {
// prefix
Prefix string `json:"prefix,omitempty"`
}
// Validate validates this bucket versioning response excluded prefixes items0
func (m *BucketVersioningResponseExcludedPrefixesItems0) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this bucket versioning response excluded prefixes items0 based on context it is used
func (m *BucketVersioningResponseExcludedPrefixesItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *BucketVersioningResponseExcludedPrefixesItems0) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *BucketVersioningResponseExcludedPrefixesItems0) UnmarshalBinary(b []byte) error {
var res BucketVersioningResponseExcludedPrefixesItems0
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,76 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// CertificateInfo certificate info
//
// swagger:model certificateInfo
type CertificateInfo struct {
// domains
Domains []string `json:"domains"`
// expiry
Expiry string `json:"expiry,omitempty"`
// name
Name string `json:"name,omitempty"`
// serial number
SerialNumber string `json:"serialNumber,omitempty"`
}
// Validate validates this certificate info
func (m *CertificateInfo) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this certificate info based on context it is used
func (m *CertificateInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *CertificateInfo) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *CertificateInfo) UnmarshalBinary(b []byte) error {
var res CertificateInfo
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,70 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// CheckOperatorVersionResponse check operator version response
//
// swagger:model checkOperatorVersionResponse
type CheckOperatorVersionResponse struct {
// current version
CurrentVersion string `json:"current_version,omitempty"`
// latest version
LatestVersion string `json:"latest_version,omitempty"`
}
// Validate validates this check operator version response
func (m *CheckOperatorVersionResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this check operator version response based on context it is used
func (m *CheckOperatorVersionResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *CheckOperatorVersionResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *CheckOperatorVersionResponse) UnmarshalBinary(b []byte) error {
var res CheckOperatorVersionResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,70 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// Condition condition
//
// swagger:model condition
type Condition struct {
// status
Status string `json:"status,omitempty"`
// type
Type string `json:"type,omitempty"`
}
// Validate validates this condition
func (m *Condition) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this condition based on context it is used
func (m *Condition) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *Condition) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Condition) UnmarshalBinary(b []byte) error {
var res Condition
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,70 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// ConfigMap config map
//
// swagger:model configMap
type ConfigMap struct {
// name
Name string `json:"name,omitempty"`
// optional
Optional bool `json:"optional,omitempty"`
}
// Validate validates this config map
func (m *ConfigMap) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this config map based on context it is used
func (m *ConfigMap) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *ConfigMap) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ConfigMap) UnmarshalBinary(b []byte) error {
var res ConfigMap
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,67 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// ConfigureTenantRequest configure tenant request
//
// swagger:model configureTenantRequest
type ConfigureTenantRequest struct {
// prometheus enabled
PrometheusEnabled bool `json:"prometheusEnabled,omitempty"`
}
// Validate validates this configure tenant request
func (m *ConfigureTenantRequest) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this configure tenant request based on context it is used
func (m *ConfigureTenantRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *ConfigureTenantRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ConfigureTenantRequest) UnmarshalBinary(b []byte) error {
var res ConfigureTenantRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,309 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// Container container
//
// swagger:model container
type Container struct {
// args
Args []string `json:"args"`
// container ID
ContainerID string `json:"containerID,omitempty"`
// environment variables
EnvironmentVariables []*EnvironmentVariable `json:"environmentVariables"`
// host ports
HostPorts []string `json:"hostPorts"`
// image
Image string `json:"image,omitempty"`
// image ID
ImageID string `json:"imageID,omitempty"`
// last state
LastState *State `json:"lastState,omitempty"`
// mounts
Mounts []*Mount `json:"mounts"`
// name
Name string `json:"name,omitempty"`
// ports
Ports []string `json:"ports"`
// ready
Ready bool `json:"ready,omitempty"`
// restart count
RestartCount int64 `json:"restartCount,omitempty"`
// state
State *State `json:"state,omitempty"`
}
// Validate validates this container
func (m *Container) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateEnvironmentVariables(formats); err != nil {
res = append(res, err)
}
if err := m.validateLastState(formats); err != nil {
res = append(res, err)
}
if err := m.validateMounts(formats); err != nil {
res = append(res, err)
}
if err := m.validateState(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Container) 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 *Container) validateLastState(formats strfmt.Registry) error {
if swag.IsZero(m.LastState) { // not required
return nil
}
if m.LastState != nil {
if err := m.LastState.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("lastState")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("lastState")
}
return err
}
}
return nil
}
func (m *Container) validateMounts(formats strfmt.Registry) error {
if swag.IsZero(m.Mounts) { // not required
return nil
}
for i := 0; i < len(m.Mounts); i++ {
if swag.IsZero(m.Mounts[i]) { // not required
continue
}
if m.Mounts[i] != nil {
if err := m.Mounts[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("mounts" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("mounts" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *Container) validateState(formats strfmt.Registry) error {
if swag.IsZero(m.State) { // not required
return nil
}
if m.State != nil {
if err := m.State.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("state")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("state")
}
return err
}
}
return nil
}
// ContextValidate validate this container based on the context it is used
func (m *Container) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateEnvironmentVariables(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateLastState(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateMounts(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateState(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Container) 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 *Container) contextValidateLastState(ctx context.Context, formats strfmt.Registry) error {
if m.LastState != nil {
if err := m.LastState.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("lastState")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("lastState")
}
return err
}
}
return nil
}
func (m *Container) contextValidateMounts(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Mounts); i++ {
if m.Mounts[i] != nil {
if err := m.Mounts[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("mounts" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("mounts" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *Container) contextValidateState(ctx context.Context, formats strfmt.Registry) error {
if m.State != nil {
if err := m.State.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("state")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("state")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *Container) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Container) UnmarshalBinary(b []byte) error {
var res Container
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,593 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// CreateTenantRequest create tenant request
//
// swagger:model createTenantRequest
type CreateTenantRequest struct {
// access key
AccessKey string `json:"access_key,omitempty"`
// annotations
Annotations map[string]string `json:"annotations,omitempty"`
// domains
Domains *DomainsConfiguration `json:"domains,omitempty"`
// enable console
EnableConsole *bool `json:"enable_console,omitempty"`
// enable prometheus
EnablePrometheus *bool `json:"enable_prometheus,omitempty"`
// enable tls
EnableTLS *bool `json:"enable_tls,omitempty"`
// encryption
Encryption *EncryptionConfiguration `json:"encryption,omitempty"`
// environment variables
EnvironmentVariables []*EnvironmentVariable `json:"environmentVariables"`
// erasure coding parity
ErasureCodingParity int64 `json:"erasureCodingParity,omitempty"`
// expose console
ExposeConsole bool `json:"expose_console,omitempty"`
// expose minio
ExposeMinio bool `json:"expose_minio,omitempty"`
// idp
Idp *IdpConfiguration `json:"idp,omitempty"`
// image
Image string `json:"image,omitempty"`
// image pull secret
ImagePullSecret string `json:"image_pull_secret,omitempty"`
// image registry
ImageRegistry *ImageRegistry `json:"image_registry,omitempty"`
// labels
Labels map[string]string `json:"labels,omitempty"`
// log search configuration
LogSearchConfiguration *LogSearchConfiguration `json:"logSearchConfiguration,omitempty"`
// mount path
MountPath string `json:"mount_path,omitempty"`
// name
// Required: true
// Pattern: ^[a-z0-9-]{3,63}$
Name *string `json:"name"`
// namespace
// Required: true
Namespace *string `json:"namespace"`
// pools
// Required: true
Pools []*Pool `json:"pools"`
// prometheus configuration
PrometheusConfiguration *PrometheusConfiguration `json:"prometheusConfiguration,omitempty"`
// secret key
SecretKey string `json:"secret_key,omitempty"`
// tls
TLS *TLSConfiguration `json:"tls,omitempty"`
}
// Validate validates this create tenant request
func (m *CreateTenantRequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateDomains(formats); err != nil {
res = append(res, err)
}
if err := m.validateEncryption(formats); err != nil {
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)
}
if err := m.validateImageRegistry(formats); err != nil {
res = append(res, err)
}
if err := m.validateLogSearchConfiguration(formats); err != nil {
res = append(res, err)
}
if err := m.validateName(formats); err != nil {
res = append(res, err)
}
if err := m.validateNamespace(formats); err != nil {
res = append(res, err)
}
if err := m.validatePools(formats); err != nil {
res = append(res, err)
}
if err := m.validatePrometheusConfiguration(formats); err != nil {
res = append(res, err)
}
if err := m.validateTLS(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *CreateTenantRequest) validateDomains(formats strfmt.Registry) error {
if swag.IsZero(m.Domains) { // not required
return nil
}
if m.Domains != nil {
if err := m.Domains.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("domains")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("domains")
}
return err
}
}
return nil
}
func (m *CreateTenantRequest) validateEncryption(formats strfmt.Registry) error {
if swag.IsZero(m.Encryption) { // not required
return nil
}
if m.Encryption != nil {
if err := m.Encryption.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("encryption")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("encryption")
}
return err
}
}
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
}
if m.Idp != nil {
if err := m.Idp.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("idp")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("idp")
}
return err
}
}
return nil
}
func (m *CreateTenantRequest) validateImageRegistry(formats strfmt.Registry) error {
if swag.IsZero(m.ImageRegistry) { // not required
return nil
}
if m.ImageRegistry != nil {
if err := m.ImageRegistry.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("image_registry")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("image_registry")
}
return err
}
}
return nil
}
func (m *CreateTenantRequest) validateLogSearchConfiguration(formats strfmt.Registry) error {
if swag.IsZero(m.LogSearchConfiguration) { // not required
return nil
}
if m.LogSearchConfiguration != nil {
if err := m.LogSearchConfiguration.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("logSearchConfiguration")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("logSearchConfiguration")
}
return err
}
}
return nil
}
func (m *CreateTenantRequest) validateName(formats strfmt.Registry) error {
if err := validate.Required("name", "body", m.Name); err != nil {
return err
}
if err := validate.Pattern("name", "body", *m.Name, `^[a-z0-9-]{3,63}$`); err != nil {
return err
}
return nil
}
func (m *CreateTenantRequest) validateNamespace(formats strfmt.Registry) error {
if err := validate.Required("namespace", "body", m.Namespace); err != nil {
return err
}
return nil
}
func (m *CreateTenantRequest) validatePools(formats strfmt.Registry) error {
if err := validate.Required("pools", "body", m.Pools); err != nil {
return err
}
for i := 0; i < len(m.Pools); i++ {
if swag.IsZero(m.Pools[i]) { // not required
continue
}
if m.Pools[i] != nil {
if err := m.Pools[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("pools" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("pools" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *CreateTenantRequest) validatePrometheusConfiguration(formats strfmt.Registry) error {
if swag.IsZero(m.PrometheusConfiguration) { // not required
return nil
}
if m.PrometheusConfiguration != nil {
if err := m.PrometheusConfiguration.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("prometheusConfiguration")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("prometheusConfiguration")
}
return err
}
}
return nil
}
func (m *CreateTenantRequest) validateTLS(formats strfmt.Registry) error {
if swag.IsZero(m.TLS) { // not required
return nil
}
if m.TLS != nil {
if err := m.TLS.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tls")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("tls")
}
return err
}
}
return nil
}
// ContextValidate validate this create tenant request based on the context it is used
func (m *CreateTenantRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateDomains(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateEncryption(ctx, formats); err != nil {
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)
}
if err := m.contextValidateImageRegistry(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateLogSearchConfiguration(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidatePools(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidatePrometheusConfiguration(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateTLS(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *CreateTenantRequest) contextValidateDomains(ctx context.Context, formats strfmt.Registry) error {
if m.Domains != nil {
if err := m.Domains.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("domains")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("domains")
}
return err
}
}
return nil
}
func (m *CreateTenantRequest) contextValidateEncryption(ctx context.Context, formats strfmt.Registry) error {
if m.Encryption != nil {
if err := m.Encryption.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("encryption")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("encryption")
}
return err
}
}
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 {
if err := m.Idp.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("idp")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("idp")
}
return err
}
}
return nil
}
func (m *CreateTenantRequest) contextValidateImageRegistry(ctx context.Context, formats strfmt.Registry) error {
if m.ImageRegistry != nil {
if err := m.ImageRegistry.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("image_registry")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("image_registry")
}
return err
}
}
return nil
}
func (m *CreateTenantRequest) contextValidateLogSearchConfiguration(ctx context.Context, formats strfmt.Registry) error {
if m.LogSearchConfiguration != nil {
if err := m.LogSearchConfiguration.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("logSearchConfiguration")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("logSearchConfiguration")
}
return err
}
}
return nil
}
func (m *CreateTenantRequest) contextValidatePools(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Pools); i++ {
if m.Pools[i] != nil {
if err := m.Pools[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("pools" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("pools" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *CreateTenantRequest) contextValidatePrometheusConfiguration(ctx context.Context, formats strfmt.Registry) error {
if m.PrometheusConfiguration != nil {
if err := m.PrometheusConfiguration.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("prometheusConfiguration")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("prometheusConfiguration")
}
return err
}
}
return nil
}
func (m *CreateTenantRequest) contextValidateTLS(ctx context.Context, formats strfmt.Registry) error {
if m.TLS != nil {
if err := m.TLS.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tls")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("tls")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *CreateTenantRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *CreateTenantRequest) UnmarshalBinary(b []byte) error {
var res CreateTenantRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,136 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// CreateTenantResponse create tenant response
//
// swagger:model createTenantResponse
type CreateTenantResponse struct {
// console
Console []*TenantResponseItem `json:"console"`
// external ID p
ExternalIDP bool `json:"externalIDP,omitempty"`
}
// Validate validates this create tenant response
func (m *CreateTenantResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateConsole(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *CreateTenantResponse) validateConsole(formats strfmt.Registry) error {
if swag.IsZero(m.Console) { // not required
return nil
}
for i := 0; i < len(m.Console); i++ {
if swag.IsZero(m.Console[i]) { // not required
continue
}
if m.Console[i] != nil {
if err := m.Console[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("console" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("console" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this create tenant response based on the context it is used
func (m *CreateTenantResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateConsole(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *CreateTenantResponse) contextValidateConsole(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Console); i++ {
if m.Console[i] != nil {
if err := m.Console[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("console" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("console" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *CreateTenantResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *CreateTenantResponse) UnmarshalBinary(b []byte) error {
var res CreateTenantResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,154 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// CsrElement csr element
//
// swagger:model csrElement
type CsrElement struct {
// annotations
Annotations []*Annotation `json:"annotations"`
// deletion grace period seconds
DeletionGracePeriodSeconds int64 `json:"deletion_grace_period_seconds,omitempty"`
// generate name
GenerateName string `json:"generate_name,omitempty"`
// generation
Generation int64 `json:"generation,omitempty"`
// name
Name string `json:"name,omitempty"`
// namespace
Namespace string `json:"namespace,omitempty"`
// resource version
ResourceVersion string `json:"resource_version,omitempty"`
// status
Status string `json:"status,omitempty"`
}
// Validate validates this csr element
func (m *CsrElement) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAnnotations(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *CsrElement) validateAnnotations(formats strfmt.Registry) error {
if swag.IsZero(m.Annotations) { // not required
return nil
}
for i := 0; i < len(m.Annotations); i++ {
if swag.IsZero(m.Annotations[i]) { // not required
continue
}
if m.Annotations[i] != nil {
if err := m.Annotations[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("annotations" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("annotations" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this csr element based on the context it is used
func (m *CsrElement) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateAnnotations(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *CsrElement) contextValidateAnnotations(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Annotations); i++ {
if m.Annotations[i] != nil {
if err := m.Annotations[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("annotations" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("annotations" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *CsrElement) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *CsrElement) UnmarshalBinary(b []byte) error {
var res CsrElement
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,133 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// CsrElements csr elements
//
// swagger:model csrElements
type CsrElements struct {
// csr element
CsrElement []*CsrElement `json:"csrElement"`
}
// Validate validates this csr elements
func (m *CsrElements) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCsrElement(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *CsrElements) validateCsrElement(formats strfmt.Registry) error {
if swag.IsZero(m.CsrElement) { // not required
return nil
}
for i := 0; i < len(m.CsrElement); i++ {
if swag.IsZero(m.CsrElement[i]) { // not required
continue
}
if m.CsrElement[i] != nil {
if err := m.CsrElement[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("csrElement" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("csrElement" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this csr elements based on the context it is used
func (m *CsrElements) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateCsrElement(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *CsrElements) contextValidateCsrElement(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.CsrElement); i++ {
if m.CsrElement[i] != nil {
if err := m.CsrElement[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("csrElement" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("csrElement" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *CsrElements) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *CsrElements) UnmarshalBinary(b []byte) error {
var res CsrElements
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,217 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// DescribePVCWrapper describe p v c wrapper
//
// swagger:model describePVCWrapper
type DescribePVCWrapper struct {
// access modes
AccessModes []string `json:"accessModes"`
// annotations
Annotations []*Annotation `json:"annotations"`
// capacity
Capacity string `json:"capacity,omitempty"`
// finalizers
Finalizers []string `json:"finalizers"`
// labels
Labels []*Label `json:"labels"`
// name
Name string `json:"name,omitempty"`
// namespace
Namespace string `json:"namespace,omitempty"`
// status
Status string `json:"status,omitempty"`
// storage class
StorageClass string `json:"storageClass,omitempty"`
// volume
Volume string `json:"volume,omitempty"`
// volume mode
VolumeMode string `json:"volumeMode,omitempty"`
}
// Validate validates this describe p v c wrapper
func (m *DescribePVCWrapper) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAnnotations(formats); err != nil {
res = append(res, err)
}
if err := m.validateLabels(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *DescribePVCWrapper) validateAnnotations(formats strfmt.Registry) error {
if swag.IsZero(m.Annotations) { // not required
return nil
}
for i := 0; i < len(m.Annotations); i++ {
if swag.IsZero(m.Annotations[i]) { // not required
continue
}
if m.Annotations[i] != nil {
if err := m.Annotations[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("annotations" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("annotations" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *DescribePVCWrapper) validateLabels(formats strfmt.Registry) error {
if swag.IsZero(m.Labels) { // not required
return nil
}
for i := 0; i < len(m.Labels); i++ {
if swag.IsZero(m.Labels[i]) { // not required
continue
}
if m.Labels[i] != nil {
if err := m.Labels[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("labels" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("labels" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this describe p v c wrapper based on the context it is used
func (m *DescribePVCWrapper) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateAnnotations(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateLabels(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *DescribePVCWrapper) contextValidateAnnotations(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Annotations); i++ {
if m.Annotations[i] != nil {
if err := m.Annotations[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("annotations" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("annotations" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *DescribePVCWrapper) contextValidateLabels(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Labels); i++ {
if m.Labels[i] != nil {
if err := m.Labels[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("labels" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("labels" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *DescribePVCWrapper) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DescribePVCWrapper) UnmarshalBinary(b []byte) error {
var res DescribePVCWrapper
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,517 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// DescribePodWrapper describe pod wrapper
//
// swagger:model describePodWrapper
type DescribePodWrapper struct {
// annotations
Annotations []*Annotation `json:"annotations"`
// conditions
Conditions []*Condition `json:"conditions"`
// containers
Containers []*Container `json:"containers"`
// controller ref
ControllerRef string `json:"controllerRef,omitempty"`
// deletion grace period seconds
DeletionGracePeriodSeconds int64 `json:"deletionGracePeriodSeconds,omitempty"`
// deletion timestamp
DeletionTimestamp string `json:"deletionTimestamp,omitempty"`
// labels
Labels []*Label `json:"labels"`
// message
Message string `json:"message,omitempty"`
// name
Name string `json:"name,omitempty"`
// namespace
Namespace string `json:"namespace,omitempty"`
// node name
NodeName string `json:"nodeName,omitempty"`
// node selector
NodeSelector []*NodeSelector `json:"nodeSelector"`
// phase
Phase string `json:"phase,omitempty"`
// pod IP
PodIP string `json:"podIP,omitempty"`
// priority
Priority int64 `json:"priority,omitempty"`
// priority class name
PriorityClassName string `json:"priorityClassName,omitempty"`
// qos class
QosClass string `json:"qosClass,omitempty"`
// reason
Reason string `json:"reason,omitempty"`
// start time
StartTime string `json:"startTime,omitempty"`
// tolerations
Tolerations []*Toleration `json:"tolerations"`
// volumes
Volumes []*Volume `json:"volumes"`
}
// Validate validates this describe pod wrapper
func (m *DescribePodWrapper) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAnnotations(formats); err != nil {
res = append(res, err)
}
if err := m.validateConditions(formats); err != nil {
res = append(res, err)
}
if err := m.validateContainers(formats); err != nil {
res = append(res, err)
}
if err := m.validateLabels(formats); err != nil {
res = append(res, err)
}
if err := m.validateNodeSelector(formats); err != nil {
res = append(res, err)
}
if err := m.validateTolerations(formats); err != nil {
res = append(res, err)
}
if err := m.validateVolumes(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *DescribePodWrapper) validateAnnotations(formats strfmt.Registry) error {
if swag.IsZero(m.Annotations) { // not required
return nil
}
for i := 0; i < len(m.Annotations); i++ {
if swag.IsZero(m.Annotations[i]) { // not required
continue
}
if m.Annotations[i] != nil {
if err := m.Annotations[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("annotations" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("annotations" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *DescribePodWrapper) validateConditions(formats strfmt.Registry) error {
if swag.IsZero(m.Conditions) { // not required
return nil
}
for i := 0; i < len(m.Conditions); i++ {
if swag.IsZero(m.Conditions[i]) { // not required
continue
}
if m.Conditions[i] != nil {
if err := m.Conditions[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("conditions" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("conditions" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *DescribePodWrapper) validateContainers(formats strfmt.Registry) error {
if swag.IsZero(m.Containers) { // not required
return nil
}
for i := 0; i < len(m.Containers); i++ {
if swag.IsZero(m.Containers[i]) { // not required
continue
}
if m.Containers[i] != nil {
if err := m.Containers[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("containers" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("containers" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *DescribePodWrapper) validateLabels(formats strfmt.Registry) error {
if swag.IsZero(m.Labels) { // not required
return nil
}
for i := 0; i < len(m.Labels); i++ {
if swag.IsZero(m.Labels[i]) { // not required
continue
}
if m.Labels[i] != nil {
if err := m.Labels[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("labels" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("labels" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *DescribePodWrapper) validateNodeSelector(formats strfmt.Registry) error {
if swag.IsZero(m.NodeSelector) { // not required
return nil
}
for i := 0; i < len(m.NodeSelector); i++ {
if swag.IsZero(m.NodeSelector[i]) { // not required
continue
}
if m.NodeSelector[i] != nil {
if err := m.NodeSelector[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("nodeSelector" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("nodeSelector" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *DescribePodWrapper) validateTolerations(formats strfmt.Registry) error {
if swag.IsZero(m.Tolerations) { // not required
return nil
}
for i := 0; i < len(m.Tolerations); i++ {
if swag.IsZero(m.Tolerations[i]) { // not required
continue
}
if m.Tolerations[i] != nil {
if err := m.Tolerations[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tolerations" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("tolerations" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *DescribePodWrapper) validateVolumes(formats strfmt.Registry) error {
if swag.IsZero(m.Volumes) { // not required
return nil
}
for i := 0; i < len(m.Volumes); i++ {
if swag.IsZero(m.Volumes[i]) { // not required
continue
}
if m.Volumes[i] != nil {
if err := m.Volumes[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("volumes" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("volumes" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this describe pod wrapper based on the context it is used
func (m *DescribePodWrapper) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateAnnotations(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateConditions(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateContainers(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateLabels(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateNodeSelector(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateTolerations(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateVolumes(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *DescribePodWrapper) contextValidateAnnotations(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Annotations); i++ {
if m.Annotations[i] != nil {
if err := m.Annotations[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("annotations" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("annotations" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *DescribePodWrapper) contextValidateConditions(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Conditions); i++ {
if m.Conditions[i] != nil {
if err := m.Conditions[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("conditions" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("conditions" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *DescribePodWrapper) contextValidateContainers(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Containers); i++ {
if m.Containers[i] != nil {
if err := m.Containers[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("containers" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("containers" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *DescribePodWrapper) contextValidateLabels(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Labels); i++ {
if m.Labels[i] != nil {
if err := m.Labels[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("labels" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("labels" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *DescribePodWrapper) contextValidateNodeSelector(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.NodeSelector); i++ {
if m.NodeSelector[i] != nil {
if err := m.NodeSelector[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("nodeSelector" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("nodeSelector" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *DescribePodWrapper) contextValidateTolerations(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Tolerations); i++ {
if m.Tolerations[i] != nil {
if err := m.Tolerations[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tolerations" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("tolerations" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *DescribePodWrapper) contextValidateVolumes(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Volumes); i++ {
if m.Volumes[i] != nil {
if err := m.Volumes[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("volumes" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("volumes" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *DescribePodWrapper) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DescribePodWrapper) UnmarshalBinary(b []byte) error {
var res DescribePodWrapper
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,85 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// DirectPVDriveInfo direct p v drive info
//
// swagger:model directPVDriveInfo
type DirectPVDriveInfo struct {
// allocated
Allocated int64 `json:"allocated,omitempty"`
// capacity
Capacity int64 `json:"capacity,omitempty"`
// drive
Drive string `json:"drive,omitempty"`
// message
Message string `json:"message,omitempty"`
// node
Node string `json:"node,omitempty"`
// status
Status string `json:"status,omitempty"`
// volumes
Volumes int64 `json:"volumes,omitempty"`
}
// Validate validates this direct p v drive info
func (m *DirectPVDriveInfo) Validate(formats strfmt.Registry) error {
return nil
}
// 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 *DirectPVDriveInfo) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DirectPVDriveInfo) UnmarshalBinary(b []byte) error {
var res DirectPVDriveInfo
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,76 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// DirectPVVolumeInfo direct p v volume info
//
// swagger:model directPVVolumeInfo
type DirectPVVolumeInfo struct {
// capacity
Capacity int64 `json:"capacity,omitempty"`
// drive
Drive string `json:"drive,omitempty"`
// node
Node string `json:"node,omitempty"`
// volume
Volume string `json:"volume,omitempty"`
}
// Validate validates this direct p v volume info
func (m *DirectPVVolumeInfo) Validate(formats strfmt.Registry) error {
return nil
}
// 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 *DirectPVVolumeInfo) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DirectPVVolumeInfo) UnmarshalBinary(b []byte) error {
var res DirectPVVolumeInfo
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,70 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// DomainsConfiguration domains configuration
//
// swagger:model domainsConfiguration
type DomainsConfiguration struct {
// console
Console string `json:"console,omitempty"`
// minio
Minio []string `json:"minio"`
}
// Validate validates this domains configuration
func (m *DomainsConfiguration) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this domains configuration based on context it is used
func (m *DomainsConfiguration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *DomainsConfiguration) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DomainsConfiguration) UnmarshalBinary(b []byte) error {
var res DomainsConfiguration
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,705 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// EncryptionConfiguration encryption configuration
//
// swagger:model encryptionConfiguration
type EncryptionConfiguration struct {
MetadataFields
// aws
Aws *AwsConfiguration `json:"aws,omitempty"`
// azure
Azure *AzureConfiguration `json:"azure,omitempty"`
// gcp
Gcp *GcpConfiguration `json:"gcp,omitempty"`
// gemalto
Gemalto *GemaltoConfiguration `json:"gemalto,omitempty"`
// image
Image string `json:"image,omitempty"`
// kms mtls
KmsMtls *EncryptionConfigurationAO1KmsMtls `json:"kms_mtls,omitempty"`
// minio mtls
MinioMtls *KeyPairConfiguration `json:"minio_mtls,omitempty"`
// raw
Raw string `json:"raw,omitempty"`
// replicas
Replicas string `json:"replicas,omitempty"`
// secrets to be deleted
SecretsToBeDeleted []string `json:"secretsToBeDeleted"`
// security context
SecurityContext *SecurityContext `json:"securityContext,omitempty"`
// server tls
ServerTLS *KeyPairConfiguration `json:"server_tls,omitempty"`
// vault
Vault *VaultConfiguration `json:"vault,omitempty"`
}
// UnmarshalJSON unmarshals this object from a JSON structure
func (m *EncryptionConfiguration) UnmarshalJSON(raw []byte) error {
// AO0
var aO0 MetadataFields
if err := swag.ReadJSON(raw, &aO0); err != nil {
return err
}
m.MetadataFields = aO0
// AO1
var dataAO1 struct {
Aws *AwsConfiguration `json:"aws,omitempty"`
Azure *AzureConfiguration `json:"azure,omitempty"`
Gcp *GcpConfiguration `json:"gcp,omitempty"`
Gemalto *GemaltoConfiguration `json:"gemalto,omitempty"`
Image string `json:"image,omitempty"`
KmsMtls *EncryptionConfigurationAO1KmsMtls `json:"kms_mtls,omitempty"`
MinioMtls *KeyPairConfiguration `json:"minio_mtls,omitempty"`
Raw string `json:"raw,omitempty"`
Replicas string `json:"replicas,omitempty"`
SecretsToBeDeleted []string `json:"secretsToBeDeleted"`
SecurityContext *SecurityContext `json:"securityContext,omitempty"`
ServerTLS *KeyPairConfiguration `json:"server_tls,omitempty"`
Vault *VaultConfiguration `json:"vault,omitempty"`
}
if err := swag.ReadJSON(raw, &dataAO1); err != nil {
return err
}
m.Aws = dataAO1.Aws
m.Azure = dataAO1.Azure
m.Gcp = dataAO1.Gcp
m.Gemalto = dataAO1.Gemalto
m.Image = dataAO1.Image
m.KmsMtls = dataAO1.KmsMtls
m.MinioMtls = dataAO1.MinioMtls
m.Raw = dataAO1.Raw
m.Replicas = dataAO1.Replicas
m.SecretsToBeDeleted = dataAO1.SecretsToBeDeleted
m.SecurityContext = dataAO1.SecurityContext
m.ServerTLS = dataAO1.ServerTLS
m.Vault = dataAO1.Vault
return nil
}
// MarshalJSON marshals this object to a JSON structure
func (m EncryptionConfiguration) MarshalJSON() ([]byte, error) {
_parts := make([][]byte, 0, 2)
aO0, err := swag.WriteJSON(m.MetadataFields)
if err != nil {
return nil, err
}
_parts = append(_parts, aO0)
var dataAO1 struct {
Aws *AwsConfiguration `json:"aws,omitempty"`
Azure *AzureConfiguration `json:"azure,omitempty"`
Gcp *GcpConfiguration `json:"gcp,omitempty"`
Gemalto *GemaltoConfiguration `json:"gemalto,omitempty"`
Image string `json:"image,omitempty"`
KmsMtls *EncryptionConfigurationAO1KmsMtls `json:"kms_mtls,omitempty"`
MinioMtls *KeyPairConfiguration `json:"minio_mtls,omitempty"`
Raw string `json:"raw,omitempty"`
Replicas string `json:"replicas,omitempty"`
SecretsToBeDeleted []string `json:"secretsToBeDeleted"`
SecurityContext *SecurityContext `json:"securityContext,omitempty"`
ServerTLS *KeyPairConfiguration `json:"server_tls,omitempty"`
Vault *VaultConfiguration `json:"vault,omitempty"`
}
dataAO1.Aws = m.Aws
dataAO1.Azure = m.Azure
dataAO1.Gcp = m.Gcp
dataAO1.Gemalto = m.Gemalto
dataAO1.Image = m.Image
dataAO1.KmsMtls = m.KmsMtls
dataAO1.MinioMtls = m.MinioMtls
dataAO1.Raw = m.Raw
dataAO1.Replicas = m.Replicas
dataAO1.SecretsToBeDeleted = m.SecretsToBeDeleted
dataAO1.SecurityContext = m.SecurityContext
dataAO1.ServerTLS = m.ServerTLS
dataAO1.Vault = m.Vault
jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1)
if errAO1 != nil {
return nil, errAO1
}
_parts = append(_parts, jsonDataAO1)
return swag.ConcatJSON(_parts...), nil
}
// Validate validates this encryption configuration
func (m *EncryptionConfiguration) Validate(formats strfmt.Registry) error {
var res []error
// validation for a type composition with MetadataFields
if err := m.MetadataFields.Validate(formats); err != nil {
res = append(res, err)
}
if err := m.validateAws(formats); err != nil {
res = append(res, err)
}
if err := m.validateAzure(formats); err != nil {
res = append(res, err)
}
if err := m.validateGcp(formats); err != nil {
res = append(res, err)
}
if err := m.validateGemalto(formats); err != nil {
res = append(res, err)
}
if err := m.validateKmsMtls(formats); err != nil {
res = append(res, err)
}
if err := m.validateMinioMtls(formats); err != nil {
res = append(res, err)
}
if err := m.validateSecurityContext(formats); err != nil {
res = append(res, err)
}
if err := m.validateServerTLS(formats); err != nil {
res = append(res, err)
}
if err := m.validateVault(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *EncryptionConfiguration) validateAws(formats strfmt.Registry) error {
if swag.IsZero(m.Aws) { // not required
return nil
}
if m.Aws != nil {
if err := m.Aws.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("aws")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("aws")
}
return err
}
}
return nil
}
func (m *EncryptionConfiguration) validateAzure(formats strfmt.Registry) error {
if swag.IsZero(m.Azure) { // not required
return nil
}
if m.Azure != nil {
if err := m.Azure.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("azure")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("azure")
}
return err
}
}
return nil
}
func (m *EncryptionConfiguration) validateGcp(formats strfmt.Registry) error {
if swag.IsZero(m.Gcp) { // not required
return nil
}
if m.Gcp != nil {
if err := m.Gcp.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("gcp")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("gcp")
}
return err
}
}
return nil
}
func (m *EncryptionConfiguration) validateGemalto(formats strfmt.Registry) error {
if swag.IsZero(m.Gemalto) { // not required
return nil
}
if m.Gemalto != nil {
if err := m.Gemalto.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("gemalto")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("gemalto")
}
return err
}
}
return nil
}
func (m *EncryptionConfiguration) validateKmsMtls(formats strfmt.Registry) error {
if swag.IsZero(m.KmsMtls) { // not required
return nil
}
if m.KmsMtls != nil {
if err := m.KmsMtls.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("kms_mtls")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("kms_mtls")
}
return err
}
}
return nil
}
func (m *EncryptionConfiguration) validateMinioMtls(formats strfmt.Registry) error {
if swag.IsZero(m.MinioMtls) { // not required
return nil
}
if m.MinioMtls != nil {
if err := m.MinioMtls.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("minio_mtls")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("minio_mtls")
}
return err
}
}
return nil
}
func (m *EncryptionConfiguration) 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
}
func (m *EncryptionConfiguration) validateServerTLS(formats strfmt.Registry) error {
if swag.IsZero(m.ServerTLS) { // not required
return nil
}
if m.ServerTLS != nil {
if err := m.ServerTLS.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("server_tls")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("server_tls")
}
return err
}
}
return nil
}
func (m *EncryptionConfiguration) validateVault(formats strfmt.Registry) error {
if swag.IsZero(m.Vault) { // not required
return nil
}
if m.Vault != nil {
if err := m.Vault.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("vault")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("vault")
}
return err
}
}
return nil
}
// ContextValidate validate this encryption configuration based on the context it is used
func (m *EncryptionConfiguration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
// validation for a type composition with MetadataFields
if err := m.MetadataFields.ContextValidate(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateAws(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateAzure(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateGcp(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateGemalto(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateKmsMtls(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateMinioMtls(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateSecurityContext(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateServerTLS(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateVault(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *EncryptionConfiguration) contextValidateAws(ctx context.Context, formats strfmt.Registry) error {
if m.Aws != nil {
if err := m.Aws.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("aws")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("aws")
}
return err
}
}
return nil
}
func (m *EncryptionConfiguration) contextValidateAzure(ctx context.Context, formats strfmt.Registry) error {
if m.Azure != nil {
if err := m.Azure.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("azure")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("azure")
}
return err
}
}
return nil
}
func (m *EncryptionConfiguration) contextValidateGcp(ctx context.Context, formats strfmt.Registry) error {
if m.Gcp != nil {
if err := m.Gcp.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("gcp")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("gcp")
}
return err
}
}
return nil
}
func (m *EncryptionConfiguration) contextValidateGemalto(ctx context.Context, formats strfmt.Registry) error {
if m.Gemalto != nil {
if err := m.Gemalto.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("gemalto")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("gemalto")
}
return err
}
}
return nil
}
func (m *EncryptionConfiguration) contextValidateKmsMtls(ctx context.Context, formats strfmt.Registry) error {
if m.KmsMtls != nil {
if err := m.KmsMtls.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("kms_mtls")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("kms_mtls")
}
return err
}
}
return nil
}
func (m *EncryptionConfiguration) contextValidateMinioMtls(ctx context.Context, formats strfmt.Registry) error {
if m.MinioMtls != nil {
if err := m.MinioMtls.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("minio_mtls")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("minio_mtls")
}
return err
}
}
return nil
}
func (m *EncryptionConfiguration) 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
}
func (m *EncryptionConfiguration) contextValidateServerTLS(ctx context.Context, formats strfmt.Registry) error {
if m.ServerTLS != nil {
if err := m.ServerTLS.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("server_tls")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("server_tls")
}
return err
}
}
return nil
}
func (m *EncryptionConfiguration) contextValidateVault(ctx context.Context, formats strfmt.Registry) error {
if m.Vault != nil {
if err := m.Vault.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("vault")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("vault")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *EncryptionConfiguration) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *EncryptionConfiguration) UnmarshalBinary(b []byte) error {
var res EncryptionConfiguration
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// EncryptionConfigurationAO1KmsMtls encryption configuration a o1 kms mtls
//
// swagger:model EncryptionConfigurationAO1KmsMtls
type EncryptionConfigurationAO1KmsMtls struct {
// ca
Ca string `json:"ca,omitempty"`
// crt
Crt string `json:"crt,omitempty"`
// key
Key string `json:"key,omitempty"`
}
// Validate validates this encryption configuration a o1 kms mtls
func (m *EncryptionConfigurationAO1KmsMtls) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this encryption configuration a o1 kms mtls based on context it is used
func (m *EncryptionConfigurationAO1KmsMtls) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *EncryptionConfigurationAO1KmsMtls) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *EncryptionConfigurationAO1KmsMtls) UnmarshalBinary(b []byte) error {
var res EncryptionConfigurationAO1KmsMtls
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,787 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// EncryptionConfigurationResponse encryption configuration response
//
// swagger:model encryptionConfigurationResponse
type EncryptionConfigurationResponse struct {
MetadataFields
// aws
Aws *AwsConfiguration `json:"aws,omitempty"`
// azure
Azure *AzureConfiguration `json:"azure,omitempty"`
// gcp
Gcp *GcpConfiguration `json:"gcp,omitempty"`
// gemalto
Gemalto *GemaltoConfigurationResponse `json:"gemalto,omitempty"`
// image
Image string `json:"image,omitempty"`
// kms mtls
KmsMtls *EncryptionConfigurationResponseAO1KmsMtls `json:"kms_mtls,omitempty"`
// minio mtls
MinioMtls *CertificateInfo `json:"minio_mtls,omitempty"`
// raw
Raw string `json:"raw,omitempty"`
// replicas
Replicas string `json:"replicas,omitempty"`
// security context
SecurityContext *SecurityContext `json:"securityContext,omitempty"`
// server tls
ServerTLS *CertificateInfo `json:"server_tls,omitempty"`
// vault
Vault *VaultConfigurationResponse `json:"vault,omitempty"`
}
// UnmarshalJSON unmarshals this object from a JSON structure
func (m *EncryptionConfigurationResponse) UnmarshalJSON(raw []byte) error {
// AO0
var aO0 MetadataFields
if err := swag.ReadJSON(raw, &aO0); err != nil {
return err
}
m.MetadataFields = aO0
// AO1
var dataAO1 struct {
Aws *AwsConfiguration `json:"aws,omitempty"`
Azure *AzureConfiguration `json:"azure,omitempty"`
Gcp *GcpConfiguration `json:"gcp,omitempty"`
Gemalto *GemaltoConfigurationResponse `json:"gemalto,omitempty"`
Image string `json:"image,omitempty"`
KmsMtls *EncryptionConfigurationResponseAO1KmsMtls `json:"kms_mtls,omitempty"`
MinioMtls *CertificateInfo `json:"minio_mtls,omitempty"`
Raw string `json:"raw,omitempty"`
Replicas string `json:"replicas,omitempty"`
SecurityContext *SecurityContext `json:"securityContext,omitempty"`
ServerTLS *CertificateInfo `json:"server_tls,omitempty"`
Vault *VaultConfigurationResponse `json:"vault,omitempty"`
}
if err := swag.ReadJSON(raw, &dataAO1); err != nil {
return err
}
m.Aws = dataAO1.Aws
m.Azure = dataAO1.Azure
m.Gcp = dataAO1.Gcp
m.Gemalto = dataAO1.Gemalto
m.Image = dataAO1.Image
m.KmsMtls = dataAO1.KmsMtls
m.MinioMtls = dataAO1.MinioMtls
m.Raw = dataAO1.Raw
m.Replicas = dataAO1.Replicas
m.SecurityContext = dataAO1.SecurityContext
m.ServerTLS = dataAO1.ServerTLS
m.Vault = dataAO1.Vault
return nil
}
// MarshalJSON marshals this object to a JSON structure
func (m EncryptionConfigurationResponse) MarshalJSON() ([]byte, error) {
_parts := make([][]byte, 0, 2)
aO0, err := swag.WriteJSON(m.MetadataFields)
if err != nil {
return nil, err
}
_parts = append(_parts, aO0)
var dataAO1 struct {
Aws *AwsConfiguration `json:"aws,omitempty"`
Azure *AzureConfiguration `json:"azure,omitempty"`
Gcp *GcpConfiguration `json:"gcp,omitempty"`
Gemalto *GemaltoConfigurationResponse `json:"gemalto,omitempty"`
Image string `json:"image,omitempty"`
KmsMtls *EncryptionConfigurationResponseAO1KmsMtls `json:"kms_mtls,omitempty"`
MinioMtls *CertificateInfo `json:"minio_mtls,omitempty"`
Raw string `json:"raw,omitempty"`
Replicas string `json:"replicas,omitempty"`
SecurityContext *SecurityContext `json:"securityContext,omitempty"`
ServerTLS *CertificateInfo `json:"server_tls,omitempty"`
Vault *VaultConfigurationResponse `json:"vault,omitempty"`
}
dataAO1.Aws = m.Aws
dataAO1.Azure = m.Azure
dataAO1.Gcp = m.Gcp
dataAO1.Gemalto = m.Gemalto
dataAO1.Image = m.Image
dataAO1.KmsMtls = m.KmsMtls
dataAO1.MinioMtls = m.MinioMtls
dataAO1.Raw = m.Raw
dataAO1.Replicas = m.Replicas
dataAO1.SecurityContext = m.SecurityContext
dataAO1.ServerTLS = m.ServerTLS
dataAO1.Vault = m.Vault
jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1)
if errAO1 != nil {
return nil, errAO1
}
_parts = append(_parts, jsonDataAO1)
return swag.ConcatJSON(_parts...), nil
}
// Validate validates this encryption configuration response
func (m *EncryptionConfigurationResponse) Validate(formats strfmt.Registry) error {
var res []error
// validation for a type composition with MetadataFields
if err := m.MetadataFields.Validate(formats); err != nil {
res = append(res, err)
}
if err := m.validateAws(formats); err != nil {
res = append(res, err)
}
if err := m.validateAzure(formats); err != nil {
res = append(res, err)
}
if err := m.validateGcp(formats); err != nil {
res = append(res, err)
}
if err := m.validateGemalto(formats); err != nil {
res = append(res, err)
}
if err := m.validateKmsMtls(formats); err != nil {
res = append(res, err)
}
if err := m.validateMinioMtls(formats); err != nil {
res = append(res, err)
}
if err := m.validateSecurityContext(formats); err != nil {
res = append(res, err)
}
if err := m.validateServerTLS(formats); err != nil {
res = append(res, err)
}
if err := m.validateVault(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *EncryptionConfigurationResponse) validateAws(formats strfmt.Registry) error {
if swag.IsZero(m.Aws) { // not required
return nil
}
if m.Aws != nil {
if err := m.Aws.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("aws")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("aws")
}
return err
}
}
return nil
}
func (m *EncryptionConfigurationResponse) validateAzure(formats strfmt.Registry) error {
if swag.IsZero(m.Azure) { // not required
return nil
}
if m.Azure != nil {
if err := m.Azure.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("azure")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("azure")
}
return err
}
}
return nil
}
func (m *EncryptionConfigurationResponse) validateGcp(formats strfmt.Registry) error {
if swag.IsZero(m.Gcp) { // not required
return nil
}
if m.Gcp != nil {
if err := m.Gcp.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("gcp")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("gcp")
}
return err
}
}
return nil
}
func (m *EncryptionConfigurationResponse) validateGemalto(formats strfmt.Registry) error {
if swag.IsZero(m.Gemalto) { // not required
return nil
}
if m.Gemalto != nil {
if err := m.Gemalto.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("gemalto")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("gemalto")
}
return err
}
}
return nil
}
func (m *EncryptionConfigurationResponse) validateKmsMtls(formats strfmt.Registry) error {
if swag.IsZero(m.KmsMtls) { // not required
return nil
}
if m.KmsMtls != nil {
if err := m.KmsMtls.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("kms_mtls")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("kms_mtls")
}
return err
}
}
return nil
}
func (m *EncryptionConfigurationResponse) validateMinioMtls(formats strfmt.Registry) error {
if swag.IsZero(m.MinioMtls) { // not required
return nil
}
if m.MinioMtls != nil {
if err := m.MinioMtls.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("minio_mtls")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("minio_mtls")
}
return err
}
}
return nil
}
func (m *EncryptionConfigurationResponse) 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
}
func (m *EncryptionConfigurationResponse) validateServerTLS(formats strfmt.Registry) error {
if swag.IsZero(m.ServerTLS) { // not required
return nil
}
if m.ServerTLS != nil {
if err := m.ServerTLS.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("server_tls")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("server_tls")
}
return err
}
}
return nil
}
func (m *EncryptionConfigurationResponse) validateVault(formats strfmt.Registry) error {
if swag.IsZero(m.Vault) { // not required
return nil
}
if m.Vault != nil {
if err := m.Vault.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("vault")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("vault")
}
return err
}
}
return nil
}
// ContextValidate validate this encryption configuration response based on the context it is used
func (m *EncryptionConfigurationResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
// validation for a type composition with MetadataFields
if err := m.MetadataFields.ContextValidate(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateAws(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateAzure(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateGcp(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateGemalto(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateKmsMtls(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateMinioMtls(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateSecurityContext(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateServerTLS(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateVault(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *EncryptionConfigurationResponse) contextValidateAws(ctx context.Context, formats strfmt.Registry) error {
if m.Aws != nil {
if err := m.Aws.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("aws")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("aws")
}
return err
}
}
return nil
}
func (m *EncryptionConfigurationResponse) contextValidateAzure(ctx context.Context, formats strfmt.Registry) error {
if m.Azure != nil {
if err := m.Azure.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("azure")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("azure")
}
return err
}
}
return nil
}
func (m *EncryptionConfigurationResponse) contextValidateGcp(ctx context.Context, formats strfmt.Registry) error {
if m.Gcp != nil {
if err := m.Gcp.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("gcp")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("gcp")
}
return err
}
}
return nil
}
func (m *EncryptionConfigurationResponse) contextValidateGemalto(ctx context.Context, formats strfmt.Registry) error {
if m.Gemalto != nil {
if err := m.Gemalto.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("gemalto")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("gemalto")
}
return err
}
}
return nil
}
func (m *EncryptionConfigurationResponse) contextValidateKmsMtls(ctx context.Context, formats strfmt.Registry) error {
if m.KmsMtls != nil {
if err := m.KmsMtls.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("kms_mtls")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("kms_mtls")
}
return err
}
}
return nil
}
func (m *EncryptionConfigurationResponse) contextValidateMinioMtls(ctx context.Context, formats strfmt.Registry) error {
if m.MinioMtls != nil {
if err := m.MinioMtls.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("minio_mtls")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("minio_mtls")
}
return err
}
}
return nil
}
func (m *EncryptionConfigurationResponse) 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
}
func (m *EncryptionConfigurationResponse) contextValidateServerTLS(ctx context.Context, formats strfmt.Registry) error {
if m.ServerTLS != nil {
if err := m.ServerTLS.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("server_tls")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("server_tls")
}
return err
}
}
return nil
}
func (m *EncryptionConfigurationResponse) contextValidateVault(ctx context.Context, formats strfmt.Registry) error {
if m.Vault != nil {
if err := m.Vault.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("vault")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("vault")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *EncryptionConfigurationResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *EncryptionConfigurationResponse) UnmarshalBinary(b []byte) error {
var res EncryptionConfigurationResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// EncryptionConfigurationResponseAO1KmsMtls encryption configuration response a o1 kms mtls
//
// swagger:model EncryptionConfigurationResponseAO1KmsMtls
type EncryptionConfigurationResponseAO1KmsMtls struct {
// ca
Ca *CertificateInfo `json:"ca,omitempty"`
// crt
Crt *CertificateInfo `json:"crt,omitempty"`
}
// Validate validates this encryption configuration response a o1 kms mtls
func (m *EncryptionConfigurationResponseAO1KmsMtls) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCa(formats); err != nil {
res = append(res, err)
}
if err := m.validateCrt(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *EncryptionConfigurationResponseAO1KmsMtls) validateCa(formats strfmt.Registry) error {
if swag.IsZero(m.Ca) { // not required
return nil
}
if m.Ca != nil {
if err := m.Ca.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("kms_mtls" + "." + "ca")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("kms_mtls" + "." + "ca")
}
return err
}
}
return nil
}
func (m *EncryptionConfigurationResponseAO1KmsMtls) validateCrt(formats strfmt.Registry) error {
if swag.IsZero(m.Crt) { // not required
return nil
}
if m.Crt != nil {
if err := m.Crt.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("kms_mtls" + "." + "crt")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("kms_mtls" + "." + "crt")
}
return err
}
}
return nil
}
// ContextValidate validate this encryption configuration response a o1 kms mtls based on the context it is used
func (m *EncryptionConfigurationResponseAO1KmsMtls) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateCa(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateCrt(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *EncryptionConfigurationResponseAO1KmsMtls) contextValidateCa(ctx context.Context, formats strfmt.Registry) error {
if m.Ca != nil {
if err := m.Ca.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("kms_mtls" + "." + "ca")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("kms_mtls" + "." + "ca")
}
return err
}
}
return nil
}
func (m *EncryptionConfigurationResponseAO1KmsMtls) contextValidateCrt(ctx context.Context, formats strfmt.Registry) error {
if m.Crt != nil {
if err := m.Crt.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("kms_mtls" + "." + "crt")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("kms_mtls" + "." + "crt")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *EncryptionConfigurationResponseAO1KmsMtls) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *EncryptionConfigurationResponseAO1KmsMtls) UnmarshalBinary(b []byte) error {
var res EncryptionConfigurationResponseAO1KmsMtls
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,70 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// EnvironmentVariable environment variable
//
// swagger:model environmentVariable
type EnvironmentVariable struct {
// key
Key string `json:"key,omitempty"`
// value
Value string `json:"value,omitempty"`
}
// Validate validates this environment variable
func (m *EnvironmentVariable) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this environment variable based on context it is used
func (m *EnvironmentVariable) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *EnvironmentVariable) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *EnvironmentVariable) UnmarshalBinary(b []byte) error {
var res EnvironmentVariable
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,82 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// EventListElement event list element
//
// swagger:model eventListElement
type EventListElement struct {
// event type
EventType string `json:"event_type,omitempty"`
// last seen
LastSeen int64 `json:"last_seen,omitempty"`
// message
Message string `json:"message,omitempty"`
// namespace
Namespace string `json:"namespace,omitempty"`
// object
Object string `json:"object,omitempty"`
// reason
Reason string `json:"reason,omitempty"`
}
// Validate validates this event list element
func (m *EventListElement) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this event list element based on context it is used
func (m *EventListElement) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *EventListElement) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *EventListElement) UnmarshalBinary(b []byte) error {
var res EventListElement
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,90 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// EventListWrapper event list wrapper
//
// swagger:model eventListWrapper
type EventListWrapper []*EventListElement
// Validate validates this event list wrapper
func (m EventListWrapper) Validate(formats strfmt.Registry) error {
var res []error
for i := 0; i < len(m); i++ {
if swag.IsZero(m[i]) { // not required
continue
}
if m[i] != nil {
if err := m[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName(strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName(strconv.Itoa(i))
}
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// ContextValidate validate this event list wrapper based on the context it is used
func (m EventListWrapper) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
for i := 0; i < len(m); i++ {
if m[i] != nil {
if err := m[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName(strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName(strconv.Itoa(i))
}
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -1,105 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// FormatConfiguration format configuration
//
// swagger:model formatConfiguration
type FormatConfiguration struct {
// drives
// Required: true
Drives []string `json:"drives"`
// force
// Required: true
Force *bool `json:"force"`
}
// Validate validates this format configuration
func (m *FormatConfiguration) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateDrives(formats); err != nil {
res = append(res, err)
}
if err := m.validateForce(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *FormatConfiguration) validateDrives(formats strfmt.Registry) error {
if err := validate.Required("drives", "body", m.Drives); err != nil {
return err
}
return nil
}
func (m *FormatConfiguration) validateForce(formats strfmt.Registry) error {
if err := validate.Required("force", "body", m.Force); err != nil {
return err
}
return nil
}
// ContextValidate validates this format configuration based on context it is used
func (m *FormatConfiguration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *FormatConfiguration) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *FormatConfiguration) UnmarshalBinary(b []byte) error {
var res FormatConfiguration
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,133 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// FormatDirectPVDrivesResponse format direct p v drives response
//
// swagger:model formatDirectPVDrivesResponse
type FormatDirectPVDrivesResponse struct {
// format issues list
FormatIssuesList []*PvFormatErrorResponse `json:"formatIssuesList"`
}
// 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 {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *FormatDirectPVDrivesResponse) validateFormatIssuesList(formats strfmt.Registry) error {
if swag.IsZero(m.FormatIssuesList) { // not required
return nil
}
for i := 0; i < len(m.FormatIssuesList); i++ {
if swag.IsZero(m.FormatIssuesList[i]) { // not required
continue
}
if m.FormatIssuesList[i] != nil {
if err := m.FormatIssuesList[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("formatIssuesList" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("formatIssuesList" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// 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 {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *FormatDirectPVDrivesResponse) contextValidateFormatIssuesList(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.FormatIssuesList); i++ {
if m.FormatIssuesList[i] != nil {
if err := m.FormatIssuesList[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("formatIssuesList" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("formatIssuesList" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *FormatDirectPVDrivesResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *FormatDirectPVDrivesResponse) UnmarshalBinary(b []byte) error {
var res FormatDirectPVDrivesResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,280 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// GcpConfiguration gcp configuration
//
// swagger:model gcpConfiguration
type GcpConfiguration struct {
// secretmanager
// Required: true
Secretmanager *GcpConfigurationSecretmanager `json:"secretmanager"`
}
// Validate validates this gcp configuration
func (m *GcpConfiguration) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateSecretmanager(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GcpConfiguration) validateSecretmanager(formats strfmt.Registry) error {
if err := validate.Required("secretmanager", "body", m.Secretmanager); err != nil {
return err
}
if m.Secretmanager != nil {
if err := m.Secretmanager.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("secretmanager")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("secretmanager")
}
return err
}
}
return nil
}
// ContextValidate validate this gcp configuration based on the context it is used
func (m *GcpConfiguration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateSecretmanager(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GcpConfiguration) contextValidateSecretmanager(ctx context.Context, formats strfmt.Registry) error {
if m.Secretmanager != nil {
if err := m.Secretmanager.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("secretmanager")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("secretmanager")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *GcpConfiguration) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *GcpConfiguration) UnmarshalBinary(b []byte) error {
var res GcpConfiguration
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// GcpConfigurationSecretmanager gcp configuration secretmanager
//
// swagger:model GcpConfigurationSecretmanager
type GcpConfigurationSecretmanager struct {
// credentials
Credentials *GcpConfigurationSecretmanagerCredentials `json:"credentials,omitempty"`
// endpoint
Endpoint string `json:"endpoint,omitempty"`
// project id
// Required: true
ProjectID *string `json:"project_id"`
}
// Validate validates this gcp configuration secretmanager
func (m *GcpConfigurationSecretmanager) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCredentials(formats); err != nil {
res = append(res, err)
}
if err := m.validateProjectID(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GcpConfigurationSecretmanager) validateCredentials(formats strfmt.Registry) error {
if swag.IsZero(m.Credentials) { // not required
return nil
}
if m.Credentials != nil {
if err := m.Credentials.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("secretmanager" + "." + "credentials")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("secretmanager" + "." + "credentials")
}
return err
}
}
return nil
}
func (m *GcpConfigurationSecretmanager) validateProjectID(formats strfmt.Registry) error {
if err := validate.Required("secretmanager"+"."+"project_id", "body", m.ProjectID); err != nil {
return err
}
return nil
}
// ContextValidate validate this gcp configuration secretmanager based on the context it is used
func (m *GcpConfigurationSecretmanager) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateCredentials(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GcpConfigurationSecretmanager) contextValidateCredentials(ctx context.Context, formats strfmt.Registry) error {
if m.Credentials != nil {
if err := m.Credentials.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("secretmanager" + "." + "credentials")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("secretmanager" + "." + "credentials")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *GcpConfigurationSecretmanager) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *GcpConfigurationSecretmanager) UnmarshalBinary(b []byte) error {
var res GcpConfigurationSecretmanager
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// GcpConfigurationSecretmanagerCredentials gcp configuration secretmanager credentials
//
// swagger:model GcpConfigurationSecretmanagerCredentials
type GcpConfigurationSecretmanagerCredentials struct {
// client email
ClientEmail string `json:"client_email,omitempty"`
// client id
ClientID string `json:"client_id,omitempty"`
// private key
PrivateKey string `json:"private_key,omitempty"`
// private key id
PrivateKeyID string `json:"private_key_id,omitempty"`
}
// Validate validates this gcp configuration secretmanager credentials
func (m *GcpConfigurationSecretmanagerCredentials) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this gcp configuration secretmanager credentials based on context it is used
func (m *GcpConfigurationSecretmanagerCredentials) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *GcpConfigurationSecretmanagerCredentials) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *GcpConfigurationSecretmanagerCredentials) UnmarshalBinary(b []byte) error {
var res GcpConfigurationSecretmanagerCredentials
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,309 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// GemaltoConfiguration gemalto configuration
//
// swagger:model gemaltoConfiguration
type GemaltoConfiguration struct {
// keysecure
// Required: true
Keysecure *GemaltoConfigurationKeysecure `json:"keysecure"`
}
// Validate validates this gemalto configuration
func (m *GemaltoConfiguration) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateKeysecure(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GemaltoConfiguration) validateKeysecure(formats strfmt.Registry) error {
if err := validate.Required("keysecure", "body", m.Keysecure); err != nil {
return err
}
if m.Keysecure != nil {
if err := m.Keysecure.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("keysecure")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("keysecure")
}
return err
}
}
return nil
}
// ContextValidate validate this gemalto configuration based on the context it is used
func (m *GemaltoConfiguration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateKeysecure(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GemaltoConfiguration) contextValidateKeysecure(ctx context.Context, formats strfmt.Registry) error {
if m.Keysecure != nil {
if err := m.Keysecure.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("keysecure")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("keysecure")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *GemaltoConfiguration) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *GemaltoConfiguration) UnmarshalBinary(b []byte) error {
var res GemaltoConfiguration
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// GemaltoConfigurationKeysecure gemalto configuration keysecure
//
// swagger:model GemaltoConfigurationKeysecure
type GemaltoConfigurationKeysecure struct {
// credentials
// Required: true
Credentials *GemaltoConfigurationKeysecureCredentials `json:"credentials"`
// endpoint
// Required: true
Endpoint *string `json:"endpoint"`
}
// Validate validates this gemalto configuration keysecure
func (m *GemaltoConfigurationKeysecure) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCredentials(formats); err != nil {
res = append(res, err)
}
if err := m.validateEndpoint(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GemaltoConfigurationKeysecure) validateCredentials(formats strfmt.Registry) error {
if err := validate.Required("keysecure"+"."+"credentials", "body", m.Credentials); err != nil {
return err
}
if m.Credentials != nil {
if err := m.Credentials.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("keysecure" + "." + "credentials")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("keysecure" + "." + "credentials")
}
return err
}
}
return nil
}
func (m *GemaltoConfigurationKeysecure) validateEndpoint(formats strfmt.Registry) error {
if err := validate.Required("keysecure"+"."+"endpoint", "body", m.Endpoint); err != nil {
return err
}
return nil
}
// ContextValidate validate this gemalto configuration keysecure based on the context it is used
func (m *GemaltoConfigurationKeysecure) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateCredentials(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GemaltoConfigurationKeysecure) contextValidateCredentials(ctx context.Context, formats strfmt.Registry) error {
if m.Credentials != nil {
if err := m.Credentials.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("keysecure" + "." + "credentials")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("keysecure" + "." + "credentials")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *GemaltoConfigurationKeysecure) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *GemaltoConfigurationKeysecure) UnmarshalBinary(b []byte) error {
var res GemaltoConfigurationKeysecure
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// GemaltoConfigurationKeysecureCredentials gemalto configuration keysecure credentials
//
// swagger:model GemaltoConfigurationKeysecureCredentials
type GemaltoConfigurationKeysecureCredentials struct {
// domain
// Required: true
Domain *string `json:"domain"`
// retry
Retry int64 `json:"retry,omitempty"`
// token
// Required: true
Token *string `json:"token"`
}
// Validate validates this gemalto configuration keysecure credentials
func (m *GemaltoConfigurationKeysecureCredentials) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateDomain(formats); err != nil {
res = append(res, err)
}
if err := m.validateToken(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GemaltoConfigurationKeysecureCredentials) validateDomain(formats strfmt.Registry) error {
if err := validate.Required("keysecure"+"."+"credentials"+"."+"domain", "body", m.Domain); err != nil {
return err
}
return nil
}
func (m *GemaltoConfigurationKeysecureCredentials) validateToken(formats strfmt.Registry) error {
if err := validate.Required("keysecure"+"."+"credentials"+"."+"token", "body", m.Token); err != nil {
return err
}
return nil
}
// ContextValidate validates this gemalto configuration keysecure credentials based on context it is used
func (m *GemaltoConfigurationKeysecureCredentials) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *GemaltoConfigurationKeysecureCredentials) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *GemaltoConfigurationKeysecureCredentials) UnmarshalBinary(b []byte) error {
var res GemaltoConfigurationKeysecureCredentials
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,309 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// GemaltoConfigurationResponse gemalto configuration response
//
// swagger:model gemaltoConfigurationResponse
type GemaltoConfigurationResponse struct {
// keysecure
// Required: true
Keysecure *GemaltoConfigurationResponseKeysecure `json:"keysecure"`
}
// Validate validates this gemalto configuration response
func (m *GemaltoConfigurationResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateKeysecure(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GemaltoConfigurationResponse) validateKeysecure(formats strfmt.Registry) error {
if err := validate.Required("keysecure", "body", m.Keysecure); err != nil {
return err
}
if m.Keysecure != nil {
if err := m.Keysecure.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("keysecure")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("keysecure")
}
return err
}
}
return nil
}
// ContextValidate validate this gemalto configuration response based on the context it is used
func (m *GemaltoConfigurationResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateKeysecure(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GemaltoConfigurationResponse) contextValidateKeysecure(ctx context.Context, formats strfmt.Registry) error {
if m.Keysecure != nil {
if err := m.Keysecure.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("keysecure")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("keysecure")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *GemaltoConfigurationResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *GemaltoConfigurationResponse) UnmarshalBinary(b []byte) error {
var res GemaltoConfigurationResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// GemaltoConfigurationResponseKeysecure gemalto configuration response keysecure
//
// swagger:model GemaltoConfigurationResponseKeysecure
type GemaltoConfigurationResponseKeysecure struct {
// credentials
// Required: true
Credentials *GemaltoConfigurationResponseKeysecureCredentials `json:"credentials"`
// endpoint
// Required: true
Endpoint *string `json:"endpoint"`
}
// Validate validates this gemalto configuration response keysecure
func (m *GemaltoConfigurationResponseKeysecure) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCredentials(formats); err != nil {
res = append(res, err)
}
if err := m.validateEndpoint(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GemaltoConfigurationResponseKeysecure) validateCredentials(formats strfmt.Registry) error {
if err := validate.Required("keysecure"+"."+"credentials", "body", m.Credentials); err != nil {
return err
}
if m.Credentials != nil {
if err := m.Credentials.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("keysecure" + "." + "credentials")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("keysecure" + "." + "credentials")
}
return err
}
}
return nil
}
func (m *GemaltoConfigurationResponseKeysecure) validateEndpoint(formats strfmt.Registry) error {
if err := validate.Required("keysecure"+"."+"endpoint", "body", m.Endpoint); err != nil {
return err
}
return nil
}
// ContextValidate validate this gemalto configuration response keysecure based on the context it is used
func (m *GemaltoConfigurationResponseKeysecure) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateCredentials(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GemaltoConfigurationResponseKeysecure) contextValidateCredentials(ctx context.Context, formats strfmt.Registry) error {
if m.Credentials != nil {
if err := m.Credentials.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("keysecure" + "." + "credentials")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("keysecure" + "." + "credentials")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *GemaltoConfigurationResponseKeysecure) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *GemaltoConfigurationResponseKeysecure) UnmarshalBinary(b []byte) error {
var res GemaltoConfigurationResponseKeysecure
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// GemaltoConfigurationResponseKeysecureCredentials gemalto configuration response keysecure credentials
//
// swagger:model GemaltoConfigurationResponseKeysecureCredentials
type GemaltoConfigurationResponseKeysecureCredentials struct {
// domain
// Required: true
Domain *string `json:"domain"`
// retry
Retry int64 `json:"retry,omitempty"`
// token
// Required: true
Token *string `json:"token"`
}
// Validate validates this gemalto configuration response keysecure credentials
func (m *GemaltoConfigurationResponseKeysecureCredentials) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateDomain(formats); err != nil {
res = append(res, err)
}
if err := m.validateToken(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GemaltoConfigurationResponseKeysecureCredentials) validateDomain(formats strfmt.Registry) error {
if err := validate.Required("keysecure"+"."+"credentials"+"."+"domain", "body", m.Domain); err != nil {
return err
}
return nil
}
func (m *GemaltoConfigurationResponseKeysecureCredentials) validateToken(formats strfmt.Registry) error {
if err := validate.Required("keysecure"+"."+"credentials"+"."+"token", "body", m.Token); err != nil {
return err
}
return nil
}
// ContextValidate validates this gemalto configuration response keysecure credentials based on context it is used
func (m *GemaltoConfigurationResponseKeysecureCredentials) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *GemaltoConfigurationResponseKeysecureCredentials) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *GemaltoConfigurationResponseKeysecureCredentials) UnmarshalBinary(b []byte) error {
var res GemaltoConfigurationResponseKeysecureCredentials
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,133 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// GetDirectPVDriveListResponse get direct p v drive list response
//
// swagger:model getDirectPVDriveListResponse
type GetDirectPVDriveListResponse struct {
// drives
Drives []*DirectPVDriveInfo `json:"drives"`
}
// 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 {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GetDirectPVDriveListResponse) validateDrives(formats strfmt.Registry) error {
if swag.IsZero(m.Drives) { // not required
return nil
}
for i := 0; i < len(m.Drives); i++ {
if swag.IsZero(m.Drives[i]) { // not required
continue
}
if m.Drives[i] != nil {
if err := m.Drives[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("drives" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("drives" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// 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 {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GetDirectPVDriveListResponse) contextValidateDrives(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Drives); i++ {
if m.Drives[i] != nil {
if err := m.Drives[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("drives" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("drives" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *GetDirectPVDriveListResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *GetDirectPVDriveListResponse) UnmarshalBinary(b []byte) error {
var res GetDirectPVDriveListResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,133 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// GetDirectPVVolumeListResponse get direct p v volume list response
//
// swagger:model getDirectPVVolumeListResponse
type GetDirectPVVolumeListResponse struct {
// volumes
Volumes []*DirectPVVolumeInfo `json:"volumes"`
}
// 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 {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GetDirectPVVolumeListResponse) validateVolumes(formats strfmt.Registry) error {
if swag.IsZero(m.Volumes) { // not required
return nil
}
for i := 0; i < len(m.Volumes); i++ {
if swag.IsZero(m.Volumes[i]) { // not required
continue
}
if m.Volumes[i] != nil {
if err := m.Volumes[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("volumes" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("volumes" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// 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 {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GetDirectPVVolumeListResponse) contextValidateVolumes(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Volumes); i++ {
if m.Volumes[i] != nil {
if err := m.Volumes[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("volumes" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("volumes" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *GetDirectPVVolumeListResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *GetDirectPVVolumeListResponse) UnmarshalBinary(b []byte) error {
var res GetDirectPVVolumeListResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,512 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// IdpConfiguration idp configuration
//
// swagger:model idpConfiguration
type IdpConfiguration struct {
// active directory
ActiveDirectory *IdpConfigurationActiveDirectory `json:"active_directory,omitempty"`
// keys
Keys []*IdpConfigurationKeysItems0 `json:"keys"`
// oidc
Oidc *IdpConfigurationOidc `json:"oidc,omitempty"`
}
// Validate validates this idp configuration
func (m *IdpConfiguration) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateActiveDirectory(formats); err != nil {
res = append(res, err)
}
if err := m.validateKeys(formats); err != nil {
res = append(res, err)
}
if err := m.validateOidc(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *IdpConfiguration) validateActiveDirectory(formats strfmt.Registry) error {
if swag.IsZero(m.ActiveDirectory) { // not required
return nil
}
if m.ActiveDirectory != nil {
if err := m.ActiveDirectory.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("active_directory")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("active_directory")
}
return err
}
}
return nil
}
func (m *IdpConfiguration) validateKeys(formats strfmt.Registry) error {
if swag.IsZero(m.Keys) { // not required
return nil
}
for i := 0; i < len(m.Keys); i++ {
if swag.IsZero(m.Keys[i]) { // not required
continue
}
if m.Keys[i] != nil {
if err := m.Keys[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("keys" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("keys" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *IdpConfiguration) validateOidc(formats strfmt.Registry) error {
if swag.IsZero(m.Oidc) { // not required
return nil
}
if m.Oidc != nil {
if err := m.Oidc.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("oidc")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("oidc")
}
return err
}
}
return nil
}
// ContextValidate validate this idp configuration based on the context it is used
func (m *IdpConfiguration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateActiveDirectory(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateKeys(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateOidc(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *IdpConfiguration) contextValidateActiveDirectory(ctx context.Context, formats strfmt.Registry) error {
if m.ActiveDirectory != nil {
if err := m.ActiveDirectory.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("active_directory")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("active_directory")
}
return err
}
}
return nil
}
func (m *IdpConfiguration) contextValidateKeys(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Keys); i++ {
if m.Keys[i] != nil {
if err := m.Keys[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("keys" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("keys" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *IdpConfiguration) contextValidateOidc(ctx context.Context, formats strfmt.Registry) error {
if m.Oidc != nil {
if err := m.Oidc.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("oidc")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("oidc")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *IdpConfiguration) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *IdpConfiguration) UnmarshalBinary(b []byte) error {
var res IdpConfiguration
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// IdpConfigurationActiveDirectory idp configuration active directory
//
// swagger:model IdpConfigurationActiveDirectory
type IdpConfigurationActiveDirectory struct {
// group search base dn
GroupSearchBaseDn string `json:"group_search_base_dn,omitempty"`
// group search filter
GroupSearchFilter string `json:"group_search_filter,omitempty"`
// lookup bind dn
// Required: true
LookupBindDn *string `json:"lookup_bind_dn"`
// lookup bind password
LookupBindPassword string `json:"lookup_bind_password,omitempty"`
// server insecure
ServerInsecure bool `json:"server_insecure,omitempty"`
// server start tls
ServerStartTLS bool `json:"server_start_tls,omitempty"`
// skip tls verification
SkipTLSVerification bool `json:"skip_tls_verification,omitempty"`
// url
// Required: true
URL *string `json:"url"`
// user dn search base dn
UserDnSearchBaseDn string `json:"user_dn_search_base_dn,omitempty"`
// user dn search filter
UserDnSearchFilter string `json:"user_dn_search_filter,omitempty"`
// user dns
UserDNS []string `json:"user_dns"`
}
// Validate validates this idp configuration active directory
func (m *IdpConfigurationActiveDirectory) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateLookupBindDn(formats); err != nil {
res = append(res, err)
}
if err := m.validateURL(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *IdpConfigurationActiveDirectory) validateLookupBindDn(formats strfmt.Registry) error {
if err := validate.Required("active_directory"+"."+"lookup_bind_dn", "body", m.LookupBindDn); err != nil {
return err
}
return nil
}
func (m *IdpConfigurationActiveDirectory) validateURL(formats strfmt.Registry) error {
if err := validate.Required("active_directory"+"."+"url", "body", m.URL); err != nil {
return err
}
return nil
}
// ContextValidate validates this idp configuration active directory based on context it is used
func (m *IdpConfigurationActiveDirectory) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *IdpConfigurationActiveDirectory) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *IdpConfigurationActiveDirectory) UnmarshalBinary(b []byte) error {
var res IdpConfigurationActiveDirectory
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// IdpConfigurationKeysItems0 idp configuration keys items0
//
// swagger:model IdpConfigurationKeysItems0
type IdpConfigurationKeysItems0 struct {
// access key
// Required: true
AccessKey *string `json:"access_key"`
// secret key
// Required: true
SecretKey *string `json:"secret_key"`
}
// Validate validates this idp configuration keys items0
func (m *IdpConfigurationKeysItems0) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAccessKey(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 *IdpConfigurationKeysItems0) validateAccessKey(formats strfmt.Registry) error {
if err := validate.Required("access_key", "body", m.AccessKey); err != nil {
return err
}
return nil
}
func (m *IdpConfigurationKeysItems0) validateSecretKey(formats strfmt.Registry) error {
if err := validate.Required("secret_key", "body", m.SecretKey); err != nil {
return err
}
return nil
}
// ContextValidate validates this idp configuration keys items0 based on context it is used
func (m *IdpConfigurationKeysItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *IdpConfigurationKeysItems0) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *IdpConfigurationKeysItems0) UnmarshalBinary(b []byte) error {
var res IdpConfigurationKeysItems0
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// IdpConfigurationOidc idp configuration oidc
//
// swagger:model IdpConfigurationOidc
type IdpConfigurationOidc struct {
// callback url
CallbackURL string `json:"callback_url,omitempty"`
// claim name
// Required: true
ClaimName *string `json:"claim_name"`
// client id
// Required: true
ClientID *string `json:"client_id"`
// configuration url
// Required: true
ConfigurationURL *string `json:"configuration_url"`
// scopes
Scopes string `json:"scopes,omitempty"`
// secret id
// Required: true
SecretID *string `json:"secret_id"`
}
// Validate validates this idp configuration oidc
func (m *IdpConfigurationOidc) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateClaimName(formats); err != nil {
res = append(res, err)
}
if err := m.validateClientID(formats); err != nil {
res = append(res, err)
}
if err := m.validateConfigurationURL(formats); err != nil {
res = append(res, err)
}
if err := m.validateSecretID(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *IdpConfigurationOidc) validateClaimName(formats strfmt.Registry) error {
if err := validate.Required("oidc"+"."+"claim_name", "body", m.ClaimName); err != nil {
return err
}
return nil
}
func (m *IdpConfigurationOidc) validateClientID(formats strfmt.Registry) error {
if err := validate.Required("oidc"+"."+"client_id", "body", m.ClientID); err != nil {
return err
}
return nil
}
func (m *IdpConfigurationOidc) validateConfigurationURL(formats strfmt.Registry) error {
if err := validate.Required("oidc"+"."+"configuration_url", "body", m.ConfigurationURL); err != nil {
return err
}
return nil
}
func (m *IdpConfigurationOidc) validateSecretID(formats strfmt.Registry) error {
if err := validate.Required("oidc"+"."+"secret_id", "body", m.SecretID); err != nil {
return err
}
return nil
}
// ContextValidate validates this idp configuration oidc based on context it is used
func (m *IdpConfigurationOidc) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *IdpConfigurationOidc) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *IdpConfigurationOidc) UnmarshalBinary(b []byte) error {
var res IdpConfigurationOidc
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,122 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// ImageRegistry image registry
//
// swagger:model imageRegistry
type ImageRegistry struct {
// password
// Required: true
Password *string `json:"password"`
// registry
// Required: true
Registry *string `json:"registry"`
// username
// Required: true
Username *string `json:"username"`
}
// Validate validates this image registry
func (m *ImageRegistry) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validatePassword(formats); err != nil {
res = append(res, err)
}
if err := m.validateRegistry(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 *ImageRegistry) validatePassword(formats strfmt.Registry) error {
if err := validate.Required("password", "body", m.Password); err != nil {
return err
}
return nil
}
func (m *ImageRegistry) validateRegistry(formats strfmt.Registry) error {
if err := validate.Required("registry", "body", m.Registry); err != nil {
return err
}
return nil
}
func (m *ImageRegistry) validateUsername(formats strfmt.Registry) error {
if err := validate.Required("username", "body", m.Username); err != nil {
return err
}
return nil
}
// ContextValidate validates this image registry based on context it is used
func (m *ImageRegistry) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *ImageRegistry) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ImageRegistry) UnmarshalBinary(b []byte) error {
var res ImageRegistry
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,105 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// KeyPairConfiguration key pair configuration
//
// swagger:model keyPairConfiguration
type KeyPairConfiguration struct {
// crt
// Required: true
Crt *string `json:"crt"`
// key
// Required: true
Key *string `json:"key"`
}
// Validate validates this key pair configuration
func (m *KeyPairConfiguration) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCrt(formats); err != nil {
res = append(res, err)
}
if err := m.validateKey(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *KeyPairConfiguration) validateCrt(formats strfmt.Registry) error {
if err := validate.Required("crt", "body", m.Crt); err != nil {
return err
}
return nil
}
func (m *KeyPairConfiguration) validateKey(formats strfmt.Registry) error {
if err := validate.Required("key", "body", m.Key); err != nil {
return err
}
return nil
}
// ContextValidate validates this key pair configuration based on context it is used
func (m *KeyPairConfiguration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *KeyPairConfiguration) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *KeyPairConfiguration) UnmarshalBinary(b []byte) error {
var res KeyPairConfiguration
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,70 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// Label label
//
// swagger:model label
type Label struct {
// key
Key string `json:"key,omitempty"`
// value
Value string `json:"value,omitempty"`
}
// Validate validates this label
func (m *Label) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this label based on context it is used
func (m *Label) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *Label) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Label) UnmarshalBinary(b []byte) error {
var res Label
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

250
models/ldap_entities.go Normal file
View File

@@ -0,0 +1,250 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// LdapEntities ldap entities
//
// swagger:model ldapEntities
type LdapEntities struct {
// groups
Groups []*LdapGroupPolicyEntity `json:"groups"`
// policies
Policies []*LdapPolicyEntity `json:"policies"`
// timestamp
Timestamp string `json:"timestamp,omitempty"`
// users
Users []*LdapUserPolicyEntity `json:"users"`
}
// Validate validates this ldap entities
func (m *LdapEntities) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateGroups(formats); err != nil {
res = append(res, err)
}
if err := m.validatePolicies(formats); err != nil {
res = append(res, err)
}
if err := m.validateUsers(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *LdapEntities) validateGroups(formats strfmt.Registry) error {
if swag.IsZero(m.Groups) { // not required
return nil
}
for i := 0; i < len(m.Groups); i++ {
if swag.IsZero(m.Groups[i]) { // not required
continue
}
if m.Groups[i] != nil {
if err := m.Groups[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("groups" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("groups" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *LdapEntities) validatePolicies(formats strfmt.Registry) error {
if swag.IsZero(m.Policies) { // not required
return nil
}
for i := 0; i < len(m.Policies); i++ {
if swag.IsZero(m.Policies[i]) { // not required
continue
}
if m.Policies[i] != nil {
if err := m.Policies[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("policies" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("policies" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *LdapEntities) validateUsers(formats strfmt.Registry) error {
if swag.IsZero(m.Users) { // not required
return nil
}
for i := 0; i < len(m.Users); i++ {
if swag.IsZero(m.Users[i]) { // not required
continue
}
if m.Users[i] != nil {
if err := m.Users[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("users" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("users" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this ldap entities based on the context it is used
func (m *LdapEntities) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateGroups(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidatePolicies(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateUsers(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *LdapEntities) contextValidateGroups(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Groups); i++ {
if m.Groups[i] != nil {
if err := m.Groups[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("groups" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("groups" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *LdapEntities) contextValidatePolicies(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Policies); i++ {
if m.Policies[i] != nil {
if err := m.Policies[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("policies" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("policies" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *LdapEntities) contextValidateUsers(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Users); i++ {
if m.Users[i] != nil {
if err := m.Users[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("users" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("users" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *LdapEntities) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *LdapEntities) UnmarshalBinary(b []byte) error {
var res LdapEntities
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -29,27 +29,33 @@ import (
"github.com/go-openapi/swag"
)
// ServiceAccountToken service account token
// LdapEntitiesRequest ldap entities request
//
// swagger:model serviceAccountToken
type ServiceAccountToken struct {
// swagger:model ldapEntitiesRequest
type LdapEntitiesRequest struct {
// expiration seconds
ExpirationSeconds int64 `json:"expirationSeconds,omitempty"`
// groups
Groups []string `json:"groups"`
// policies
Policies []string `json:"policies"`
// users
Users []string `json:"users"`
}
// Validate validates this service account token
func (m *ServiceAccountToken) Validate(formats strfmt.Registry) error {
// Validate validates this ldap entities request
func (m *LdapEntitiesRequest) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this service account token based on context it is used
func (m *ServiceAccountToken) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
// ContextValidate validates this ldap entities request based on context it is used
func (m *LdapEntitiesRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *ServiceAccountToken) MarshalBinary() ([]byte, error) {
func (m *LdapEntitiesRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@@ -57,8 +63,8 @@ func (m *ServiceAccountToken) MarshalBinary() ([]byte, error) {
}
// UnmarshalBinary interface implementation
func (m *ServiceAccountToken) UnmarshalBinary(b []byte) error {
var res ServiceAccountToken
func (m *LdapEntitiesRequest) UnmarshalBinary(b []byte) error {
var res LdapEntitiesRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}

View File

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

View File

@@ -29,36 +29,33 @@ import (
"github.com/go-openapi/swag"
)
// Mount mount
// LdapPolicyEntity ldap policy entity
//
// swagger:model mount
type Mount struct {
// swagger:model ldapPolicyEntity
type LdapPolicyEntity struct {
// mount path
MountPath string `json:"mountPath,omitempty"`
// groups
Groups []string `json:"groups"`
// name
Name string `json:"name,omitempty"`
// policy
Policy string `json:"policy,omitempty"`
// read only
ReadOnly bool `json:"readOnly,omitempty"`
// sub path
SubPath string `json:"subPath,omitempty"`
// users
Users []string `json:"users"`
}
// Validate validates this mount
func (m *Mount) Validate(formats strfmt.Registry) error {
// Validate validates this ldap policy entity
func (m *LdapPolicyEntity) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this mount based on context it is used
func (m *Mount) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
// ContextValidate validates this ldap policy entity based on context it is used
func (m *LdapPolicyEntity) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *Mount) MarshalBinary() ([]byte, error) {
func (m *LdapPolicyEntity) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@@ -66,8 +63,8 @@ func (m *Mount) MarshalBinary() ([]byte, error) {
}
// UnmarshalBinary interface implementation
func (m *Mount) UnmarshalBinary(b []byte) error {
var res Mount
func (m *LdapPolicyEntity) UnmarshalBinary(b []byte) error {
var res LdapPolicyEntity
if err := swag.ReadJSON(b, &res); err != nil {
return err
}

View File

@@ -29,27 +29,30 @@ import (
"github.com/go-openapi/swag"
)
// OperatorSubnetAPIKey operator subnet API key
// LdapUserPolicyEntity ldap user policy entity
//
// swagger:model operatorSubnetAPIKey
type OperatorSubnetAPIKey struct {
// swagger:model ldapUserPolicyEntity
type LdapUserPolicyEntity struct {
// api key
APIKey string `json:"apiKey,omitempty"`
// policies
Policies []string `json:"policies"`
// user
User string `json:"user,omitempty"`
}
// Validate validates this operator subnet API key
func (m *OperatorSubnetAPIKey) Validate(formats strfmt.Registry) error {
// Validate validates this ldap user policy entity
func (m *LdapUserPolicyEntity) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this operator subnet API key based on context it is used
func (m *OperatorSubnetAPIKey) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
// ContextValidate validates this ldap user policy entity based on context it is used
func (m *LdapUserPolicyEntity) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *OperatorSubnetAPIKey) MarshalBinary() ([]byte, error) {
func (m *LdapUserPolicyEntity) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@@ -57,8 +60,8 @@ func (m *OperatorSubnetAPIKey) MarshalBinary() ([]byte, error) {
}
// UnmarshalBinary interface implementation
func (m *OperatorSubnetAPIKey) UnmarshalBinary(b []byte) error {
var res OperatorSubnetAPIKey
func (m *LdapUserPolicyEntity) UnmarshalBinary(b []byte) error {
var res LdapUserPolicyEntity
if err := swag.ReadJSON(b, &res); err != nil {
return err
}

View File

@@ -1,133 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// ListPVCsResponse list p v cs response
//
// swagger:model listPVCsResponse
type ListPVCsResponse struct {
// pvcs
Pvcs []*PvcsListResponse `json:"pvcs"`
}
// Validate validates this list p v cs response
func (m *ListPVCsResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validatePvcs(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *ListPVCsResponse) validatePvcs(formats strfmt.Registry) error {
if swag.IsZero(m.Pvcs) { // not required
return nil
}
for i := 0; i < len(m.Pvcs); i++ {
if swag.IsZero(m.Pvcs[i]) { // not required
continue
}
if m.Pvcs[i] != nil {
if err := m.Pvcs[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("pvcs" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("pvcs" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this list p v cs response based on the context it is used
func (m *ListPVCsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidatePvcs(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *ListPVCsResponse) contextValidatePvcs(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Pvcs); i++ {
if m.Pvcs[i] != nil {
if err := m.Pvcs[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("pvcs" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("pvcs" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *ListPVCsResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ListPVCsResponse) UnmarshalBinary(b []byte) error {
var res ListPVCsResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,136 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// ListTenantsResponse list tenants response
//
// swagger:model listTenantsResponse
type ListTenantsResponse struct {
// list of resulting tenants
Tenants []*TenantList `json:"tenants"`
// number of tenants accessible to tenant user
Total int64 `json:"total,omitempty"`
}
// Validate validates this list tenants response
func (m *ListTenantsResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateTenants(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *ListTenantsResponse) validateTenants(formats strfmt.Registry) error {
if swag.IsZero(m.Tenants) { // not required
return nil
}
for i := 0; i < len(m.Tenants); i++ {
if swag.IsZero(m.Tenants[i]) { // not required
continue
}
if m.Tenants[i] != nil {
if err := m.Tenants[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tenants" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("tenants" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this list tenants response based on the context it is used
func (m *ListTenantsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateTenants(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *ListTenantsResponse) contextValidateTenants(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Tenants); i++ {
if m.Tenants[i] != nil {
if err := m.Tenants[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tenants" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("tenants" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *ListTenantsResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ListTenantsResponse) UnmarshalBinary(b []byte) error {
var res ListTenantsResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,182 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// LogSearchConfiguration log search configuration
//
// swagger:model logSearchConfiguration
type LogSearchConfiguration struct {
// image
Image string `json:"image,omitempty"`
// postgres image
PostgresImage string `json:"postgres_image,omitempty"`
// postgres init image
PostgresInitImage string `json:"postgres_init_image,omitempty"`
// postgres security context
PostgresSecurityContext *SecurityContext `json:"postgres_securityContext,omitempty"`
// security context
SecurityContext *SecurityContext `json:"securityContext,omitempty"`
// storage class
StorageClass string `json:"storageClass,omitempty"`
// storage size
StorageSize *float64 `json:"storageSize,omitempty"`
}
// Validate validates this log search configuration
func (m *LogSearchConfiguration) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validatePostgresSecurityContext(formats); err != nil {
res = append(res, err)
}
if err := m.validateSecurityContext(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *LogSearchConfiguration) validatePostgresSecurityContext(formats strfmt.Registry) error {
if swag.IsZero(m.PostgresSecurityContext) { // not required
return nil
}
if m.PostgresSecurityContext != nil {
if err := m.PostgresSecurityContext.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("postgres_securityContext")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("postgres_securityContext")
}
return err
}
}
return nil
}
func (m *LogSearchConfiguration) 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 log search configuration based on the context it is used
func (m *LogSearchConfiguration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidatePostgresSecurityContext(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateSecurityContext(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *LogSearchConfiguration) contextValidatePostgresSecurityContext(ctx context.Context, formats strfmt.Registry) error {
if m.PostgresSecurityContext != nil {
if err := m.PostgresSecurityContext.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("postgres_securityContext")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("postgres_securityContext")
}
return err
}
}
return nil
}
func (m *LogSearchConfiguration) 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 *LogSearchConfiguration) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *LogSearchConfiguration) UnmarshalBinary(b []byte) error {
var res LogSearchConfiguration
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -38,8 +38,8 @@ import (
// swagger:model loginDetails
type LoginDetails struct {
// is direct p v
IsDirectPV bool `json:"isDirectPV,omitempty"`
// animated login
AnimatedLogin bool `json:"animatedLogin,omitempty"`
// is k8 s
IsK8S bool `json:"isK8S,omitempty"`

View File

@@ -1,88 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// LoginOperatorRequest login operator request
//
// swagger:model loginOperatorRequest
type LoginOperatorRequest struct {
// jwt
// Required: true
Jwt *string `json:"jwt"`
}
// Validate validates this login operator request
func (m *LoginOperatorRequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateJwt(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *LoginOperatorRequest) validateJwt(formats strfmt.Registry) error {
if err := validate.Required("jwt", "body", m.Jwt); err != nil {
return err
}
return nil
}
// ContextValidate validates this login operator request based on context it is used
func (m *LoginOperatorRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *LoginOperatorRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *LoginOperatorRequest) UnmarshalBinary(b []byte) error {
var res LoginOperatorRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -50,7 +50,7 @@ type MakeBucketRequest struct {
Retention *PutBucketRetentionRequest `json:"retention,omitempty"`
// versioning
Versioning bool `json:"versioning,omitempty"`
Versioning *SetBucketVersioning `json:"versioning,omitempty"`
}
// Validate validates this make bucket request
@@ -69,6 +69,10 @@ func (m *MakeBucketRequest) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
if err := m.validateVersioning(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
@@ -122,6 +126,25 @@ func (m *MakeBucketRequest) validateRetention(formats strfmt.Registry) error {
return nil
}
func (m *MakeBucketRequest) validateVersioning(formats strfmt.Registry) error {
if swag.IsZero(m.Versioning) { // not required
return nil
}
if m.Versioning != nil {
if err := m.Versioning.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("versioning")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("versioning")
}
return err
}
}
return nil
}
// ContextValidate validate this make bucket request based on the context it is used
func (m *MakeBucketRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
@@ -134,6 +157,10 @@ func (m *MakeBucketRequest) ContextValidate(ctx context.Context, formats strfmt.
res = append(res, err)
}
if err := m.contextValidateVersioning(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
@@ -172,6 +199,22 @@ func (m *MakeBucketRequest) contextValidateRetention(ctx context.Context, format
return nil
}
func (m *MakeBucketRequest) contextValidateVersioning(ctx context.Context, formats strfmt.Registry) error {
if m.Versioning != nil {
if err := m.Versioning.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("versioning")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("versioning")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *MakeBucketRequest) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -29,27 +29,27 @@ import (
"github.com/go-openapi/swag"
)
// DeleteTenantRequest delete tenant request
// MakeBucketsResponse make buckets response
//
// swagger:model deleteTenantRequest
type DeleteTenantRequest struct {
// swagger:model makeBucketsResponse
type MakeBucketsResponse struct {
// delete pvcs
DeletePvcs bool `json:"delete_pvcs,omitempty"`
// bucket name
BucketName string `json:"bucketName,omitempty"`
}
// Validate validates this delete tenant request
func (m *DeleteTenantRequest) Validate(formats strfmt.Registry) error {
// Validate validates this make buckets response
func (m *MakeBucketsResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this delete tenant request based on context it is used
func (m *DeleteTenantRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
// ContextValidate validates this make buckets response based on context it is used
func (m *MakeBucketsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *DeleteTenantRequest) MarshalBinary() ([]byte, error) {
func (m *MakeBucketsResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@@ -57,8 +57,8 @@ func (m *DeleteTenantRequest) MarshalBinary() ([]byte, error) {
}
// UnmarshalBinary interface implementation
func (m *DeleteTenantRequest) UnmarshalBinary(b []byte) error {
var res DeleteTenantRequest
func (m *MakeBucketsResponse) UnmarshalBinary(b []byte) error {
var res MakeBucketsResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}

View File

@@ -1,67 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// MaxAllocatableMemResponse max allocatable mem response
//
// swagger:model maxAllocatableMemResponse
type MaxAllocatableMemResponse struct {
// max memory
MaxMemory int64 `json:"max_memory,omitempty"`
}
// Validate validates this max allocatable mem response
func (m *MaxAllocatableMemResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this max allocatable mem response based on context it is used
func (m *MaxAllocatableMemResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *MaxAllocatableMemResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *MaxAllocatableMemResponse) UnmarshalBinary(b []byte) error {
var res MaxAllocatableMemResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,73 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// MetadataFields metadata fields
//
// swagger:model metadataFields
type MetadataFields struct {
// annotations
Annotations map[string]string `json:"annotations,omitempty"`
// labels
Labels map[string]string `json:"labels,omitempty"`
// node selector
NodeSelector map[string]string `json:"node_selector,omitempty"`
}
// Validate validates this metadata fields
func (m *MetadataFields) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this metadata fields based on context it is used
func (m *MetadataFields) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *MetadataFields) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *MetadataFields) UnmarshalBinary(b []byte) error {
var res MetadataFields
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,70 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// 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

@@ -1,88 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// Namespace namespace
//
// swagger:model namespace
type Namespace struct {
// name
// Required: true
Name *string `json:"name"`
}
// Validate validates this namespace
func (m *Namespace) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateName(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Namespace) validateName(formats strfmt.Registry) error {
if err := validate.Required("name", "body", m.Name); err != nil {
return err
}
return nil
}
// ContextValidate validates this namespace based on context it is used
func (m *Namespace) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *Namespace) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Namespace) UnmarshalBinary(b []byte) error {
var res Namespace
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,44 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
)
// NodeLabels node labels
//
// swagger:model nodeLabels
type NodeLabels map[string][]string
// Validate validates this node labels
func (m NodeLabels) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this node labels based on context it is used
func (m NodeLabels) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}

View File

@@ -1,70 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// NodeMaxAllocatableResources node max allocatable resources
//
// swagger:model nodeMaxAllocatableResources
type NodeMaxAllocatableResources struct {
// max allocatable cpu
MaxAllocatableCPU int64 `json:"max_allocatable_cpu,omitempty"`
// max allocatable mem
MaxAllocatableMem int64 `json:"max_allocatable_mem,omitempty"`
}
// Validate validates this node max allocatable resources
func (m *NodeMaxAllocatableResources) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this node max allocatable resources based on context it is used
func (m *NodeMaxAllocatableResources) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *NodeMaxAllocatableResources) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *NodeMaxAllocatableResources) UnmarshalBinary(b []byte) error {
var res NodeMaxAllocatableResources
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -1,70 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// NodeSelector node selector
//
// swagger:model nodeSelector
type NodeSelector struct {
// key
Key string `json:"key,omitempty"`
// value
Value string `json:"value,omitempty"`
}
// Validate validates this node selector
func (m *NodeSelector) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this node selector based on context it is used
func (m *NodeSelector) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *NodeSelector) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *NodeSelector) UnmarshalBinary(b []byte) error {
var res NodeSelector
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

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