Add multihop auth support (#32)
This commit is contained in:
1 parent
8579a248d4
commit
ab4d542fad
10 files changed
+91
-13
No files matched your search
@@ -573,12 +573,24 @@ func handleNodes(c *Controller) http.Handler {
|
||||
}
|
||||
var err error
|
||||
var currVals vals
|
||||
currVals.WaitingNodes, err = c.NodeeFileStorage.List(c.baseContext, (*nodetypes.NodeInformation)(nil))
|
||||
waitingNodes, err := c.NodeeFileStorage.List(c.baseContext, (*nodetypes.NodeInformation)(nil))
|
||||
if err != nil {
|
||||
_, _ = w.Write([]byte(err.Error()))
|
||||
w.WriteHeader(500)
|
||||
return
|
||||
}
|
||||
for _, keyId := range waitingNodes {
|
||||
ni, err := nodetypes.LoadNodeInformation(c.baseContext, c.NodeeFileStorage, keyId)
|
||||
if err != nil {
|
||||
_, _ = w.Write([]byte(err.Error()))
|
||||
w.WriteHeader(500)
|
||||
return
|
||||
}
|
||||
if ni.Authorized {
|
||||
continue
|
||||
}
|
||||
currVals.WaitingNodes = append(currVals.WaitingNodes, keyId)
|
||||
}
|
||||
ret, err := json.Marshal(currVals)
|
||||
if err != nil {
|
||||
_, _ = w.Write([]byte(err.Error()))
|
||||
|
||||
Reference in new issue
Block a user