Skip to content

Commit 66b8330

Browse files
committed
session_rpcserver: include account ID in Session proto
1 parent 57931e6 commit 66b8330

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

itest/litd_accounts_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ func testAccountRestrictionsLNC(ctxm context.Context, t *harnessTest,
199199
AccountId: accountID,
200200
})
201201
require.NoError(t.t, err)
202+
require.Equal(t.t, accountID, sessResp.Session.AccountId)
202203

203204
// Try the LNC connection now.
204205
connectPhrase := strings.Split(

session_rpcserver.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package terminal
22

33
import (
44
"context"
5+
"encoding/hex"
56
"encoding/json"
67
"errors"
78
"fmt"
@@ -1504,6 +1505,11 @@ func (s *sessionRpcServer) marshalRPCSession(sess *session.Session) (
15041505
}
15051506
}
15061507

1508+
var accountID string
1509+
sess.AccountID.WhenSome(func(id accounts.AccountID) {
1510+
accountID = hex.EncodeToString(id[:])
1511+
})
1512+
15071513
return &litrpc.Session{
15081514
Id: sess.ID[:],
15091515
Label: sess.Label,
@@ -1523,6 +1529,7 @@ func (s *sessionRpcServer) marshalRPCSession(sess *session.Session) (
15231529
GroupId: sess.GroupID[:],
15241530
FeatureConfigs: clientConfig,
15251531
PrivacyFlags: sess.PrivacyFlags.Serialize(),
1532+
AccountId: accountID,
15261533
}, nil
15271534
}
15281535

0 commit comments

Comments
 (0)