Compare commits

...

219 Commits

Author SHA1 Message Date
Minio Trusted
b84b80742c update to release v0.8.0 2021-07-23 18:55:16 -07:00
Alex
dcab568ea7 assets (#895) 2021-07-23 18:50:24 -07:00
Alex
4fdf9a1190 Fixed encoding & URL issues for users & groups pages (#896)
* Fixed encoding & URL issues for users & groups pages
* Update portal-ui/src/screens/Console/Users/ListUsers.tsx

Co-authored-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-07-23 18:37:34 -07:00
Alex
6c7bfe6514 Improved Tiers page (#894)
Added relevant instructions for tiers name & returned correct errors from MinIO

Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-07-23 11:09:19 -07:00
adfost
419fa59923 New link (#893) 2021-07-23 12:34:13 -05:00
Daniel Valdivia
73fe08cd81 Remove Operator mode references in Console mode (#884)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-07-22 11:17:26 -07:00
Minio Trusted
b79c228890 fix: assets build missing entries in index.html 2021-07-21 22:18:37 -07:00
Alex
d88146459a Removed log search error message in console logs (#890)
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-07-21 16:13:23 -07:00
adfost
2e1e4e4e80 Delete multiple objects (#856)
* delete multiple objects

* fixing capitalization

* make assets

Co-authored-by: Adam Stafford <adam@minio.io>
Co-authored-by: Adam Stafford <adamstafford@Adams-MacBook-Pro.local>
Co-authored-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-07-21 15:49:20 -07:00
Daniel Valdivia
6f7c026e4c Support for Hop into tenants (#878)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-07-21 15:09:49 -07:00
Alex
a6aa0f14c1 Added loading splash screen (#888) 2021-07-21 16:59:29 -05:00
Alex
2377959628 Improved FS Mode in console: (#889)
- Replaced legend for create bucket

- Hidden Heal in FS mode

Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-07-21 14:44:00 -07:00
Daniel Valdivia
e91ce7ebbb Fix Log Db Volume size request (#886)
* Fix Log Db Volume size request

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

* Update operatorapi/operator_tenants.go

Co-authored-by: Harshavardhana <harsha@minio.io>

* Update operatorapi/operator_tenants.go

Co-authored-by: Harshavardhana <harsha@minio.io>

* Update operatorapi/operator_tenants.go

Co-authored-by: Harshavardhana <harsha@minio.io>

* Update operatorapi/operator_tenants.go

Co-authored-by: Harshavardhana <harsha@minio.io>

* Added humanize package

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

Co-authored-by: Harshavardhana <harsha@minio.io>
Co-authored-by: Lenin Alevski <alevsk.8772@gmail.com>
2021-07-21 14:05:40 -07:00
Harshavardhana
87416b1fee fix: subnet health triggering OOM, infinite loop (#887) 2021-07-21 13:56:35 -07:00
Alex
dd0b791d9d Added FS Support & blocked non usable functionality in console (#880)
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
Co-authored-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-07-20 19:02:33 -07:00
Daniel Valdivia
c31af8bb8c Fix bug when deleting objects with % in the name (#876)
* Fix bug when deleting object puts with % in the name

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

* Remove unused import

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-07-20 18:42:50 -07:00
Alex
9b6d14c752 Fixed policy page crash (#882)
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-07-20 18:33:01 -07:00
Lenin Alevski
aa60ff9dd0 Initialize TLS configuration for operatorApi (#879)
Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>

Co-authored-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-07-20 15:14:29 -07:00
Daniel Valdivia
804e3b04ad iFrame Support (#865)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-07-20 11:55:37 -07:00
Harshavardhana
bfedc14497 fix: avoid versioning list per objects 2021-07-19 17:46:37 -07:00
Daniel Valdivia
ff7c305345 Remove the last k8s import on restapi (#877)
* Remove the last k8s import on restapi

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-07-19 19:17:56 -05:00
Harshavardhana
2a6a6cab24 fix: properly support FS/Gateway mode (#874) 2021-07-19 12:24:35 -07:00
Daniel Valdivia
982ff0da5e Split Operator and Management API into different Swagger files (#875)
* Split Operator and Management API into different Swagger files

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

* Linting

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-07-19 11:48:50 -07:00
adfost
63582de380 adding int value functions (#852) 2021-07-16 16:53:07 -07:00
Minio Trusted
d8840cc810 update minio-go dependency to fix LDAP error logging 2021-07-15 14:21:37 -07:00
Daniel Valdivia
27489d9a3d Improve Object Download (#867)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-07-15 13:26:19 -07:00
Harshavardhana
7bd6d73663 fix: remove response timeouts for console (#864) 2021-07-14 11:29:32 -07:00
Lenin Alevski
54dfcbd378 Fix: derivedKey should not be a global variable (#862)
Embedded console was ignoring values set by CONSOLE_PBKDF_PASSPHRASE and
CONSOLE_PBKDF_SALT for generating new session tokens, derivedKey is used
to encrypt/decrypt session tokens generated by console

Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
2021-07-12 14:31:10 -07:00
Harshavardhana
445c0be5b1 fix: change password is implicit (#861)
Also only match actions do not need to match
dynamic values in resources.

fixes https://github.com/minio/console/issues/857
fixes https://github.com/minio/console/issues/858
2021-07-10 12:11:11 -07:00
adfost
373d576e54 Delete pods (#844)
Co-authored-by: Adam Stafford <adam@minio.io>
Co-authored-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-07-09 09:56:29 -07:00
Harshavardhana
b19852a75a fix: upgrade to latest UBI 8.4 (#848) 2021-07-06 12:08:26 -07:00
Minio Trusted
a0e4a62278 fix: docker compose example 2021-06-30 23:53:26 -07:00
Lenin Alevski
7ca7c8278b Responsive License Page via Flex (#843)
Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
2021-06-29 21:18:57 -05:00
Minio Trusted
ced3e64c61 update to release v0.7.5 2021-06-29 11:43:04 -07:00
Daniel Valdivia
b51d5505f3 Update readme screenshots (#842)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-06-28 15:35:11 -07:00
Daniel Valdivia
c73764bca1 Style Tenant Security Tab (#841)
* Style Tenant Security Tab

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

* Address comments

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-06-28 14:58:34 -07:00
adfost
531d8a2f4e Adding groups tab to Policy Details page (#837)
* parent 58efbbbf60
author Adam Stafford <adam@minio.io> 1624473190 -0700
committer Adam Stafford <adam@minio.io> 1624569868 -0700

policy groups

* restoring old commit files

Co-authored-by: Adam Stafford <adam@minio.io>
Co-authored-by: Alex <33497058+bexsoft@users.noreply.github.com>
Co-authored-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-06-28 12:53:29 -07:00
Harshavardhana
9ec73260c9 fix: client secret is optional in implicit flow (#840) 2021-06-28 12:49:21 -07:00
Anis Elleuch
173c3d43bb idp: Always use custom http client when generating tokens (#838)
x/oauth2 always wants a context with a custom http client embedded
when performing various requests. Ensure that the custom http client is
passed when requesting for a token.
2021-06-26 09:23:42 -07:00
Minio Trusted
c6eae4b807 update minio/pkg v1.0.8 2021-06-25 17:32:04 -07:00
Alex
58efbbbf60 Fixed some warnings (#834)
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-06-24 12:38:41 -07:00
Lenin Alevski
616be03c0b CA Certificates in Operator-UI (#829)
- Bug fix: removing CA certificates for MinIO in operator-ui was broken
- Added missing file uplader for Console CA certificates

Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
2021-06-24 14:15:24 -05:00
adfost
c7e195b361 Add Filtering to Users on Policy Details (#833) 2021-06-23 22:03:21 -05:00
Daniel Valdivia
fa85ad9791 Make ElementKey optional (#831)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-06-23 11:03:55 -07:00
Daniel Valdivia
9f4d3f4586 Fix Bucket Replication listing (#832)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-06-23 10:57:19 -07:00
Alex
52075681c3 Added rewind functionality to console (#828)
* Added rewind functionality to console

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

* Fix for object details

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

Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
Co-authored-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-06-22 23:10:54 -07:00
Harshavardhana
fd86e65e5e fix: console should trust itself with its own public.crt (#827) 2021-06-21 18:15:57 -07:00
Minio Trusted
b10c4f51b1 fix: log search URL, token environment variables 2021-06-18 16:03:29 -07:00
Harshavardhana
14604e0cba fix: lazily interpret environment values (#826)
using `init()` to initialize environment values
can cause problems when console is imported
into dependent projects.
2021-06-18 15:40:25 -07:00
Daniel Valdivia
83ca73ec0b Cross Compile in Parallel two archs at a time (#825)
* Cross Compile in Parallel two archs at a time

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

* Remove echo. Fix args

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-06-18 11:44:01 -07:00
Daniel Valdivia
b14d67eead Parallelize PR check stages (#824)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-06-18 13:23:39 -05:00
jinapurapu
6166223995 Moved Change User Password and added password length check (#820)
* Moved Change User Password and added password length check

* Remade assets

* Moved Change User Password and added password length check

* Rebuilt assets

Co-authored-by: Jill <jill@minio.io>
2021-06-18 11:22:09 -07:00
Daniel Valdivia
61cf109fd6 Global Refresh for Tenant Details (#822)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-06-18 11:22:51 -05:00
Junlin Zhou
d372a2cd7a update TLS section in README (#777)
Replace the mismatched TLS port in the documentation
2021-06-17 22:59:00 -07:00
Daniel Valdivia
2d6b5ecbc6 Re-organize Pod Details (#821)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-06-17 19:12:52 -07:00
Lenin Alevski
85797749ba Security Tab for operator-ui (#804)
Security Tab allow users to set various configurations related to TLS
certificates for MinIO and Console

- Enable/Disable AutoCert
- Add/Delete MinIO and Console Certificates
- Add/Delete MinIO and Console CA Certificates

Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
2021-06-17 17:30:20 -07:00
adfost
09503ed0c8 Pod Events (#807)
* Pod Events

* restoring files

* restoring files

* make assets

Co-authored-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
Co-authored-by: Adam Stafford <adam@minio.io>
Co-authored-by: Alex <33497058+bexsoft@users.noreply.github.com>
2021-06-17 16:24:22 -07:00
Daniel Valdivia
34b05bd426 Fix Singel Value widget not rendering on tab switch (#819)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-06-17 18:01:19 -05:00
Alex
11eb587610 Improved trace functionality & added filters support (#817)
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-06-17 12:21:25 -07:00
Harshavardhana
13f9f6c848 fix: do not use var to define global sets (#818)
console when imported cannot honor certain environment
values, we need to make sure to read it directly from
environment.
2021-06-17 00:50:56 -07:00
Alex
03c24c6f14 Fixed issue with comparison & prettier (#815)
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-06-16 16:36:50 -07:00
Daniel Valdivia
0c8025b39f Bring Tenant Metrics to Tenant Details (#813)
* Bring Tenant Metrics to Tenant Details

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-06-16 16:50:04 -05:00
Alex
7117d87546 Changed field names & removed bottom texts (#816) 2021-06-16 12:38:29 -05:00
Harshavardhana
55531d605b fix: allow TLS access on multiple SNI certs (#812)
if GetCertificate() is set never set tls.Certificates
2021-06-15 17:52:39 -07:00
Alex
e32819034a Added create Namespace functionality to Add Tenant screen (#809)
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-06-14 18:00:20 -05:00
Harshavardhana
f208ce5382 fix: GetAllCertificatesAndCAs shouldn't fail internally (#810)
all libraries in pkg/* should never be called Fatal()
internally, the console is imported now and it is important
that the failure logging etc is all well controlled.

Bonus: update to latest minio/pkg v1.0.6 to get trial
customer license verification fixes.
2021-06-14 10:41:34 -07:00
Alex
31d18efa9a Added create namespace API (#808) 2021-06-14 12:04:57 -05:00
Harshavardhana
4d62fe1638 add releases to quay.io from next release (#811) 2021-06-11 18:36:27 -07:00
jinapurapu
11d0080488 Move change user password modal (#806) 2021-06-11 17:24:41 -05:00
Alex
8bea9ab2a5 Implemented an autocomplete component (#803)
This component can be used as a replacement for select component
2021-06-11 15:32:07 -05:00
Alex
480e6d7980 Connected filters for bucket details sections (#801) 2021-06-08 19:47:26 -05:00
Minio Trusted
4fc95ae17d remove the shotfile source line 2021-06-08 16:24:50 -07:00
Alex
d5a3fee0be Updated dependencies for console. (#800)
There is one fix that needs to be applied once create-react-app delivers a new update. Please refer to https://github.com/facebook/create-react-app/issues/11053
https://github.com/facebook/create-react-app/issues/11053

Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-06-08 16:21:48 -07:00
Harshavardhana
6791631904 upgrade swagger version to v0.27.0 (#798) 2021-06-08 14:35:39 -05:00
Alex
6f0df68200 Removed not available comparison (#797) 2021-06-08 12:35:38 -05:00
Daniel Valdivia
9a8106d714 Add missing resource to cluster role (#796)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-06-07 22:28:53 -07:00
dependabot[bot]
991043822b Bump ws from 6.2.1 to 6.2.2 in /portal-ui (#793)
Bumps [ws](https://github.com/websockets/ws) from 6.2.1 to 6.2.2.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-07 22:27:20 -07:00
Harshavardhana
91f165ca32 update operator to latest master (#792)
this is to remove logsearchapi dependency
on audit.Entry structure from MinIO server.
2021-06-07 20:53:03 -07:00
Alex
c2dc7391e4 Added URL navigation to tenant details (#795)
Added URL navigation to tenant details and fixed a couple of warnings

Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-06-07 20:23:14 -07:00
Daniel Valdivia
bb0f613f5b Move log code out of auto-generated files (#791)
* Move log coude out of auto-generated files

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

* Configure API

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-06-07 19:30:53 -07:00
adfost
ecab89f7fb Pod Details (#789)
* Introduce dropdowns for node selector screen on affinity

Fixes https://github.com/miniohq/engineering/issues/138

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

* pod logs

* fixing test cases

* adding paper

* style for pod logs

* dealing with style errors

* Delete logs.log

* using new Affinity.tsx

* moving loadinfo

* moving loadinfo and adding dependencies

Co-authored-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
Co-authored-by: Adam Stafford <adam@minio.io>
Co-authored-by: Alex <33497058+bexsoft@users.noreply.github.com>
2021-06-07 18:56:05 -07:00
Lenin Alevski
69055c492e ReadOnly filesystem error when loading certificates (#794)
Read-only file-system, ie: when console is running as container in kubernetes, was
preventing console to run because of an error during creating
directories

Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
2021-06-07 16:33:47 -07:00
Harshavardhana
07fbb8b8f7 rewrite logging in console (#788)
- enhance logging throughout the codebase
- all packages at pkg/ should never log
  or perform log.Fatal() instead packages
  should return errors through functions.
- simplified various user, group mapping
  and removed redundant functions.
- deprecate older flags like --tls-certificate
  --tls-key and --tls-ca as we do not use
  them anymore, keep them for backward compatibility
  for some time.
2021-06-04 11:35:55 -07:00
Alex
b65f04a2b5 Fixed assets in console master (#790) 2021-06-04 12:50:26 -05:00
Harshavardhana
83d6620fe3 remove various unexpected features in console (#782)
- Unix listeners are removed
- KeepAlive, IdleTimeout etc are removed
- Authorization logic is simplified
- Added support for MINIO_PROMETHEUS_JOB_ID
2021-06-03 18:04:08 -07:00
Lenin Alevski
b1aedf813f AGPL License Modal in License page (#786)
Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>

Co-authored-by: Alex <33497058+bexsoft@users.noreply.github.com>
Co-authored-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-06-03 16:40:04 -07:00
Daniel Valdivia
76bdd9dded Introduce tabs for Dashboard (#785)
Also fixes the sync button

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-06-03 16:02:45 -07:00
jinapurapu
a9e82eb909 #616 added modal on icon click (#747)
* Added refresh tenant functionality

add icon to Users page to change password

commit work to date to github for ongoing use

add modal with fields for current and new password on icon click

missing swagger files

remove unneeded files

move changeUserPassword to admin_api, remove field for current password,
include selected user

Please enter the commit message for your changes. Lines starting

added missing js files

asset and function signature

formatting changes

* fixed lint

* removed Current Password field, returned Groups label, added
selectedUser to modal text

* disabled save button if newPasssword and reNewPassword don't match, removed commented out code

* Added refresh tenant functionality

add icon to Users page to change password

commit work to date to github for ongoing use

add modal with fields for current and new password on icon click

missing swagger files

remove unneeded files

move changeUserPassword to admin_api, remove field for current password,
include selected user

Please enter the commit message for your changes. Lines starting

added missing js files

asset and function signature

formatting changes

* removed Current Password field, returned Groups label, added
selectedUser to modal text

* changed Swagger parameters to camel case

Co-authored-by: Jill <jill@minio.io>
2021-06-03 15:32:22 -07:00
Daniel Valdivia
f18360416b Add Tenant Health Details (#780)
* Add Tenant Health Details

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

* Colors

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-06-02 16:26:08 -07:00
Daniel Valdivia
8ca6401ac0 Introduce dropdowns for node selector screen on affinity (#779)
* Introduce dropdowns for node selector screen on affinity

Fixes https://github.com/miniohq/engineering/issues/138

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

* Lint

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-06-02 15:48:17 -07:00
Harshavardhana
c1e41e6b0a allow console to listen on ipv6 (#781)
also converge tls-host and host, because hostnames
have nothing to do with HTTP or HTTPs they are the
same for both HTTP and HTTPs. Deprecating the
older flag `--tls-host` but it will still be honored
as hidden flag.
2021-06-02 14:33:09 -07:00
Harshavardhana
1b7fb2ae7a move to master direct-csi (#778)
this removes the last remaining vestibule minio/minio
dependency from all console cross dependencies
2021-06-01 15:31:43 -07:00
Harshavardhana
eff001b12f move to madmin-go/, pkg/ packages (#765) 2021-06-01 11:34:55 -07:00
dependabot[bot]
9498f8dcb5 Bump dns-packet from 1.3.1 to 1.3.4 in /portal-ui (#774)
Bumps [dns-packet](https://github.com/mafintosh/dns-packet) from 1.3.1 to 1.3.4.
- [Release notes](https://github.com/mafintosh/dns-packet/releases)
- [Changelog](https://github.com/mafintosh/dns-packet/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mafintosh/dns-packet/compare/v1.3.1...v1.3.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-30 21:34:26 -07:00
adfost
5782b9d9a2 adding test case for bucket users (#773)
Co-authored-by: Minio Trusted <trusted@minio.io>
Co-authored-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-05-28 18:28:39 -07:00
Daniel Valdivia
7db4e187ec List Service Accounts for a User (#775) 2021-05-28 17:46:36 -07:00
Daniel Valdivia
c95bc64dbe Enable Bucket Quota on Bucket Details (#776)
* Enable Bucket Quota on Bucket Details

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

* warnings

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

* remove uselss br

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-05-28 17:21:45 -07:00
Minio Trusted
16647b88e9 update to v0.7.4 2021-05-27 16:32:21 -07:00
Daniel Valdivia
59c4ac6336 Add Sync, Bandwidth and Health Check Period to replication set (#771)
* Add Sync, Bandwidth and Health Check Period to replication set

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

* Update Columns

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

* Add Prefix and Tags

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

* Last fields

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-05-27 16:25:00 -07:00
Minio Trusted
49f0b83613 instead of go get use 'go install' 2021-05-26 10:54:27 -07:00
Alex
622f9ed3cd Added URl routing for tabs in buckets (#769)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>

Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-05-25 16:16:15 -07:00
Daniel Valdivia
213d7589c6 Latest Assets (#768)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-05-24 14:10:12 -07:00
Minio Trusted
0a4f02bd83 update to v0.7.2 2021-05-24 11:53:05 -07:00
Alex
db9b61677c 20 seconds timeout removal (#767)
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
Co-authored-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-05-24 11:48:41 -07:00
Daniel Valdivia
003eaaea76 Group bucket users and policies under access tab. Rename ViewBuckets to BucketDetails (#766)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-05-24 11:11:39 -07:00
Alex
d8350625f3 Added routes to tab selection in storage (#761)
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-05-21 15:40:39 -07:00
Daniel Valdivia
6b2043c832 Dashboard widgets async (#762)
* Make Widgets load asynchronously

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

* Added loading spinners to all widgets

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-05-21 10:24:16 -07:00
Daniel Valdivia
87cb36c944 Fix PVC list so it's only tenant PVCs. Fix NPE on pod listing. (#764) 2021-05-21 07:55:53 -07:00
Alex
59d4ebc109 Fixed issue with graphs that are not showing series correctly (#763)
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-05-20 17:42:39 -07:00
Lenin Alevski
6eabff3d96 Add support for custom KES image in tenant (#759)
Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
2021-05-20 12:31:57 -07:00
adfost
1267f989b2 fixing duplicated usernames (#760) 2021-05-20 12:33:18 -05:00
Daniel Valdivia
2895804e0f Make list of policies on UserDetails clickable. Fix Warnings. Add latest assets (#758)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-05-20 09:45:53 -07:00
adfost
c2171fafde User policies (#744)
* adding policy users and new UI page

* Prettier + aligment

Co-authored-by: Adam Stafford <adam@minio.io>
2021-05-19 15:18:59 -07:00
Daniel Valdivia
b0f1f88b5b Remove Excessive Logging. Add missing labels for metrics. (#753)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-05-18 09:06:31 -07:00
Daniel Valdivia
8917f415cc Line Break for Tenant Details (#751)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-05-17 14:16:03 -07:00
Alex
40aca3da79 Changed Labels for storage section (#750)
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
Co-authored-by: Daniel Valdivia <hola@danielvaldivia.com>
2021-05-17 11:52:20 -07:00
Daniel Valdivia
cf27e20bf2 Add the current state to tenant details. Fix Enable/Disable Encryption (#749)
* Add the current state to tenant details

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

* Fix the Enable

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

* Linting

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-05-17 11:29:11 -07:00
Daniel Valdivia
3b10eb58ea Update View Bucket screen (#746)
Also add a few refresh screen buttons and remove duplicate titles

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-05-14 17:05:02 -07:00
Lenin Alevski
98b4012dde Change bucket encryption configuration UI (#745)
Replace checkbox with pencil icon component to open the bucket
encryption configuration

Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
2021-05-14 15:54:14 -07:00
Daniel Valdivia
2769ba145a Add features box to tenant details (#738)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-05-14 17:04:29 -05:00
Alex
9c5a788dae Added PVCs section & direct CSI panel (#742)
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-05-14 13:20:36 -07:00
Alex
a06636035a Added sync icon to get information button (#743)
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-05-14 10:13:24 -07:00
Daniel Valdivia
1808027fa1 Latest Assets only (#741)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-05-13 10:15:31 -07:00
Alex
3ac22d48d5 More Widgets fixes (#739)
* Fix the Prometheus queries

Signed-off-by: Daniel Valdivia <hola@danielvaldivia.com>

* Add missing steps

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

* Enabled missing axis & fixed labels

Co-authored-by: Daniel Valdivia <hola@danielvaldivia.com>
Co-authored-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-05-12 17:52:21 -07:00
Daniel Valdivia
288bf01dd8 Permanently enable ILM (#740)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-05-12 16:32:15 -07:00
dependabot[bot]
d546f05e11 Bump hosted-git-info from 2.8.8 to 2.8.9 in /portal-ui (#736)
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alex <33497058+bexsoft@users.noreply.github.com>
2021-05-12 16:08:29 -07:00
Alex
5c73137d60 Fixed Console Widgets to match grafana information (#737)
* Fixed Console Widgets to match grafana information

* Fix the Prometheus queries

Signed-off-by: Daniel Valdivia <hola@danielvaldivia.com>

* Add missing steps

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

* adjust interval

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

* Fixed inconsistence with backend names

* Reimplemented step calc to avoid issues on multime times request

Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
Co-authored-by: Daniel Valdivia <hola@danielvaldivia.com>
Co-authored-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
2021-05-12 13:35:14 -07:00
Daniel Valdivia
1daec71271 Update Console Prometheus Widgets (#731)
Signed-off-by: Daniel Valdivia <hola@danielvaldivia.com>
2021-05-10 20:12:15 -07:00
Minio Trusted
3a519cdcfa update to v0.7.1 2021-05-10 19:11:30 -07:00
Daniel Valdivia
a2dce5fa9f Show error when editing tenant Yaml (#733)
* Show error when editing tenant Yaml

Also adds error line when we prepareError()

Signed-off-by: Daniel Valdivia <hola@danielvaldivia.com>

* make certain metadata fields editable

Signed-off-by: Daniel Valdivia <hola@danielvaldivia.com>
2021-05-10 19:08:22 -07:00
Daniel Valdivia
3a7da72919 Fix NodeSelector Screen (#732)
This makes it so the node selector logic is different from podAffinity

Signed-off-by: Daniel Valdivia <hola@danielvaldivia.com>
2021-05-10 17:34:54 -07:00
dependabot[bot]
4f0752c9fc Bump url-parse from 1.4.7 to 1.5.1 in /portal-ui (#728)
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.4.7 to 1.5.1.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.4.7...1.5.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alex <33497058+bexsoft@users.noreply.github.com>
2021-05-10 16:18:53 -07:00
Daniel Valdivia
59d074c7a9 Allow to edit Tenant YAML (#727) 2021-05-10 17:27:52 -05:00
Daniel Valdivia
c5a8ad3168 Remove duplicated logic (#730)
We were adding the users secrets twice, this consolidates the logic so it's only once and we don't do it if external IDPs are configured

Signed-off-by: Daniel Valdivia <hola@danielvaldivia.com>
2021-05-10 11:31:56 -07:00
Daniel Valdivia
b86a992a33 Fix bug when adding multiple built-in users (#729)
There was a problem with the root credentials being added as a user, and the name of the built in users had collisions with the root credentials

Signed-off-by: Daniel Valdivia <hola@danielvaldivia.com>
2021-05-10 10:56:10 -07:00
Daniel Valdivia
24410e7c85 Make user details a page (#726) 2021-05-08 00:00:29 -07:00
Ravind Kumar
ffb3362f79 Update Console metrics dashboard (#724) 2021-05-07 20:59:25 -05:00
Lenin Alevski
f5beb90608 Hide users tab from bucket view when LDAP is enabled (#719) 2021-05-07 17:48:03 -07:00
Alex
cc02b21632 Fixed missing object in swagger (#725)
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-05-07 14:14:54 -07:00
adfost
281f8d553a Adding list of pods (#715)
* changing delete button

* committing so I can swich branches

* adding pods

* showing only pods with given tenant

* pull request fixes

* changing pod selection algorithm

* changed the pods API

* Delete admin.json

* Update portal-ui/src/screens/Console/Tenants/TenantDetails/TenantDetails.tsx

Co-authored-by: Alex <33497058+bexsoft@users.noreply.github.com>

* Update portal-ui/src/screens/Console/Tenants/TenantDetails/TenantDetails.tsx

Co-authored-by: Alex <33497058+bexsoft@users.noreply.github.com>

Co-authored-by: Lenin Alevski <alevsk.8772@gmail.com>
Co-authored-by: Adam Stafford <adam@minio.io>
Co-authored-by: Alex <33497058+bexsoft@users.noreply.github.com>
2021-05-06 18:57:14 -07:00
Daniel Valdivia
cc52e267eb Build assets automatically (#721) 2021-05-05 17:24:21 -05:00
Alex
7fdc02aec8 Returned multi user list in tenant created modal (#718)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2021-05-05 14:33:55 -05:00
Minio Trusted
29e1af3363 update to v0.7.0 2021-05-05 11:24:26 -07:00
Daniel Valdivia
8a635fc0d7 Make Log Search and Prometheus images configurable (#717)
Three new fields were added to let users customize the docker images for log search and prometheus

Signed-off-by: Daniel Valdivia <hola@danielvaldivia.com>
2021-05-04 14:46:10 -07:00
Alex
35da684ec9 Added direct-csi API support to console (#710) 2021-05-04 11:56:33 -05:00
Daniel Valdivia
8cfa41eb53 Make Tabs Scrollable (#714)
This makes so tab components are scrollable if the resolution on the screen demands it

Signed-off-by: Daniel Valdivia <hola@danielvaldivia.com>
2021-05-03 13:19:35 -07:00
Alex
08e40fe632 Fixed issue with namespace not returning error (#709)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>

Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-05-03 08:38:20 -07:00
Alex
0b0cb785b5 Fixed small issues & removed warnings in console (#711) 2021-04-27 21:55:16 -07:00
Daniel Valdivia
5838606789 Improvements to Built-In users (#708) 2021-04-27 13:07:25 -07:00
Alex
38f95e3b28 Added affinity support to tenant add screen (#706) 2021-04-26 18:40:09 -07:00
Daniel Valdivia
0c90785ed0 Remove printing of tenant yaml (#705)
Signed-off-by: Daniel Valdivia <hola@danielvaldivia.com>

Co-authored-by: Alex <33497058+bexsoft@users.noreply.github.com>
2021-04-26 10:35:45 -07:00
Alex
62d762318f Tiers & lifecycle implementation (#638) 2021-04-24 14:31:47 -07:00
adfost
097e6e9825 changing delete button (#704)
Co-authored-by: Lenin Alevski <alevsk.8772@gmail.com>
2021-04-23 15:56:06 -07:00
Alex
9e35db0642 Added validation for single tenant in namespace (#701)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>

Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-04-23 13:38:02 -07:00
Lenin Alevski
3b55d63211 Attaching subnet license to existing tenants fails (#702)
Uses the right tenant namespace to update console secrets instead of the
wrong operator namespace

Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
2021-04-23 12:58:37 -07:00
Alex
2981e63797 Fixes an issue with empty logsearch & prometheus configurations (#703) 2021-04-22 20:54:17 -07:00
adfost
ca742b781f Adding key creation in tenant wizard. (#697)
Signed-off-by: Adam Stafford <adam@minio.io>

Co-authored-by: Adam Stafford <adamstafford@MacBook-Pro-van-Adam-2.local>
2021-04-22 14:18:14 -07:00
dependabot[bot]
d60cac0122 Bump ssri from 6.0.1 to 6.0.2 in /portal-ui (#698)
Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/npm/ssri/releases)
- [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md)
- [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alex <33497058+bexsoft@users.noreply.github.com>
2021-04-20 23:59:09 -07:00
Alex
62745e9ff2 Added log search & prometheus extra params configuration (#700) 2021-04-20 23:39:14 -07:00
Alex
c81da22e8a Added storage class selector to add pool modal (#699)
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-04-19 18:26:22 -07:00
Minio Trusted
c07b7b4772 update to v0.6.8 2021-04-19 14:42:47 -07:00
Minio Trusted
6cb703685b update to v0.6.7 2021-04-14 14:26:09 -07:00
Alex
7a3c2a3cf8 Disabled selected buttons in table wrapper (#692)
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-04-14 14:20:30 -07:00
Alex
d8ac8cc1e3 Merged object locking & access policy cards into a single one for bucket details (#691)
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-04-14 12:52:29 -07:00
Daniel Valdivia
0e492dae67 Add Restruct with policy selector in add SA modal (#689) 2021-04-13 16:16:53 -07:00
Alex
b72217764a Removed center alignment of forms in full screen (#690)
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-04-13 15:51:39 -07:00
Lenin Alevski
26bcbb896a Remove unecessary default scopes for IDP integration (#686) 2021-04-08 14:04:32 -07:00
Lenin Alevski
7b4254f525 Display errors during IDP authentication (#685) 2021-04-06 00:38:11 -07:00
Alex
68ea3b5d05 Fixed double scroll issue in modal wizard (#684)
Also changed grid classes for wizard/ modal-wizard
2021-04-05 20:31:00 -05:00
Alex
8a51570d14 Added replication bulk modal to buckets list (#665)
* Added replication bulk modal to buckets list

* Disabled buttons & inputs in loading state

Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-04-05 16:20:08 -07:00
Daniel Valdivia
9c6ed83d63 make tenant breadcrum clickable (#683) 2021-04-02 17:04:55 -07:00
adfost
4f29f8457f Api bucket policy (#674)
* Adding API for Users with Access to Bucket

* changing error logging

* Delete .yarn-integrity
2021-04-02 17:13:29 -06:00
Lenin Alevski
94747acab2 fixes issue about displaying documentation link multiple times (#681) 2021-04-01 23:02:45 -07:00
Alex
d8360737ee Fixed max width in wizard panels & issue in wide screens for input switchers (#679)
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-04-01 18:35:33 -07:00
Daniel Valdivia
bb91cb66b0 Operator UI improvements (#678) 2021-04-01 16:13:57 -07:00
Lenin Alevski
ce473b9286 Adding references for operator and console links in license page (#675) 2021-03-30 17:01:56 -07:00
Minio Trusted
14fe7c1269 update to v0.6.6 release with service 2021-03-27 17:06:01 -07:00
Lenin Alevski
b6938a5888 Check xcerts.Manager is initialized before adding certificates (#673) 2021-03-27 15:35:45 -07:00
Minio Trusted
901358e8d4 update to release v0.6.5 2021-03-27 13:26:58 -07:00
Lenin Alevski
5155aef802 Add support to load certificates from swagger tls flags (#672)
- Add support to load certificates via `--tls-certificate`, `--tls-key`
  and `--tls-ca` flags (standard TLS flags for the swagger server)
- Certificate keypair will be added to the certificate pool used by the
  Console server
2021-03-27 12:21:59 -07:00
adfost
23b3283014 Adding Bucket Policies UI to ViewBucket.tsx (#669)
* Adding ViewBucket.tsx

* Update ViewBucket.tsx

Co-authored-by: Adam Stafford <adam@minio.io>
2021-03-26 10:06:38 -07:00
Daniel Valdivia
53eb59f5ad Disable Bucket/Replication (feature) if not enough permissions (#662)
* Bucket/Replication (feature) if not enough permissions

* Address comments

* Remove Consts fetchPerms
2021-03-25 10:10:54 -07:00
Minio Trusted
e088431c62 update to v0.6.4 2021-03-23 17:45:51 -07:00
Lenin Alevski
8bb982b39f update ldap development example (#664) 2021-03-23 15:09:44 -06:00
Daniel Valdivia
744ccea842 Add Bucket Locking option and fix versioning configuration. (#661)
* Add Bucket Locking option and fix versioning configuration.

* Addres comments

* Rework the View Bucket options

* Remove extra padding
2021-03-22 16:28:07 -07:00
Daniel Valdivia
19195e0cd0 Interactive Feedback when list objects take a long time (#655)
* Interactive Feedback when list objects take a long time

* Remove cancel button

Co-authored-by: Alex <33497058+bexsoft@users.noreply.github.com>
2021-03-22 11:36:46 -07:00
Lenin Alevski
7ce36bac42 console license page improvements and fixes (#647)
- fixed issue when deploying tenant with tls disabled
- applied new design for tenant details and license screens
- added license refresh job to operator console
- added new refresh license endpoint
- console operator not longer store CONSOLE_ACCESS_KEY and
  CONSOLE_SECRET_KEY values in the tenant-console-secret

Co-authored-by: Daniel Valdivia <hola@danielvaldivia.com>
2021-03-22 11:08:31 -07:00
Daniel Valdivia
2a704d3d59 Allow to assign multiple policies to to a user or group (#646)
* Allow to assign multiple policies to to a user or group

* Latest assets
2021-03-22 10:45:31 -07:00
dependabot[bot]
897b5b8be5 Bump react-dev-utils from 11.0.1 to 11.0.4 in /portal-ui (#644)
Bumps [react-dev-utils](https://github.com/facebook/create-react-app/tree/HEAD/packages/react-dev-utils) from 11.0.1 to 11.0.4.
- [Release notes](https://github.com/facebook/create-react-app/releases)
- [Changelog](https://github.com/facebook/create-react-app/blob/master/CHANGELOG-1.x.md)
- [Commits](https://github.com/facebook/create-react-app/commits/HEAD/packages/react-dev-utils)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Daniel Valdivia <hola@danielvaldivia.com>
2021-03-19 22:18:24 -07:00
Alex
03dc83af3a Added versioning edit in console (#645) 2021-03-19 17:48:58 -07:00
adfost
26f7982323 api for listing policies attatched to a bucket (#660)
api for listing policies attatched to a bucket
2021-03-19 16:00:56 -07:00
dependabot[bot]
934e8c9f4c Bump elliptic from 6.5.3 to 6.5.4 in /portal-ui (#640)
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.3 to 6.5.4.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.3...v6.5.4)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-18 18:05:15 -07:00
Cesar N
e780f24fb9 Add list direct-csi drives api (#643)
Add direct-csi volumes list api

Co-authored-by: Daniel Valdivia <hola@danielvaldivia.com>
2021-03-18 12:10:05 -07:00
Lenin Alevski
c48a024310 Remove user secret key from encrypted session token (#652)
User secret key is not really need it to be stored inside the encrypted
session key, since the `change-password` endpoint requires the user to
provide the current `secret key` that password will be used to
initialize a new minio client then we will leverage on the
`SetUser` operation, this api only works with actual user credentials
and not sts credentials
2021-03-18 10:27:27 -07:00
Minio Trusted
3fcf278460 rename Readme.md as README.md github friendly name 2021-03-11 21:26:28 -08:00
Nitish Tiwari
8b6202296e Add Docker compose file for quick deployment on non k8s envs (#639) 2021-03-11 21:24:38 -08:00
Alex
7030e80ac8 Allowed edit in policies create form (#642) 2021-03-11 16:48:01 -06:00
Alex
6bed9f8f97 Fixed issue with routes (#641) 2021-03-10 13:39:07 -06:00
Cesar N
e7263c9a89 Show object versions on UI only when bucket has versioning enabled (#637) 2021-03-10 12:37:43 -06:00
Lenin Alevski
9c1e87b1be Improvements on change-password errors page (#635)
- Returning correct error when user is unable to change password
- Added support for enable/disable UI elements based on allowed apis
2021-03-09 19:32:09 -06:00
Alex
6f98ecc59f Revert "Tiers & lifecycle implementation (#615)" (#636)
This reverts commit ac77b8b441.

Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-03-09 14:07:53 -08:00
Alex
ac77b8b441 Tiers & lifecycle implementation (#615)
* Tiers & lifecycle implementation

* Add a feature flag for ILM

* Update pkg/auth/idp/oauth2/provider.go

Co-authored-by: Lenin Alevski <alevsk.8772@gmail.com>

Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
Co-authored-by: Daniel Valdivia <hola@danielvaldivia.com>
Co-authored-by: Lenin Alevski <alevsk.8772@gmail.com>
2021-03-09 12:36:48 -08:00
Alex
d4a69978fc Added loader & notification for files download (#634)
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-03-09 09:29:54 -08:00
Alex
81087ae910 Added validation for users to not delete their own account (#633)
Also Implemented an option to show / hide actions in table wrapper

Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-03-08 21:38:19 -08:00
Cesar N
ebab2e1648 Update docs for go version required (#632) 2021-03-05 17:59:55 -06:00
Harshavardhana
9a875a6f14 add console systemd service (#627)
Co-authored-by: Daniel Valdivia <hola@danielvaldivia.com>
2021-03-05 15:20:22 -08:00
Alex
abc9f2b428 Limited input width size for forms in wide screens (#628)
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-03-05 12:30:01 -08:00
Daniel Valdivia
a2a09b8db1 Upgrade to Go 1.16. Remove Go-Bind-assets in favor of embed. (#630)
* Upgrade to Go 1.16. Remove Go-Bind-assets in favor of embed. Checking Portal-UI Build folder.

* lint

* Remove assets references

* Fixes for sub fs

* Fix lint
2021-03-05 10:39:17 -08:00
Alex
716aabe782 Fixed max size for widgets (#624)
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2021-03-04 16:09:22 -08:00
Alex
07a23ab374 Fixes issue in settings page with CSV multiselector scroll (#622)
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
Co-authored-by: Daniel Valdivia <hola@danielvaldivia.com>
2021-03-04 14:53:47 -08:00
Cesar N
e7838ebc47 Add right image for logsearchapi (#626) 2021-03-03 16:26:44 -08:00
Minio Trusted
e6705b685c update to v0.6.3 2021-03-02 20:46:04 -08:00
Alex
6b11d403a6 Add Tenant page refactor (#617)
Refactored add tenant page to be working with reducers & settings styles
2021-03-02 20:18:53 -08:00
Daniel Valdivia
8958cbec69 Fix container image for log search (#619) 2021-03-02 11:07:31 -06:00
Lenin Alevski
5ef66c3cfc Fixes for license page (#620) 2021-03-01 22:25:08 -08:00
Harshavardhana
d4395e1409 add update command to self-update console (#618) 2021-03-01 16:30:53 -08:00
Minio Trusted
8a4139c8e7 update to v0.6.2 2021-02-26 13:01:28 -08:00
Lenin Alevski
34bcd25c9f Disable Users and Groups Menu options when LDAP is enabled on MinIO (#614) 2021-02-26 11:20:17 -08:00
Minio Trusted
7853aa6bb9 update to v0.6.1 2021-02-25 10:20:32 -08:00
973 changed files with 87345 additions and 19355 deletions

View File

@@ -1,52 +0,0 @@
name: "Code scanning - action"
on:
push:
pull_request:
schedule:
- cron: '0 19 * * 0'
jobs:
CodeQL-Build:
# CodeQL runs on ubuntu-latest and windows-latest
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

34
.github/workflows/compiles.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: Go
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
build:
name: Compiles on Go ${{ matrix.go-version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [1.16.x]
os: [ubuntu-latest]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Build on ${{ matrix.os }}
env:
GO111MODULE: on
GOOS: linux
run: |
make console

34
.github/workflows/crosscompile-1.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: Go
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
build:
name: Cross compile
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [1.16.x]
os: [ubuntu-latest]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Build on ${{ matrix.os }}
env:
GO111MODULE: on
GOOS: linux
run: |
make crosscompile arg1="'linux/ppc64le linux/mips64'"

34
.github/workflows/crosscompile-2.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: Go
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
build:
name: Cross compile
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [1.16.x]
os: [ubuntu-latest]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Build on ${{ matrix.os }}
env:
GO111MODULE: on
GOOS: linux
run: |
make crosscompile arg1="'linux/arm64 linux/s390x'"

34
.github/workflows/crosscompile-3.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: Go
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
build:
name: Cross compile
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [1.16.x]
os: [ubuntu-latest]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Build on ${{ matrix.os }}
env:
GO111MODULE: on
GOOS: linux
run: |
make crosscompile arg1="'darwin/amd64 freebsd/amd64'"

34
.github/workflows/crosscompile-4.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: Go
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
build:
name: Cross compile
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [1.16.x]
os: [ubuntu-latest]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Build on ${{ matrix.os }}
env:
GO111MODULE: on
GOOS: linux
run: |
make crosscompile arg1="'windows/amd64 linux/arm'"

34
.github/workflows/crosscompile-5.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: Go
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
build:
name: Cross compile
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [1.16.x]
os: [ubuntu-latest]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Build on ${{ matrix.os }}
env:
GO111MODULE: on
GOOS: linux
run: |
make crosscompile arg1="'linux/386 netbsd/amd64'"

34
.github/workflows/go-test-pkg.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: Go
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
build:
name: Test Pkg on Go ${{ matrix.go-version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [1.16.x]
os: [ubuntu-latest]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Build on ${{ matrix.os }}
env:
GO111MODULE: on
GOOS: linux
run: |
make test-pkg

View File

@@ -10,11 +10,11 @@ on:
jobs:
build:
name: Test on Go ${{ matrix.go-version }} and ${{ matrix.os }}
name: Test Restapi on Go ${{ matrix.go-version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [1.15.x]
go-version: [1.16.x]
os: [ubuntu-latest]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
@@ -31,7 +31,4 @@ jobs:
GO111MODULE: on
GOOS: linux
run: |
make verifiers
make test
make crosscompile
make console

34
.github/workflows/lint.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: Go
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
build:
name: Checking Lint
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [1.16.x]
os: [ubuntu-latest]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Build on ${{ matrix.os }}
env:
GO111MODULE: on
GOOS: linux
run: |
make verifiers

1
.gitignore vendored
View File

@@ -27,7 +27,6 @@ dist/
# Ignore node_modules
portal-ui/node_modules/
portal-ui/build/
# Ignore tls cert and key
private.key

View File

@@ -12,7 +12,7 @@ linters:
- goimports
- misspell
- govet
- golint
- revive
- ineffassign
- gosimple
- deadcode
@@ -23,6 +23,16 @@ linters:
service:
golangci-lint-version: 1.27.0 # use the fixed version to not introduce new linters unexpectedly
issues:
exclude-use-default: false
exclude:
- should have a package comment
# TODO(y4m4): Remove once all exported ident. have comments!
- comment on exported function
- comment on exported type
- should have comment
- use leading k in Go names
- comment on exported const
run:
skip-dirs:
- pkg/clientgen

View File

@@ -78,6 +78,10 @@ nfpms:
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:
@@ -90,6 +94,7 @@ dockers:
- CREDITS
build_flag_templates:
- "--platform=linux/amd64"
- "--build-arg=TAG={{ .Tag }}"
- image_templates:
- "minio/console:{{ .Tag }}-ppc64le"
use_buildx: true
@@ -100,6 +105,7 @@ dockers:
- CREDITS
build_flag_templates:
- "--platform=linux/ppc64le"
- "--build-arg=TAG={{ .Tag }}"
- image_templates:
- "minio/console:{{ .Tag }}-s390x"
use_buildx: true
@@ -110,6 +116,7 @@ dockers:
- CREDITS
build_flag_templates:
- "--platform=linux/s390x"
- "--build-arg=TAG={{ .Tag }}"
- image_templates:
- "minio/console:{{ .Tag }}-arm64"
use_buildx: true
@@ -121,6 +128,52 @@ dockers:
- CREDITS
build_flag_templates:
- "--platform=linux/arm64"
- "--build-arg=TAG={{ .Tag }}"
- image_templates:
- "quay.io/minio/console:{{ .Tag }}-amd64"
use_buildx: true
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: true
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: true
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: true
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:
@@ -128,6 +181,12 @@ docker_manifests:
- 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

73
CREDITS
View File

@@ -2836,35 +2836,6 @@ Everyone is permitted to copy and distribute copies of this Agreement, but in or
This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
================================================================
github.com/elazarl/go-bindata-assetfs
https://github.com/elazarl/go-bindata-assetfs
----------------------------------------------------------------
Copyright (c) 2014, Elazar Leibovich
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
================================================================
github.com/evanphx/json-patch
https://github.com/evanphx/json-patch
----------------------------------------------------------------
@@ -13173,28 +13144,28 @@ SOFTWARE.
github.com/klauspost/readahead
https://github.com/klauspost/readahead
----------------------------------------------------------------
The MIT License (MIT)
Copyright (c) 2015 Klaus Post
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
The MIT License (MIT)
Copyright (c) 2015 Klaus Post
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================================

View File

@@ -67,7 +67,7 @@ $ cat > consoleAdmin.json << EOF
}
EOF
$ mc admin policy add myminio consoleAdmin consoleAdmin.json
$ mc admin policy set myminio consoleAdmin user=billy
$ mc admin policy set myminio consoleAdmin user="uid=billy,dc=example,dc=org"
```
## Run MinIO

View File

@@ -1,14 +1,7 @@
FROM golang:1.15 as binlayer
RUN go get github.com/go-bindata/go-bindata/... && go get github.com/elazarl/go-bindata-assetfs/...
FROM node:10 as uilayer
WORKDIR /app
COPY --from=binlayer /go/bin/go-bindata-assetfs /bin/
COPY --from=binlayer /go/bin/go-bindata /bin/
COPY ./portal-ui/package.json ./
COPY ./portal-ui/yarn.lock ./
RUN yarn install
@@ -19,7 +12,7 @@ RUN yarn install && make build-static
USER node
FROM golang:1.15 as golayer
FROM golang:1.16 as golayer
RUN apt-get update -y && apt-get install -y ca-certificates
@@ -33,16 +26,16 @@ RUN go mod download
ADD . /go/src/github.com/minio/console/
WORKDIR /go/src/github.com/minio/console/
COPY --from=uilayer /app/bindata_assetfs.go /go/src/github.com/minio/console/portal-ui/bindata_assetfs.go
ENV CGO_ENABLED=0
COPY --from=uilayer /app/build /go/src/github.com/minio/console/portal-ui/build
RUN go build -ldflags "-w -s" -a -o console ./cmd/console
FROM scratch
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3
MAINTAINER MinIO Development "dev@min.io"
EXPOSE 9090
COPY --from=golayer /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=golayer /go/src/github.com/minio/console/console .

View File

@@ -1,14 +1,7 @@
FROM golang:1.15 as binlayer
RUN go get github.com/go-bindata/go-bindata/... && go get github.com/elazarl/go-bindata-assetfs/...
FROM node:10 as uilayer
WORKDIR /app
COPY --from=binlayer /go/bin/go-bindata-assetfs /bin/
COPY --from=binlayer /go/bin/go-bindata /bin/
COPY ./portal-ui/package.json ./
COPY ./portal-ui/yarn.lock ./
RUN yarn install

View File

@@ -1,4 +1,6 @@
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.4
ARG TAG
COPY CREDITS /licenses/CREDITS
COPY LICENSE /licenses/LICENSE
@@ -6,8 +8,8 @@ COPY LICENSE /licenses/LICENSE
LABEL name="MinIO" \
vendor="MinIO Inc <dev@min.io>" \
maintainer="MinIO Inc <dev@min.io>" \
version="v0.6.0" \
release="v0.6.0" \
version="${TAG}" \
release="${TAG}" \
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."

View File

@@ -19,7 +19,7 @@ k8sdev:
getdeps:
@mkdir -p ${GOPATH}/bin
@which golangci-lint 1>/dev/null || (echo "Installing golangci-lint" && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.27.0)
@which golangci-lint 1>/dev/null || (echo "Installing golangci-lint" && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.40.1)
verifiers: getdeps fmt lint
@@ -31,7 +31,7 @@ fmt:
@GO111MODULE=on gofmt -d cluster/
crosscompile:
@(env bash $(PWD)/cross-compile.sh)
@(env bash $(PWD)/cross-compile.sh $(arg1))
lint:
@echo "Running $@ check"
@@ -43,17 +43,30 @@ install: console
@mkdir -p $(GOPATH)/bin && cp -f $(PWD)/console $(GOPATH)/bin/console
@echo "Installation successful. To learn more, try \"console --help\"."
swagger-gen:
@echo "Generating swagger server code from yaml"
swagger-gen: clean-swagger swagger-console swagger-operator
@echo "Done Generating swagger server code from yaml"
clean-swagger:
@echo "cleaning"
@rm -rf models
@rm -rf restapi/operations
@swagger generate server -A console --main-package=console --exclude-main -P models.Principal -f ./swagger.yml -r NOTICE
@rm -rf operatorapi/operations
swagger-console:
@echo "Generating swagger server code from yaml"
@swagger generate server -A console --main-package=management --server-package=restapi --exclude-main -P models.Principal -f ./swagger-console.yml -r NOTICE
swagger-operator:
@echo "Generating swagger server code from yaml"
@swagger generate server -A operator --main-package=operator --server-package=operatorapi --exclude-main -P models.Principal -f ./swagger-operator.yml -r NOTICE
assets:
@(cd portal-ui; yarn install; make build-static; yarn prettier --write . --loglevel warn; cd ..)
test:
@(GO111MODULE=on go test -race -v github.com/minio/console/restapi/...)
test-pkg:
@(GO111MODULE=on go test -race -v github.com/minio/console/pkg/...)
coverage:

View File

@@ -55,10 +55,10 @@ docker pull minio/console
### Build from source
```
GO111MODULE=on go get github.com/minio/console/cmd/console
GO111MODULE=on go install github.com/minio/console/cmd/console@latest
```
> You will need a working Go environment. Therefore, please follow [How to install Go](https://golang.org/doc/install).
> Minimum version required is go1.14
> Minimum version required is go1.16
## Setup
@@ -182,7 +182,8 @@ Copy your `public.crt` and `private.key` to `~/.console/certs`, then:
```sh
./console server
2021-01-19 02:36:08.893735 I | 2021/01/19 02:36:08 server.go:129: Serving console at https://localhost:9090
2021-01-19 02:36:08.893735 I | 2021/01/19 02:36:08 server.go:129: Serving console at http://[::]:9090
2021-01-19 02:36:08.893735 I | 2021/01/19 02:36:08 server.go:129: Serving console at https://[::]:9443
```
For advanced users, `console` has support for multiple certificates to service clients through multiple domains.

View File

@@ -17,6 +17,7 @@
package cluster
import (
direct "github.com/minio/direct-csi/pkg/clientset"
operator "github.com/minio/operator/pkg/client/clientset/versioned"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
@@ -63,3 +64,8 @@ func OperatorClient(token string) (*operator.Clientset, error) {
func K8sClient(token string) (*kubernetes.Clientset, error) {
return kubernetes.NewForConfig(GetK8sConfig(token))
}
// DirectCSIClient returns Direct CSI client using GetK8sConfig for its config
func DirectCSIClient(token string) (*direct.Clientset, error) {
return direct.NewForConfig(GetK8sConfig(token))
}

View File

@@ -26,7 +26,7 @@ import (
"strings"
"time"
"github.com/minio/minio/pkg/env"
"github.com/minio/pkg/env"
)
var (

View File

@@ -23,13 +23,11 @@ import (
"sort"
"time"
"github.com/minio/console/pkg"
"github.com/minio/minio/pkg/console"
"github.com/minio/minio/pkg/trie"
"github.com/minio/minio/pkg/words"
"github.com/minio/cli"
"github.com/minio/console/pkg"
"github.com/minio/pkg/console"
"github.com/minio/pkg/trie"
"github.com/minio/pkg/words"
)
// Help template for Console.
@@ -54,6 +52,8 @@ VERSION:
var appCmds = []cli.Command{
serverCmd,
updateCmd,
operatorCmd,
}
func newApp(name string) *cli.App {

246
cmd/console/operator.go Normal file
View File

@@ -0,0 +1,246 @@
// 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 main
import (
"fmt"
"io/ioutil"
"path/filepath"
"strconv"
"time"
"github.com/minio/console/restapi"
"github.com/go-openapi/loads"
"github.com/jessevdk/go-flags"
"github.com/minio/cli"
"github.com/minio/console/operatorapi"
"github.com/minio/console/operatorapi/operations"
"github.com/minio/console/pkg/certs"
)
// starts the server
var operatorCmd = cli.Command{
Name: "operator",
Aliases: []string{"opr"},
Usage: "Start MinIO Operator UI server",
Action: startOperatorServer,
Flags: []cli.Flag{
cli.StringFlag{
Name: "host",
Value: restapi.GetHostname(),
Usage: "bind to a specific HOST, HOST can be an IP or hostname",
},
cli.IntFlag{
Name: "port",
Value: restapi.GetPort(),
Usage: "bind to specific HTTP port",
},
// This is kept here for backward compatibility,
// hostname's do not have HTTP or HTTPs
// hostnames are opaque so using --host
// works for both HTTP and HTTPS setup.
cli.StringFlag{
Name: "tls-host",
Value: restapi.GetHostname(),
Hidden: true,
},
cli.StringFlag{
Name: "certs-dir",
Value: certs.GlobalCertsCADir.Get(),
Usage: "path to certs directory",
},
cli.IntFlag{
Name: "tls-port",
Value: restapi.GetTLSPort(),
Usage: "bind to specific HTTPS port",
},
cli.StringFlag{
Name: "tls-redirect",
Value: restapi.GetTLSRedirect(),
Usage: "toggle HTTP->HTTPS redirect",
},
cli.StringFlag{
Name: "tls-certificate",
Value: "",
Usage: "path to TLS public certificate",
Hidden: true,
},
cli.StringFlag{
Name: "tls-key",
Value: "",
Usage: "path to TLS private key",
Hidden: true,
},
cli.StringFlag{
Name: "tls-ca",
Value: "",
Usage: "path to TLS Certificate Authority",
Hidden: true,
},
},
}
func buildOperatorServer() (*operatorapi.Server, error) {
swaggerSpec, err := loads.Embedded(operatorapi.SwaggerJSON, operatorapi.FlatSwaggerJSON)
if err != nil {
return nil, err
}
api := operations.NewOperatorAPI(swaggerSpec)
api.Logger = operatorapi.LogInfo
server := operatorapi.NewServer(api)
parser := flags.NewParser(server, flags.Default)
parser.ShortDescription = "MinIO Console Server"
parser.LongDescription = swaggerSpec.Spec().Info.Description
server.ConfigureFlags()
// register all APIs
server.ConfigureAPI()
for _, optsGroup := range api.CommandLineOptionsGroups {
_, err := parser.AddGroup(optsGroup.ShortDescription, optsGroup.LongDescription, optsGroup.Options)
if err != nil {
return nil, err
}
}
if _, err := parser.Parse(); err != nil {
return nil, err
}
return server, nil
}
func loadOperatorAllCerts(ctx *cli.Context) error {
var err error
// Set all certs and CAs directories path
certs.GlobalCertsDir, _, err = certs.NewConfigDirFromCtx(ctx, "certs-dir", certs.DefaultCertsDir.Get)
if err != nil {
return err
}
certs.GlobalCertsCADir = &certs.ConfigDir{Path: filepath.Join(certs.GlobalCertsDir.Get(), certs.CertsCADir)}
// check if certs and CAs directories exists or can be created
if err = certs.MkdirAllIgnorePerm(certs.GlobalCertsCADir.Get()); err != nil {
return fmt.Errorf("unable to create certs CA directory at %s: failed with %w", certs.GlobalCertsCADir.Get(), err)
}
// load the certificates and the CAs
operatorapi.GlobalRootCAs, operatorapi.GlobalPublicCerts, operatorapi.GlobalTLSCertsManager, err = certs.GetAllCertificatesAndCAs()
if err != nil {
return fmt.Errorf("unable to load certificates at %s: failed with %w", certs.GlobalCertsDir.Get(), err)
}
{
// TLS flags from swagger server, used to support VMware vsphere operator version.
swaggerServerCertificate := ctx.String("tls-certificate")
swaggerServerCertificateKey := ctx.String("tls-key")
swaggerServerCACertificate := ctx.String("tls-ca")
// load tls cert and key from swagger server tls-certificate and tls-key flags
if swaggerServerCertificate != "" && swaggerServerCertificateKey != "" {
if err = operatorapi.GlobalTLSCertsManager.AddCertificate(swaggerServerCertificate, swaggerServerCertificateKey); err != nil {
return err
}
x509Certs, err := certs.ParsePublicCertFile(swaggerServerCertificate)
if err == nil {
operatorapi.GlobalPublicCerts = append(operatorapi.GlobalPublicCerts, x509Certs...)
}
}
// load ca cert from swagger server tls-ca flag
if swaggerServerCACertificate != "" {
caCert, caCertErr := ioutil.ReadFile(swaggerServerCACertificate)
if caCertErr == nil {
operatorapi.GlobalRootCAs.AppendCertsFromPEM(caCert)
}
}
}
return nil
}
// StartServer starts the console service
func startOperatorServer(ctx *cli.Context) error {
if err := loadOperatorAllCerts(ctx); err != nil {
// Log this as a warning and continue running console without TLS certificates
operatorapi.LogError("Unable to load certs: %v", err)
}
var rctx operatorapi.Context
if err := rctx.Load(ctx); err != nil {
operatorapi.LogError("argument validation failed: %v", err)
return err
}
server, err := buildOperatorServer()
if err != nil {
operatorapi.LogError("Unable to initialize console server: %v", err)
return err
}
server.Host = rctx.Host
server.Port = rctx.HTTPPort
// set conservative timesout for uploads
server.ReadTimeout = 1 * time.Hour
// no timeouts for response for downloads
server.WriteTimeout = 0
operatorapi.Port = strconv.Itoa(server.Port)
operatorapi.Hostname = server.Host
if len(operatorapi.GlobalPublicCerts) > 0 {
// If TLS certificates are provided enforce the HTTPS schema, meaning console will redirect
// plain HTTP connections to HTTPS server
server.EnabledListeners = []string{"http", "https"}
server.TLSPort = rctx.HTTPSPort
// Need to store tls-port, tls-host un config variables so secure.middleware can read from there
operatorapi.TLSPort = strconv.Itoa(server.TLSPort)
operatorapi.Hostname = rctx.Host
operatorapi.TLSRedirect = rctx.TLSRedirect
}
defer server.Shutdown()
// subnet license refresh process
go func() {
// start refreshing subnet license after 5 seconds..
time.Sleep(time.Second * 5)
failedAttempts := 0
for {
if err := operatorapi.RefreshLicense(); err != nil {
operatorapi.LogError("Refreshing subnet license failed: %v", err)
failedAttempts++
// end license refresh after 3 consecutive failed attempts
if failedAttempts >= 3 {
return
}
// wait 5 minutes and retry again
time.Sleep(time.Minute * 5)
continue
}
// if license refreshed successfully reset the counter
failedAttempts = 0
// try to refresh license every 24 hrs
time.Sleep(time.Hour * 24)
}
}()
return server.Serve()
}

View File

@@ -18,9 +18,11 @@ package main
import (
"fmt"
"log"
"io/ioutil"
"os"
"path/filepath"
"strconv"
"time"
"github.com/go-openapi/loads"
"github.com/jessevdk/go-flags"
@@ -34,52 +36,73 @@ import (
var serverCmd = cli.Command{
Name: "server",
Aliases: []string{"srv"},
Usage: "starts Console server",
Action: startServer,
Usage: "Start MinIO Console server",
Action: StartServer,
Flags: []cli.Flag{
cli.StringFlag{
Name: "host",
Value: restapi.GetHostname(),
Usage: "HTTP server hostname",
Usage: "bind to a specific HOST, HOST can be an IP or hostname",
},
cli.IntFlag{
Name: "port",
Value: restapi.GetPort(),
Usage: "HTTP Server port",
Usage: "bind to specific HTTP port",
},
// This is kept here for backward compatibility,
// hostname's do not have HTTP or HTTPs
// hostnames are opaque so using --host
// works for both HTTP and HTTPS setup.
cli.StringFlag{
Name: "tls-host",
Value: restapi.GetTLSHostname(),
Usage: "HTTPS server hostname",
},
cli.IntFlag{
Name: "tls-port",
Value: restapi.GetTLSPort(),
Usage: "HTTPS server port",
},
cli.StringFlag{
Name: "tls-redirect",
Value: restapi.GetTLSRedirect(),
Usage: "HTTPS redirect by default",
Name: "tls-host",
Value: restapi.GetHostname(),
Hidden: true,
},
cli.StringFlag{
Name: "certs-dir",
Value: certs.GlobalCertsCADir.Get(),
Usage: "path to certs directory",
},
cli.IntFlag{
Name: "tls-port",
Value: restapi.GetTLSPort(),
Usage: "bind to specific HTTPS port",
},
cli.StringFlag{
Name: "tls-redirect",
Value: restapi.GetTLSRedirect(),
Usage: "toggle HTTP->HTTPS redirect",
},
cli.StringFlag{
Name: "tls-certificate",
Value: "",
Usage: "path to TLS public certificate",
Hidden: true,
},
cli.StringFlag{
Name: "tls-key",
Value: "",
Usage: "path to TLS private key",
Hidden: true,
},
cli.StringFlag{
Name: "tls-ca",
Value: "",
Usage: "path to TLS Certificate Authority",
Hidden: true,
},
},
}
// starts the controller
func startServer(ctx *cli.Context) error {
func buildServer() (*restapi.Server, error) {
swaggerSpec, err := loads.Embedded(restapi.SwaggerJSON, restapi.FlatSwaggerJSON)
if err != nil {
log.Fatalln(err)
return nil, err
}
api := operations.NewConsoleAPI(swaggerSpec)
api.Logger = restapi.LogInfo
server := restapi.NewServer(api)
defer server.Shutdown()
parser := flags.NewParser(server, flags.Default)
parser.ShortDescription = "MinIO Console Server"
@@ -87,56 +110,115 @@ func startServer(ctx *cli.Context) error {
server.ConfigureFlags()
// register all APIs
server.ConfigureAPI()
for _, optsGroup := range api.CommandLineOptionsGroups {
_, err := parser.AddGroup(optsGroup.ShortDescription, optsGroup.LongDescription, optsGroup.Options)
if err != nil {
log.Fatalln(err)
return nil, err
}
}
if _, err := parser.Parse(); err != nil {
code := 1
if fe, ok := err.(*flags.Error); ok {
if fe.Type == flags.ErrHelp {
code = 0
return nil, err
}
return server, nil
}
func loadAllCerts(ctx *cli.Context) error {
var err error
// Set all certs and CAs directories path
certs.GlobalCertsDir, _, err = certs.NewConfigDirFromCtx(ctx, "certs-dir", certs.DefaultCertsDir.Get)
if err != nil {
return err
}
certs.GlobalCertsCADir = &certs.ConfigDir{Path: filepath.Join(certs.GlobalCertsDir.Get(), certs.CertsCADir)}
// check if certs and CAs directories exists or can be created
if err = certs.MkdirAllIgnorePerm(certs.GlobalCertsCADir.Get()); err != nil {
return fmt.Errorf("unable to create certs CA directory at %s: failed with %w", certs.GlobalCertsCADir.Get(), err)
}
// load the certificates and the CAs
restapi.GlobalRootCAs, restapi.GlobalPublicCerts, restapi.GlobalTLSCertsManager, err = certs.GetAllCertificatesAndCAs()
if err != nil {
return fmt.Errorf("unable to load certificates at %s: failed with %w", certs.GlobalCertsDir.Get(), err)
}
{
// TLS flags from swagger server, used to support VMware vsphere operator version.
swaggerServerCertificate := ctx.String("tls-certificate")
swaggerServerCertificateKey := ctx.String("tls-key")
swaggerServerCACertificate := ctx.String("tls-ca")
// load tls cert and key from swagger server tls-certificate and tls-key flags
if swaggerServerCertificate != "" && swaggerServerCertificateKey != "" {
if err = restapi.GlobalTLSCertsManager.AddCertificate(swaggerServerCertificate, swaggerServerCertificateKey); err != nil {
return err
}
x509Certs, err := certs.ParsePublicCertFile(swaggerServerCertificate)
if err == nil {
restapi.GlobalPublicCerts = append(restapi.GlobalPublicCerts, x509Certs...)
}
}
// load ca cert from swagger server tls-ca flag
if swaggerServerCACertificate != "" {
caCert, caCertErr := ioutil.ReadFile(swaggerServerCACertificate)
if caCertErr == nil {
restapi.GlobalRootCAs.AppendCertsFromPEM(caCert)
}
}
os.Exit(code)
}
server.Host = ctx.String("host")
server.Port = ctx.Int("port")
return nil
}
restapi.Hostname = ctx.String("host")
restapi.Port = fmt.Sprintf("%v", ctx.Int("port"))
// Set all certs and CAs directories path
certs.GlobalCertsDir, _ = certs.NewConfigDirFromCtx(ctx, "certs-dir", certs.DefaultCertsDir.Get)
certs.GlobalCertsCADir = &certs.ConfigDir{Path: filepath.Join(certs.GlobalCertsDir.Get(), certs.CertsCADir)}
// check if certs and CAs directories exists or can be created
if err := certs.MkdirAllIgnorePerm(certs.GlobalCertsCADir.Get()); err != nil {
log.Println(fmt.Sprintf("Unable to create certs CA directory at %s", certs.GlobalCertsCADir.Get()))
// StartServer starts the console service
func StartServer(ctx *cli.Context) error {
if os.Getenv("CONSOLE_OPERATOR_MODE") != "" && os.Getenv("CONSOLE_OPERATOR_MODE") == "on" {
return startOperatorServer(ctx)
}
// load the certificates and the CAs
restapi.GlobalRootCAs, restapi.GlobalPublicCerts, restapi.GlobalTLSCertsManager = certs.GetAllCertificatesAndCAs()
if err := loadAllCerts(ctx); err != nil {
// Log this as a warning and continue running console without TLS certificates
restapi.LogError("Unable to load certs: %v", err)
}
var rctx restapi.Context
if err := rctx.Load(ctx); err != nil {
restapi.LogError("argument validation failed: %v", err)
return err
}
server, err := buildServer()
if err != nil {
restapi.LogError("Unable to initialize console server: %v", err)
return err
}
server.Host = rctx.Host
server.Port = rctx.HTTPPort
// set conservative timesout for uploads
server.ReadTimeout = 1 * time.Hour
// no timeouts for response for downloads
server.WriteTimeout = 0
restapi.Port = strconv.Itoa(server.Port)
restapi.Hostname = server.Host
if len(restapi.GlobalPublicCerts) > 0 {
// If TLS certificates are provided enforce the HTTPS schema, meaning console will redirect
// plain HTTP connections to HTTPS server
server.EnabledListeners = []string{"http", "https"}
server.TLSPort = ctx.Int("tls-port")
server.TLSHost = ctx.String("tls-host")
server.TLSPort = rctx.HTTPSPort
// Need to store tls-port, tls-host un config variables so secure.middleware can read from there
restapi.TLSPort = fmt.Sprintf("%v", ctx.Int("tls-port"))
restapi.TLSHostname = ctx.String("tls-host")
restapi.TLSRedirect = ctx.String("tls-redirect")
restapi.TLSPort = strconv.Itoa(server.TLSPort)
restapi.Hostname = rctx.Host
restapi.TLSRedirect = rctx.TLSRedirect
}
server.ConfigureAPI()
defer server.Shutdown()
if err := server.Serve(); err != nil {
log.Fatalln(err)
}
return nil
return server.Serve()
}

154
cmd/console/update.go Normal file
View File

@@ -0,0 +1,154 @@
// 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 main
import (
"encoding/json"
"errors"
"fmt"
"io"
"net"
"net/http"
"os"
"runtime"
"strings"
"time"
"github.com/blang/semver/v4"
"github.com/cheggaaa/pb/v3"
"github.com/minio/cli"
"github.com/minio/console/pkg"
"github.com/minio/selfupdate"
)
func getUpdateTransport(timeout time.Duration) http.RoundTripper {
var updateTransport http.RoundTripper = &http.Transport{
Proxy: http.ProxyFromEnvironment,
DialContext: (&net.Dialer{
Timeout: timeout,
KeepAlive: timeout,
DualStack: true,
}).DialContext,
IdleConnTimeout: timeout,
TLSHandshakeTimeout: timeout,
ExpectContinueTimeout: timeout,
DisableCompression: true,
}
return updateTransport
}
func getUpdateReaderFromURL(u string, transport http.RoundTripper) (io.ReadCloser, int64, error) {
clnt := &http.Client{
Transport: transport,
}
req, err := http.NewRequest(http.MethodGet, u, nil)
if err != nil {
return nil, -1, err
}
resp, err := clnt.Do(req)
if err != nil {
return nil, -1, err
}
return resp.Body, resp.ContentLength, nil
}
const defaultPubKey = "RWTx5Zr1tiHQLwG9keckT0c45M3AGeHD6IvimQHpyRywVWGbP1aVSGav"
func getLatestRelease(tr http.RoundTripper) (string, error) {
releaseURL := "https://api.github.com/repos/minio/console/releases/latest"
body, _, err := getUpdateReaderFromURL(releaseURL, tr)
if err != nil {
return "", fmt.Errorf("unable to access github release URL %w", err)
}
defer body.Close()
lm := make(map[string]interface{})
if err = json.NewDecoder(body).Decode(&lm); err != nil {
return "", err
}
rel, ok := lm["tag_name"].(string)
if !ok {
return "", errors.New("unable to find latest release tag")
}
return rel, nil
}
// update console in-place
var updateCmd = cli.Command{
Name: "update",
Usage: "update console to latest release",
Action: updateInplace,
}
func updateInplace(ctx *cli.Context) error {
transport := getUpdateTransport(30 * time.Second)
rel, err := getLatestRelease(transport)
if err != nil {
return err
}
latest, err := semver.Make(strings.TrimPrefix(rel, "v"))
if err != nil {
return err
}
current, err := semver.Make(pkg.Version)
if err != nil {
return err
}
if current.GTE(latest) {
fmt.Printf("You are already running the latest version v%v.\n", pkg.Version)
return nil
}
consoleBin := fmt.Sprintf("https://github.com/minio/console/releases/download/%s/console-%s-%s", rel, runtime.GOOS, runtime.GOARCH)
reader, length, err := getUpdateReaderFromURL(consoleBin, transport)
if err != nil {
return fmt.Errorf("unable to fetch binary from %s: %w", consoleBin, err)
}
minisignPubkey := os.Getenv("CONSOLE_MINISIGN_PUBKEY")
if minisignPubkey == "" {
minisignPubkey = defaultPubKey
}
v := selfupdate.NewVerifier()
if err = v.LoadFromURL(consoleBin+".minisig", minisignPubkey, transport); err != nil {
return fmt.Errorf("unable to fetch binary signature for %s: %w", consoleBin, err)
}
opts := selfupdate.Options{
Verifier: v,
}
tmpl := `{{ red "Downloading:" }} {{bar . (red "[") (green "=") (red "]")}} {{speed . | rndcolor }}`
bar := pb.ProgressBarTemplate(tmpl).Start64(length)
barReader := bar.NewProxyReader(reader)
if err = selfupdate.Apply(barReader, opts); err != nil {
bar.Finish()
if rerr := selfupdate.RollbackError(err); rerr != nil {
return rerr
}
return err
}
bar.Finish()
fmt.Printf("Updated 'console' to latest release %s\n", rel)
return nil
}

61
compose/.env Normal file
View File

@@ -0,0 +1,61 @@
## PostgreSQL related variables
# Postgres Docker image
POSTGRES_IMAGE=library/postgres
# Postgres user
POSTGRES_USER=postgres
# Postgres password
POSTGRES_PASSWORD=magical_password
# Postgres port number
POSTGRES_PORT=5432
# Postgres data directory
PGDATA=/data/postgres
## Logsearch related variables
# Logsearch Docker image
LOGSEARCH_IMAGE=minio/logsearchapi:v4.1.2
# Logsearch storage max
LOGSEARCH_DISK_CAPACITY_GB=5
# Logsearch port number
LOGSEARCH_PORT=8080
# Log retention duration
LOGSEARCH_MAX_RETENTION_MONTHS=1
# Logsearch audit authentication token
LOGSEARCH_AUDIT_AUTH_TOKEN=c6rkqjZ03ElEUKQ7MtSeYBJ8q_p3GDFPBQAQJlcbBLA=
# Logsearch query authentication token
LOGSEARCH_QUERY_AUTH_TOKEN=c6rkqjZ03ElEUKQ7MtSeYBJ8q_p3GDFPBQAQJlcbBLA=
## Console related variables
# Console Docker image
CONSOLE_IMAGE=minio/console:v0.8.0
# Salt to encrypt JWT payload
CONSOLE_PBKDF_PASSPHRASE=top_secret
# Required to encrypt JWT payload
CONSOLE_PBKDF_SALT=top_secret1
# MinIO Server URL
CONSOLE_MINIO_SERVER=http://localhost:9000
## Prometheus related variables
# Prometheus Docker image
PROMETHEUS_IMAGE=prom/prometheus:latest
# Prometheus port number
PROMETHEUS_PORT=9999

64
compose/README.md Normal file
View File

@@ -0,0 +1,64 @@
## Console Docker Compose
This compose file allows users to quickly deploy MinIO Console, LogSearch & Prometheus in a baremetal (non Kubernetes) environment.
### Pre-requisites
1. [MinIO](https://docs.minio.io/docs/distributed-minio-quickstart-guide.html) cluster up and running.
2. [mc](https://docs.minio.io/docs/minio-client-quickstart-guide.html) configured for this MinIO cluster.
3. [Docker-Compose](https://docs.docker.com/compose/) installed on the server.
### Getting Started
- Download the contents of `compose` directory on your machine.
- Edit the `prometheus.yaml` file and fill in the correct target (MinIO Endpoint). Optionally setup the `bearer_token` as explained [here](https://github.com/minio/minio/tree/master/docs/metrics/prometheus#31-authenticated-prometheus-config).
- Setup a console admin policy.
```sh
cat > admin.json << EOF
{
"Version": "2012-10-17",
"Statement": [{
"Action": [
"admin:*"
],
"Effect": "Allow",
"Sid": ""
},
{
"Action": [
"s3:*"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::*"
],
"Sid": ""
}
]
}
EOF
```
Then create this policy on MinIO server: `mc admin policy add myminio consoleAdmin admin.json`.
- Setup user and policy for Console
```
mc admin user add myminio console console123
mc admin policy set myminio consoleAdmin user=console
```
- Configure Webhook target on the MinIO server. Remember to change the `token` value in below URL to the actual token value as set in the `.env` file.
```
mc admin config set myminio audit_webhook:1 endpoint=http://localhost:8080/api/ingest?token=c6rkqjZ03ElEUKQ7MtSeYBJ8q_p3GDFPBQAQJlcbBLA=
mc admin service restart myminio
```
### Configuration
To configure the Console Compose file to custom setup, please take a look at the [`.env`](./.env) file.

View File

@@ -0,0 +1,62 @@
version: '3.4'
services:
pg_database:
image: ${POSTGRES_IMAGE}
network_mode: host
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- PGDATA=${PGDATA}
- POSTGRES_DB=minio_logs
volumes:
- database:${PGDATA}
ports:
- ${POSTGRES_PORT}:${POSTGRES_PORT}
log_search:
image: ${LOGSEARCH_IMAGE}
network_mode: host
environment:
- LOGSEARCH_AUDIT_AUTH_TOKEN=${LOGSEARCH_AUDIT_AUTH_TOKEN}
- LOGSEARCH_QUERY_AUTH_TOKEN=${LOGSEARCH_QUERY_AUTH_TOKEN}
- LOGSEARCH_DISK_CAPACITY_GB=${LOGSEARCH_DISK_CAPACITY_GB}
- LOGSEARCH_MAX_RETENTION_MONTHS=${LOGSEARCH_MAX_RETENTION_MONTHS}
- LOGSEARCH_PG_CONN_STR=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@localhost:${POSTGRES_PORT}/minio_logs?sslmode=disable
ports:
- ${LOGSEARCH_PORT}:${LOGSEARCH_PORT}
command: ["/usr/bin/wait-for-it.sh", "localhost:${POSTGRES_PORT}", "--", "/logsearchapi"]
volumes:
- ./wait-for-it.sh:/usr/bin/wait-for-it.sh
depends_on:
- pg_database
console:
image: ${CONSOLE_IMAGE}
network_mode: host
environment:
- CONSOLE_PBKDF_PASSPHRASE=${CONSOLE_PBKDF_PASSPHRASE}
- CONSOLE_PBKDF_SALT=${CONSOLE_PBKDF_SALT}
- LOGSEARCH_QUERY_AUTH_TOKEN=${LOGSEARCH_QUERY_AUTH_TOKEN}
- CONSOLE_MINIO_SERVER=${CONSOLE_MINIO_SERVER}
- CONSOLE_LOG_QUERY_URL=http://localhost:${LOGSEARCH_PORT}
- CONSOLE_PROMETHEUS_URL=http://localhost:${PROMETHEUS_PORT}
ports:
- "9090:9090"
command: server
depends_on:
- log_search
- prometheus
prometheus:
image: ${PROMETHEUS_IMAGE}
network_mode: host
ports:
- ${PROMETHEUS_PORT}:${PROMETHEUS_PORT}
command:
- --config.file=/etc/prometheus/prometheus.yml
- --web.listen-address=:${PROMETHEUS_PORT}
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
volumes:
database:

15
compose/prometheus.yml Normal file
View File

@@ -0,0 +1,15 @@
global:
scrape_interval: 10s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 30s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: minio-job
metrics_path: /minio/v2/metrics/cluster
scheme: http
static_configs:
- targets:
- 'localhost:9000'

182
compose/wait-for-it.sh Executable file
View File

@@ -0,0 +1,182 @@
#!/usr/bin/env bash
# Use this script to test if a given TCP host/port are available
WAITFORIT_cmdname=${0##*/}
echoerr() { if [[ $WAITFORIT_QUIET -ne 1 ]]; then echo "$@" 1>&2; fi }
usage()
{
cat << USAGE >&2
Usage:
$WAITFORIT_cmdname host:port [-s] [-t timeout] [-- command args]
-h HOST | --host=HOST Host or IP under test
-p PORT | --port=PORT TCP port under test
Alternatively, you specify the host and port as host:port
-s | --strict Only execute subcommand if the test succeeds
-q | --quiet Don't output any status messages
-t TIMEOUT | --timeout=TIMEOUT
Timeout in seconds, zero for no timeout
-- COMMAND ARGS Execute command with args after the test finishes
USAGE
exit 1
}
wait_for()
{
if [[ $WAITFORIT_TIMEOUT -gt 0 ]]; then
echoerr "$WAITFORIT_cmdname: waiting $WAITFORIT_TIMEOUT seconds for $WAITFORIT_HOST:$WAITFORIT_PORT"
else
echoerr "$WAITFORIT_cmdname: waiting for $WAITFORIT_HOST:$WAITFORIT_PORT without a timeout"
fi
WAITFORIT_start_ts=$(date +%s)
while :
do
if [[ $WAITFORIT_ISBUSY -eq 1 ]]; then
nc -z $WAITFORIT_HOST $WAITFORIT_PORT
WAITFORIT_result=$?
else
(echo -n > /dev/tcp/$WAITFORIT_HOST/$WAITFORIT_PORT) >/dev/null 2>&1
WAITFORIT_result=$?
fi
if [[ $WAITFORIT_result -eq 0 ]]; then
WAITFORIT_end_ts=$(date +%s)
echoerr "$WAITFORIT_cmdname: $WAITFORIT_HOST:$WAITFORIT_PORT is available after $((WAITFORIT_end_ts - WAITFORIT_start_ts)) seconds"
break
fi
sleep 1
done
return $WAITFORIT_result
}
wait_for_wrapper()
{
# In order to support SIGINT during timeout: http://unix.stackexchange.com/a/57692
if [[ $WAITFORIT_QUIET -eq 1 ]]; then
timeout $WAITFORIT_BUSYTIMEFLAG $WAITFORIT_TIMEOUT $0 --quiet --child --host=$WAITFORIT_HOST --port=$WAITFORIT_PORT --timeout=$WAITFORIT_TIMEOUT &
else
timeout $WAITFORIT_BUSYTIMEFLAG $WAITFORIT_TIMEOUT $0 --child --host=$WAITFORIT_HOST --port=$WAITFORIT_PORT --timeout=$WAITFORIT_TIMEOUT &
fi
WAITFORIT_PID=$!
trap "kill -INT -$WAITFORIT_PID" INT
wait $WAITFORIT_PID
WAITFORIT_RESULT=$?
if [[ $WAITFORIT_RESULT -ne 0 ]]; then
echoerr "$WAITFORIT_cmdname: timeout occurred after waiting $WAITFORIT_TIMEOUT seconds for $WAITFORIT_HOST:$WAITFORIT_PORT"
fi
return $WAITFORIT_RESULT
}
# process arguments
while [[ $# -gt 0 ]]
do
case "$1" in
*:* )
WAITFORIT_hostport=(${1//:/ })
WAITFORIT_HOST=${WAITFORIT_hostport[0]}
WAITFORIT_PORT=${WAITFORIT_hostport[1]}
shift 1
;;
--child)
WAITFORIT_CHILD=1
shift 1
;;
-q | --quiet)
WAITFORIT_QUIET=1
shift 1
;;
-s | --strict)
WAITFORIT_STRICT=1
shift 1
;;
-h)
WAITFORIT_HOST="$2"
if [[ $WAITFORIT_HOST == "" ]]; then break; fi
shift 2
;;
--host=*)
WAITFORIT_HOST="${1#*=}"
shift 1
;;
-p)
WAITFORIT_PORT="$2"
if [[ $WAITFORIT_PORT == "" ]]; then break; fi
shift 2
;;
--port=*)
WAITFORIT_PORT="${1#*=}"
shift 1
;;
-t)
WAITFORIT_TIMEOUT="$2"
if [[ $WAITFORIT_TIMEOUT == "" ]]; then break; fi
shift 2
;;
--timeout=*)
WAITFORIT_TIMEOUT="${1#*=}"
shift 1
;;
--)
shift
WAITFORIT_CLI=("$@")
break
;;
--help)
usage
;;
*)
echoerr "Unknown argument: $1"
usage
;;
esac
done
if [[ "$WAITFORIT_HOST" == "" || "$WAITFORIT_PORT" == "" ]]; then
echoerr "Error: you need to provide a host and port to test."
usage
fi
WAITFORIT_TIMEOUT=${WAITFORIT_TIMEOUT:-15}
WAITFORIT_STRICT=${WAITFORIT_STRICT:-0}
WAITFORIT_CHILD=${WAITFORIT_CHILD:-0}
WAITFORIT_QUIET=${WAITFORIT_QUIET:-0}
# Check to see if timeout is from busybox?
WAITFORIT_TIMEOUT_PATH=$(type -p timeout)
WAITFORIT_TIMEOUT_PATH=$(realpath $WAITFORIT_TIMEOUT_PATH 2>/dev/null || readlink -f $WAITFORIT_TIMEOUT_PATH)
WAITFORIT_BUSYTIMEFLAG=""
if [[ $WAITFORIT_TIMEOUT_PATH =~ "busybox" ]]; then
WAITFORIT_ISBUSY=1
# Check if busybox timeout uses -t flag
# (recent Alpine versions don't support -t anymore)
if timeout &>/dev/stdout | grep -q -e '-t '; then
WAITFORIT_BUSYTIMEFLAG="-t"
fi
else
WAITFORIT_ISBUSY=0
fi
if [[ $WAITFORIT_CHILD -gt 0 ]]; then
wait_for
WAITFORIT_RESULT=$?
exit $WAITFORIT_RESULT
else
if [[ $WAITFORIT_TIMEOUT -gt 0 ]]; then
wait_for_wrapper
WAITFORIT_RESULT=$?
else
wait_for
WAITFORIT_RESULT=$?
fi
fi
if [[ $WAITFORIT_CLI != "" ]]; then
if [[ $WAITFORIT_RESULT -ne 0 && $WAITFORIT_STRICT -eq 1 ]]; then
echoerr "$WAITFORIT_cmdname: strict mode, refusing to execute subprocess"
exit $WAITFORIT_RESULT
fi
exec "${WAITFORIT_CLI[@]}"
else
exit $WAITFORIT_RESULT
fi

View File

@@ -4,13 +4,12 @@ set -e
# Enable tracing if set.
[ -n "$BASH_XTRACEFD" ] && set -x
_init() {
## All binaries are static make sure to disable CGO.
export CGO_ENABLED=0
## All binaries are static make sure to disable CGO.
export CGO_ENABLED=0
## List of architectures and OS to test coss compilation.
SUPPORTED_OSARCH="linux/ppc64le linux/mips64 linux/arm64 linux/s390x darwin/amd64 freebsd/amd64 windows/amd64 linux/arm linux/386 netbsd/amd64"
}
## List of architectures and OS to test cross compilation.
SUPPORTED_OSARCH_DEFAULTS="linux/ppc64le linux/mips64 linux/arm64 linux/s390x darwin/amd64 freebsd/amd64 windows/amd64 linux/arm linux/386 netbsd/amd64"
SUPPORTED_OSARCH=${1:-$SUPPORTED_OSARCH_DEFAULTS}
_build() {
local osarch=$1
@@ -31,4 +30,4 @@ main() {
done
}
_init && main "$@"
main "$@"

50
go.mod
View File

@@ -1,36 +1,44 @@
module github.com/minio/console
go 1.15
go 1.16
require (
github.com/blang/semver/v4 v4.0.0
github.com/cheggaaa/pb/v3 v3.0.6
github.com/coreos/go-oidc v2.2.1+incompatible
github.com/elazarl/go-bindata-assetfs v1.0.0
github.com/go-openapi/errors v0.19.6
github.com/go-openapi/loads v0.19.5
github.com/go-openapi/runtime v0.19.19
github.com/go-openapi/spec v0.19.8
github.com/go-openapi/strfmt v0.19.5
github.com/go-openapi/swag v0.19.9
github.com/go-openapi/validate v0.19.10
github.com/dustin/go-humanize v1.0.0
github.com/go-openapi/errors v0.19.9
github.com/go-openapi/loads v0.20.2
github.com/go-openapi/runtime v0.19.24
github.com/go-openapi/spec v0.20.3
github.com/go-openapi/strfmt v0.20.0
github.com/go-openapi/swag v0.19.14
github.com/go-openapi/validate v0.20.2
github.com/gorilla/websocket v1.4.2
github.com/jessevdk/go-flags v1.4.0
github.com/minio/cli v1.22.0
github.com/minio/direct-csi v1.3.5-0.20210601185811-f7776f7961bf
github.com/minio/kes v0.11.0
github.com/minio/mc v0.0.0-20210213084525-7672841f8c58
github.com/minio/minio v0.0.0-20210216195645-87cce344f6e4
github.com/minio/minio-go/v7 v7.0.9-0.20210210235136-83423dddb072
github.com/minio/operator v0.0.0-20210201110528-753019b838b4
github.com/minio/operator/logsearchapi v0.0.0-20210201110528-753019b838b4
github.com/minio/madmin-go v1.0.17
github.com/minio/mc v0.0.0-20210626002108-cebf3318546f
github.com/minio/minio-go/v7 v7.0.13-0.20210715203016-9e713532886e
github.com/minio/operator v0.0.0-20210616045941-65f31f5f78ae
github.com/minio/operator/logsearchapi v0.0.0-20210604224119-7e256f98cf90
github.com/minio/pkg v1.0.8
github.com/minio/selfupdate v0.3.1
github.com/mitchellh/go-homedir v1.1.0
github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 // indirect
github.com/rs/xid v1.2.1
github.com/secure-io/sio-go v0.3.1
github.com/stretchr/testify v1.6.1
github.com/stretchr/testify v1.7.0
github.com/unrolled/secure v1.0.7
golang.org/x/crypto v0.0.0-20201124201722-c8d3bf9c5392
golang.org/x/net v0.0.0-20201216054612-986b41b23924
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b
golang.org/x/net v0.0.0-20210421230115-4e50805a0758
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
gopkg.in/yaml.v2 v2.3.0
k8s.io/api v0.20.2
k8s.io/apimachinery v0.20.2
k8s.io/client-go v0.20.2
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.21.1
k8s.io/apimachinery v0.21.1
k8s.io/client-go v0.21.1
)
replace google.golang.org/grpc => google.golang.org/grpc v1.29.1

716
go.sum

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

After

Width:  |  Height:  |  Size: 1.5 MiB

View File

@@ -3,20 +3,6 @@ kind: ClusterRole
metadata:
name: console-sa-role
rules:
- apiGroups:
- ""
resources:
- namespaces
- pods
- services
- events
- resourcequotas
verbs:
- get
- watch
- create
- list
- patch
- apiGroups:
- ""
resources:
@@ -27,8 +13,33 @@ rules:
- create
- list
- patch
- update
- deletecollection
- delete
- apiGroups:
- ""
resources:
- namespaces
- pods
- services
- events
- resourcequotas
- nodes
verbs:
- get
- watch
- create
- list
- patch
- apiGroups:
- ""
resources:
- persistentvolumeclaims
verbs:
- deletecollection
- list
- get
- watch
- update
- apiGroups:
- "storage.k8s.io"
resources:
@@ -86,3 +97,126 @@ rules:
- "*"
verbs:
- "*"
- apiGroups:
- ""
resources:
- persistentvolumes
verbs:
- get
- list
- watch
- create
- delete
- apiGroups:
- ""
resources:
- persistentvolumeclaims
verbs:
- get
- list
- watch
- update
- apiGroups:
- ""
resources:
- events
verbs:
- create
- list
- watch
- update
- patch
- apiGroups:
- snapshot.storage.k8s.io
resources:
- volumesnapshots
verbs:
- get
- list
- apiGroups:
- snapshot.storage.k8s.io
resources:
- volumesnapshotcontents
verbs:
- get
- list
- apiGroups:
- storage.k8s.io
resources:
- csinodes
verbs:
- get
- list
- watch
- apiGroups:
- storage.k8s.io
resources:
- volumeattachments
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- endpoints
verbs:
- get
- list
- watch
- create
- update
- delete
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- list
- watch
- create
- update
- delete
- apiGroups:
- direct.csi.min.io
resources:
- volumes
verbs:
- get
- list
- watch
- create
- update
- delete
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- get
- list
- watch
- create
- update
- delete
- apiGroups:
- direct.csi.min.io
resources:
- directcsidrives
- directcsivolumes
verbs:
- get
- list
- watch
- create
- update
- delete
- apiGroups:
- ""
resources:
- pod
verbs:
- get
- list
- watch

View File

@@ -15,7 +15,7 @@ spec:
serviceAccountName: console-sa
containers:
- name: console
image: minio/console:v0.6.0
image: minio/console:v0.8.0
imagePullPolicy: "IfNotPresent"
args:
- server

View File

@@ -38,6 +38,8 @@ rules:
- deletecollection
- list
- get
- watch
- update
- apiGroups:
- "storage.k8s.io"
resources:
@@ -95,3 +97,127 @@ rules:
- "*"
verbs:
- "*"
- apiGroups:
- ""
resources:
- persistentvolumes
verbs:
- get
- list
- watch
- create
- delete
- apiGroups:
- ""
resources:
- persistentvolumeclaims
verbs:
- get
- list
- watch
- update
- apiGroups:
- ""
resources:
- events
verbs:
- create
- list
- watch
- update
- patch
- apiGroups:
- snapshot.storage.k8s.io
resources:
- volumesnapshots
verbs:
- get
- list
- apiGroups:
- snapshot.storage.k8s.io
resources:
- volumesnapshotcontents
verbs:
- get
- list
- apiGroups:
- storage.k8s.io
resources:
- csinodes
verbs:
- get
- list
- watch
- apiGroups:
- storage.k8s.io
resources:
- volumeattachments
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- endpoints
verbs:
- get
- list
- watch
- create
- update
- delete
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- list
- watch
- create
- update
- delete
- apiGroups:
- direct.csi.min.io
resources:
- volumes
verbs:
- get
- list
- watch
- create
- update
- delete
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- get
- list
- watch
- create
- update
- delete
- apiGroups:
- direct.csi.min.io
resources:
- directcsidrives
- directcsivolumes
verbs:
- get
- list
- watch
- create
- update
- delete
- apiGroups:
- ""
resources:
- pod
- pods/log
verbs:
- get
- list
- watch

View File

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

View File

@@ -14,7 +14,7 @@
// 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/>.
// This package imports things required by build scripts, to force `go mod` to see them as dependencies
// Package k8s - this package imports things required by build scripts, to force `go mod` to see them as dependencies
package k8s
//import _ "k8s.io/code-generator"
// import _ "k8s.io/code-generator"

View File

@@ -23,6 +23,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
@@ -79,6 +81,11 @@ func (m *AccountChangePasswordRequest) validateNewSecretKey(formats strfmt.Regis
return nil
}
// ContextValidate validates this account change password request based on context it is used
func (m *AccountChangePasswordRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *AccountChangePasswordRequest) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -0,0 +1,100 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 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"
)
// AddBucketLifecycle add bucket lifecycle
//
// swagger:model addBucketLifecycle
type AddBucketLifecycle struct {
// Non required, toggle to disable or enable rule
Disable bool `json:"disable,omitempty"`
// Non required, toggle to disable or enable rule
ExpiredObjectDeleteMarker bool `json:"expired_object_delete_marker,omitempty"`
// Required in case of expiry_days or transition fields are not set. it defines an expiry date for ILM
ExpiryDate string `json:"expiry_date,omitempty"`
// 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
NoncurrentversionExpirationDays int32 `json:"noncurrentversion_expiration_days,omitempty"`
// Non required, can be set in case of transition is enabled
NoncurrentversionTransitionDays int32 `json:"noncurrentversion_transition_days,omitempty"`
// Non required, can be set in case of transition is enabled
NoncurrentversionTransitionStorageClass string `json:"noncurrentversion_transition_storage_class,omitempty"`
// Non required field, it matches a prefix to perform ILM operations on it
Prefix string `json:"prefix,omitempty"`
// Required only in case of transition is set. it refers to a tier
StorageClass string `json:"storage_class,omitempty"`
// Non required field, tags to match ILM files
Tags string `json:"tags,omitempty"`
// Required in case of transition_days or expiry fields are not set. it defines a transition date for ILM
TransitionDate string `json:"transition_date,omitempty"`
// Required in case of transition_date or expiry fields are not set. it defines a transition days for ILM
TransitionDays int32 `json:"transition_days,omitempty"`
}
// Validate validates this add bucket lifecycle
func (m *AddBucketLifecycle) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this add bucket lifecycle based on context it is used
func (m *AddBucketLifecycle) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *AddBucketLifecycle) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *AddBucketLifecycle) UnmarshalBinary(b []byte) error {
var res AddBucketLifecycle
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -23,6 +23,8 @@ package models
// 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"
)
@@ -44,6 +46,11 @@ func (m *AddBucketReplication) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this add bucket replication based on context it is used
func (m *AddBucketReplication) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *AddBucketReplication) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -23,6 +23,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
@@ -79,6 +81,11 @@ func (m *AddGroupRequest) validateMembers(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this add group request based on context it is used
func (m *AddGroupRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *AddGroupRequest) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -23,6 +23,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
@@ -79,6 +81,11 @@ func (m *AddPolicyRequest) validatePolicy(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this add policy request based on context it is used
func (m *AddPolicyRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *AddPolicyRequest) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -23,6 +23,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
@@ -96,6 +98,11 @@ func (m *AddUserRequest) validateSecretKey(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this add user request based on context it is used
func (m *AddUserRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *AddUserRequest) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -23,6 +23,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
@@ -63,7 +64,6 @@ func (m *AdminInfoResponse) Validate(formats strfmt.Registry) error {
}
func (m *AdminInfoResponse) validateWidgets(formats strfmt.Registry) error {
if swag.IsZero(m.Widgets) { // not required
return nil
}
@@ -87,6 +87,38 @@ func (m *AdminInfoResponse) validateWidgets(formats strfmt.Registry) error {
return nil
}
// ContextValidate validate this admin info response based on the context it is used
func (m *AdminInfoResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateWidgets(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *AdminInfoResponse) contextValidateWidgets(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Widgets); i++ {
if m.Widgets[i] != 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))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *AdminInfoResponse) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -23,6 +23,8 @@ package models
// 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"
)
@@ -41,6 +43,11 @@ func (m *ArnsResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this arns response based on context it is used
func (m *ArnsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *ArnsResponse) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -23,6 +23,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
@@ -71,6 +73,34 @@ func (m *AwsConfiguration) validateSecretsmanager(formats strfmt.Registry) error
return nil
}
// ContextValidate validate this aws configuration based on the context it is used
func (m *AwsConfiguration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateSecretsmanager(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *AwsConfiguration) contextValidateSecretsmanager(ctx context.Context, formats strfmt.Registry) error {
if m.Secretsmanager != nil {
if err := m.Secretsmanager.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("secretsmanager")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *AwsConfiguration) MarshalBinary() ([]byte, error) {
if m == nil {
@@ -168,6 +198,34 @@ func (m *AwsConfigurationSecretsmanager) validateRegion(formats strfmt.Registry)
return nil
}
// ContextValidate validate this aws configuration secretsmanager based on the context it is used
func (m *AwsConfigurationSecretsmanager) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateCredentials(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *AwsConfigurationSecretsmanager) contextValidateCredentials(ctx context.Context, formats strfmt.Registry) error {
if m.Credentials != nil {
if err := m.Credentials.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("secretsmanager" + "." + "credentials")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *AwsConfigurationSecretsmanager) MarshalBinary() ([]byte, error) {
if m == nil {
@@ -239,6 +297,11 @@ func (m *AwsConfigurationSecretsmanagerCredentials) validateSecretkey(formats st
return nil
}
// ContextValidate validates this aws configuration secretsmanager credentials based on context it is used
func (m *AwsConfigurationSecretsmanagerCredentials) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *AwsConfigurationSecretsmanagerCredentials) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -23,6 +23,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
@@ -35,7 +37,7 @@ import (
type Bucket struct {
// access
Access BucketAccess `json:"access,omitempty"`
Access *BucketAccess `json:"access,omitempty"`
// creation date
CreationDate string `json:"creation_date,omitempty"`
@@ -68,16 +70,17 @@ func (m *Bucket) Validate(formats strfmt.Registry) error {
}
func (m *Bucket) validateAccess(formats strfmt.Registry) error {
if swag.IsZero(m.Access) { // not required
return nil
}
if err := m.Access.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("access")
if m.Access != nil {
if err := m.Access.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("access")
}
return err
}
return err
}
return nil
@@ -89,13 +92,41 @@ func (m *Bucket) validateName(formats strfmt.Registry) error {
return err
}
if err := validate.MinLength("name", "body", string(*m.Name), 3); err != nil {
if err := validate.MinLength("name", "body", *m.Name, 3); err != nil {
return err
}
return nil
}
// ContextValidate validate this bucket based on the context it is used
func (m *Bucket) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateAccess(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Bucket) 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")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *Bucket) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -23,6 +23,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"encoding/json"
"github.com/go-openapi/errors"
@@ -35,6 +36,11 @@ import (
// swagger:model bucketAccess
type BucketAccess string
func NewBucketAccess(value BucketAccess) *BucketAccess {
v := value
return &v
}
const (
// BucketAccessPRIVATE captures enum value "PRIVATE"
@@ -81,3 +87,8 @@ func (m BucketAccess) Validate(formats strfmt.Registry) error {
}
return nil
}
// ContextValidate validates this bucket access based on context it is used
func (m BucketAccess) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}

View File

@@ -23,6 +23,8 @@ package models
// 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"
)
@@ -44,6 +46,11 @@ func (m *BucketEncryptionInfo) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this bucket encryption info based on context it is used
func (m *BucketEncryptionInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *BucketEncryptionInfo) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -23,6 +23,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
@@ -34,7 +36,7 @@ import (
type BucketEncryptionRequest struct {
// enc type
EncType BucketEncryptionType `json:"encType,omitempty"`
EncType *BucketEncryptionType `json:"encType,omitempty"`
// kms key ID
KmsKeyID string `json:"kmsKeyID,omitempty"`
@@ -55,16 +57,45 @@ func (m *BucketEncryptionRequest) Validate(formats strfmt.Registry) error {
}
func (m *BucketEncryptionRequest) validateEncType(formats strfmt.Registry) error {
if swag.IsZero(m.EncType) { // not required
return nil
}
if err := m.EncType.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("encType")
if m.EncType != nil {
if err := m.EncType.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("encType")
}
return err
}
}
return nil
}
// ContextValidate validate this bucket encryption request based on the context it is used
func (m *BucketEncryptionRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateEncType(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *BucketEncryptionRequest) contextValidateEncType(ctx context.Context, formats strfmt.Registry) error {
if m.EncType != nil {
if err := m.EncType.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("encType")
}
return err
}
return err
}
return nil

View File

@@ -23,6 +23,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"encoding/json"
"github.com/go-openapi/errors"
@@ -35,13 +36,18 @@ import (
// swagger:model bucketEncryptionType
type BucketEncryptionType string
func NewBucketEncryptionType(value BucketEncryptionType) *BucketEncryptionType {
v := value
return &v
}
const (
// BucketEncryptionTypeSseS3 captures enum value "sse-s3"
BucketEncryptionTypeSseS3 BucketEncryptionType = "sse-s3"
// BucketEncryptionTypeSseDashS3 captures enum value "sse-s3"
BucketEncryptionTypeSseDashS3 BucketEncryptionType = "sse-s3"
// BucketEncryptionTypeSseKms captures enum value "sse-kms"
BucketEncryptionTypeSseKms BucketEncryptionType = "sse-kms"
// BucketEncryptionTypeSseDashKms captures enum value "sse-kms"
BucketEncryptionTypeSseDashKms BucketEncryptionType = "sse-kms"
)
// for schema
@@ -78,3 +84,8 @@ func (m BucketEncryptionType) Validate(formats strfmt.Registry) error {
}
return nil
}
// ContextValidate validates this bucket encryption type based on context it is used
func (m BucketEncryptionType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}

View File

@@ -23,6 +23,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
@@ -74,6 +76,34 @@ func (m *BucketEventRequest) validateConfiguration(formats strfmt.Registry) erro
return nil
}
// ContextValidate validate this bucket event request based on the context it is used
func (m *BucketEventRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateConfiguration(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
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")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *BucketEventRequest) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -0,0 +1,129 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 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"
)
// BucketLifecycleResponse bucket lifecycle response
//
// swagger:model bucketLifecycleResponse
type BucketLifecycleResponse struct {
// lifecycle
Lifecycle []*ObjectBucketLifecycle `json:"lifecycle"`
}
// Validate validates this bucket lifecycle response
func (m *BucketLifecycleResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateLifecycle(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *BucketLifecycleResponse) validateLifecycle(formats strfmt.Registry) error {
if swag.IsZero(m.Lifecycle) { // not required
return nil
}
for i := 0; i < len(m.Lifecycle); i++ {
if swag.IsZero(m.Lifecycle[i]) { // not required
continue
}
if m.Lifecycle[i] != nil {
if err := m.Lifecycle[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("lifecycle" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this bucket lifecycle response based on the context it is used
func (m *BucketLifecycleResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateLifecycle(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *BucketLifecycleResponse) contextValidateLifecycle(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Lifecycle); i++ {
if m.Lifecycle[i] != 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))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *BucketLifecycleResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *BucketLifecycleResponse) UnmarshalBinary(b []byte) error {
var res BucketLifecycleResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,67 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 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 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"
)
// BucketObLockingResponse bucket ob locking response
//
// swagger:model bucketObLockingResponse
type BucketObLockingResponse struct {
// object locking enabled
ObjectLockingEnabled bool `json:"object_locking_enabled,omitempty"`
}
// Validate validates this bucket ob locking response
func (m *BucketObLockingResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this bucket ob locking response based on context it is used
func (m *BucketObLockingResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *BucketObLockingResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *BucketObLockingResponse) UnmarshalBinary(b []byte) error {
var res BucketObLockingResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -23,6 +23,8 @@ package models
// 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"
)
@@ -80,6 +82,11 @@ func (m *BucketObject) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this bucket object based on context it is used
func (m *BucketObject) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *BucketObject) MarshalBinary() ([]byte, error) {
if m == nil {

125
models/bucket_quota.go Normal file
View File

@@ -0,0 +1,125 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 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"
"encoding/json"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// BucketQuota bucket quota
//
// swagger:model bucketQuota
type BucketQuota struct {
// quota
Quota int64 `json:"quota,omitempty"`
// type
// Enum: [hard fifo]
Type string `json:"type,omitempty"`
}
// Validate validates this bucket quota
func (m *BucketQuota) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateType(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
var bucketQuotaTypeTypePropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["hard","fifo"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
bucketQuotaTypeTypePropEnum = append(bucketQuotaTypeTypePropEnum, v)
}
}
const (
// BucketQuotaTypeHard captures enum value "hard"
BucketQuotaTypeHard string = "hard"
// BucketQuotaTypeFifo captures enum value "fifo"
BucketQuotaTypeFifo string = "fifo"
)
// prop value enum
func (m *BucketQuota) validateTypeEnum(path, location string, value string) error {
if err := validate.EnumCase(path, location, value, bucketQuotaTypeTypePropEnum, true); err != nil {
return err
}
return nil
}
func (m *BucketQuota) validateType(formats strfmt.Registry) error {
if swag.IsZero(m.Type) { // not required
return nil
}
// value enum
if err := m.validateTypeEnum("type", "body", m.Type); err != nil {
return err
}
return nil
}
// ContextValidate validates this bucket quota based on context it is used
func (m *BucketQuota) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *BucketQuota) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *BucketQuota) UnmarshalBinary(b []byte) error {
var res BucketQuota
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -23,6 +23,8 @@ package models
// 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"
)
@@ -41,6 +43,11 @@ func (m *BucketReplicationDestination) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this bucket replication destination based on context it is used
func (m *BucketReplicationDestination) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *BucketReplicationDestination) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -23,6 +23,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
@@ -54,7 +55,6 @@ func (m *BucketReplicationResponse) Validate(formats strfmt.Registry) error {
}
func (m *BucketReplicationResponse) validateRules(formats strfmt.Registry) error {
if swag.IsZero(m.Rules) { // not required
return nil
}
@@ -78,6 +78,38 @@ func (m *BucketReplicationResponse) validateRules(formats strfmt.Registry) error
return nil
}
// ContextValidate validate this bucket replication response based on the context it is used
func (m *BucketReplicationResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateRules(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *BucketReplicationResponse) contextValidateRules(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Rules); i++ {
if m.Rules[i] != 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))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *BucketReplicationResponse) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -23,6 +23,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"encoding/json"
"github.com/go-openapi/errors"
@@ -36,31 +37,49 @@ import (
// swagger:model bucketReplicationRule
type BucketReplicationRule struct {
// bandwidth
Bandwidth string `json:"bandwidth,omitempty"`
// delete marker replication
DeleteMarkerReplication *BucketReplicationRuleMarker `json:"delete_marker_replication,omitempty"`
DeleteMarkerReplication bool `json:"delete_marker_replication,omitempty"`
// deletes replication
DeletesReplication bool `json:"deletes_replication,omitempty"`
// destination
Destination *BucketReplicationDestination `json:"destination,omitempty"`
// health check period
HealthCheckPeriod int64 `json:"healthCheckPeriod,omitempty"`
// id
ID string `json:"id,omitempty"`
// metadata replication
MetadataReplication bool `json:"metadata_replication,omitempty"`
// prefix
Prefix string `json:"prefix,omitempty"`
// priority
Priority int32 `json:"priority,omitempty"`
// status
// Enum: [Enabled Disabled]
Status string `json:"status,omitempty"`
// sync mode
// Enum: [async sync]
SyncMode *string `json:"syncMode,omitempty"`
// tags
Tags string `json:"tags,omitempty"`
}
// Validate validates this bucket replication rule
func (m *BucketReplicationRule) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateDeleteMarkerReplication(formats); err != nil {
res = append(res, err)
}
if err := m.validateDestination(formats); err != nil {
res = append(res, err)
}
@@ -69,32 +88,17 @@ func (m *BucketReplicationRule) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
if err := m.validateSyncMode(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *BucketReplicationRule) validateDeleteMarkerReplication(formats strfmt.Registry) error {
if swag.IsZero(m.DeleteMarkerReplication) { // not required
return nil
}
if m.DeleteMarkerReplication != nil {
if err := m.DeleteMarkerReplication.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("delete_marker_replication")
}
return err
}
}
return nil
}
func (m *BucketReplicationRule) validateDestination(formats strfmt.Registry) error {
if swag.IsZero(m.Destination) { // not required
return nil
}
@@ -141,7 +145,6 @@ func (m *BucketReplicationRule) validateStatusEnum(path, location string, value
}
func (m *BucketReplicationRule) validateStatus(formats strfmt.Registry) error {
if swag.IsZero(m.Status) { // not required
return nil
}
@@ -154,6 +157,76 @@ func (m *BucketReplicationRule) validateStatus(formats strfmt.Registry) error {
return nil
}
var bucketReplicationRuleTypeSyncModePropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["async","sync"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
bucketReplicationRuleTypeSyncModePropEnum = append(bucketReplicationRuleTypeSyncModePropEnum, v)
}
}
const (
// BucketReplicationRuleSyncModeAsync captures enum value "async"
BucketReplicationRuleSyncModeAsync string = "async"
// BucketReplicationRuleSyncModeSync captures enum value "sync"
BucketReplicationRuleSyncModeSync string = "sync"
)
// prop value enum
func (m *BucketReplicationRule) validateSyncModeEnum(path, location string, value string) error {
if err := validate.EnumCase(path, location, value, bucketReplicationRuleTypeSyncModePropEnum, true); err != nil {
return err
}
return nil
}
func (m *BucketReplicationRule) validateSyncMode(formats strfmt.Registry) error {
if swag.IsZero(m.SyncMode) { // not required
return nil
}
// value enum
if err := m.validateSyncModeEnum("syncMode", "body", *m.SyncMode); err != nil {
return err
}
return nil
}
// ContextValidate validate this bucket replication rule based on the context it is used
func (m *BucketReplicationRule) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateDestination(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *BucketReplicationRule) contextValidateDestination(ctx context.Context, formats strfmt.Registry) error {
if m.Destination != nil {
if err := m.Destination.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("destination")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *BucketReplicationRule) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -23,6 +23,8 @@ package models
// 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"
)
@@ -41,6 +43,11 @@ func (m *BucketVersioningResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this bucket versioning response based on context it is used
func (m *BucketVersioningResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *BucketVersioningResponse) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -23,6 +23,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
@@ -79,6 +81,11 @@ func (m *BulkUserGroups) validateUsers(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this bulk user groups based on context it is used
func (m *BulkUserGroups) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *BulkUserGroups) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -0,0 +1,76 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// CertificateInfo certificate info
//
// swagger:model certificateInfo
type CertificateInfo struct {
// domains
Domains []string `json:"domains"`
// expiry
Expiry string `json:"expiry,omitempty"`
// name
Name string `json:"name,omitempty"`
// serial number
SerialNumber string `json:"serialNumber,omitempty"`
}
// Validate validates this certificate info
func (m *CertificateInfo) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this certificate info based on context it is used
func (m *CertificateInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *CertificateInfo) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *CertificateInfo) UnmarshalBinary(b []byte) error {
var res CertificateInfo
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,105 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// ChangeUserPasswordRequest change user password request
//
// swagger:model changeUserPasswordRequest
type ChangeUserPasswordRequest struct {
// new secret key
// Required: true
NewSecretKey *string `json:"newSecretKey"`
// selected user
// Required: true
SelectedUser *string `json:"selectedUser"`
}
// Validate validates this change user password request
func (m *ChangeUserPasswordRequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateNewSecretKey(formats); err != nil {
res = append(res, err)
}
if err := m.validateSelectedUser(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *ChangeUserPasswordRequest) validateNewSecretKey(formats strfmt.Registry) error {
if err := validate.Required("newSecretKey", "body", m.NewSecretKey); err != nil {
return err
}
return nil
}
func (m *ChangeUserPasswordRequest) validateSelectedUser(formats strfmt.Registry) error {
if err := validate.Required("selectedUser", "body", m.SelectedUser); err != nil {
return err
}
return nil
}
// ContextValidate validates this change user password request based on context it is used
func (m *ChangeUserPasswordRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *ChangeUserPasswordRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ChangeUserPasswordRequest) UnmarshalBinary(b []byte) error {
var res ChangeUserPasswordRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -23,6 +23,8 @@ package models
// 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"
)
@@ -44,6 +46,11 @@ func (m *ConfigDescription) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this config description based on context it is used
func (m *ConfigDescription) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *ConfigDescription) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -23,6 +23,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
@@ -57,7 +58,6 @@ func (m *Configuration) Validate(formats strfmt.Registry) error {
}
func (m *Configuration) validateKeyValues(formats strfmt.Registry) error {
if swag.IsZero(m.KeyValues) { // not required
return nil
}
@@ -81,6 +81,38 @@ func (m *Configuration) validateKeyValues(formats strfmt.Registry) error {
return nil
}
// ContextValidate validate this configuration based on the context it is used
func (m *Configuration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateKeyValues(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Configuration) contextValidateKeyValues(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.KeyValues); i++ {
if m.KeyValues[i] != 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))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *Configuration) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -23,6 +23,8 @@ package models
// 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"
)
@@ -44,6 +46,11 @@ func (m *ConfigurationKV) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this configuration k v based on context it is used
func (m *ConfigurationKV) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *ConfigurationKV) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -23,6 +23,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
@@ -98,6 +100,21 @@ func (m *ConsoleConfiguration) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validate this console configuration based on the context it is used
func (m *ConsoleConfiguration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
// validation for a type composition with MetadataFields
if err := m.MetadataFields.ContextValidate(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// MarshalBinary interface implementation
func (m *ConsoleConfiguration) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -23,6 +23,9 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"encoding/json"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
@@ -39,6 +42,12 @@ type CreateRemoteBucket struct {
// Min Length: 3
AccessKey *string `json:"accessKey"`
// bandwidth
Bandwidth int64 `json:"bandwidth,omitempty"`
// health check period
HealthCheckPeriod int32 `json:"healthCheckPeriod,omitempty"`
// region
Region string `json:"region,omitempty"`
@@ -51,6 +60,10 @@ type CreateRemoteBucket struct {
// Required: true
SourceBucket *string `json:"sourceBucket"`
// sync mode
// Enum: [async sync]
SyncMode *string `json:"syncMode,omitempty"`
// target bucket
// Required: true
TargetBucket *string `json:"targetBucket"`
@@ -76,6 +89,10 @@ func (m *CreateRemoteBucket) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
if err := m.validateSyncMode(formats); err != nil {
res = append(res, err)
}
if err := m.validateTargetBucket(formats); err != nil {
res = append(res, err)
}
@@ -96,7 +113,7 @@ func (m *CreateRemoteBucket) validateAccessKey(formats strfmt.Registry) error {
return err
}
if err := validate.MinLength("accessKey", "body", string(*m.AccessKey), 3); err != nil {
if err := validate.MinLength("accessKey", "body", *m.AccessKey, 3); err != nil {
return err
}
@@ -109,7 +126,7 @@ func (m *CreateRemoteBucket) validateSecretKey(formats strfmt.Registry) error {
return err
}
if err := validate.MinLength("secretKey", "body", string(*m.SecretKey), 8); err != nil {
if err := validate.MinLength("secretKey", "body", *m.SecretKey, 8); err != nil {
return err
}
@@ -125,6 +142,48 @@ func (m *CreateRemoteBucket) validateSourceBucket(formats strfmt.Registry) error
return nil
}
var createRemoteBucketTypeSyncModePropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["async","sync"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
createRemoteBucketTypeSyncModePropEnum = append(createRemoteBucketTypeSyncModePropEnum, v)
}
}
const (
// CreateRemoteBucketSyncModeAsync captures enum value "async"
CreateRemoteBucketSyncModeAsync string = "async"
// CreateRemoteBucketSyncModeSync captures enum value "sync"
CreateRemoteBucketSyncModeSync string = "sync"
)
// prop value enum
func (m *CreateRemoteBucket) validateSyncModeEnum(path, location string, value string) error {
if err := validate.EnumCase(path, location, value, createRemoteBucketTypeSyncModePropEnum, true); err != nil {
return err
}
return nil
}
func (m *CreateRemoteBucket) validateSyncMode(formats strfmt.Registry) error {
if swag.IsZero(m.SyncMode) { // not required
return nil
}
// value enum
if err := m.validateSyncModeEnum("syncMode", "body", *m.SyncMode); err != nil {
return err
}
return nil
}
func (m *CreateRemoteBucket) validateTargetBucket(formats strfmt.Registry) error {
if err := validate.Required("targetBucket", "body", m.TargetBucket); err != nil {
@@ -143,6 +202,11 @@ func (m *CreateRemoteBucket) validateTargetURL(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this create remote bucket based on context it is used
func (m *CreateRemoteBucket) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *CreateRemoteBucket) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -23,6 +23,7 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
@@ -84,6 +85,9 @@ type CreateTenantRequest struct {
// labels
Labels map[string]string `json:"labels,omitempty"`
// log search configuration
LogSearchConfiguration *LogSearchConfiguration `json:"logSearchConfiguration,omitempty"`
// mounth path
MounthPath string `json:"mounth_path,omitempty"`
@@ -100,6 +104,9 @@ type CreateTenantRequest struct {
// Required: true
Pools []*Pool `json:"pools"`
// prometheus configuration
PrometheusConfiguration *PrometheusConfiguration `json:"prometheusConfiguration,omitempty"`
// secret key
SecretKey string `json:"secret_key,omitempty"`
@@ -127,6 +134,10 @@ func (m *CreateTenantRequest) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
if err := m.validateLogSearchConfiguration(formats); err != nil {
res = append(res, err)
}
if err := m.validateName(formats); err != nil {
res = append(res, err)
}
@@ -139,6 +150,10 @@ func (m *CreateTenantRequest) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
if err := m.validatePrometheusConfiguration(formats); err != nil {
res = append(res, err)
}
if err := m.validateTLS(formats); err != nil {
res = append(res, err)
}
@@ -150,7 +165,6 @@ func (m *CreateTenantRequest) Validate(formats strfmt.Registry) error {
}
func (m *CreateTenantRequest) validateConsole(formats strfmt.Registry) error {
if swag.IsZero(m.Console) { // not required
return nil
}
@@ -168,7 +182,6 @@ func (m *CreateTenantRequest) validateConsole(formats strfmt.Registry) error {
}
func (m *CreateTenantRequest) validateEncryption(formats strfmt.Registry) error {
if swag.IsZero(m.Encryption) { // not required
return nil
}
@@ -186,7 +199,6 @@ func (m *CreateTenantRequest) validateEncryption(formats strfmt.Registry) error
}
func (m *CreateTenantRequest) validateIdp(formats strfmt.Registry) error {
if swag.IsZero(m.Idp) { // not required
return nil
}
@@ -204,7 +216,6 @@ func (m *CreateTenantRequest) validateIdp(formats strfmt.Registry) error {
}
func (m *CreateTenantRequest) validateImageRegistry(formats strfmt.Registry) error {
if swag.IsZero(m.ImageRegistry) { // not required
return nil
}
@@ -221,13 +232,30 @@ func (m *CreateTenantRequest) validateImageRegistry(formats strfmt.Registry) err
return nil
}
func (m *CreateTenantRequest) validateLogSearchConfiguration(formats strfmt.Registry) error {
if swag.IsZero(m.LogSearchConfiguration) { // not required
return nil
}
if m.LogSearchConfiguration != nil {
if err := m.LogSearchConfiguration.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("logSearchConfiguration")
}
return err
}
}
return nil
}
func (m *CreateTenantRequest) validateName(formats strfmt.Registry) error {
if err := validate.Required("name", "body", m.Name); err != nil {
return err
}
if err := validate.Pattern("name", "body", string(*m.Name), `^[a-z0-9-]{3,63}$`); err != nil {
if err := validate.Pattern("name", "body", *m.Name, `^[a-z0-9-]{3,63}$`); err != nil {
return err
}
@@ -268,8 +296,24 @@ func (m *CreateTenantRequest) validatePools(formats strfmt.Registry) error {
return nil
}
func (m *CreateTenantRequest) validateTLS(formats strfmt.Registry) error {
func (m *CreateTenantRequest) validatePrometheusConfiguration(formats strfmt.Registry) error {
if swag.IsZero(m.PrometheusConfiguration) { // not required
return nil
}
if m.PrometheusConfiguration != nil {
if err := m.PrometheusConfiguration.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("prometheusConfiguration")
}
return err
}
}
return nil
}
func (m *CreateTenantRequest) validateTLS(formats strfmt.Registry) error {
if swag.IsZero(m.TLS) { // not required
return nil
}
@@ -286,6 +330,164 @@ func (m *CreateTenantRequest) validateTLS(formats strfmt.Registry) error {
return nil
}
// ContextValidate validate this create tenant request based on the context it is used
func (m *CreateTenantRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateConsole(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateEncryption(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateIdp(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateImageRegistry(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateLogSearchConfiguration(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidatePools(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidatePrometheusConfiguration(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateTLS(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *CreateTenantRequest) contextValidateConsole(ctx context.Context, formats strfmt.Registry) error {
if m.Console != nil {
if err := m.Console.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("console")
}
return err
}
}
return nil
}
func (m *CreateTenantRequest) contextValidateEncryption(ctx context.Context, formats strfmt.Registry) error {
if m.Encryption != nil {
if err := m.Encryption.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("encryption")
}
return err
}
}
return nil
}
func (m *CreateTenantRequest) contextValidateIdp(ctx context.Context, formats strfmt.Registry) error {
if m.Idp != nil {
if err := m.Idp.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("idp")
}
return err
}
}
return nil
}
func (m *CreateTenantRequest) contextValidateImageRegistry(ctx context.Context, formats strfmt.Registry) error {
if m.ImageRegistry != nil {
if err := m.ImageRegistry.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("image_registry")
}
return err
}
}
return nil
}
func (m *CreateTenantRequest) contextValidateLogSearchConfiguration(ctx context.Context, formats strfmt.Registry) error {
if m.LogSearchConfiguration != nil {
if err := m.LogSearchConfiguration.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("logSearchConfiguration")
}
return err
}
}
return nil
}
func (m *CreateTenantRequest) contextValidatePools(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Pools); i++ {
if m.Pools[i] != nil {
if err := m.Pools[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("pools" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *CreateTenantRequest) contextValidatePrometheusConfiguration(ctx context.Context, formats strfmt.Registry) error {
if m.PrometheusConfiguration != nil {
if err := m.PrometheusConfiguration.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("prometheusConfiguration")
}
return err
}
}
return nil
}
func (m *CreateTenantRequest) contextValidateTLS(ctx context.Context, formats strfmt.Registry) error {
if m.TLS != nil {
if err := m.TLS.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("tls")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *CreateTenantRequest) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -23,6 +23,9 @@ package models
// 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"
@@ -34,7 +37,7 @@ import (
type CreateTenantResponse struct {
// console
Console *CreateTenantResponseConsole `json:"console,omitempty"`
Console []*TenantResponseItem `json:"console"`
}
// Validate validates this create tenant response
@@ -52,18 +55,56 @@ func (m *CreateTenantResponse) Validate(formats strfmt.Registry) error {
}
func (m *CreateTenantResponse) validateConsole(formats strfmt.Registry) error {
if swag.IsZero(m.Console) { // not required
return nil
}
if m.Console != nil {
if err := m.Console.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("console")
}
return err
for i := 0; i < len(m.Console); i++ {
if swag.IsZero(m.Console[i]) { // not required
continue
}
if m.Console[i] != nil {
if err := m.Console[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("console" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this create tenant response based on the context it is used
func (m *CreateTenantResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateConsole(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *CreateTenantResponse) contextValidateConsole(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Console); i++ {
if m.Console[i] != nil {
if err := m.Console[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("console" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
@@ -86,38 +127,3 @@ func (m *CreateTenantResponse) UnmarshalBinary(b []byte) error {
*m = res
return nil
}
// CreateTenantResponseConsole create tenant response console
//
// swagger:model CreateTenantResponseConsole
type CreateTenantResponseConsole struct {
// access key
AccessKey string `json:"access_key,omitempty"`
// secret key
SecretKey string `json:"secret_key,omitempty"`
}
// Validate validates this create tenant response console
func (m *CreateTenantResponseConsole) Validate(formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *CreateTenantResponseConsole) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *CreateTenantResponseConsole) UnmarshalBinary(b []byte) error {
var res CreateTenantResponseConsole
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) 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 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"
)
// CsiFormatErrorResponse csi format error response
//
// swagger:model csiFormatErrorResponse
type CsiFormatErrorResponse struct {
// drive
Drive string `json:"drive,omitempty"`
// error
Error string `json:"error,omitempty"`
// node
Node string `json:"node,omitempty"`
}
// Validate validates this csi format error response
func (m *CsiFormatErrorResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this csi format error response based on context it is used
func (m *CsiFormatErrorResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *CsiFormatErrorResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *CsiFormatErrorResponse) UnmarshalBinary(b []byte) error {
var res CsiFormatErrorResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

73
models/delete_file.go Normal file
View File

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

View File

@@ -23,6 +23,8 @@ package models
// 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"
)
@@ -41,6 +43,11 @@ func (m *DeleteTenantRequest) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this delete tenant request based on context it is used
func (m *DeleteTenantRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *DeleteTenantRequest) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -0,0 +1,85 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 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"
)
// DirectCSIDriveInfo direct c s i drive info
//
// swagger:model directCSIDriveInfo
type DirectCSIDriveInfo struct {
// allocated
Allocated int64 `json:"allocated,omitempty"`
// capacity
Capacity int64 `json:"capacity,omitempty"`
// drive
Drive string `json:"drive,omitempty"`
// message
Message string `json:"message,omitempty"`
// node
Node string `json:"node,omitempty"`
// status
Status string `json:"status,omitempty"`
// volumes
Volumes int64 `json:"volumes,omitempty"`
}
// Validate validates this direct c s i drive info
func (m *DirectCSIDriveInfo) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this direct c s i drive info based on context it is used
func (m *DirectCSIDriveInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *DirectCSIDriveInfo) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DirectCSIDriveInfo) UnmarshalBinary(b []byte) error {
var res DirectCSIDriveInfo
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,76 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 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"
)
// DirectCSIVolumeInfo direct c s i volume info
//
// swagger:model directCSIVolumeInfo
type DirectCSIVolumeInfo struct {
// capacity
Capacity int64 `json:"capacity,omitempty"`
// drive
Drive string `json:"drive,omitempty"`
// node
Node string `json:"node,omitempty"`
// volume
Volume string `json:"volume,omitempty"`
}
// Validate validates this direct c s i volume info
func (m *DirectCSIVolumeInfo) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this direct c s i volume info based on context it is used
func (m *DirectCSIVolumeInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *DirectCSIVolumeInfo) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *DirectCSIVolumeInfo) UnmarshalBinary(b []byte) error {
var res DirectCSIVolumeInfo
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -23,6 +23,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
@@ -49,6 +51,9 @@ type EncryptionConfiguration struct {
// image
Image string `json:"image,omitempty"`
// replicas
Replicas string `json:"replicas,omitempty"`
// server
Server *KeyPairConfiguration `json:"server,omitempty"`
@@ -77,6 +82,8 @@ func (m *EncryptionConfiguration) UnmarshalJSON(raw []byte) error {
Image string `json:"image,omitempty"`
Replicas string `json:"replicas,omitempty"`
Server *KeyPairConfiguration `json:"server,omitempty"`
Vault *VaultConfiguration `json:"vault,omitempty"`
@@ -95,6 +102,8 @@ func (m *EncryptionConfiguration) UnmarshalJSON(raw []byte) error {
m.Image = dataAO1.Image
m.Replicas = dataAO1.Replicas
m.Server = dataAO1.Server
m.Vault = dataAO1.Vault
@@ -122,6 +131,8 @@ func (m EncryptionConfiguration) MarshalJSON() ([]byte, error) {
Image string `json:"image,omitempty"`
Replicas string `json:"replicas,omitempty"`
Server *KeyPairConfiguration `json:"server,omitempty"`
Vault *VaultConfiguration `json:"vault,omitempty"`
@@ -137,6 +148,8 @@ func (m EncryptionConfiguration) MarshalJSON() ([]byte, error) {
dataAO1.Image = m.Image
dataAO1.Replicas = m.Replicas
dataAO1.Server = m.Server
dataAO1.Vault = m.Vault
@@ -296,6 +309,129 @@ func (m *EncryptionConfiguration) validateVault(formats strfmt.Registry) error {
return nil
}
// ContextValidate validate this encryption configuration based on the context it is used
func (m *EncryptionConfiguration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
// validation for a type composition with MetadataFields
if err := m.MetadataFields.ContextValidate(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateAws(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateClient(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateGcp(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateGemalto(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateServer(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateVault(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *EncryptionConfiguration) contextValidateAws(ctx context.Context, formats strfmt.Registry) error {
if m.Aws != nil {
if err := m.Aws.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("aws")
}
return err
}
}
return nil
}
func (m *EncryptionConfiguration) contextValidateClient(ctx context.Context, formats strfmt.Registry) error {
if m.Client != nil {
if err := m.Client.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("client")
}
return err
}
}
return nil
}
func (m *EncryptionConfiguration) contextValidateGcp(ctx context.Context, formats strfmt.Registry) error {
if m.Gcp != nil {
if err := m.Gcp.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("gcp")
}
return err
}
}
return nil
}
func (m *EncryptionConfiguration) contextValidateGemalto(ctx context.Context, formats strfmt.Registry) error {
if m.Gemalto != nil {
if err := m.Gemalto.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("gemalto")
}
return err
}
}
return nil
}
func (m *EncryptionConfiguration) contextValidateServer(ctx context.Context, formats strfmt.Registry) error {
if m.Server != nil {
if err := m.Server.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("server")
}
return err
}
}
return nil
}
func (m *EncryptionConfiguration) contextValidateVault(ctx context.Context, formats strfmt.Registry) error {
if m.Vault != nil {
if err := m.Vault.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("vault")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *EncryptionConfiguration) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -23,6 +23,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
@@ -65,6 +67,11 @@ func (m *Error) validateMessage(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this error based on context it is used
func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *Error) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -0,0 +1,82 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// EventListElement event list element
//
// swagger:model eventListElement
type EventListElement struct {
// event type
EventType string `json:"event_type,omitempty"`
// last seen
LastSeen int64 `json:"last_seen,omitempty"`
// message
Message string `json:"message,omitempty"`
// namespace
Namespace string `json:"namespace,omitempty"`
// object
Object string `json:"object,omitempty"`
// reason
Reason string `json:"reason,omitempty"`
}
// Validate validates this event list element
func (m *EventListElement) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this event list element based on context it is used
func (m *EventListElement) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *EventListElement) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *EventListElement) UnmarshalBinary(b []byte) error {
var res EventListElement
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,86 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// EventListWrapper event list wrapper
//
// swagger:model eventListWrapper
type EventListWrapper []*EventListElement
// Validate validates this event list wrapper
func (m EventListWrapper) Validate(formats strfmt.Registry) error {
var res []error
for i := 0; i < len(m); i++ {
if swag.IsZero(m[i]) { // not required
continue
}
if m[i] != nil {
if err := m[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName(strconv.Itoa(i))
}
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// ContextValidate validate this event list wrapper based on the context it is used
func (m EventListWrapper) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
for i := 0; i < len(m); i++ {
if m[i] != nil {
if err := m[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName(strconv.Itoa(i))
}
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(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) 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 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"
)
// ExpirationResponse expiration response
//
// swagger:model expirationResponse
type ExpirationResponse struct {
// date
Date string `json:"date,omitempty"`
// days
Days int64 `json:"days,omitempty"`
// delete marker
DeleteMarker bool `json:"delete_marker,omitempty"`
}
// Validate validates this expiration response
func (m *ExpirationResponse) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this expiration response based on context it is used
func (m *ExpirationResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *ExpirationResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ExpirationResponse) UnmarshalBinary(b []byte) error {
var res ExpirationResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,105 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// FormatConfiguration format configuration
//
// swagger:model formatConfiguration
type FormatConfiguration struct {
// drives
// Required: true
Drives []string `json:"drives"`
// force
// Required: true
Force *bool `json:"force"`
}
// Validate validates this format configuration
func (m *FormatConfiguration) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateDrives(formats); err != nil {
res = append(res, err)
}
if err := m.validateForce(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *FormatConfiguration) validateDrives(formats strfmt.Registry) error {
if err := validate.Required("drives", "body", m.Drives); err != nil {
return err
}
return nil
}
func (m *FormatConfiguration) validateForce(formats strfmt.Registry) error {
if err := validate.Required("force", "body", m.Force); err != nil {
return err
}
return nil
}
// ContextValidate validates this format configuration based on context it is used
func (m *FormatConfiguration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *FormatConfiguration) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *FormatConfiguration) UnmarshalBinary(b []byte) error {
var res FormatConfiguration
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,129 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 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"
)
// FormatDirectCSIDrivesResponse format direct c s i drives response
//
// swagger:model formatDirectCSIDrivesResponse
type FormatDirectCSIDrivesResponse struct {
// format issues list
FormatIssuesList []*CsiFormatErrorResponse `json:"formatIssuesList"`
}
// Validate validates this format direct c s i drives response
func (m *FormatDirectCSIDrivesResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateFormatIssuesList(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *FormatDirectCSIDrivesResponse) validateFormatIssuesList(formats strfmt.Registry) error {
if swag.IsZero(m.FormatIssuesList) { // not required
return nil
}
for i := 0; i < len(m.FormatIssuesList); i++ {
if swag.IsZero(m.FormatIssuesList[i]) { // not required
continue
}
if m.FormatIssuesList[i] != nil {
if err := m.FormatIssuesList[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("formatIssuesList" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this format direct c s i drives response based on the context it is used
func (m *FormatDirectCSIDrivesResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateFormatIssuesList(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *FormatDirectCSIDrivesResponse) contextValidateFormatIssuesList(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.FormatIssuesList); i++ {
if m.FormatIssuesList[i] != nil {
if err := m.FormatIssuesList[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("formatIssuesList" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *FormatDirectCSIDrivesResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *FormatDirectCSIDrivesResponse) UnmarshalBinary(b []byte) error {
var res FormatDirectCSIDrivesResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -23,6 +23,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
@@ -71,6 +73,34 @@ func (m *GcpConfiguration) validateSecretmanager(formats strfmt.Registry) error
return nil
}
// ContextValidate validate this gcp configuration based on the context it is used
func (m *GcpConfiguration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateSecretmanager(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GcpConfiguration) contextValidateSecretmanager(ctx context.Context, formats strfmt.Registry) error {
if m.Secretmanager != nil {
if err := m.Secretmanager.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("secretmanager")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *GcpConfiguration) MarshalBinary() ([]byte, error) {
if m == nil {
@@ -124,7 +154,6 @@ func (m *GcpConfigurationSecretmanager) Validate(formats strfmt.Registry) error
}
func (m *GcpConfigurationSecretmanager) validateCredentials(formats strfmt.Registry) error {
if swag.IsZero(m.Credentials) { // not required
return nil
}
@@ -150,6 +179,34 @@ func (m *GcpConfigurationSecretmanager) validateProjectID(formats strfmt.Registr
return nil
}
// ContextValidate validate this gcp configuration secretmanager based on the context it is used
func (m *GcpConfigurationSecretmanager) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateCredentials(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GcpConfigurationSecretmanager) contextValidateCredentials(ctx context.Context, formats strfmt.Registry) error {
if m.Credentials != nil {
if err := m.Credentials.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("secretmanager" + "." + "credentials")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *GcpConfigurationSecretmanager) MarshalBinary() ([]byte, error) {
if m == nil {
@@ -191,6 +248,11 @@ func (m *GcpConfigurationSecretmanagerCredentials) Validate(formats strfmt.Regis
return nil
}
// ContextValidate validates this gcp configuration secretmanager credentials based on context it is used
func (m *GcpConfigurationSecretmanagerCredentials) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *GcpConfigurationSecretmanagerCredentials) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -23,6 +23,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
@@ -71,6 +73,34 @@ func (m *GemaltoConfiguration) validateKeysecure(formats strfmt.Registry) error
return nil
}
// ContextValidate validate this gemalto configuration based on the context it is used
func (m *GemaltoConfiguration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateKeysecure(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GemaltoConfiguration) contextValidateKeysecure(ctx context.Context, formats strfmt.Registry) error {
if m.Keysecure != nil {
if err := m.Keysecure.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("keysecure")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *GemaltoConfiguration) MarshalBinary() ([]byte, error) {
if m == nil {
@@ -156,7 +186,6 @@ func (m *GemaltoConfigurationKeysecure) validateEndpoint(formats strfmt.Registry
}
func (m *GemaltoConfigurationKeysecure) validateTLS(formats strfmt.Registry) error {
if swag.IsZero(m.TLS) { // not required
return nil
}
@@ -173,6 +202,52 @@ func (m *GemaltoConfigurationKeysecure) validateTLS(formats strfmt.Registry) err
return nil
}
// ContextValidate validate this gemalto configuration keysecure based on the context it is used
func (m *GemaltoConfigurationKeysecure) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateCredentials(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateTLS(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GemaltoConfigurationKeysecure) contextValidateCredentials(ctx context.Context, formats strfmt.Registry) error {
if m.Credentials != nil {
if err := m.Credentials.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("keysecure" + "." + "credentials")
}
return err
}
}
return nil
}
func (m *GemaltoConfigurationKeysecure) contextValidateTLS(ctx context.Context, formats strfmt.Registry) error {
if m.TLS != nil {
if err := m.TLS.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("keysecure" + "." + "tls")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *GemaltoConfigurationKeysecure) MarshalBinary() ([]byte, error) {
if m == nil {
@@ -244,6 +319,11 @@ func (m *GemaltoConfigurationKeysecureCredentials) validateToken(formats strfmt.
return nil
}
// ContextValidate validates this gemalto configuration keysecure credentials based on context it is used
func (m *GemaltoConfigurationKeysecureCredentials) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *GemaltoConfigurationKeysecureCredentials) MarshalBinary() ([]byte, error) {
if m == nil {
@@ -295,6 +375,11 @@ func (m *GemaltoConfigurationKeysecureTLS) validateCa(formats strfmt.Registry) e
return nil
}
// ContextValidate validates this gemalto configuration keysecure TLS based on context it is used
func (m *GemaltoConfigurationKeysecureTLS) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *GemaltoConfigurationKeysecureTLS) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -23,6 +23,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
@@ -62,7 +64,6 @@ func (m *GetBucketRetentionConfig) Validate(formats strfmt.Registry) error {
}
func (m *GetBucketRetentionConfig) validateMode(formats strfmt.Registry) error {
if swag.IsZero(m.Mode) { // not required
return nil
}
@@ -78,7 +79,6 @@ func (m *GetBucketRetentionConfig) validateMode(formats strfmt.Registry) error {
}
func (m *GetBucketRetentionConfig) validateUnit(formats strfmt.Registry) error {
if swag.IsZero(m.Unit) { // not required
return nil
}
@@ -93,6 +93,48 @@ func (m *GetBucketRetentionConfig) validateUnit(formats strfmt.Registry) error {
return nil
}
// ContextValidate validate this get bucket retention config based on the context it is used
func (m *GetBucketRetentionConfig) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateMode(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateUnit(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GetBucketRetentionConfig) contextValidateMode(ctx context.Context, formats strfmt.Registry) error {
if err := m.Mode.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("mode")
}
return err
}
return nil
}
func (m *GetBucketRetentionConfig) contextValidateUnit(ctx context.Context, formats strfmt.Registry) error {
if err := m.Unit.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("unit")
}
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *GetBucketRetentionConfig) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -0,0 +1,129 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 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"
)
// GetDirectCSIDriveListResponse get direct c s i drive list response
//
// swagger:model getDirectCSIDriveListResponse
type GetDirectCSIDriveListResponse struct {
// drives
Drives []*DirectCSIDriveInfo `json:"drives"`
}
// Validate validates this get direct c s i drive list response
func (m *GetDirectCSIDriveListResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateDrives(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GetDirectCSIDriveListResponse) validateDrives(formats strfmt.Registry) error {
if swag.IsZero(m.Drives) { // not required
return nil
}
for i := 0; i < len(m.Drives); i++ {
if swag.IsZero(m.Drives[i]) { // not required
continue
}
if m.Drives[i] != nil {
if err := m.Drives[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("drives" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this get direct c s i drive list response based on the context it is used
func (m *GetDirectCSIDriveListResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateDrives(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GetDirectCSIDriveListResponse) contextValidateDrives(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Drives); i++ {
if m.Drives[i] != nil {
if err := m.Drives[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("drives" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *GetDirectCSIDriveListResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *GetDirectCSIDriveListResponse) UnmarshalBinary(b []byte) error {
var res GetDirectCSIDriveListResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,129 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 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"
)
// GetDirectCSIVolumeListResponse get direct c s i volume list response
//
// swagger:model getDirectCSIVolumeListResponse
type GetDirectCSIVolumeListResponse struct {
// volumes
Volumes []*DirectCSIVolumeInfo `json:"volumes"`
}
// Validate validates this get direct c s i volume list response
func (m *GetDirectCSIVolumeListResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateVolumes(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GetDirectCSIVolumeListResponse) validateVolumes(formats strfmt.Registry) error {
if swag.IsZero(m.Volumes) { // not required
return nil
}
for i := 0; i < len(m.Volumes); i++ {
if swag.IsZero(m.Volumes[i]) { // not required
continue
}
if m.Volumes[i] != nil {
if err := m.Volumes[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("volumes" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this get direct c s i volume list response based on the context it is used
func (m *GetDirectCSIVolumeListResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateVolumes(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GetDirectCSIVolumeListResponse) contextValidateVolumes(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Volumes); i++ {
if m.Volumes[i] != nil {
if err := m.Volumes[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("volumes" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *GetDirectCSIVolumeListResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *GetDirectCSIVolumeListResponse) UnmarshalBinary(b []byte) error {
var res GetDirectCSIVolumeListResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -23,6 +23,8 @@ package models
// 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"
)
@@ -50,6 +52,11 @@ func (m *Group) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this group based on context it is used
func (m *Group) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *Group) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -0,0 +1,129 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 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"
)
// HasPermissionRequest has permission request
//
// swagger:model hasPermissionRequest
type HasPermissionRequest struct {
// actions
Actions []*PolicyArgs `json:"actions"`
}
// Validate validates this has permission request
func (m *HasPermissionRequest) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateActions(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *HasPermissionRequest) validateActions(formats strfmt.Registry) error {
if swag.IsZero(m.Actions) { // not required
return nil
}
for i := 0; i < len(m.Actions); i++ {
if swag.IsZero(m.Actions[i]) { // not required
continue
}
if m.Actions[i] != nil {
if err := m.Actions[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("actions" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this has permission request based on the context it is used
func (m *HasPermissionRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateActions(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *HasPermissionRequest) contextValidateActions(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Actions); i++ {
if m.Actions[i] != nil {
if err := m.Actions[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("actions" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *HasPermissionRequest) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *HasPermissionRequest) UnmarshalBinary(b []byte) error {
var res HasPermissionRequest
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -0,0 +1,129 @@
// Code generated by go-swagger; DO NOT EDIT.
// 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 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"
)
// HasPermissionResponse has permission response
//
// swagger:model hasPermissionResponse
type HasPermissionResponse struct {
// permissions
Permissions []*PermissionAction `json:"permissions"`
}
// Validate validates this has permission response
func (m *HasPermissionResponse) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validatePermissions(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *HasPermissionResponse) validatePermissions(formats strfmt.Registry) error {
if swag.IsZero(m.Permissions) { // not required
return nil
}
for i := 0; i < len(m.Permissions); i++ {
if swag.IsZero(m.Permissions[i]) { // not required
continue
}
if m.Permissions[i] != nil {
if err := m.Permissions[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("permissions" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this has permission response based on the context it is used
func (m *HasPermissionResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidatePermissions(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *HasPermissionResponse) contextValidatePermissions(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Permissions); i++ {
if m.Permissions[i] != nil {
if err := m.Permissions[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("permissions" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (m *HasPermissionResponse) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *HasPermissionResponse) UnmarshalBinary(b []byte) error {
var res HasPermissionResponse
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

View File

@@ -23,6 +23,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/validate"
@@ -46,3 +48,8 @@ func (m IamEntity) Validate(formats strfmt.Registry) error {
}
return nil
}
// ContextValidate validates this iam entity based on context it is used
func (m IamEntity) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}

View File

@@ -23,6 +23,9 @@ package models
// 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"
@@ -37,6 +40,9 @@ type IdpConfiguration struct {
// active directory
ActiveDirectory *IdpConfigurationActiveDirectory `json:"active_directory,omitempty"`
// keys
Keys []*IdpConfigurationKeysItems0 `json:"keys"`
// oidc
Oidc *IdpConfigurationOidc `json:"oidc,omitempty"`
}
@@ -49,6 +55,10 @@ func (m *IdpConfiguration) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
if err := m.validateKeys(formats); err != nil {
res = append(res, err)
}
if err := m.validateOidc(formats); err != nil {
res = append(res, err)
}
@@ -60,7 +70,6 @@ func (m *IdpConfiguration) Validate(formats strfmt.Registry) error {
}
func (m *IdpConfiguration) validateActiveDirectory(formats strfmt.Registry) error {
if swag.IsZero(m.ActiveDirectory) { // not required
return nil
}
@@ -77,8 +86,31 @@ func (m *IdpConfiguration) validateActiveDirectory(formats strfmt.Registry) erro
return nil
}
func (m *IdpConfiguration) validateOidc(formats strfmt.Registry) error {
func (m *IdpConfiguration) validateKeys(formats strfmt.Registry) error {
if swag.IsZero(m.Keys) { // not required
return nil
}
for i := 0; i < len(m.Keys); i++ {
if swag.IsZero(m.Keys[i]) { // not required
continue
}
if m.Keys[i] != nil {
if err := m.Keys[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("keys" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *IdpConfiguration) validateOidc(formats strfmt.Registry) error {
if swag.IsZero(m.Oidc) { // not required
return nil
}
@@ -95,6 +127,74 @@ func (m *IdpConfiguration) validateOidc(formats strfmt.Registry) error {
return nil
}
// ContextValidate validate this idp configuration based on the context it is used
func (m *IdpConfiguration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateActiveDirectory(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateKeys(ctx, formats); err != nil {
res = append(res, err)
}
if err := m.contextValidateOidc(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *IdpConfiguration) contextValidateActiveDirectory(ctx context.Context, formats strfmt.Registry) error {
if m.ActiveDirectory != nil {
if err := m.ActiveDirectory.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("active_directory")
}
return err
}
}
return nil
}
func (m *IdpConfiguration) contextValidateKeys(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Keys); i++ {
if m.Keys[i] != nil {
if err := m.Keys[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("keys" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
func (m *IdpConfiguration) contextValidateOidc(ctx context.Context, formats strfmt.Registry) error {
if m.Oidc != nil {
if err := m.Oidc.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("oidc")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *IdpConfiguration) MarshalBinary() ([]byte, error) {
if m == nil {
@@ -195,6 +295,11 @@ func (m *IdpConfigurationActiveDirectory) validateUsernameFormat(formats strfmt.
return nil
}
// ContextValidate validates this idp configuration active directory based on context it is used
func (m *IdpConfigurationActiveDirectory) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *IdpConfigurationActiveDirectory) MarshalBinary() ([]byte, error) {
if m == nil {
@@ -213,6 +318,79 @@ func (m *IdpConfigurationActiveDirectory) UnmarshalBinary(b []byte) error {
return nil
}
// IdpConfigurationKeysItems0 idp configuration keys items0
//
// swagger:model IdpConfigurationKeysItems0
type IdpConfigurationKeysItems0 struct {
// access key
// Required: true
AccessKey *string `json:"access_key"`
// secret key
// Required: true
SecretKey *string `json:"secret_key"`
}
// Validate validates this idp configuration keys items0
func (m *IdpConfigurationKeysItems0) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAccessKey(formats); err != nil {
res = append(res, err)
}
if err := m.validateSecretKey(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *IdpConfigurationKeysItems0) validateAccessKey(formats strfmt.Registry) error {
if err := validate.Required("access_key", "body", m.AccessKey); err != nil {
return err
}
return nil
}
func (m *IdpConfigurationKeysItems0) validateSecretKey(formats strfmt.Registry) error {
if err := validate.Required("secret_key", "body", m.SecretKey); err != nil {
return err
}
return nil
}
// ContextValidate validates this idp configuration keys items0 based on context it is used
func (m *IdpConfigurationKeysItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *IdpConfigurationKeysItems0) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *IdpConfigurationKeysItems0) UnmarshalBinary(b []byte) error {
var res IdpConfigurationKeysItems0
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
// IdpConfigurationOidc idp configuration oidc
//
// swagger:model IdpConfigurationOidc
@@ -280,6 +458,11 @@ func (m *IdpConfigurationOidc) validateURL(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this idp configuration oidc based on context it is used
func (m *IdpConfigurationOidc) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *IdpConfigurationOidc) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -23,6 +23,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
@@ -96,6 +98,11 @@ func (m *ImageRegistry) validateUsername(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this image registry based on context it is used
func (m *ImageRegistry) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *ImageRegistry) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -23,6 +23,8 @@ package models
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
@@ -79,6 +81,11 @@ func (m *KeyPairConfiguration) validateKey(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this key pair configuration based on context it is used
func (m *KeyPairConfiguration) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *KeyPairConfiguration) MarshalBinary() ([]byte, error) {
if m == nil {

View File

@@ -23,6 +23,8 @@ package models
// 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"
)
@@ -56,6 +58,11 @@ func (m *License) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this license based on context it is used
func (m *License) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *License) MarshalBinary() ([]byte, error) {
if m == nil {

70
models/lifecycle_tag.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) 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 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"
)
// LifecycleTag lifecycle tag
//
// swagger:model lifecycleTag
type LifecycleTag struct {
// key
Key string `json:"key,omitempty"`
// value
Value string `json:"value,omitempty"`
}
// Validate validates this lifecycle tag
func (m *LifecycleTag) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this lifecycle tag based on context it is used
func (m *LifecycleTag) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *LifecycleTag) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *LifecycleTag) UnmarshalBinary(b []byte) error {
var res LifecycleTag
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}

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