Bring up-to-date with refactor
Some checks failed
release / docker (push) Has been cancelled

This commit is contained in:
lash 2025-01-06 07:22:58 +00:00
parent d2d878d5d7
commit 2024cc96e2
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
2 changed files with 7 additions and 3 deletions

View File

@ -11,6 +11,7 @@ import (
"git.defalsify.org/vise.git/db" "git.defalsify.org/vise.git/db"
"git.grassecon.net/urdt/ussd/internal/storage" "git.grassecon.net/urdt/ussd/internal/storage"
dbstorage "git.grassecon.net/urdt/ussd/internal/storage/db/gdbm"
) )
type SshKeyStore struct { type SshKeyStore struct {
@ -20,7 +21,7 @@ type SshKeyStore struct {
func NewSshKeyStore(ctx context.Context, dbDir string) (*SshKeyStore, error) { func NewSshKeyStore(ctx context.Context, dbDir string) (*SshKeyStore, error) {
keyStore := &SshKeyStore{} keyStore := &SshKeyStore{}
keyStoreFile := path.Join(dbDir, "ssh_authorized_keys.gdbm") keyStoreFile := path.Join(dbDir, "ssh_authorized_keys.gdbm")
keyStore.store = storage.NewThreadGdbmDb() keyStore.store = dbstorage.NewThreadGdbmDb()
err := keyStore.store.Connect(ctx, keyStoreFile) err := keyStore.store.Connect(ctx, keyStoreFile)
if err != nil { if err != nil {
return nil, err return nil, err

View File

@ -19,6 +19,7 @@ import (
"git.grassecon.net/urdt/ussd/internal/handlers" "git.grassecon.net/urdt/ussd/internal/handlers"
"git.grassecon.net/urdt/ussd/internal/storage" "git.grassecon.net/urdt/ussd/internal/storage"
"git.grassecon.net/urdt/ussd/remote"
) )
var ( var (
@ -174,7 +175,7 @@ func(s *SshRunner) GetEngine(sessionId string) (engine.Engine, func(), error) {
return nil, nil, err 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.SetDataStore(&userdatastore)
lhs.SetPersister(pe) lhs.SetPersister(pe)
lhs.Cfg.SessionId = sessionId lhs.Cfg.SessionId = sessionId
@ -183,7 +184,9 @@ func(s *SshRunner) GetEngine(sessionId string) (engine.Engine, func(), error) {
return nil, nil, err 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 { if err != nil {
return nil, nil, err return nil, nil, err
} }