mirror of
https://github.com/lightninglabs/loop
synced 2024-11-09 19:10:47 +00:00
5a1f79557d
This is needed not to break existing client binaries, e.g. `loop listauth`, Terminal Web, RTL. The API should be removed in a couple of releases. For now, GetLsatTokens just prints a warning message about the API being deprecated and that the client binary should be updated, and calls GetL402Tokens API, as a wrapper. Type LsatToken used by GetLsatTokens in the past was renamed to L402Token, but this does not affect binary encoding, so type L402Token can be used (as part of TokensResponse) without breaking backward compatibility. Updated release_notes.md. See https://github.com/lightninglabs/loop/pull/730#discussion_r1579251294
120 lines
2.3 KiB
Go
120 lines
2.3 KiB
Go
package perms
|
|
|
|
import "gopkg.in/macaroon-bakery.v2/bakery"
|
|
|
|
// RequiredPermissions is a map of all loop RPC methods and their
|
|
// required macaroon permissions to access loopd.
|
|
var RequiredPermissions = map[string][]bakery.Op{
|
|
"/looprpc.SwapClient/LoopOut": {{
|
|
Entity: "swap",
|
|
Action: "execute",
|
|
}, {
|
|
Entity: "loop",
|
|
Action: "out",
|
|
}},
|
|
"/looprpc.SwapClient/LoopIn": {{
|
|
Entity: "swap",
|
|
Action: "execute",
|
|
}, {
|
|
Entity: "loop",
|
|
Action: "in",
|
|
}},
|
|
"/looprpc.SwapClient/Monitor": {{
|
|
Entity: "swap",
|
|
Action: "read",
|
|
}},
|
|
"/looprpc.SwapClient/ListSwaps": {{
|
|
Entity: "swap",
|
|
Action: "read",
|
|
}},
|
|
"/looprpc.SwapClient/SwapInfo": {{
|
|
Entity: "swap",
|
|
Action: "read",
|
|
}},
|
|
"/looprpc.SwapClient/AbandonSwap": {{
|
|
Entity: "swap",
|
|
Action: "execute",
|
|
}, {
|
|
Entity: "loop",
|
|
Action: "in",
|
|
}, {
|
|
Entity: "loop",
|
|
Action: "out",
|
|
}},
|
|
"/looprpc.SwapClient/LoopOutTerms": {{
|
|
Entity: "terms",
|
|
Action: "read",
|
|
}, {
|
|
Entity: "loop",
|
|
Action: "out",
|
|
}},
|
|
"/looprpc.SwapClient/LoopOutQuote": {{
|
|
Entity: "swap",
|
|
Action: "read",
|
|
}, {
|
|
Entity: "loop",
|
|
Action: "out",
|
|
}},
|
|
"/looprpc.SwapClient/GetLoopInTerms": {{
|
|
Entity: "terms",
|
|
Action: "read",
|
|
}, {
|
|
Entity: "loop",
|
|
Action: "in",
|
|
}},
|
|
"/looprpc.SwapClient/GetLoopInQuote": {{
|
|
Entity: "swap",
|
|
Action: "read",
|
|
}, {
|
|
Entity: "loop",
|
|
Action: "in",
|
|
}},
|
|
"/looprpc.SwapClient/GetL402Tokens": {{
|
|
Entity: "auth",
|
|
Action: "read",
|
|
}},
|
|
"/looprpc.SwapClient/GetLsatTokens": {{
|
|
Entity: "auth",
|
|
Action: "read",
|
|
}},
|
|
"/looprpc.SwapClient/SuggestSwaps": {{
|
|
Entity: "suggestions",
|
|
Action: "read",
|
|
}},
|
|
"/looprpc.SwapClient/GetInfo": {{
|
|
Entity: "suggestions",
|
|
Action: "read",
|
|
}},
|
|
"/looprpc.SwapClient/GetLiquidityParams": {{
|
|
Entity: "suggestions",
|
|
Action: "read",
|
|
}},
|
|
"/looprpc.SwapClient/SetLiquidityParams": {{
|
|
Entity: "suggestions",
|
|
Action: "write",
|
|
}},
|
|
"/looprpc.SwapClient/Probe": {{
|
|
Entity: "swap",
|
|
Action: "execute",
|
|
}, {
|
|
Entity: "loop",
|
|
Action: "in",
|
|
}},
|
|
"/looprpc.SwapClient/ListReservations": {{
|
|
Entity: "swap",
|
|
Action: "read",
|
|
}},
|
|
"/looprpc.SwapClient/InstantOut": {{
|
|
Entity: "swap",
|
|
Action: "execute",
|
|
}},
|
|
"/looprpc.SwapClient/InstantOutQuote": {{
|
|
Entity: "swap",
|
|
Action: "read",
|
|
}},
|
|
"/looprpc.SwapClient/ListInstantOuts": {{
|
|
Entity: "swap",
|
|
Action: "read",
|
|
}},
|
|
}
|