Documentation
¶
Index ¶
- Constants
- Variables
- func AddTenantToContext(ctx context.Context, tenant *database.Tenant) context.Context
- func AdminPermissions() []bakery.Op
- func GetPermissions(isTenant bool, permissions []*lightzrpc.MacaroonPermissions) (result []bakery.Op)
- func TenantFromContext(ctx context.Context) *database.Tenant
- func TenantIdFromContext(ctx context.Context) *database.Id
- type RootKeyStorage
- type Service
- func (service *Service) Init()
- func (service *Service) NewMacaroon(tenant *database.Id, ops ...bakery.Op) (*bakery.Macaroon, error)
- func (service *Service) StreamServerInterceptor() grpc.StreamServerInterceptor
- func (service *Service) UnaryServerInterceptor() grpc.UnaryServerInterceptor
- func (service *Service) ValidateMacaroon(macBytes []byte, requiredPermissions []bakery.Op) (*bakery.AuthInfo, error)
Constants ¶
View Source
const TenantAll = "all"
Variables ¶
View Source
var ( TenantReadPermissions = []bakery.Op{ { Entity: "info", Action: "read", }, { Entity: "swap", Action: "read", }, { Entity: "wallet", Action: "read", }, { Entity: "autoswap", Action: "read", }, } TenantWritePermissons = []bakery.Op{ { Entity: "info", Action: "write", }, { Entity: "swap", Action: "write", }, { Entity: "wallet", Action: "write", }, { Entity: "autoswap", Action: "write", }, } ReadPermissions = append([]bakery.Op{ { Entity: "admin", Action: "read", }, }, TenantReadPermissions...) WritePermissions = append([]bakery.Op{ { Entity: "admin", Action: "write", }, }, TenantWritePermissons...) RPCServerPermissions = map[string][]bakery.Op{ "/lightzrpc.Lightz/GetInfo": {{ Entity: "info", Action: "read", }}, "/lightzrpc.Lightz/GetServiceInfo": {{ Entity: "info", Action: "read", }}, "/lightzrpc.Lightz/GetPairInfo": {{ Entity: "info", Action: "read", }}, "/lightzrpc.Lightz/GetPairs": {{ Entity: "info", Action: "read", }}, "/lightzrpc.Lightz/ListSwaps": {{ Entity: "swap", Action: "read", }}, "/lightzrpc.Lightz/GetStats": {{ Entity: "swap", Action: "read", }}, "/lightzrpc.Lightz/GetSwapInfo": {{ Entity: "swap", Action: "read", }}, "/lightzrpc.Lightz/GetSwapInfoStream": {{ Entity: "swap", Action: "read", }}, "/lightzrpc.Lightz/Deposit": {{ Entity: "swap", Action: "write", }}, "/lightzrpc.Lightz/CreateSwap": {{ Entity: "swap", Action: "write", }}, "/lightzrpc.Lightz/CreateChainSwap": {{ Entity: "swap", Action: "write", }}, "/lightzrpc.Lightz/RefundSwap": {{ Entity: "swap", Action: "write", }}, "/lightzrpc.Lightz/ClaimSwaps": {{ Entity: "swap", Action: "write", }}, "/lightzrpc.Lightz/CreateChannel": {{ Entity: "swap", Action: "write", }}, "/lightzrpc.Lightz/CreateReverseSwap": {{ Entity: "swap", Action: "write", }}, "/lightzrpc.Lightz/CreateWallet": {{ Entity: "wallet", Action: "write", }}, "/lightzrpc.Lightz/ImportWallet": {{ Entity: "wallet", Action: "write", }}, "/lightzrpc.Lightz/SetSubaccount": {{ Entity: "wallet", Action: "write", }}, "/lightzrpc.Lightz/GetSubaccounts": {{ Entity: "wallet", Action: "read", }}, "/lightzrpc.Lightz/GetWalletSendFee": {{ Entity: "wallet", Action: "read", }}, "/lightzrpc.Lightz/RemoveWallet": {{ Entity: "wallet", Action: "write", }}, "/lightzrpc.Lightz/WalletSend": {{ Entity: "wallet", Action: "write", }}, "/lightzrpc.Lightz/WalletReceive": {{ Entity: "wallet", Action: "read", }}, "/lightzrpc.Lightz/GetWalletCredentials": {{ Entity: "wallet", Action: "write", }}, "/lightzrpc.Lightz/GetWallets": {{ Entity: "wallet", Action: "read", }}, "/lightzrpc.Lightz/ListWalletTransactions": {{ Entity: "wallet", Action: "read", }}, "/lightzrpc.Lightz/BumpTransaction": {{ Entity: "wallet", Action: "write", }}, "/lightzrpc.Lightz/GetWallet": {{ Entity: "wallet", Action: "read", }}, "/lightzrpc.Lightz/Stop": {{ Entity: "admin", Action: "write", }}, "/lightzrpc.Lightz/Unlock": {{ Entity: "admin", Action: "write", }}, "/lightzrpc.Lightz/ChangeWalletPassword": {{ Entity: "admin", Action: "write", }}, "/lightzrpc.Lightz/VerifyWalletPassword": {{ Entity: "admin", Action: "read", }}, "/lightzrpc.Lightz/CreateTenant": {{ Entity: "admin", Action: "write", }}, "/lightzrpc.Lightz/ListTenants": {{ Entity: "admin", Action: "read", }}, "/lightzrpc.Lightz/GetTenant": {{ Entity: "admin", Action: "read", }}, "/lightzrpc.Lightz/RemoveTenant": {{ Entity: "admin", Action: "write", }}, "/lightzrpc.Lightz/BakeMacaroon": {{ Entity: "admin", Action: "write", }}, "/lightzrpc.Lightz/GetSwapMnemonic": {{ Entity: "admin", Action: "read", }}, "/lightzrpc.Lightz/SetSwapMnemonic": {{ Entity: "admin", Action: "write", }}, "/autoswaprpc.AutoSwap/GetRecommendations": {{ Entity: "autoswap", Action: "read", }}, "/autoswaprpc.AutoSwap/ExecuteRecommendations": {{ Entity: "autoswap", Action: "write", }}, "/autoswaprpc.AutoSwap/GetStatus": {{ Entity: "autoswap", Action: "read", }}, "/autoswaprpc.AutoSwap/GetConfig": {{ Entity: "autoswap", Action: "read", }}, "/autoswaprpc.AutoSwap/ReloadConfig": {{ Entity: "autoswap", Action: "write", }}, "/autoswaprpc.AutoSwap/UpdateChainConfig": {{ Entity: "autoswap", Action: "write", }}, "/autoswaprpc.AutoSwap/UpdateLightningConfig": {{ Entity: "autoswap", Action: "write", }}, } )
Functions ¶
func AddTenantToContext ¶
func AdminPermissions ¶
func GetPermissions ¶
func GetPermissions(isTenant bool, permissions []*lightzrpc.MacaroonPermissions) (result []bakery.Op)
Types ¶
type RootKeyStorage ¶
type RootKeyStorage struct {
// contains filtered or unexported fields
}
type Service ¶
func (*Service) NewMacaroon ¶
func (*Service) StreamServerInterceptor ¶
func (service *Service) StreamServerInterceptor() grpc.StreamServerInterceptor
func (*Service) UnaryServerInterceptor ¶
func (service *Service) UnaryServerInterceptor() grpc.UnaryServerInterceptor
Click to show internal directories.
Click to hide internal directories.