ImagingTools Core SDK
CGqlContextControllerComp.h
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ImtCore-Commercial
2#pragma once
3
4
5// ACF includes
6#include <ilog/TLoggerCompWrap.h>
7
8// ImtCore includes
9#include <imtbase/IObjectCollection.h>
10#include <imtgql/IGqlContextController.h>
11#include <imtauth/IJwtSessionController.h>
12#include <imtauth/IPersonalAccessTokenManager.h>
13
14
15namespace imtservergql
16{
17
18
19class CGqlContextControllerComp:
20 public ilog::CLoggerComponentBase,
22{
23public:
24 typedef ilog::CLoggerComponentBase BaseClass;
25
26 I_BEGIN_COMPONENT(CGqlContextControllerComp);
27 I_REGISTER_INTERFACE(imtgql::IGqlContextController);
28 I_ASSIGN(m_userCollectionCompPtr, "UserCollection", "User collection", false, "UserCollection");
29 I_ASSIGN(m_userSettingsCollectionCompPtr, "UserSettingsCollection", "User settings collection", false, "UserSettingsCollection");
30 I_ASSIGN(m_jwtSessionControllerCompPtr, "JwtSessionController", "JWT session controller", false, "JwtSessionController");
31 I_ASSIGN(m_patManagerCompPtr, "PersonalAccessTokenManager", "Personal Access Token manager", false, "PersonalAccessTokenManager");
32 I_END_COMPONENT;
33
34 // reimplemented (imtgql::IGqlContextController)
35 virtual imtgql::IGqlContext* GetRequestContext(
36 const imtgql::CGqlRequest& gqlRequest,
37 const QByteArray& token,
38 const imtgql::IGqlContext::Headers& headers,
39 QString& errorMessage) const override;
40
41private:
42 I_REF(imtbase::IObjectCollection, m_userCollectionCompPtr);
43 I_REF(imtbase::IObjectCollection, m_userSettingsCollectionCompPtr);
44 I_REF(imtauth::IJwtSessionController, m_jwtSessionControllerCompPtr);
45 I_REF(imtauth::IPersonalAccessTokenManager, m_patManagerCompPtr);
46};
47
48
49} // namespace imtservergql
50
51