feat: add Chromium Browser with new v2 architecture (#530)

* feat: add Chromium Browser implementation with new architecture
* refactor: replace Walk with ReadDir+Stat for profile discovery
* refactor: remove queries override, use extractors for Yandex passwords
* refactor: remove dataSource wrapper, use []sourcePath directly
* fix: address Copilot review feedback on chromium_new.go
* fix: always call key retriever regardless of Local State existence
This commit is contained in:
Roger
2026-04-02 22:36:12 +08:00
committed by moonD4rk
parent 1ec2781131
commit 1b8bb1df3d
9 changed files with 899 additions and 54 deletions
+3 -6
View File
@@ -5,8 +5,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/moond4rk/hackbrowserdata/types"
)
func TestExtractPasswords(t *testing.T) {
@@ -15,7 +13,7 @@ func TestExtractPasswords(t *testing.T) {
insertLogin("https://new.com", "https://new.com/login", "bob", "", 13360000000000000),
)
got, err := extractPasswords(nil, path, "")
got, err := extractPasswords(nil, path)
require.NoError(t, err)
require.Len(t, got, 2)
@@ -30,13 +28,12 @@ func TestExtractPasswords(t *testing.T) {
assert.Empty(t, got[0].Password)
}
func TestExtractPasswords_YandexQueryOverride(t *testing.T) {
func TestExtractYandexPasswords(t *testing.T) {
path := createTestDB(t, "Ya Passman Data", loginsSchema,
insertLogin("https://origin.yandex.ru", "https://action.yandex.ru/submit", "user", "", 13350000000000000),
)
// Yandex uses action_url instead of origin_url
got, err := extractPasswords(nil, path, yandexQueryOverrides[types.Password])
got, err := extractYandexPasswords(nil, path)
require.NoError(t, err)
require.Len(t, got, 1)
assert.Equal(t, "https://action.yandex.ru/submit", got[0].URL) // action_url, not origin_url