Compare commits

..

287 Commits

Author SHA1 Message Date
Cesar N
74030aa067 Release 0.42.0 (#3148) 2023-12-06 16:04:01 -08:00
Cesar N
07b8c745e6 Remove prints from delete handlers (#3147) 2023-12-06 16:59:10 -06:00
Prakash Senthil Vel
6767bfa2d2 add encoded filename as part of delete api url (#3141) 2023-12-06 14:28:46 -08:00
Prakash Senthil Vel
607d94fef4 add encoded filename as part of upload url (#3140) 2023-12-06 14:14:25 -08:00
Alex
83b060ef94 Updated govuln check to use latest version (#3146)
Updated go vuln check to use latest version

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-12-06 15:13:22 -06:00
dependabot[bot]
cb14cb94ce Bump @adobe/css-tools from 4.3.1 to 4.3.2 in /portal-ui (#3139) 2023-12-06 11:31:55 -06:00
Daniel Valdivia
2b9de49fbe Upgrade to Go 1.21 (#3142)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2023-12-01 18:23:24 -06:00
Alex
290f273bdf Updated mds version to v0.13.0 (#3138) 2023-11-28 17:11:54 -08:00
Prakash Senthil Vel
7b43779fb0 Fix share option should not be enabled for a prefix (#3135) 2023-11-28 18:45:24 -06:00
Prakash Senthil Vel
924c38faa6 Fix actions on a del marker in object list view (#3134) 2023-11-23 22:32:08 -06:00
Prakash Senthil Vel
e4d5f9610e access keys ui details improvement and edit (#3116) 2023-11-21 22:08:23 -06:00
jinapurapu
04e9cb0ac8 Enable Create Path button on BrowserBreadcrumbs if User can create subPath (#3131) 2023-11-17 13:21:07 -06:00
jinapurapu
da53daff37 Add UI to select number of non-current versions subject to ILM expiry rule (#3088) 2023-11-16 13:34:04 -06:00
Alex
8c26eff2c1 Added matchMedia mock function for Testing purposes (#3130)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-11-15 15:51:55 -06:00
Alex
044c265423 Enabled Dark Mode in Console (#3129)
- Dark mode will be tied to system settings if not set
- Dark mode will be stored in Application storage once set

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-11-15 13:33:05 -06:00
jinapurapu
0053658d5d Added OIDC docs and blog to helpMenu (#3127) 2023-11-15 09:30:39 -06:00
Alex
99cf3b378f Removed MUI dependencies from console (#3126)
- Updated DateTime Selector
- Updated last dependency functions
- Removed mui theming tools

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-11-14 10:22:47 -06:00
jinapurapu
78293eab62 Added new blog and video content to HelpMenu (#3124) 2023-11-13 12:11:55 -06:00
Cesar N
1a84be5782 Ignore server file from swagger-gen make command (#3123) 2023-11-06 14:01:02 -08:00
Alex
178f82b675 Release v0.41.0 (#3121)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-11-02 16:30:50 -07:00
Alex
ec5fbbcd1e Updated Login Error Callback page to mds (#3120)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-11-01 15:21:24 -06:00
Alex
78164054d4 Updated HelpMenu components to use only mds subcomponents (#3119)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-11-01 09:54:14 -06:00
Alex
6d5d11d5b4 Updated common bars (#3118)
- Updated common Loading Bars
- Updated Restart MinIO notification bar

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-11-01 09:53:42 -06:00
nreisingercres
9e3b93d385 Fix days selector to ignore daylight savings (#3117) 2023-10-31 14:30:10 -06:00
jiuker
d77cf93193 update the madmin-go dep (#3115) 2023-10-31 11:03:26 -06:00
Alex
2cca3f3722 Updated Logs Page to use mds components (#3114)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-10-31 10:12:23 -06:00
Anis Eleuch
36d96a1791 Support resolving of listen addrs to multiple IPv4/IPv6 (#3100)
If you specify --console-address "myaddress:9001" while myaddress can be
resolved to one IPv4 address and another IPv6 address, Console ignores
the IPv6 address. This commit fixes that.

Authored-by: Anis Elleuch <anis@min.io>
2023-10-30 17:47:16 -07:00
Alex
82e34a5df2 Replaced MenuDropdown components with mds variables (#3113)
- Replaced menu dropdown in Files Button
- Input Unit Menu dropdown replacement
- Migrated Download Widget dropdown

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-10-30 16:46:22 -06:00
Alex
7b83f4b1dc Restored ENV var display support in Console Configuration pages. (#3112)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-10-30 14:38:33 -06:00
Andreas Auernhammer
7d9910d1ca update docker file to ubi9 base image (#3109)
This commit improves and updates the docker file
to the UBI 9 base image.

Signed-off-by: Andreas Auernhammer <github@aead.dev>
2023-10-30 13:20:43 -06:00
Alex
7a63f6da56 Migrated Object Manager components to mds (#3108) 2023-10-27 06:36:01 -07:00
Alex
0043833f36 Migrated Date Selectors & Chart Tooltips styles (#3107)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-10-26 22:41:40 -06:00
Alex
3ad3bccadb Autocomplete component replacement (#3104)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-10-26 11:54:34 -06:00
Alex
39e94c890e Replaced Notification components with mds variants (#3103)
Replaced Notification components for mds variants

- Updated Warning Message components
- Replaced Snackbar component

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-10-25 11:38:35 -06:00
Alex
701039454a MDS Console improvements (#3102)
- Removed mui badge component
- Updated icons screen
- Migrated Wizard Component
- Improved modals styles
- Updated KMS Status page

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-10-24 14:09:22 -06:00
Alex
ec77a03d7c Replace missing icons from mui (#3101)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-10-24 09:28:33 -07:00
Alex
8dbad84a58 Improved error handling in Object Browser (#3097)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-10-23 10:17:44 -06:00
Cesar N
1767a37162 Add share link exp api (#3095) 2023-10-19 16:03:14 -05:00
Javier Adriel
622c3a067a Add global params for limit and offset (#3096) 2023-10-19 15:38:31 -05:00
Cesar N
4389548b64 Update swagger generated files with latest swagger version (#3094) 2023-10-19 12:49:38 -07:00
Alex
8cb0f1e558 Replaced mui accordion with mds component (#3089)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-10-17 10:32:23 -05:00
Alex
faafb77c73 Updated mds version to v0.9.6 (#3090)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-10-16 18:17:05 -05:00
Alex
0ecd1c73c1 Updated styling methods to remove mui and replace it with mds (#3085)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-10-13 12:02:29 -05:00
Shubhendu
88bf40f9a6 Use the new golang version 1.21.3 (#3087)
Signed-off-by: Shubhendu Ram Tripathi <shubhendu@minio.io>
2023-10-12 11:50:15 -05:00
dependabot[bot]
a025163b34 Bump golang.org/x/net from 0.15.0 to 0.17.0 (#3086) 2023-10-12 11:50:00 -05:00
Alex
07c80462b7 mui Grid component replacement (#3084)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-10-11 13:59:04 -07:00
Alex
79ac2277d4 Migrated mui Box to use mds component (#3082)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-10-11 13:58:33 -07:00
Alex
1c27bee9d0 Removed FormSwitchWrapper component (#3081)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-10-10 12:29:24 -05:00
Alex
56dc58b0b8 Components cleanup (#3079)
Removed old component wrappers and replaced them with their mds equivalent components:

- InputBoxWrapper
- CommentBoxWrapper
- CheckboxWrapper
- PredefinedList

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-10-09 14:41:23 -05:00
Adrian Najera
4018addd79 Fix: cache clientIP in GetConsoleHTTPClient (#3056) 2023-10-09 14:40:54 -05:00
jinapurapu
429dfb4314 Add HelpTips to Console (#3054) 2023-10-06 15:38:55 -05:00
Alex
1d7bb0bb2b Removed mui support from PasswordSelector component (#3078)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-10-06 14:09:44 -05:00
Alex
476eb673bb Updated FileSelector and removed old component (#3076)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-10-06 09:12:13 -07:00
Alex
71681b710c Removed deprecated components and replaced them with mds ones (#3077)
- SectionTitle
- AButton
- ScreenTitle

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-10-06 09:11:48 -07:00
Alex
fb02a7da06 Updated README file (#3074)
Updated README file

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-10-05 12:31:06 -05:00
MinIO Bot
5fdc341138 mds-released-v0.9.3 (#3073) 2023-10-04 19:17:16 -05:00
Alex
15de6caf75 Fixed Failing integration test (#3071)
Added a wait time after bucket creation to list the new buckets list
2023-10-04 09:09:55 -07:00
Alex
77bc2d5006 Updated Playwright tests (#3070)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-10-03 20:09:33 -05:00
Alex
972f5fca9d Release v0.40.0 (#3069) 2023-10-03 12:17:05 -07:00
Alex
083314ee2d Object Browser Refactor (#3066)
- Refactored navigation to be handled only with URL
- Refactored & simplified websocket
- Updated components to use mds
- Fixed an issue with Anonymous access and file selection
- Fixed an issue with anonymous access and download selection click
- Fixed an issue with object details selection on root path from a bucket
- Simplified reducer

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-10-02 18:02:03 -05:00
Alex
078ce0e546 Updated console dependencies (#3068)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-10-02 15:52:34 -05:00
MinIO Bot
9beca2c226 mds-released-v0.9.2 (#3060) 2023-09-25 11:49:51 -06:00
Prakash Senthil Vel
451f23ae24 Improve change password user experience (#3058) 2023-09-22 13:51:03 -06:00
Alex
300ebfa19f Updated OpenID UX (#3050)
- Display ENV variables set in configuration
- Removed Password empty placeholders
- Added notification to re-enter password when modifying OpenID configuration

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-09-22 13:50:41 -06:00
Alex
1ce2846c95 AuditLogs page fixes (#3059)
- Added support to endDate
- Converted dates to UTC as required by AuditLogs API

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-09-22 09:49:36 -06:00
Alex
7fb8c11a9d Added support for Scanner event type (#3055)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-09-21 13:14:54 -06:00
Prakash Senthil Vel
e7993c2d1b Fix: handle crash in error handling of access keys page (#3051) 2023-09-20 20:45:51 -06:00
Alex
3e93f7ff88 Release v0.39.0 (#3049)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-09-14 23:43:58 -07:00
Alex
f0580956db Improvements to LDAP Configuration page (#3047)
- Fixed LDAP Enabled / Disabled calculation
- Removed Password Label from main page to avoid confusion
- Display LDAP ENV variables in case of configured

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-09-14 17:54:59 -06:00
Pedro Juarez
65b0bab26d Load the available CA in logout API (#3044) 2023-09-13 15:26:48 -06:00
Harshavardhana
a559421293 migrate and upgrade all dependencies (#3046) 2023-09-13 13:55:47 -06:00
Cesar N
6ef35c26a4 Remove unused check-version api (#3045) 2023-09-13 13:55:06 -06:00
Alex
8a918324aa Added CONSOLE_PROMETHEUS_AUTH_TOKEN flag support (#3043)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-09-13 12:02:13 -06:00
Alex
d30c0c8cbb Migrated Metrics pages and components to mds (#3042)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-09-13 12:01:43 -06:00
Alex
1697c826c0 Fixed an issue while deleting objects with similar prefixes (#3035)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-09-12 10:05:41 -06:00
Cesar N
b378b8c8ef Fix regression on login path when using redirect url (#3038) 2023-09-11 14:25:34 -07:00
MinIO Bot
2c42d7ff81 mds-released-v0.9.1 (#3041) 2023-09-11 09:58:23 -06:00
Cesar N
e1f36ee54a Upgrade go version in git workflows to 1.21.1 (#3039) 2023-09-07 17:29:22 -06:00
Alex
698f72f828 Migrated Register page components to mds (#3034)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-09-07 11:48:29 -06:00
jinapurapu
8dd94f5336 Moved EditBucketReplication to screen (#3037) 2023-09-06 17:24:07 -06:00
Alex
1dc21b9a21 Removed TableWrapper (#3032)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-09-05 11:06:33 -06:00
Alex
248215cc77 Updated Changelog for v0.38.0 (#3031)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-09-04 11:44:50 -07:00
Alex
a6eee73c11 Release v0.38.0 (#3029)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-09-02 09:10:10 -07:00
Anis Eleuch
50d6a39312 idp: Use 900 seconds as minimum expiry without returning an error (#3022)
Do not bother the user with an error if the IDP expiry is less than
900 seconds, since the S3 spec sets a minimum of 900 seconds for STS
expiration, use that minimum duration instead of returning an error

Co-authored-by: Anis Elleuch <anis@min.io>
Co-authored-by: Alex <33497058+bexsoft@users.noreply.github.com>
2023-09-02 07:50:45 -07:00
Aditya Manthramurthy
467b6b9bcb Use github.com/minio/pkg/v2 (#3027) 2023-09-01 17:29:07 -06:00
Alex
6e6246797c Renamed Subnet strings to SUBNET (#3026)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-09-01 15:10:12 -07:00
Alex
f8e4f747f5 Migrated Components loader to mds (#3025)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-09-01 12:06:33 -06:00
Alex
9acd49fcc6 Updated console dependencies (#3024)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-08-31 09:27:48 -06:00
Alex
636d12d43f Replaced LinearProgress as loader in favor of ProgressBar from mds (#3020)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-08-31 09:27:29 -06:00
MinIO Bot
5e9383de95 mds-released-v0.9.0 (#3021) 2023-08-30 12:38:11 -06:00
Kaan Kabalak
4863af863e Update minimum Standard plan capacity on License page (#3023) 2023-08-30 11:28:42 -06:00
Martin
b6d4c62edd Fix oauth2Config.Exchange error reporting (#3003) 2023-08-28 15:35:53 -07:00
Alex
bf733f3822 Migrated Heal and Watch pages to mds (#3016)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-08-25 09:53:02 -06:00
Alex
bbf4027418 Migrated Speedtest components to mds (#3015)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-08-24 17:08:16 -06:00
Alex
dbffc5fc22 Migrated Site Replication Pages (#3011)
- Improved & Simplified UI elements

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-08-24 17:07:58 -06:00
Cesar Celis Hernandez
f4a9420002 To properly show error in AddAccessRule.tsx (#3008)
Fixing the shown errors
2023-08-24 06:53:32 -06:00
Alex
657854bd29 Updated generated stylesheet (#3013) 2023-08-23 15:31:22 -06:00
MinIO Bot
cdc9e7d921 mds-released-v0.8.6 (#3012) 2023-08-23 15:21:36 -06:00
Alex
b125121ac8 Migrated available mds components in Tiers Page (#3007)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-08-21 22:30:04 -06:00
Daniel Valdivia
0c480dd5ec Handle errors for Set Policy for Access keys (#3005)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2023-08-21 12:00:45 -06:00
MinIO Bot
c07b8dcf73 mds-released-v0.8.4 (#3002)
Co-authored-by: MinIO Bot <minio.bot@minio.io>
2023-08-21 09:25:24 -06:00
Daniel Valdivia
912a4b216f Rename Error to ApiError to avoid ambiguity (#2954)
Rename Error to ApiError to avoide ambiguity and remove redundant status code

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2023-08-16 14:18:08 -07:00
Prakash Senthil Vel
e7fb205c31 show service account status and expiry in ui (#2992) 2023-08-16 11:55:07 -06:00
Alex
a2ba20e12f Release v0.37.0 (#3000) 2023-08-16 10:03:02 -07:00
Alex
f515dd82fe Migrated Trace page to mds (#2996)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-08-16 10:23:01 -06:00
Alex
61d3193c41 Migrated available mds components in Logs Page (#2998)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-08-16 09:42:15 -06:00
Harshavardhana
430ae66955 update disk -> drive change in prometheus metrics in minio master (#2999)
refer to https://github.com/minio/minio/pull/17854
2023-08-15 19:49:53 -07:00
MinIO Bot
3abbbc82b2 mds-released-v0.8.3 (#2995) 2023-08-15 10:09:50 -06:00
Alex
854181f63e Disabled input fields and changed Register label in Subscription features (#2994)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-08-14 17:07:31 -06:00
Kaan Kabalak
df996794ed Remove duplicate ref=con in License page buttons (#2993) 2023-08-14 10:12:10 -06:00
Cesar N
2d94018e3c Release v0.36.0 (#2988) 2023-08-10 11:59:15 -07:00
Alex
72bb9d0ca1 Update Settings Page components (#2986)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-08-09 18:30:42 -06:00
Javier Adriel
93bd0d65e2 Show LDAP configuration (#2985) 2023-08-09 12:06:17 -06:00
Prakash Senthil Vel
495b0f0068 truncate prefixes above the selected level to make the download layout flat (#2987) 2023-08-09 10:29:41 -07:00
Cesar Celis Hernandez
3275b6a6d8 Removing unneeded password (#2983) 2023-08-04 13:45:41 -06:00
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
1333 changed files with 49464 additions and 45765 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.21.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
cache: true
id: go
- name: Build on ${{ matrix.os }}
env:
GO111MODULE: on
GOOS: linux
run: |
make crosscompile arg1="'linux/ppc64le linux/mips64'"
cross-compile-2:
name: Cross compile 2
needs:
- lint-job
- ui-assets
- reuse-golang-dependencies
- semgrep-static-code-analysis
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.21.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
cache: true
id: go
- name: Build on ${{ matrix.os }}
env:
GO111MODULE: on
GOOS: linux
run: |
make crosscompile arg1="'linux/arm64 linux/s390x'"
cross-compile-3:
name: Cross compile 3
needs:
- lint-job
- ui-assets
- reuse-golang-dependencies
- semgrep-static-code-analysis
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.21.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
cache: true
id: go
- name: Build on ${{ matrix.os }}
env:
GO111MODULE: on
GOOS: linux
run: |
make crosscompile arg1="'darwin/amd64 freebsd/amd64'"
cross-compile-4:
name: Cross compile 4
needs:
- lint-job
- ui-assets
- reuse-golang-dependencies
- semgrep-static-code-analysis
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.21.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
cache: true
id: go
- name: Build on ${{ matrix.os }}
env:
GO111MODULE: on
GOOS: linux
run: |
make crosscompile arg1="'windows/amd64 linux/arm'"
cross-compile-5:
name: Cross compile 5
needs:
- lint-job
- ui-assets
- reuse-golang-dependencies
- semgrep-static-code-analysis
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.21.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
cache: true
id: go
- name: Build on ${{ matrix.os }}
env:
GO111MODULE: on
GOOS: linux
run: |
make crosscompile arg1="'linux/386 netbsd/amd64'"

18
.github/workflows/issues.yaml vendored Normal file
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 }}

View File

@@ -1,3 +1,5 @@
# @format
name: Workflow
on:
@@ -15,15 +17,13 @@ concurrency:
cancel-in-progress: true
jobs:
lint-job:
name: Checking Lint
runs-on: [ ubuntu-latest ]
runs-on: [ubuntu-latest]
strategy:
matrix:
go-version: [ 1.19.x ]
os: [ ubuntu-latest ]
go-version: [1.21.x]
os: [ubuntu-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -42,32 +42,12 @@ jobs:
run: |
make verifiers
vulnerable-dependencies-checks:
name: "Check for vulnerable dependencies"
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ 1.19 ]
steps:
- name: Check out code
uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
cache: true
check-latest: true
- name: Get govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest
shell: bash
- name: Run govulncheck
run: govulncheck ./...
shell: bash
semgrep-static-code-analysis:
name: "semgrep checks"
runs-on: ubuntu-latest
strategy:
matrix:
os: [ ubuntu-latest ]
os: [ubuntu-latest]
steps:
- name: Check out source code
uses: actions/checkout@v3
@@ -80,14 +60,13 @@ jobs:
pip3 install semgrep
semgrep --config semgrep.yaml $(pwd)/portal-ui --error
ui-assets:
name: "React Code Has No Warnings & Prettified"
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ 1.19.x ]
os: [ ubuntu-latest ]
go-version: [1.21.x]
os: [ubuntu-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -97,7 +76,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NVMRC }}
cache: 'yarn'
cache: "yarn"
cache-dependency-path: portal-ui/yarn.lock
- uses: actions/cache@v3
id: assets-cache
@@ -121,13 +100,18 @@ jobs:
continue-on-error: false
run: |
./check-prettier.sh
- name: Check for dead code
working-directory: ./portal-ui
continue-on-error: false
run: |
./check-deadcode.sh
reuse-golang-dependencies:
name: reuse golang dependencies
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ 1.19.x ]
os: [ ubuntu-latest ]
go-version: [1.21.x]
os: [ubuntu-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -146,10 +130,10 @@ jobs:
latest-minio:
name: Build latest MinIO
runs-on: [ ubuntu-latest ]
runs-on: [ubuntu-latest]
strategy:
matrix:
go-version: [ 1.19.x ]
go-version: [1.21.x]
steps:
# To build minio image, we need to clone the repository first
- name: Clone github.com/minio/minio
@@ -184,8 +168,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.19.x ]
os: [ ubuntu-latest ]
go-version: [1.21.x]
os: [ubuntu-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -215,42 +199,66 @@ jobs:
GOOS: linux
run: |
make console
react-code-known-vulnerabilities:
name: "React Code Has No Known Vulnerable Deps"
test-nginx-subpath:
name: Test Subpath with Nginx
needs:
- ui-assets
runs-on: ubuntu-latest
- compile-binary
runs-on: [ubuntu-latest]
timeout-minutes: 10
strategy:
matrix:
go-version: [ 1.19.x ]
os: [ ubuntu-latest ]
go-version: [1.21.x]
os: [ubuntu-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NVMRC }}
cache: 'yarn'
cache-dependency-path: portal-ui/yarn.lock
- name: Checks for known security issues with the installed packages
working-directory: ./portal-ui
- name: Install MinIO JS
working-directory: ./
continue-on-error: false
run: |
yarn audit
yarn add minio
- uses: actions/cache@v3
name: Console Binary Cache
with:
path: |
./console
key: ${{ runner.os }}-binary-${{ github.run_id }}
- name: clean-previous-containers-if-any
run: |
docker stop minio || true;
docker container prune -f || true;
- name: Start Console, MinIO and Nginx
run: |
(CONSOLE_SUBPATH=/console/subpath ./console server ) & (make test-initialize-minio-nginx)
- name: Install TestCafe
run: npm install testcafe@3.0.0
- name: Run TestCafe Tests
run: npx testcafe "chrome:headless" portal-ui/tests/subpath-nginx/ -q --skip-js-errors -c 3
- name: Clean up docker
if: always()
run: |
make cleanup-minio-nginx
all-permissions-1:
name: Permissions Tests Part 1
needs:
- compile-binary
runs-on: [ ubuntu-latest ]
runs-on: [ubuntu-latest]
timeout-minutes: 10
strategy:
matrix:
go-version: [ 1.19.x ]
os: [ ubuntu-latest ]
go-version: [1.21.x]
os: [ubuntu-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -279,10 +287,11 @@ jobs:
run: |
(./console server) & (make initialize-permissions)
- name: Install TestCafe
run: npm install testcafe@3.0.0
- name: Run TestCafe Tests
uses: DevExpress/testcafe-action@latest
with:
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-1/ --skip-js-errors -c 3'
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-1/ -q --skip-js-errors -c 3
- name: Clean up users & policies
run: |
@@ -292,12 +301,12 @@ jobs:
name: Permissions Tests Part 2
needs:
- compile-binary
runs-on: [ ubuntu-latest ]
runs-on: [ubuntu-latest]
timeout-minutes: 10
strategy:
matrix:
go-version: [ 1.19.x ]
os: [ ubuntu-latest ]
go-version: [1.21.x]
os: [ubuntu-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -325,10 +334,11 @@ jobs:
run: |
(./console server) & (make initialize-permissions)
- name: Install TestCafe
run: npm install testcafe@3.0.0
- name: Run TestCafe Tests
uses: DevExpress/testcafe-action@latest
with:
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-2/ --skip-js-errors -c 3'
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-2/ -q --skip-js-errors -c 3
- name: Clean up users & policies
run: |
@@ -338,12 +348,12 @@ jobs:
name: Permissions Tests Part 3
needs:
- compile-binary
runs-on: [ ubuntu-latest ]
runs-on: [ubuntu-latest]
timeout-minutes: 10
strategy:
matrix:
go-version: [ 1.19.x ]
os: [ ubuntu-latest ]
go-version: [1.21.x]
os: [ubuntu-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -371,26 +381,26 @@ jobs:
run: |
(./console server) & (make initialize-permissions)
- name: Install TestCafe
run: npm install testcafe@3.0.0
- name: Run TestCafe Tests
uses: DevExpress/testcafe-action@latest
with:
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-3/ --skip-js-errors -c 3'
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-3/ -q --skip-js-errors -c 3
- name: Clean up users & policies
run: |
make cleanup-permissions
all-permissions-4:
name: Permissions Tests Part 4
needs:
- compile-binary
runs-on: [ ubuntu-latest ]
runs-on: [ubuntu-latest]
timeout-minutes: 15
strategy:
matrix:
go-version: [ 1.19.x ]
os: [ ubuntu-latest ]
go-version: [1.21.x]
os: [ubuntu-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -417,20 +427,23 @@ jobs:
- name: Start Console, front-end app and initialize users/policies
run: |
(./console server) & (make initialize-permissions)
- name: Install TestCafe
run: npm install testcafe@3.0.0
- name: Run TestCafe Tests
timeout-minutes: 10
uses: DevExpress/testcafe-action@latest
with:
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-4/ --skip-js-errors'
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-4/ --skip-js-errors
all-permissions-5:
name: Permissions Tests Part 5
needs:
- compile-binary
runs-on: [ ubuntu-latest ]
runs-on: [ubuntu-latest]
strategy:
matrix:
go-version: [ 1.19.x ]
os: [ ubuntu-latest ]
go-version: [1.21.x]
os: [ubuntu-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -457,20 +470,23 @@ jobs:
- name: Start Console, front-end app and initialize users/policies
run: |
(./console server) & (make initialize-permissions)
- name: Install TestCafe
run: npm install testcafe@3.0.0
- name: Run TestCafe Tests
timeout-minutes: 5
uses: DevExpress/testcafe-action@latest
with:
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-5/ --skip-js-errors'
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-5/ --skip-js-errors
all-permissions-6:
name: Permissions Tests Part 6
needs:
- compile-binary
runs-on: [ ubuntu-latest ]
runs-on: [ubuntu-latest]
strategy:
matrix:
go-version: [ 1.19.x ]
os: [ ubuntu-latest ]
go-version: [1.21.x]
os: [ubuntu-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -497,20 +513,23 @@ jobs:
- name: Start Console, front-end app and initialize users/policies
run: |
(./console server) & (make initialize-permissions)
- name: Install TestCafe
run: npm install testcafe@3.0.0
- name: Run TestCafe Tests
timeout-minutes: 5
uses: DevExpress/testcafe-action@latest
with:
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-6/ --skip-js-errors'
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-6/ --skip-js-errors
all-permissions-7:
name: Permissions Tests Part 7
needs:
- compile-binary
runs-on: [ ubuntu-latest ]
runs-on: [ubuntu-latest]
strategy:
matrix:
go-version: [ 1.19.x ]
os: [ ubuntu-latest ]
go-version: [1.21.x]
os: [ubuntu-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -537,20 +556,22 @@ jobs:
- name: Start Console, front-end app and initialize users/policies
run: |
(./console server) & (make initialize-permissions)
- name: Install TestCafe
run: npm install testcafe@3.0.0
- name: Run TestCafe Tests
timeout-minutes: 5
uses: DevExpress/testcafe-action@latest
with:
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-7/ --skip-js-errors'
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-7/ --skip-js-errors
all-permissions-8:
name: Permissions Tests Part 8
needs:
- compile-binary
runs-on: [ ubuntu-latest ]
runs-on: [ubuntu-latest]
strategy:
matrix:
go-version: [ 1.19.x ]
os: [ ubuntu-latest ]
go-version: [1.21.x]
os: [ubuntu-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -577,20 +598,23 @@ jobs:
- name: Start Console, front-end app and initialize users/policies
run: |
(./console server) & (make initialize-permissions)
- name: Install TestCafe
run: npm install testcafe@3.0.0
- name: Run TestCafe Tests
timeout-minutes: 5
uses: DevExpress/testcafe-action@latest
with:
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-8/ --skip-js-errors'
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-8/ --skip-js-errors
all-permissions-9:
name: Permissions Tests Part 9
needs:
- compile-binary
runs-on: [ ubuntu-latest ]
runs-on: [ubuntu-latest]
strategy:
matrix:
go-version: [ 1.19.x ]
os: [ ubuntu-latest ]
go-version: [1.21.x]
os: [ubuntu-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -618,10 +642,11 @@ jobs:
run: |
(./console server) & (make initialize-permissions)
- name: Install TestCafe
run: npm install testcafe@3.0.0
- name: Run TestCafe Tests
uses: DevExpress/testcafe-action@latest
with:
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-9/ --skip-js-errors -c 3'
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-9/ --skip-js-errors -c 3
- name: Clean up users & policies
run: |
@@ -631,11 +656,11 @@ jobs:
name: Permissions Tests Part A
needs:
- compile-binary
runs-on: [ ubuntu-latest ]
runs-on: [ubuntu-latest]
strategy:
matrix:
go-version: [ 1.19.x ]
os: [ ubuntu-latest ]
go-version: [1.21.x]
os: [ubuntu-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -663,10 +688,11 @@ jobs:
run: |
(./console server) & (make initialize-permissions)
- name: Install TestCafe
run: npm install testcafe@3.0.0
- name: Run TestCafe Tests
uses: DevExpress/testcafe-action@latest
with:
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-A/ --skip-js-errors -c 3'
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-A/ --skip-js-errors -c 3
- name: Clean up users & policies
run: |
@@ -676,11 +702,11 @@ jobs:
name: Permissions Tests Part B
needs:
- compile-binary
runs-on: [ ubuntu-latest ]
runs-on: [ubuntu-latest]
strategy:
matrix:
go-version: [ 1.19.x ]
os: [ ubuntu-latest ]
go-version: [1.21.x]
os: [ubuntu-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -708,169 +734,16 @@ jobs:
run: |
(./console server) & (make initialize-permissions)
- name: Install TestCafe
run: npm install testcafe@3.0.0
- name: Run TestCafe Tests
uses: DevExpress/testcafe-action@latest
with:
args: '"chrome --headless --no-sandbox" portal-ui/tests/permissions-B/ --skip-js-errors -c 3'
run: npx testcafe "chrome:headless" portal-ui/tests/permissions-B/ --skip-js-errors -c 3
- name: Clean up users & policies
run: |
make cleanup-permissions
cross-compile-1:
name: Cross compile
needs:
- lint-job
- ui-assets
- reuse-golang-dependencies
- semgrep-static-code-analysis
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.19.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
cache: true
id: go
- name: Build on ${{ matrix.os }}
env:
GO111MODULE: on
GOOS: linux
run: |
make crosscompile arg1="'linux/ppc64le linux/mips64'"
cross-compile-2:
name: Cross compile 2
needs:
- lint-job
- ui-assets
- reuse-golang-dependencies
- semgrep-static-code-analysis
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.19.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
cache: true
id: go
- name: Build on ${{ matrix.os }}
env:
GO111MODULE: on
GOOS: linux
run: |
make crosscompile arg1="'linux/arm64 linux/s390x'"
cross-compile-3:
name: Cross compile 3
needs:
- lint-job
- ui-assets
- reuse-golang-dependencies
- semgrep-static-code-analysis
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.19.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
cache: true
id: go
- name: Build on ${{ matrix.os }}
env:
GO111MODULE: on
GOOS: linux
run: |
make crosscompile arg1="'darwin/amd64 freebsd/amd64'"
cross-compile-4:
name: Cross compile 4
needs:
- lint-job
- ui-assets
- reuse-golang-dependencies
- semgrep-static-code-analysis
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.19.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
cache: true
id: go
- name: Build on ${{ matrix.os }}
env:
GO111MODULE: on
GOOS: linux
run: |
make crosscompile arg1="'windows/amd64 linux/arm'"
cross-compile-5:
name: Cross compile 5
needs:
- lint-job
- ui-assets
- reuse-golang-dependencies
- semgrep-static-code-analysis
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.19.x ]
os: [ ubuntu-latest ]
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
cache: true
id: go
- name: Build on ${{ matrix.os }}
env:
GO111MODULE: on
GOOS: linux
run: |
make crosscompile arg1="'linux/386 netbsd/amd64'"
test-pkg-on-go:
name: Test Pkg on Go ${{ matrix.go-version }} and ${{ matrix.os }}
needs:
@@ -881,8 +754,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.19.x ]
os: [ ubuntu-latest ]
go-version: [1.21.x]
os: [ubuntu-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -918,8 +791,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.19.x ]
os: [ ubuntu-latest ]
go-version: [1.21.x]
os: [ubuntu-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -931,7 +804,6 @@ jobs:
cache: true
id: go
- name: Build on ${{ matrix.os }}
env:
GO111MODULE: on
@@ -958,7 +830,7 @@ jobs:
strategy:
matrix:
go-version: [ 1.19.x ]
go-version: [1.21.x]
steps:
- name: Check out code
@@ -967,7 +839,7 @@ jobs:
uses: actions/checkout@master
with:
repository: minio/minio
path: 'minio_repository'
path: "minio_repository"
- uses: actions/cache@v3
id: minio-latest-cache
name: MinIO Latest Cache
@@ -1003,7 +875,7 @@ jobs:
echo "We are going to use the built image on test-integration";
VERSION="minio/minio:$VERSION";
echo $VERSION;
echo "Create bucket for replication with versioning"
echo "Download mc for Ubuntu"
wget -q https://dl.min.io/client/mc/release/linux-amd64/mc
@@ -1036,7 +908,6 @@ jobs:
working-directory: ./portal-ui
run: yarn test
replication:
name: Site Replication Test
needs:
- lint-job
@@ -1044,11 +915,11 @@ jobs:
- reuse-golang-dependencies
- semgrep-static-code-analysis
- latest-minio
runs-on: [ ubuntu-latest ]
runs-on: [ubuntu-latest]
strategy:
matrix:
go-version: [ 1.19.x ]
go-version: [1.21.x]
steps:
- name: Check out code
@@ -1065,7 +936,7 @@ jobs:
uses: actions/checkout@master
with:
repository: minio/minio
path: 'minio_repository'
path: "minio_repository"
- uses: actions/cache@v3
id: minio-latest-cache
name: MinIO Latest Cache
@@ -1110,8 +981,8 @@ jobs:
with:
name: replication-artifact
path: ./replication/coverage/replication.out
if-no-files-found: error
sso-integration:
name: SSO Integration Test
needs:
- lint-job
@@ -1123,7 +994,7 @@ jobs:
strategy:
matrix:
go-version: [ 1.19.x ]
go-version: [1.21.x]
steps:
- name: Check out code
@@ -1140,7 +1011,7 @@ jobs:
uses: actions/checkout@master
with:
repository: minio/minio
path: 'minio_repository'
path: "minio_repository"
- uses: actions/cache@v3
id: minio-latest-cache
name: MinIO Latest Cache
@@ -1194,8 +1065,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.19.x ]
os: [ ubuntu-latest ]
go-version: [1.21.x]
os: [ubuntu-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
@@ -1298,7 +1169,7 @@ jobs:
go tool cover -func=all.out | grep total > tmp2
result=`cat tmp2 | awk 'END {print $3}'`
result=${result%\%}
threshold=69.4
threshold=71.3
echo "Result:"
echo "$result%"
if (( $(echo "$result >= $threshold" |bc -l) )); then
@@ -1307,3 +1178,145 @@ jobs:
echo "It is smaller than threshold ($threshold%) value, failed!"
exit 1
fi
ui-assets-istanbul-coverage:
name: "Assets with Istanbul Plugin for coverage"
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Read .nvmrc
id: node_version
run: echo "$(cat .nvmrc)" && echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_ENV
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NVMRC }}
cache: "yarn"
cache-dependency-path: portal-ui/yarn.lock
- uses: actions/cache@v3
id: assets-cache-istanbul-coverage
name: Assets Cache Istanbul Coverage
with:
path: |
./portal-ui/build/
key: ${{ runner.os }}-assets-istanbul-coverage-${{ github.run_id }}
- name: Install Dependencies
working-directory: ./portal-ui
continue-on-error: false
run: |
yarn install --frozen-lockfile --immutable
- name: Check for Warnings in build output
working-directory: ./portal-ui
continue-on-error: false
run: |
./check-warnings-istanbul-coverage.sh
compile-binary-istanbul-coverage:
name: "Compile Console Binary with Istanbul Plugin for Coverage"
needs:
- lint-job
- ui-assets-istanbul-coverage
- reuse-golang-dependencies
- semgrep-static-code-analysis
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
cache: true
id: go
- uses: actions/cache@v3
name: Console Binary Cache Istanbul Coverage
with:
path: |
./console
key: ${{ runner.os }}-binary-istanbul-coverage-${{ github.run_id }}
- uses: actions/cache@v3
id: assets-cache-istanbul-coverage
name: Assets Cache Istanbul Coverage
with:
path: |
./portal-ui/build/
key: ${{ runner.os }}-assets-istanbul-coverage-${{ github.run_id }}
- name: Build on ${{ matrix.os }}
env:
GO111MODULE: on
GOOS: linux
run: |
make console
playwright:
needs:
- compile-binary-istanbul-coverage
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies
run: |
echo "Install dependencies"
cd $GITHUB_WORKSPACE/portal-ui
yarn add -D playwright
yarn add -D babel-plugin-istanbul
yarn add -D nyc
yarn add -D react-app-rewired
yarn add -D create-react-app
yarn add -D @playwright/test
yarn init -y
echo "yarn install"
yarn install
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- uses: actions/cache@v3
name: Console Binary Cache Istanbul Coverage
with:
path: |
./console
key: ${{ runner.os }}-binary-istanbul-coverage-${{ github.run_id }}
- name: Start Console, front-end app and initialize users/policies
run: |
(./console server) & (make initialize-permissions)
- name: Run Playwright tests
run: |
echo "Run tests under playwright folder only"
cd $GITHUB_WORKSPACE/portal-ui
yarn remove playwright
yarn add --dev @playwright/test
echo "npx playwright test"
npx playwright test # To run the tests
echo "npx nyc report"
npx nyc report # To see report printed in logs as text
echo "npx nyc report --reporter=html"
npx nyc report --reporter=html # to see report in ./coverage/index.html
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- uses: actions/upload-artifact@v3
if: always()
with:
name: coverage
path: coverage/
retention-days: 30

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

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

10
.gitignore vendored
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

186
CHANGELOG.md Normal file
View File

@@ -0,0 +1,186 @@
<!-- @format -->
# Changelog
## Release v0.42.0
Features:
- Introducing Dark Mode
Bug Fix:
- Fixed vulnerabilities
- Changes on Upload and Delete object urls
- Fixed blocking subpath creation if not enough permissions
- Removed share object option at prefix level
- Updated allowed actions for a deleted object
## Release v0.41.0
Features:
- Updated pages to use mds components
- support for resolving IPv4/IPv6
Bug Fix:
- Remove cache for ClientIP
- Fixed override environment variables display in settings page
- Fixed daylight savings time support in share modal
## Release v0.40.0
Features:
- Updated OpenID page
- Added New bucket event types support
Bug Fix:
- Fixed crash in access keys page
- Fixed AuditLog filters issue
- Fixed multiple issues with Object Browser
## Release v0.39.0
Features:
- Migrated metrics page to mds
- Migrated Register page to mds
Bug Fix:
- Fixed LDAP configuration page issues
- Load available certificates in logout
- Updated dependencies & go version
- Fixed delete objects functionality
## Release v0.38.0
Features:
- Added extra information to Service Accounts page
- Updated Tiers, Site Replication, Speedtest, Heal & Watch pages components
Bug Fix:
- Fixed IDP expiry time errors
- Updated project Dependencies
## Release v0.37.0
Features:
- Updated Trace and Logs page components
- Updated Prometheus metrics
Bug Fix:
- Disabled input fields for Subscription features if MinIO is not registered
## Release v0.36.0
Features:
- Updated Settings page components
Bug Fix:
- Show LDAP Enabled value LDAP configuration
- Download multiple objects in same path as they were selected
## Release v0.35.1
Bug Fix:
- Change timestamp format for zip creation
## Release v0.35.0
Features:
- Add Exclude Folders and Exclude Prefixes during bucket creation
- Download multiple selected objects as zip and ignore deleted objects
- Updated Call Home, Inspet, Profile and Health components
Bug Fix:
- Remove extra white spaces for configuration strings
- Allow Create New Path in bucket view when having right permissions
## Release v0.34.0
Features:
- Updated Buckets components
Bug Fix:
- Fixed SUBNET Health report upload
- Updated Download Handler
- Fixes issue with rewind
- Avoid 1 hour expiration for IDP credentials
---
## Release v0.33.0
Features:
- Updated OpenID, LDAP components
Bug Fix:
- Fixed security issues
- Fixed navigation issues in Object Browser
- Fixed Dashboard metrics
---
## Release v0.32.0
Features:
- Updated Users and Groups components
- Added placeholder image for Help Menu
Bug Fix:
- Fixed memory leak in WebSocket API for Object Browser
---
## Release v0.31.0
**Breaking Changes:**
- **Removed support for Standalone Deployments**
Features:
- Updated way files are displayed in uploading component
- Updated Audit Logs and Policies components
Bug Fix:
- Fixed Download folders issue in Object Browser
- Added missing Notification Events (ILM & REPLICA) in Events Notification Page
- Fixed Security Vulnerability for `semver` dependency
---
## Release v0.30.0
Features:
- Added MinIO Console Help Menu
- Updated UI Menu components
Bug Fix:
- Disable the Upload button on Object Browser if the user is not allowed
- Fixed security vulnerability for `lestrrat-go/jwx` and `fast-xml-parser`
- Fixed bug on sub-paths for Object Browser
- Reduce the number of calls to `/session` API endpoint to improve performance
- Rolled back the previous change for the Share File feature to no longer ask for Service Account access keys

7169
CREDITS

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,27 @@
# Developing MinIO Console
The MinIO Console requires the [MinIO Server](https://github.com/minio/minio). For development purposes, you also need to run both the MinIO Console web app and the MinIO Console server.
## Running MinIO Console server
Build the server in the main folder by running:
```
make
```
> Note: If it's the first time running the server, you might need to run `go mod tidy` to ensure you have all modules required.
To start the server run:
```
CONSOLE_ACCESS_KEY=<your-access-key>
CONSOLE_SECRET_KEY=<your-secret-key>
CONSOLE_MINIO_SERVER=<minio-server-endpoint>
CONSOLE_DEV_MODE=on
./console server
```
## Running MinIO Console web app
Refer to `/portal-ui` [instructions](/portal-ui/README.md) to run the web app locally.
# Building with MinIO
To test console in its shipping format, you need to build it from the MinIO repository, the following step will guide
@@ -137,8 +161,8 @@ $ cat > consoleAdmin.json << EOF
]
}
EOF
$ mc admin policy add myminio consoleAdmin consoleAdmin.json
$ mc admin policy set myminio consoleAdmin user="uid=billy,dc=example,dc=org"
$ mc admin policy create myminio consoleAdmin consoleAdmin.json
$ mc admin policy attach myminio consoleAdmin --user="uid=billy,dc=example,dc=org"
```
## Run MinIO

View File

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

View File

@@ -53,6 +53,9 @@ clean-swagger:
swagger-console:
@echo "Generating swagger server code from yaml"
@swagger generate server -A console --main-package=management --server-package=restapi --exclude-main -P models.Principal -f ./swagger.yml -r NOTICE
@echo "Generating typescript api"
@npx swagger-typescript-api -p ./swagger.yml -o ./portal-ui/src/api -n consoleApi.ts
@git restore restapi/server.go
assets:
@@ -171,7 +174,7 @@ test-sso-integration:
@(docker run --name minio-client --network my-net -dit --entrypoint=/bin/sh minio/mc)
@(docker exec minio-client mc alias set myminio/ http://minio:9000 minio minio123)
@echo "adding policy to Dillon Harper to be able to login:"
@(cd sso-integration && docker cp allaccess.json minio-client:/ && docker exec minio-client mc admin policy add myminio "Dillon Harper" allaccess.json)
@(cd sso-integration && docker cp allaccess.json minio-client:/ && docker exec minio-client mc admin policy create myminio "Dillon Harper" allaccess.json)
@echo "starting bash script"
@(env bash $(PWD)/sso-integration/set-sso.sh)
@echo "add python module"
@@ -227,6 +230,30 @@ cleanup-permissions:
@(env bash $(PWD)/portal-ui/tests/scripts/cleanup-env.sh)
@(docker stop minio)
initialize-docker-network:
@(docker network create test-network)
test-start-docker-minio-w-redirect-url: initialize-docker-network
@(docker run \
-e MINIO_BROWSER_REDIRECT_URL='http://localhost:8000/console/subpath/' \
-e MINIO_SERVER_URL='http://localhost:9000' \
-v /data1 -v /data2 -v /data3 -v /data4 \
-d --network host --name minio --rm\
quay.io/minio/minio:latest server /data{1...4})
test-start-docker-nginx-w-subpath:
@(docker run \
--network host \
-d --rm \
--add-host=host.docker.internal:host-gateway \
-v ./portal-ui/tests/subpath-nginx/nginx.conf:/etc/nginx/nginx.conf \
--name test-nginx nginx)
test-initialize-minio-nginx: test-start-docker-minio-w-redirect-url test-start-docker-nginx-w-subpath
cleanup-minio-nginx:
@(docker stop minio test-nginx & docker network rm test-network)
test:
@echo "execute test and get coverage"
@(cd restapi && mkdir coverage && GO111MODULE=on go test -test.v -coverprofile=coverage/coverage.out)

View File

@@ -12,48 +12,25 @@ A graphical user interface for [MinIO](https://github.com/minio/minio)
**Table of Contents**
- [MinIO Console](#minio-console)
- [Install](#install)
- [Binary Releases](#binary-releases)
- [Docker](#docker)
- [Build from source](#build-from-source)
- [Setup](#setup)
- [1. Create a user `console` using `mc`](#1-create-a-user-console-using-mc)
- [2. Create a policy for `console` with admin access to all resources (for testing)](#2-create-a-policy-for-console-with-admin-access-to-all-resources-for-testing)
- [3. Set the policy for the new `console` user](#3-set-the-policy-for-the-new-console-user)
- [Start Console service:](#start-console-service)
- [Start Console service with TLS:](#start-console-service-with-tls)
- [Connect Console to a Minio using TLS and a self-signed certificate](#connect-console-to-a-minio-using-tls-and-a-self-signed-certificate)
- [Install](#install)
- [Build from source](#build-from-source)
- [Setup](#setup)
- [1. Create a user `console` using `mc`](#1-create-a-user-console-using-mc)
- [2. Create a policy for `console` with admin access to all resources (for testing)](#2-create-a-policy-for-console-with-admin-access-to-all-resources-for-testing)
- [3. Set the policy for the new `console` user](#3-set-the-policy-for-the-new-console-user)
- [Start Console service:](#start-console-service)
- [Start Console service with TLS:](#start-console-service-with-tls)
- [Connect Console to a Minio using TLS and a self-signed certificate](#connect-console-to-a-minio-using-tls-and-a-self-signed-certificate)
- [Contribute to console Project](#contribute-to-console-project)
<!-- markdown-toc end -->
## Install
### Binary Releases
MinIO Console is a library that provides a management and browser UI overlay for the MinIO Server.
The standalone binary installation path has been removed.
| OS | ARCH | Binary |
|:-------:|:-------:|:----------------------------------------------------------------------------------------------------:|
| Linux | amd64 | [linux-amd64](https://github.com/minio/console/releases/latest/download/console-linux-amd64) |
| Linux | arm64 | [linux-arm64](https://github.com/minio/console/releases/latest/download/console-linux-arm64) |
| Linux | ppc64le | [linux-ppc64le](https://github.com/minio/console/releases/latest/download/console-linux-ppc64le) |
| Linux | s390x | [linux-s390x](https://github.com/minio/console/releases/latest/download/console-linux-s390x) |
| Apple | amd64 | [darwin-amd64](https://github.com/minio/console/releases/latest/download/console-darwin-amd64) |
| Windows | amd64 | [windows-amd64](https://github.com/minio/console/releases/latest/download/console-windows-amd64.exe) |
You can also verify the binary with [minisign](https://jedisct1.github.io/minisign/) by downloading the
corresponding [`.minisig`](https://github.com/minio/console/releases/latest) signature file. Then run:
```
minisign -Vm console-<OS>-<ARCH> -P RWTx5Zr1tiHQLwG9keckT0c45M3AGeHD6IvimQHpyRywVWGbP1aVSGav
```
### Docker
Pull the latest release via:
```
docker pull minio/console
```
In case a Console standalone binary is needed, it can be generated by building this package from source as follows:
### Build from source
@@ -107,13 +84,13 @@ EOF
```
```sh
mc admin policy add myminio/ consoleAdmin admin.json
mc admin policy create myminio/ consoleAdmin admin.json
```
### 3. Set the policy for the new `console` user
```sh
mc admin policy set myminio consoleAdmin user=console
mc admin policy attach myminio consoleAdmin --user=console
```
> NOTE: Additionally, you can create policies to limit the privileges for other `console` users, for example, if you

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

@@ -41,8 +41,9 @@ func StartServer(ctx *cli.Context) error {
}
xctx := context.Background()
transport := restapi.PrepareSTSClientTransport(false)
if err := logger.InitializeLogger(xctx, transport); err != nil {
transport := restapi.PrepareSTSClientTransport(false, restapi.LocalAddress)
if err := logger.InitializeLogger(xctx, transport.Transport); err != nil {
fmt.Println("error InitializeLogger", err)
logger.CriticalIf(xctx, err)
}

View File

@@ -25,9 +25,9 @@ import (
"github.com/minio/cli"
"github.com/minio/console/pkg"
"github.com/minio/pkg/console"
"github.com/minio/pkg/trie"
"github.com/minio/pkg/words"
"github.com/minio/pkg/v2/console"
"github.com/minio/pkg/v2/trie"
"github.com/minio/pkg/v2/words"
)
// Help template for Console.

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 {

196
go.mod
View File

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

1348
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

@@ -28,7 +28,6 @@ import (
"github.com/go-openapi/swag"
iampolicy "github.com/minio/pkg/iam/policy"
"github.com/stretchr/testify/assert"
)
@@ -52,6 +51,21 @@ func TestAddServiceAccount(t *testing.T) {
requestDataAddServiceAccount := map[string]interface{}{
"accessKey": "testuser1",
"secretKey": "password",
"policy": `{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetBucketLocation",
"s3:GetObject"
],
"Resource": [
"arn:aws:s3:::*"
]
}
]
}`,
}
requestDataJSON, _ := json.Marshal(requestDataAddServiceAccount)
@@ -75,75 +89,6 @@ func TestAddServiceAccount(t *testing.T) {
assert.Equal(201, response.StatusCode, "Status Code is incorrect")
}
requestDataPolicy := map[string]interface{}{
"policy": `
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetBucketLocation",
"s3:GetObject"
],
"Resource": [
"arn:aws:s3:::*"
]
}
]
}`,
}
requestDataJSON, _ = json.Marshal(requestDataPolicy)
requestDataBody = bytes.NewReader(requestDataJSON)
request, err = http.NewRequest(
"PUT", "http://localhost:9090/api/v1/service-accounts/"+base64.StdEncoding.EncodeToString([]byte("testuser1"))+"/policy", requestDataBody)
if err != nil {
log.Println(err)
return
}
request.Header.Add("Cookie", fmt.Sprintf("token=%s", token))
request.Header.Add("Content-Type", "application/json")
response, err = client.Do(request)
if err != nil {
log.Println(err)
return
}
if response != nil {
fmt.Println("POST StatusCode:", response.StatusCode)
assert.Equal(200, response.StatusCode, "Status Code is incorrect")
}
// Test policy
request, err = http.NewRequest(
"GET", "http://localhost:9090/api/v1/service-accounts/"+base64.StdEncoding.EncodeToString([]byte("testuser1"))+"/policy", nil)
if err != nil {
log.Println(err)
return
}
request.Header.Add("Cookie", fmt.Sprintf("token=%s", token))
request.Header.Add("Content-Type", "application/json")
response, err = client.Do(request)
if err != nil {
log.Println(err)
return
}
if response != nil {
fmt.Println("POST StatusCode:", response.StatusCode)
assert.Equal(200, response.StatusCode, "Status Code is incorrect")
buf := new(bytes.Buffer)
buf.ReadFrom(response.Body)
var actual *iampolicy.Policy
var expected *iampolicy.Policy
json.Unmarshal(buf.Bytes(), actual)
policy, err := json.Marshal(requestDataAddServiceAccount["policy"])
if err != nil {
log.Println(err)
return
}
json.Unmarshal(policy, expected)
assert.Equal(expected, actual)
}
// {{baseUrl}}/user?name=proident velit
// Investiga como se borra en el browser.
request, err = http.NewRequest(
@@ -305,7 +250,6 @@ func TestCreateServiceAccountForUserWithCredentials(t *testing.T) {
userName := "testcreateserviceaccountforuserwithcredentials1"
assert := assert.New(t)
policy := ""
serviceAccountLengthInBytes := 40 // As observed, update as needed
// 1. Create the user
groups := []string{}
@@ -383,7 +327,6 @@ func TestCreateServiceAccountForUserWithCredentials(t *testing.T) {
finalResponse,
)
}
assert.Equal(len(finalResponse), serviceAccountLengthInBytes, finalResponse)
})
}

View File

@@ -21,11 +21,11 @@ package integration
import (
"bytes"
"context"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"os"
@@ -34,8 +34,9 @@ import (
"testing"
"time"
"github.com/minio/console/models"
"github.com/minio/minio-go/v7"
"github.com/minio/console/models"
"github.com/minio/minio-go/v7/pkg/credentials"
"github.com/stretchr/testify/assert"
)
@@ -43,14 +44,14 @@ import (
type AddBucketOps struct {
Name string
Locking bool
Versioning bool
Versioning map[string]interface{}
Quota map[string]interface{}
Retention map[string]interface{}
Endpoint *string
UseToken *string
}
func AddBucket(name string, locking, versioning bool, quota, retention map[string]interface{}) (*http.Response, error) {
func AddBucket(name string, locking bool, versioning, quota, retention map[string]interface{}) (*http.Response, error) {
return AddBucketWithOpts(&AddBucketOps{
Name: name,
Locking: locking,
@@ -143,11 +144,11 @@ func getTokenForEndpoint(endpoint string) string {
return loginToken
}
func setupBucket(name string, locking, versioning bool, quota, retention map[string]interface{}, assert *assert.Assertions, expected int) bool {
func setupBucket(name string, locking bool, versioning, quota, retention map[string]interface{}, assert *assert.Assertions, expected int) bool {
return setupBucketForEndpoint(name, locking, versioning, quota, retention, assert, expected, nil, nil)
}
func setupBucketForEndpoint(name string, locking, versioning bool, quota, retention map[string]interface{}, assert *assert.Assertions, expected int, endpoint, endpointToken *string) bool {
func setupBucketForEndpoint(name string, locking bool, versioning, quota, retention map[string]interface{}, assert *assert.Assertions, expected int, endpoint, endpointToken *string) bool {
/*
The intention of this function is to return either true or false to
reduce the code by performing the verification in one place only.
@@ -167,6 +168,10 @@ func setupBucketForEndpoint(name string, locking, versioning bool, quota, retent
return false
}
if response != nil {
if response.StatusCode >= 200 && response.StatusCode <= 299 {
fmt.Println("setupBucketForEndpoint(): HTTP Status is in the 2xx range")
return true
}
if response.StatusCode != expected {
assert.Fail(inspectHTTPResponse(response))
return false
@@ -391,9 +396,10 @@ func UploadAnObject(bucketName, fileName string) (*http.Response, error) {
contentType + boundaryEnd
arrayOfBytes := []byte(file)
requestDataBody := bytes.NewReader(arrayOfBytes)
apiURL := "http://localhost:9090/api/v1/buckets/" + bucketName + "/objects/upload" + "?prefix=" + base64.StdEncoding.EncodeToString([]byte(fileName))
request, err := http.NewRequest(
"POST",
"http://localhost:9090/api/v1/buckets/"+bucketName+"/objects/upload",
apiURL,
requestDataBody,
)
if err != nil {
@@ -417,8 +423,9 @@ func DeleteObject(bucketName, path string, recursive, allVersions bool) (*http.R
DELETE:
{{baseUrl}}/buckets/bucketName/objects?path=Y2VzYXJpby50eHQ=&recursive=false&all_versions=false
*/
url := "http://localhost:9090/api/v1/buckets/" + bucketName + "/objects?path=" +
path + "&recursive=" + strconv.FormatBool(recursive) + "&all_versions=" +
prefixEncoded := base64.StdEncoding.EncodeToString([]byte(path))
url := "http://localhost:9090/api/v1/buckets/" + bucketName + "/objects?prefix=" +
prefixEncoded + "&recursive=" + strconv.FormatBool(recursive) + "&all_versions=" +
strconv.FormatBool(allVersions)
request, err := http.NewRequest(
"DELETE",
@@ -484,9 +491,11 @@ func PutObjectsRetentionStatus(bucketName, prefix, versionID, mode, expires stri
}
requestDataJSON, _ := json.Marshal(requestDataAdd)
requestDataBody := bytes.NewReader(requestDataJSON)
apiURL := "http://localhost:9090/api/v1/buckets/" + bucketName + "/objects/retention?prefix=" + prefix + "&version_id=" + versionID
request, err := http.NewRequest(
"PUT",
"http://localhost:9090/api/v1/buckets/"+bucketName+"/objects/retention?prefix="+prefix+"&version_id="+versionID,
apiURL,
requestDataBody,
)
if err != nil {
@@ -722,9 +731,10 @@ func PutObjectsLegalholdStatus(bucketName, prefix, status, versionID string) (*h
}
requestDataJSON, _ := json.Marshal(requestDataAdd)
requestDataBody := bytes.NewReader(requestDataJSON)
apiURL := "http://localhost:9090/api/v1/buckets/" + bucketName + "/objects/legalhold?prefix=" + prefix + "&version_id=" + versionID
request, err := http.NewRequest(
"PUT",
"http://localhost:9090/api/v1/buckets/"+bucketName+"/objects/legalhold?prefix="+prefix+"&version_id="+versionID,
apiURL,
requestDataBody,
)
if err != nil {
@@ -743,19 +753,19 @@ func TestPutObjectsLegalholdStatus(t *testing.T) {
// Variables
assert := assert.New(t)
bucketName := "testputobjectslegalholdstatus"
fileName := "testputobjectslegalholdstatus.txt"
prefix := "dGVzdHB1dG9iamVjdHNsZWdhbGhvbGRzdGF0dXMudHh0" // encoded base64
objName := "testputobjectslegalholdstatus.txt" // // encoded base64 of testputobjectslegalholdstatus.txt = dGVzdHB1dG9iamVjdHNsZWdhbGhvbGRzdGF0dXMudHh0
objectNameEncoded := "dGVzdHB1dG9iamVjdHNsZWdhbGhvbGRzdGF0dXMudHh0"
status := "enabled"
// 1. Create bucket
if !setupBucket(bucketName, true, true, nil, nil, assert, 201) {
if !setupBucket(bucketName, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
return
}
// 2. Add object
uploadResponse, uploadError := UploadAnObject(
bucketName,
fileName,
objName,
)
assert.Nil(uploadError)
if uploadError != nil {
@@ -772,8 +782,8 @@ func TestPutObjectsLegalholdStatus(t *testing.T) {
}
// Get versionID
listResponse, _ := ListObjects(bucketName, prefix, "true")
bodyBytes, _ := ioutil.ReadAll(listResponse.Body)
listResponse, _ := ListObjects(bucketName, "", "true")
bodyBytes, _ := io.ReadAll(listResponse.Body)
listObjs := models.ListObjectsResponse{}
err := json.Unmarshal(bodyBytes, &listObjs)
if err != nil {
@@ -810,7 +820,7 @@ func TestPutObjectsLegalholdStatus(t *testing.T) {
// 3. Put Objects Legal Status
putResponse, putError := PutObjectsLegalholdStatus(
bucketName,
prefix,
objectNameEncoded,
status,
tt.args.versionID,
)
@@ -835,7 +845,7 @@ func TestGetBucketQuota(t *testing.T) {
validBucket := "testgetbucketquota"
// 1. Create bucket
if !setupBucket(validBucket, true, true, nil, nil, assert, 201) {
if !setupBucket(validBucket, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
return
}
@@ -912,7 +922,7 @@ func TestPutBucketQuota(t *testing.T) {
validBucket := "testputbucketquota"
// 1. Create bucket
if !setupBucket(validBucket, true, true, nil, nil, assert, 201) {
if !setupBucket(validBucket, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
return
}
@@ -971,7 +981,7 @@ func TestListBucketEvents(t *testing.T) {
validBucket := "testlistbucketevents"
// 1. Create bucket
if !setupBucket(validBucket, true, true, nil, nil, assert, 201) {
if !setupBucket(validBucket, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
return
}
@@ -1029,7 +1039,7 @@ func TestDeleteObjectsRetentionStatus(t *testing.T) {
validPrefix := encodeBase64(fileName)
// 1. Create bucket
if !setupBucket(bucketName, true, true, nil, nil, assert, 201) {
if !setupBucket(bucketName, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
return
}
@@ -1054,7 +1064,7 @@ func TestDeleteObjectsRetentionStatus(t *testing.T) {
// Get versionID
listResponse, _ := ListObjects(bucketName, validPrefix, "true")
bodyBytes, _ := ioutil.ReadAll(listResponse.Body)
bodyBytes, _ := io.ReadAll(listResponse.Body)
listObjs := models.ListObjectsResponse{}
err := json.Unmarshal(bodyBytes, &listObjs)
if err != nil {
@@ -1136,7 +1146,7 @@ func TestBucketSetPolicy(t *testing.T) {
validBucketName := "testbucketsetpolicy"
// 1. Create bucket
if !setupBucket(validBucketName, true, true, nil, nil, assert, 201) {
if !setupBucket(validBucketName, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
return
}
@@ -1197,7 +1207,7 @@ func TestRestoreObjectToASelectedVersion(t *testing.T) {
validPrefix := encodeBase64(fileName)
// 1. Create bucket
if !setupBucket(bucketName, true, true, nil, nil, assert, 201) {
if !setupBucket(bucketName, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
return
}
@@ -1222,7 +1232,7 @@ func TestRestoreObjectToASelectedVersion(t *testing.T) {
// 3. Get versionID
listResponse, _ := ListObjects(bucketName, validPrefix, "true")
bodyBytes, _ := ioutil.ReadAll(listResponse.Body)
bodyBytes, _ := io.ReadAll(listResponse.Body)
listObjs := models.ListObjectsResponse{}
err := json.Unmarshal(bodyBytes, &listObjs)
if err != nil {
@@ -1285,7 +1295,7 @@ func TestPutBucketsTags(t *testing.T) {
// 1. Create the bucket
assert := assert.New(t)
validBucketName := "testputbuckettags1"
if !setupBucket(validBucketName, false, false, nil, nil, assert, 201) {
if !setupBucket(validBucketName, false, nil, nil, nil, assert, 200) {
return
}
@@ -1343,7 +1353,7 @@ func TestGetsTheMetadataOfAnObject(t *testing.T) {
tags["tag"] = "testputobjecttagbucketonetagone"
// 1. Create the bucket
if !setupBucket(bucketName, false, false, nil, nil, assert, 201) {
if !setupBucket(bucketName, false, nil, nil, nil, assert, 200) {
return
}
@@ -1414,7 +1424,7 @@ func TestPutObjectsRetentionStatus(t *testing.T) {
prefix := encodeBase64(fileName)
// 1. Create bucket
if !setupBucket(bucketName, true, true, nil, nil, assert, 201) {
if !setupBucket(bucketName, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
return
}
@@ -1439,7 +1449,7 @@ func TestPutObjectsRetentionStatus(t *testing.T) {
// Get versionID
listResponse, _ := ListObjects(bucketName, prefix, "true")
bodyBytes, _ := ioutil.ReadAll(listResponse.Body)
bodyBytes, _ := io.ReadAll(listResponse.Body)
listObjs := models.ListObjectsResponse{}
err := json.Unmarshal(bodyBytes, &listObjs)
if err != nil {
@@ -1512,7 +1522,7 @@ func TestShareObjectOnURL(t *testing.T) {
versionID := "null"
// 1. Create the bucket
if !setupBucket(bucketName, false, false, nil, nil, assert, 201) {
if !setupBucket(bucketName, false, nil, nil, nil, assert, 200) {
return
}
@@ -1586,7 +1596,7 @@ func TestListObjects(t *testing.T) {
fileName := "testlistobjecttobucket1.txt"
// 1. Create the bucket
if !setupBucket(bucketName, false, false, nil, nil, assert, 201) {
if !setupBucket(bucketName, false, nil, nil, nil, assert, 200) {
return
}
@@ -1630,11 +1640,10 @@ func TestDeleteObject(t *testing.T) {
assert := assert.New(t)
bucketName := "testdeleteobjectbucket1"
fileName := "testdeleteobjectfile"
path := "dGVzdGRlbGV0ZW9iamVjdGZpbGUxLnR4dA==" // fileName encoded base64
numberOfFiles := 2
// 1. Create bucket
if !setupBucket(bucketName, true, true, nil, nil, assert, 201) {
if !setupBucket(bucketName, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
return
}
@@ -1653,8 +1662,9 @@ func TestDeleteObject(t *testing.T) {
}
}
objPathFull := fileName + "1.txt" // would be encoded in DeleteObject util method.
// 3. Delete only one object from the bucket.
deleteResponse, deleteError := DeleteObject(bucketName, path, false, false)
deleteResponse, deleteError := DeleteObject(bucketName, objPathFull, false, false)
assert.Nil(deleteError)
if deleteError != nil {
log.Println(deleteError)
@@ -1700,7 +1710,7 @@ func TestUploadObjectToBucket(t *testing.T) {
fileName := "sample.txt"
// 1. Create the bucket
if !setupBucket(bucketName, false, false, nil, nil, assert, 201) {
if !setupBucket(bucketName, false, nil, nil, nil, assert, 200) {
return
}
@@ -1735,7 +1745,7 @@ func TestDownloadObject(t *testing.T) {
}
// 1. Create the bucket
if !setupBucket(bucketName, true, true, nil, nil, assert, 201) {
if !setupBucket(bucketName, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
return
}
@@ -1772,7 +1782,7 @@ func TestDownloadObject(t *testing.T) {
}
// 4. Verify the file was downloaded
files, err := ioutil.ReadDir(workingDirectory)
files, err := os.ReadDir(workingDirectory)
if err != nil {
log.Fatal(err)
}
@@ -1797,7 +1807,7 @@ func TestDeleteMultipleObjects(t *testing.T) {
fileName := "testdeletemultipleobjs"
// 1. Create a bucket for this particular test
if !setupBucket(bucketName, false, false, nil, nil, assert, 201) {
if !setupBucket(bucketName, false, nil, nil, nil, assert, 200) {
return
}
@@ -1874,7 +1884,7 @@ func TestPutObjectTag(t *testing.T) {
versionID := "null"
// 1. Create the bucket
if !setupBucket(bucketName, false, false, nil, nil, assert, 201) {
if !setupBucket(bucketName, false, nil, nil, nil, assert, 200) {
return
}
@@ -1948,7 +1958,7 @@ func TestBucketRetention(t *testing.T) {
retention["mode"] = "compliance"
retention["unit"] = "years"
retention["validity"] = 2
if !setupBucket("setbucketretention1", true, true, nil, retention, assert, 201) {
if !setupBucket("setbucketretention1", true, map[string]interface{}{"enabled": true}, nil, retention, assert, 200) {
return
}
@@ -1999,7 +2009,7 @@ func TestBucketInformationGenericErrorResponse(t *testing.T) {
// 1. Create the bucket
assert := assert.New(t)
if !setupBucket("bucketinformation2", false, false, nil, nil, assert, 201) {
if !setupBucket("bucketinformation2", false, nil, nil, nil, assert, 200) {
return
}
@@ -2044,7 +2054,7 @@ func TestBucketInformationSuccessfulResponse(t *testing.T) {
// 1. Create the bucket
assert := assert.New(t)
if !setupBucket("bucketinformation1", false, false, nil, nil, assert, 201) {
if !setupBucket("bucketinformation1", false, nil, nil, nil, assert, 200) {
return
}
@@ -2157,29 +2167,23 @@ func TestListBuckets(t *testing.T) {
// 1. Create buckets
numberOfBuckets := 3
for i := 1; i <= numberOfBuckets; i++ {
if !setupBucket("testlistbuckets"+strconv.Itoa(i), false, false, nil, nil, assert, 201) {
if !setupBucket("testlistbuckets"+strconv.Itoa(i), false, nil, nil, nil, assert, 200) {
return
}
}
// Waiting to retrieve the new list of buckets
time.Sleep(3 * time.Second)
// 2. List buckets
listBucketsResponse, listBucketsError := ListBuckets()
assert.Nil(listBucketsError)
if listBucketsError != nil {
log.Println(listBucketsError)
assert.Fail("Error listing the buckets")
return
}
assert.NotNil(listBucketsResponse)
assert.NotNil(listBucketsResponse.Body)
// 3. Verify list of buckets
b, err := io.ReadAll(listBucketsResponse.Body)
if listBucketsResponse != nil {
if err != nil {
log.Fatalln(err)
}
assert.Equal(200, listBucketsResponse.StatusCode,
"Status Code is incorrect: "+string(b))
}
b, _ := io.ReadAll(listBucketsResponse.Body)
assert.Equal(200, listBucketsResponse.StatusCode,
"Status Code is incorrect: "+string(b))
for i := 1; i <= numberOfBuckets; i++ {
assert.True(strings.Contains(string(b),
"testlistbuckets"+strconv.Itoa(i)))
@@ -2211,7 +2215,7 @@ func TestBucketsGet(t *testing.T) {
if response != nil {
assert.Equal(200, response.StatusCode, "Status Code is incorrect")
bodyBytes, _ := ioutil.ReadAll(response.Body)
bodyBytes, _ := io.ReadAll(response.Body)
listBuckets := models.ListBucketsResponse{}
err = json.Unmarshal(bodyBytes, &listBuckets)
@@ -2251,7 +2255,7 @@ func TestBucketVersioning(t *testing.T) {
if response != nil {
bodyBytes, _ := ioutil.ReadAll(response.Body)
bodyBytes, _ := io.ReadAll(response.Body)
sessionResponse := models.SessionResponse{}
err = json.Unmarshal(bodyBytes, &sessionResponse)
@@ -2273,7 +2277,7 @@ func TestBucketVersioning(t *testing.T) {
requestDataBody := bytes.NewReader(requestDataJSON)
if !setupBucket("test2", true, false, nil, nil, assert, 201) {
if !setupBucket("test2", true, nil, nil, nil, assert, 200) {
return
}
@@ -2288,7 +2292,7 @@ func TestBucketVersioning(t *testing.T) {
assert.Equal(
200, getVersioningResult.StatusCode, "Status Code is incorrect")
}
bodyBytes, _ := ioutil.ReadAll(getVersioningResult.Body)
bodyBytes, _ := io.ReadAll(getVersioningResult.Body)
structBucketRepl := models.BucketVersioningResponse{
ExcludeFolders: false,
ExcludedPrefixes: nil,
@@ -2310,12 +2314,12 @@ func TestBucketVersioning(t *testing.T) {
if distributedSystem {
assert.Equal(200, response.StatusCode, "Versioning test Status Code is incorrect - bucket failed to create")
} else {
assert.NotEqual(201, response.StatusCode, "Versioning test Status Code is incorrect - versioned bucket created on non-distributed system")
assert.NotEqual(200, response.StatusCode, "Versioning test Status Code is incorrect - versioned bucket created on non-distributed system")
}
request, error := http.NewRequest("DELETE", "http://localhost:9090/api/v1/buckets/test2", requestDataBody)
if error != nil {
log.Println(error)
request, err = http.NewRequest("DELETE", "http://localhost:9090/api/v1/buckets/test2", requestDataBody)
if err != nil {
log.Println(err)
return
}
@@ -2341,7 +2345,7 @@ func TestSetBucketTags(t *testing.T) {
}
// put bucket
if !setupBucket("test4", false, false, nil, nil, assert, 201) {
if !setupBucket("test4", false, nil, nil, nil, assert, 200) {
return
}
@@ -2365,7 +2369,7 @@ func TestSetBucketTags(t *testing.T) {
request.Header.Add("Cookie", fmt.Sprintf("token=%s", token))
request.Header.Add("Content-Type", "application/json")
response, err := client.Do(request)
_, err = client.Do(request)
assert.Nil(err)
if err != nil {
log.Println(err)
@@ -2383,14 +2387,14 @@ func TestSetBucketTags(t *testing.T) {
request.Header.Add("Cookie", fmt.Sprintf("token=%s", token))
request.Header.Add("Content-Type", "application/json")
response, err = client.Do(request)
response, err := client.Do(request)
assert.Nil(err)
if err != nil {
log.Println(err)
return
}
bodyBytes, _ := ioutil.ReadAll(response.Body)
bodyBytes, _ := io.ReadAll(response.Body)
bucket := models.Bucket{}
err = json.Unmarshal(bodyBytes, &bucket)
@@ -2408,7 +2412,7 @@ func TestGetBucket(t *testing.T) {
Timeout: 2 * time.Second,
}
if !setupBucket("test3", false, false, nil, nil, assert, 201) {
if !setupBucket("test3", false, nil, nil, nil, assert, 200) {
return
}
@@ -2446,7 +2450,7 @@ func TestAddBucket(t *testing.T) {
}{
{
name: "Add Bucket with valid name",
expectedStatus: 201,
expectedStatus: 200,
args: args{
bucketName: "test1",
},
@@ -2461,7 +2465,7 @@ func TestAddBucket(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if !setupBucket(tt.args.bucketName, false, false, nil, nil, assert, tt.expectedStatus) {
if !setupBucket(tt.args.bucketName, false, nil, nil, nil, assert, tt.expectedStatus) {
return
}
})
@@ -2843,7 +2847,7 @@ func TestReplication(t *testing.T) {
}
// 3. Get rule ID and status from response's body
bodyBytes, _ := ioutil.ReadAll(response.Body)
bodyBytes, _ := io.ReadAll(response.Body)
structBucketRepl := models.BucketReplicationResponse{}
err = json.Unmarshal(bodyBytes, &structBucketRepl)
if err != nil {
@@ -2925,7 +2929,7 @@ func TestReplication(t *testing.T) {
}
// 9. Get rule ID and status from response's body
bodyBytes, _ = ioutil.ReadAll(response.Body)
bodyBytes, _ = io.ReadAll(response.Body)
structBucketRepl = models.BucketReplicationResponse{}
err = json.Unmarshal(bodyBytes, &structBucketRepl)
if err != nil {
@@ -2992,7 +2996,7 @@ func TestReturnsTheStatusOfObjectLockingSupportOnTheBucket(t *testing.T) {
}
// 2. Verify the status to be enabled for this bucket
bodyBytes, _ := ioutil.ReadAll(response.Body)
bodyBytes, _ := io.ReadAll(response.Body)
structBucketLocking := models.BucketObLockingResponse{}
err = json.Unmarshal(bodyBytes, &structBucketLocking)
if err != nil {
@@ -3006,7 +3010,7 @@ func TestReturnsTheStatusOfObjectLockingSupportOnTheBucket(t *testing.T) {
)
}
func SetBucketVersioning(bucketName string, versioning bool, endpoint, useToken *string) (*http.Response, error) {
func SetBucketVersioning(bucketName string, versioning map[string]interface{}, endpoint, useToken *string) (*http.Response, error) {
/*
Helper function to set Bucket Versioning
*/
@@ -3043,15 +3047,15 @@ func TestSetBucketVersioning(t *testing.T) {
assert := assert.New(t)
bucket := "test-set-bucket-versioning"
locking := false
versioning := true
versioning := map[string]interface{}{"enabled": true}
// 1. Create bucket with versioning as true and locking as false
if !setupBucket(bucket, locking, versioning, nil, nil, assert, 201) {
if !setupBucket(bucket, locking, versioning, nil, nil, assert, 200) {
return
}
// 2. Set versioning as False i.e Suspend versioning
response, err := SetBucketVersioning(bucket, false, nil, nil)
response, err := SetBucketVersioning(bucket, map[string]interface{}{"enabled": false}, nil, nil)
assert.Nil(err)
if err != nil {
log.Println(err)
@@ -3073,7 +3077,7 @@ func TestSetBucketVersioning(t *testing.T) {
assert.Equal(
200, getVersioningResult.StatusCode, "Status Code is incorrect")
}
bodyBytes, _ := ioutil.ReadAll(getVersioningResult.Body)
bodyBytes, _ := io.ReadAll(getVersioningResult.Body)
result := models.BucketVersioningResponse{
ExcludeFolders: false,
ExcludedPrefixes: nil,
@@ -3124,12 +3128,11 @@ func TestEnableBucketEncryption(t *testing.T) {
assert := assert.New(t)
bucketName := "test-enable-bucket-encryption"
locking := false
versioning := false
encType := "sse-s3"
kmsKeyID := ""
// 1. Add bucket
if !setupBucket(bucketName, locking, versioning, nil, nil, assert, 201) {
if !setupBucket(bucketName, locking, nil, nil, nil, assert, 200) {
return
}
@@ -3156,7 +3159,7 @@ func TestEnableBucketEncryption(t *testing.T) {
assert.Equal(
200, resp.StatusCode, "Status Code is incorrect")
}
bodyBytes, _ := ioutil.ReadAll(resp.Body)
bodyBytes, _ := io.ReadAll(resp.Body)
result := models.BucketEncryptionInfo{}
err = json.Unmarshal(bodyBytes, &result)
if err != nil {
@@ -3188,14 +3191,14 @@ func TestEnableBucketEncryption(t *testing.T) {
assert.Equal(
404, resp.StatusCode, "Status Code is incorrect")
}
bodyBytes, _ = ioutil.ReadAll(resp.Body)
result2 := models.Error{}
bodyBytes, _ = io.ReadAll(resp.Body)
result2 := models.APIError{}
err = json.Unmarshal(bodyBytes, &result2)
if err != nil {
log.Println(err)
assert.Nil(err)
}
dereferencedPointerDetailedMessage := *result2.DetailedMessage
dereferencedPointerDetailedMessage := result2.DetailedMessage
assert.Equal("error server side encryption configuration not found", dereferencedPointerDetailedMessage, dereferencedPointerDetailedMessage)
}
@@ -3387,7 +3390,6 @@ func TestBucketLifeCycle(t *testing.T) {
assert := assert.New(t)
bucketName := "test-bucket-life-cycle"
locking := false
versioning := false
ltype := "expiry"
prefix := ""
tags := ""
@@ -3398,7 +3400,7 @@ func TestBucketLifeCycle(t *testing.T) {
var noncurrentversionExpirationDays int64
// 1. Add bucket
if !setupBucket(bucketName, locking, versioning, nil, nil, assert, 201) {
if !setupBucket(bucketName, locking, nil, nil, nil, assert, 200) {
return
}
@@ -3433,7 +3435,7 @@ func TestBucketLifeCycle(t *testing.T) {
assert.Equal(
200, resp.StatusCode, "Status Code is incorrect")
}
bodyBytes, _ := ioutil.ReadAll(resp.Body)
bodyBytes, _ := io.ReadAll(resp.Body)
result := models.BucketLifecycleResponse{}
err = json.Unmarshal(bodyBytes, &result)
if err != nil {
@@ -3479,7 +3481,7 @@ func TestBucketLifeCycle(t *testing.T) {
assert.Equal(
200, resp.StatusCode, "Status Code is incorrect")
}
bodyBytes, _ = ioutil.ReadAll(resp.Body)
bodyBytes, _ = io.ReadAll(resp.Body)
result = models.BucketLifecycleResponse{}
err = json.Unmarshal(bodyBytes, &result)
if err != nil {
@@ -3603,12 +3605,11 @@ func TestAccessRule(t *testing.T) {
assert := assert.New(t)
bucketName := "test-access-rule-bucket"
locking := false
versioning := false
prefix := "prefix"
access := "readonly"
// 1. Add bucket
if !setupBucket(bucketName, locking, versioning, nil, nil, assert, 201) {
if !setupBucket(bucketName, locking, nil, nil, nil, assert, 200) {
return
}
@@ -3639,7 +3640,7 @@ func TestAccessRule(t *testing.T) {
assert.Equal(
200, resp.StatusCode, "Status Code is incorrect")
}
bodyBytes, _ := ioutil.ReadAll(resp.Body)
bodyBytes, _ := io.ReadAll(resp.Body)
result := models.ListAccessRulesResponse{}
err = json.Unmarshal(bodyBytes, &result)
if err != nil {
@@ -3677,7 +3678,7 @@ func TestAccessRule(t *testing.T) {
assert.Equal(
200, resp.StatusCode, "Status Code is incorrect")
}
bodyBytes, _ = ioutil.ReadAll(resp.Body)
bodyBytes, _ = io.ReadAll(resp.Body)
result = models.ListAccessRulesResponse{}
err = json.Unmarshal(bodyBytes, &result)
if err != nil {
@@ -3852,16 +3853,16 @@ func TestAddRemoteBucket(t *testing.T) {
fmt.Println("targetBucket: ", targetBucket)
// 1. Create bucket
if !setupBucket("source", true, true, nil, nil, assert, 201) {
if !setupBucket("source", true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
return
}
// 1.1. Create target bucket
targetEndpoint := "http://localhost:9092"
targetToken := getTokenForEndpoint(targetEndpoint)
if !setupBucketForEndpoint(targetBucket, true, true, nil, nil, assert, 201, &targetEndpoint, &targetToken) {
if !setupBucketForEndpoint(targetBucket, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200, &targetEndpoint, &targetToken) {
log.Println("bucket already exists")
}
_, err := SetBucketVersioning(targetBucket, false, &targetURL, &targetToken)
_, err := SetBucketVersioning(targetBucket, map[string]interface{}{"enabled": false}, &targetURL, &targetToken)
if err != nil {
log.Println("bucket already has versioning")
}
@@ -3911,16 +3912,16 @@ func TestDeleteRemoteBucket(t *testing.T) {
fmt.Println("targetBucket: ", targetBucket)
// 1. Create bucket
if !setupBucket("deletesource", true, true, nil, nil, assert, 201) {
if !setupBucket("deletesource", true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200) {
return
}
// 1.1. Create target bucket
targetEndpoint := "http://localhost:9092"
targetToken := getTokenForEndpoint(targetEndpoint)
if !setupBucketForEndpoint(targetBucket, true, true, nil, nil, assert, 201, &targetEndpoint, &targetToken) {
if !setupBucketForEndpoint(targetBucket, true, map[string]interface{}{"enabled": true}, nil, nil, assert, 200, &targetEndpoint, &targetToken) {
log.Println("bucket already exists")
}
_, err := SetBucketVersioning(targetBucket, false, &targetURL, &targetToken)
_, err := SetBucketVersioning(targetBucket, map[string]interface{}{"enabled": false}, &targetURL, &targetToken)
if err != nil {
log.Println("bucket already has versioning")
}
@@ -3946,21 +3947,13 @@ func TestDeleteRemoteBucket(t *testing.T) {
// 3. Get ARN
resp, err = GetRemoteBucketARN(sourceBucket)
assert.Nil(err)
if err != nil {
log.Println(err)
return
}
bodyBytes, _ := ioutil.ReadAll(resp.Body)
assert.NotNil(resp)
assert.NotNil(resp.Body)
bodyBytes, _ := io.ReadAll(resp.Body)
remoteBucket := models.RemoteBucket{}
err = json.Unmarshal(bodyBytes, &remoteBucket)
if err != nil {
log.Println(err)
assert.Nil(err)
}
if resp != nil {
assert.Equal(
200, resp.StatusCode, inspectHTTPResponse(resp))
}
assert.Nil(err)
assert.Equal(200, resp.StatusCode, inspectHTTPResponse(resp))
// 4. Delete Remote Bucket
if remoteBucket.RemoteARN != nil {

View File

@@ -715,7 +715,6 @@ func TestCreateServiceAccountForUser(t *testing.T) {
userName := "testcreateserviceaccountforuser1"
assert := assert.New(t)
policy := ""
serviceAccountLengthInBytes := 40 // As observed, update as needed
// 1. Create the user
groups := []string{}
@@ -765,8 +764,6 @@ func TestCreateServiceAccountForUser(t *testing.T) {
finalResponse,
)
}
assert.Equal(len(finalResponse), serviceAccountLengthInBytes, finalResponse)
}
func TestUsersGroupsBulk(t *testing.T) {

View File

@@ -1,73 +0,0 @@
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package integration
import (
"fmt"
"log"
"net/http"
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func Test_VersionAPI(t *testing.T) {
assert := assert.New(t)
type args struct {
api string
}
tests := []struct {
name string
args args
expectedStatus int
expectedError error
}{
{
name: "Check Version",
args: args{
api: "/check-version",
},
expectedStatus: 200,
expectedError: nil,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
client := &http.Client{
Timeout: 3 * time.Second,
}
request, err := http.NewRequest(
"GET", fmt.Sprintf("http://localhost:9090/api/v1%s", tt.args.api), nil)
if err != nil {
log.Println(err)
return
}
request.Header.Add("Content-Type", "application/json")
response, err := client.Do(request)
if err != nil {
log.Println(err)
return
}
if response != nil {
assert.Equal(tt.expectedStatus, response.StatusCode, "Status Code is incorrect")
}
})
}
}

View File

@@ -46,6 +46,9 @@ type AddBucketLifecycle struct {
// Required in case of expiry_date or transition fields are not set. it defines an expiry days for ILM
ExpiryDays int32 `json:"expiry_days,omitempty"`
// Non required, can be set in case of expiration is enabled
NewerNoncurrentversionExpirationVersions int32 `json:"newer_noncurrentversion_expiration_versions,omitempty"`
// Non required, can be set in case of expiration is enabled
NoncurrentversionExpirationDays int32 `json:"noncurrentversion_expiration_days,omitempty"`

View File

@@ -228,6 +228,11 @@ func (m *AdminInfoResponse) ContextValidate(ctx context.Context, formats strfmt.
func (m *AdminInfoResponse) contextValidateBackend(ctx context.Context, formats strfmt.Registry) error {
if m.Backend != nil {
if swag.IsZero(m.Backend) { // not required
return nil
}
if err := m.Backend.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("backend")
@@ -246,6 +251,11 @@ func (m *AdminInfoResponse) contextValidateServers(ctx context.Context, formats
for i := 0; i < len(m.Servers); i++ {
if m.Servers[i] != nil {
if swag.IsZero(m.Servers[i]) { // not required
return nil
}
if err := m.Servers[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("servers" + "." + strconv.Itoa(i))
@@ -266,6 +276,11 @@ func (m *AdminInfoResponse) contextValidateWidgets(ctx context.Context, formats
for i := 0; i < len(m.Widgets); i++ {
if m.Widgets[i] != nil {
if swag.IsZero(m.Widgets[i]) { // not required
return nil
}
if err := m.Widgets[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("widgets" + "." + strconv.Itoa(i))

70
models/api_error.go Normal file
View File

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

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

@@ -185,6 +185,11 @@ func (m *Bucket) ContextValidate(ctx context.Context, formats strfmt.Registry) e
func (m *Bucket) contextValidateAccess(ctx context.Context, formats strfmt.Registry) error {
if m.Access != nil {
if swag.IsZero(m.Access) { // not required
return nil
}
if err := m.Access.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("access")
@@ -201,6 +206,11 @@ func (m *Bucket) contextValidateAccess(ctx context.Context, formats strfmt.Regis
func (m *Bucket) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error {
if m.Details != nil {
if swag.IsZero(m.Details) { // not required
return nil
}
if err := m.Details.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("details")
@@ -217,6 +227,11 @@ func (m *Bucket) contextValidateDetails(ctx context.Context, formats strfmt.Regi
func (m *Bucket) contextValidateRwAccess(ctx context.Context, formats strfmt.Registry) error {
if m.RwAccess != nil {
if swag.IsZero(m.RwAccess) { // not required
return nil
}
if err := m.RwAccess.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("rw_access")
@@ -322,6 +337,11 @@ func (m *BucketDetails) ContextValidate(ctx context.Context, formats strfmt.Regi
func (m *BucketDetails) contextValidateQuota(ctx context.Context, formats strfmt.Registry) error {
if m.Quota != nil {
if swag.IsZero(m.Quota) { // not required
return nil
}
if err := m.Quota.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("details" + "." + "quota")

View File

@@ -92,6 +92,11 @@ func (m *BucketEncryptionRequest) ContextValidate(ctx context.Context, formats s
func (m *BucketEncryptionRequest) contextValidateEncType(ctx context.Context, formats strfmt.Registry) error {
if m.EncType != nil {
if swag.IsZero(m.EncType) { // not required
return nil
}
if err := m.EncType.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("encType")

View File

@@ -95,6 +95,7 @@ func (m *BucketEventRequest) ContextValidate(ctx context.Context, formats strfmt
func (m *BucketEventRequest) contextValidateConfiguration(ctx context.Context, formats strfmt.Registry) error {
if m.Configuration != nil {
if err := m.Configuration.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("configuration")

View File

@@ -99,6 +99,11 @@ func (m *BucketLifecycleResponse) contextValidateLifecycle(ctx context.Context,
for i := 0; i < len(m.Lifecycle); i++ {
if m.Lifecycle[i] != nil {
if swag.IsZero(m.Lifecycle[i]) { // not required
return nil
}
if err := m.Lifecycle[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("lifecycle" + "." + strconv.Itoa(i))

View File

@@ -99,6 +99,11 @@ func (m *BucketReplicationResponse) contextValidateRules(ctx context.Context, fo
for i := 0; i < len(m.Rules); i++ {
if m.Rules[i] != nil {
if swag.IsZero(m.Rules[i]) { // not required
return nil
}
if err := m.Rules[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("rules" + "." + strconv.Itoa(i))

View File

@@ -224,6 +224,11 @@ func (m *BucketReplicationRule) ContextValidate(ctx context.Context, formats str
func (m *BucketReplicationRule) contextValidateDestination(ctx context.Context, formats strfmt.Registry) error {
if m.Destination != nil {
if swag.IsZero(m.Destination) { // not required
return nil
}
if err := m.Destination.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("destination")

View File

@@ -36,17 +36,17 @@ import (
// swagger:model bucketVersioningResponse
type BucketVersioningResponse struct {
// exclude folders
ExcludeFolders bool `json:"ExcludeFolders,omitempty"`
// excluded prefixes
ExcludedPrefixes []*BucketVersioningResponseExcludedPrefixesItems0 `json:"ExcludedPrefixes"`
// m f a delete
MFADelete string `json:"MFADelete,omitempty"`
// exclude folders
ExcludeFolders bool `json:"excludeFolders,omitempty"`
// excluded prefixes
ExcludedPrefixes []*BucketVersioningResponseExcludedPrefixesItems0 `json:"excludedPrefixes"`
// status
Status string `json:"Status,omitempty"`
Status string `json:"status,omitempty"`
}
// Validate validates this bucket versioning response
@@ -76,9 +76,9 @@ func (m *BucketVersioningResponse) validateExcludedPrefixes(formats strfmt.Regis
if m.ExcludedPrefixes[i] != nil {
if err := m.ExcludedPrefixes[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("ExcludedPrefixes" + "." + strconv.Itoa(i))
return ve.ValidateName("excludedPrefixes" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("ExcludedPrefixes" + "." + strconv.Itoa(i))
return ce.ValidateName("excludedPrefixes" + "." + strconv.Itoa(i))
}
return err
}
@@ -108,11 +108,16 @@ func (m *BucketVersioningResponse) contextValidateExcludedPrefixes(ctx context.C
for i := 0; i < len(m.ExcludedPrefixes); i++ {
if m.ExcludedPrefixes[i] != nil {
if swag.IsZero(m.ExcludedPrefixes[i]) { // not required
return nil
}
if err := m.ExcludedPrefixes[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("ExcludedPrefixes" + "." + strconv.Itoa(i))
return ve.ValidateName("excludedPrefixes" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("ExcludedPrefixes" + "." + strconv.Itoa(i))
return ce.ValidateName("excludedPrefixes" + "." + strconv.Itoa(i))
}
return err
}
@@ -147,7 +152,7 @@ func (m *BucketVersioningResponse) UnmarshalBinary(b []byte) error {
type BucketVersioningResponseExcludedPrefixesItems0 struct {
// prefix
Prefix string `json:"Prefix,omitempty"`
Prefix string `json:"prefix,omitempty"`
}
// Validate validates this bucket versioning response excluded prefixes items0

View File

@@ -102,6 +102,11 @@ func (m *Configuration) contextValidateKeyValues(ctx context.Context, formats st
for i := 0; i < len(m.KeyValues); i++ {
if m.KeyValues[i] != nil {
if swag.IsZero(m.KeyValues[i]) { // not required
return nil
}
if err := m.KeyValues[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("key_values" + "." + strconv.Itoa(i))

View File

@@ -95,6 +95,11 @@ func (m *ConfigurationKV) ContextValidate(ctx context.Context, formats strfmt.Re
func (m *ConfigurationKV) contextValidateEnvOverride(ctx context.Context, formats strfmt.Registry) error {
if m.EnvOverride != nil {
if swag.IsZero(m.EnvOverride) { // not required
return nil
}
if err := m.EnvOverride.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("env_override")

View File

@@ -43,6 +43,9 @@ type ExpirationResponse struct {
// delete marker
DeleteMarker bool `json:"delete_marker,omitempty"`
// newer noncurrent expiration versions
NewerNoncurrentExpirationVersions int64 `json:"newer_noncurrent_expiration_versions,omitempty"`
// noncurrent expiration days
NoncurrentExpirationDays int64 `json:"noncurrent_expiration_days,omitempty"`
}

View File

@@ -117,6 +117,10 @@ func (m *GetBucketRetentionConfig) ContextValidate(ctx context.Context, formats
func (m *GetBucketRetentionConfig) contextValidateMode(ctx context.Context, formats strfmt.Registry) error {
if swag.IsZero(m.Mode) { // not required
return nil
}
if err := m.Mode.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("mode")
@@ -131,6 +135,10 @@ func (m *GetBucketRetentionConfig) contextValidateMode(ctx context.Context, form
func (m *GetBucketRetentionConfig) contextValidateUnit(ctx context.Context, formats strfmt.Registry) error {
if swag.IsZero(m.Unit) { // not required
return nil
}
if err := m.Unit.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("unit")

View File

@@ -102,6 +102,11 @@ func (m *IamPolicy) contextValidateStatement(ctx context.Context, formats strfmt
for i := 0; i < len(m.Statement); i++ {
if m.Statement[i] != nil {
if swag.IsZero(m.Statement[i]) { // not required
return nil
}
if err := m.Statement[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("statement" + "." + strconv.Itoa(i))

View File

@@ -99,6 +99,11 @@ func (m *IdpListConfigurationsResponse) contextValidateResults(ctx context.Conte
for i := 0; i < len(m.Results); i++ {
if m.Results[i] != nil {
if swag.IsZero(m.Results[i]) { // not required
return nil
}
if err := m.Results[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("results" + "." + strconv.Itoa(i))

View File

@@ -111,6 +111,11 @@ func (m *IdpServerConfiguration) contextValidateInfo(ctx context.Context, format
for i := 0; i < len(m.Info); i++ {
if m.Info[i] != nil {
if swag.IsZero(m.Info[i]) { // not required
return nil
}
if err := m.Info[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("info" + "." + strconv.Itoa(i))

View File

@@ -99,6 +99,11 @@ func (m *KmsAPIsResponse) contextValidateResults(ctx context.Context, formats st
for i := 0; i < len(m.Results); i++ {
if m.Results[i] != nil {
if swag.IsZero(m.Results[i]) { // not required
return nil
}
if err := m.Results[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("results" + "." + strconv.Itoa(i))

View File

@@ -104,6 +104,11 @@ func (m *KmsDescribeSelfIdentityResponse) ContextValidate(ctx context.Context, f
func (m *KmsDescribeSelfIdentityResponse) contextValidatePolicy(ctx context.Context, formats strfmt.Registry) error {
if m.Policy != nil {
if swag.IsZero(m.Policy) { // not required
return nil
}
if err := m.Policy.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("policy")

View File

@@ -99,6 +99,11 @@ func (m *KmsListIdentitiesResponse) contextValidateResults(ctx context.Context,
for i := 0; i < len(m.Results); i++ {
if m.Results[i] != nil {
if swag.IsZero(m.Results[i]) { // not required
return nil
}
if err := m.Results[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("results" + "." + strconv.Itoa(i))

View File

@@ -99,6 +99,11 @@ func (m *KmsListKeysResponse) contextValidateResults(ctx context.Context, format
for i := 0; i < len(m.Results); i++ {
if m.Results[i] != nil {
if swag.IsZero(m.Results[i]) { // not required
return nil
}
if err := m.Results[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("results" + "." + strconv.Itoa(i))

View File

@@ -99,6 +99,11 @@ func (m *KmsListPoliciesResponse) contextValidateResults(ctx context.Context, fo
for i := 0; i < len(m.Results); i++ {
if m.Results[i] != nil {
if swag.IsZero(m.Results[i]) { // not required
return nil
}
if err := m.Results[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("results" + "." + strconv.Itoa(i))

View File

@@ -309,6 +309,11 @@ func (m *KmsMetricsResponse) contextValidateLatencyHistogram(ctx context.Context
for i := 0; i < len(m.LatencyHistogram); i++ {
if m.LatencyHistogram[i] != nil {
if swag.IsZero(m.LatencyHistogram[i]) { // not required
return nil
}
if err := m.LatencyHistogram[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("latencyHistogram" + "." + strconv.Itoa(i))

View File

@@ -105,6 +105,11 @@ func (m *KmsStatusResponse) contextValidateEndpoints(ctx context.Context, format
for i := 0; i < len(m.Endpoints); i++ {
if m.Endpoints[i] != nil {
if swag.IsZero(m.Endpoints[i]) { // not required
return nil
}
if err := m.Endpoints[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("endpoints" + "." + strconv.Itoa(i))

265
models/ldap_entities.go Normal file
View File

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

View File

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

View File

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

View File

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

View File

@@ -29,30 +29,30 @@ import (
"github.com/go-openapi/swag"
)
// CheckVersionResponse check version response
// LdapUserPolicyEntity ldap user policy entity
//
// swagger:model checkVersionResponse
type CheckVersionResponse struct {
// swagger:model ldapUserPolicyEntity
type LdapUserPolicyEntity struct {
// current version
CurrentVersion string `json:"current_version,omitempty"`
// policies
Policies []string `json:"policies"`
// latest version
LatestVersion string `json:"latest_version,omitempty"`
// user
User string `json:"user,omitempty"`
}
// Validate validates this check version response
func (m *CheckVersionResponse) Validate(formats strfmt.Registry) error {
// Validate validates this ldap user policy entity
func (m *LdapUserPolicyEntity) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this check version response based on context it is used
func (m *CheckVersionResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
// ContextValidate validates this ldap user policy entity based on context it is used
func (m *LdapUserPolicyEntity) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *CheckVersionResponse) MarshalBinary() ([]byte, error) {
func (m *LdapUserPolicyEntity) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@@ -60,8 +60,8 @@ func (m *CheckVersionResponse) MarshalBinary() ([]byte, error) {
}
// UnmarshalBinary interface implementation
func (m *CheckVersionResponse) UnmarshalBinary(b []byte) error {
var res CheckVersionResponse
func (m *LdapUserPolicyEntity) UnmarshalBinary(b []byte) error {
var res LdapUserPolicyEntity
if err := swag.ReadJSON(b, &res); err != nil {
return err
}

View File

@@ -102,6 +102,11 @@ func (m *ListAccessRulesResponse) contextValidateAccessRules(ctx context.Context
for i := 0; i < len(m.AccessRules); i++ {
if m.AccessRules[i] != nil {
if swag.IsZero(m.AccessRules[i]) { // not required
return nil
}
if err := m.AccessRules[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("accessRules" + "." + strconv.Itoa(i))

View File

@@ -102,6 +102,11 @@ func (m *ListBucketEventsResponse) contextValidateEvents(ctx context.Context, fo
for i := 0; i < len(m.Events); i++ {
if m.Events[i] != nil {
if swag.IsZero(m.Events[i]) { // not required
return nil
}
if err := m.Events[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("events" + "." + strconv.Itoa(i))

View File

@@ -102,6 +102,11 @@ func (m *ListBucketsResponse) contextValidateBuckets(ctx context.Context, format
for i := 0; i < len(m.Buckets); i++ {
if m.Buckets[i] != nil {
if swag.IsZero(m.Buckets[i]) { // not required
return nil
}
if err := m.Buckets[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("buckets" + "." + strconv.Itoa(i))

View File

@@ -102,6 +102,11 @@ func (m *ListConfigResponse) contextValidateConfigurations(ctx context.Context,
for i := 0; i < len(m.Configurations); i++ {
if m.Configurations[i] != nil {
if swag.IsZero(m.Configurations[i]) { // not required
return nil
}
if err := m.Configurations[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("configurations" + "." + strconv.Itoa(i))

View File

@@ -102,6 +102,11 @@ func (m *ListObjectsResponse) contextValidateObjects(ctx context.Context, format
for i := 0; i < len(m.Objects); i++ {
if m.Objects[i] != nil {
if swag.IsZero(m.Objects[i]) { // not required
return nil
}
if err := m.Objects[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("objects" + "." + strconv.Itoa(i))

View File

@@ -102,6 +102,11 @@ func (m *ListPoliciesResponse) contextValidatePolicies(ctx context.Context, form
for i := 0; i < len(m.Policies); i++ {
if m.Policies[i] != nil {
if swag.IsZero(m.Policies[i]) { // not required
return nil
}
if err := m.Policies[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("policies" + "." + strconv.Itoa(i))

View File

@@ -102,6 +102,11 @@ func (m *ListRemoteBucketsResponse) contextValidateBuckets(ctx context.Context,
for i := 0; i < len(m.Buckets); i++ {
if m.Buckets[i] != nil {
if swag.IsZero(m.Buckets[i]) { // not required
return nil
}
if err := m.Buckets[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("buckets" + "." + strconv.Itoa(i))

View File

@@ -99,6 +99,11 @@ func (m *ListUsersResponse) contextValidateUsers(ctx context.Context, formats st
for i := 0; i < len(m.Users); i++ {
if m.Users[i] != nil {
if swag.IsZero(m.Users[i]) { // not required
return nil
}
if err := m.Users[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("users" + "." + strconv.Itoa(i))

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"`
@@ -163,6 +163,11 @@ func (m *LoginDetails) contextValidateRedirectRules(ctx context.Context, formats
for i := 0; i < len(m.RedirectRules); i++ {
if m.RedirectRules[i] != nil {
if swag.IsZero(m.RedirectRules[i]) { // not required
return nil
}
if err := m.RedirectRules[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("redirectRules" + "." + strconv.Itoa(i))

View File

@@ -98,6 +98,11 @@ func (m *LoginRequest) ContextValidate(ctx context.Context, formats strfmt.Regis
func (m *LoginRequest) contextValidateFeatures(ctx context.Context, formats strfmt.Registry) error {
if m.Features != nil {
if swag.IsZero(m.Features) { // not required
return nil
}
if err := m.Features.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("features")

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...)
}
@@ -143,6 +170,11 @@ func (m *MakeBucketRequest) ContextValidate(ctx context.Context, formats strfmt.
func (m *MakeBucketRequest) contextValidateQuota(ctx context.Context, formats strfmt.Registry) error {
if m.Quota != nil {
if swag.IsZero(m.Quota) { // not required
return nil
}
if err := m.Quota.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("quota")
@@ -159,6 +191,11 @@ func (m *MakeBucketRequest) contextValidateQuota(ctx context.Context, formats st
func (m *MakeBucketRequest) contextValidateRetention(ctx context.Context, formats strfmt.Registry) error {
if m.Retention != nil {
if swag.IsZero(m.Retention) { // not required
return nil
}
if err := m.Retention.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("retention")
@@ -172,6 +209,27 @@ func (m *MakeBucketRequest) contextValidateRetention(ctx context.Context, format
return nil
}
func (m *MakeBucketRequest) contextValidateVersioning(ctx context.Context, formats strfmt.Registry) error {
if m.Versioning != nil {
if swag.IsZero(m.Versioning) { // not required
return nil
}
if err := m.Versioning.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("versioning")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("versioning")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *MakeBucketRequest) MarshalBinary() ([]byte, error) {
if m == nil {

View File

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

View File

@@ -31,32 +31,21 @@ import (
"github.com/go-openapi/validate"
)
// Error error
// MaxShareLinkExpResponse max share link exp response
//
// swagger:model error
type Error struct {
// swagger:model maxShareLinkExpResponse
type MaxShareLinkExpResponse struct {
// code
Code int32 `json:"code,omitempty"`
// detailed message
// exp
// Required: true
DetailedMessage *string `json:"detailedMessage"`
// message
// Required: true
Message *string `json:"message"`
Exp *int64 `json:"exp"`
}
// Validate validates this error
func (m *Error) Validate(formats strfmt.Registry) error {
// Validate validates this max share link exp response
func (m *MaxShareLinkExpResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateDetailedMessage(formats); err != nil {
res = append(res, err)
}
if err := m.validateMessage(formats); err != nil {
if err := m.validateExp(formats); err != nil {
res = append(res, err)
}
@@ -66,31 +55,22 @@ func (m *Error) Validate(formats strfmt.Registry) error {
return nil
}
func (m *Error) validateDetailedMessage(formats strfmt.Registry) error {
func (m *MaxShareLinkExpResponse) validateExp(formats strfmt.Registry) error {
if err := validate.Required("detailedMessage", "body", m.DetailedMessage); err != nil {
if err := validate.Required("exp", "body", m.Exp); err != nil {
return err
}
return nil
}
func (m *Error) validateMessage(formats strfmt.Registry) error {
if err := validate.Required("message", "body", m.Message); err != nil {
return err
}
return nil
}
// ContextValidate validates this error based on context it is used
func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
// ContextValidate validates this max share link exp response based on context it is used
func (m *MaxShareLinkExpResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *Error) MarshalBinary() ([]byte, error) {
func (m *MaxShareLinkExpResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
@@ -98,8 +78,8 @@ func (m *Error) MarshalBinary() ([]byte, error) {
}
// UnmarshalBinary interface implementation
func (m *Error) UnmarshalBinary(b []byte) error {
var res Error
func (m *MaxShareLinkExpResponse) UnmarshalBinary(b []byte) error {
var res MaxShareLinkExpResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}

View File

@@ -244,6 +244,11 @@ func (m *MultiBucketReplication) contextValidateBucketsRelation(ctx context.Cont
for i := 0; i < len(m.BucketsRelation); i++ {
if m.BucketsRelation[i] != nil {
if swag.IsZero(m.BucketsRelation[i]) { // not required
return nil
}
if err := m.BucketsRelation[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("bucketsRelation" + "." + strconv.Itoa(i))

View File

@@ -99,6 +99,11 @@ func (m *MultiBucketResponseState) contextValidateReplicationState(ctx context.C
for i := 0; i < len(m.ReplicationState); i++ {
if m.ReplicationState[i] != nil {
if swag.IsZero(m.ReplicationState[i]) { // not required
return nil
}
if err := m.ReplicationState[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("replicationState" + "." + strconv.Itoa(i))

View File

@@ -99,6 +99,11 @@ func (m *MultiLifecycleResult) contextValidateResults(ctx context.Context, forma
for i := 0; i < len(m.Results); i++ {
if m.Results[i] != nil {
if swag.IsZero(m.Results[i]) { // not required
return nil
}
if err := m.Results[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("results" + "." + strconv.Itoa(i))

View File

@@ -99,6 +99,11 @@ func (m *NotifEndpointResponse) contextValidateNotificationEndpoints(ctx context
for i := 0; i < len(m.NotificationEndpoints); i++ {
if m.NotificationEndpoints[i] != nil {
if swag.IsZero(m.NotificationEndpoints[i]) { // not required
return nil
}
if err := m.NotificationEndpoints[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("notification_endpoints" + "." + strconv.Itoa(i))

View File

@@ -120,6 +120,10 @@ func (m *NotificationConfig) contextValidateEvents(ctx context.Context, formats
for i := 0; i < len(m.Events); i++ {
if swag.IsZero(m.Events[i]) { // not required
return nil
}
if err := m.Events[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("events" + "." + strconv.Itoa(i))

View File

@@ -130,6 +130,10 @@ func (m *NotificationDeleteRequest) contextValidateEvents(ctx context.Context, f
for i := 0; i < len(m.Events); i++ {
if swag.IsZero(m.Events[i]) { // not required
return nil
}
if err := m.Events[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("events" + "." + strconv.Itoa(i))

View File

@@ -130,6 +130,7 @@ func (m *NotificationEndpoint) ContextValidate(ctx context.Context, formats strf
func (m *NotificationEndpoint) contextValidateService(ctx context.Context, formats strfmt.Registry) error {
if m.Service != nil {
if err := m.Service.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("service")

View File

@@ -92,6 +92,10 @@ func (m *NotificationEndpointItem) ContextValidate(ctx context.Context, formats
func (m *NotificationEndpointItem) contextValidateService(ctx context.Context, formats strfmt.Registry) error {
if swag.IsZero(m.Service) { // not required
return nil
}
if err := m.Service.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("service")

View File

@@ -55,6 +55,15 @@ const (
// NotificationEventTypeGet captures enum value "get"
NotificationEventTypeGet NotificationEventType = "get"
// NotificationEventTypeReplica captures enum value "replica"
NotificationEventTypeReplica NotificationEventType = "replica"
// NotificationEventTypeIlm captures enum value "ilm"
NotificationEventTypeIlm NotificationEventType = "ilm"
// NotificationEventTypeScanner captures enum value "scanner"
NotificationEventTypeScanner NotificationEventType = "scanner"
)
// for schema
@@ -62,7 +71,7 @@ var notificationEventTypeEnum []interface{}
func init() {
var res []NotificationEventType
if err := json.Unmarshal([]byte(`["put","delete","get"]`), &res); err != nil {
if err := json.Unmarshal([]byte(`["put","delete","get","replica","ilm","scanner"]`), &res); err != nil {
panic(err)
}
for _, v := range res {

View File

@@ -166,6 +166,11 @@ func (m *ObjectBucketLifecycle) ContextValidate(ctx context.Context, formats str
func (m *ObjectBucketLifecycle) contextValidateExpiration(ctx context.Context, formats strfmt.Registry) error {
if m.Expiration != nil {
if swag.IsZero(m.Expiration) { // not required
return nil
}
if err := m.Expiration.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("expiration")
@@ -184,6 +189,11 @@ func (m *ObjectBucketLifecycle) contextValidateTags(ctx context.Context, formats
for i := 0; i < len(m.Tags); i++ {
if m.Tags[i] != nil {
if swag.IsZero(m.Tags[i]) { // not required
return nil
}
if err := m.Tags[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tags" + "." + strconv.Itoa(i))
@@ -202,6 +212,11 @@ func (m *ObjectBucketLifecycle) contextValidateTags(ctx context.Context, formats
func (m *ObjectBucketLifecycle) contextValidateTransition(ctx context.Context, formats strfmt.Registry) error {
if m.Transition != nil {
if swag.IsZero(m.Transition) { // not required
return nil
}
if err := m.Transition.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("transition")

View File

@@ -149,6 +149,7 @@ func (m *PutBucketRetentionRequest) ContextValidate(ctx context.Context, formats
func (m *PutBucketRetentionRequest) contextValidateMode(ctx context.Context, formats strfmt.Registry) error {
if m.Mode != nil {
if err := m.Mode.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("mode")
@@ -165,6 +166,7 @@ func (m *PutBucketRetentionRequest) contextValidateMode(ctx context.Context, for
func (m *PutBucketRetentionRequest) contextValidateUnit(ctx context.Context, formats strfmt.Registry) error {
if m.Unit != nil {
if err := m.Unit.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("unit")

View File

@@ -96,6 +96,7 @@ func (m *PutObjectLegalHoldRequest) ContextValidate(ctx context.Context, formats
func (m *PutObjectLegalHoldRequest) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error {
if m.Status != nil {
if err := m.Status.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("status")

View File

@@ -116,6 +116,7 @@ func (m *PutObjectRetentionRequest) ContextValidate(ctx context.Context, formats
func (m *PutObjectRetentionRequest) contextValidateMode(ctx context.Context, formats strfmt.Registry) error {
if m.Mode != nil {
if err := m.Mode.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("mode")

View File

@@ -104,6 +104,11 @@ func (m *ReleaseInfo) ContextValidate(ctx context.Context, formats strfmt.Regist
func (m *ReleaseInfo) contextValidateMetadata(ctx context.Context, formats strfmt.Registry) error {
if m.Metadata != nil {
if swag.IsZero(m.Metadata) { // not required
return nil
}
if err := m.Metadata.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("metadata")

View File

@@ -99,6 +99,11 @@ func (m *ReleaseListResponse) contextValidateResults(ctx context.Context, format
for i := 0; i < len(m.Results); i++ {
if m.Results[i] != nil {
if swag.IsZero(m.Results[i]) { // not required
return nil
}
if err := m.Results[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("results" + "." + strconv.Itoa(i))

View File

@@ -134,6 +134,11 @@ func (m *ReleaseMetadata) ContextValidate(ctx context.Context, formats strfmt.Re
func (m *ReleaseMetadata) contextValidateAuthor(ctx context.Context, formats strfmt.Registry) error {
if m.Author != nil {
if swag.IsZero(m.Author) { // not required
return nil
}
if err := m.Author.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("author")

View File

@@ -105,6 +105,11 @@ func (m *ResultTarget) contextValidateResult(ctx context.Context, formats strfmt
for i := 0; i < len(m.Result); i++ {
if m.Result[i] != nil {
if swag.IsZero(m.Result[i]) { // not required
return nil
}
if err := m.Result[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("result" + "." + strconv.Itoa(i))

View File

@@ -99,6 +99,11 @@ func (m *RewindResponse) contextValidateObjects(ctx context.Context, formats str
for i := 0; i < len(m.Objects); i++ {
if m.Objects[i] != nil {
if swag.IsZero(m.Objects[i]) { // not required
return nil
}
if err := m.Objects[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("objects" + "." + strconv.Itoa(i))

View File

@@ -120,6 +120,11 @@ func (m *ServerProperties) contextValidateDrives(ctx context.Context, formats st
for i := 0; i < len(m.Drives); i++ {
if m.Drives[i] != nil {
if swag.IsZero(m.Drives[i]) { // not required
return nil
}
if err := m.Drives[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("drives" + "." + strconv.Itoa(i))

85
models/service_account.go Normal file
View File

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

View File

@@ -34,6 +34,18 @@ import (
// swagger:model serviceAccountRequest
type ServiceAccountRequest struct {
// comment
Comment string `json:"comment,omitempty"`
// description
Description string `json:"description,omitempty"`
// expiry
Expiry string `json:"expiry,omitempty"`
// name
Name string `json:"name,omitempty"`
// policy to be applied to the Service Account if any
Policy string `json:"policy,omitempty"`
}

View File

@@ -37,6 +37,18 @@ type ServiceAccountRequestCreds struct {
// access key
AccessKey string `json:"accessKey,omitempty"`
// comment
Comment string `json:"comment,omitempty"`
// description
Description string `json:"description,omitempty"`
// expiry
Expiry string `json:"expiry,omitempty"`
// name
Name string `json:"name,omitempty"`
// policy to be applied to the Service Account if any
Policy string `json:"policy,omitempty"`

View File

@@ -24,21 +24,121 @@ package models
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// ServiceAccounts service accounts
//
// swagger:model serviceAccounts
type ServiceAccounts []string
type ServiceAccounts []*ServiceAccountsItems0
// Validate validates this service accounts
func (m ServiceAccounts) Validate(formats strfmt.Registry) error {
var res []error
for i := 0; i < len(m); i++ {
if swag.IsZero(m[i]) { // not required
continue
}
if m[i] != nil {
if err := m[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName(strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName(strconv.Itoa(i))
}
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// ContextValidate validates this service accounts based on context it is used
// ContextValidate validate this service accounts based on the context it is used
func (m ServiceAccounts) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
for i := 0; i < len(m); i++ {
if m[i] != nil {
if swag.IsZero(m[i]) { // not required
return nil
}
if err := m[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName(strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName(strconv.Itoa(i))
}
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// ServiceAccountsItems0 service accounts items0
//
// swagger:model ServiceAccountsItems0
type ServiceAccountsItems0 struct {
// access key
AccessKey string `json:"accessKey,omitempty"`
// account status
AccountStatus string `json:"accountStatus,omitempty"`
// description
Description string `json:"description,omitempty"`
// expiration
Expiration string `json:"expiration,omitempty"`
// name
Name string `json:"name,omitempty"`
}
// Validate validates this service accounts items0
func (m *ServiceAccountsItems0) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this service accounts items0 based on context it is used
func (m *ServiceAccountsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *ServiceAccountsItems0) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ServiceAccountsItems0) UnmarshalBinary(b []byte) error {
var res ServiceAccountsItems0
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -196,6 +196,11 @@ func (m *SessionResponse) contextValidateAllowResources(ctx context.Context, for
for i := 0; i < len(m.AllowResources); i++ {
if m.AllowResources[i] != nil {
if swag.IsZero(m.AllowResources[i]) { // not required
return nil
}
if err := m.AllowResources[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("allowResources" + "." + strconv.Itoa(i))
@@ -214,6 +219,11 @@ func (m *SessionResponse) contextValidateAllowResources(ctx context.Context, for
func (m *SessionResponse) contextValidateEnvConstants(ctx context.Context, formats strfmt.Registry) error {
if m.EnvConstants != nil {
if swag.IsZero(m.EnvConstants) { // not required
return nil
}
if err := m.EnvConstants.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("envConstants")

View File

@@ -99,6 +99,7 @@ func (m *SetBucketPolicyRequest) ContextValidate(ctx context.Context, formats st
func (m *SetBucketPolicyRequest) contextValidateAccess(ctx context.Context, formats strfmt.Registry) error {
if m.Access != nil {
if err := m.Access.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("access")

View File

@@ -34,8 +34,14 @@ import (
// swagger:model setBucketVersioning
type SetBucketVersioning struct {
// versioning
Versioning bool `json:"versioning,omitempty"`
// enabled
Enabled bool `json:"enabled,omitempty"`
// exclude folders
ExcludeFolders bool `json:"excludeFolders,omitempty"`
// exclude prefixes
ExcludePrefixes []string `json:"excludePrefixes"`
}
// Validate validates this set bucket versioning

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