Skip to content

Commit 021daae

Browse files
committed
session_rpcserver: include account ID in Session proto
1 parent 1b2f18c commit 021daae

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"
@@ -1499,6 +1500,11 @@ func (s *sessionRpcServer) marshalRPCSession(sess *session.Session) (
14991500
}
15001501
}
15011502

1503+
var accountID string
1504+
sess.AccountID.WhenSome(func(id accounts.AccountID) {
1505+
accountID = hex.EncodeToString(id[:])
1506+
})
1507+
15021508
return &litrpc.Session{
15031509
Id: sess.ID[:],
15041510
Label: sess.Label,
@@ -1518,6 +1524,7 @@ func (s *sessionRpcServer) marshalRPCSession(sess *session.Session) (
15181524
GroupId: sess.GroupID[:],
15191525
FeatureConfigs: clientConfig,
15201526
PrivacyFlags: sess.PrivacyFlags.Serialize(),
1527+
AccountId: accountID,
15211528
}, nil
15221529
}
15231530

0 commit comments

Comments
 (0)