Bitwarden import: Add support for timestamps and password history (#12588)

* Closes #12587

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: droidmonkey <2809491+droidmonkey@users.noreply.github.com>
Co-authored-by: Jonathan White <support@dmapps.us>
This commit is contained in:
Copilot
2025-10-26 08:10:01 -04:00
committed by GitHub
parent 6ca42103b8
commit 682269f622
3 changed files with 80 additions and 0 deletions

View File

@@ -228,6 +228,16 @@ void TestImports::testBitwarden()
QCOMPARE(entry->attribute("KP2A_URL_2"), QStringLiteral("https://gmail.com"));
// Check TOTP
QVERIFY(entry->hasTotp());
// Check Modified and Created timestamps
QCOMPARE(entry->timeInfo().lastModificationTime(),
QDateTime::fromString(QStringLiteral("2024-12-25T12:00:00Z"), Qt::ISODate));
QCOMPARE(entry->timeInfo().creationTime(),
QDateTime::fromString(QStringLiteral("2024-12-01T12:00:00Z"), Qt::ISODate));
// Check Password History
QCOMPARE(entry->historyItems().size(), 1);
QCOMPARE(entry->historyItems().first()->password(), QStringLiteral("oldpassword"));
QCOMPARE(entry->historyItems().first()->timeInfo().lastModificationTime(),
QDateTime::fromString(QStringLiteral("2024-12-01T12:00:00Z"), Qt::ISODate));
// NOTE: Bitwarden does not export attachments
// NOTE: Bitwarden does not export expiration dates

View File

@@ -11,6 +11,9 @@
],
"items": [
{
"revisionDate": "2024-12-25T12:00:00.000Z",
"creationDate": "2024-12-01T12:00:00.000Z",
"deletedDate": null,
"id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaa",
"organizationId": null,
"folderId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
@@ -43,6 +46,9 @@
]
},
{
"revisionDate": "2024-12-25T12:00:00.000Z",
"creationDate": "2024-12-01T12:00:00.000Z",
"deletedDate": null,
"id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb",
"organizationId": null,
"folderId": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy",
@@ -80,6 +86,9 @@
]
},
{
"revisionDate": "2024-12-25T12:00:00.000Z",
"creationDate": "2024-12-01T12:00:00.000Z",
"deletedDate": null,
"id": "cccccccc-cccc-cccc-cccc-cccccccccccc",
"organizationId": null,
"folderId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
@@ -129,6 +138,15 @@
]
},
{
"passwordHistory": [
{
"lastUsedDate": "2024-12-01T12:00:00.000Z",
"password": "oldpassword"
}
],
"revisionDate": "2024-12-25T12:00:00.000Z",
"creationDate": "2024-12-01T12:00:00.000Z",
"deletedDate": null,
"id": "dddddddd-dddd-dddd-dddd-dddddddddddd",
"organizationId": null,
"folderId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",