Browse Source
Merge pull request #1329 from bingoohuang/master
fix build error
pull/1341/head
Chris Lu
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
3 additions and
4 deletions
-
unmaintained/volume_tailer/volume_tailer.go
-
weed/security/guard.go
-
weed/server/master_server.go
|
|
@ -9,7 +9,6 @@ import ( |
|
|
|
"github.com/chrislusf/seaweedfs/weed/security" |
|
|
|
"github.com/chrislusf/seaweedfs/weed/storage/needle" |
|
|
|
util2 "github.com/chrislusf/seaweedfs/weed/util" |
|
|
|
"github.com/spf13/viper" |
|
|
|
"golang.org/x/tools/godoc/util" |
|
|
|
) |
|
|
|
|
|
|
@ -25,7 +24,7 @@ func main() { |
|
|
|
flag.Parse() |
|
|
|
|
|
|
|
util2.LoadConfiguration("security", false) |
|
|
|
grpcDialOption := security.LoadClientTLS(util.GetViper(), "grpc.client") |
|
|
|
grpcDialOption := security.LoadClientTLS(util2.GetViper(), "grpc.client") |
|
|
|
|
|
|
|
vid := needle.VolumeId(*volumeId) |
|
|
|
|
|
|
|
|
|
@ -62,7 +62,7 @@ func NewGuard(whiteList []string, signingKey string, expiresAfterSec int, readSi |
|
|
|
return g |
|
|
|
} |
|
|
|
|
|
|
|
func (g *Guard) WhiteList(f func(w http.ResponseWriter, r *http.Request)) func(w http.ResponseWriter, r *http.Request) { |
|
|
|
func (g *Guard) WhiteList(f http.HandlerFunc) http.HandlerFunc { |
|
|
|
if !g.isWriteActive { |
|
|
|
//if no security needed, just skip all checking
|
|
|
|
return f |
|
|
|
|
|
@ -156,7 +156,7 @@ func (ms *MasterServer) SetRaftServer(raftServer *RaftServer) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func (ms *MasterServer) proxyToLeader(f func(w http.ResponseWriter, r *http.Request)) func(w http.ResponseWriter, r *http.Request) { |
|
|
|
func (ms *MasterServer) proxyToLeader(f http.HandlerFunc) http.HandlerFunc { |
|
|
|
return func(w http.ResponseWriter, r *http.Request) { |
|
|
|
if ms.Topo.IsLeader() { |
|
|
|
f(w, r) |
|
|
|