QGIS API Documentation 3.39.0-Master (d85f3c2a281)
Loading...
Searching...
No Matches
Classes | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QgsAuthConfigurationStorage Class Referenceabstract

Abstract class that defines the interface for all authentication configuration storage implementations. More...

#include <qgsauthconfigurationstorage.h>

Inheritance diagram for QgsAuthConfigurationStorage:
Inheritance graph
[legend]

Classes

struct  MasterPasswordConfig
 Structure that holds the (encrypted) master password elements. More...
 
struct  SettingParameter
 Storage configuration setting parameter. More...
 

Signals

void authSettingsChanged ()
 Emitted when the storage auth settings table was changed.
 
void certAuthorityChanged ()
 Emitted when the storage cert authority table was changed.
 
void certIdentityChanged ()
 Emitted when the storage cert identity table was changed.
 
void masterPasswordChanged ()
 Emitted when the storage master password table was changed.
 
void messageLog (const QString &message, const QString &tag=QStringLiteral("Authentication"), Qgis::MessageLevel level=Qgis::MessageLevel::Info)
 Custom logging signal to relay to console output and QgsMessageLog.
 
void methodConfigChanged ()
 Emitted when the storage method config table was changed.
 
void readOnlyChanged (bool readOnly)
 Emitted when the storage read-only status was changed.
 
void sslCertCustomConfigChanged ()
 Emitted when the storage ssl cert custom config table was changed.
 
void sslCertTrustPolicyChanged ()
 Emitted when the storage ssl cert trust policy table was changed.
 
void storageChanged (const QString &id)
 Emitted when the storage was updated.
 

Public Member Functions

 QgsAuthConfigurationStorage (const QMap< QString, QVariant > &settings)
 Creates a new authentication configuration storage.
 
virtual ~QgsAuthConfigurationStorage ()
 
virtual QgsAuthMethodConfigsMap authMethodConfigs (const QStringList &allowedMethods=QStringList()) const =0
 Returns a mapping of authentication configurations available from this storage.
 
virtual QgsAuthMethodConfigsMap authMethodConfigsWithPayload () const =0
 Returns a mapping of authentication configurations available from this storage.
 
virtual bool authSettingExists (const QString &key) const =0
 Check if an authentication setting exists in the storage.
 
virtual const QList< QSslCertificate > caCerts () const =0
 Returns the list of CA certificates in the storage.
 
virtual const QMap< QString, QgsAuthCertUtils::CertTrustPolicycaCertsPolicy () const =0
 Returns the map of CA certificates hashes in the storages and their trust policy.
 
Qgis::AuthConfigurationStorageCapabilities capabilities () const
 Returns the capabilities of the storage.
 
virtual bool certAuthorityExists (const QSslCertificate &cert) const =0
 Check if a certificate authority exists.
 
virtual QStringList certAuthorityIds () const =0
 Returns the list of certificate authority IDs in the storage.
 
virtual const QList< QSslCertificate > certIdentities () const =0
 certIdentities get certificate identities
 
virtual bool certIdentityExists (const QString &id) const =0
 Check if the certificate identity exists.
 
virtual QStringList certIdentityIds () const =0
 certIdentityIds get list of certificate identity ids from database
 
virtual bool certTrustPolicyExists (const QSslCertificate &cert) const =0
 Check if certificate trust policy exists.
 
virtual bool clearMasterPasswords ()=0
 Remove all master passwords from the database.
 
virtual bool clearMethodConfigs ()=0
 Remove all authentications configurations from the storage.
 
virtual QString description () const =0
 Returns a human readable localized description of the storage implementation (e.g.
 
virtual bool erase ()=0
 Completely erase the storage removing all configurations/certs/settings etc.
 
virtual QString id () const =0
 Returns the unique identifier of the storage object.
 
virtual bool initialize ()
 Initializes the storage.
 
bool isEnabled () const
 Returns true if the storage is enabled.
 
bool isEncrypted () const
 Returns true if the storage is encrypted.
 
virtual bool isReadOnly () const
 Returns true if the storage is read-only, false otherwise.
 
virtual bool isReady () const =0
 Returns true is the storage is ready to be used.
 
virtual QString lastError () const
 Returns the last error message.
 
virtual QString loadAuthSetting (const QString &key) const =0
 Load an authentication setting from the storage.
 
virtual const QSslCertificate loadCertAuthority (const QString &id) const =0
 certAuthority get a certificate authority by id (sha hash)
 
virtual const QSslCertificate loadCertIdentity (const QString &id) const =0
 certIdentity get a certificate identity by id (sha hash)
 
virtual const QPair< QSslCertificate, QString > loadCertIdentityBundle (const QString &id) const =0
 Returns a certificate identity bundle by id (sha hash).
 
virtual QgsAuthCertUtils::CertTrustPolicy loadCertTrustPolicy (const QSslCertificate &cert) const =0
 Load certificate trust policy.
 
virtual QgsAuthMethodConfig loadMethodConfig (const QString &id, QString &payload, bool full=false) const =0
 Load an authentication configuration from the database.
 
virtual const QgsAuthConfigSslServer loadSslCertCustomConfig (const QString &id, const QString &hostport) const =0
 Loads an SSL certificate custom config by id (sha hash) and hostport (host:port)
 
virtual const QgsAuthConfigSslServer loadSslCertCustomConfigByHost (const QString &hostport) const =0
 Loads an SSL certificate custom config by hostport (host:port)
 
virtual const QList< QgsAuthConfigurationStorage::MasterPasswordConfigmasterPasswords () const =0
 Returns the list of (encrypted) master passwords stored in the database.
 
virtual bool methodConfigExists (const QString &id) const =0
 Check if an authentication configuration exists in the storage.
 
virtual QString name () const =0
 Returns a human readable localized short name of the storage implementation (e.g "SQLite").
 
virtual bool removeAuthSetting (const QString &key)=0
 Remove an authentication setting from the storage.
 
virtual bool removeCertAuthority (const QSslCertificate &cert)=0
 Remove a certificate authority.
 
virtual bool removeCertIdentity (const QSslCertificate &cert)=0
 Remove a certificate identity from the storage.
 
virtual bool removeCertIdentity (const QString &id)=0
 Remove a certificate identity from the storage.
 
virtual bool removeCertTrustPolicy (const QSslCertificate &cert)=0
 Remove certificate trust policy.
 
virtual bool removeMethodConfig (const QString &id)=0
 Removes the authentication configuration with the specified id.
 
virtual bool removeSslCertCustomConfig (const QString &id, const QString &hostport)=0
 Remove an SSL certificate custom config.
 
void setEnabled (bool enabled)
 Set the storage enabled status to enabled.
 
virtual void setReadOnly (bool readOnly)
 Utility method to unset all editing capabilities.
 
QMap< QString, QVariant > settings () const
 Returns the settings of the storage.
 
virtual QList< QgsAuthConfigurationStorage::SettingParametersettingsParameters () const =0
 Returns a list of the settings accepted by the storage.
 
virtual bool sslCertCustomConfigExists (const QString &id, const QString &hostport)=0
 Check if SSL certificate custom config exists.
 
virtual QStringList sslCertCustomConfigIds () const =0
 Returns the list of SSL certificate custom config ids.
 
virtual const QList< QgsAuthConfigSslServersslCertCustomConfigs () const =0
 sslCertCustomConfigs get SSL certificate custom configs
 
virtual bool storeAuthSetting (const QString &key, const QString &value)=0
 Store an authentication setting in the storage.
 
virtual bool storeCertAuthority (const QSslCertificate &cert)=0
 Store a certificate authority.
 
virtual bool storeCertIdentity (const QSslCertificate &cert, const QString &keyPem)=0
 Store a certificate identity in the storage.
 
virtual bool storeCertTrustPolicy (const QSslCertificate &cert, QgsAuthCertUtils::CertTrustPolicy policy)=0
 Store certificate trust policy.
 
virtual bool storeMasterPassword (const QgsAuthConfigurationStorage::MasterPasswordConfig &config)=0
 Store a master password in the database.
 
virtual bool storeMethodConfig (const QgsAuthMethodConfig &config, const QString &payload)=0
 Store an authentication config in the database.
 
virtual bool storeSslCertCustomConfig (const QgsAuthConfigSslServer &config)=0
 Store an SSL certificate custom config.
 
virtual QString type () const =0
 Returns the type of the storage implementation.
 

Protected Member Functions

void checkCapability (Qgis::AuthConfigurationStorageCapability capability) const
 Utility to check capability and throw QgsNotSupportedException if not supported.
 
virtual QString loggerTag () const
 Returns the logger tag for the storage.
 
void setCapabilities (Qgis::AuthConfigurationStorageCapabilities capabilities)
 Set the capabilities of the storage to capabilities.
 
void setError (const QString &error, Qgis::MessageLevel level=Qgis::MessageLevel::Critical)
 Set the last error message to error with message level level.
 

Protected Attributes

Qgis::AuthConfigurationStorageCapabilities mCapabilities
 Store the capabilities of the storage.
 
QMap< QString, QVariant > mConfiguration
 Store the implementation-specific configuration.
 
bool mIsEnabled = true
 Store whether the storage is enabled.
 
bool mIsEncrypted = true
 Store whether the storage is encrypted.
 
bool mIsReadOnly = false
 Store whether the storage is read-only.
 
QString mLastError
 Store the last error message.
 

Detailed Description

Abstract class that defines the interface for all authentication configuration storage implementations.

Since
QGIS 3.40

Definition at line 36 of file qgsauthconfigurationstorage.h.

Constructor & Destructor Documentation

◆ QgsAuthConfigurationStorage()

QgsAuthConfigurationStorage::QgsAuthConfigurationStorage ( const QMap< QString, QVariant > &  settings)

Creates a new authentication configuration storage.

Parameters
settingsImplementation-specific configuration settings.

Definition at line 18 of file qgsauthconfigurationstorage.cpp.

◆ ~QgsAuthConfigurationStorage()

virtual QgsAuthConfigurationStorage::~QgsAuthConfigurationStorage ( )
inlinevirtual

Definition at line 68 of file qgsauthconfigurationstorage.h.

Member Function Documentation

◆ authMethodConfigs()

virtual QgsAuthMethodConfigsMap QgsAuthConfigurationStorage::authMethodConfigs ( const QStringList &  allowedMethods = QStringList()) const
pure virtual

Returns a mapping of authentication configurations available from this storage.

Parameters
allowedMethodsOptional filter to return only configurations for specific authentication methods.
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ authMethodConfigsWithPayload()

virtual QgsAuthMethodConfigsMap QgsAuthConfigurationStorage::authMethodConfigsWithPayload ( ) const
pure virtual

Returns a mapping of authentication configurations available from this storage.

The encrypted payload is added to the configuration as "encrypted_payload" key.

Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage
Note
This convenience method is used by the authentication manager to retrieve the configurations and check if it can decrypt all of them, it is faster than retrieve all the configurations one by one.

Implemented in QgsAuthConfigurationStorageDb.

◆ authSettingExists()

virtual bool QgsAuthConfigurationStorage::authSettingExists ( const QString &  key) const
pure virtual

Check if an authentication setting exists in the storage.

Parameters
keySetting key.
Returns
true if the setting exists, false otherwise.
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ authSettingsChanged

void QgsAuthConfigurationStorage::authSettingsChanged ( )
signal

Emitted when the storage auth settings table was changed.

◆ caCerts()

virtual const QList< QSslCertificate > QgsAuthConfigurationStorage::caCerts ( ) const
pure virtual

Returns the list of CA certificates in the storage.

Returns
list of CA certificates
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ caCertsPolicy()

virtual const QMap< QString, QgsAuthCertUtils::CertTrustPolicy > QgsAuthConfigurationStorage::caCertsPolicy ( ) const
pure virtual

Returns the map of CA certificates hashes in the storages and their trust policy.

Returns
map of CA certificates hashes and their trust policy
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ capabilities()

Qgis::AuthConfigurationStorageCapabilities QgsAuthConfigurationStorage::capabilities ( ) const

Returns the capabilities of the storage.

Definition at line 75 of file qgsauthconfigurationstorage.cpp.

◆ certAuthorityChanged

void QgsAuthConfigurationStorage::certAuthorityChanged ( )
signal

Emitted when the storage cert authority table was changed.

◆ certAuthorityExists()

virtual bool QgsAuthConfigurationStorage::certAuthorityExists ( const QSslCertificate &  cert) const
pure virtual

Check if a certificate authority exists.

Parameters
certCertificate authority
Returns
true if the certificate authority exists, false otherwise
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ certAuthorityIds()

virtual QStringList QgsAuthConfigurationStorage::certAuthorityIds ( ) const
pure virtual

Returns the list of certificate authority IDs in the storage.

Returns
list of certificate authority IDs
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ certIdentities()

virtual const QList< QSslCertificate > QgsAuthConfigurationStorage::certIdentities ( ) const
pure virtual

certIdentities get certificate identities

Returns
list of certificates
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ certIdentityChanged

void QgsAuthConfigurationStorage::certIdentityChanged ( )
signal

Emitted when the storage cert identity table was changed.

◆ certIdentityExists()

virtual bool QgsAuthConfigurationStorage::certIdentityExists ( const QString &  id) const
pure virtual

Check if the certificate identity exists.

Parameters
idCertificate identity id
Returns
true if the certificate identity exists, false otherwise
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ certIdentityIds()

virtual QStringList QgsAuthConfigurationStorage::certIdentityIds ( ) const
pure virtual

certIdentityIds get list of certificate identity ids from database

Returns
list of certificate ids
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ certTrustPolicyExists()

virtual bool QgsAuthConfigurationStorage::certTrustPolicyExists ( const QSslCertificate &  cert) const
pure virtual

Check if certificate trust policy exists.

Parameters
certCertificate
Returns
true if the certificate trust policy exists, false otherwise
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ checkCapability()

void QgsAuthConfigurationStorage::checkCapability ( Qgis::AuthConfigurationStorageCapability  capability) const
protected

Utility to check capability and throw QgsNotSupportedException if not supported.

Note
Not available in SIP bindings.

Definition at line 117 of file qgsauthconfigurationstorage.cpp.

◆ clearMasterPasswords()

virtual bool QgsAuthConfigurationStorage::clearMasterPasswords ( )
pure virtual

Remove all master passwords from the database.

Returns
true if operation succeeded
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ clearMethodConfigs()

virtual bool QgsAuthConfigurationStorage::clearMethodConfigs ( )
pure virtual

Remove all authentications configurations from the storage.

Returns
true if authentications configurations were removed, false otherwise.
Note
This method does not remove certificate and other assets.
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ description()

virtual QString QgsAuthConfigurationStorage::description ( ) const
pure virtual

Returns a human readable localized description of the storage implementation (e.g.

"Store credentials in a local SQLite database"). This description is displayed to the user.

Implemented in QgsAuthConfigurationStorageDb.

◆ erase()

virtual bool QgsAuthConfigurationStorage::erase ( )
pure virtual

Completely erase the storage removing all configurations/certs/settings etc.

Returns
true if storage was completely erased, false if any error occurred.
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage (e.g. the storage is read-only).

Implemented in QgsAuthConfigurationStorageDb.

◆ id()

virtual QString QgsAuthConfigurationStorage::id ( ) const
pure virtual

Returns the unique identifier of the storage object.

The id is used to uniquely identify the storage object (e.g. the path or the connection URI to a storage configuration).

Implemented in QgsAuthConfigurationStorageDb.

◆ initialize()

virtual bool QgsAuthConfigurationStorage::initialize ( )
inlinevirtual

Initializes the storage.

Returns
true if the storage was successfully initialized, false otherwise. If the storage is already initialized, this method does nothing and returns true.
Note
The default implementation does nothing and returns true. This method is called by the authentication manager when the storage is added to the manager.

Reimplemented in QgsAuthConfigurationStorageDb.

Definition at line 102 of file qgsauthconfigurationstorage.h.

◆ isEnabled()

bool QgsAuthConfigurationStorage::isEnabled ( ) const

Returns true if the storage is enabled.

Definition at line 91 of file qgsauthconfigurationstorage.cpp.

◆ isEncrypted()

bool QgsAuthConfigurationStorage::isEncrypted ( ) const

Returns true if the storage is encrypted.

Definition at line 101 of file qgsauthconfigurationstorage.cpp.

◆ isReadOnly()

bool QgsAuthConfigurationStorage::isReadOnly ( ) const
virtual

Returns true if the storage is read-only, false otherwise.

See also
setReadOnly()

Definition at line 64 of file qgsauthconfigurationstorage.cpp.

◆ isReady()

virtual bool QgsAuthConfigurationStorage::isReady ( ) const
pure virtual

Returns true is the storage is ready to be used.

Note
This method should be called after the initialize() method to check whether the initialization was properly completed.

Implemented in QgsAuthConfigurationStorageDb.

◆ lastError()

QString QgsAuthConfigurationStorage::lastError ( ) const
virtual

Returns the last error message.

Definition at line 70 of file qgsauthconfigurationstorage.cpp.

◆ loadAuthSetting()

virtual QString QgsAuthConfigurationStorage::loadAuthSetting ( const QString &  key) const
pure virtual

Load an authentication setting from the storage.

Parameters
keySetting key.
Returns
Setting value.
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ loadCertAuthority()

virtual const QSslCertificate QgsAuthConfigurationStorage::loadCertAuthority ( const QString &  id) const
pure virtual

certAuthority get a certificate authority by id (sha hash)

Parameters
idsha hash
Returns
a (possibly empty) certificate
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ loadCertIdentity()

virtual const QSslCertificate QgsAuthConfigurationStorage::loadCertIdentity ( const QString &  id) const
pure virtual

certIdentity get a certificate identity by id (sha hash)

Parameters
idsha hash of the cert
Returns
the certificate
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ loadCertIdentityBundle()

virtual const QPair< QSslCertificate, QString > QgsAuthConfigurationStorage::loadCertIdentityBundle ( const QString &  id) const
pure virtual

Returns a certificate identity bundle by id (sha hash).

Parameters
idsha shash
Returns
a pair with the certificate and its SSL key as an encrypted string
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ loadCertTrustPolicy()

virtual QgsAuthCertUtils::CertTrustPolicy QgsAuthConfigurationStorage::loadCertTrustPolicy ( const QSslCertificate &  cert) const
pure virtual

Load certificate trust policy.

Parameters
certCertificate
Returns
Trust policy
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ loadMethodConfig()

virtual QgsAuthMethodConfig QgsAuthConfigurationStorage::loadMethodConfig ( const QString &  id,
QString &  payload,
bool  full = false 
) const
pure virtual

Load an authentication configuration from the database.

Parameters
idConfiguration id.
payload(possibly encrypted) payload.
fullIf true, the full configuration is loaded and the (possibly encrypted) payload is populated, otherwise only the configuration metadata is loaded.
Returns
Authentication configuration metadata.
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ loadSslCertCustomConfig()

virtual const QgsAuthConfigSslServer QgsAuthConfigurationStorage::loadSslCertCustomConfig ( const QString &  id,
const QString &  hostport 
) const
pure virtual

Loads an SSL certificate custom config by id (sha hash) and hostport (host:port)

Parameters
idsha hash
hostportstring host:port
Returns
a SSL certificate custom config
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ loadSslCertCustomConfigByHost()

virtual const QgsAuthConfigSslServer QgsAuthConfigurationStorage::loadSslCertCustomConfigByHost ( const QString &  hostport) const
pure virtual

Loads an SSL certificate custom config by hostport (host:port)

Parameters
hostporthost:port
Returns
a SSL certificate custom config
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ loggerTag()

QString QgsAuthConfigurationStorage::loggerTag ( ) const
protectedvirtual

Returns the logger tag for the storage.

The default implementation returns the literal "Auth storage" followed by the storage name.

Definition at line 112 of file qgsauthconfigurationstorage.cpp.

◆ masterPasswordChanged

void QgsAuthConfigurationStorage::masterPasswordChanged ( )
signal

Emitted when the storage master password table was changed.

◆ masterPasswords()

virtual const QList< QgsAuthConfigurationStorage::MasterPasswordConfig > QgsAuthConfigurationStorage::masterPasswords ( ) const
pure virtual

Returns the list of (encrypted) master passwords stored in the database.

Returns
list of master passwords
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ messageLog

void QgsAuthConfigurationStorage::messageLog ( const QString &  message,
const QString &  tag = QStringLiteral("Authentication"),
Qgis::MessageLevel  level = Qgis::MessageLevel::Info 
)
signal

Custom logging signal to relay to console output and QgsMessageLog.

Parameters
messageMessage to send
tagAssociated tag (title)
levelMessage log level
See also
QgsMessageLog

◆ methodConfigChanged

void QgsAuthConfigurationStorage::methodConfigChanged ( )
signal

Emitted when the storage method config table was changed.

◆ methodConfigExists()

virtual bool QgsAuthConfigurationStorage::methodConfigExists ( const QString &  id) const
pure virtual

Check if an authentication configuration exists in the storage.

Parameters
idConfiguration id.
Returns
true if the configuration exists, false otherwise.
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ name()

virtual QString QgsAuthConfigurationStorage::name ( ) const
pure virtual

Returns a human readable localized short name of the storage implementation (e.g "SQLite").

This name is displayed to the user and used to identify the storage implementation.

Implemented in QgsAuthConfigurationStorageDb.

◆ readOnlyChanged

void QgsAuthConfigurationStorage::readOnlyChanged ( bool  readOnly)
signal

Emitted when the storage read-only status was changed.

◆ removeAuthSetting()

virtual bool QgsAuthConfigurationStorage::removeAuthSetting ( const QString &  key)
pure virtual

Remove an authentication setting from the storage.

Parameters
keySetting key.
Returns
Whether operation succeeded
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ removeCertAuthority()

virtual bool QgsAuthConfigurationStorage::removeCertAuthority ( const QSslCertificate &  cert)
pure virtual

Remove a certificate authority.

Parameters
certCertificate authority
Returns
Whether operation succeeded
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ removeCertIdentity() [1/2]

virtual bool QgsAuthConfigurationStorage::removeCertIdentity ( const QSslCertificate &  cert)
pure virtual

Remove a certificate identity from the storage.

Parameters
certCertificate.
Returns
Whether operation succeeded
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ removeCertIdentity() [2/2]

virtual bool QgsAuthConfigurationStorage::removeCertIdentity ( const QString &  id)
pure virtual

Remove a certificate identity from the storage.

Parameters
idCertificate identity id
Returns
Whether operation succeeded
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ removeCertTrustPolicy()

virtual bool QgsAuthConfigurationStorage::removeCertTrustPolicy ( const QSslCertificate &  cert)
pure virtual

Remove certificate trust policy.

Parameters
certCertificate
Returns
Whether operation succeeded
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ removeMethodConfig()

virtual bool QgsAuthConfigurationStorage::removeMethodConfig ( const QString &  id)
pure virtual

Removes the authentication configuration with the specified id.

Returns
true if the configuration was removed, false otherwise.
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ removeSslCertCustomConfig()

virtual bool QgsAuthConfigurationStorage::removeSslCertCustomConfig ( const QString &  id,
const QString &  hostport 
)
pure virtual

Remove an SSL certificate custom config.

Parameters
idsha hash
hostporthost:port
Returns
Whether operation succeeded
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ setCapabilities()

void QgsAuthConfigurationStorage::setCapabilities ( Qgis::AuthConfigurationStorageCapabilities  capabilities)
protected

Set the capabilities of the storage to capabilities.

Definition at line 80 of file qgsauthconfigurationstorage.cpp.

◆ setEnabled()

void QgsAuthConfigurationStorage::setEnabled ( bool  enabled)

Set the storage enabled status to enabled.

Note
This is a user-controlled setting: the storage may be enabled but not ready to be used.

Definition at line 96 of file qgsauthconfigurationstorage.cpp.

◆ setError()

void QgsAuthConfigurationStorage::setError ( const QString &  error,
Qgis::MessageLevel  level = Qgis::MessageLevel::Critical 
)
protected

Set the last error message to error with message level level.

Definition at line 85 of file qgsauthconfigurationstorage.cpp.

◆ setReadOnly()

void QgsAuthConfigurationStorage::setReadOnly ( bool  readOnly)
virtual

Utility method to unset all editing capabilities.

Note
This method does not alter existing capabilities, make sure subclasses recompute capabilities if needed.

Definition at line 55 of file qgsauthconfigurationstorage.cpp.

◆ settings()

QMap< QString, QVariant > QgsAuthConfigurationStorage::settings ( ) const

Returns the settings of the storage.

Definition at line 106 of file qgsauthconfigurationstorage.cpp.

◆ settingsParameters()

virtual QList< QgsAuthConfigurationStorage::SettingParameter > QgsAuthConfigurationStorage::settingsParameters ( ) const
pure virtual

Returns a list of the settings accepted by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ sslCertCustomConfigChanged

void QgsAuthConfigurationStorage::sslCertCustomConfigChanged ( )
signal

Emitted when the storage ssl cert custom config table was changed.

◆ sslCertCustomConfigExists()

virtual bool QgsAuthConfigurationStorage::sslCertCustomConfigExists ( const QString &  id,
const QString &  hostport 
)
pure virtual

Check if SSL certificate custom config exists.

Parameters
idsha hash
hostporthost:port
Returns
true if the SSL certificate custom config exists, false otherwise
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ sslCertCustomConfigIds()

virtual QStringList QgsAuthConfigurationStorage::sslCertCustomConfigIds ( ) const
pure virtual

Returns the list of SSL certificate custom config ids.

Returns
list of SSL certificate custom config ids
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ sslCertCustomConfigs()

virtual const QList< QgsAuthConfigSslServer > QgsAuthConfigurationStorage::sslCertCustomConfigs ( ) const
pure virtual

sslCertCustomConfigs get SSL certificate custom configs

Returns
list of SSL certificate custom config
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ sslCertTrustPolicyChanged

void QgsAuthConfigurationStorage::sslCertTrustPolicyChanged ( )
signal

Emitted when the storage ssl cert trust policy table was changed.

◆ storageChanged

void QgsAuthConfigurationStorage::storageChanged ( const QString &  id)
signal

Emitted when the storage was updated.

Parameters
idThe storage id
Note
This is a generic changed signal and it is normally emitted together with the dedicated signals which are provided for specific changes on the individual tables.

◆ storeAuthSetting()

virtual bool QgsAuthConfigurationStorage::storeAuthSetting ( const QString &  key,
const QString &  value 
)
pure virtual

Store an authentication setting in the storage.

Parameters
keySetting key.
valueSetting value.
Returns
Whether operation succeeded
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ storeCertAuthority()

virtual bool QgsAuthConfigurationStorage::storeCertAuthority ( const QSslCertificate &  cert)
pure virtual

Store a certificate authority.

Parameters
certCertificate authority
Returns
Whether operation succeeded
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ storeCertIdentity()

virtual bool QgsAuthConfigurationStorage::storeCertIdentity ( const QSslCertificate &  cert,
const QString &  keyPem 
)
pure virtual

Store a certificate identity in the storage.

Parameters
certCertificate.
keyPemSSL key in PEM format.
Returns
Whether operation succeeded
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ storeCertTrustPolicy()

virtual bool QgsAuthConfigurationStorage::storeCertTrustPolicy ( const QSslCertificate &  cert,
QgsAuthCertUtils::CertTrustPolicy  policy 
)
pure virtual

Store certificate trust policy.

Parameters
certCertificate
policyTrust policy
Returns
Whether operation succeeded
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ storeMasterPassword()

virtual bool QgsAuthConfigurationStorage::storeMasterPassword ( const QgsAuthConfigurationStorage::MasterPasswordConfig config)
pure virtual

Store a master password in the database.

Parameters
configMaster password configuration.
Returns
true if operation succeeded
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ storeMethodConfig()

virtual bool QgsAuthConfigurationStorage::storeMethodConfig ( const QgsAuthMethodConfig config,
const QString &  payload 
)
pure virtual

Store an authentication config in the database.

Parameters
configAuthentication configuration.
payloadpayload to store (possibly encrypted).
Returns
Whether operation succeeded
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ storeSslCertCustomConfig()

virtual bool QgsAuthConfigurationStorage::storeSslCertCustomConfig ( const QgsAuthConfigSslServer config)
pure virtual

Store an SSL certificate custom config.

Parameters
configSSL certificate custom config
Returns
Whether operation succeeded
Exceptions
QgsNotSupportedExceptionif the operation is not supported by the storage.

Implemented in QgsAuthConfigurationStorageDb.

◆ type()

virtual QString QgsAuthConfigurationStorage::type ( ) const
pure virtual

Returns the type of the storage implementation.

The type is used to identify the storage implementation internally (e.g. "sqlite"). A valid type must be ASCII alphanumeric and contain no spaces.

Implemented in QgsAuthConfigurationStorageDb.

Member Data Documentation

◆ mCapabilities

Qgis::AuthConfigurationStorageCapabilities QgsAuthConfigurationStorage::mCapabilities
protected

Store the capabilities of the storage.

Definition at line 588 of file qgsauthconfigurationstorage.h.

◆ mConfiguration

QMap<QString, QVariant> QgsAuthConfigurationStorage::mConfiguration
protected

Store the implementation-specific configuration.

Definition at line 583 of file qgsauthconfigurationstorage.h.

◆ mIsEnabled

bool QgsAuthConfigurationStorage::mIsEnabled = true
protected

Store whether the storage is enabled.

Definition at line 603 of file qgsauthconfigurationstorage.h.

◆ mIsEncrypted

bool QgsAuthConfigurationStorage::mIsEncrypted = true
protected

Store whether the storage is encrypted.

Definition at line 598 of file qgsauthconfigurationstorage.h.

◆ mIsReadOnly

bool QgsAuthConfigurationStorage::mIsReadOnly = false
protected

Store whether the storage is read-only.

Definition at line 608 of file qgsauthconfigurationstorage.h.

◆ mLastError

QString QgsAuthConfigurationStorage::mLastError
mutableprotected

Store the last error message.

Definition at line 593 of file qgsauthconfigurationstorage.h.


The documentation for this class was generated from the following files: