Skip to content

Commit

Permalink
Auth Manager integration
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Jul 11, 2024
1 parent 18e4005 commit d3b430c
Show file tree
Hide file tree
Showing 11 changed files with 969 additions and 1,503 deletions.
76 changes: 69 additions & 7 deletions python/PyQt6/core/auto_generated/auth/qgsauthmanager.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@




class QgsAuthManager : QObject
{
%Docstring(signature="appended")
Expand Down Expand Up @@ -77,19 +76,35 @@ not already been done.

~QgsAuthManager();

QSqlDatabase authDatabaseConnection() const;
QgsAuthConfigurationStorageRegistry *authConfigurationStorageRegistry() const;
%Docstring
Return the authentication configuration storage registry.

.. versionadded:: 3.40
%End

QSqlDatabase authDatabaseConnection() const /Deprecated/;
%Docstring
Sets up the application instance of the authentication database connection

.. deprecated:: QGIS 3.40
direct access to the DB is not allowed, use :py:class:`QgsAuthConfigurationStorage` API instead.
%End

const QString authDatabaseConfigTable() const;
const QString authDatabaseConfigTable() const /Deprecated/;
%Docstring
Name of the authentication database table that stores configs

.. deprecated:: QGIS 3.40
direct access to the DB is not allowed, use :py:class:`QgsAuthConfigurationStorage` API instead.
%End

const QString authDatabaseServersTable() const;
const QString authDatabaseServersTable() const /Deprecated/;
%Docstring
Name of the authentication database table that stores server exceptions/configs

.. deprecated:: QGIS 3.40
direct access to the DB is not allowed, use :py:class:`QgsAuthConfigurationStorage` API instead.
%End


Expand All @@ -103,11 +118,26 @@ Whether QCA has the qca-ossl plugin, which a base run-time requirement
Standard message for when QCA's qca-ossl plugin is missing and system is disabled
%End

const QString authenticationDatabasePath() const;
const QString authenticationDatabasePath() const;
%Docstring
The standard authentication database file in ~/.qgis3/ or defined location

.. seealso:: :py:func:`QgsApplication.qgisAuthDatabaseFilePath`

.. deprecated:: QGIS 3.40
use :py:func:`~QgsAuthManager.authenticationDatabaseUri` instead.
%End

static bool isFilesystemBasedDatabase( const QString &uri );
%Docstring
Returns the ``True`` if the ``uri`` is a filesystem-based database (SQLite).
%End

const QString authenticationDatabaseUri() const;
%Docstring
Returns the authentication database connection URI.

.. versionadded:: 3.40
%End

bool setMasterPassword( bool verify = false );
Expand Down Expand Up @@ -763,6 +793,7 @@ Store the password manager into the wallet

static const QString AUTH_MAN_TAG;


signals:

void passwordHelperFailure();
Expand All @@ -777,7 +808,21 @@ Signals emitted on password helper success,
mainly used in the tests to exit main application loop
%End

void messageOut( const QString &message, const QString &tag = QgsAuthManager::AUTH_MAN_TAG, QgsAuthManager::MessageLevel level = QgsAuthManager::INFO ) const;
void messageOut( const QString &message, const QString &tag = QgsAuthManager::AUTH_MAN_TAG, QgsAuthManager::MessageLevel level = QgsAuthManager::INFO ) const /Deprecated/;
%Docstring
Custom logging signal to relay to console output and :py:class:`QgsMessageLog`

:param message: Message to send
:param tag: Associated tag (title)
:param level: Message log level

.. seealso:: :py:class:`QgsMessageLog`

.. deprecated:: QGIS 3.40
use :py:func:`~QgsAuthManager.logMessage` instead.
%End

void messageLog( const QString &message, const QString &tag = QgsAuthManager::AUTH_MAN_TAG, Qgis::MessageLevel level = Qgis::MessageLevel::Info ) const;
%Docstring
Custom logging signal to relay to console output and :py:class:`QgsMessageLog`

Expand All @@ -786,9 +831,11 @@ Custom logging signal to relay to console output and :py:class:`QgsMessageLog`
:param level: Message log level

.. seealso:: :py:class:`QgsMessageLog`

.. versionadded:: 3.40
%End

void passwordHelperMessageOut( const QString &message, const QString &tag = QgsAuthManager::AUTH_MAN_TAG, QgsAuthManager::MessageLevel level = QgsAuthManager::INFO );
void passwordHelperMessageOut( const QString &message, const QString &tag = QgsAuthManager::AUTH_MAN_TAG, QgsAuthManager::MessageLevel level = QgsAuthManager::INFO ) /Deprecated/;
%Docstring
Custom logging signal to inform the user about master password <-> password manager interactions

Expand All @@ -797,8 +844,23 @@ Custom logging signal to inform the user about master password <-> password mana
:param level: Message log level

.. seealso:: :py:class:`QgsMessageLog`

.. deprecated:: QGIS 3.40
use :py:func:`~QgsAuthManager.passwordHelperMessageLog` instead.
%End

void passwordHelperMessageLog( const QString &message, const QString &tag = QgsAuthManager::AUTH_MAN_TAG, Qgis::MessageLevel level = Qgis::MessageLevel::Info );
%Docstring
Custom logging signal to inform the user about master password <-> password manager interactions

:param message: Message to send
:param tag: Associated tag (title)
:param level: Message log level

.. seealso:: :py:class:`QgsMessageLog`

.. versionadded:: 3.40
%End

void masterPasswordVerified( bool verified );
%Docstring
Expand Down
7 changes: 7 additions & 0 deletions python/PyQt6/core/auto_generated/qgsapplication.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,13 @@ Returns the application's authentication manager instance
this can be ``None`` if called before initQgis

.. seealso:: :py:func:`initQgis`
%End

static QgsAuthConfigurationStorageRegistry *authConfigurationStorageRegistry();
%Docstring
Returns the application's authentication configuration storage registry

.. versionadded:: 3.40
%End

static QgsProcessingRegistry *processingRegistry();
Expand Down
76 changes: 69 additions & 7 deletions python/core/auto_generated/auth/qgsauthmanager.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@




class QgsAuthManager : QObject
{
%Docstring(signature="appended")
Expand Down Expand Up @@ -77,19 +76,35 @@ not already been done.

~QgsAuthManager();

QSqlDatabase authDatabaseConnection() const;
QgsAuthConfigurationStorageRegistry *authConfigurationStorageRegistry() const;
%Docstring
Return the authentication configuration storage registry.

.. versionadded:: 3.40
%End

QSqlDatabase authDatabaseConnection() const /Deprecated/;
%Docstring
Sets up the application instance of the authentication database connection

.. deprecated:: QGIS 3.40
direct access to the DB is not allowed, use :py:class:`QgsAuthConfigurationStorage` API instead.
%End

const QString authDatabaseConfigTable() const;
const QString authDatabaseConfigTable() const /Deprecated/;
%Docstring
Name of the authentication database table that stores configs

.. deprecated:: QGIS 3.40
direct access to the DB is not allowed, use :py:class:`QgsAuthConfigurationStorage` API instead.
%End

const QString authDatabaseServersTable() const;
const QString authDatabaseServersTable() const /Deprecated/;
%Docstring
Name of the authentication database table that stores server exceptions/configs

.. deprecated:: QGIS 3.40
direct access to the DB is not allowed, use :py:class:`QgsAuthConfigurationStorage` API instead.
%End


Expand All @@ -103,11 +118,26 @@ Whether QCA has the qca-ossl plugin, which a base run-time requirement
Standard message for when QCA's qca-ossl plugin is missing and system is disabled
%End

const QString authenticationDatabasePath() const;
const QString authenticationDatabasePath() const;
%Docstring
The standard authentication database file in ~/.qgis3/ or defined location

.. seealso:: :py:func:`QgsApplication.qgisAuthDatabaseFilePath`

.. deprecated:: QGIS 3.40
use :py:func:`~QgsAuthManager.authenticationDatabaseUri` instead.
%End

static bool isFilesystemBasedDatabase( const QString &uri );
%Docstring
Returns the ``True`` if the ``uri`` is a filesystem-based database (SQLite).
%End

const QString authenticationDatabaseUri() const;
%Docstring
Returns the authentication database connection URI.

.. versionadded:: 3.40
%End

bool setMasterPassword( bool verify = false );
Expand Down Expand Up @@ -763,6 +793,7 @@ Store the password manager into the wallet

static const QString AUTH_MAN_TAG;


signals:

void passwordHelperFailure();
Expand All @@ -777,7 +808,21 @@ Signals emitted on password helper success,
mainly used in the tests to exit main application loop
%End

void messageOut( const QString &message, const QString &tag = QgsAuthManager::AUTH_MAN_TAG, QgsAuthManager::MessageLevel level = QgsAuthManager::INFO ) const;
void messageOut( const QString &message, const QString &tag = QgsAuthManager::AUTH_MAN_TAG, QgsAuthManager::MessageLevel level = QgsAuthManager::INFO ) const /Deprecated/;
%Docstring
Custom logging signal to relay to console output and :py:class:`QgsMessageLog`

:param message: Message to send
:param tag: Associated tag (title)
:param level: Message log level

.. seealso:: :py:class:`QgsMessageLog`

.. deprecated:: QGIS 3.40
use :py:func:`~QgsAuthManager.logMessage` instead.
%End

void messageLog( const QString &message, const QString &tag = QgsAuthManager::AUTH_MAN_TAG, Qgis::MessageLevel level = Qgis::MessageLevel::Info ) const;
%Docstring
Custom logging signal to relay to console output and :py:class:`QgsMessageLog`

Expand All @@ -786,9 +831,11 @@ Custom logging signal to relay to console output and :py:class:`QgsMessageLog`
:param level: Message log level

.. seealso:: :py:class:`QgsMessageLog`

.. versionadded:: 3.40
%End

void passwordHelperMessageOut( const QString &message, const QString &tag = QgsAuthManager::AUTH_MAN_TAG, QgsAuthManager::MessageLevel level = QgsAuthManager::INFO );
void passwordHelperMessageOut( const QString &message, const QString &tag = QgsAuthManager::AUTH_MAN_TAG, QgsAuthManager::MessageLevel level = QgsAuthManager::INFO ) /Deprecated/;
%Docstring
Custom logging signal to inform the user about master password <-> password manager interactions

Expand All @@ -797,8 +844,23 @@ Custom logging signal to inform the user about master password <-> password mana
:param level: Message log level

.. seealso:: :py:class:`QgsMessageLog`

.. deprecated:: QGIS 3.40
use :py:func:`~QgsAuthManager.passwordHelperMessageLog` instead.
%End

void passwordHelperMessageLog( const QString &message, const QString &tag = QgsAuthManager::AUTH_MAN_TAG, Qgis::MessageLevel level = Qgis::MessageLevel::Info );
%Docstring
Custom logging signal to inform the user about master password <-> password manager interactions

:param message: Message to send
:param tag: Associated tag (title)
:param level: Message log level

.. seealso:: :py:class:`QgsMessageLog`

.. versionadded:: 3.40
%End

void masterPasswordVerified( bool verified );
%Docstring
Expand Down
7 changes: 7 additions & 0 deletions python/core/auto_generated/qgsapplication.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,13 @@ Returns the application's authentication manager instance
this can be ``None`` if called before initQgis

.. seealso:: :py:func:`initQgis`
%End

static QgsAuthConfigurationStorageRegistry *authConfigurationStorageRegistry();
%Docstring
Returns the application's authentication configuration storage registry

.. versionadded:: 3.40
%End

static QgsProcessingRegistry *processingRegistry();
Expand Down
2 changes: 2 additions & 0 deletions src/core/auth/qgsauthconfigurationstorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ QgsAuthConfigurationStorage::QgsAuthConfigurationStorage( const QMap<QString, QS
#endif
}



QString QgsAuthConfigurationStorage::lastError() const
{
return mLastError;
Expand Down
Loading

0 comments on commit d3b430c

Please sign in to comment.