MCPcopy
hub / github.com/gliderlabs/ssh / Context

Interface Context

context.go:65–92  ·  view source on GitHub ↗

Context is a package specific context interface. It exposes connection metadata and allows new values to be easily written to it. It's used in authentication handlers and callbacks, and its underlying context.Context is exposed on Session in the session Handler. A connection-scoped lock is also embe

Source from the content-addressed store, hash-verified

63// exposed on Session in the session Handler. A connection-scoped lock is also
64// embedded in the context to make it easier to limit operations per-connection.
65type Context interface {
66 context.Context
67 sync.Locker
68
69 // User returns the username used when establishing the SSH connection.
70 User() string
71
72 // SessionID returns the session hash.
73 SessionID() string
74
75 // ClientVersion returns the version reported by the client.
76 ClientVersion() string
77
78 // ServerVersion returns the version reported by the server.
79 ServerVersion() string
80
81 // RemoteAddr returns the remote address for this connection.
82 RemoteAddr() net.Addr
83
84 // LocalAddr returns the local address for this connection.
85 LocalAddr() net.Addr
86
87 // Permissions returns the Permissions object used for this connection.
88 Permissions() *Permissions
89
90 // SetValue allows you to easily write new values into the underlying context.
91 SetValue(key, value interface{})
92}
93
94type sshContext struct {
95 context.Context

Callers 12

applyConnMetadataFunction · 0.65
applyConnMetadataFunction · 0.65
applyConnMetadataFunction · 0.65
applyConnMetadataFunction · 0.65
applyConnMetadataFunction · 0.65
applyConnMetadataFunction · 0.65
configMethod · 0.65
HandleConnMethod · 0.65
TestSetValueFunction · 0.65
TestSetValueConcurrencyFunction · 0.65
applyConnMetadataFunction · 0.65
SetAgentRequestedFunction · 0.65

Implementers 1

sshContextcontext.go

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…