mirror of
https://github.com/minio/minio.git
synced 2025-11-09 05:34:56 -05:00
controller/auth: Implement JWT based authorization for controller. (#2544)
Fixes #2474
This commit is contained in:
11
vendor/github.com/minio/dsync/drwmutex.go
generated
vendored
11
vendor/github.com/minio/dsync/drwmutex.go
generated
vendored
@@ -19,6 +19,7 @@ package dsync
|
||||
import (
|
||||
"math"
|
||||
"math/rand"
|
||||
"net"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
@@ -336,11 +337,21 @@ func sendRelease(c RPC, name, uid string, isReadLock bool) {
|
||||
if err = c.Call("Dsync.RUnlock", &LockArgs{Name: name}, &status); err == nil {
|
||||
// RUnlock delivered, exit out
|
||||
return
|
||||
} else if err != nil {
|
||||
if nErr, ok := err.(net.Error); ok && nErr.Timeout() {
|
||||
// RUnlock possibly failed with server timestamp mismatch, server may have restarted.
|
||||
return
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if err = c.Call("Dsync.Unlock", &LockArgs{Name: name}, &status); err == nil {
|
||||
// Unlock delivered, exit out
|
||||
return
|
||||
} else if err != nil {
|
||||
if nErr, ok := err.(net.Error); ok && nErr.Timeout() {
|
||||
// Unlock possibly failed with server timestamp mismatch, server may have restarted.
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
11
vendor/github.com/minio/dsync/rpc-client-interface.go
generated
vendored
11
vendor/github.com/minio/dsync/rpc-client-interface.go
generated
vendored
@@ -18,12 +18,11 @@ package dsync
|
||||
|
||||
import "time"
|
||||
|
||||
type TokenSetter interface {
|
||||
SetToken(token string)
|
||||
SetTimestamp(tstamp time.Time)
|
||||
}
|
||||
|
||||
// RPC - is dsync compatible client interface.
|
||||
type RPC interface {
|
||||
Call(serviceMethod string, args TokenSetter, reply interface{}) error
|
||||
Call(serviceMethod string, args interface {
|
||||
SetToken(token string)
|
||||
SetTimestamp(tstamp time.Time)
|
||||
}, reply interface{}) error
|
||||
Close() error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user