QgsAuthMethodRegistry class
A registry / canonical manager of authentication methods.
Contents
This is a Singleton class that manages authentication method plugin access.
Loaded auth methods may be restricted using QGIS_AUTHMETHOD_FILE environment variable. QGIS_AUTHMETHOD_FILE is regexp pattern applied to auth method file name (not auth method key). For example, if the variable is set to basic|pkipaths it will load only auth methods basic, and pkipaths.
Public types
- using AuthMethods = std::map<QString, QgsAuthMethodMetadata*>
- Type for auth method metadata associative container.
Public static functions
- static auto instance(const QString& pluginPath = QString()) -> QgsAuthMethodRegistry*
- Means of accessing canonical single instance.
Constructors, destructors, conversion operators
- ~QgsAuthMethodRegistry() virtual
- Virtual dectructor.
Public functions
- auto authMethod(const QString& authMethodKey) -> std::unique_ptr<QgsAuthMethod>
- Create an instance of the auth method.
- auto authMethodLibrary(const QString& authMethodKey) const -> std::unique_ptr<QLibrary>
- Returns the library object associated with an auth method key.
- auto authMethodList() const -> QStringList
- Returns list of available auth methods by their keys.
- auto authMethodMetadata(const QString& authMethodKey) const -> const QgsAuthMethodMetadata*
- Returns metadata of the auth method or nullptr if not found.
- auto editWidget(const QString& authMethodKey, QWidget* parent = nullptr) -> QWidget*
- Returns the auth method capabilities.
- auto function(const QString& authMethodKey, const QString& functionName) -> QFunctionPointer
- Gets pointer to auth method function.
- auto library(const QString& authMethodKey) const -> QString
- Returns path for the library of the auth method.
- auto libraryDirectory() const -> QDir
- Returns library directory where plugins are found.
- auto pluginList(bool asHtml = false) const -> QString
- Returns list of auth method plugins found.
- void setLibraryDirectory(const QDir& path)
- Sets library directory where to search for plugins.
Function documentation
std::unique_ptr<QgsAuthMethod> QgsAuthMethodRegistry:: authMethod(const QString& authMethodKey)
Create an instance of the auth method.
| Parameters | |
|---|---|
| authMethodKey | identificator of the auth method |
| Returns | instance of auth method or nullptr on error |
QWidget* QgsAuthMethodRegistry:: editWidget(const QString& authMethodKey,
QWidget* parent = nullptr)
Returns the auth method capabilities.
| Parameters | |
|---|---|
| authMethodKey | identificator of the auth method |
| parent | Parent widget |
QFunctionPointer QgsAuthMethodRegistry:: function(const QString& authMethodKey,
const QString& functionName)
Gets pointer to auth method function.
| Parameters | |
|---|---|
| authMethodKey | identificator of the auth method |
| functionName | name of function |
| Returns | pointer to function or nullptr on error |