Skip to content

Commit bfb3c7b

Browse files
committed
session_rpcserver: include account ID in Session proto
1 parent 8a34189 commit bfb3c7b

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"
@@ -1509,6 +1510,11 @@ func (s *sessionRpcServer) marshalRPCSession(sess *session.Session) (
15091510
}
15101511
}
15111512

1513+
var accountID string
1514+
sess.AccountID.WhenSome(func(id accounts.AccountID) {
1515+
accountID = hex.EncodeToString(id[:])
1516+
})
1517+
15121518
return &litrpc.Session{
15131519
Id: sess.ID[:],
15141520
Label: sess.Label,
@@ -1528,6 +1534,7 @@ func (s *sessionRpcServer) marshalRPCSession(sess *session.Session) (
15281534
GroupId: sess.GroupID[:],
15291535
FeatureConfigs: clientConfig,
15301536
PrivacyFlags: sess.PrivacyFlags.Serialize(),
1537+
AccountId: accountID,
15311538
}, nil
15321539
}
15331540

0 commit comments

Comments
 (0)