revert partial succ support (#395)
* chore: Update Dockerfile to use golang 1.22-bookworm and install additional dependencies * revert crypto * testcase to cover re-mapping to fail
This commit is contained in:
parent
865b972b07
commit
6fe67e3f5c
5 changed files with 71 additions and 6 deletions
14
Dockerfile
14
Dockerfile
|
|
@ -1,4 +1,4 @@
|
|||
FROM docker.io/golang:1.22.0-alpine3.19 as builder
|
||||
FROM docker.io/golang:1.22-bookworm as builder
|
||||
|
||||
ARG VER=devel
|
||||
ARG BUILDTAGS=""
|
||||
|
|
@ -13,10 +13,18 @@ RUN --mount=target=/src,type=bind,source=. --mount=type=cache,target=/root/.cach
|
|||
ADD entrypoint.sh /sshpiperd
|
||||
|
||||
FROM builder as testrunner
|
||||
RUN apk add openssh-client git bash coreutils
|
||||
RUN apt update && apt install -y autoconf automake libssl-dev libz-dev
|
||||
|
||||
RUN cd /tmp && \
|
||||
curl -fsSL https://github.com/openssh/openssh-portable/archive/refs/tags/V_9_7_P1.tar.gz | tar xz && \
|
||||
cd openssh-portable-V_9_7_P1 && \
|
||||
autoreconf && \
|
||||
./configure && \
|
||||
make ssh && \
|
||||
cp ssh /usr/bin/ssh-9.7.1p1
|
||||
|
||||
FROM docker.io/busybox
|
||||
LABEL maintainer="Boshi Lian<farmer1992@gmail.com>"
|
||||
# LABEL maintainer="Boshi Lian<farmer1992@gmail.com>"
|
||||
|
||||
RUN mkdir /etc/ssh/
|
||||
|
||||
|
|
|
|||
2
crypto
2
crypto
|
|
@ -1 +1 @@
|
|||
Subproject commit ce9cbe5ceedbe92d7fe6360513790c5ddd8f1a40
|
||||
Subproject commit 06bd4d377ec44ce00cbd9a5084f40b8980c94e0e
|
||||
|
|
@ -34,7 +34,7 @@ func TestFixed(t *testing.T) {
|
|||
targetfie := uuid.New().String()
|
||||
|
||||
c, stdin, stdout, err := runCmd(
|
||||
"ssh",
|
||||
"ssh-9.7.1p1",
|
||||
"-v",
|
||||
"-o",
|
||||
"StrictHostKeyChecking=no",
|
||||
|
|
|
|||
|
|
@ -145,4 +145,58 @@ func TestKubernetes(t *testing.T) {
|
|||
})
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
// fallback to password
|
||||
t.Run("fallback to password", func(t *testing.T) {
|
||||
randtext := uuid.New().String()
|
||||
targetfie := uuid.New().String()
|
||||
|
||||
keyfiledir, err := os.MkdirTemp("", "")
|
||||
if err != nil {
|
||||
t.Errorf("failed to create temp key file: %v", err)
|
||||
}
|
||||
|
||||
keyfile := path.Join(keyfiledir, "key")
|
||||
|
||||
if err := runCmdAndWait(
|
||||
"ssh-keygen",
|
||||
"-N",
|
||||
"",
|
||||
"-f",
|
||||
keyfile,
|
||||
); err != nil {
|
||||
t.Errorf("failed to generate key: %v", err)
|
||||
}
|
||||
|
||||
c, stdin, stdout, err := runCmd(
|
||||
"ssh",
|
||||
"-v",
|
||||
"-o",
|
||||
"StrictHostKeyChecking=no",
|
||||
"-o",
|
||||
"UserKnownHostsFile=/dev/null",
|
||||
"-p",
|
||||
piperport,
|
||||
"-l",
|
||||
"pass",
|
||||
"-i",
|
||||
keyfile,
|
||||
piperhost,
|
||||
fmt.Sprintf(`sh -c "echo -n %v > /shared/%v"`, randtext, targetfie),
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
t.Errorf("failed to ssh to piper-fixed, %v", err)
|
||||
}
|
||||
|
||||
defer killCmd(c)
|
||||
|
||||
enterPassword(stdin, stdout, "pass")
|
||||
|
||||
time.Sleep(time.Second) // wait for file flush
|
||||
|
||||
checkSharedFileContent(t, targetfie, randtext)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
5
go.sum
5
go.sum
|
|
@ -198,7 +198,7 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL
|
|||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
|
||||
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
|
||||
golang.org/x/oauth2 v0.17.0 h1:6m3ZPmLEFdVxKKWnKq4VqZ60gutO35zm+zrAHVmHyDQ=
|
||||
|
|
@ -223,11 +223,13 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc
|
|||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
|
||||
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
|
||||
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
|
||||
golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw=
|
||||
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
|
||||
|
|
@ -236,6 +238,7 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
|||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
|
||||
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue