macaroons

package
v1.2.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ReadPermissions = []bakery.Op{
		{
			Entity: "info",
			Action: "read",
		},
		{
			Entity: "swap",
			Action: "read",
		},
	}

	WritePermissions = []bakery.Op{
		{
			Entity: "info",
			Action: "write",
		},
		{
			Entity: "swap",
			Action: "write",
		},
	}

	RPCServerPermissions = map[string][]bakery.Op{
		"/boltzrpc.Boltz/GetInfo": {{
			Entity: "info",
			Action: "read",
		}},
		"/boltzrpc.Boltz/GetServiceInfo": {{
			Entity: "info",
			Action: "read",
		}},
		"/boltzrpc.Boltz/ListSwaps": {{
			Entity: "swap",
			Action: "read",
		}},
		"/boltzrpc.Boltz/GetSwapInfo": {{
			Entity: "swap",
			Action: "read",
		}},
		"/boltzrpc.Boltz/Deposit": {{
			Entity: "swap",
			Action: "write",
		}},
		"/boltzrpc.Boltz/CreateSwap": {{
			Entity: "swap",
			Action: "write",
		}},
		"/boltzrpc.Boltz/CreateChannel": {{
			Entity: "swap",
			Action: "write",
		}},
		"/boltzrpc.Boltz/CreateReverseSwap": {{
			Entity: "swap",
			Action: "write",
		}},
	}
)

Functions

func AdminPermissions

func AdminPermissions() []bakery.Op

Types

type RootKeyStorage

type RootKeyStorage struct {
	// contains filtered or unexported fields
}

func (*RootKeyStorage) Get

func (storage *RootKeyStorage) Get(_ context.Context, id []byte) ([]byte, error)

func (*RootKeyStorage) RootKey

func (storage *RootKeyStorage) RootKey(ctx context.Context) ([]byte, []byte, error)

type Service

type Service struct {
	Database *database.Database
	// contains filtered or unexported fields
}

func (*Service) Init

func (service *Service) Init()

func (*Service) NewMacaroon

func (service *Service) NewMacaroon(ops ...bakery.Op) (*bakery.Macaroon, error)

func (*Service) StreamServerInterceptor

func (service *Service) StreamServerInterceptor() grpc.StreamServerInterceptor

func (*Service) UnaryServerInterceptor

func (service *Service) UnaryServerInterceptor() grpc.UnaryServerInterceptor

func (*Service) ValidateMacaroon

func (service *Service) ValidateMacaroon(ctx context.Context, requiredPermissions []bakery.Op) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL