Compare commits

...

5 Commits

8 changed files with 20 additions and 12 deletions

View File

@ -22,9 +22,8 @@ import (
at "git.grassecon.net/grassrootseconomics/visedriver-africastalking/africastalking" at "git.grassecon.net/grassrootseconomics/visedriver-africastalking/africastalking"
"git.grassecon.net/grassrootseconomics/sarafu-vise/args" "git.grassecon.net/grassrootseconomics/sarafu-vise/args"
httpremote "git.grassecon.net/grassrootseconomics/sarafu-api/remote/http"
"git.grassecon.net/grassrootseconomics/sarafu-vise/handlers" "git.grassecon.net/grassrootseconomics/sarafu-vise/handlers"
"git.grassecon.net/grassrootseconomics/sarafu-vise/services"
) )
var ( var (
@ -121,7 +120,8 @@ func main() {
os.Exit(1) os.Exit(1)
} }
accountService := &httpremote.HTTPAccountService{} accountService := services.New(ctx, menuStorageService, connData)
hl, err := lhs.GetHandler(accountService) hl, err := lhs.GetHandler(accountService)
if err != nil { if err != nil {
fmt.Fprintf(os.Stderr, "httpaccountservice: %v\n", err) fmt.Fprintf(os.Stderr, "httpaccountservice: %v\n", err)

View File

@ -17,7 +17,7 @@ import (
"git.grassecon.net/grassrootseconomics/sarafu-vise/config" "git.grassecon.net/grassrootseconomics/sarafu-vise/config"
"git.grassecon.net/grassrootseconomics/visedriver/storage" "git.grassecon.net/grassrootseconomics/visedriver/storage"
"git.grassecon.net/grassrootseconomics/visedriver/request" "git.grassecon.net/grassrootseconomics/visedriver/request"
httpremote "git.grassecon.net/grassrootseconomics/sarafu-api/remote/http" "git.grassecon.net/grassrootseconomics/sarafu-vise/services"
"git.grassecon.net/grassrootseconomics/sarafu-vise/args" "git.grassecon.net/grassrootseconomics/sarafu-vise/args"
"git.grassecon.net/grassrootseconomics/sarafu-vise/handlers" "git.grassecon.net/grassrootseconomics/sarafu-vise/handlers"
) )
@ -125,7 +125,8 @@ func main() {
lhs, err := handlers.NewLocalHandlerService(ctx, pfp, true, dbResource, cfg, rs) lhs, err := handlers.NewLocalHandlerService(ctx, pfp, true, dbResource, cfg, rs)
lhs.SetDataStore(&userdataStore) lhs.SetDataStore(&userdataStore)
accountService := &httpremote.HTTPAccountService{}
accountService := services.New(ctx, menuStorageService, connData)
hl, err := lhs.GetHandler(accountService) hl, err := lhs.GetHandler(accountService)
if err != nil { if err != nil {

View File

@ -21,7 +21,7 @@ import (
"git.grassecon.net/grassrootseconomics/visedriver/request" "git.grassecon.net/grassrootseconomics/visedriver/request"
"git.grassecon.net/grassrootseconomics/visedriver/storage" "git.grassecon.net/grassrootseconomics/visedriver/storage"
httpremote "git.grassecon.net/grassrootseconomics/sarafu-api/remote/http" "git.grassecon.net/grassrootseconomics/sarafu-vise/services"
"git.grassecon.net/grassrootseconomics/sarafu-vise/args" "git.grassecon.net/grassrootseconomics/sarafu-vise/args"
"git.grassecon.net/grassrootseconomics/sarafu-vise/handlers" "git.grassecon.net/grassrootseconomics/sarafu-vise/handlers"
) )
@ -116,7 +116,8 @@ func main() {
os.Exit(1) os.Exit(1)
} }
accountService := &httpremote.HTTPAccountService{} accountService := services.New(ctx, menuStorageService, connData)
hl, err := lhs.GetHandler(accountService) hl, err := lhs.GetHandler(accountService)
if err != nil { if err != nil {
fmt.Fprintf(os.Stderr, err.Error()) fmt.Fprintf(os.Stderr, err.Error())
@ -130,6 +131,8 @@ func main() {
} }
defer stateStore.Close() defer stateStore.Close()
//accountService := services.New(ctx, menuStorageService, connData)
rp := &httprequest.DefaultRequestParser{} rp := &httprequest.DefaultRequestParser{}
bsh := request.NewBaseRequestHandler(cfg, rs, stateStore, userdataStore, rp, hl) bsh := request.NewBaseRequestHandler(cfg, rs, stateStore, userdataStore, rp, hl)
sh := httprequest.NewHTTPRequestHandler(bsh) sh := httprequest.NewHTTPRequestHandler(bsh)

View File

@ -86,7 +86,7 @@ func main() {
cfg := engine.Config{ cfg := engine.Config{
Root: "root", Root: "root",
OutputSize: uint32(size), OutputSize: uint32(size),
FlagCount: uint32(16), FlagCount: uint32(128),
} }
if stateDebug { if stateDebug {
cfg.StateDebug = true cfg.StateDebug = true

View File

@ -1 +1 @@
Your account is still being created. Your account is still being created. For more help, please call: 0757628885

View File

@ -1 +1 @@
Akaunti yako bado inatengenezwa Akaunti yako bado inatengenezwa. Kwa usaidizi zaidi, piga: 0757628885

View File

@ -44,6 +44,8 @@ func(s *SshKeyStore) AddFromFile(ctx context.Context, fp string, sessionId strin
return fmt.Errorf("Failed to parse public key: %v", err) return fmt.Errorf("Failed to parse public key: %v", err)
} }
k := append([]byte{0x01}, pubKey.Marshal()...) k := append([]byte{0x01}, pubKey.Marshal()...)
s.store.SetLanguage(nil)
s.store.SetSession("")
s.store.SetPrefix(storage.DATATYPE_EXTEND) s.store.SetPrefix(storage.DATATYPE_EXTEND)
logg.Infof("Added key", "sessionId", sessionId, "public key", string(publicBytes)) logg.Infof("Added key", "sessionId", sessionId, "public key", string(publicBytes))
return s.store.Put(ctx, k, []byte(sessionId)) return s.store.Put(ctx, k, []byte(sessionId))
@ -51,6 +53,7 @@ func(s *SshKeyStore) AddFromFile(ctx context.Context, fp string, sessionId strin
func(s *SshKeyStore) Get(ctx context.Context, pubKey ssh.PublicKey) (string, error) { func(s *SshKeyStore) Get(ctx context.Context, pubKey ssh.PublicKey) (string, error) {
s.store.SetLanguage(nil) s.store.SetLanguage(nil)
s.store.SetSession("")
s.store.SetPrefix(storage.DATATYPE_EXTEND) s.store.SetPrefix(storage.DATATYPE_EXTEND)
k := append([]byte{0x01}, pubKey.Marshal()...) k := append([]byte{0x01}, pubKey.Marshal()...)
v, err := s.store.Get(ctx, k) v, err := s.store.Get(ctx, k)

View File

@ -17,7 +17,7 @@ import (
"git.defalsify.org/vise.git/resource" "git.defalsify.org/vise.git/resource"
"git.defalsify.org/vise.git/state" "git.defalsify.org/vise.git/state"
"git.grassecon.net/grassrootseconomics/visedriver/storage" "git.grassecon.net/grassrootseconomics/visedriver/storage"
httpremote "git.grassecon.net/grassrootseconomics/sarafu-api/remote/http" "git.grassecon.net/grassrootseconomics/sarafu-vise/services"
"git.grassecon.net/grassrootseconomics/sarafu-vise/handlers" "git.grassecon.net/grassrootseconomics/sarafu-vise/handlers"
) )
@ -180,7 +180,8 @@ func(s *SshRunner) GetEngine(sessionId string) (engine.Engine, func(), error) {
} }
// TODO: clear up why pointer here and by-value other cmds // TODO: clear up why pointer here and by-value other cmds
accountService := &httpremote.HTTPAccountService{} accountService := services.New(ctx, menuStorageService, s.Conn)
hl, err := lhs.GetHandler(accountService) hl, err := lhs.GetHandler(accountService)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err