update minio dependency to latest release (#603)

iam/policies now support wildcard actions for
all actions such as 's3:Get*', 's3:Put*'

new policies such as CreateBucket now honors
LocationConstraint set but rejecting calls
that do not honor region.
This commit is contained in:
Harshavardhana
2021-02-16 12:53:18 -08:00
committed by GitHub
parent 7121dbfcea
commit d01eeb43a7
6 changed files with 65 additions and 40 deletions

View File

@@ -20,11 +20,10 @@ import (
"context"
"io"
"net/http"
"path/filepath"
"runtime"
"time"
"github.com/minio/console/models"
"github.com/minio/console/pkg"
mcCmd "github.com/minio/mc/cmd"
"github.com/minio/mc/pkg/probe"
"github.com/minio/minio-go/v7/pkg/credentials"
@@ -33,7 +32,7 @@ import (
"github.com/minio/minio/pkg/madmin"
)
const globalAppName = "console"
const globalAppName = "MinIO Console"
// NewAdminClient gives a new madmin client interface
func NewAdminClient(url, accessKey, secretKey, sessionToken string) (*madmin.AdminClient, *probe.Error) {
@@ -42,15 +41,13 @@ func NewAdminClient(url, accessKey, secretKey, sessionToken string) (*madmin.Adm
// NewAdminClientWithInsecure gives a new madmin client interface either secure or insecure based on parameter
func NewAdminClientWithInsecure(url, accessKey, secretKey, sessionToken string, insecure bool) (*madmin.AdminClient, *probe.Error) {
appName := filepath.Base(globalAppName)
s3Client, err := s3AdminNew(&mcCmd.Config{
HostURL: url,
AccessKey: accessKey,
SecretKey: secretKey,
SessionToken: sessionToken,
AppName: appName,
AppVersion: ConsoleVersion,
AppComments: []string{appName, runtime.GOOS, runtime.GOARCH},
AppName: globalAppName,
AppVersion: pkg.Version,
Insecure: insecure,
})
if err != nil {

View File

@@ -29,6 +29,7 @@ import (
"errors"
"github.com/minio/console/models"
"github.com/minio/console/pkg"
"github.com/minio/console/pkg/acl"
"github.com/minio/console/pkg/auth"
"github.com/minio/console/pkg/auth/ldap"
@@ -399,9 +400,8 @@ func newS3Config(endpoint, accessKey, secretKey, sessionToken string, insecure b
// consoleCredentials from the match found in the config file.
s3Config := new(mc.Config)
s3Config.AppName = "console" // TODO: make this a constant
s3Config.AppVersion = "" // TODO: get this from constant or build
s3Config.AppComments = []string{}
s3Config.AppName = globalAppName
s3Config.AppVersion = pkg.Version
s3Config.Debug = false
s3Config.Insecure = insecure

View File

@@ -35,7 +35,6 @@ import (
"github.com/go-openapi/runtime"
"github.com/go-openapi/swag"
"github.com/minio/console/models"
"github.com/minio/console/pkg"
"github.com/minio/console/pkg/auth"
"github.com/minio/console/restapi/operations"
"github.com/unrolled/secure"
@@ -241,7 +240,7 @@ func AuthenticationMiddleware(next http.Handler) http.Handler {
// FileServerMiddleware serves files from the static folder
func FileServerMiddleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Server", "console/"+pkg.Version) // add HTTP Server header
w.Header().Set("Server", globalAppName) // do not add version information
switch {
case strings.HasPrefix(r.URL.Path, "/ws"):
serveWS(w, r)

View File

@@ -16,9 +16,9 @@
package restapi
// list of all console environment constants
const (
// Constants for common configuration
ConsoleVersion = `0.2.0`
ConsoleMinIOServer = "CONSOLE_MINIO_SERVER"
ConsoleMinIORegion = "CONSOLE_MINIO_REGION"
ConsoleProductionMode = "CONSOLE_PRODUCTION_MODE"