1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/auth/qgsauthmethod.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsAuthMethod : QObject
{
%Docstring(signature="appended")
Abstract base class for authentication method plugins
%End
%TypeHeaderCode
#include "qgsauthmethod.h"
%End
public:
enum Expansion /BaseType=IntEnum/
{
// TODO: Figure out all different authentication expansions current layer providers use
NetworkRequest,
NetworkReply,
DataSourceUri,
GenericDataSourceUri,
NetworkProxy,
All
};
typedef QFlags<QgsAuthMethod::Expansion> Expansions;
virtual QString key() const = 0;
%Docstring
A non-translated short name representing the auth method
%End
virtual QString description() const = 0;
%Docstring
A non-translated short description representing the auth method for use
in debug output and About dialog
%End
virtual QString displayDescription() const = 0;
%Docstring
Translatable display version of the
':py:func:`~QgsAuthMethod.description`'
%End
int version() const;
%Docstring
Increment this if method is significantly updated, allow updater code to
be written for previously stored authcfg
%End
%If (HAVE_GUI)
virtual QWidget *editWidget( QWidget *parent ) const;
%Docstring
Constructs the configuration for the authentication method
.. versionadded:: 3.22
%End
%End
QgsAuthMethod::Expansions supportedExpansions() const;
%Docstring
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
%End
QStringList supportedDataProviders() const;
%Docstring
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.
%End
virtual bool updateNetworkRequest( QNetworkRequest &request, const QString &authcfg,
const QString &dataprovider = QString() );
%Docstring
Update a network request with authentication components
:param request: The network request to update
:param authcfg: Authentication configuration ID
:param dataprovider: Textual key for a data provider, e.g. 'postgres',
that allows for custom updater code specific to the
provider
:return: Whether the update succeeded
%End
virtual bool updateNetworkReply( QNetworkReply *reply, const QString &authcfg,
const QString &dataprovider = QString() );
%Docstring
Update a network reply with authentication components
:param reply: The network reply object to update
:param authcfg: Authentication configuration ID
:param dataprovider: Textual key for a data provider, e.g. 'postgres',
that allows for custom updater code specific to the
provider
:return: Whether the update succeeded
%End
virtual bool updateDataSourceUriItems( QStringList &connectionItems, const QString &authcfg,
const QString &dataprovider = QString() );
%Docstring
Update data source connection items with authentication components
:param connectionItems: QStringlist of 'key=value' pairs, as utilized in
:py:func:`QgsDataSourceUri.connectionInfo()`
:param authcfg: Authentication configuration ID
:param dataprovider: Textual key for a data provider, e.g. 'postgres',
that allows for custom updater code specific to the
provider
:return: Whether the update succeeded
%End
virtual bool updateNetworkProxy( QNetworkProxy &proxy, const QString &authcfg,
const QString &dataprovider = QString() );
%Docstring
Update proxy settings with authentication components
:param proxy:
:param authcfg: Authentication configuration ID
:param dataprovider: Textual key for a data provider, e.g. 'proxy', that
allows for custom updater code specific to the
provider
:return: Whether the update succeeded
%End
virtual void clearCachedConfig( const QString &authcfg ) = 0;
%Docstring
Clear any cached configuration. Called when the
:py:class:`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 -> :py:class:`QgsAuthMethodConfig`. See 'Basic' auth method plugin for example.
%End
virtual void updateMethodConfig( QgsAuthMethodConfig &mconfig ) = 0;
%Docstring
Update an authentication configuration in place
.. note::
Useful for updating previously stored authcfgs, when an authentication method has been significantly updated
%End
protected:
explicit QgsAuthMethod();
%Docstring
Construct a default authentication method
.. note::
Non-public since this is an abstract base class
%End
static QString authMethodTag();
%Docstring
Tag signifying that this is an authentcation method (e.g. for use as
title in message log panel output)
%End
void setVersion( int version );
%Docstring
Sets the version of the auth method (useful for future upgrading)
%End
void setExpansions( QgsAuthMethod::Expansions expansions );
%Docstring
Sets the support expansions (points in providers where the
authentication is injected) of the auth method
%End
void setDataProviders( const QStringList &dataproviders );
%Docstring
Sets list of data providers this auth method supports
%End
};
QFlags<QgsAuthMethod::Expansion> operator|(QgsAuthMethod::Expansion f1, QFlags<QgsAuthMethod::Expansion> f2);
typedef QHash<QString, QgsAuthMethod *> QgsAuthMethodsMap;
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/auth/qgsauthmethod.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|