first move of working dir

This commit is contained in:
Boshi Lian 2022-07-04 15:55:06 +00:00
parent 54d1f08ade
commit fd0a0c628e
5 changed files with 133 additions and 28 deletions

View file

@ -49,7 +49,7 @@ type SshPiperPluginConfig struct {
KeyboardInteractiveCallback func(conn ConnMetadata, client KeyboardInteractiveChallenge) (*Upstream, error)
UpstreamAuthFailureCallback func(conn ConnMetadata, method string, err error)
UpstreamAuthFailureCallback func(conn ConnMetadata, method string, err error, allowmethods []string)
BannerCallback func(conn ConnMetadata) string
@ -341,7 +341,17 @@ func (s *server) UpstreamAuthFailureNotice(ctx context.Context, req *UpstreamAut
return nil, status.Errorf(codes.Unimplemented, "method UpstreamAuthFailureNotice not implemented")
}
s.config.UpstreamAuthFailureCallback(req.Meta, req.Method, fmt.Errorf(req.Error))
var methods []string
for _, method := range req.GetAllowedMethods() {
m := AuthMethodTypeToName(method)
if m == "" {
continue
}
methods = append(methods, m)
}
s.config.UpstreamAuthFailureCallback(req.Meta, req.Method, fmt.Errorf(req.Error), methods)
return &UpstreamAuthFailureNoticeResponse{}, nil
}