Compare commits
No commits in common. "master" and "lash/dev-api-buildtag" have entirely different histories.
master
...
lash/dev-a
@ -22,8 +22,9 @@ import (
|
||||
|
||||
at "git.grassecon.net/grassrootseconomics/visedriver-africastalking/africastalking"
|
||||
"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/services"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -120,8 +121,7 @@ func main() {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
accountService := services.New(ctx, menuStorageService, connData)
|
||||
|
||||
accountService := &httpremote.HTTPAccountService{}
|
||||
hl, err := lhs.GetHandler(accountService)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "httpaccountservice: %v\n", err)
|
||||
|
@ -17,7 +17,7 @@ import (
|
||||
"git.grassecon.net/grassrootseconomics/sarafu-vise/config"
|
||||
"git.grassecon.net/grassrootseconomics/visedriver/storage"
|
||||
"git.grassecon.net/grassrootseconomics/visedriver/request"
|
||||
"git.grassecon.net/grassrootseconomics/sarafu-vise/services"
|
||||
httpremote "git.grassecon.net/grassrootseconomics/sarafu-api/remote/http"
|
||||
"git.grassecon.net/grassrootseconomics/sarafu-vise/args"
|
||||
"git.grassecon.net/grassrootseconomics/sarafu-vise/handlers"
|
||||
)
|
||||
@ -125,8 +125,7 @@ func main() {
|
||||
|
||||
lhs, err := handlers.NewLocalHandlerService(ctx, pfp, true, dbResource, cfg, rs)
|
||||
lhs.SetDataStore(&userdataStore)
|
||||
|
||||
accountService := services.New(ctx, menuStorageService, connData)
|
||||
accountService := &httpremote.HTTPAccountService{}
|
||||
|
||||
hl, err := lhs.GetHandler(accountService)
|
||||
if err != nil {
|
||||
|
@ -21,7 +21,7 @@ import (
|
||||
"git.grassecon.net/grassrootseconomics/visedriver/request"
|
||||
"git.grassecon.net/grassrootseconomics/visedriver/storage"
|
||||
|
||||
"git.grassecon.net/grassrootseconomics/sarafu-vise/services"
|
||||
httpremote "git.grassecon.net/grassrootseconomics/sarafu-api/remote/http"
|
||||
"git.grassecon.net/grassrootseconomics/sarafu-vise/args"
|
||||
"git.grassecon.net/grassrootseconomics/sarafu-vise/handlers"
|
||||
)
|
||||
@ -116,8 +116,7 @@ func main() {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
accountService := services.New(ctx, menuStorageService, connData)
|
||||
|
||||
accountService := &httpremote.HTTPAccountService{}
|
||||
hl, err := lhs.GetHandler(accountService)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, err.Error())
|
||||
@ -131,8 +130,6 @@ func main() {
|
||||
}
|
||||
defer stateStore.Close()
|
||||
|
||||
//accountService := services.New(ctx, menuStorageService, connData)
|
||||
|
||||
rp := &httprequest.DefaultRequestParser{}
|
||||
bsh := request.NewBaseRequestHandler(cfg, rs, stateStore, userdataStore, rp, hl)
|
||||
sh := httprequest.NewHTTPRequestHandler(bsh)
|
||||
|
@ -86,7 +86,7 @@ func main() {
|
||||
cfg := engine.Config{
|
||||
Root: "root",
|
||||
OutputSize: uint32(size),
|
||||
FlagCount: uint32(128),
|
||||
FlagCount: uint32(16),
|
||||
}
|
||||
if stateDebug {
|
||||
cfg.StateDebug = true
|
||||
|
@ -2187,23 +2187,6 @@ func (h *MenuHandlers) resetIncorrectPINAttempts(ctx context.Context, sessionId
|
||||
return nil
|
||||
}
|
||||
|
||||
func (h *MenuHandlers) persistInitialLanguageCode(ctx context.Context, sessionId string, code string) error {
|
||||
store := h.userdataStore
|
||||
_, err := store.ReadEntry(ctx, sessionId, storedb.DATA_INITIAL_LANGUAGE_CODE)
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
if !db.IsNotFound(err) {
|
||||
return err
|
||||
}
|
||||
err = store.WriteEntry(ctx, sessionId, storedb.DATA_INITIAL_LANGUAGE_CODE, []byte(code))
|
||||
if err != nil {
|
||||
logg.ErrorCtxf(ctx, "failed to persist initial language code", "key", storedb.DATA_INITIAL_LANGUAGE_CODE, "value", code, "error", err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// persistLanguageCode persists the selected ISO 639 language code
|
||||
func (h *MenuHandlers) persistLanguageCode(ctx context.Context, code string) error {
|
||||
store := h.userdataStore
|
||||
@ -2216,5 +2199,5 @@ func (h *MenuHandlers) persistLanguageCode(ctx context.Context, code string) err
|
||||
logg.ErrorCtxf(ctx, "failed to persist language code", "key", storedb.DATA_SELECTED_LANGUAGE_CODE, "value", code, "error", err)
|
||||
return err
|
||||
}
|
||||
return h.persistInitialLanguageCode(ctx, sessionId, code)
|
||||
return nil
|
||||
}
|
||||
|
@ -825,17 +825,6 @@ func TestSetLanguage(t *testing.T) {
|
||||
|
||||
// Assert that the Result FlagSet has the required flags after language switch
|
||||
assert.Equal(t, res, tt.expectedResult, "Result should match expected result")
|
||||
code, err := store.ReadEntry(ctx, sessionId, storedb.DATA_SELECTED_LANGUAGE_CODE)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, string(code), tt.expectedResult.Content)
|
||||
code, err = store.ReadEntry(ctx, sessionId, storedb.DATA_INITIAL_LANGUAGE_CODE)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
assert.Equal(t, string(code), "eng")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
Your account is still being created. For more help, please call: 0757628885
|
||||
Your account is still being created.
|
@ -1 +1 @@
|
||||
Akaunti yako bado inatengenezwa. Kwa usaidizi zaidi, piga: 0757628885
|
||||
Akaunti yako bado inatengenezwa
|
@ -44,8 +44,6 @@ func(s *SshKeyStore) AddFromFile(ctx context.Context, fp string, sessionId strin
|
||||
return fmt.Errorf("Failed to parse public key: %v", err)
|
||||
}
|
||||
k := append([]byte{0x01}, pubKey.Marshal()...)
|
||||
s.store.SetLanguage(nil)
|
||||
s.store.SetSession("")
|
||||
s.store.SetPrefix(storage.DATATYPE_EXTEND)
|
||||
logg.Infof("Added key", "sessionId", sessionId, "public key", string(publicBytes))
|
||||
return s.store.Put(ctx, k, []byte(sessionId))
|
||||
@ -53,7 +51,6 @@ func(s *SshKeyStore) AddFromFile(ctx context.Context, fp string, sessionId strin
|
||||
|
||||
func(s *SshKeyStore) Get(ctx context.Context, pubKey ssh.PublicKey) (string, error) {
|
||||
s.store.SetLanguage(nil)
|
||||
s.store.SetSession("")
|
||||
s.store.SetPrefix(storage.DATATYPE_EXTEND)
|
||||
k := append([]byte{0x01}, pubKey.Marshal()...)
|
||||
v, err := s.store.Get(ctx, k)
|
||||
|
@ -17,7 +17,7 @@ import (
|
||||
"git.defalsify.org/vise.git/resource"
|
||||
"git.defalsify.org/vise.git/state"
|
||||
"git.grassecon.net/grassrootseconomics/visedriver/storage"
|
||||
"git.grassecon.net/grassrootseconomics/sarafu-vise/services"
|
||||
httpremote "git.grassecon.net/grassrootseconomics/sarafu-api/remote/http"
|
||||
"git.grassecon.net/grassrootseconomics/sarafu-vise/handlers"
|
||||
)
|
||||
|
||||
@ -180,8 +180,7 @@ func(s *SshRunner) GetEngine(sessionId string) (engine.Engine, func(), error) {
|
||||
}
|
||||
|
||||
// TODO: clear up why pointer here and by-value other cmds
|
||||
accountService := services.New(ctx, menuStorageService, s.Conn)
|
||||
|
||||
accountService := &httpremote.HTTPAccountService{}
|
||||
hl, err := lhs.GetHandler(accountService)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
|
@ -59,8 +59,6 @@ const (
|
||||
DATA_INCORRECT_PIN_ATTEMPTS
|
||||
//ISO 639 code for the selected language.
|
||||
DATA_SELECTED_LANGUAGE_CODE
|
||||
//ISO 639 code for the language initially selected.
|
||||
DATA_INITIAL_LANGUAGE_CODE
|
||||
)
|
||||
|
||||
const (
|
||||
|
Loading…
Reference in New Issue
Block a user