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

Method OnRequest

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

Source from the content-addressed store, hash-verified

38}
39
40func (p *authzHandler) OnRequest(request http.ServerRequest, response http.ServerResponse) error {
41 requestObject := auth.AuthorizationRequest{}
42 if err := request.Decode(&requestObject); err != nil {
43 return err
44 }
45 success, meta, err := p.backend.OnAuthorization(
46 requestObject.ConnectionAuthenticatedMetadata,
47 )
48 if err != nil {
49 p.logger.Debug(message.Wrap(err, message.EAuthRequestDecodeFailed, "failed to execute authorization request"))
50 response.SetStatus(500)
51 response.SetBody(
52 auth.ResponseBody{
53 ConnectionAuthenticatedMetadata: requestObject.ConnectionAuthenticatedMetadata,
54 Success: false,
55 },
56 )
57 return nil
58 } else {
59 response.SetBody(
60 auth.ResponseBody{
61 ConnectionAuthenticatedMetadata: meta,
62 Success: success,
63 })
64 }
65 return nil
66}
67
68type passwordHandler struct {
69 backend Handler

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected