Passkeys: Add support for importing Passkey to entry (#9987)

---------
Co-authored-by: Jonathan White <support@dmapps.us>
This commit is contained in:
Sami Vänttinen 2023-11-23 06:11:25 +02:00 committed by GitHub
parent 013db199cb
commit 13c88e1013
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 459 additions and 176 deletions

View file

@ -19,6 +19,9 @@
#include "browser/BrowserCbor.h"
#include "browser/BrowserMessageBuilder.h"
#include "browser/BrowserService.h"
#include "core/Database.h"
#include "core/Entry.h"
#include "core/Group.h"
#include "crypto/Crypto.h"
#include <QJsonArray>
@ -469,3 +472,27 @@ void TestPasskeys::testSetFlags()
auto discouragedResult = browserPasskeys()->setFlagsFromJson(discouragedJson);
QCOMPARE(discouragedResult, 0x01);
}
void TestPasskeys::testEntry()
{
Database db;
auto* root = db.rootGroup();
root->setUuid(QUuid::createUuid());
auto* group1 = new Group();
group1->setUuid(QUuid::createUuid());
group1->setParent(root);
auto* entry = new Entry();
entry->setGroup(root);
browserService()->addPasskeyToEntry(entry,
QString("example.com"),
QString("example.com"),
QString("username"),
QString("userId"),
QString("userHandle"),
QString("privateKey"));
QVERIFY(entry->hasPasskey());
}