Skip to content

Commit

Permalink
pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
SimoneDutto committed Jan 14, 2025
1 parent c19138c commit 48be1cb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 18 deletions.
12 changes: 0 additions & 12 deletions cmd/jimmsrv/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
6 changes: 3 additions & 3 deletions internal/ssh/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
4 changes: 2 additions & 2 deletions internal/ssh/ssh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{},
Expand Down
3 changes: 2 additions & 1 deletion internal/ssh/types.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2025 Canonical.

package ssh

import "github.com/gliderlabs/ssh"
Expand All @@ -18,7 +19,7 @@ type Server struct {
resolver Resolver
}

type SSHServerConfig struct {
type Config struct {
Port string
HostKey []byte
MaxConcurrentConnections string
Expand Down

0 comments on commit 48be1cb

Please sign in to comment.