Skip to content

Commit d1b0cf8

Browse files
committed
session_rpcserver: include account ID in Session proto
1 parent a752204 commit d1b0cf8

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"
@@ -1502,6 +1503,11 @@ func (s *sessionRpcServer) marshalRPCSession(sess *session.Session) (
15021503
}
15031504
}
15041505

1506+
var accountID string
1507+
sess.AccountID.WhenSome(func(id accounts.AccountID) {
1508+
accountID = hex.EncodeToString(id[:])
1509+
})
1510+
15051511
return &litrpc.Session{
15061512
Id: sess.ID[:],
15071513
Label: sess.Label,
@@ -1521,6 +1527,7 @@ func (s *sessionRpcServer) marshalRPCSession(sess *session.Session) (
15211527
GroupId: sess.GroupID[:],
15221528
FeatureConfigs: clientConfig,
15231529
PrivacyFlags: sess.PrivacyFlags.Serialize(),
1530+
AccountId: accountID,
15241531
}, nil
15251532
}
15261533

0 commit comments

Comments
 (0)