Skip to content

Commit ecc5f4e

Browse files
committed
session_rpcserver: include account ID in Session proto
1 parent 0ed84a3 commit ecc5f4e

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"
@@ -1473,6 +1474,11 @@ func (s *sessionRpcServer) marshalRPCSession(sess *session.Session) (
14731474
}
14741475
}
14751476

1477+
var accountID string
1478+
sess.AccountID.WhenSome(func(id accounts.AccountID) {
1479+
accountID = hex.EncodeToString(id[:])
1480+
})
1481+
14761482
return &litrpc.Session{
14771483
Id: sess.ID[:],
14781484
Label: sess.Label,
@@ -1492,6 +1498,7 @@ func (s *sessionRpcServer) marshalRPCSession(sess *session.Session) (
14921498
GroupId: sess.GroupID[:],
14931499
FeatureConfigs: clientConfig,
14941500
PrivacyFlags: sess.PrivacyFlags.Serialize(),
1501+
AccountId: accountID,
14951502
}, nil
14961503
}
14971504

0 commit comments

Comments
 (0)