Skip to content

Commit

Permalink
[auth][api] QgsAuthConfigurationStorage classes and tests (qgis#57992)
Browse files Browse the repository at this point in the history
Implementation of QEP 
Authentication System: allow Database storage for authentication DB
qgis/QGIS-Enhancement-Proposals#248
  • Loading branch information
elpaso authored and velle committed Sep 17, 2024
1 parent b0581a6 commit 0f1533e
Show file tree
Hide file tree
Showing 70 changed files with 23,628 additions and 15,700 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ if (WITH_CORE AND WITH_BINDINGS)
include(SIPMacros)

set(SIP_INCLUDES ${PYQT_SIP_DIR} ${CMAKE_SOURCE_DIR}/python)
set(SIP_CONCAT_PARTS 24)
set(SIP_CONCAT_PARTS 25)

if (NOT BINDINGS_GLOBAL_INSTALL)
set(Python_SITEARCH ${QGIS_DATA_DIR}/python)
Expand Down
178 changes: 89 additions & 89 deletions python/3d/class_map.yaml

Large diffs are not rendered by default.

178 changes: 89 additions & 89 deletions python/PyQt6/3d/class_map.yaml

Large diffs are not rendered by default.

160 changes: 80 additions & 80 deletions python/PyQt6/analysis/class_map.yaml

Large diffs are not rendered by default.

70 changes: 70 additions & 0 deletions python/PyQt6/core/auto_additions/qgis.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,74 @@
# The following has been generated automatically from src/core/qgis.h
# monkey patching scoped based enum
Qgis.AuthConfigurationStorageCapability.ClearStorage.__doc__ = "Can clear all configurations from storage"
Qgis.AuthConfigurationStorageCapability.ReadConfiguration.__doc__ = "Can read an authentication configuration"
Qgis.AuthConfigurationStorageCapability.UpdateConfiguration.__doc__ = "Can update an authentication configuration"
Qgis.AuthConfigurationStorageCapability.DeleteConfiguration.__doc__ = "Can deleet an authentication configuration"
Qgis.AuthConfigurationStorageCapability.CreateConfiguration.__doc__ = "Can create a new authentication configuration"
Qgis.AuthConfigurationStorageCapability.ReadCertificateIdentity.__doc__ = "Can read a certificate identity"
Qgis.AuthConfigurationStorageCapability.UpdateCertificateIdentity.__doc__ = "Can update a certificate identity"
Qgis.AuthConfigurationStorageCapability.DeleteCertificateIdentity.__doc__ = "Can delete a certificate identity"
Qgis.AuthConfigurationStorageCapability.CreateCertificateIdentity.__doc__ = "Can create a new certificate identity"
Qgis.AuthConfigurationStorageCapability.ReadSslCertificateCustomConfig.__doc__ = "Can read a SSL certificate custom config"
Qgis.AuthConfigurationStorageCapability.UpdateSslCertificateCustomConfig.__doc__ = "Can update a SSL certificate custom config"
Qgis.AuthConfigurationStorageCapability.DeleteSslCertificateCustomConfig.__doc__ = "Can delete a SSL certificate custom config"
Qgis.AuthConfigurationStorageCapability.CreateSslCertificateCustomConfig.__doc__ = "Can create a new SSL certificate custom config"
Qgis.AuthConfigurationStorageCapability.ReadCertificateAuthority.__doc__ = "Can read a certificate authority"
Qgis.AuthConfigurationStorageCapability.UpdateCertificateAuthority.__doc__ = "Can update a certificate authority"
Qgis.AuthConfigurationStorageCapability.DeleteCertificateAuthority.__doc__ = "Can delete a certificate authority"
Qgis.AuthConfigurationStorageCapability.CreateCertificateAuthority.__doc__ = "Can create a new certificate authority"
Qgis.AuthConfigurationStorageCapability.ReadCertificateTrustPolicy.__doc__ = "Can read a certificate trust policy"
Qgis.AuthConfigurationStorageCapability.UpdateCertificateTrustPolicy.__doc__ = "Can update a certificate trust policy"
Qgis.AuthConfigurationStorageCapability.DeleteCertificateTrustPolicy.__doc__ = "Can delete a certificate trust policy"
Qgis.AuthConfigurationStorageCapability.CreateCertificateTrustPolicy.__doc__ = "Can create a new certificate trust policy"
Qgis.AuthConfigurationStorageCapability.ReadMasterPassword.__doc__ = "Can read the master password"
Qgis.AuthConfigurationStorageCapability.UpdateMasterPassword.__doc__ = "Can update the master password"
Qgis.AuthConfigurationStorageCapability.DeleteMasterPassword.__doc__ = "Can delete the master password"
Qgis.AuthConfigurationStorageCapability.CreateMasterPassword.__doc__ = "Can create a new master password"
Qgis.AuthConfigurationStorageCapability.ReadSetting.__doc__ = "Can read the authentication settings"
Qgis.AuthConfigurationStorageCapability.UpdateSetting.__doc__ = "Can update the authentication setting"
Qgis.AuthConfigurationStorageCapability.DeleteSetting.__doc__ = "Can delete the authentication setting"
Qgis.AuthConfigurationStorageCapability.CreateSetting.__doc__ = "Can create a new authentication setting"
Qgis.AuthConfigurationStorageCapability.__doc__ = """Authentication configuration storage capabilities.

.. versionadded:: 3.40

* ``ClearStorage``: Can clear all configurations from storage
* ``ReadConfiguration``: Can read an authentication configuration
* ``UpdateConfiguration``: Can update an authentication configuration
* ``DeleteConfiguration``: Can deleet an authentication configuration
* ``CreateConfiguration``: Can create a new authentication configuration
* ``ReadCertificateIdentity``: Can read a certificate identity
* ``UpdateCertificateIdentity``: Can update a certificate identity
* ``DeleteCertificateIdentity``: Can delete a certificate identity
* ``CreateCertificateIdentity``: Can create a new certificate identity
* ``ReadSslCertificateCustomConfig``: Can read a SSL certificate custom config
* ``UpdateSslCertificateCustomConfig``: Can update a SSL certificate custom config
* ``DeleteSslCertificateCustomConfig``: Can delete a SSL certificate custom config
* ``CreateSslCertificateCustomConfig``: Can create a new SSL certificate custom config
* ``ReadCertificateAuthority``: Can read a certificate authority
* ``UpdateCertificateAuthority``: Can update a certificate authority
* ``DeleteCertificateAuthority``: Can delete a certificate authority
* ``CreateCertificateAuthority``: Can create a new certificate authority
* ``ReadCertificateTrustPolicy``: Can read a certificate trust policy
* ``UpdateCertificateTrustPolicy``: Can update a certificate trust policy
* ``DeleteCertificateTrustPolicy``: Can delete a certificate trust policy
* ``CreateCertificateTrustPolicy``: Can create a new certificate trust policy
* ``ReadMasterPassword``: Can read the master password
* ``UpdateMasterPassword``: Can update the master password
* ``DeleteMasterPassword``: Can delete the master password
* ``CreateMasterPassword``: Can create a new master password
* ``ReadSetting``: Can read the authentication settings
* ``UpdateSetting``: Can update the authentication setting
* ``DeleteSetting``: Can delete the authentication setting
* ``CreateSetting``: Can create a new authentication setting

"""
# --
Qgis.AuthConfigurationStorageCapability.baseClass = Qgis
Qgis.AuthConfigurationStorageCapabilities = lambda flags=0: Qgis.AuthConfigurationStorageCapability(flags)
Qgis.AuthConfigurationStorageCapabilities.baseClass = Qgis
AuthConfigurationStorageCapabilities = Qgis # dirty hack since SIP seems to introduce the flags in module
Qgis.Info = Qgis.MessageLevel.Info
Qgis.Warning = Qgis.MessageLevel.Warning
Qgis.Critical = Qgis.MessageLevel.Critical
Expand Down
2 changes: 2 additions & 0 deletions python/PyQt6/core/auto_additions/qgsapplication.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
QgsApplication.qgisSettingsDirPath = staticmethod(QgsApplication.qgisSettingsDirPath)
QgsApplication.qgisUserDatabaseFilePath = staticmethod(QgsApplication.qgisUserDatabaseFilePath)
QgsApplication.qgisAuthDatabaseFilePath = staticmethod(QgsApplication.qgisAuthDatabaseFilePath)
QgsApplication.qgisAuthDatabaseUri = staticmethod(QgsApplication.qgisAuthDatabaseUri)
QgsApplication.splashPath = staticmethod(QgsApplication.splashPath)
QgsApplication.iconsPath = staticmethod(QgsApplication.iconsPath)
QgsApplication.srsDatabaseFilePath = staticmethod(QgsApplication.srsDatabaseFilePath)
Expand Down Expand Up @@ -123,6 +124,7 @@
QgsApplication.sensorRegistry = staticmethod(QgsApplication.sensorRegistry)
QgsApplication.messageLog = staticmethod(QgsApplication.messageLog)
QgsApplication.authManager = staticmethod(QgsApplication.authManager)
QgsApplication.authConfigurationStorageRegistry = staticmethod(QgsApplication.authConfigurationStorageRegistry)
QgsApplication.processingRegistry = staticmethod(QgsApplication.processingRegistry)
QgsApplication.pageSizeRegistry = staticmethod(QgsApplication.pageSizeRegistry)
QgsApplication.actionScopeRegistry = staticmethod(QgsApplication.actionScopeRegistry)
Expand Down
5 changes: 3 additions & 2 deletions python/PyQt6/core/auto_additions/qgsauthmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
QgsAuthManager.CRITICAL = QgsAuthManager.MessageLevel.CRITICAL
QgsAuthManager.MessageLevel.baseClass = QgsAuthManager
try:
QgsAuthManager.__attribute_docs__ = {'AUTH_PASSWORD_HELPER_DISPLAY_NAME': 'The display name of the password helper (platform dependent)', 'AUTH_MAN_TAG': 'The display name of the Authentication Manager', 'passwordHelperFailure': 'Signals emitted on password helper failure,\nmainly used in the tests to exit main application loop\n', 'passwordHelperSuccess': 'Signals emitted on password helper success,\nmainly used in the tests to exit main application loop\n', 'messageOut': 'Custom logging signal to relay to console output and :py:class:`QgsMessageLog`\n\n:param message: Message to send\n:param tag: Associated tag (title)\n:param level: Message log level\n\n.. seealso:: :py:class:`QgsMessageLog`\n', 'passwordHelperMessageOut': 'Custom logging signal to inform the user about master password <-> password manager interactions\n\n:param message: Message to send\n:param tag: Associated tag (title)\n:param level: Message log level\n\n.. seealso:: :py:class:`QgsMessageLog`\n', 'masterPasswordVerified': "Emitted when a password has been verify (or not)\n\n:param verified: The state of password's verification\n", 'authDatabaseEraseRequested': 'Emitted when a user has indicated they may want to erase the authentication db.\n', 'authDatabaseChanged': 'Emitted when the authentication db is significantly changed, e.g. large record removal, erased, etc.\n'}
QgsAuthManager.__attribute_docs__ = {'AUTH_PASSWORD_HELPER_DISPLAY_NAME': 'The display name of the password helper (platform dependent)', 'AUTH_MAN_TAG': 'The display name of the Authentication Manager', 'passwordHelperFailure': 'Signals emitted on password helper failure,\nmainly used in the tests to exit main application loop\n', 'passwordHelperSuccess': 'Signals emitted on password helper success,\nmainly used in the tests to exit main application loop\n', 'messageOut': 'Custom logging signal to relay to console output and :py:class:`QgsMessageLog`\n\n:param message: Message to send\n:param tag: Associated tag (title)\n:param level: Message log level\n\n.. seealso:: :py:class:`QgsMessageLog`\n\n.. deprecated:: 3.40\n\n Use :py:func:`~QgsAuthManager.messageLog` instead.\n', 'messageLog': 'Custom logging signal to relay to console output and :py:class:`QgsMessageLog`\n\n:param message: Message to send\n:param tag: Associated tag (title)\n:param level: Message log level\n\n.. seealso:: :py:class:`QgsMessageLog`\n\n.. versionadded:: 3.40\n', 'passwordHelperMessageOut': 'Custom logging signal to inform the user about master password <-> password manager interactions\n\n:param message: Message to send\n:param tag: Associated tag (title)\n:param level: Message log level\n\n.. seealso:: :py:class:`QgsMessageLog`\n\n.. deprecated:: 3.40\n\n Use :py:func:`~QgsAuthManager.passwordHelperMessageLog` instead.\n', 'passwordHelperMessageLog': 'Custom logging signal to inform the user about master password <-> password manager interactions\n\n:param message: Message to send\n:param tag: Associated tag (title)\n:param level: Message log level\n\n.. seealso:: :py:class:`QgsMessageLog`\n\n.. versionadded:: 3.40\n', 'masterPasswordVerified': "Emitted when a password has been verify (or not)\n\n:param verified: The state of password's verification\n", 'authDatabaseEraseRequested': 'Emitted when a user has indicated they may want to erase the authentication db.\n', 'authDatabaseChanged': 'Emitted when the authentication db is significantly changed, e.g. large record removal, erased, etc.\n'}
QgsAuthManager.isFilesystemBasedDatabase = staticmethod(QgsAuthManager.isFilesystemBasedDatabase)
QgsAuthManager.hasConfigId = staticmethod(QgsAuthManager.hasConfigId)
QgsAuthManager.passwordHelperEnabled = staticmethod(QgsAuthManager.passwordHelperEnabled)
QgsAuthManager.__signal_arguments__ = {'passwordHelperMessageOut': ['message: str', 'tag: str = QgsAuthManager.AUTH_MAN_TAG', 'level: QgsAuthManager.MessageLevel = QgsAuthManager.INFO'], 'masterPasswordVerified': ['verified: bool']}
QgsAuthManager.__signal_arguments__ = {'passwordHelperMessageLog': ['message: str', 'tag: str = QgsAuthManager.AUTH_MAN_TAG', 'level: Qgis.MessageLevel = Qgis.MessageLevel.Info'], 'masterPasswordVerified': ['verified: bool']}
QgsAuthManager.__group__ = ['auth']
except NameError:
pass
Loading

0 comments on commit 0f1533e

Please sign in to comment.