mirror of
https://github.com/pgsty/minio.git
synced 2026-08-10 16:23:28 +03:00
Cleanup and fixes (#3273)
* newRequestID() (previously generateUploadID()) returns string than byte array. * Remove unclear comments and added appropriate comments. * SHA-256, MD5 Hash functions return Hex/Base64 encoded string than byte array. * Remove duplicate MD5 hasher functions. * Rename listObjectsValidateArgs() into validateListObjectsArgs() * Remove repeated auth check code in all bucket request handlers. * Remove abbreviated names in bucket-metadata * Avoid nested if in bucketPolicyMatchStatement() * Use ioutil.ReadFile() instead of os.Open() and ioutil.ReadAll() * Set crossDomainXML as constant.
This commit is contained in:
@@ -36,9 +36,9 @@ func (s3 *s3PeerAPIHandlers) LoginHandler(args *RPCLoginArgs, reply *RPCLoginRep
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetBNPArgs - Arguments collection to SetBucketNotificationPeer RPC
|
||||
// SetBucketNotificationPeerArgs - Arguments collection to SetBucketNotificationPeer RPC
|
||||
// call
|
||||
type SetBNPArgs struct {
|
||||
type SetBucketNotificationPeerArgs struct {
|
||||
// For Auth
|
||||
GenericArgs
|
||||
|
||||
@@ -48,7 +48,7 @@ type SetBNPArgs struct {
|
||||
NCfg *notificationConfig
|
||||
}
|
||||
|
||||
func (s3 *s3PeerAPIHandlers) SetBucketNotificationPeer(args *SetBNPArgs, reply *GenericReply) error {
|
||||
func (s3 *s3PeerAPIHandlers) SetBucketNotificationPeer(args *SetBucketNotificationPeerArgs, reply *GenericReply) error {
|
||||
// check auth
|
||||
if !isRPCTokenValid(args.Token) {
|
||||
return errInvalidToken
|
||||
@@ -57,8 +57,8 @@ func (s3 *s3PeerAPIHandlers) SetBucketNotificationPeer(args *SetBNPArgs, reply *
|
||||
return s3.bms.UpdateBucketNotification(args)
|
||||
}
|
||||
|
||||
// SetBLPArgs - Arguments collection to SetBucketListenerPeer RPC call
|
||||
type SetBLPArgs struct {
|
||||
// SetBucketListenerPeerArgs - Arguments collection to SetBucketListenerPeer RPC call
|
||||
type SetBucketListenerPeerArgs struct {
|
||||
// For Auth
|
||||
GenericArgs
|
||||
|
||||
@@ -68,7 +68,7 @@ type SetBLPArgs struct {
|
||||
LCfg []listenerConfig
|
||||
}
|
||||
|
||||
func (s3 *s3PeerAPIHandlers) SetBucketListenerPeer(args *SetBLPArgs, reply *GenericReply) error {
|
||||
func (s3 *s3PeerAPIHandlers) SetBucketListenerPeer(args *SetBucketListenerPeerArgs, reply *GenericReply) error {
|
||||
// check auth
|
||||
if !isRPCTokenValid(args.Token) {
|
||||
return errInvalidToken
|
||||
@@ -99,8 +99,8 @@ func (s3 *s3PeerAPIHandlers) Event(args *EventArgs, reply *GenericReply) error {
|
||||
return s3.bms.SendEvent(args)
|
||||
}
|
||||
|
||||
// SetBPPArgs - Arguments collection for SetBucketPolicyPeer RPC call
|
||||
type SetBPPArgs struct {
|
||||
// SetBucketPolicyPeerArgs - Arguments collection for SetBucketPolicyPeer RPC call
|
||||
type SetBucketPolicyPeerArgs struct {
|
||||
// For Auth
|
||||
GenericArgs
|
||||
|
||||
@@ -111,7 +111,7 @@ type SetBPPArgs struct {
|
||||
}
|
||||
|
||||
// tell receiving server to update a bucket policy
|
||||
func (s3 *s3PeerAPIHandlers) SetBucketPolicyPeer(args *SetBPPArgs, reply *GenericReply) error {
|
||||
func (s3 *s3PeerAPIHandlers) SetBucketPolicyPeer(args *SetBucketPolicyPeerArgs, reply *GenericReply) error {
|
||||
// check auth
|
||||
if !isRPCTokenValid(args.Token) {
|
||||
return errInvalidToken
|
||||
|
||||
Reference in New Issue
Block a user