aboutsummaryrefslogtreecommitdiff
path: root/libraries/katabasis
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/katabasis')
-rw-r--r--libraries/katabasis/CMakeLists.txt9
-rw-r--r--libraries/katabasis/acknowledgements.md12
-rw-r--r--libraries/katabasis/include/katabasis/DeviceFlow.h1
-rw-r--r--libraries/katabasis/src/DeviceFlow.cpp6
-rw-r--r--libraries/katabasis/src/Reply.cpp2
5 files changed, 21 insertions, 9 deletions
diff --git a/libraries/katabasis/CMakeLists.txt b/libraries/katabasis/CMakeLists.txt
index f764feb6..643244ed 100644
--- a/libraries/katabasis/CMakeLists.txt
+++ b/libraries/katabasis/CMakeLists.txt
@@ -38,6 +38,15 @@ set( katabasis_PUBLIC
include/katabasis/RequestParameter.h
)
+ecm_qt_declare_logging_category(katabasis_PRIVATE
+ HEADER KatabasisLogging.h # NOTE: this won't be in src/, but CMAKE_BINARY_DIR/src isn't included by default so this should be fine
+ IDENTIFIER katabasisCredentials
+ CATEGORY_NAME "katabasis.credentials"
+ DEFAULT_SEVERITY Warning
+ DESCRIPTION "Secrets and credentials from Katabasis"
+ EXPORT "Katabasis"
+)
+
add_library( Katabasis STATIC ${katabasis_PRIVATE} ${katabasis_PUBLIC} )
target_link_libraries(Katabasis Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Network)
diff --git a/libraries/katabasis/acknowledgements.md b/libraries/katabasis/acknowledgements.md
index ccc7c263..a6989d15 100644
--- a/libraries/katabasis/acknowledgements.md
+++ b/libraries/katabasis/acknowledgements.md
@@ -8,10 +8,10 @@
> Redistribution and use in source and binary forms, with or without
> modification, are permitted provided that the following conditions are met:
>
-> * Redistributions of source code must retain the above copyright notice, this
+> * Redistributions of source code must retain the above copyright notice, this
> list of conditions and the following disclaimer.
>
-> * Redistributions in binary form must reproduce the above copyright notice,
+> * Redistributions in binary form must reproduce the above copyright notice,
> this list of conditions and the following disclaimer in the documentation
> and/or other materials provided with the distribution.
>
@@ -36,12 +36,12 @@ Cryptographic methods for Qt.
> Redistribution and use in source and binary forms, with or without
> modification, are permitted provided that the following conditions are met:
>
-> * Redistributions of source code must retain the above copyright
+> * Redistributions of source code must retain the above copyright
> notice, this list of conditions and the following disclaimer.
-> * Redistributions in binary form must reproduce the above copyright
+> * Redistributions in binary form must reproduce the above copyright
> notice, this list of conditions and the following disclaimer in the
> documentation and/or other materials provided with the distribution.
-> * Neither the name of the Rathenau Instituut, Andre Somers nor the
+> * Neither the name of the Rathenau Instituut, Andre Somers nor the
> names of its contributors may be used to endorse or promote products
> derived from this software without specific prior written permission.
>
@@ -62,7 +62,7 @@ Configurable settings storage, Twitter XAuth specialization, new demos, cleanups
> "Hi Akos,
>
-> I'm writing this mail to confirm that my contributions to the O2 library, available here https://github.com/pipacs/o2, can be freely distributed according to the project's license (as shown in the LICENSE file).
+> I'm writing this mail to confirm that my contributions to the O2 library, available here <https://github.com/pipacs/o2>, can be freely distributed according to the project's license (as shown in the LICENSE file).
>
> Regards,
> -mandeep"
diff --git a/libraries/katabasis/include/katabasis/DeviceFlow.h b/libraries/katabasis/include/katabasis/DeviceFlow.h
index b68c92e0..0401df3c 100644
--- a/libraries/katabasis/include/katabasis/DeviceFlow.h
+++ b/libraries/katabasis/include/katabasis/DeviceFlow.h
@@ -1,5 +1,6 @@
#pragma once
+#include <QLoggingCategory>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
diff --git a/libraries/katabasis/src/DeviceFlow.cpp b/libraries/katabasis/src/DeviceFlow.cpp
index f78fd620..f49fcb7d 100644
--- a/libraries/katabasis/src/DeviceFlow.cpp
+++ b/libraries/katabasis/src/DeviceFlow.cpp
@@ -19,9 +19,11 @@
#include "katabasis/PollServer.h"
#include "katabasis/Globals.h"
+#include "KatabasisLogging.h"
#include "JsonResponse.h"
namespace {
+
// ref: https://tools.ietf.org/html/rfc8628#section-3.2
// Exception: Google sign-in uses "verification_url" instead of "*_uri" - we'll accept both.
bool hasMandatoryDeviceAuthParams(const QVariantMap& params)
@@ -333,9 +335,7 @@ QString DeviceFlow::refreshToken() {
}
void DeviceFlow::setRefreshToken(const QString &v) {
-#ifndef NDEBUG
- qDebug() << "DeviceFlow::setRefreshToken" << v << "...";
-#endif
+ qCDebug(katabasisCredentials) << "new refresh token:" << v;
token_.refresh_token = v;
}
diff --git a/libraries/katabasis/src/Reply.cpp b/libraries/katabasis/src/Reply.cpp
index 3e27a7e6..c2607900 100644
--- a/libraries/katabasis/src/Reply.cpp
+++ b/libraries/katabasis/src/Reply.cpp
@@ -40,6 +40,8 @@ void ReplyList::remove(QNetworkReply *reply) {
if (o2Reply) {
o2Reply->stop();
(void)replies_.removeOne(o2Reply);
+ // we took ownership, we must free
+ delete o2Reply;
}
}