Skip to content

Commit

Permalink
fix(pico): use ssh shared public key auth mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
neurosnap committed Jan 11, 2025
1 parent e9d74c8 commit c7655a6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pico/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ import (
"github.com/picosh/utils"
)

func authHandler(ctx ssh.Context, key ssh.PublicKey) bool {
return true
}

func createRouter(cfg *shared.ConfigSite, handler *UploadHandler, cliHandler *CliHandler) proxy.Router {
return func(sh ssh.Handler, s ssh.Session) []wish.Middleware {
return []wish.Middleware{
Expand Down Expand Up @@ -75,10 +71,14 @@ func StartSshServer() {
DBPool: dbpool,
}

sshAuth := shared.NewSshAuthHandler(dbpool, logger, cfg)
s, err := wish.NewServer(
wish.WithAddress(fmt.Sprintf("%s:%s", host, port)),
wish.WithHostKeyPath("ssh_data/term_info_ed25519"),
wish.WithPublicKeyAuth(authHandler),
wish.WithPublicKeyAuth(func(ctx ssh.Context, key ssh.PublicKey) bool {
sshAuth.PubkeyAuthHandler(ctx, key)
return true
}),
withProxy(
cfg,
handler,
Expand Down

0 comments on commit c7655a6

Please sign in to comment.