MCPcopy Index your code
hub / github.com/ContainerSSH/ContainerSSH / OnRequest

Method OnRequest

internal/auth/handler_impl.go:107–134  ·  view source on GitHub ↗
(request http.ServerRequest, response http.ServerResponse)

Source from the content-addressed store, hash-verified

105}
106
107func (p *pubKeyHandler) OnRequest(request http.ServerRequest, response http.ServerResponse) error {
108 requestObject := auth.PublicKeyAuthRequest{}
109 if err := request.Decode(&requestObject); err != nil {
110 return err
111 }
112 success, meta, err := p.backend.OnPubKey(
113 requestObject.ConnectionAuthPendingMetadata,
114 requestObject.PublicKey,
115 )
116 if err != nil {
117 p.logger.Debug(message.Wrap(err, message.EAuthRequestDecodeFailed, "failed to execute public key request"))
118 response.SetStatus(500)
119 response.SetBody(
120 auth.ResponseBody{
121 ConnectionAuthenticatedMetadata: meta,
122 Success: false,
123 },
124 )
125 return nil
126 } else {
127 response.SetBody(
128 auth.ResponseBody{
129 ConnectionAuthenticatedMetadata: meta,
130 Success: success,
131 })
132 }
133 return nil
134}

Callers

nothing calls this directly

Calls 6

WrapFunction · 0.92
DecodeMethod · 0.65
OnPubKeyMethod · 0.65
DebugMethod · 0.65
SetStatusMethod · 0.65
SetBodyMethod · 0.65

Tested by

no test coverage detected