MCPcopy
hub / github.com/gitpod-io/gitpod / TrackSSHConnection

Method TrackSSHConnection

components/ws-proxy/pkg/sshproxy/server.go:336–357  ·  view source on GitHub ↗
(wsInfo *p.WorkspaceInfo, phase string, err error)

Source from the content-addressed store, hash-verified

334}
335
336func (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
359func (s *Server) VerifyPublicKey(ctx context.Context, wsInfo *p.WorkspaceInfo, pk ssh.PublicKey) (bool, error) {
360 for _, keyStr := range wsInfo.SSHPublicKeys {

Callers 2

NewFunction · 0.95
HandleConnMethod · 0.95

Calls 2

TrackMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected