diff --git a/cmd/jimmsrv/main.go b/cmd/jimmsrv/main.go index 0d59b467f..07bf8cba9 100644 --- a/cmd/jimmsrv/main.go +++ b/cmd/jimmsrv/main.go @@ -210,17 +210,5 @@ func start(ctx context.Context, s *service.Service) error { s.Go(httpsrv.ListenAndServe) zapctx.Info(ctx, "Successfully started JIMM server") - // // this is to show the integration, we will uncommented it once the ssh implementation is ready. - // sshJumpServer, err := ssh.NewJumpSSHServer(ctx, ssh.SSHServerConfig{ - // Port: os.Getenv("JIMM_SSH_PORT"), - // HostKey: []byte(os.Getenv("JIMM_SSH_HOST_KEY")), - // MaxConcurrentConnections: os.Getenv("JIMM_SSH_MAX_CONCURRENT_CONNECTIONS"), - // }, jimmsvc.JIMM().SSHManager()) - // if err != nil { - // return err - // } - // s.Go(sshJumpServer.ListenAndServe) - // zapctx.Info(ctx, "Successfully started JIMM ssh jump server") - return nil } diff --git a/internal/ssh/ssh.go b/internal/ssh/ssh.go index 94250c9af..a459003a8 100644 --- a/internal/ssh/ssh.go +++ b/internal/ssh/ssh.go @@ -25,9 +25,9 @@ type Resolver interface { AddrFromModelUUID(ctx context.Context, user openfga.User, modelUUID string) (string, error) } -// NewJumpSSHServer creates the jump server struct. -func NewJumpSSHServer(ctx context.Context, config SSHServerConfig, resolver Resolver) (Server, error) { - zapctx.Info(ctx, "NewSSHServer") +// NewJumpServer creates the jump server struct. +func NewJumpServer(ctx context.Context, config Config, resolver Resolver) (Server, error) { + zapctx.Info(ctx, "NewJumpServer") if resolver == nil { return Server{}, fmt.Errorf("Cannot create JumpSSHServer with a nil resolver.") diff --git a/internal/ssh/ssh_test.go b/internal/ssh/ssh_test.go index 8b24826a4..ae7ff18b3 100644 --- a/internal/ssh/ssh_test.go +++ b/internal/ssh/ssh_test.go @@ -83,8 +83,8 @@ func (s *sshSuite) Init(c *qt.C) { s.hostKey, err = gossh.ParsePrivateKey(hostKey) c.Assert(err, qt.IsNil) - s.jumpSSHServer, err = ssh.NewJumpSSHServer(context.Background(), - ssh.SSHServerConfig{ + s.jumpSSHServer, err = ssh.NewJumpServer(context.Background(), + ssh.Config{ Port: fmt.Sprint(port), HostKey: hostKey}, resolver{}, diff --git a/internal/ssh/types.go b/internal/ssh/types.go index beeb05a6e..92871fa3b 100644 --- a/internal/ssh/types.go +++ b/internal/ssh/types.go @@ -1,4 +1,5 @@ // Copyright 2025 Canonical. + package ssh import "github.com/gliderlabs/ssh" @@ -18,7 +19,7 @@ type Server struct { resolver Resolver } -type SSHServerConfig struct { +type Config struct { Port string HostKey []byte MaxConcurrentConnections string