aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport
Commit message (Collapse)AuthorAgeFilesLines
* *: fix some typos (#567)cui fliter2022-09-221-1/+1
| | | | | Signed-off-by: cui fliter <imcusg@gmail.com> Signed-off-by: cui fliter <imcusg@gmail.com>
* plumbing: packp and server, Include the contents of ↵🚀 Steven Ewing 🌌2022-09-221-2/+2
| | | | `GO_GIT_USER_AGENT_EXTRA` as the git user agent. Fixes #529
* plumbing: transport/ssh, auto-populate ClientConfig.HostKeyAlgorithms. Fixes ↵Evan Elias2022-09-222-17/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | #411 This commit adjusts the transport/ssh logic in command.connect(), so that it now auto-populates ssh.ClientConfig.HostKeyAlgorithms. The algorithms are chosen based on the known host keys for the target host, as obtained from the known_hosts file. In order to look-up the algorithms from the known_hosts file, external module github.com/skeema/knownhosts is used. This package is just a thin wrapper around golang.org/x/crypto/ssh/knownhosts, adding an extra mechanism to query the known_hosts keys, implemented in a way which avoids duplication of any golang.org/x/crypto/ssh/knownhosts logic. Because HostKeyAlgorithms vary by target host, some related logic for setting HostKeyCallback has been moved out of the various AuthMethod implementations. This was necessary because the old HostKeyCallbackHelper is not host-specific. Since known_hosts handling isn't really tied to AuthMethod anyway, it seems reasonable to separate these. Previously-exported types/methods remain in place for backwards compat, but some of them are now unused. For testing approach, see pull request. Issue #411 can only be reproduced via end-to-end / integration testing, since it requires actually launching an SSH connection, in order to see the key mismatch error triggered from https://github.com/golang/go/issues/29286 as the root cause.
* minor grammatical fixesJon Eskin2022-09-221-2/+2
|
* all: replace go-homedir with os.UserHomeDirDaniel Martí2022-05-291-5/+6
| | | | Added in Go 1.12, this means we need one less dependency.
* Remove unused variables/types/functionsAbhinav Gupta2021-11-273-12/+1
| | | | | | | | [staticcheck](https://staticcheck.io/) reported a number of unused fields, functions, types, and variables across the code. Where possible, use them (assert unchecked errors in tests, for example) and otherwise remove them.
* git: Add support for deepening shallow clones (#311)Marcus Watkins2021-05-121-1/+1
|
* plumbing: transport/http, skip flaky testMáximo Cuadros2021-05-031-0/+4
|
* *: use go-billy instead of os callsMáximo Cuadros2021-05-023-7/+26
|
* utils: ioutil, Pipe implementatioMáximo Cuadros2021-05-022-2/+3
|
* plumbing: transport/file, replace os/exec with golang.org/x/sys/execabs to ↵Máximo Cuadros2021-04-171-9/+9
| | | | improve path security
* plumbing: transport/ssh, support more formats in `NewPublicKeys` SSH helper ↵Hidde Beydals2021-04-172-18/+11
| | | | | | | | | | | | | | | (#298) * Add failing ED25519 encrypted PEM test Signed-off-by: Hidde Beydals <hello@hidde.co> * Support more formats in `NewPublicKeys` SSH helper By switching to `ParsePrivateKey` and `ParsePrivateKeyWithPassphrase` from `crypto/ssh`, which has support for RSA (PKCS#1), PKCS#8, DSA (OpenSSL), and ECDSA private keys. Signed-off-by: Hidde Beydals <hello@hidde.co>
* plumbing: transport/ssh, fix no agent test on windowsv5.3.0Máximo Cuadros2021-03-291-1/+1
|
* *: fix flaky testMáximo Cuadros2021-03-261-0/+4
|
* plumbing: wire up contexts for Transport.AdvertisedReferences (#246)Andrew Suffield2021-03-267-7/+64
| | | | | * plumbing: wire up contexts for Transport.AdvertisedReferences * add more tests for context wiring
* transport: ssh, fix cloning large repositories (#272)David Cuadrado2021-03-262-1/+29
| | | | | | | | | | | | | | | | | * Fix cloning large repositories Ignore the error on close when the connection is already closed Fixes #70 * Compatibility for go 1.13 Because it's required by the pipeline * Add test for allowing to close a command when the client is already closed This test is for issue #70 * Add debug information for broken test
* Add insecureSkipTLS and cabundle (#228)Daishan Peng2021-01-272-1/+40
| | | | | This PR add insecureSkipTLSVerify and cabundle to any remote http calls so that https repo with private CA signed can be used. This is the equivalent of https.sslVerify and GIT_SSL_CAINFO
* fix nilOleg Kovalov2020-07-013-3/+3
|
* fix goreportcard warningsOleg Kovalov2020-07-018-9/+9
|
* Merge pull request #22 from mcuadros/fix-emptyMáximo Cuadros2020-04-071-0/+7
|\ | | | | plumbing: transport, fix handling of empty adv-refs on upload-pack
| * plumbing: transport, fix handling of empty adv-refs on upload-packMáximo Cuadros2020-04-071-0/+7
| |
* | plumbing: transport server test for nil PackfileBrandon Westcott2020-03-191-0/+30
| |
* | plumbing: transport server check for nil Packfile, fixes ref deletesBrandon Westcott2020-03-191-5/+7
|/
* *: migration from go-git-fixtures/v4 and go-git/gcfgMáximo Cuadros2020-03-1013-40/+33
|
* *: migration from gopkg to go modulesMáximo Cuadros2020-03-1034-104/+104
|
* Fix typos in comments, variables and function namesOleksandr Redko2019-10-243-3/+3
| | | | Signed-off-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
* *: avoid unnecessary conversionsChristian Muehlhaeuser2019-07-291-1/+1
| | | | | | | No need to convert these values, they're already of the right type. Signed-off-by: Christian Muehlhaeuser <muesli@gmail.com> (cherry picked from commit a1d8a7ac8bd0e4aff0f27dbb8bb37b8bd13a1346)
* *: fixed tautological error conditionsautological error conditionsChristian Muehlhaeuser2019-07-291-5/+0
| | | | | | | | | | - Added missing error handling around encodeCommitData and prevented shadowing err. - Removed tautological error checks. Signed-off-by: Christian Muehlhaeuser <muesli@gmail.com> (cherry picked from commit 7d76176416551fc21d98bc17768d158a82281406)
* Make http.AuthMethod setAuth public. Fixes #1196JACQUES Francois2019-07-282-5/+5
| | | | Signed-off-by: JACQUES Francois <Francois.JACQUES@murex.com>
* ssh: leverage proxy.DialJacob Blain Christen2019-05-022-1/+62
| | | | | | | This enables interacting with git remotes over SSH when behind a SOCKSv5 firewall. Signed-off-by: Jacob Blain Christen <dweomer5@gmail.com>
* config: add a way to see if a "remote" URL is local or notJeremy Stribling2019-02-111-14/+8
| | | | | | | | This factors out some URL-parsing code from the transport layer so it can be used by config as well. Issue: #909 Signed-off-by: Jeremy Stribling <strib@alum.mit.edu>
* Simplify return statement in receivePackNoCheckIskander (Alex) Sharipov2018-12-121-5/+1
| | | | | | Fixes #1035 Signed-off-by: Iskander Sharipov <quasilyte@gmail.com>
* Merge branch 'master' of github.com:src-d/go-git into ↵Colton McCurdy2018-11-012-1/+58
|\ | | | | | | mccurdyc/Issue#969/fix-flaky-ssh-test
| * http: improve TokenAuth documentationSantiago M. Mola2018-10-311-1/+8
| | | | | | | | | | | | | | | | | | | | Users are often confused with TokenAuth, since it might look that it should be used with GitHub's OAuth tokens. But that is not the case. TokenAuth implements HTTP bearer authentication. Most git servers will use HTTP basic authentication (user+passwords) even for OAuth tokens. Signed-off-by: Santiago M. Mola <santi@mola.io>
| * plumbing: transport/http, Add missing host/port on redirect. Fixes #820Dave Henderson2018-10-272-0/+50
| | | | | | | | Signed-off-by: Dave Henderson <dhenderson@gmail.com>
* | plumbing: ssh, Fix flaky test TestAdvertisedReferencesNotExists. Fixes #969Colton McCurdy2018-11-011-3/+11
|/ | | | Signed-off-by: Colton McCurdy <mccurdyc22@gmail.com>
* test: improve test for urlencoded user:passSantiago M. Mola2018-09-271-5/+15
| | | | Signed-off-by: Santiago M. Mola <santi@mola.io>
* Merge pull request #949 from kuba--/custom-cacheMáximo Cuadros2018-09-082-3/+4
|\ | | | | Expose Storage cache.
| * Expose Storage cache.kuba--2018-09-072-3/+4
| | | | | | | | Signed-off-by: kuba-- <kuba@sourced.tech>
* | plumbing/transport: ssh check if list of known_hosts files is emptyKuba Podgórski2018-09-072-7/+69
|/ | | Signed-off-by: kuba-- <kuba@sourced.tech>
* *: use parser to populate non writable storages and bug fixesMiguel Molina2018-08-072-7/+6
| | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* plumbing/transport/internal: common, add support of Gogs for ↵Jerome Doucet2018-07-142-0/+83
| | | | | | ErrRepositoryNotFound, avoiding to get an 'unknown error: '. Add some tests for existing supported services (github, gitlab, etc...) too. Signed-off-by: Jerome Doucet <jerdct@gmail.com>
* plumbing/transport: http, Adds token authentication support [Fixes #858]Eric Billingsley2018-06-082-0/+38
| | | | Signed-off-by: Eric Billingsley <ebilling@babrains.com>
* Remove printlnAntonio Jesus Navarro Perez2018-06-051-1/+0
| | | | Signed-off-by: Antonio Jesus Navarro Perez <antnavper@gmail.com>
* plumbing: transport, make target repo writeable in testsJavi Fontan2018-03-271-0/+21
| | | | | | | | | Some tests write to an already existent repository retrieved from fixtures. The permissions of these files are read only and make receive pack fail. This was shadowed before as close errors were lost. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* *: Use CheckClose with named returnsJavi Fontan2018-03-271-3/+3
| | | | | | | | Previously some close errors were losts. This is specially problematic in go-git as lots of work is done here like generating indexes and moving packfiles. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* Merge pull request #762 from zkry/escape-basic-auth-user-pswdMáximo Cuadros2018-03-012-2/+12
|\ | | | | plubming: transport, Escape the user and pswd for endpoint. Fixes #723
| * plubming: transport, Escape the user and password for endpoint. Fixes #723Zachary Romero2018-02-282-2/+12
| | | | | | | | Signed-off-by: Zachary Romero <zacromero3@gmail.com>
* | Merge pull request #766 from mvdan/patchesMáximo Cuadros2018-03-012-22/+11
|\ \ | | | | | | Unused params, unused code, make Go tip's vet happy
| * | all: make the upcoming Go 1.11's vet happyDaniel Martí2018-03-011-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vet in 1.10 and earlier was buggy in how its "composite literal uses unkeyed fields" check had false negatives when it encountered a slice of pointer types that omitted each element's type. This has been fixed in tip, so adapt to that fix. Signed-off-by: Daniel Martí <mvdan@mvdan.cc>