Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pouch ¶
type Pouch map[TaprpcServiceMac]SerializedMacaroon
Pouch holds the set of macaroons we need to interact with tapd. Each sub-server has its own macaroon, and for the remaining temporary calls that directly hit tapd, we'll use the admin macaroon.
type SerializedMacaroon ¶
type SerializedMacaroon string
SerializedMacaroon is a type that represents a hex-encoded macaroon. We'll use this primarily vs the raw binary format as the gRPC metadata feature requires that all keys and values be strings.
func (SerializedMacaroon) WithMacaroonAuth ¶
func (s SerializedMacaroon) WithMacaroonAuth( ctx context.Context) context.Context
WithMacaroonAuth modifies the passed context to include the macaroon KV metadata of the target macaroon. This method can be used to add the macaroon at call time, rather than when the connection to the gRPC server is created.
type Source ¶
type Source interface {
// LoadPouch loads the full per-service Pouch represented by
// this source.
LoadPouch() (Pouch, error)
}
Source describes where the SDK should obtain authentication macaroons. Exactly one source is held by the caller's Config, so conflicting inputs cannot be expressed — the compiler enforces what runtime validation used to. Instances are obtained from FromPath, FromDir, or FromHex.
func FromDir ¶
FromDir returns a Source that loads one macaroon per service from the given directory, matching tapd's standard on-disk layout.
type TaprpcServiceMac ¶
type TaprpcServiceMac string
TaprpcServiceMac is the name of a macaroon that can be used to authenticate with a specific taprpc service.
const ( AdminServiceMac TaprpcServiceMac = "admin.macaroon" WalletKitServiceMac TaprpcServiceMac = "walletkit.macaroon" ProofServiceMac TaprpcServiceMac = "proof.macaroon" UniverseServiceMac TaprpcServiceMac = "universe.macaroon" MintServiceMac TaprpcServiceMac = "mint.macaroon" ReadOnlyServiceMac TaprpcServiceMac = "readonly.macaroon" )