Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
xacrimon committed Mar 10, 2022
1 parent 24bff36 commit 0ef3d04
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/srv/sess.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ func NewSessionRegistry(srv Server, auth auth.ClientI) (*SessionRegistry, error)
}),
srv: srv,
sessions: make(map[rsession.ID]*session),
auth: auth,
}, nil
}

Expand Down Expand Up @@ -1716,9 +1717,12 @@ func (s *session) trackerCreate(teleportUser string, policySet []*types.SessionT

reason := s.scx.env[teleport.EnvSSHSessionReason]
var invited []string
err := json.Unmarshal([]byte(s.scx.env[teleport.EnvSSHSessionInvited]), &invited)
if err != nil {
return trace.Wrap(err)

if s.scx.env[teleport.EnvSSHSessionInvited] != "" {
err := json.Unmarshal([]byte(s.scx.env[teleport.EnvSSHSessionInvited]), &invited)
if err != nil {
return trace.Wrap(err)
}
}

req := &proto.CreateSessionTrackerRequest{
Expand All @@ -1737,7 +1741,7 @@ func (s *session) trackerCreate(teleportUser string, policySet []*types.SessionT
HostPolicies: policySet,
}

_, err = s.registry.auth.CreateSessionTracker(s.serverCtx, req)
_, err := s.registry.auth.CreateSessionTracker(s.serverCtx, req)
return trace.Wrap(err)
}

Expand Down

0 comments on commit 0ef3d04

Please sign in to comment.