Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63e1c554b7 | ||
|
|
a9d8f3fc41 | ||
|
|
59bf546b4a | ||
|
|
c3e34dc220 | ||
|
|
cd547e9425 | ||
|
|
d98b70f0ca | ||
|
|
7ff009ec43 | ||
|
|
3760c783d0 |
@@ -21,7 +21,7 @@ linters:
|
||||
- structcheck
|
||||
|
||||
service:
|
||||
golangci-lint-version: 1.21.0 # use the fixed version to not introduce new linters unexpectedly
|
||||
golangci-lint-version: 1.27.0 # use the fixed version to not introduce new linters unexpectedly
|
||||
|
||||
run:
|
||||
skip-dirs:
|
||||
|
||||
@@ -23,6 +23,33 @@ builds:
|
||||
goarch:
|
||||
- amd64
|
||||
- arm64
|
||||
|
||||
ignore:
|
||||
- goos: darwin
|
||||
goarch: arm64
|
||||
- goos: darwin
|
||||
goarch: arm
|
||||
- goos: darwin
|
||||
goarch: ppc64le
|
||||
- goos: darwin
|
||||
goarch: s390x
|
||||
- goos: windows
|
||||
goarch: arm64
|
||||
- goos: windows
|
||||
goarch: arm
|
||||
- goos: windows
|
||||
goarch: ppc64le
|
||||
- goos: windows
|
||||
goarch: s390x
|
||||
- goos: freebsd
|
||||
goarch: arm
|
||||
- goos: freebsd
|
||||
goarch: arm64
|
||||
- goos: freebsd
|
||||
goarch: ppc64le
|
||||
- goos: freebsd
|
||||
goarch: s390x
|
||||
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
main: ./cmd/console/
|
||||
|
||||
4
Makefile
4
Makefile
@@ -25,8 +25,10 @@ verifiers: getdeps fmt lint
|
||||
|
||||
fmt:
|
||||
@echo "Running $@ check"
|
||||
@GO111MODULE=on gofmt -d cmd/
|
||||
@GO111MODULE=on gofmt -d restapi/
|
||||
@GO111MODULE=on gofmt -d pkg/
|
||||
@GO111MODULE=on gofmt -d cmd/
|
||||
@GO111MODULE=on gofmt -d cluster/
|
||||
|
||||
lint:
|
||||
@echo "Running $@ check"
|
||||
|
||||
@@ -15,7 +15,7 @@ spec:
|
||||
serviceAccountName: console-sa
|
||||
containers:
|
||||
- name: console
|
||||
image: minio/console:v0.3.4
|
||||
image: minio/console:v0.3.6
|
||||
imagePullPolicy: "IfNotPresent"
|
||||
args:
|
||||
- server
|
||||
|
||||
@@ -15,7 +15,7 @@ spec:
|
||||
serviceAccountName: console-sa
|
||||
containers:
|
||||
- name: console
|
||||
image: minio/console:v0.3.4
|
||||
image: minio/console:v0.3.6
|
||||
imagePullPolicy: "IfNotPresent"
|
||||
env:
|
||||
- name: CONSOLE_OPERATOR_MODE
|
||||
|
||||
@@ -51,6 +51,9 @@ type CreateTenantRequest struct {
|
||||
// encryption
|
||||
Encryption *EncryptionConfiguration `json:"encryption,omitempty"`
|
||||
|
||||
// idp
|
||||
Idp *IdpConfiguration `json:"idp,omitempty"`
|
||||
|
||||
// image
|
||||
Image string `json:"image,omitempty"`
|
||||
|
||||
@@ -88,6 +91,10 @@ func (m *CreateTenantRequest) Validate(formats strfmt.Registry) error {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateIdp(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateName(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
@@ -128,6 +135,24 @@ func (m *CreateTenantRequest) validateEncryption(formats strfmt.Registry) error
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *CreateTenantRequest) validateIdp(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Idp) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Idp != nil {
|
||||
if err := m.Idp.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("idp")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *CreateTenantRequest) validateName(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("name", "body", m.Name); err != nil {
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// This file is part of MinIO Console Server
|
||||
// Copyright (c) 2020 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 (
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// EncryptionKesConfig encryption kes config
|
||||
//
|
||||
// swagger:model encryptionKesConfig
|
||||
type EncryptionKesConfig struct {
|
||||
|
||||
// server cert
|
||||
// Required: true
|
||||
ServerCert *string `json:"server_cert"`
|
||||
|
||||
// server config
|
||||
// Required: true
|
||||
ServerConfig *string `json:"server_config"`
|
||||
|
||||
// server key
|
||||
// Required: true
|
||||
ServerKey *string `json:"server_key"`
|
||||
}
|
||||
|
||||
// Validate validates this encryption kes config
|
||||
func (m *EncryptionKesConfig) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateServerCert(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateServerConfig(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateServerKey(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *EncryptionKesConfig) validateServerCert(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("server_cert", "body", m.ServerCert); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *EncryptionKesConfig) validateServerConfig(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("server_config", "body", m.ServerConfig); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *EncryptionKesConfig) validateServerKey(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("server_key", "body", m.ServerKey); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *EncryptionKesConfig) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *EncryptionKesConfig) UnmarshalBinary(b []byte) error {
|
||||
var res EncryptionKesConfig
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
299
models/idp_configuration.go
Normal file
299
models/idp_configuration.go
Normal file
@@ -0,0 +1,299 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// This file is part of MinIO Console Server
|
||||
// Copyright (c) 2020 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 (
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// IdpConfiguration idp configuration
|
||||
//
|
||||
// swagger:model idpConfiguration
|
||||
type IdpConfiguration struct {
|
||||
|
||||
// active directory
|
||||
ActiveDirectory *IdpConfigurationActiveDirectory `json:"active_directory,omitempty"`
|
||||
|
||||
// oidc
|
||||
Oidc *IdpConfigurationOidc `json:"oidc,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this idp configuration
|
||||
func (m *IdpConfiguration) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateActiveDirectory(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateOidc(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *IdpConfiguration) validateActiveDirectory(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.ActiveDirectory) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.ActiveDirectory != nil {
|
||||
if err := m.ActiveDirectory.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("active_directory")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *IdpConfiguration) validateOidc(formats strfmt.Registry) error {
|
||||
|
||||
if swag.IsZero(m.Oidc) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if m.Oidc != nil {
|
||||
if err := m.Oidc.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("oidc")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *IdpConfiguration) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *IdpConfiguration) UnmarshalBinary(b []byte) error {
|
||||
var res IdpConfiguration
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
|
||||
// IdpConfigurationActiveDirectory idp configuration active directory
|
||||
//
|
||||
// swagger:model IdpConfigurationActiveDirectory
|
||||
type IdpConfigurationActiveDirectory struct {
|
||||
|
||||
// group name attribute
|
||||
GroupNameAttribute string `json:"group_name_attribute,omitempty"`
|
||||
|
||||
// group search base dn
|
||||
GroupSearchBaseDn string `json:"group_search_base_dn,omitempty"`
|
||||
|
||||
// group search filter
|
||||
GroupSearchFilter string `json:"group_search_filter,omitempty"`
|
||||
|
||||
// server insecure
|
||||
ServerInsecure bool `json:"server_insecure,omitempty"`
|
||||
|
||||
// skip ssl verification
|
||||
SkipSslVerification bool `json:"skip_ssl_verification,omitempty"`
|
||||
|
||||
// url
|
||||
// Required: true
|
||||
URL *string `json:"url"`
|
||||
|
||||
// user search filter
|
||||
// Required: true
|
||||
UserSearchFilter *string `json:"user_search_filter"`
|
||||
|
||||
// username format
|
||||
// Required: true
|
||||
UsernameFormat *string `json:"username_format"`
|
||||
}
|
||||
|
||||
// Validate validates this idp configuration active directory
|
||||
func (m *IdpConfigurationActiveDirectory) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateURL(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateUserSearchFilter(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateUsernameFormat(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *IdpConfigurationActiveDirectory) validateURL(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("active_directory"+"."+"url", "body", m.URL); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *IdpConfigurationActiveDirectory) validateUserSearchFilter(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("active_directory"+"."+"user_search_filter", "body", m.UserSearchFilter); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *IdpConfigurationActiveDirectory) validateUsernameFormat(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("active_directory"+"."+"username_format", "body", m.UsernameFormat); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *IdpConfigurationActiveDirectory) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *IdpConfigurationActiveDirectory) UnmarshalBinary(b []byte) error {
|
||||
var res IdpConfigurationActiveDirectory
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
|
||||
// IdpConfigurationOidc idp configuration oidc
|
||||
//
|
||||
// swagger:model IdpConfigurationOidc
|
||||
type IdpConfigurationOidc struct {
|
||||
|
||||
// client id
|
||||
// Required: true
|
||||
ClientID *string `json:"client_id"`
|
||||
|
||||
// secret id
|
||||
// Required: true
|
||||
SecretID *string `json:"secret_id"`
|
||||
|
||||
// url
|
||||
// Required: true
|
||||
URL *string `json:"url"`
|
||||
}
|
||||
|
||||
// Validate validates this idp configuration oidc
|
||||
func (m *IdpConfigurationOidc) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateClientID(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateSecretID(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateURL(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *IdpConfigurationOidc) validateClientID(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("oidc"+"."+"client_id", "body", m.ClientID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *IdpConfigurationOidc) validateSecretID(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("oidc"+"."+"secret_id", "body", m.SecretID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *IdpConfigurationOidc) validateURL(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("oidc"+"."+"url", "body", m.URL); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *IdpConfigurationOidc) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *IdpConfigurationOidc) UnmarshalBinary(b []byte) error {
|
||||
var res IdpConfigurationOidc
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
@@ -1,269 +0,0 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
// This file is part of MinIO Console Server
|
||||
// Copyright (c) 2020 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 (
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// KesConfiguration kes configuration
|
||||
//
|
||||
// swagger:model kesConfiguration
|
||||
type KesConfiguration struct {
|
||||
|
||||
// client
|
||||
// Required: true
|
||||
Client *KesConfigurationClient `json:"client"`
|
||||
|
||||
// server
|
||||
// Required: true
|
||||
Server *KesConfigurationServer `json:"server"`
|
||||
|
||||
// server config yaml
|
||||
// Required: true
|
||||
ServerConfigYaml *string `json:"server-config.yaml"`
|
||||
}
|
||||
|
||||
// Validate validates this kes configuration
|
||||
func (m *KesConfiguration) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateClient(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateServer(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateServerConfigYaml(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *KesConfiguration) validateClient(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("client", "body", m.Client); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if m.Client != nil {
|
||||
if err := m.Client.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("client")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *KesConfiguration) validateServer(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("server", "body", m.Server); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if m.Server != nil {
|
||||
if err := m.Server.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("server")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *KesConfiguration) validateServerConfigYaml(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("server-config.yaml", "body", m.ServerConfigYaml); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *KesConfiguration) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *KesConfiguration) UnmarshalBinary(b []byte) error {
|
||||
var res KesConfiguration
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
|
||||
// KesConfigurationClient kes configuration client
|
||||
//
|
||||
// swagger:model KesConfigurationClient
|
||||
type KesConfigurationClient struct {
|
||||
|
||||
// tls crt
|
||||
// Required: true
|
||||
TLSCrt *string `json:"tls.crt"`
|
||||
|
||||
// tls key
|
||||
// Required: true
|
||||
TLSKey *string `json:"tls.key"`
|
||||
}
|
||||
|
||||
// Validate validates this kes configuration client
|
||||
func (m *KesConfigurationClient) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateTLSCrt(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateTLSKey(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *KesConfigurationClient) validateTLSCrt(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("client"+"."+"tls.crt", "body", m.TLSCrt); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *KesConfigurationClient) validateTLSKey(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("client"+"."+"tls.key", "body", m.TLSKey); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *KesConfigurationClient) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *KesConfigurationClient) UnmarshalBinary(b []byte) error {
|
||||
var res KesConfigurationClient
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
|
||||
// KesConfigurationServer kes configuration server
|
||||
//
|
||||
// swagger:model KesConfigurationServer
|
||||
type KesConfigurationServer struct {
|
||||
|
||||
// tls crt
|
||||
// Required: true
|
||||
TLSCrt *string `json:"tls.crt"`
|
||||
|
||||
// tls key
|
||||
// Required: true
|
||||
TLSKey *string `json:"tls.key"`
|
||||
}
|
||||
|
||||
// Validate validates this kes configuration server
|
||||
func (m *KesConfigurationServer) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateTLSCrt(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateTLSKey(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *KesConfigurationServer) validateTLSCrt(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("server"+"."+"tls.crt", "body", m.TLSCrt); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *KesConfigurationServer) validateTLSKey(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("server"+"."+"tls.key", "body", m.TLSKey); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *KesConfigurationServer) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *KesConfigurationServer) UnmarshalBinary(b []byte) error {
|
||||
var res KesConfigurationServer
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
@@ -32,8 +32,11 @@ import (
|
||||
// swagger:model tenantUsage
|
||||
type TenantUsage struct {
|
||||
|
||||
// used size
|
||||
UsedSize int64 `json:"used_size,omitempty"`
|
||||
// disk used
|
||||
DiskUsed int64 `json:"disk_used,omitempty"`
|
||||
|
||||
// used
|
||||
Used int64 `json:"used,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this tenant usage
|
||||
|
||||
6
portal-ui/package-lock.json
generated
6
portal-ui/package-lock.json
generated
@@ -4877,9 +4877,9 @@
|
||||
"integrity": "sha512-WOr3SrZ55lUFYugA6sUu3H3ZoxVIH5o3zTSqYS+2DOJJP4hnHmBiD1w432a2YFW/H2G5FIxE6DB06rv+9dUL5g=="
|
||||
},
|
||||
"elliptic": {
|
||||
"version": "6.5.2",
|
||||
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz",
|
||||
"integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==",
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz",
|
||||
"integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==",
|
||||
"requires": {
|
||||
"bn.js": "^4.4.0",
|
||||
"brorand": "^1.0.1",
|
||||
|
||||
@@ -250,7 +250,10 @@ const Login = ({ classes, userLoggedIn }: ILoginProps) => {
|
||||
</Typography>
|
||||
<Button
|
||||
component={"a"}
|
||||
href={loginStrategy.redirect}
|
||||
href={loginStrategy.redirect.replace(
|
||||
"%5BHOSTNAME%5D",
|
||||
window.location.hostname
|
||||
)}
|
||||
type="submit"
|
||||
fullWidth
|
||||
variant="contained"
|
||||
|
||||
@@ -2588,9 +2588,9 @@ bluebird@^3.5.1, bluebird@^3.5.3, bluebird@^3.5.5:
|
||||
integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==
|
||||
|
||||
bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0:
|
||||
version "4.11.8"
|
||||
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f"
|
||||
integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==
|
||||
version "4.11.9"
|
||||
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.9.tgz#26d556829458f9d1e81fc48952493d0ba3507828"
|
||||
integrity sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==
|
||||
|
||||
body-parser@1.19.0:
|
||||
version "1.19.0"
|
||||
@@ -4374,9 +4374,9 @@ electron-to-chromium@^1.3.378, electron-to-chromium@^1.3.413:
|
||||
integrity sha512-JTEOWiqCY4snuKuQAaFy0z6LK2Gdb8Lojkd/csQwpNHgMUF8I6QRjGVKk44IH46dHQhUFKzr4o6zxZrtDBjc2Q==
|
||||
|
||||
elliptic@^6.0.0:
|
||||
version "6.5.2"
|
||||
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.2.tgz#05c5678d7173c049d8ca433552224a495d0e3762"
|
||||
integrity sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==
|
||||
version "6.5.3"
|
||||
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.3.tgz#cb59eb2efdaf73a0bd78ccd7015a62ad6e0f93d6"
|
||||
integrity sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==
|
||||
dependencies:
|
||||
bn.js "^4.4.0"
|
||||
brorand "^1.0.1"
|
||||
|
||||
@@ -60,11 +60,11 @@ func TestListConfig(t *testing.T) {
|
||||
function := "listConfig()"
|
||||
// Test-1 : listConfig() get list of two configurations and ensure is output correctly
|
||||
configListMock := []madmin.HelpKV{
|
||||
madmin.HelpKV{
|
||||
{
|
||||
Key: "region",
|
||||
Description: "label the location of the server",
|
||||
},
|
||||
madmin.HelpKV{
|
||||
{
|
||||
Key: "notify_nsq",
|
||||
Description: "publish bucket notifications to NSQ endpoints",
|
||||
},
|
||||
|
||||
@@ -57,6 +57,7 @@ func registerTenantHandlers(api *operations.ConsoleAPI) {
|
||||
api.AdminAPICreateTenantHandler = admin_api.CreateTenantHandlerFunc(func(params admin_api.CreateTenantParams, session *models.Principal) middleware.Responder {
|
||||
resp, err := getTenantCreatedResponse(session, params)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return admin_api.NewCreateTenantDefault(500).WithPayload(&models.Error{Code: 500, Message: swag.String(err.Error())})
|
||||
}
|
||||
return admin_api.NewCreateTenantOK().WithPayload(resp)
|
||||
@@ -65,6 +66,7 @@ func registerTenantHandlers(api *operations.ConsoleAPI) {
|
||||
api.AdminAPIListAllTenantsHandler = admin_api.ListAllTenantsHandlerFunc(func(params admin_api.ListAllTenantsParams, session *models.Principal) middleware.Responder {
|
||||
resp, err := getListAllTenantsResponse(session, params)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return admin_api.NewListTenantsDefault(500).WithPayload(&models.Error{Code: 500, Message: swag.String(err.Error())})
|
||||
}
|
||||
return admin_api.NewListTenantsOK().WithPayload(resp)
|
||||
@@ -74,6 +76,7 @@ func registerTenantHandlers(api *operations.ConsoleAPI) {
|
||||
api.AdminAPIListTenantsHandler = admin_api.ListTenantsHandlerFunc(func(params admin_api.ListTenantsParams, session *models.Principal) middleware.Responder {
|
||||
resp, err := getListTenantsResponse(session, params)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return admin_api.NewListTenantsDefault(500).WithPayload(&models.Error{Code: 500, Message: swag.String(err.Error())})
|
||||
}
|
||||
return admin_api.NewListTenantsOK().WithPayload(resp)
|
||||
@@ -83,6 +86,7 @@ func registerTenantHandlers(api *operations.ConsoleAPI) {
|
||||
api.AdminAPITenantInfoHandler = admin_api.TenantInfoHandlerFunc(func(params admin_api.TenantInfoParams, session *models.Principal) middleware.Responder {
|
||||
resp, err := getTenantInfoResponse(session, params)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return admin_api.NewTenantInfoDefault(500).WithPayload(&models.Error{Code: 500, Message: swag.String(err.Error())})
|
||||
}
|
||||
return admin_api.NewTenantInfoOK().WithPayload(resp)
|
||||
@@ -391,6 +395,57 @@ func getTenantCreatedResponse(session *models.Principal, params admin_api.Create
|
||||
Env: []corev1.EnvVar{},
|
||||
},
|
||||
}
|
||||
idpEnabled := false
|
||||
// Enable IDP (Active Directory) for MinIO
|
||||
if params.Body.Idp != nil && params.Body.Idp.ActiveDirectory != nil {
|
||||
url := *params.Body.Idp.ActiveDirectory.URL
|
||||
userNameFormat := *params.Body.Idp.ActiveDirectory.UsernameFormat
|
||||
userSearchFilter := *params.Body.Idp.ActiveDirectory.UserSearchFilter
|
||||
tlsSkipVerify := params.Body.Idp.ActiveDirectory.SkipSslVerification
|
||||
serverInsecure := params.Body.Idp.ActiveDirectory.ServerInsecure
|
||||
groupSearchDN := params.Body.Idp.ActiveDirectory.GroupSearchBaseDn
|
||||
groupSearchFilter := params.Body.Idp.ActiveDirectory.GroupSearchFilter
|
||||
groupNameAttribute := params.Body.Idp.ActiveDirectory.GroupNameAttribute
|
||||
if url != "" && userNameFormat != "" && userSearchFilter != "" {
|
||||
// CONSOLE_LDAP_ENABLED
|
||||
idpEnabled = true
|
||||
minInst.Spec.Env = append(minInst.Spec.Env, corev1.EnvVar{
|
||||
Name: "MINIO_IDENTITY_LDAP_SERVER_ADDR",
|
||||
Value: userNameFormat,
|
||||
}, corev1.EnvVar{
|
||||
Name: "MINIO_IDENTITY_LDAP_USERNAME_FORMAT",
|
||||
Value: userNameFormat,
|
||||
}, corev1.EnvVar{
|
||||
Name: "MINIO_IDENTITY_LDAP_USERNAME_SEARCH_FILTER",
|
||||
Value: userSearchFilter,
|
||||
}, corev1.EnvVar{
|
||||
Name: "MINIO_IDENTITY_LDAP_USERNAME_SEARCH_FILTER",
|
||||
Value: userSearchFilter,
|
||||
}, corev1.EnvVar{
|
||||
Name: "MINIO_IDENTITY_LDAP_GROUP_SEARCH_BASE_DN",
|
||||
Value: groupSearchDN,
|
||||
}, corev1.EnvVar{
|
||||
Name: "MINIO_IDENTITY_LDAP_GROUP_SEARCH_FILTER",
|
||||
Value: groupSearchFilter,
|
||||
}, corev1.EnvVar{
|
||||
Name: "MINIO_IDENTITY_LDAP_GROUP_NAME_ATTRIBUTE",
|
||||
Value: groupNameAttribute,
|
||||
})
|
||||
|
||||
if tlsSkipVerify {
|
||||
minInst.Spec.Env = append(minInst.Spec.Env, corev1.EnvVar{
|
||||
Name: "MINIO_IDENTITY_LDAP_TLS_SKIP_VERIFY",
|
||||
Value: "on",
|
||||
})
|
||||
}
|
||||
if serverInsecure {
|
||||
minInst.Spec.Env = append(minInst.Spec.Env, corev1.EnvVar{
|
||||
Name: "MINIO_IDENTITY_LDAP_SERVER_INSECURE",
|
||||
Value: "on",
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// operator request AutoCert feature
|
||||
encryption := false
|
||||
@@ -464,6 +519,7 @@ func getTenantCreatedResponse(session *models.Principal, params admin_api.Create
|
||||
minInst.Spec.KES.Image = params.Body.Encryption.Image
|
||||
}
|
||||
// Secret to store KES server TLS certificates
|
||||
// TODO check if AutoCert it's already configured
|
||||
serverTLSCrt, err := base64.StdEncoding.DecodeString(*params.Body.Encryption.Server.Crt)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -685,16 +741,43 @@ func getTenantCreatedResponse(session *models.Principal, params admin_api.Create
|
||||
"CONSOLE_SECRET_KEY": []byte(consoleSecret),
|
||||
},
|
||||
}
|
||||
|
||||
// Enable IDP (Open ID Connect) for console
|
||||
if !idpEnabled && params.Body.Idp != nil && params.Body.Idp.Oidc != nil {
|
||||
url := *params.Body.Idp.Oidc.URL
|
||||
clientID := *params.Body.Idp.Oidc.ClientID
|
||||
secretID := *params.Body.Idp.Oidc.SecretID
|
||||
if url != "" && clientID != "" && secretID != "" {
|
||||
instanceSecret.Data["CONSOLE_IDP_URL"] = []byte(url)
|
||||
instanceSecret.Data["CONSOLE_IDP_CLIENT_ID"] = []byte(clientID)
|
||||
instanceSecret.Data["CONSOLE_IDP_SECRET"] = []byte(secretID)
|
||||
consoleScheme := "http"
|
||||
consolePort := 9090
|
||||
if minInst.Spec.RequestAutoCert {
|
||||
consoleScheme = "https"
|
||||
consolePort = 9443
|
||||
}
|
||||
// https://[HOSTNAME]:9443 will be replaced by javascript in the browser to use the actual hostname
|
||||
// assigned to Console, eg: https://localhost:9443
|
||||
instanceSecret.Data["CONSOLE_IDP_CALLBACK"] = []byte(fmt.Sprintf("%s://[HOSTNAME]:%d/oauth_callback", consoleScheme, consolePort))
|
||||
}
|
||||
}
|
||||
|
||||
_, err = clientset.CoreV1().Secrets(ns).Create(context.Background(), &instanceSecret, metav1.CreateOptions{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
const consoleVersion = "minio/console:v0.3.4"
|
||||
const consoleVersion = "minio/console:v0.3.6"
|
||||
minInst.Spec.Console = &operator.ConsoleConfiguration{
|
||||
Replicas: 2,
|
||||
Image: consoleVersion,
|
||||
ConsoleSecret: &corev1.LocalObjectReference{Name: consoleSecretName},
|
||||
Resources: corev1.ResourceRequirements{
|
||||
Requests: map[corev1.ResourceName]resource.Quantity{
|
||||
"memory": resource.MustParse("64Mi"),
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -856,6 +939,7 @@ func getTenantUsageResponse(session *models.Principal, params admin_api.GetTenan
|
||||
|
||||
opClientClientSet, err := cluster.OperatorClient(session.SessionToken)
|
||||
if err != nil {
|
||||
log.Println("error operator client", err)
|
||||
return nil, err
|
||||
}
|
||||
clientset, err := cluster.K8sClient(session.SessionToken)
|
||||
@@ -906,7 +990,7 @@ func getTenantUsageResponse(session *models.Principal, params admin_api.GetTenan
|
||||
log.Println("error getting admin info:", err)
|
||||
return nil, err
|
||||
}
|
||||
info := &models.TenantUsage{UsedSize: adminInfo.Usage}
|
||||
info := &models.TenantUsage{Used: adminInfo.Usage, DiskUsed: adminInfo.DisksUsage}
|
||||
return info, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -67,13 +67,13 @@ func TestListUsers(t *testing.T) {
|
||||
// Test-1 : listUsers() Get response from minio client with two users and return the same number on listUsers()
|
||||
// mock minIO client
|
||||
mockUserMap := map[string]madmin.UserInfo{
|
||||
"ABCDEFGHI": madmin.UserInfo{
|
||||
"ABCDEFGHI": {
|
||||
SecretKey: "",
|
||||
PolicyName: "ABCDEFGHI-policy",
|
||||
Status: "enabled",
|
||||
MemberOf: []string{"group1", "group2"},
|
||||
},
|
||||
"ZBCDEFGHI": madmin.UserInfo{
|
||||
"ZBCDEFGHI": {
|
||||
SecretKey: "",
|
||||
PolicyName: "ZBCDEFGHI-policy",
|
||||
Status: "enabled",
|
||||
|
||||
@@ -33,8 +33,13 @@ import (
|
||||
|
||||
const globalAppName = "console"
|
||||
|
||||
// NewAdminClient gives a new client interface
|
||||
// NewAdminClient gives a new madmin client interface
|
||||
func NewAdminClient(url, accessKey, secretKey string) (*madmin.AdminClient, *probe.Error) {
|
||||
return NewAdminClientWithInsecure(url, accessKey, secretKey, false)
|
||||
}
|
||||
|
||||
// NewAdminClientWithInsecure gives a new madmin client interface either secure or insecure based on parameter
|
||||
func NewAdminClientWithInsecure(url, accessKey, secretKey string, insecure bool) (*madmin.AdminClient, *probe.Error) {
|
||||
appName := filepath.Base(globalAppName)
|
||||
|
||||
s3Client, err := s3AdminNew(&mcCmd.Config{
|
||||
@@ -44,7 +49,7 @@ func NewAdminClient(url, accessKey, secretKey string) (*madmin.AdminClient, *pro
|
||||
AppName: appName,
|
||||
AppVersion: ConsoleVersion,
|
||||
AppComments: []string{appName, runtime.GOOS, runtime.GOARCH},
|
||||
Insecure: false,
|
||||
Insecure: insecure,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err.Trace(url)
|
||||
|
||||
@@ -2036,6 +2036,10 @@ func init() {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/encryptionConfiguration"
|
||||
},
|
||||
"idp": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/idpConfiguration"
|
||||
},
|
||||
"image": {
|
||||
"type": "string"
|
||||
},
|
||||
@@ -2227,6 +2231,64 @@ func init() {
|
||||
}
|
||||
}
|
||||
},
|
||||
"idpConfiguration": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"active_directory": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"url",
|
||||
"username_format",
|
||||
"user_search_filter"
|
||||
],
|
||||
"properties": {
|
||||
"group_name_attribute": {
|
||||
"type": "string"
|
||||
},
|
||||
"group_search_base_dn": {
|
||||
"type": "string"
|
||||
},
|
||||
"group_search_filter": {
|
||||
"type": "string"
|
||||
},
|
||||
"server_insecure": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"skip_ssl_verification": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
},
|
||||
"user_search_filter": {
|
||||
"type": "string"
|
||||
},
|
||||
"username_format": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"oidc": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"url",
|
||||
"client_id",
|
||||
"secret_id"
|
||||
],
|
||||
"properties": {
|
||||
"client_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"secret_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"listBucketEventsResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -2938,7 +3000,11 @@ func init() {
|
||||
"tenantUsage": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"used_size": {
|
||||
"disk_used": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
"used": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
}
|
||||
@@ -5244,6 +5310,59 @@ func init() {
|
||||
}
|
||||
}
|
||||
},
|
||||
"IdpConfigurationActiveDirectory": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"url",
|
||||
"username_format",
|
||||
"user_search_filter"
|
||||
],
|
||||
"properties": {
|
||||
"group_name_attribute": {
|
||||
"type": "string"
|
||||
},
|
||||
"group_search_base_dn": {
|
||||
"type": "string"
|
||||
},
|
||||
"group_search_filter": {
|
||||
"type": "string"
|
||||
},
|
||||
"server_insecure": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"skip_ssl_verification": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
},
|
||||
"user_search_filter": {
|
||||
"type": "string"
|
||||
},
|
||||
"username_format": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"IdpConfigurationOidc": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"url",
|
||||
"client_id",
|
||||
"secret_id"
|
||||
],
|
||||
"properties": {
|
||||
"client_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"secret_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"NodeSelectorTermMatchExpressionsItems0": {
|
||||
"description": "A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.",
|
||||
"type": "object",
|
||||
@@ -5808,6 +5927,10 @@ func init() {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/encryptionConfiguration"
|
||||
},
|
||||
"idp": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/idpConfiguration"
|
||||
},
|
||||
"image": {
|
||||
"type": "string"
|
||||
},
|
||||
@@ -5999,6 +6122,64 @@ func init() {
|
||||
}
|
||||
}
|
||||
},
|
||||
"idpConfiguration": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"active_directory": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"url",
|
||||
"username_format",
|
||||
"user_search_filter"
|
||||
],
|
||||
"properties": {
|
||||
"group_name_attribute": {
|
||||
"type": "string"
|
||||
},
|
||||
"group_search_base_dn": {
|
||||
"type": "string"
|
||||
},
|
||||
"group_search_filter": {
|
||||
"type": "string"
|
||||
},
|
||||
"server_insecure": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"skip_ssl_verification": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
},
|
||||
"user_search_filter": {
|
||||
"type": "string"
|
||||
},
|
||||
"username_format": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"oidc": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"url",
|
||||
"client_id",
|
||||
"secret_id"
|
||||
],
|
||||
"properties": {
|
||||
"client_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"secret_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"listBucketEventsResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -6644,7 +6825,11 @@ func init() {
|
||||
"tenantUsage": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"used_size": {
|
||||
"disk_used": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
"used": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
}
|
||||
|
||||
@@ -66,12 +66,12 @@ func Test_ResourceQuota(t *testing.T) {
|
||||
want: models.ResourceQuota{
|
||||
Name: mockRQResponse.Name,
|
||||
Elements: []*models.ResourceQuotaElement{
|
||||
&models.ResourceQuotaElement{
|
||||
{
|
||||
Name: "storage",
|
||||
Hard: int64(1000),
|
||||
Used: int64(500),
|
||||
},
|
||||
&models.ResourceQuotaElement{
|
||||
{
|
||||
Name: "cpu",
|
||||
Hard: int64(2048),
|
||||
Used: int64(1024),
|
||||
|
||||
@@ -148,7 +148,7 @@ func TestListBucketEvents(t *testing.T) {
|
||||
LambdaConfigs: []notification.LambdaConfig{},
|
||||
TopicConfigs: []notification.TopicConfig{},
|
||||
QueueConfigs: []notification.QueueConfig{
|
||||
notification.QueueConfig{
|
||||
{
|
||||
Queue: "arn:minio:sqs::test:postgresql",
|
||||
Config: notification.Config{
|
||||
ID: "",
|
||||
@@ -160,11 +160,11 @@ func TestListBucketEvents(t *testing.T) {
|
||||
Filter: ¬ification.Filter{
|
||||
S3Key: notification.S3Key{
|
||||
FilterRules: []notification.FilterRule{
|
||||
notification.FilterRule{
|
||||
{
|
||||
Name: "suffix",
|
||||
Value: ".jpg",
|
||||
},
|
||||
notification.FilterRule{
|
||||
{
|
||||
Name: "prefix",
|
||||
Value: "file/",
|
||||
},
|
||||
@@ -176,7 +176,7 @@ func TestListBucketEvents(t *testing.T) {
|
||||
},
|
||||
}
|
||||
expectedOutput := []*models.NotificationConfig{
|
||||
&models.NotificationConfig{
|
||||
{
|
||||
Arn: swag.String("arn:minio:sqs::test:postgresql"),
|
||||
ID: "",
|
||||
Prefix: "file/",
|
||||
@@ -213,7 +213,7 @@ func TestListBucketEvents(t *testing.T) {
|
||||
LambdaConfigs: []notification.LambdaConfig{},
|
||||
TopicConfigs: []notification.TopicConfig{},
|
||||
QueueConfigs: []notification.QueueConfig{
|
||||
notification.QueueConfig{
|
||||
{
|
||||
Queue: "arn:minio:sqs::test:postgresql",
|
||||
Config: notification.Config{
|
||||
ID: "",
|
||||
@@ -225,7 +225,7 @@ func TestListBucketEvents(t *testing.T) {
|
||||
},
|
||||
}
|
||||
expectedOutput = []*models.NotificationConfig{
|
||||
&models.NotificationConfig{
|
||||
{
|
||||
Arn: swag.String("arn:minio:sqs::test:postgresql"),
|
||||
ID: "",
|
||||
Prefix: "",
|
||||
@@ -258,7 +258,7 @@ func TestListBucketEvents(t *testing.T) {
|
||||
////// Test-3 : listBucketEvents() get list of events
|
||||
mockBucketN = notification.Configuration{
|
||||
LambdaConfigs: []notification.LambdaConfig{
|
||||
notification.LambdaConfig{
|
||||
{
|
||||
Lambda: "lambda",
|
||||
Config: notification.Config{
|
||||
ID: "",
|
||||
@@ -268,11 +268,11 @@ func TestListBucketEvents(t *testing.T) {
|
||||
Filter: ¬ification.Filter{
|
||||
S3Key: notification.S3Key{
|
||||
FilterRules: []notification.FilterRule{
|
||||
notification.FilterRule{
|
||||
{
|
||||
Name: "suffix",
|
||||
Value: ".png",
|
||||
},
|
||||
notification.FilterRule{
|
||||
{
|
||||
Name: "prefix",
|
||||
Value: "lambda/",
|
||||
},
|
||||
@@ -283,7 +283,7 @@ func TestListBucketEvents(t *testing.T) {
|
||||
},
|
||||
},
|
||||
TopicConfigs: []notification.TopicConfig{
|
||||
notification.TopicConfig{
|
||||
{
|
||||
Topic: "topic",
|
||||
Config: notification.Config{
|
||||
ID: "",
|
||||
@@ -293,11 +293,11 @@ func TestListBucketEvents(t *testing.T) {
|
||||
Filter: ¬ification.Filter{
|
||||
S3Key: notification.S3Key{
|
||||
FilterRules: []notification.FilterRule{
|
||||
notification.FilterRule{
|
||||
{
|
||||
Name: "suffix",
|
||||
Value: ".gif",
|
||||
},
|
||||
notification.FilterRule{
|
||||
{
|
||||
Name: "prefix",
|
||||
Value: "topic/",
|
||||
},
|
||||
@@ -308,7 +308,7 @@ func TestListBucketEvents(t *testing.T) {
|
||||
},
|
||||
},
|
||||
QueueConfigs: []notification.QueueConfig{
|
||||
notification.QueueConfig{
|
||||
{
|
||||
Queue: "arn:minio:sqs::test:postgresql",
|
||||
Config: notification.Config{
|
||||
ID: "",
|
||||
@@ -326,7 +326,7 @@ func TestListBucketEvents(t *testing.T) {
|
||||
}
|
||||
// order matters in output: topic,queue then lambda are given respectively
|
||||
expectedOutput = []*models.NotificationConfig{
|
||||
&models.NotificationConfig{
|
||||
{
|
||||
Arn: swag.String("topic"),
|
||||
ID: "",
|
||||
Prefix: "topic/",
|
||||
@@ -335,7 +335,7 @@ func TestListBucketEvents(t *testing.T) {
|
||||
models.NotificationEventTypeDelete,
|
||||
},
|
||||
},
|
||||
&models.NotificationConfig{
|
||||
{
|
||||
Arn: swag.String("arn:minio:sqs::test:postgresql"),
|
||||
ID: "",
|
||||
Prefix: "",
|
||||
@@ -344,7 +344,7 @@ func TestListBucketEvents(t *testing.T) {
|
||||
models.NotificationEventTypeDelete,
|
||||
},
|
||||
},
|
||||
&models.NotificationConfig{
|
||||
{
|
||||
Arn: swag.String("lambda"),
|
||||
ID: "",
|
||||
Prefix: "lambda/",
|
||||
|
||||
@@ -82,8 +82,8 @@ func TestListBucket(t *testing.T) {
|
||||
mockBucketList := madmin.AccountUsageInfo{
|
||||
AccountName: "test",
|
||||
Buckets: []madmin.BucketUsageInfo{
|
||||
madmin.BucketUsageInfo{Name: "bucket-1", Created: time.Now(), Size: 1024},
|
||||
madmin.BucketUsageInfo{Name: "bucket-2", Created: time.Now().Add(time.Hour * 1), Size: 0},
|
||||
{Name: "bucket-1", Created: time.Now(), Size: 1024},
|
||||
{Name: "bucket-2", Created: time.Now().Add(time.Hour * 1), Size: 0},
|
||||
},
|
||||
}
|
||||
// mock function response from listBucketsWithContext(ctx)
|
||||
|
||||
@@ -71,7 +71,7 @@ func TestWatch(t *testing.T) {
|
||||
// mocking sending 5 lines of info
|
||||
for range lines {
|
||||
info := []mc.EventInfo{
|
||||
mc.EventInfo{
|
||||
{
|
||||
UserAgent: textToReceive,
|
||||
},
|
||||
}
|
||||
@@ -134,7 +134,7 @@ func TestWatch(t *testing.T) {
|
||||
// mocking sending 5 lines of info
|
||||
for range lines {
|
||||
info := []mc.EventInfo{
|
||||
mc.EventInfo{
|
||||
{
|
||||
UserAgent: textToReceive,
|
||||
},
|
||||
}
|
||||
@@ -177,7 +177,7 @@ func TestWatch(t *testing.T) {
|
||||
// mocking sending 5 lines of info
|
||||
for range lines {
|
||||
info := []mc.EventInfo{
|
||||
mc.EventInfo{
|
||||
{
|
||||
UserAgent: textToReceive,
|
||||
},
|
||||
}
|
||||
|
||||
48
swagger.yml
48
swagger.yml
@@ -1733,7 +1733,10 @@ definitions:
|
||||
tenantUsage:
|
||||
type: object
|
||||
properties:
|
||||
used_size:
|
||||
used:
|
||||
type: integer
|
||||
format: int64
|
||||
disk_used:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
@@ -1810,6 +1813,9 @@ definitions:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: string
|
||||
idp:
|
||||
type: object
|
||||
$ref: "#/definitions/idpConfiguration"
|
||||
tls:
|
||||
type: object
|
||||
$ref: "#/definitions/tlsConfiguration"
|
||||
@@ -1828,6 +1834,46 @@ definitions:
|
||||
key:
|
||||
type: string
|
||||
|
||||
idpConfiguration:
|
||||
type: object
|
||||
properties:
|
||||
oidc:
|
||||
type: object
|
||||
required:
|
||||
- url
|
||||
- client_id
|
||||
- secret_id
|
||||
properties:
|
||||
url:
|
||||
type: string
|
||||
client_id:
|
||||
type: string
|
||||
secret_id:
|
||||
type: string
|
||||
active_directory:
|
||||
type: object
|
||||
required:
|
||||
- url
|
||||
- username_format
|
||||
- user_search_filter
|
||||
properties:
|
||||
url:
|
||||
type: string
|
||||
username_format:
|
||||
type: string
|
||||
user_search_filter:
|
||||
type: string
|
||||
group_search_base_dn:
|
||||
type: string
|
||||
group_search_filter:
|
||||
type: string
|
||||
group_name_attribute:
|
||||
type: string
|
||||
skip_ssl_verification:
|
||||
type: boolean
|
||||
server_insecure:
|
||||
type: boolean
|
||||
|
||||
encryptionConfiguration:
|
||||
type: object
|
||||
properties:
|
||||
|
||||
Reference in New Issue
Block a user