Class: QgsAuthConfigurationStorageRegistry

Registry for authentication configuration storages.

This singleton class manages a list of authentication configuration storages.

QgsAuthConfigurationStorageRegistry is not usually directly created, but rather accessed through QgsApplication.authConfigurationStorageRegistry().

Added in version 3.40.

Class Hierarchy

Inheritance diagram of qgis.core.QgsAuthConfigurationStorageRegistry

Base classes

QObject

Methods

addStorage

Add an authentication configuration storage to the registry.

firstReadyStorageWithCapability

Returns the first ready (and enabled) authentication configuration storage which has the required capability.

readyStorages

Returns the list of all ready (and enabled) authentication configuration storage.

readyStoragesWithCapability

Returns the list of all ready (and enabled) authentication configuration storage with the required capability.

removeStorage

Remove the authentication configuration storage identified by id from the registry.

setStorageOrder

Order the storages by the specified orderIds.

storage

Returns the storage with the specified id or None if not found in the registry.

storages

Returns the list of all registered authentication configuration storages.

Signals

storageAdded

Emitted after a storage was added

storageChanged

Emitted after a storage was changed

storageRemoved

Emitted after a storage was removed

class qgis.core.QgsAuthConfigurationStorageRegistry[source]

Bases: QObject

__init__()

Creates a new QgsAuthConfigurationStorageRegistry instance.

addStorage(self, storage: QgsAuthConfigurationStorage | None) bool[source]

Add an authentication configuration storage to the registry. The registry takes ownership of the storage object.

Parameters:

storage (Optional[QgsAuthConfigurationStorage]) – The storage to add

Return type:

bool

Returns:

True if the storage was added, False if it was already present in the registry.

Note

The storage object must have a unique id.

Note

This method must be called from the same thread the registry was created in.

firstReadyStorageWithCapability(self, capability: Qgis.AuthConfigurationStorageCapability) QgsAuthConfigurationStorage | None[source]

Returns the first ready (and enabled) authentication configuration storage which has the required capability.

Parameters:

capability (Qgis.AuthConfigurationStorageCapability) – The capability to look for

Return type:

Optional[QgsAuthConfigurationStorage]

readyStorages(self) List[QgsAuthConfigurationStorage]

Returns the list of all ready (and enabled) authentication configuration storage.

Return type:

List[QgsAuthConfigurationStorage]

readyStoragesWithCapability(self, capability: Qgis.AuthConfigurationStorageCapability) List[QgsAuthConfigurationStorage]

Returns the list of all ready (and enabled) authentication configuration storage with the required capability.

Parameters:

capability (Qgis.AuthConfigurationStorageCapability) – The capability to look for

Return type:

List[QgsAuthConfigurationStorage]

removeStorage(self, id: str | None) bool[source]

Remove the authentication configuration storage identified by id from the registry.

Return type:

bool

Returns:

True if the storage was removed, False if it was not present in the registry.

Note

This method must be called from the same thread the registry was created in.

Note

The storage will be deleted.

Parameters:

id (Optional[str])

setStorageOrder(self, orderIds: Iterable[str | None])[source]

Order the storages by the specified orderIds.

Parameters:

orderIds (Iterable[Optional[str]]) – The ordered list of storage Ids to apply, storages not in the list will be appended at the end.

Note

This method must be called from the same thread the registry was created in.

storage(self, id: str | None) QgsAuthConfigurationStorage | None[source]

Returns the storage with the specified id or None if not found in the registry.

Parameters:

id (Optional[str]) – The id of the storage to retrieve

Return type:

Optional[QgsAuthConfigurationStorage]

signal storageAdded(id: str)[source]

Emitted after a storage was added

Parameters:

id (str) – The id of the added storage

signal storageChanged(id: str)[source]

Emitted after a storage was changed

Parameters:

id (str) – The id of the changed storage

signal storageRemoved(id: str)[source]

Emitted after a storage was removed

Parameters:

id (str) – The id of the removed storage

storages(self) List[QgsAuthConfigurationStorage]

Returns the list of all registered authentication configuration storages.

Return type:

List[QgsAuthConfigurationStorage]