rpcserver: export MainRPCServerPermissions

To be able to properly delegate requests to the correct component in LiT we
need to know all URIs of lnd and the other subservers.
This commit is contained in:
Oliver Gugger 2020-09-10 10:25:38 +02:00
parent 8988a01d7e
commit 061040c57b
No known key found for this signature in database
GPG Key ID: 8E4256593F177720

@ -213,9 +213,9 @@ func stringInSlice(a string, slice []string) bool {
return false
}
// mainRPCServerPermissions returns a mapping of the main RPC server calls to
// MainRPCServerPermissions returns a mapping of the main RPC server calls to
// the permissions they require.
func mainRPCServerPermissions() map[string][]bakery.Op {
func MainRPCServerPermissions() map[string][]bakery.Op {
return map[string][]bakery.Op{
"/lnrpc.Lightning/SendCoins": {{
Entity: "onchain",
@ -640,7 +640,7 @@ func newRPCServer(cfg *Config, s *server, macService *macaroons.Service,
// Next, we need to merge the set of sub server macaroon permissions
// with the main RPC server permissions so we can unite them under a
// single set of interceptors.
permissions := mainRPCServerPermissions()
permissions := MainRPCServerPermissions()
for _, subServerPerm := range subServerPerms {
for method, ops := range subServerPerm {
// For each new method:ops combo, we also ensure that