Skip to content

Commit d3cab70

Browse files
committed
cmd/litcli: create account sessions
Create LNC account sessions through litcli
1 parent 6a5a8c6 commit d3cab70

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

cmd/litcli/sessions.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ var addSessionCommand = cli.Command{
6969
Usage: "session type to be created which will " +
7070
"determine the permissions a user has when " +
7171
"connecting with the session. Options " +
72-
"include readonly|admin|custom",
72+
"include readonly|admin|account|custom",
7373
Value: "readonly",
7474
},
7575
cli.StringSliceFlag{
@@ -85,6 +85,13 @@ var addSessionCommand = cli.Command{
8585
"For example, '/lnrpc\\..*' will result in " +
8686
"all `lnrpc` permissions being included.",
8787
},
88+
cli.StringFlag{
89+
Name: "account_id",
90+
Usage: "The account id that should be used for " +
91+
"the account session. Note that this flag " +
92+
"will only be used if the 'type' flag is " +
93+
"set to 'account'.",
94+
},
8895
},
8996
}
9097

@@ -122,6 +129,7 @@ func addSession(ctx *cli.Context) error {
122129
MailboxServerAddr: ctx.String("mailboxserveraddr"),
123130
DevServer: ctx.Bool("devserver"),
124131
MacaroonCustomPermissions: macPerms,
132+
AccountId: ctx.String("account_id"),
125133
},
126134
)
127135
if err != nil {
@@ -139,6 +147,8 @@ func parseSessionType(sessionType string) (litrpc.SessionType, error) {
139147
return litrpc.SessionType_TYPE_MACAROON_ADMIN, nil
140148
case "readonly":
141149
return litrpc.SessionType_TYPE_MACAROON_READONLY, nil
150+
case "account":
151+
return litrpc.SessionType_TYPE_MACAROON_ACCOUNT, nil
142152
case "custom":
143153
return litrpc.SessionType_TYPE_MACAROON_CUSTOM, nil
144154
default:

0 commit comments

Comments
 (0)