Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

Run the exec verbs on a session, not an SSH channel

5ff8dfc964d8e05c5f5b7a8ec5e5f229178e5e4c · Keenan Nemetz · 16d ago · parent 22e290b0

Run the exec verbs on a session, not an SSH channel

Every handler behind the exec verb took an *xssh.Channel, and the two that
answer the exec request took the request too. That tied twenty functions to the
SSH transport, but the front door needs the same verbs, with the same access
rules, from a forced command that reaches the service over a local socket.

A Session is now what a verb runs on: stdin, stdout, a separate error stream,
Accept, CloseWrite, Exit, and Close. sshSession is the only implementation that
knows what an SSH channel is, so the handlers no longer name a transport and a
second one cannot become a second copy of the access rules.

No behaviour change. The handlers keep their names and bodies; the refusal and
exit-status paths move behind the interface, which is also what removes the
standalone exit helper. A new test drives vole-whoami and git-upload-pack over
SSH and over a session with no channel behind it, comparing stdout, stderr, and
the exit status of both.

server/ssh/merge.go +1−3

@@ -16,8 +16,6 @@ import (
16 16 "strings"
17 17 "time"
18 18
19 xssh "golang.org/x/crypto/ssh"
20
21 19 "rodent.software/vole/ci/runs"
22 20 "rodent.software/vole/forge/landing"
23 21 "rodent.software/vole/internal/format"
@@ -25,7 +23,7 @@ import (
25 23
26 24 // serveChangeMerge runs one landing for the caller. Every refusal is written to the
27 25 // channel with a "vole:" prefix, which is what the client turns into the error.
28 func (s *Server) serveChangeMerge(ch xssh.Channel, argv []string, user, remote string) int {
26 func (s *Server) serveChangeMerge(ch Session, argv []string, user, remote string) int {
29 27 if len(argv) != 3 {
30 28 fmt.Fprint(ch, "vole: usage: vole-change-merge <repository> <request-id>\n")
31 29 return 129