diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-09-18 11:40:41 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-09-18 11:40:45 +0200 |
commit | a7e7f7fdd2a9d38921476d57f305c9cd4459a556 (patch) | |
tree | d9ad3bdc3e275004a54f508025f0d52227ab18cb /common/synchronizer.h | |
parent | ea2e02ad656640c17d520b5a22c168c3c1faef56 (diff) | |
download | sink-a7e7f7fdd2a9d38921476d57f305c9cd4459a556.tar.gz sink-a7e7f7fdd2a9d38921476d57f305c9cd4459a556.zip |
Avoid storing the password in the configuration
The password (or any other secret), is now cached in the client process
(in-memory only), and delivered to the resource via command.
The resource avoids doing any operations against the source until the
secret is available.
Diffstat (limited to 'common/synchronizer.h')
-rw-r--r-- | common/synchronizer.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/common/synchronizer.h b/common/synchronizer.h index cc082be..bd03ba3 100644 --- a/common/synchronizer.h +++ b/common/synchronizer.h | |||
@@ -60,6 +60,8 @@ public: | |||
60 | bool allChangesReplayed() Q_DECL_OVERRIDE; | 60 | bool allChangesReplayed() Q_DECL_OVERRIDE; |
61 | void flushComplete(const QByteArray &flushId); | 61 | void flushComplete(const QByteArray &flushId); |
62 | 62 | ||
63 | void setSecret(const QString &s); | ||
64 | |||
63 | signals: | 65 | signals: |
64 | void notify(Notification); | 66 | void notify(Notification); |
65 | 67 | ||
@@ -78,6 +80,8 @@ protected: | |||
78 | virtual KAsync::Job<QByteArray> replay(const Sink::ApplicationDomain::Mail &, Sink::Operation, const QByteArray &oldRemoteId, const QList<QByteArray> &); | 80 | virtual KAsync::Job<QByteArray> replay(const Sink::ApplicationDomain::Mail &, Sink::Operation, const QByteArray &oldRemoteId, const QList<QByteArray> &); |
79 | virtual KAsync::Job<QByteArray> replay(const Sink::ApplicationDomain::Folder &, Sink::Operation, const QByteArray &oldRemoteId, const QList<QByteArray> &); | 81 | virtual KAsync::Job<QByteArray> replay(const Sink::ApplicationDomain::Folder &, Sink::Operation, const QByteArray &oldRemoteId, const QList<QByteArray> &); |
80 | protected: | 82 | protected: |
83 | QString secret() const; | ||
84 | |||
81 | ///Calls the callback to enqueue the command | 85 | ///Calls the callback to enqueue the command |
82 | void enqueueCommand(int commandId, const QByteArray &data); | 86 | void enqueueCommand(int commandId, const QByteArray &data); |
83 | 87 | ||
@@ -224,6 +228,7 @@ private: | |||
224 | MessageQueue *mMessageQueue; | 228 | MessageQueue *mMessageQueue; |
225 | bool mSyncInProgress; | 229 | bool mSyncInProgress; |
226 | QMultiHash<QByteArray, SyncRequest> mPendingSyncRequests; | 230 | QMultiHash<QByteArray, SyncRequest> mPendingSyncRequests; |
231 | QString mSecret; | ||
227 | }; | 232 | }; |
228 | 233 | ||
229 | } | 234 | } |