mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 23:25:53 +08:00
refs #502, cookie manager
* use authenticated user data objects in databaseauthentication * shared threadsafe cookie manager across the QNetworkAccessManagers * use cookie manager in existing readers
This commit is contained in:
committed by
Mathew Sutcliffe
parent
98b86b6f27
commit
dda64d0879
@@ -7,18 +7,21 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#ifndef BLACKCORE_DATABASE_USER_H
|
||||
#define BLACKCORE_DATABASE_USER_H
|
||||
#ifndef BLACKCORE_DATABASE_CDATABASEUATHENTICATIONSERVICE_H
|
||||
#define BLACKCORE_DATABASE_CDATABASEUATHENTICATIONSERVICE_H
|
||||
|
||||
//! \file
|
||||
|
||||
#include "blackcore/blackcoreexport.h"
|
||||
#include "blackmisc/network/authenticateduser.h"
|
||||
#include "blackcore/data/globalsetup.h"
|
||||
#include "blackcore/data/authenticateduser.h"
|
||||
#include "blackmisc/statusmessagelist.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QNetworkReply>
|
||||
#include <QNetworkCookieJar>
|
||||
#include <QSharedPointer>
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
@@ -31,9 +34,6 @@ namespace BlackCore
|
||||
//! Constructor
|
||||
CDatabaseAuthenticationService(QObject *parent = nullptr);
|
||||
|
||||
//! Get the user
|
||||
const BlackMisc::Network::CAuthenticatedUser &getUser() const;
|
||||
|
||||
//! Shutdown
|
||||
void gracefulShutdown();
|
||||
|
||||
@@ -55,11 +55,15 @@ namespace BlackCore
|
||||
//! Parse login answer
|
||||
void ps_parseServerResponse(QNetworkReply *nwReplyPtr);
|
||||
|
||||
//! User object changed
|
||||
void ps_userChanged();
|
||||
|
||||
private:
|
||||
BlackMisc::Network::CAuthenticatedUser m_user;
|
||||
CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< data cache
|
||||
QNetworkAccessManager *m_networkManager = nullptr;
|
||||
bool m_shutdown = false;
|
||||
CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< data cache
|
||||
BlackCore::CData<BlackCore::Data::AuthenticatedUser> m_user {this, &CDatabaseAuthenticationService::ps_userChanged};
|
||||
|
||||
QNetworkAccessManager *m_networkManager = nullptr;
|
||||
bool m_shutdown = false;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
|
||||
Reference in New Issue
Block a user