Update dependencies (#5518)
This commit is contained in:
8
vendor/gopkg.in/src-d/go-git.v4/plumbing/transport/http/common.go
generated
vendored
8
vendor/gopkg.in/src-d/go-git.v4/plumbing/transport/http/common.go
generated
vendored
@@ -139,7 +139,7 @@ func (s *session) ApplyAuthToRequest(req *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
s.auth.setAuth(req)
|
||||
s.auth.SetAuth(req)
|
||||
}
|
||||
|
||||
func (s *session) ModifyEndpointIfRedirect(res *http.Response) {
|
||||
@@ -175,7 +175,7 @@ func (*session) Close() error {
|
||||
// AuthMethod is concrete implementation of common.AuthMethod for HTTP services
|
||||
type AuthMethod interface {
|
||||
transport.AuthMethod
|
||||
setAuth(r *http.Request)
|
||||
SetAuth(r *http.Request)
|
||||
}
|
||||
|
||||
func basicAuthFromEndpoint(ep *transport.Endpoint) *BasicAuth {
|
||||
@@ -192,7 +192,7 @@ type BasicAuth struct {
|
||||
Username, Password string
|
||||
}
|
||||
|
||||
func (a *BasicAuth) setAuth(r *http.Request) {
|
||||
func (a *BasicAuth) SetAuth(r *http.Request) {
|
||||
if a == nil {
|
||||
return
|
||||
}
|
||||
@@ -226,7 +226,7 @@ type TokenAuth struct {
|
||||
Token string
|
||||
}
|
||||
|
||||
func (a *TokenAuth) setAuth(r *http.Request) {
|
||||
func (a *TokenAuth) SetAuth(r *http.Request) {
|
||||
if a == nil {
|
||||
return
|
||||
}
|
||||
|
||||
5
vendor/gopkg.in/src-d/go-git.v4/plumbing/transport/server/server.go
generated
vendored
5
vendor/gopkg.in/src-d/go-git.v4/plumbing/transport/server/server.go
generated
vendored
@@ -286,11 +286,6 @@ func (s *rpSession) updateReferences(req *packp.ReferenceUpdateRequest) {
|
||||
continue
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
s.setStatus(cmd.Name, err)
|
||||
continue
|
||||
}
|
||||
|
||||
ref := plumbing.NewHashReference(cmd.Name, cmd.New)
|
||||
err := s.storer.SetReference(ref)
|
||||
s.setStatus(cmd.Name, err)
|
||||
|
||||
2
vendor/gopkg.in/src-d/go-git.v4/plumbing/transport/ssh/auth_method.go
generated
vendored
2
vendor/gopkg.in/src-d/go-git.v4/plumbing/transport/ssh/auth_method.go
generated
vendored
@@ -61,7 +61,7 @@ func (a *KeyboardInteractive) ClientConfig() (*ssh.ClientConfig, error) {
|
||||
return a.SetHostKeyCallback(&ssh.ClientConfig{
|
||||
User: a.User,
|
||||
Auth: []ssh.AuthMethod{
|
||||
ssh.KeyboardInteractiveChallenge(a.Challenge),
|
||||
a.Challenge,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
27
vendor/gopkg.in/src-d/go-git.v4/plumbing/transport/ssh/common.go
generated
vendored
27
vendor/gopkg.in/src-d/go-git.v4/plumbing/transport/ssh/common.go
generated
vendored
@@ -2,6 +2,7 @@
|
||||
package ssh
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"reflect"
|
||||
"strconv"
|
||||
@@ -11,6 +12,7 @@ import (
|
||||
|
||||
"github.com/kevinburke/ssh_config"
|
||||
"golang.org/x/crypto/ssh"
|
||||
"golang.org/x/net/proxy"
|
||||
)
|
||||
|
||||
// DefaultClient is the default SSH client.
|
||||
@@ -115,7 +117,7 @@ func (c *command) connect() error {
|
||||
|
||||
overrideConfig(c.config, config)
|
||||
|
||||
c.client, err = ssh.Dial("tcp", c.getHostWithPort(), config)
|
||||
c.client, err = dial("tcp", c.getHostWithPort(), config)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -130,6 +132,29 @@ func (c *command) connect() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func dial(network, addr string, config *ssh.ClientConfig) (*ssh.Client, error) {
|
||||
var (
|
||||
ctx = context.Background()
|
||||
cancel context.CancelFunc
|
||||
)
|
||||
if config.Timeout > 0 {
|
||||
ctx, cancel = context.WithTimeout(ctx, config.Timeout)
|
||||
} else {
|
||||
ctx, cancel = context.WithCancel(ctx)
|
||||
}
|
||||
defer cancel()
|
||||
|
||||
conn, err := proxy.Dial(ctx, network, addr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
c, chans, reqs, err := ssh.NewClientConn(conn, addr, config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ssh.NewClient(c, chans, reqs), nil
|
||||
}
|
||||
|
||||
func (c *command) getHostWithPort() string {
|
||||
if addr, found := c.doGetHostWithPortFromSSHConfig(); found {
|
||||
return addr
|
||||
|
||||
Reference in New Issue
Block a user