Documentation ¶
Index ¶
- Constants
- Variables
- func AddTenantToContext(ctx context.Context, tenant *database.Tenant) context.Context
- func AdminPermissions() []bakery.Op
- func GetPermissions(isTenant bool, permissions []*boltzrpc.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{ "/boltzrpc.Boltz/GetInfo": {{ Entity: "info", Action: "read", }}, "/boltzrpc.Boltz/GetServiceInfo": {{ Entity: "info", Action: "read", }}, "/boltzrpc.Boltz/GetPairInfo": {{ Entity: "info", Action: "read", }}, "/boltzrpc.Boltz/GetPairs": {{ Entity: "info", Action: "read", }}, "/boltzrpc.Boltz/ListSwaps": {{ Entity: "swap", Action: "read", }}, "/boltzrpc.Boltz/GetStats": {{ Entity: "swap", Action: "read", }}, "/boltzrpc.Boltz/GetSwapInfo": {{ Entity: "swap", Action: "read", }}, "/boltzrpc.Boltz/GetSwapInfoStream": {{ Entity: "swap", Action: "read", }}, "/boltzrpc.Boltz/Deposit": {{ Entity: "swap", Action: "write", }}, "/boltzrpc.Boltz/CreateSwap": {{ Entity: "swap", Action: "write", }}, "/boltzrpc.Boltz/CreateChainSwap": {{ Entity: "swap", Action: "write", }}, "/boltzrpc.Boltz/RefundSwap": {{ Entity: "swap", Action: "write", }}, "/boltzrpc.Boltz/ClaimSwaps": {{ Entity: "swap", Action: "write", }}, "/boltzrpc.Boltz/CreateChannel": {{ Entity: "swap", Action: "write", }}, "/boltzrpc.Boltz/CreateReverseSwap": {{ Entity: "swap", Action: "write", }}, "/boltzrpc.Boltz/CreateWallet": {{ Entity: "wallet", Action: "write", }}, "/boltzrpc.Boltz/ImportWallet": {{ Entity: "wallet", Action: "write", }}, "/boltzrpc.Boltz/SetSubaccount": {{ Entity: "wallet", Action: "write", }}, "/boltzrpc.Boltz/GetSubaccounts": {{ Entity: "wallet", Action: "read", }}, "/boltzrpc.Boltz/GetWalletSendFee": {{ Entity: "wallet", Action: "read", }}, "/boltzrpc.Boltz/RemoveWallet": {{ Entity: "wallet", Action: "write", }}, "/boltzrpc.Boltz/WalletSend": {{ Entity: "wallet", Action: "write", }}, "/boltzrpc.Boltz/WalletReceive": {{ Entity: "wallet", Action: "read", }}, "/boltzrpc.Boltz/GetWalletCredentials": {{ Entity: "wallet", Action: "write", }}, "/boltzrpc.Boltz/GetWallets": {{ Entity: "wallet", Action: "read", }}, "/boltzrpc.Boltz/ListWalletTransactions": {{ Entity: "wallet", Action: "read", }}, "/boltzrpc.Boltz/GetWallet": {{ Entity: "wallet", Action: "read", }}, "/boltzrpc.Boltz/Stop": {{ Entity: "admin", Action: "write", }}, "/boltzrpc.Boltz/Unlock": {{ Entity: "admin", Action: "write", }}, "/boltzrpc.Boltz/ChangeWalletPassword": {{ Entity: "admin", Action: "write", }}, "/boltzrpc.Boltz/VerifyWalletPassword": {{ Entity: "admin", Action: "read", }}, "/boltzrpc.Boltz/CreateTenant": {{ Entity: "admin", Action: "write", }}, "/boltzrpc.Boltz/ListTenants": {{ Entity: "admin", Action: "read", }}, "/boltzrpc.Boltz/GetTenant": {{ Entity: "admin", Action: "read", }}, "/boltzrpc.Boltz/BakeMacaroon": {{ 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 []*boltzrpc.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.