Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[auth system] Add to API docs and fix warnings
  • Loading branch information
dakcarto committed Sep 21, 2015
1 parent c519e06 commit f58bd1a
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 10 deletions.
2 changes: 2 additions & 0 deletions cmake_templates/Doxyfile.in
Expand Up @@ -572,6 +572,7 @@ WARN_LOGFILE =

INPUT = @CMAKE_SOURCE_DIR@/doc \
@CMAKE_SOURCE_DIR@/src/core \
@CMAKE_SOURCE_DIR@/src/core/auth \
@CMAKE_SOURCE_DIR@/src/core/composer \
@CMAKE_SOURCE_DIR@/src/core/diagram \
@CMAKE_SOURCE_DIR@/src/core/dxf \
Expand All @@ -583,6 +584,7 @@ INPUT = @CMAKE_SOURCE_DIR@/doc \
@CMAKE_SOURCE_DIR@/src/core/raster \
@CMAKE_SOURCE_DIR@/src/core/symbology-ng \
@CMAKE_SOURCE_DIR@/src/gui \
@CMAKE_SOURCE_DIR@/src/gui/auth \
@CMAKE_SOURCE_DIR@/src/gui/attributetable \
@CMAKE_SOURCE_DIR@/src/gui/editorwidgets \
@CMAKE_SOURCE_DIR@/src/gui/editorwidgets/core \
Expand Down
9 changes: 8 additions & 1 deletion src/core/auth/qgsauthcertutils.h
Expand Up @@ -102,6 +102,8 @@ class CORE_EXPORT QgsAuthCertUtils
static const QList<QSslCertificate> certsFromString( const QString &pemtext );

/** Return list of certificate, private key and algorithm (as PEM text) from file path components
* @param certpath File path to certificate
* @param keypath File path to private key
* @param keypass Passphrase for private key
* @param reencrypt Whether to re-encrypt the private key with the passphrase
* @return certificate, private key, key's algorithm type
Expand All @@ -112,7 +114,8 @@ class CORE_EXPORT QgsAuthCertUtils
bool reencrypt = true );

/** Return list of certificate, private key and algorithm (as PEM text) for a PKCS#12 bundle
* @param keypass Passphrase for private key
* @param bundlepath File path to the PKCS bundle
* @param bundlepass Passphrase for bundle
* @param reencrypt Whether to re-encrypt the private key with the passphrase
* @return certificate, private key, key's algorithm type
*/
Expand All @@ -121,6 +124,7 @@ class CORE_EXPORT QgsAuthCertUtils
bool reencrypt = true );

/** Get the general name for CA source enum type
* @param source The enum source type for the CA
* @param single Whether to return singular or plural description
*/
static const QString getCaSourceName( QgsAuthCertUtils::CaCertSource source , bool single = false );
Expand All @@ -129,6 +133,8 @@ class CORE_EXPORT QgsAuthCertUtils
static const QString resolvedCertName( const QSslCertificate& cert, bool issuer = false );

/** Get combined distinguished name for certificate
* @param qcert Qt SSL cert object
* @param acert QCA SSL cert object to add more info to the output
* @param issuer Whether to return cert's subject or issuer combined name
*/
static const QString getCertDistinguishedName( const QSslCertificate& qcert,
Expand All @@ -142,6 +148,7 @@ class CORE_EXPORT QgsAuthCertUtils
static const QString getColonDelimited( const QString& txt );

/** Get the sha1 hash for certificate
* @param cert Qt SSL certificate to generate hash from
* @param formatted Whether to colon-delimit the hash
*/
static const QString shaHexForCert( const QSslCertificate &cert , bool formatted = false );
Expand Down
14 changes: 9 additions & 5 deletions src/core/auth/qgsauthmanager.h
Expand Up @@ -90,7 +90,7 @@ class CORE_EXPORT QgsAuthManager : public QObject
/** Standard message for when QCA's qca-ossl plugin is missing and system is disabled */
const QString disabledMessage() const;

/** The standard authentication database file in <user>/.qgis2/ or defined location
/** The standard authentication database file in ~/.qgis2/ or defined location
* @see QgsApplication::qgisAuthDbFilePath
*/
const QString authenticationDbPath() const { return mAuthDbPath; }
Expand Down Expand Up @@ -207,6 +207,7 @@ class CORE_EXPORT QgsAuthManager : public QObject
/**
* Get authentication method edit widget via its key
* @param authMethodKey Authentication method key
* @param parent Parent widget
*/
QWidget *authMethodEditWidget( const QString &authMethodKey , QWidget *parent );

Expand All @@ -230,7 +231,7 @@ class CORE_EXPORT QgsAuthManager : public QObject

/**
* Store an authentication config in the database
* @param config Associated authentication config id
* @param mconfig Associated authentication config id
* @return Whether operation succeeded
*/
bool storeAuthenticationConfig( QgsAuthMethodConfig &mconfig );
Expand All @@ -245,15 +246,15 @@ class CORE_EXPORT QgsAuthManager : public QObject
/**
* Load an authentication config from the database into subclass
* @param authcfg Associated authentication config id
* @param config Subclassed config to load into
* @param mconfig Subclassed config to load into
* @param full Whether to decrypt and populate all sensitive data in subclass
* @return Whether operation succeeded
*/
bool loadAuthenticationConfig( const QString& authcfg, QgsAuthMethodConfig &mconfig, bool full = false );

/**
* Remove an authentication config in the database
* @param config Associated authentication config id
* @param authcfg Associated authentication config id
* @return Whether operation succeeded
*/
bool removeAuthenticationConfig( const QString& authcfg );
Expand Down Expand Up @@ -285,6 +286,7 @@ class CORE_EXPORT QgsAuthManager : public QObject
* Provider call to update a QNetworkRequest with an authentication config
* @param request The QNetworkRequest
* @param authcfg Associated authentication config id
* @param dataprovider Provider key filter, offering logic branching in authentication method
* @return Whether operation succeeded
*/
bool updateNetworkRequest( QNetworkRequest &request, const QString& authcfg,
Expand All @@ -294,15 +296,17 @@ class CORE_EXPORT QgsAuthManager : public QObject
* Provider call to update a QNetworkReply with an authentication config (used to skip known SSL errors, etc.)
* @param reply The QNetworkReply
* @param authcfg Associated authentication config id
* @param dataprovider Provider key filter, offering logic branching in authentication method
* @return Whether operation succeeded
*/
bool updateNetworkReply( QNetworkReply *reply, const QString& authcfg,
const QString &dataprovider = QString() );

/**
* Provider call to update a QgsDataSourceURI with an authentication config
* @param uri The QgsDataSourceURI
* @param connectionItems The connection items, e.g. username=myname, of QgsDataSourceURI
* @param authcfg Associated authentication config id
* @param dataprovider Provider key filter, offering logic branching in authentication method
* @return Whether operation succeeded
*/
bool updateDataSourceUriItems( QStringList &connectionItems, const QString& authcfg,
Expand Down
5 changes: 5 additions & 0 deletions src/core/auth/qgsauthmethod.h
Expand Up @@ -83,6 +83,8 @@ class CORE_EXPORT QgsAuthMethod : public QObject
QStringList supportedDataProviders() const { return mDataProviders; }

/** Update a network request with authentication components
* @param request The network request to update
* @param authcfg Authentication configuration ID
* @param dataprovider Textual key for a data provider, e.g. 'postgres', that allows
* for custom updater code specific to the provider
* @return Whether the update succeeded
Expand All @@ -97,6 +99,8 @@ class CORE_EXPORT QgsAuthMethod : public QObject
}

/** Update a network reply with authentication components
* @param reply The network reply object to update
* @param authcfg Authentication configuration ID
* @param dataprovider Textual key for a data provider, e.g. 'postgres', that allows
* for custom updater code specific to the provider
* @return Whether the update succeeded
Expand All @@ -112,6 +116,7 @@ class CORE_EXPORT QgsAuthMethod : public QObject

/** Update data source connection items with authentication components
* @param connectionItems QStringlist of 'key=value' pairs, as utilized in QgsDataSourceURI::connectionInfo()
* @param authcfg Authentication configuration ID
* @param dataprovider Textual key for a data provider, e.g. 'postgres', that allows
* for custom updater code specific to the provider
* @return Whether the update succeeded
Expand Down
3 changes: 2 additions & 1 deletion src/core/auth/qgsauthmethodregistry.h
Expand Up @@ -72,7 +72,8 @@ class CORE_EXPORT QgsAuthMethodRegistry
// int authMethodCapabilities( const QString& authMethodKey ) const;

/** Return the GUI edit widget associated with the auth method
@param authMethodKey identificator of the auth method
* @param parent Parent widget
* @param authMethodKey identificator of the auth method
*/
QWidget *editWidget( const QString & authMethodKey, QWidget * parent = 0 );

Expand Down
5 changes: 3 additions & 2 deletions src/gui/auth/qgsauthconfigedit.h
Expand Up @@ -43,8 +43,9 @@ class GUI_EXPORT QgsAuthConfigEdit : public QDialog, private Ui::QgsAuthConfigEd

/**
* Create a dialog for editing an authentication configuration
*
* @param authcfg Authentication config id for a existing config in auth database
* @param parent Parent widget
* @param authcfg Authentication config id for a existing config in auth database
* @param dataprovider The provider origin of the edit, to allow for customized code and filtering
*/
explicit QgsAuthConfigEdit( QWidget *parent = 0, const QString& authcfg = QString(),
const QString &dataprovider = QString() );
Expand Down
1 change: 1 addition & 0 deletions src/gui/auth/qgsauthconfigselect.h
Expand Up @@ -34,6 +34,7 @@ class GUI_EXPORT QgsAuthConfigSelect : public QWidget, private Ui::QgsAuthConfig
/**
* Create a dialog for setting an associated authentication config, either
* from existing configs, or creating/removing them from auth database
* @param parent Parent widget
* @param dataprovider The key of the calling layer provider, if applicable
*/
explicit QgsAuthConfigSelect( QWidget *parent = 0, const QString &dataprovider = QString() );
Expand Down
3 changes: 3 additions & 0 deletions src/gui/auth/qgsauthsslconfigwidget.h
Expand Up @@ -135,6 +135,9 @@ class GUI_EXPORT QgsAuthSslConfigWidget : public QWidget, private Ui::QgsAuthSsl

//////////////// Embed in dialog ///////////////////

/** \ingroup gui
* Dialog wrapper of widget for editing an SSL server configuration
*/
class GUI_EXPORT QgsAuthSslConfigDialog : public QDialog
{
Q_OBJECT
Expand Down
2 changes: 1 addition & 1 deletion src/ui/qgsoptionsbase.ui
Expand Up @@ -4515,7 +4515,7 @@
</layout>
</widget>
<widget class="QWidget" name="mOptionsPageAuth">
<layout class="QVBoxLayout" name="verticalLayout_42">
<layout class="QVBoxLayout" name="verticalLayout_45">
<property name="bottomMargin">
<number>0</number>
</property>
Expand Down

0 comments on commit f58bd1a

Please sign in to comment.