Documentation
¶
Index ¶
- Variables
- type Manager
- func (pm *Manager) ActivePermissions(readOnly bool) []bakery.Op
- func (pm *Manager) GetLitPerms() map[string][]bakery.Op
- func (pm *Manager) IsFaradayURI(uri string) bool
- func (pm *Manager) IsLitURI(uri string) bool
- func (pm *Manager) IsLndURI(uri string) bool
- func (pm *Manager) IsLoopURI(uri string) bool
- func (pm *Manager) IsPoolURI(uri string) bool
- func (pm *Manager) MatchRegexURI(uriRegex string) ([]string, bool)
- func (pm *Manager) OnLNDBuildTags(lndBuildTags []string)
- func (pm *Manager) URIPermissions(uri string) ([]bakery.Op, bool)
Constants ¶
This section is empty.
Variables ¶
var ( // LitPermissions is a map of all LiT RPC methods and their required // macaroon permissions to access the session service. LitPermissions = map[string][]bakery.Op{ "/litrpc.Sessions/AddSession": {{ Entity: "sessions", Action: "write", }}, "/litrpc.Sessions/ListSessions": {{ Entity: "sessions", Action: "read", }}, "/litrpc.Sessions/RevokeSession": {{ Entity: "sessions", Action: "write", }}, } )
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages the permission lists that Lit requires.
func NewManager ¶
NewManager constructs a new Manager instance and collects any of the fixed permissions.
func (*Manager) ActivePermissions ¶
ActivePermissions returns all the available active permissions that the manager is aware of. Optionally, readOnly can be set to true if only the read-only permissions should be returned.
func (*Manager) GetLitPerms ¶
GetLitPerms returns a map of all permissions that the manager is aware of _except_ for any LND permissions. In other words, this returns permissions for which the external validator of Lit is responsible.
func (*Manager) IsFaradayURI ¶
IsFaradayURI returns true if the given URI belongs to an RPC of faraday.
func (*Manager) MatchRegexURI ¶
MatchRegexURI first checks that the given URI is in fact a regex. If it is, then it is used to match on the perms that the manager has. The return values are a list of URIs that match the regex and the boolean represents whether the given uri is in fact a regex.
func (*Manager) OnLNDBuildTags ¶
OnLNDBuildTags should be called once a list of LND build tags has been obtained. It then uses those build tags to decide which of the LND sub-server permissions to add to the main permissions list. This method should only be called once.