Abstract base class for authentication method plugins.
More...
#include <qgsauthmethod.h>
|
virtual void | clearCachedConfig (const QString &authcfg)=0 |
| Clear any cached configuration. More...
|
|
virtual QString | description () const =0 |
| A non-translated short description representing the auth method for use in debug output and About dialog. More...
|
|
virtual QString | displayDescription () const =0 |
| Translatable display version of the 'description()'. More...
|
|
virtual QString | key () const =0 |
| A non-translated short name representing the auth method. More...
|
|
QStringList | supportedDataProviders () const |
| The data providers that the method supports, allowing for filtering out authcfgs that are not applicable to a given provider, or where the updating code is not currently implemented. More...
|
|
QgsAuthMethod::Expansions | supportedExpansions () const |
| Flags that represent the update points (where authentication configurations are expanded) supported by an authentication method. More...
|
|
virtual bool | updateDataSourceUriItems (QStringList &connectionItems, const QString &authcfg, const QString &dataprovider=QString()) |
| Update data source connection items with authentication components. More...
|
|
virtual void | updateMethodConfig (QgsAuthMethodConfig &mconfig)=0 |
| Update an authentication configuration in place. More...
|
|
virtual bool | updateNetworkProxy (QNetworkProxy &proxy, const QString &authcfg, const QString &dataprovider=QString()) |
| Update proxy settings with authentication components. More...
|
|
virtual bool | updateNetworkReply (QNetworkReply *reply, const QString &authcfg, const QString &dataprovider=QString()) |
| Update a network reply with authentication components. More...
|
|
virtual bool | updateNetworkRequest (QNetworkRequest &request, const QString &authcfg, const QString &dataprovider=QString()) |
| Update a network request with authentication components. More...
|
|
int | version () const |
| Increment this if method is significantly updated, allow updater code to be written for previously stored authcfg. More...
|
|
|
| QgsAuthMethod () |
| Construct a default authentication method. More...
|
|
void | setDataProviders (const QStringList &dataproviders) |
| Sets list of data providers this auth method supports. More...
|
|
void | setExpansions (QgsAuthMethod::Expansions expansions) |
| Sets the support expansions (points in providers where the authentication is injected) of the auth method. More...
|
|
void | setVersion (int version) |
| Sets the version of the auth method (useful for future upgrading) More...
|
|
|
static QString | authMethodTag () |
| Tag signifying that this is an authentcation method (e.g. for use as title in message log panel output) More...
|
|
Abstract base class for authentication method plugins.
Definition at line 41 of file qgsauthmethod.h.
◆ Expansion
Flags that represent the update points (where authentication configurations are expanded) supported by an authentication method.
These equate to the 'update*()' virtual functions below, and allow for update point code to skip calling an unused update by a method, because the base virtual function will always return true
, giving a false impression an update occurred.
- Note
- When adding an 'update' member function, also add the corresponding Expansion flag.
-
These flags will be added to as new update points are added
Enumerator |
---|
NetworkRequest | |
NetworkReply | |
DataSourceUri | |
GenericDataSourceUri | |
NetworkProxy | |
All | |
Definition at line 55 of file qgsauthmethod.h.
◆ QgsAuthMethod()
QgsAuthMethod::QgsAuthMethod |
( |
| ) |
|
|
explicitprotected |
Construct a default authentication method.
- Note
- Non-public since this is an abstract base class
Definition at line 19 of file qgsauthmethod.cpp.
◆ authMethodTag()
static QString QgsAuthMethod::authMethodTag |
( |
| ) |
|
|
inlinestaticprotected |
Tag signifying that this is an authentcation method (e.g. for use as title in message log panel output)
Definition at line 183 of file qgsauthmethod.h.
◆ clearCachedConfig()
virtual void QgsAuthMethod::clearCachedConfig |
( |
const QString & |
authcfg | ) |
|
|
pure virtual |
Clear any cached configuration.
Called when the QgsAuthManager deletes an authentication configuration (authcfg).
- Note
- It is highly recommended that a cache of authentication components (per requested authcfg) be implemented, to avoid excessive queries on the auth database. Such a cache could be as simple as a QHash or QMap of authcfg -> QgsAuthMethodConfig. See 'Basic' auth method plugin for example.
◆ description()
virtual QString QgsAuthMethod::description |
( |
| ) |
const |
|
pure virtual |
A non-translated short description representing the auth method for use in debug output and About dialog.
◆ displayDescription()
virtual QString QgsAuthMethod::displayDescription |
( |
| ) |
const |
|
pure virtual |
◆ key()
virtual QString QgsAuthMethod::key |
( |
| ) |
const |
|
pure virtual |
A non-translated short name representing the auth method.
◆ setDataProviders()
void QgsAuthMethod::setDataProviders |
( |
const QStringList & |
dataproviders | ) |
|
|
inlineprotected |
Sets list of data providers this auth method supports.
Definition at line 191 of file qgsauthmethod.h.
◆ setExpansions()
void QgsAuthMethod::setExpansions |
( |
QgsAuthMethod::Expansions |
expansions | ) |
|
|
inlineprotected |
Sets the support expansions (points in providers where the authentication is injected) of the auth method.
Definition at line 189 of file qgsauthmethod.h.
◆ setVersion()
void QgsAuthMethod::setVersion |
( |
int |
version | ) |
|
|
inlineprotected |
Sets the version of the auth method (useful for future upgrading)
Definition at line 186 of file qgsauthmethod.h.
◆ supportedDataProviders()
QStringList QgsAuthMethod::supportedDataProviders |
( |
| ) |
const |
|
inline |
The data providers that the method supports, allowing for filtering out authcfgs that are not applicable to a given provider, or where the updating code is not currently implemented.
Definition at line 90 of file qgsauthmethod.h.
◆ supportedExpansions()
QgsAuthMethod::Expansions QgsAuthMethod::supportedExpansions |
( |
| ) |
const |
|
inline |
Flags that represent the update points (where authentication configurations are expanded) supported by an authentication method.
- Note
- These should directly correlate to existing 'update*()' member functions
Definition at line 84 of file qgsauthmethod.h.
◆ updateDataSourceUriItems()
virtual bool QgsAuthMethod::updateDataSourceUriItems |
( |
QStringList & |
connectionItems, |
|
|
const QString & |
authcfg, |
|
|
const QString & |
dataprovider = QString() |
|
) |
| |
|
inlinevirtual |
Update data source connection items with authentication components.
- Parameters
-
connectionItems | QStringlist of 'key=value' pairs, as utilized in QgsDataSourceUri::connectionInfo() |
authcfg | Authentication configuration ID |
dataprovider | Textual key for a data provider, e.g. 'postgres', that allows for custom updater code specific to the provider |
- Returns
- Whether the update succeeded
Definition at line 134 of file qgsauthmethod.h.
◆ updateMethodConfig()
Update an authentication configuration in place.
- Note
- Useful for updating previously stored authcfgs, when an authentication method has been significantly updated
◆ updateNetworkProxy()
virtual bool QgsAuthMethod::updateNetworkProxy |
( |
QNetworkProxy & |
proxy, |
|
|
const QString & |
authcfg, |
|
|
const QString & |
dataprovider = QString() |
|
) |
| |
|
inlinevirtual |
Update proxy settings with authentication components.
- Parameters
-
proxy | |
authcfg | Authentication configuration ID |
dataprovider | Textual key for a data provider, e.g. 'proxy', that allows for custom updater code specific to the provider |
- Returns
- Whether the update succeeded
Definition at line 151 of file qgsauthmethod.h.
◆ updateNetworkReply()
virtual bool QgsAuthMethod::updateNetworkReply |
( |
QNetworkReply * |
reply, |
|
|
const QString & |
authcfg, |
|
|
const QString & |
dataprovider = QString() |
|
) |
| |
|
inlinevirtual |
Update a network reply with authentication components.
- Parameters
-
reply | The network reply object to update |
authcfg | Authentication configuration ID |
dataprovider | Textual key for a data provider, e.g. 'postgres', that allows for custom updater code specific to the provider |
- Returns
- Whether the update succeeded
Definition at line 117 of file qgsauthmethod.h.
◆ updateNetworkRequest()
virtual bool QgsAuthMethod::updateNetworkRequest |
( |
QNetworkRequest & |
request, |
|
|
const QString & |
authcfg, |
|
|
const QString & |
dataprovider = QString() |
|
) |
| |
|
inlinevirtual |
Update a network request with authentication components.
- Parameters
-
request | The network request to update |
authcfg | Authentication configuration ID |
dataprovider | Textual key for a data provider, e.g. 'postgres', that allows for custom updater code specific to the provider |
- Returns
- Whether the update succeeded
Definition at line 100 of file qgsauthmethod.h.
◆ version()
int QgsAuthMethod::version |
( |
| ) |
const |
|
inline |
Increment this if method is significantly updated, allow updater code to be written for previously stored authcfg.
Definition at line 77 of file qgsauthmethod.h.
◆ mDataProviders
QStringList QgsAuthMethod::mDataProviders |
|
protected |
◆ mExpansions
QgsAuthMethod::Expansions QgsAuthMethod::mExpansions = QgsAuthMethod::Expansions() |
|
protected |
◆ mMutex
QRecursiveMutex QgsAuthMethod::mMutex |
|
protected |
◆ mVersion
int QgsAuthMethod::mVersion = 0 |
|
protected |
The documentation for this class was generated from the following files: