cutelyst 3.9.1
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
authenticationrealm.h
1/*
2 * SPDX-FileCopyrightText: (C) 2013-2022 Daniel Nicoletti <dantti12@gmail.com>
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5#ifndef AUTHENTICATIONREALM_H
6#define AUTHENTICATIONREALM_H
7
8#include <Cutelyst/Plugins/Authentication/authenticationuser.h>
9#include <Cutelyst/component.h>
10#include <Cutelyst/cutelyst_global.h>
11
12namespace Cutelyst {
13
14class Context;
15class AuthenticationStore;
16class AuthenticationCredential;
17class CUTELYST_PLUGIN_AUTHENTICATION_EXPORT AuthenticationRealm : public Component
18{
19 Q_OBJECT
20public:
22 static char *defaultRealm;
23
29 AuthenticationCredential *credential,
30 const QString &name = QLatin1String(defaultRealm),
31 QObject *parent = nullptr);
32 virtual ~AuthenticationRealm() override;
33
37 AuthenticationStore *store() const;
38
42 AuthenticationCredential *credential() const;
43
47 virtual AuthenticationUser findUser(Context *c, const ParamsMultiMap &userinfo);
48
53 virtual AuthenticationUser authenticate(Context *c, const ParamsMultiMap &authinfo);
54
58 void removePersistedUser(Context *c);
59
63 AuthenticationUser persistUser(Context *c, const AuthenticationUser &user);
64
68 AuthenticationUser restoreUser(Context *c, const QVariant &frozenUser);
69
73 QVariant userIsRestorable(Context *c);
74
75private:
76 friend class Authentication;
77 friend class AuthenticationPrivate;
78
79 AuthenticationStore *m_store;
80 AuthenticationCredential *m_credential;
81};
82
83} // namespace Cutelyst
84
85#endif // AUTHENTICATIONREALM_H
static char * defaultRealm
default realm name
The Cutelyst Component base class.
Definition component.h:26
The Cutelyst Context.
Definition context.h:39
The Cutelyst namespace holds all public Cutelyst API.
Definition Mainpage.dox:8
QMultiMap< QString, QString > ParamsMultiMap