|
Cutelyst
2.14.2
|

Public Member Functions | |
| Authentication (Application *parent) | |
| Constructs a new Authentication object with the given parent. | |
| void | addRealm (AuthenticationRealm *realm) |
Adds the realm with name. More... | |
| void | addRealm (AuthenticationStore *store, AuthenticationCredential *credential, const QString &name=QLatin1String(defaultRealm)) |
Creates a new AuthenticationRealm using store, credential and name to build it. More... | |
| AuthenticationRealm * | realm (const QString &name=QLatin1String(defaultRealm)) const |
Returns an AuthenticationRealm object that was registered with name. | |
Public Member Functions inherited from Cutelyst::Plugin | |
| Plugin (Application *parent) | |
Public Member Functions inherited from QObject | |
| QObject (QObject *parent) | |
| bool | blockSignals (bool block) |
| const QObjectList & | children () const |
| QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
| void | deleteLater () |
| void | destroyed (QObject *obj) |
| bool | disconnect (const char *signal, const QObject *receiver, const char *method) const |
| bool | disconnect (const QObject *receiver, const char *method) const |
| void | dumpObjectInfo () |
| void | dumpObjectTree () |
| QList< QByteArray > | dynamicPropertyNames () const |
| virtual bool | event (QEvent *e) |
| virtual bool | eventFilter (QObject *watched, QEvent *event) |
| T | findChild (const QString &name, Qt::FindChildOptions options) const |
| QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const |
| QList< T > | findChildren (const QRegExp ®Exp, Qt::FindChildOptions options) const |
| QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const |
| bool | inherits (const char *className) const |
| void | installEventFilter (QObject *filterObj) |
| bool | isWidgetType () const |
| bool | isWindowType () const |
| void | killTimer (int id) |
| virtual const QMetaObject * | metaObject () const |
| void | moveToThread (QThread *targetThread) |
| QString | objectName () const |
| void | objectNameChanged (const QString &objectName) |
| QObject * | parent () const |
| QVariant | property (const char *name) const |
| void | removeEventFilter (QObject *obj) |
| void | setObjectName (const QString &name) |
| void | setParent (QObject *parent) |
| bool | setProperty (const char *name, const QVariant &value) |
| bool | signalsBlocked () const |
| int | startTimer (int interval, Qt::TimerType timerType) |
| QThread * | thread () const |
Static Public Member Functions | |
| static bool | authenticate (Context *c, const ParamsMultiMap &userinfo, const QString &realm=QLatin1String(defaultRealm)) |
| static bool | authenticate (Context *c, const QString &realm=QLatin1String(defaultRealm)) |
| static AuthenticationUser | findUser (Context *c, const ParamsMultiMap &userinfo, const QString &realm=QLatin1String(defaultRealm)) |
Tries to find the user with userinfo using the realm, returning a non null AuthenticationUser on success. | |
| static void | logout (Context *c) |
| static AuthenticationUser | user (Context *c) |
| static bool | userExists (Context *c) |
| static bool | userInRealm (Context *c, const QString &realmName=QLatin1String(defaultRealm)) |
Static Public Member Functions inherited from QObject | |
| QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
| QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
| QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
| QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
| QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
| bool | disconnect (const QMetaObject::Connection &connection) |
| bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
| bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
| bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
| QString | tr (const char *sourceText, const char *disambiguation, int n) |
| QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Static Public Attributes | |
| static char * | defaultRealm |
| default realm name | |
Protected Member Functions | |
| virtual bool | setup (Application *app) override |
Protected Member Functions inherited from QObject | |
| virtual void | childEvent (QChildEvent *event) |
| virtual void | connectNotify (const QMetaMethod &signal) |
| virtual void | customEvent (QEvent *event) |
| virtual void | disconnectNotify (const QMetaMethod &signal) |
| bool | isSignalConnected (const QMetaMethod &signal) const |
| int | receivers (const char *signal) const |
| QObject * | sender () const |
| int | senderSignalIndex () const |
| virtual void | timerEvent (QTimerEvent *event) |
Additional Inherited Members | |
Properties inherited from QObject | |
| objectName | |
Definition at line 49 of file authentication.h.
| void Authentication::addRealm | ( | Cutelyst::AuthenticationRealm * | realm | ) |
Definition at line 55 of file authentication.cpp.
References QObject::objectName, realm(), and QObject::setParent().
| void Cutelyst::Authentication::addRealm | ( | Cutelyst::AuthenticationStore * | store, |
| Cutelyst::AuthenticationCredential * | credential, | ||
| const QString & | name = QLatin1String(defaultRealm) |
||
| ) |
Definition at line 63 of file authentication.cpp.
|
static |
Returns true if the userinfo could be validated against a realm.
Definition at line 74 of file authentication.cpp.
References Cutelyst::AuthenticationRealm::authenticate(), Cutelyst::AuthenticationUser::isNull(), realm(), and user().
Referenced by authenticate().
|
inlinestatic |
Returns true if the request information could be validated against a realm.
Definition at line 129 of file authentication.h.
References authenticate().
|
static |
Logs the user out. Deletes the currently logged in user from the Context and the session. It does not delete the session.
Definition at line 161 of file authentication.cpp.
References realm(), and Cutelyst::AuthenticationRealm::removePersistedUser().
|
overrideprotectedvirtual |
Reimplement this if you need to connect to the signals emitted from Cutelyst::Application
Reimplemented from Cutelyst::Plugin.
Definition at line 175 of file authentication.cpp.
References QObject::connect(), and Cutelyst::Application::postForked().
|
static |
Returns the authenticated user if any, if you only need to know if the user is authenticated (rather than retrieving it's ID) use userExists instead which is faster.
Definition at line 113 of file authentication.cpp.
References QVariant::isNull(), Cutelyst::Context::stash(), and QVariant::value().
Referenced by authenticate(), Cutelyst::RoleACL::canVisit(), and userInRealm().
|
static |
Returns true if a user is logged in right now. The difference between userExists() and user() is that userExists will return true if a user is logged in, even if it has not been yet retrieved from the storage backend. If you only need to know if the user is logged in, depending on the storage mechanism this can be much more efficient. userExists() only looks into the session while user() is trying to restore the user.
Definition at line 125 of file authentication.cpp.
References Cutelyst::Context::stash().
|
static |
Works like user_exists, except that it only returns true if a user is both logged in right now and was retrieved from the realm provided.
Definition at line 141 of file authentication.cpp.
References QVariant::isNull(), Cutelyst::Component::name(), realm(), Cutelyst::Context::stash(), user(), and QVariant::value().
1.8.6