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 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/auth/qgsauthconfigurationstoragedb.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsAuthConfigurationStorageDb : QgsAuthConfigurationStorage
{
%Docstring(signature="appended")
QSqlDatabase based implementation of
:py:class:`QgsAuthConfigurationStorage`.
.. versionadded:: 3.40
%End
%TypeHeaderCode
#include "qgsauthconfigurationstoragedb.h"
%End
public:
QgsAuthConfigurationStorageDb( const QMap<QString, QVariant> &settings );
%Docstring
Creates a new QgsAuthConfigurationStorageDb instance from the specified
``settings``. Settings can contain the following keys:
Mandatory settings:
- driver: the database driver to use (default is "QSQLITE", see: https://doc.qt.io/qt-6/sql-driver.html)
- database: the database name (or path in case of QSQLITE)
Optional settings:
- host: the database host
- user: the database user
- password: the database password
- port: the database port
- schema: the database schema for all the tables (ignored if not
supported)
- options: the database connection options (see:
https://doc.qt.io/qt-6/qsqldatabase.html#setConnectOptions)
.. note::
Even if this generic storage also works with a pre-existing SQLite DB,
a convenience subclass :py:class:`QgsAuthConfigurationStorageSqlite` is provided for
SQLite DBs.
%End
QgsAuthConfigurationStorageDb( const QString &uri );
%Docstring
Creates a new QgsAuthConfigurationStorageDb instance from the specified
``uri``. The URI should be in the format:
\verbatim<DRIVER>://<USER>:<PASSWORD>@<HOST>:<PORT>/<DATABASE>[?OPTIONS]\endverbatim
.. note::
It is not possible to set the schema in the URI, pass SCHEMA=\verbatim<SCHEMA>\endverbatim in the options instead.
%End
~QgsAuthConfigurationStorageDb();
QSqlDatabase authDatabaseConnection() const;
%Docstring
Returns the database connection used by this storage.
%End
public:
virtual QString name() const;
virtual QString type() const;
virtual QString description() const;
virtual QString id() const;
virtual QgsAuthMethodConfigsMap authMethodConfigs( const QStringList &allowedMethods = QStringList() ) const;
virtual QgsAuthMethodConfigsMap authMethodConfigsWithPayload( ) const;
virtual QgsAuthMethodConfig loadMethodConfig( const QString &id, QString &payload /Out/, bool full = false ) const;
virtual bool storeMethodConfig( const QgsAuthMethodConfig &mconfig, const QString &payload );
virtual bool removeMethodConfig( const QString &id );
virtual bool methodConfigExists( const QString &id ) const;
virtual bool storeAuthSetting( const QString &key, const QString &value );
virtual QString loadAuthSetting( const QString &key ) const;
virtual bool removeAuthSetting( const QString &key );
virtual bool authSettingExists( const QString &key ) const;
virtual bool clearMethodConfigs();
virtual bool erase();
virtual bool isReady() const;
virtual bool initialize();
virtual QList<QgsAuthConfigurationStorage::SettingParameter> settingsParameters() const;
virtual bool storeCertIdentity( const QSslCertificate &cert, const QString &keyPem );
virtual bool removeCertIdentity( const QSslCertificate &cert );
virtual const QSslCertificate loadCertIdentity( const QString &id ) const;
virtual const QPair<QSslCertificate, QString> loadCertIdentityBundle( const QString &id ) const;
virtual const QList<QSslCertificate> certIdentities() const;
virtual QStringList certIdentityIds() const;
virtual bool certIdentityExists( const QString &id ) const;
virtual bool removeCertIdentity( const QString &id );
virtual bool storeSslCertCustomConfig( const QgsAuthConfigSslServer &config );
virtual QStringList sslCertCustomConfigIds() const;
virtual const QgsAuthConfigSslServer loadSslCertCustomConfig( const QString &id, const QString &hostport ) const;
virtual const QgsAuthConfigSslServer loadSslCertCustomConfigByHost( const QString &hostport ) const;
virtual const QList<QgsAuthConfigSslServer> sslCertCustomConfigs() const;
virtual bool sslCertCustomConfigExists( const QString &id, const QString &hostport );
virtual bool removeSslCertCustomConfig( const QString &id, const QString &hostport );
virtual bool storeCertAuthority( const QSslCertificate &cert );
virtual QStringList certAuthorityIds() const;
virtual const QSslCertificate loadCertAuthority( const QString &id ) const;
virtual bool certAuthorityExists( const QSslCertificate &cert ) const;
virtual bool removeCertAuthority( const QSslCertificate &cert );
virtual const QMap<QString, QgsAuthCertUtils::CertTrustPolicy> caCertsPolicy() const;
virtual const QList<QSslCertificate> caCerts() const;
virtual bool storeCertTrustPolicy( const QSslCertificate &cert, QgsAuthCertUtils::CertTrustPolicy policy );
virtual QgsAuthCertUtils::CertTrustPolicy loadCertTrustPolicy( const QSslCertificate &cert ) const;
virtual bool removeCertTrustPolicy( const QSslCertificate &cert );
virtual bool certTrustPolicyExists( const QSslCertificate &cert ) const;
virtual const QList<QgsAuthConfigurationStorage::MasterPasswordConfig> masterPasswords( ) const;
virtual bool storeMasterPassword( const QgsAuthConfigurationStorage::MasterPasswordConfig &config );
virtual bool clearMasterPasswords();
virtual QString methodConfigTableName() const;
%Docstring
Returns the name of the table used to store the method configurations.
%End
virtual QString authSettingsTableName() const;
%Docstring
Returns the name of the table used to store the auth settings.
%End
virtual QString certIdentityTableName() const;
%Docstring
Returns the name of the table used to store the certificate identities.
%End
virtual QString certAuthorityTableName() const;
%Docstring
Returns the name of the table used to store the certificate authorities.
%End
virtual QString sslCertCustomConfigTableName() const;
%Docstring
Returns the name of the table used to store the SSL custom
configurations.
%End
virtual QString certTrustPolicyTableName() const;
%Docstring
Returns the name of the table used to store the certificate trust
policies.
%End
virtual QString masterPasswordTableName() const;
%Docstring
Returns the name of the table used to store the master passwords.
%End
virtual bool tableExists( const QString &table ) const;
%Docstring
Returns ``True`` if the specified ``table`` exists in the database,
``False`` otherwise.
.. note::
The schema is automatically prepended to the table name.
%End
virtual QString quotedQualifiedIdentifier( const QString &identifier, bool isIndex = false ) const;
%Docstring
Returns the quoted identifier, prefixed with the schema (if not null),
ready for the insertion into a SQL query.
:param identifier: the identifier to quote.
:param isIndex: if ``True``, the identifier is treated as an index name.
%End
protected:
bool authDbOpen() const;
%Docstring
Opens the connction to the database.
:return: ``True`` if the connection was opened successfully, ``False``
otherwise.
%End
bool authDbQuery( QSqlQuery *query, const QString &sql = QString() ) const;
%Docstring
Runs the specified ``query`` on the database. Optional ``sql`` can be
provided.
:return: ``True`` if the query was executed successfully, ``False``
otherwise.
%End
bool authDbTransactionQuery( QSqlQuery *query );
%Docstring
Executes the specified ``query`` on the database using a transaction.
Optional ``sql`` can be provided.
:return: ``True`` if the query was executed successfully, ``False``
otherwise.
%End
bool createConfigTables();
%Docstring
Creates the configuration tables in the database.
:return: ``True`` if the tables were created successfully, ``False``
otherwise.
%End
bool createCertTables();
%Docstring
Creates the certificate tables in the database.
:return: ``True`` if the tables were created successfully, ``False``
otherwise.
%End
virtual void checkCapabilities();
%Docstring
Checks the capabilities of the storage.
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/auth/qgsauthconfigurationstoragedb.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|