Skip to content

Commit

Permalink
corrected authorization for fetchContainerLogs
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan6sha committed Feb 10, 2024
1 parent 685fafe commit 1526bf7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion blockchain/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ func (bl *FxBlockchain) authorized(pid peer.ID, action string) bool {
return true
}
switch action {
case actionBloxFreeSpace, actionAccountFund, actionAssetsBalance, actionEraseBlData, actionWifiRemoveall, actionReboot, actionPartition, actionDeleteWifi, actionDisconnectWifi, actionDeleteFulaConfig, actionGetAccount, actionSeeded, actionAccountExists, actionPoolCreate, actionPoolJoin, actionPoolCancelJoin, actionPoolRequests, actionPoolList, actionPoolVote, actionPoolLeave, actionManifestUpload, actionManifestStore, actionManifestAvailable, actionManifestRemove, actionManifestRemoveStorer, actionManifestRemoveStored:
case actionBloxFreeSpace, actionAccountFund, actionAssetsBalance, actionFetchContainerLogs, actionEraseBlData, actionWifiRemoveall, actionReboot, actionPartition, actionDeleteWifi, actionDisconnectWifi, actionDeleteFulaConfig, actionGetAccount, actionSeeded, actionAccountExists, actionPoolCreate, actionPoolJoin, actionPoolCancelJoin, actionPoolRequests, actionPoolList, actionPoolVote, actionPoolLeave, actionManifestUpload, actionManifestStore, actionManifestAvailable, actionManifestRemove, actionManifestRemoveStorer, actionManifestRemoveStored:
bl.authorizedPeersLock.RLock()
_, ok := bl.authorizedPeers[pid]
bl.authorizedPeersLock.RUnlock()
Expand Down
2 changes: 1 addition & 1 deletion blockchain/blox.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ func (bl *FxBlockchain) handleFetchContainerLogs(ctx context.Context, from peer.
Msg: res,
}
}

log.Debugw("handleFetchContainerLogs response", "out", out)
w.WriteHeader(http.StatusOK)
if err := json.NewEncoder(w).Encode(out); err != nil {
log.Error("failed to write response: %v", err)
Expand Down

0 comments on commit 1526bf7

Please sign in to comment.