mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -05:00
rpc: client login should ignore server versions.
This commit is contained in:
parent
bb0466f4ce
commit
7e3e24b394
@ -455,7 +455,7 @@ var errorCodeResponse = map[APIErrorCode]APIError{
|
|||||||
Description: "Request is not valid yet",
|
Description: "Request is not valid yet",
|
||||||
HTTPStatusCode: http.StatusForbidden,
|
HTTPStatusCode: http.StatusForbidden,
|
||||||
},
|
},
|
||||||
// FIXME: Actual XML error response also contains the header which missed in lsit of signed header parameters.
|
// FIXME: Actual XML error response also contains the header which missed in list of signed header parameters.
|
||||||
ErrUnsignedHeaders: {
|
ErrUnsignedHeaders: {
|
||||||
Code: "AccessDenied",
|
Code: "AccessDenied",
|
||||||
Description: "There were headers present in the request which were not signed",
|
Description: "There were headers present in the request which were not signed",
|
||||||
|
@ -32,7 +32,6 @@ func newObjectLayer(disks, ignoredDisks []string) (ObjectLayer, error) {
|
|||||||
// Initialize FS object layer.
|
// Initialize FS object layer.
|
||||||
return newFSObjects(exportPath)
|
return newFSObjects(exportPath)
|
||||||
}
|
}
|
||||||
// TODO: use dsync to block other concurrently booting up nodes.
|
|
||||||
// Initialize XL object layer.
|
// Initialize XL object layer.
|
||||||
objAPI, err := newXLObjects(disks, ignoredDisks)
|
objAPI, err := newXLObjects(disks, ignoredDisks)
|
||||||
if err == errXLWriteQuorum {
|
if err == errXLWriteQuorum {
|
||||||
@ -56,6 +55,8 @@ func newObjectLayerFactory(disks, ignoredDisks []string) func() ObjectLayer {
|
|||||||
defer nsMutex.Unlock(minioMetaBucket, formatConfigFile)
|
defer nsMutex.Unlock(minioMetaBucket, formatConfigFile)
|
||||||
objAPI, err = newObjectLayer(disks, ignoredDisks)
|
objAPI, err = newObjectLayer(disks, ignoredDisks)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
errorIf(err, "Unable to initialize object layer.")
|
||||||
|
// Purposefully do not return error, just return nil.
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
// Migrate bucket policy from configDir to .minio.sys/buckets/
|
// Migrate bucket policy from configDir to .minio.sys/buckets/
|
||||||
@ -81,6 +82,7 @@ func newObjectLayerFactory(disks, ignoredDisks []string) func() ObjectLayer {
|
|||||||
err = initBucketPolicies(objAPI)
|
err = initBucketPolicies(objAPI)
|
||||||
fatalIf(err, "Unable to load all bucket policies")
|
fatalIf(err, "Unable to load all bucket policies")
|
||||||
|
|
||||||
|
// Success.
|
||||||
return objAPI
|
return objAPI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
"io"
|
"io"
|
||||||
"path"
|
"path"
|
||||||
"strconv"
|
"strconv"
|
||||||
@ -88,9 +87,6 @@ func loginRPCClient(rpcClient *RPCClient) (tokenStr string, err error) {
|
|||||||
}, &reply); err != nil {
|
}, &reply); err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
if reply.ServerVersion != Version {
|
|
||||||
return "", errors.New("Server version mismatch")
|
|
||||||
}
|
|
||||||
// Reply back server provided token.
|
// Reply back server provided token.
|
||||||
return reply.Token, nil
|
return reply.Token, nil
|
||||||
}
|
}
|
||||||
@ -102,7 +98,7 @@ func newRPCClient(networkPath string) (StorageAPI, error) {
|
|||||||
return nil, errInvalidArgument
|
return nil, errInvalidArgument
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO validate netAddr and netPath.
|
// Split network path into its components.
|
||||||
netAddr, netPath, err := splitNetPath(networkPath)
|
netAddr, netPath, err := splitNetPath(networkPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -125,7 +121,12 @@ func newRPCClient(networkPath string) (StorageAPI, error) {
|
|||||||
|
|
||||||
// Initialize network storage.
|
// Initialize network storage.
|
||||||
ndisk := &networkStorage{
|
ndisk := &networkStorage{
|
||||||
netScheme: "http", // TODO: fix for ssl rpc support.
|
netScheme: func() string {
|
||||||
|
if !isSSL() {
|
||||||
|
return "http"
|
||||||
|
}
|
||||||
|
return "https"
|
||||||
|
}(),
|
||||||
netAddr: netAddr,
|
netAddr: netAddr,
|
||||||
netPath: netPath,
|
netPath: netPath,
|
||||||
rpcClient: rpcClient,
|
rpcClient: rpcClient,
|
||||||
|
Loading…
Reference in New Issue
Block a user