From 2024cc96e2123f4721ace79fd0987123ba3100c6 Mon Sep 17 00:00:00 2001 From: lash Date: Mon, 6 Jan 2025 07:22:58 +0000 Subject: [PATCH] Bring up-to-date with refactor --- internal/ssh/keystore.go | 3 ++- internal/ssh/ssh.go | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/internal/ssh/keystore.go b/internal/ssh/keystore.go index b80727b..206d684 100644 --- a/internal/ssh/keystore.go +++ b/internal/ssh/keystore.go @@ -11,6 +11,7 @@ import ( "git.defalsify.org/vise.git/db" "git.grassecon.net/urdt/ussd/internal/storage" + dbstorage "git.grassecon.net/urdt/ussd/internal/storage/db/gdbm" ) type SshKeyStore struct { @@ -20,7 +21,7 @@ type SshKeyStore struct { func NewSshKeyStore(ctx context.Context, dbDir string) (*SshKeyStore, error) { keyStore := &SshKeyStore{} keyStoreFile := path.Join(dbDir, "ssh_authorized_keys.gdbm") - keyStore.store = storage.NewThreadGdbmDb() + keyStore.store = dbstorage.NewThreadGdbmDb() err := keyStore.store.Connect(ctx, keyStoreFile) if err != nil { return nil, err diff --git a/internal/ssh/ssh.go b/internal/ssh/ssh.go index 394f55f..1831ebe 100644 --- a/internal/ssh/ssh.go +++ b/internal/ssh/ssh.go @@ -19,6 +19,7 @@ import ( "git.grassecon.net/urdt/ussd/internal/handlers" "git.grassecon.net/urdt/ussd/internal/storage" + "git.grassecon.net/urdt/ussd/remote" ) var ( @@ -174,7 +175,7 @@ func(s *SshRunner) GetEngine(sessionId string) (engine.Engine, func(), error) { return nil, nil, err } - lhs, err := handlers.NewLocalHandlerService(s.FlagFile, true, dbResource, s.Cfg, rs) + lhs, err := handlers.NewLocalHandlerService(ctx, s.FlagFile, true, dbResource, s.Cfg, rs) lhs.SetDataStore(&userdatastore) lhs.SetPersister(pe) lhs.Cfg.SessionId = sessionId @@ -183,7 +184,9 @@ func(s *SshRunner) GetEngine(sessionId string) (engine.Engine, func(), error) { return nil, nil, err } - hl, err := lhs.GetHandler() + // TODO: clear up why pointer here and by-value other cmds + accountService := &remote.AccountService{} + hl, err := lhs.GetHandler(accountService) if err != nil { return nil, nil, err }