(wsInfo *p.WorkspaceInfo, phase string, err error)
| 334 | } |
| 335 | |
| 336 | func (s *Server) TrackSSHConnection(wsInfo *p.WorkspaceInfo, phase string, err error) { |
| 337 | // if we didn't find an associated user, we don't want to track |
| 338 | if wsInfo == nil { |
| 339 | return |
| 340 | } |
| 341 | propertics := make(map[string]interface{}) |
| 342 | propertics["workspaceId"] = wsInfo.WorkspaceID |
| 343 | propertics["instanceId"] = wsInfo.InstanceID |
| 344 | propertics["state"] = "success" |
| 345 | propertics["phase"] = phase |
| 346 | |
| 347 | if err != nil { |
| 348 | propertics["state"] = "failed" |
| 349 | propertics["cause"] = err.Error() |
| 350 | } |
| 351 | |
| 352 | tracker.Track(analytics.TrackMessage{ |
| 353 | Identity: analytics.Identity{UserID: wsInfo.OwnerUserId}, |
| 354 | Event: "ssh_connection", |
| 355 | Properties: propertics, |
| 356 | }) |
| 357 | } |
| 358 | |
| 359 | func (s *Server) VerifyPublicKey(ctx context.Context, wsInfo *p.WorkspaceInfo, pk ssh.PublicKey) (bool, error) { |
| 360 | for _, keyStr := range wsInfo.SSHPublicKeys { |
no test coverage detected