swift
databaseauthentication.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2015 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #ifndef SWIFT_CORE_DATABASE_CDATABASEUATHENTICATIONSERVICE_H
7 #define SWIFT_CORE_DATABASE_CDATABASEUATHENTICATIONSERVICE_H
8 
9 #include <QObject>
10 #include <QString>
11 
13 #include "core/swiftcoreexport.h"
14 #include "misc/datacache.h"
15 #include "misc/statusmessagelist.h"
16 
17 class QNetworkReply;
18 
19 namespace swift::misc::network
20 {
21  class CAuthenticatedUser;
22 }
23 namespace swift::core::db
24 {
27  {
28  Q_OBJECT
29 
30  public:
32  static const QStringList &getLogCategories();
33 
35  CDatabaseAuthenticationService(QObject *parent = nullptr);
36 
38  void gracefulShutdown();
39 
42 
44  bool isUserAuthenticated() const;
45 
47  swift::misc::CStatusMessageList login(const QString &id, const QString &password);
48 
50  void logoff();
51 
52  signals:
55  const swift::misc::CStatusMessageList &loginStatus);
56 
59 
60  private:
62  void parseServerResponse(QNetworkReply *nwReplyPtr);
63 
65  void userChanged();
66 
68  this, &CDatabaseAuthenticationService::userChanged
69  };
70  bool m_shutdown = false;
71  };
72 } // namespace swift::core::db
73 
74 #endif // SWIFT_CORE_DATABASE_CDATABASEUATHENTICATIONSERVICE_H
Database user used with swift DB. Features role and cookie handling.
void userAuthenticationFinished(const swift::misc::network::CAuthenticatedUser &user, const swift::misc::CStatusMessageList &loginStatus)
User authenticated.
Status messages, e.g. from Core -> GUI.
Value object encapsulating information of an authentiated user.
Classes interacting with the swift database (aka "datastore").
#define SWIFT_CORE_EXPORT
Export a class or function from the library.