mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-16 13:00:37 +02:00
multi: expose l402 id in grpc interface
This commit adds an additional field to the tokens in order to fetch the relevant l402 ids for the users tokens.
This commit is contained in:
parent
eaad220800
commit
ca032b1f1d
5 changed files with 36 additions and 10 deletions
|
|
@ -1,13 +1,11 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/lightninglabs/aperture/lsat"
|
||||
"github.com/lightninglabs/loop/looprpc"
|
||||
"github.com/urfave/cli"
|
||||
"gopkg.in/macaroon.v2"
|
||||
|
|
@ -55,13 +53,9 @@ func listAuth(ctx *cli.Context) error {
|
|||
return fmt.Errorf("unable to unmarshal macaroon: %v",
|
||||
err)
|
||||
}
|
||||
id, err := lsat.DecodeIdentifier(bytes.NewReader(mac.Id()))
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to decode macaroon ID: %v",
|
||||
err)
|
||||
}
|
||||
|
||||
tokens[i] = &printableToken{
|
||||
ID: hex.EncodeToString(id.TokenID[:]),
|
||||
ID: t.Id,
|
||||
ValidUntil: "",
|
||||
BaseMacaroon: hex.EncodeToString(t.BaseMacaroon),
|
||||
PaymentHash: hex.EncodeToString(t.PaymentHash),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue