From 48d63fb43ff57ea7dc16c24f1ac3b7a715d49958 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Thu, 2 Jan 2025 13:16:38 +0300 Subject: [PATCH 01/14] added pin.go to contain all PIN related functionality --- common/pin.go | 14 ++++++++++++++ internal/handlers/ussd/menuhandler.go | 16 ++-------------- internal/handlers/ussd/menuhandler_test.go | 4 ++-- 3 files changed, 18 insertions(+), 16 deletions(-) create mode 100644 common/pin.go diff --git a/common/pin.go b/common/pin.go new file mode 100644 index 0000000..4d46f12 --- /dev/null +++ b/common/pin.go @@ -0,0 +1,14 @@ +package common + +import "regexp" + +// Define the regex pattern as a constant +const ( + pinPattern = `^\d{4}$` +) + +// checks whether the given input is a 4 digit number +func IsValidPIN(pin string) bool { + match, _ := regexp.MatchString(pinPattern, pin) + return match +} diff --git a/internal/handlers/ussd/menuhandler.go b/internal/handlers/ussd/menuhandler.go index 640517f..c20d75b 100644 --- a/internal/handlers/ussd/menuhandler.go +++ b/internal/handlers/ussd/menuhandler.go @@ -5,7 +5,6 @@ import ( "context" "fmt" "path" - "regexp" "strconv" "strings" @@ -34,17 +33,6 @@ var ( translationDir = path.Join(scriptDir, "locale") ) -// Define the regex patterns as constants -const ( - pinPattern = `^\d{4}$` -) - -// checks whether the given input is a 4 digit number -func isValidPIN(pin string) bool { - match, _ := regexp.MatchString(pinPattern, pin) - return match -} - // FlagManager handles centralized flag management type FlagManager struct { parser *asm.FlagParser @@ -281,7 +269,7 @@ func (h *Handlers) VerifyNewPin(ctx context.Context, sym string, input []byte) ( flag_valid_pin, _ := h.flagManager.GetFlag("flag_valid_pin") pinInput := string(input) // Validate that the PIN is a 4-digit number. - if isValidPIN(pinInput) { + if common.IsValidPIN(pinInput) { res.FlagSet = append(res.FlagSet, flag_valid_pin) } else { res.FlagReset = append(res.FlagReset, flag_valid_pin) @@ -306,7 +294,7 @@ func (h *Handlers) SaveTemporaryPin(ctx context.Context, sym string, input []byt accountPIN := string(input) // Validate that the PIN is a 4-digit number. - if !isValidPIN(accountPIN) { + if !common.IsValidPIN(accountPIN) { res.FlagSet = append(res.FlagSet, flag_incorrect_pin) return res, nil } diff --git a/internal/handlers/ussd/menuhandler_test.go b/internal/handlers/ussd/menuhandler_test.go index 34c8e76..0d66f72 100644 --- a/internal/handlers/ussd/menuhandler_test.go +++ b/internal/handlers/ussd/menuhandler_test.go @@ -1544,9 +1544,9 @@ func TestIsValidPIN(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - actual := isValidPIN(tt.pin) + actual := common.IsValidPIN(tt.pin) if actual != tt.expected { - t.Errorf("isValidPIN(%q) = %v; expected %v", tt.pin, actual, tt.expected) + t.Errorf("IsValidPIN(%q) = %v; expected %v", tt.pin, actual, tt.expected) } }) } From 5ca6a74274931fd49f8081a9fa3e68ee524a1eb3 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Thu, 2 Jan 2025 13:18:49 +0300 Subject: [PATCH 02/14] move PIN test to the common package --- common/pin_test.go | 56 ++++++++++++++++++++++ internal/handlers/ussd/menuhandler_test.go | 53 -------------------- 2 files changed, 56 insertions(+), 53 deletions(-) create mode 100644 common/pin_test.go diff --git a/common/pin_test.go b/common/pin_test.go new file mode 100644 index 0000000..9012024 --- /dev/null +++ b/common/pin_test.go @@ -0,0 +1,56 @@ +package common + +import "testing" + +func TestIsValidPIN(t *testing.T) { + tests := []struct { + name string + pin string + expected bool + }{ + { + name: "Valid PIN with 4 digits", + pin: "1234", + expected: true, + }, + { + name: "Valid PIN with leading zeros", + pin: "0001", + expected: true, + }, + { + name: "Invalid PIN with less than 4 digits", + pin: "123", + expected: false, + }, + { + name: "Invalid PIN with more than 4 digits", + pin: "12345", + expected: false, + }, + { + name: "Invalid PIN with letters", + pin: "abcd", + expected: false, + }, + { + name: "Invalid PIN with special characters", + pin: "12@#", + expected: false, + }, + { + name: "Empty PIN", + pin: "", + expected: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + actual := IsValidPIN(tt.pin) + if actual != tt.expected { + t.Errorf("IsValidPIN(%q) = %v; expected %v", tt.pin, actual, tt.expected) + } + }) + } +} diff --git a/internal/handlers/ussd/menuhandler_test.go b/internal/handlers/ussd/menuhandler_test.go index 0d66f72..9b3dc7b 100644 --- a/internal/handlers/ussd/menuhandler_test.go +++ b/internal/handlers/ussd/menuhandler_test.go @@ -1499,59 +1499,6 @@ func TestQuit(t *testing.T) { } } -func TestIsValidPIN(t *testing.T) { - tests := []struct { - name string - pin string - expected bool - }{ - { - name: "Valid PIN with 4 digits", - pin: "1234", - expected: true, - }, - { - name: "Valid PIN with leading zeros", - pin: "0001", - expected: true, - }, - { - name: "Invalid PIN with less than 4 digits", - pin: "123", - expected: false, - }, - { - name: "Invalid PIN with more than 4 digits", - pin: "12345", - expected: false, - }, - { - name: "Invalid PIN with letters", - pin: "abcd", - expected: false, - }, - { - name: "Invalid PIN with special characters", - pin: "12@#", - expected: false, - }, - { - name: "Empty PIN", - pin: "", - expected: false, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - actual := common.IsValidPIN(tt.pin) - if actual != tt.expected { - t.Errorf("IsValidPIN(%q) = %v; expected %v", tt.pin, actual, tt.expected) - } - }) - } -} - func TestValidateAmount(t *testing.T) { fm, err := NewFlagManager(flagsPath) if err != nil { From c899c098f62994536f6952626c3feb7e5d041ab7 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Thu, 2 Jan 2025 13:20:01 +0300 Subject: [PATCH 03/14] updated the expected age --- internal/handlers/ussd/menuhandler_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/handlers/ussd/menuhandler_test.go b/internal/handlers/ussd/menuhandler_test.go index 9b3dc7b..43f80a2 100644 --- a/internal/handlers/ussd/menuhandler_test.go +++ b/internal/handlers/ussd/menuhandler_test.go @@ -1745,7 +1745,7 @@ func TestGetProfile(t *testing.T) { result: resource.Result{ Content: fmt.Sprintf( "Name: %s\nGender: %s\nAge: %s\nLocation: %s\nYou provide: %s\n", - "John Doee", "Male", "48", "Kilifi", "Bananas", + "John Doee", "Male", "49", "Kilifi", "Bananas", ), }, }, @@ -1757,7 +1757,7 @@ func TestGetProfile(t *testing.T) { result: resource.Result{ Content: fmt.Sprintf( "Jina: %s\nJinsia: %s\nUmri: %s\nEneo: %s\nUnauza: %s\n", - "John Doee", "Male", "48", "Kilifi", "Bananas", + "John Doee", "Male", "49", "Kilifi", "Bananas", ), }, }, @@ -1769,7 +1769,7 @@ func TestGetProfile(t *testing.T) { result: resource.Result{ Content: fmt.Sprintf( "Name: %s\nGender: %s\nAge: %s\nLocation: %s\nYou provide: %s\n", - "John Doee", "Male", "48", "Kilifi", "Bananas", + "John Doee", "Male", "49", "Kilifi", "Bananas", ), }, }, From fd1ac85a1b2cbcdb233df8dc9b34cbfdf3e4de37 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Thu, 2 Jan 2025 13:43:38 +0300 Subject: [PATCH 04/14] add code to Hash and Verify the PIN --- common/pin.go | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/common/pin.go b/common/pin.go index 4d46f12..6db9d15 100644 --- a/common/pin.go +++ b/common/pin.go @@ -1,6 +1,10 @@ package common -import "regexp" +import ( + "regexp" + + "golang.org/x/crypto/bcrypt" +) // Define the regex pattern as a constant const ( @@ -12,3 +16,18 @@ func IsValidPIN(pin string) bool { match, _ := regexp.MatchString(pinPattern, pin) return match } + +// HashPIN uses bcrypt with 8 salt rounds to hash the PIN +func HashPIN(pin string) (string, error) { + hash, err := bcrypt.GenerateFromPassword([]byte(pin), 8) + if err != nil { + return "", err + } + return string(hash), nil +} + +// VerifyPIN compareS the hashed PIN with the plaintext PIN +func VerifyPIN(hashedPIN, pin string) bool { + err := bcrypt.CompareHashAndPassword([]byte(hashedPIN), []byte(pin)) + return err == nil +} From d95c7abea46dd84049262571ab9481922e089c33 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Thu, 2 Jan 2025 13:45:18 +0300 Subject: [PATCH 05/14] return if the PIN is not a match, and hash the PIN before saving it --- internal/handlers/ussd/menuhandler.go | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/internal/handlers/ussd/menuhandler.go b/internal/handlers/ussd/menuhandler.go index c20d75b..645e74c 100644 --- a/internal/handlers/ussd/menuhandler.go +++ b/internal/handlers/ussd/menuhandler.go @@ -356,11 +356,19 @@ func (h *Handlers) ConfirmPinChange(ctx context.Context, sym string, input []byt res.FlagReset = append(res.FlagReset, flag_pin_mismatch) } else { res.FlagSet = append(res.FlagSet, flag_pin_mismatch) + return res, nil } - // If matched, save the confirmed PIN as the new account PIN - err = store.WriteEntry(ctx, sessionId, common.DATA_ACCOUNT_PIN, []byte(temporaryPin)) + + // Hash the PIN + hashedPIN, err := common.HashPIN(string(temporaryPin)) if err != nil { - logg.ErrorCtxf(ctx, "failed to write temporaryPin entry with", "key", common.DATA_ACCOUNT_PIN, "value", temporaryPin, "error", err) + logg.ErrorCtxf(ctx, "failed to hash temporaryPin", "error", err) + } + + // save the hashed PIN as the new account PIN + err = store.WriteEntry(ctx, sessionId, common.DATA_ACCOUNT_PIN, []byte(hashedPIN)) + if err != nil { + logg.ErrorCtxf(ctx, "failed to write DATA_ACCOUNT_PIN entry with", "key", common.DATA_ACCOUNT_PIN, "hashedPIN value", hashedPIN, "error", err) return res, err } return res, nil @@ -392,11 +400,18 @@ func (h *Handlers) VerifyCreatePin(ctx context.Context, sym string, input []byte res.FlagSet = append(res.FlagSet, flag_pin_set) } else { res.FlagSet = []uint32{flag_pin_mismatch} + return res, nil } - err = store.WriteEntry(ctx, sessionId, common.DATA_ACCOUNT_PIN, []byte(temporaryPin)) + // Hash the PIN + hashedPIN, err := common.HashPIN(string(temporaryPin)) if err != nil { - logg.ErrorCtxf(ctx, "failed to write temporaryPin entry with", "key", common.DATA_ACCOUNT_PIN, "value", temporaryPin, "error", err) + logg.ErrorCtxf(ctx, "failed to hash temporaryPin", "error", err) + } + + err = store.WriteEntry(ctx, sessionId, common.DATA_ACCOUNT_PIN, []byte(hashedPIN)) + if err != nil { + logg.ErrorCtxf(ctx, "failed to write DATA_ACCOUNT_PIN entry with", "key", common.DATA_ACCOUNT_PIN, "value", hashedPIN, "error", err) return res, err } From 99a4d3ff421f7da6c22e3bba7d155b6f0b82e982 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Thu, 2 Jan 2025 13:49:57 +0300 Subject: [PATCH 06/14] verify the PIN input against the hashed PIN --- internal/handlers/ussd/menuhandler.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/handlers/ussd/menuhandler.go b/internal/handlers/ussd/menuhandler.go index 645e74c..0829011 100644 --- a/internal/handlers/ussd/menuhandler.go +++ b/internal/handlers/ussd/menuhandler.go @@ -725,7 +725,7 @@ func (h *Handlers) Authorize(ctx context.Context, sym string, input []byte) (res return res, err } if len(input) == 4 { - if bytes.Equal(input, AccountPin) { + if common.VerifyPIN(string(AccountPin), string(input)) { if h.st.MatchFlag(flag_account_authorized, false) { res.FlagReset = append(res.FlagReset, flag_incorrect_pin) res.FlagSet = append(res.FlagSet, flag_allow_update, flag_account_authorized) @@ -1403,7 +1403,6 @@ func (h *Handlers) GetCurrentProfileInfo(ctx context.Context, sym string, input defaultValue = "Not Provided" } - sm, _ := h.st.Where() parts := strings.SplitN(sm, "_", 2) filename := parts[1] From 98db85511be78d3238f80fb74d77817ef8b799d2 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Thu, 2 Jan 2025 14:37:45 +0300 Subject: [PATCH 07/14] hash the PIN in the ResetOthersPin function --- internal/handlers/ussd/menuhandler.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/internal/handlers/ussd/menuhandler.go b/internal/handlers/ussd/menuhandler.go index 0829011..3919595 100644 --- a/internal/handlers/ussd/menuhandler.go +++ b/internal/handlers/ussd/menuhandler.go @@ -363,6 +363,7 @@ func (h *Handlers) ConfirmPinChange(ctx context.Context, sym string, input []byt hashedPIN, err := common.HashPIN(string(temporaryPin)) if err != nil { logg.ErrorCtxf(ctx, "failed to hash temporaryPin", "error", err) + return res, err } // save the hashed PIN as the new account PIN @@ -407,6 +408,7 @@ func (h *Handlers) VerifyCreatePin(ctx context.Context, sym string, input []byte hashedPIN, err := common.HashPIN(string(temporaryPin)) if err != nil { logg.ErrorCtxf(ctx, "failed to hash temporaryPin", "error", err) + return res, err } err = store.WriteEntry(ctx, sessionId, common.DATA_ACCOUNT_PIN, []byte(hashedPIN)) @@ -952,7 +954,15 @@ func (h *Handlers) ResetOthersPin(ctx context.Context, sym string, input []byte) logg.ErrorCtxf(ctx, "failed to read temporaryPin entry with", "key", common.DATA_TEMPORARY_VALUE, "error", err) return res, err } - err = store.WriteEntry(ctx, string(blockedPhonenumber), common.DATA_ACCOUNT_PIN, []byte(temporaryPin)) + + // Hash the PIN + hashedPIN, err := common.HashPIN(string(temporaryPin)) + if err != nil { + logg.ErrorCtxf(ctx, "failed to hash temporaryPin", "error", err) + return res, err + } + + err = store.WriteEntry(ctx, string(blockedPhonenumber), common.DATA_ACCOUNT_PIN, []byte(hashedPIN)) if err != nil { return res, nil } From 82b4365d161ab9e16e0506f61439f4c124a6be96 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Thu, 2 Jan 2025 14:38:22 +0300 Subject: [PATCH 08/14] hash the PIN in TestAuthorize --- internal/handlers/ussd/menuhandler_test.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/handlers/ussd/menuhandler_test.go b/internal/handlers/ussd/menuhandler_test.go index 43f80a2..12ed5c2 100644 --- a/internal/handlers/ussd/menuhandler_test.go +++ b/internal/handlers/ussd/menuhandler_test.go @@ -1047,7 +1047,14 @@ func TestAuthorize(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - err = store.WriteEntry(ctx, sessionId, common.DATA_ACCOUNT_PIN, []byte(accountPIN)) + // Hash the PIN + hashedPIN, err := common.HashPIN(accountPIN) + if err != nil { + logg.ErrorCtxf(ctx, "failed to hash temporaryPin", "error", err) + t.Fatal(err) + } + + err = store.WriteEntry(ctx, sessionId, common.DATA_ACCOUNT_PIN, []byte(hashedPIN)) if err != nil { t.Fatal(err) } From ca8df5989a4eac8a723c8d2b1bf1c580d326c3dc Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Thu, 2 Jan 2025 15:15:52 +0300 Subject: [PATCH 09/14] updated expected age in test --- menutraversal_test/group_test.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/menutraversal_test/group_test.json b/menutraversal_test/group_test.json index 5ffe615..ac12de3 100644 --- a/menutraversal_test/group_test.json +++ b/menutraversal_test/group_test.json @@ -430,7 +430,7 @@ }, { "input": "1234", - "expectedContent": "My profile:\nName: foo bar\nGender: male\nAge: 79\nLocation: Kilifi\nYou provide: Bananas\n\n0:Back" + "expectedContent": "My profile:\nName: foo bar\nGender: male\nAge: 80\nLocation: Kilifi\nYou provide: Bananas\n\n0:Back" }, { "input": "0", From 29ce4b83bdff170d3e8bb6d24e9754da9dcb3dc4 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Thu, 2 Jan 2025 15:22:07 +0300 Subject: [PATCH 10/14] added tests for HashPIN and VerifyPIN --- common/pin_test.go | 98 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 1 deletion(-) diff --git a/common/pin_test.go b/common/pin_test.go index 9012024..1b11d2c 100644 --- a/common/pin_test.go +++ b/common/pin_test.go @@ -1,6 +1,10 @@ package common -import "testing" +import ( + "testing" + + "golang.org/x/crypto/bcrypt" +) func TestIsValidPIN(t *testing.T) { tests := []struct { @@ -54,3 +58,95 @@ func TestIsValidPIN(t *testing.T) { }) } } + +func TestHashPIN(t *testing.T) { + tests := []struct { + name string + pin string + }{ + { + name: "Valid PIN with 4 digits", + pin: "1234", + }, + { + name: "Valid PIN with leading zeros", + pin: "0001", + }, + { + name: "Empty PIN", + pin: "", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + hashedPIN, err := HashPIN(tt.pin) + if err != nil { + t.Errorf("HashPIN(%q) returned an error: %v", tt.pin, err) + return + } + + if hashedPIN == "" { + t.Errorf("HashPIN(%q) returned an empty hash", tt.pin) + } + + // Ensure the hash can be verified with bcrypt + err = bcrypt.CompareHashAndPassword([]byte(hashedPIN), []byte(tt.pin)) + if tt.pin != "" && err != nil { + t.Errorf("HashPIN(%q) produced a hash that does not match: %v", tt.pin, err) + } + }) + } +} + +func TestVerifyPIN(t *testing.T) { + tests := []struct { + name string + pin string + hashedPIN string + shouldPass bool + }{ + { + name: "Valid PIN verification", + pin: "1234", + hashedPIN: hashPINHelper("1234"), + shouldPass: true, + }, + { + name: "Invalid PIN verification with incorrect PIN", + pin: "5678", + hashedPIN: hashPINHelper("1234"), + shouldPass: false, + }, + { + name: "Invalid PIN verification with empty PIN", + pin: "", + hashedPIN: hashPINHelper("1234"), + shouldPass: false, + }, + { + name: "Invalid PIN verification with invalid hash", + pin: "1234", + hashedPIN: "invalidhash", + shouldPass: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + result := VerifyPIN(tt.hashedPIN, tt.pin) + if result != tt.shouldPass { + t.Errorf("VerifyPIN(%q, %q) = %v; expected %v", tt.hashedPIN, tt.pin, result, tt.shouldPass) + } + }) + } +} + +// Helper function to hash a PIN for testing purposes +func hashPINHelper(pin string) string { + hashedPIN, err := HashPIN(pin) + if err != nil { + panic("Failed to hash PIN for test setup: " + err.Error()) + } + return hashedPIN +} From 491b7424a9176e4d646dca82234e4e3b49968879 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Thu, 2 Jan 2025 16:01:19 +0300 Subject: [PATCH 11/14] point to the correct ./devtools/admin_numbers directory --- internal/handlers/handlerservice.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/handlers/handlerservice.go b/internal/handlers/handlerservice.go index 1da28c3..b2a6f2f 100644 --- a/internal/handlers/handlerservice.go +++ b/internal/handlers/handlerservice.go @@ -43,7 +43,7 @@ func NewLocalHandlerService(ctx context.Context, fp string, debug bool, dbResour if err != nil { return nil, err } - adminstore, err := utils.NewAdminStore(ctx, "admin_numbers") + adminstore, err := utils.NewAdminStore(ctx, "./devtools/admin_numbers") if err != nil { return nil, err } From 91dc9ce82f9cb5ca3e233013f8b0cccf3f0b4e5a Mon Sep 17 00:00:00 2001 From: Mohammed Sohail Date: Fri, 3 Jan 2025 11:10:07 +0300 Subject: [PATCH 12/14] tests: add sample pin/hash pair from migration dataset --- common/pin_test.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/common/pin_test.go b/common/pin_test.go index 1b11d2c..f10ad6b 100644 --- a/common/pin_test.go +++ b/common/pin_test.go @@ -99,6 +99,27 @@ func TestHashPIN(t *testing.T) { } } +func TestVerifyMigratedHashPin(t *testing.T) { + tests := []struct { + pin string + hash string + }{ + { + pin: "1234", + hash: "$2b$08$dTvIGxCCysJtdvrSnaLStuylPoOS/ZLYYkxvTeR5QmTFY3TSvPQC6", + }, + } + + for _, tt := range tests { + t.Run(tt.pin, func(t *testing.T) { + ok := VerifyPIN(tt.hash, tt.pin) + if !ok { + t.Errorf("VerifyPIN could not verify migrated PIN: %v", tt.pin, ok) + } + }) + } +} + func TestVerifyPIN(t *testing.T) { tests := []struct { name string From c26f5683f6a752b0f23fdbc9980a665d31f4555a Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Fri, 3 Jan 2025 11:17:09 +0300 Subject: [PATCH 13/14] removed second unused argument --- common/pin_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/pin_test.go b/common/pin_test.go index f10ad6b..154ab06 100644 --- a/common/pin_test.go +++ b/common/pin_test.go @@ -114,7 +114,7 @@ func TestVerifyMigratedHashPin(t *testing.T) { t.Run(tt.pin, func(t *testing.T) { ok := VerifyPIN(tt.hash, tt.pin) if !ok { - t.Errorf("VerifyPIN could not verify migrated PIN: %v", tt.pin, ok) + t.Errorf("VerifyPIN could not verify migrated PIN: %v", tt.pin) } }) } From 9d6e25e184e1647e97b9f9bfece69f39495f1c15 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Fri, 3 Jan 2025 11:24:24 +0300 Subject: [PATCH 14/14] revert to previous state for the adminstore --- internal/handlers/handlerservice.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/handlers/handlerservice.go b/internal/handlers/handlerservice.go index b2a6f2f..1da28c3 100644 --- a/internal/handlers/handlerservice.go +++ b/internal/handlers/handlerservice.go @@ -43,7 +43,7 @@ func NewLocalHandlerService(ctx context.Context, fp string, debug bool, dbResour if err != nil { return nil, err } - adminstore, err := utils.NewAdminStore(ctx, "./devtools/admin_numbers") + adminstore, err := utils.NewAdminStore(ctx, "admin_numbers") if err != nil { return nil, err }