Add option to use entry only for HTTP Basic Auth

This commit is contained in:
varjolintu 2019-11-24 18:10:40 +02:00 committed by Jonathan White
parent 7f262a1210
commit c0796d8fb1
7 changed files with 43 additions and 10 deletions

View file

@ -54,6 +54,7 @@ static const QString KEEPASSHTTP_GROUP_NAME = QStringLiteral("KeePassHttp Passwo
// Extra entry related options saved in custom data
const QString BrowserService::OPTION_SKIP_AUTO_SUBMIT = QStringLiteral("BrowserSkipAutoSubmit");
const QString BrowserService::OPTION_HIDE_ENTRY = QStringLiteral("BrowserHideEntry");
const QString BrowserService::OPTION_ONLY_HTTP_AUTH = QStringLiteral("BrowserOnlyHttpAuth");
// Multiple URL's
const QString BrowserService::ADDITIONAL_URL = QStringLiteral("KP2A_URL");
@ -382,7 +383,12 @@ QJsonArray BrowserService::findMatchingEntries(const QString& id,
QList<Entry*> pwEntries;
for (auto* entry : searchEntries(url, submitUrl, keyList)) {
if (entry->customData()->contains(BrowserService::OPTION_HIDE_ENTRY)
&& entry->customData()->value(BrowserService::OPTION_HIDE_ENTRY) == "true") {
&& entry->customData()->value(BrowserService::OPTION_HIDE_ENTRY) == TRUE_STR) {
continue;
}
if (!httpAuth && entry->customData()->contains(BrowserService::OPTION_ONLY_HTTP_AUTH)
&& entry->customData()->value(BrowserService::OPTION_ONLY_HTTP_AUTH) == TRUE_STR) {
continue;
}
@ -850,7 +856,7 @@ QJsonObject BrowserService::prepareEntry(const Entry* entry)
}
if (entry->isExpired()) {
res["expired"] = "true";
res["expired"] = TRUE_STR;
}
if (entry->customData()->contains(BrowserService::OPTION_SKIP_AUTO_SUBMIT)) {