ipfs-cluster/rpc_policy.go
Kishan Sagathiya 30fd5ee6a0 Feat: Allow and run multiple informer components (#962)
This introduces the possiblity of running Cluster with multiple informer components. The first one in the list is the used for "allocations". This is just groundwork for working with several informers in the future.
2019-12-05 15:08:43 +01:00

72 lines
3.1 KiB
Go

package ipfscluster
// This file can be generated with rpcutil/policygen.
// DefaultRPCPolicy associates all rpc endpoints offered by cluster peers to an
// endpoint type. See rpcutil/policygen.go as a quick way to generate this
// without missing any endpoint.
var DefaultRPCPolicy = map[string]RPCEndpointType{
// Cluster methods
"Cluster.BlockAllocate": RPCClosed,
"Cluster.ConnectGraph": RPCClosed,
"Cluster.ID": RPCOpen,
"Cluster.Join": RPCClosed,
"Cluster.PeerAdd": RPCOpen, // Used by Join()
"Cluster.PeerRemove": RPCTrusted,
"Cluster.Peers": RPCTrusted, // Used by ConnectGraph()
"Cluster.Pin": RPCClosed,
"Cluster.PinGet": RPCClosed,
"Cluster.PinPath": RPCClosed,
"Cluster.Pins": RPCClosed, // Used in stateless tracker, ipfsproxy, restapi
"Cluster.Recover": RPCClosed,
"Cluster.RecoverAll": RPCClosed,
"Cluster.RecoverAllLocal": RPCTrusted,
"Cluster.RecoverLocal": RPCTrusted,
"Cluster.RepoGC": RPCClosed,
"Cluster.RepoGCLocal": RPCTrusted,
"Cluster.SendInformerMetric": RPCClosed,
"Cluster.SendInformersMetrics": RPCClosed,
"Cluster.Status": RPCClosed,
"Cluster.StatusAll": RPCClosed,
"Cluster.StatusAllLocal": RPCClosed,
"Cluster.StatusLocal": RPCClosed,
"Cluster.Sync": RPCClosed,
"Cluster.SyncAll": RPCClosed,
"Cluster.SyncAllLocal": RPCTrusted, // Called in broadcast from SyncAll()
"Cluster.SyncLocal": RPCTrusted, // Called in broadcast from Sync()
"Cluster.Unpin": RPCClosed,
"Cluster.UnpinPath": RPCClosed,
"Cluster.Version": RPCOpen,
// PinTracker methods
"PinTracker.Recover": RPCTrusted, // Called in broadcast from Recover()
"PinTracker.RecoverAll": RPCClosed, // Broadcast in RecoverAll unimplemented
"PinTracker.Status": RPCTrusted,
"PinTracker.StatusAll": RPCTrusted,
"PinTracker.Track": RPCClosed,
"PinTracker.Untrack": RPCClosed,
// IPFSConnector methods
"IPFSConnector.BlockGet": RPCClosed,
"IPFSConnector.BlockPut": RPCTrusted, // Called from Add()
"IPFSConnector.ConfigKey": RPCClosed,
"IPFSConnector.Pin": RPCClosed,
"IPFSConnector.PinLs": RPCClosed,
"IPFSConnector.PinLsCid": RPCClosed,
"IPFSConnector.RepoStat": RPCTrusted, // Called in broadcast from proxy/repo/stat
"IPFSConnector.Resolve": RPCClosed,
"IPFSConnector.SwarmPeers": RPCTrusted, // Called in ConnectGraph
"IPFSConnector.Unpin": RPCClosed,
// Consensus methods
"Consensus.AddPeer": RPCTrusted, // Called by Raft/redirect to leader
"Consensus.LogPin": RPCTrusted, // Called by Raft/redirect to leader
"Consensus.LogUnpin": RPCTrusted, // Called by Raft/redirect to leader
"Consensus.Peers": RPCClosed,
"Consensus.RmPeer": RPCTrusted, // Called by Raft/redirect to leader
// PeerMonitor methods
"PeerMonitor.LatestMetrics": RPCClosed,
"PeerMonitor.MetricNames": RPCClosed,
}