13 Commits

Author SHA1 Message Date
Giles Cope
6678be5be2 feat: not fail on non-default ports
Signed-off-by: Giles Cope <gilescope@gmail.com>
2026-06-24 06:30:57 +01:00
Akihiro Suda
e6676287ca git url: support query form
Fix issue 4905, but the syntax differs from the original proposal.

The document will be added to
https://github.com/docker/docs/blob/main/content/manuals/build/concepts/context.md#url-fragments

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-08-28 13:50:17 -07:00
Justin Chadwell
938560b7bd sshutil: refactor to allow parsing scp-style urls
SCP-style URLs take the following format [1]:

	[user@]server:project.git

These are used and handled by git, so we should have a full-parser for
these, that return a custom URL type.

[1]: https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols

Signed-off-by: Justin Chadwell <me@jedevc.com>
2023-10-12 12:06:27 +01:00
Justin Chadwell
f57b3ef89b chore: refactor util to use errors pkg
Signed-off-by: Justin Chadwell <me@jedevc.com>
2022-11-23 12:29:27 +00:00
Sebastiaan van Stijn
314bedc808 util/sshutil: minor linting / warning nits
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-12-01 17:01:15 +01:00
Alex Couture-Beil
3a5bdf0710 Move prefix check to isGitTransport
- rename IsSSHTransport to IsImplicitSSHTransport
- add testing for NewGitIdentifier

Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
2021-01-04 11:09:56 -08:00
Alex Couture-Beil
0dff0fdab4 Check for explicit ssh git URL
- fix IsSSHTransport to also check for explicitly-defined ssh-based git repos

Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
2020-12-15 13:31:35 -08:00
Tibor Vass
fbf8ed15a8 sshutil: allow uppercase usernames (thinking of you thaJeztah)
Signed-off-by: Tibor Vass <tibor@docker.com>
2020-12-11 05:19:39 +00:00
Alex Couture-Beil
201482bba9 Allow for usersnames with hyphens or underscores
- usernames could have - or _
- expand testing cases

Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
2020-12-10 17:10:38 -08:00
Alex Couture-Beil
3fa063dcf3 move ssh regexp test to common location
- include testing
- improve hostname checking

Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
2020-12-10 17:10:38 -08:00
Alex Couture-Beil
88580ad989 Fix sshkeyscan to work with ipv6
- make use of standard net.SplitHostPort and net.JoinHostPort functions

Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
2020-11-18 09:19:49 -08:00
Alex Couture-Beil
ccac4d664e fix assumption that ssh port must be 2 digits
Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
2020-11-16 17:02:40 -08:00
Alex Couture-Beil
3c73a22430 Add default ssh mount and keyscans when missing
Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
2020-11-16 13:23:37 -08:00