Skip to content
Permalink
Browse files

[auth system] Fix doc string warnings and comments in PR 2330

  • Loading branch information
dakcarto committed Sep 22, 2015
1 parent 16ac248 commit 1ff02debdc1aa76cadc8e017fce1b5d8640c4adc
Showing with 436 additions and 212 deletions.
  1. +33 −33 python/core/auth/qgsauthcertutils.sip
  2. +28 −28 src/core/auth/qgsauthcertutils.cpp
  3. +37 −33 src/core/auth/qgsauthcertutils.h
  4. +123 −16 src/core/auth/qgsauthconfig.h
  5. +2 −0 src/core/auth/qgsauthmanager.h
  6. +7 −2 src/core/auth/qgsauthmethod.h
  7. +6 −0 src/core/auth/qgsauthmethodmetadata.h
  8. +2 −0 src/core/auth/qgsauthmethodregistry.cpp
  9. +1 −0 src/core/auth/qgsauthmethodregistry.h
  10. +1 −1 src/core/qgsdataprovider.h
  11. +2 −1 src/core/qgsdatasourceuri.h
  12. +1 −1 src/gui/auth/qgsauthauthoritieseditor.cpp
  13. +3 −1 src/gui/auth/qgsauthauthoritieseditor.h
  14. +11 −0 src/gui/auth/qgsauthcertificateinfo.h
  15. +11 −0 src/gui/auth/qgsauthcerttrustpolicycombobox.h
  16. +1 −0 src/gui/auth/qgsauthconfigedit.h
  17. +2 −0 src/gui/auth/qgsauthconfigeditor.cpp
  18. +2 −0 src/gui/auth/qgsauthconfigselect.cpp
  19. +5 −0 src/gui/auth/qgsautheditorwidgets.h
  20. +6 −6 src/gui/auth/qgsauthguiutils.cpp
  21. +6 −6 src/gui/auth/qgsauthguiutils.h
  22. +3 −1 src/gui/auth/qgsauthidentitieseditor.h
  23. +2 −2 src/gui/auth/qgsauthimportcertdialog.cpp
  24. +13 −0 src/gui/auth/qgsauthimportcertdialog.h
  25. +11 −0 src/gui/auth/qgsauthimportidentitydialog.h
  26. +14 −0 src/gui/auth/qgsauthmethodedit.h
  27. +3 −1 src/gui/auth/qgsauthserverseditor.h
  28. +51 −1 src/gui/auth/qgsauthsslconfigwidget.h
  29. +8 −0 src/gui/auth/qgsauthsslerrorsdialog.h
  30. +6 −1 src/gui/auth/qgsauthsslimportdialog.h
  31. +7 −1 src/gui/auth/qgsauthtrustedcasdialog.h
  32. +5 −10 src/gui/qgscredentialdialog.cpp
  33. +0 −1 src/gui/qgscredentialdialog.h
  34. +23 −66 src/ui/qgscredentialdialog.ui
@@ -43,85 +43,85 @@ class QgsAuthCertUtils



static const QString getSslProtocolName( QSsl::SslProtocol protocol );
static QString getSslProtocolName( QSsl::SslProtocol protocol );


static const QMap< QString, QSslCertificate> mapDigestToCerts( QList<QSslCertificate> certs );
static QMap< QString, QSslCertificate> mapDigestToCerts( QList<QSslCertificate> certs );


// static const QMap< QString, QList<QSslCertificate> > certsGroupedByOrg( QList<QSslCertificate> certs );
// static QMap< QString, QList<QSslCertificate> > certsGroupedByOrg( QList<QSslCertificate> certs );


static const QMap< QString, QgsAuthConfigSslServer> mapDigestToSslConfigs( QList<QgsAuthConfigSslServer> configs );
static QMap< QString, QgsAuthConfigSslServer> mapDigestToSslConfigs( QList<QgsAuthConfigSslServer> configs );


// static const QMap< QString, QList<QgsAuthConfigSslServer> > sslConfigsGroupedByOrg( QList<QgsAuthConfigSslServer> configs );
// static QMap< QString, QList<QgsAuthConfigSslServer> > sslConfigsGroupedByOrg( QList<QgsAuthConfigSslServer> configs );


static const QList<QSslCertificate> certsFromFile( const QString &certspath );
static QList<QSslCertificate> certsFromFile( const QString &certspath );


static const QSslCertificate certFromFile( const QString &certpath );
static QSslCertificate certFromFile( const QString &certpath );


static const QSslKey keyFromFile( const QString &keypath,
const QString &keypass = QString(),
QString *algtype = 0 );
static QSslKey keyFromFile( const QString &keypath,
const QString &keypass = QString(),
QString *algtype = 0 );


static const QList<QSslCertificate> certsFromString( const QString &pemtext );
static QList<QSslCertificate> certsFromString( const QString &pemtext );


static const QStringList certKeyBundleToPem( const QString &certpath,
const QString &keypath,
const QString &keypass = QString(),
bool reencrypt = true );
static QStringList certKeyBundleToPem( const QString &certpath,
const QString &keypath,
const QString &keypass = QString(),
bool reencrypt = true );


static const QStringList pkcs12BundleToPem( const QString &bundlepath,
const QString &bundlepass = QString(),
bool reencrypt = true );
static QStringList pkcs12BundleToPem( const QString &bundlepath,
const QString &bundlepass = QString(),
bool reencrypt = true );


static const QString getCaSourceName( QgsAuthCertUtils::CaCertSource source , bool single = false );
static QString getCaSourceName( QgsAuthCertUtils::CaCertSource source , bool single = false );


static const QString resolvedCertName( const QSslCertificate& cert, bool issuer = false );
static QString resolvedCertName( const QSslCertificate& cert, bool issuer = false );


// static const QString getCertDistinguishedName( const QSslCertificate& qcert,
// static QString getCertDistinguishedName( const QSslCertificate& qcert,
// const QCA::Certificate& acert = QCA::Certificate(),
// bool issuer = false );


static const QString getCertTrustName( QgsAuthCertUtils::CertTrustPolicy trust );
static QString getCertTrustName( QgsAuthCertUtils::CertTrustPolicy trust );


static const QString getColonDelimited( const QString& txt );
static QString getColonDelimited( const QString& txt );


static const QString shaHexForCert( const QSslCertificate &cert , bool formatted = false );
static QString shaHexForCert( const QSslCertificate &cert , bool formatted = false );


// static const QCA::Certificate qtCertToQcaCert( const QSslCertificate& cert );
// static QCA::Certificate qtCertToQcaCert( const QSslCertificate& cert );


// static const QCA::CertificateCollection qtCertsToQcaCollection( const QList<QSslCertificate>& certs );
// static QCA::CertificateCollection qtCertsToQcaCollection( const QList<QSslCertificate>& certs );


// static const QCA::KeyBundle qcaKeyBundle( const QString &path, const QString &pass );
// static QCA::KeyBundle qcaKeyBundle( const QString &path, const QString &pass );


// static const QString qcaValidityMessage( QCA::Validity validity );
// static QString qcaValidityMessage( QCA::Validity validity );


// static const QString qcaSignatureAlgorithm( QCA::SignatureAlgorithm algorithm );
// static QString qcaSignatureAlgorithm( QCA::SignatureAlgorithm algorithm );


// static const QString qcaKnownConstraint( QCA::ConstraintTypeKnown constraint );
// static QString qcaKnownConstraint( QCA::ConstraintTypeKnown constraint );


static const QString certificateUsageTypeString( QgsAuthCertUtils::CertUsageType usagetype );
static QString certificateUsageTypeString( QgsAuthCertUtils::CertUsageType usagetype );


static QList<QgsAuthCertUtils::CertUsageType> certificateUsageTypes( const QSslCertificate& cert );
@@ -141,7 +141,7 @@ class QgsAuthCertUtils

static bool certificateIsSslClient( const QSslCertificate& cert );

static const QString sslErrorEnumString( QSslError::SslError errenum );
static QString sslErrorEnumString( QSslError::SslError errenum );

// static const QList<QPair<QSslError::SslError, QString> > sslErrorEnumStrings();
// static QList<QPair<QSslError::SslError, QString> > sslErrorEnumStrings();
};
@@ -25,7 +25,7 @@
#include "qgslogger.h"


const QString QgsAuthCertUtils::getSslProtocolName( QSsl::SslProtocol protocol )
QString QgsAuthCertUtils::getSslProtocolName( QSsl::SslProtocol protocol )
{
switch ( protocol )
{
@@ -46,7 +46,7 @@ const QString QgsAuthCertUtils::getSslProtocolName( QSsl::SslProtocol protocol )
}
}

const QMap<QString, QSslCertificate> QgsAuthCertUtils::mapDigestToCerts( QList<QSslCertificate> certs )
QMap<QString, QSslCertificate> QgsAuthCertUtils::mapDigestToCerts( QList<QSslCertificate> certs )
{
QMap<QString, QSslCertificate> digestmap;
Q_FOREACH ( QSslCertificate cert, certs )
@@ -56,7 +56,7 @@ const QMap<QString, QSslCertificate> QgsAuthCertUtils::mapDigestToCerts( QList<Q
return digestmap;
}

const QMap<QString, QList<QSslCertificate> > QgsAuthCertUtils::certsGroupedByOrg( QList<QSslCertificate> certs )
QMap<QString, QList<QSslCertificate> > QgsAuthCertUtils::certsGroupedByOrg( QList<QSslCertificate> certs )
{
QMap< QString, QList<QSslCertificate> > orgcerts;
Q_FOREACH ( QSslCertificate cert, certs )
@@ -70,7 +70,7 @@ const QMap<QString, QList<QSslCertificate> > QgsAuthCertUtils::certsGroupedByOrg
return orgcerts;
}

const QMap<QString, QgsAuthConfigSslServer> QgsAuthCertUtils::mapDigestToSslConfigs( QList<QgsAuthConfigSslServer> configs )
QMap<QString, QgsAuthConfigSslServer> QgsAuthCertUtils::mapDigestToSslConfigs( QList<QgsAuthConfigSslServer> configs )
{
QMap<QString, QgsAuthConfigSslServer> digestmap;
Q_FOREACH ( QgsAuthConfigSslServer config, configs )
@@ -80,7 +80,7 @@ const QMap<QString, QgsAuthConfigSslServer> QgsAuthCertUtils::mapDigestToSslConf
return digestmap;
}

const QMap<QString, QList<QgsAuthConfigSslServer> > QgsAuthCertUtils::sslConfigsGroupedByOrg( QList<QgsAuthConfigSslServer> configs )
QMap<QString, QList<QgsAuthConfigSslServer> > QgsAuthCertUtils::sslConfigsGroupedByOrg( QList<QgsAuthConfigSslServer> configs )
{
QMap< QString, QList<QgsAuthConfigSslServer> > orgconfigs;
Q_FOREACH ( QgsAuthConfigSslServer config, configs )
@@ -113,7 +113,7 @@ static QByteArray fileData_( const QString& path, bool astext = false )
return data;
}

const QList<QSslCertificate> QgsAuthCertUtils::certsFromFile( const QString &certspath )
QList<QSslCertificate> QgsAuthCertUtils::certsFromFile( const QString &certspath )
{
QList<QSslCertificate> certs;
bool pem = certspath.endsWith( ".pem", Qt::CaseInsensitive );
@@ -125,7 +125,7 @@ const QList<QSslCertificate> QgsAuthCertUtils::certsFromFile( const QString &cer
return certs;
}

const QSslCertificate QgsAuthCertUtils::certFromFile( const QString &certpath )
QSslCertificate QgsAuthCertUtils::certFromFile( const QString &certpath )
{
QSslCertificate cert;
QList<QSslCertificate> certs( QgsAuthCertUtils::certsFromFile( certpath ) );
@@ -140,9 +140,9 @@ const QSslCertificate QgsAuthCertUtils::certFromFile( const QString &certpath )
return cert;
}

const QSslKey QgsAuthCertUtils::keyFromFile( const QString &keypath,
const QString &keypass,
QString *algtype )
QSslKey QgsAuthCertUtils::keyFromFile( const QString &keypath,
const QString &keypass,
QString *algtype )
{
bool pem = keypath.endsWith( ".pem", Qt::CaseInsensitive );
QByteArray keydata( fileData_( keypath, pem ) );
@@ -177,7 +177,7 @@ const QSslKey QgsAuthCertUtils::keyFromFile( const QString &keypath,
return clientkey;
}

const QList<QSslCertificate> QgsAuthCertUtils::certsFromString( const QString &pemtext )
QList<QSslCertificate> QgsAuthCertUtils::certsFromString( const QString &pemtext )
{
QList<QSslCertificate> certs;
certs = QSslCertificate::fromData( pemtext.toAscii(), QSsl::Pem );
@@ -188,7 +188,7 @@ const QList<QSslCertificate> QgsAuthCertUtils::certsFromString( const QString &p
return certs;
}

const QStringList QgsAuthCertUtils::certKeyBundleToPem( const QString &certpath,
QStringList QgsAuthCertUtils::certKeyBundleToPem( const QString &certpath,
const QString &keypath,
const QString &keypass,
bool reencrypt )
@@ -213,7 +213,7 @@ const QStringList QgsAuthCertUtils::certKeyBundleToPem( const QString &certpath,
return QStringList() << certpem << keypem << algtype;
}

const QStringList QgsAuthCertUtils::pkcs12BundleToPem( const QString &bundlepath,
QStringList QgsAuthCertUtils::pkcs12BundleToPem( const QString &bundlepath,
const QString &bundlepass,
bool reencrypt )
{
@@ -246,7 +246,7 @@ const QStringList QgsAuthCertUtils::pkcs12BundleToPem( const QString &bundlepath
return QStringList() << bundle.certificateChain().primary().toPEM() << bundle.privateKey().toPEM( passarray ) << algtype;
}

const QString QgsAuthCertUtils::getCaSourceName( QgsAuthCertUtils::CaCertSource source, bool single )
QString QgsAuthCertUtils::getCaSourceName( QgsAuthCertUtils::CaCertSource source, bool single )
{
switch ( source )
{
@@ -263,7 +263,7 @@ const QString QgsAuthCertUtils::getCaSourceName( QgsAuthCertUtils::CaCertSource
}
}

const QString QgsAuthCertUtils::resolvedCertName( const QSslCertificate &cert, bool issuer )
QString QgsAuthCertUtils::resolvedCertName( const QSslCertificate &cert, bool issuer )
{
QString name( issuer ? cert.issuerInfo( QSslCertificate::CommonName )
: cert.subjectInfo( QSslCertificate::CommonName ) );
@@ -301,7 +301,7 @@ void QgsAuthCertUtils::appendDirSegment_( QStringList &dirname,
}
}

const QString QgsAuthCertUtils::getCertDistinguishedName( const QSslCertificate &qcert ,
QString QgsAuthCertUtils::getCertDistinguishedName( const QSslCertificate &qcert ,
const QCA::Certificate &acert ,
bool issuer )
{
@@ -351,7 +351,7 @@ const QString QgsAuthCertUtils::getCertDistinguishedName( const QSslCertificate
return dirname.join( "," );
}

const QString QgsAuthCertUtils::getCertTrustName( QgsAuthCertUtils::CertTrustPolicy trust )
QString QgsAuthCertUtils::getCertTrustName( QgsAuthCertUtils::CertTrustPolicy trust )
{
switch ( trust )
{
@@ -366,7 +366,7 @@ const QString QgsAuthCertUtils::getCertTrustName( QgsAuthCertUtils::CertTrustPol
}
}

const QString QgsAuthCertUtils::getColonDelimited( const QString &txt )
QString QgsAuthCertUtils::getColonDelimited( const QString &txt )
{
// 64321c05b0ebab8e2b67ec0d7d9e2b6d4bc3c303
// -> 64:32:1c:05:b0:eb:ab:8e:2b:67:ec:0d:7d:9e:2b:6d:4b:c3:c3:03
@@ -378,7 +378,7 @@ const QString QgsAuthCertUtils::getColonDelimited( const QString &txt )
return sl.join( ":" );
}

const QString QgsAuthCertUtils::shaHexForCert( const QSslCertificate& cert, bool formatted )
QString QgsAuthCertUtils::shaHexForCert( const QSslCertificate& cert, bool formatted )
{
QString sha( cert.digest( QCryptographicHash::Sha1 ).toHex() );
if ( formatted )
@@ -388,7 +388,7 @@ const QString QgsAuthCertUtils::shaHexForCert( const QSslCertificate& cert, bool
return sha;
}

const QCA::Certificate QgsAuthCertUtils::qtCertToQcaCert( const QSslCertificate &cert )
QCA::Certificate QgsAuthCertUtils::qtCertToQcaCert( const QSslCertificate &cert )
{
if ( QgsAuthManager::instance()->isDisabled() )
return QCA::Certificate();
@@ -403,7 +403,7 @@ const QCA::Certificate QgsAuthCertUtils::qtCertToQcaCert( const QSslCertificate
return qcacert;
}

const QCA::CertificateCollection QgsAuthCertUtils::qtCertsToQcaCollection( const QList<QSslCertificate> &certs )
QCA::CertificateCollection QgsAuthCertUtils::qtCertsToQcaCollection( const QList<QSslCertificate> &certs )
{
QCA::CertificateCollection qcacoll;
if ( QgsAuthManager::instance()->isDisabled() )
@@ -420,7 +420,7 @@ const QCA::CertificateCollection QgsAuthCertUtils::qtCertsToQcaCollection( const
return qcacoll;
}

const QCA::KeyBundle QgsAuthCertUtils::qcaKeyBundle( const QString &path, const QString &pass )
QCA::KeyBundle QgsAuthCertUtils::qcaKeyBundle( const QString &path, const QString &pass )
{
QCA::SecureArray passarray;
if ( !pass.isEmpty() )
@@ -432,7 +432,7 @@ const QCA::KeyBundle QgsAuthCertUtils::qcaKeyBundle( const QString &path, const
return ( res == QCA::ConvertGood ? bundle : QCA::KeyBundle() );
}

const QString QgsAuthCertUtils::qcaValidityMessage( QCA::Validity validity )
QString QgsAuthCertUtils::qcaValidityMessage( QCA::Validity validity )
{
switch ( validity )
{
@@ -465,7 +465,7 @@ const QString QgsAuthCertUtils::qcaValidityMessage( QCA::Validity validity )
}
}

const QString QgsAuthCertUtils::qcaSignatureAlgorithm( QCA::SignatureAlgorithm algorithm )
QString QgsAuthCertUtils::qcaSignatureAlgorithm( QCA::SignatureAlgorithm algorithm )
{
switch ( algorithm )
{
@@ -496,7 +496,7 @@ const QString QgsAuthCertUtils::qcaSignatureAlgorithm( QCA::SignatureAlgorithm a
}
}

const QString QgsAuthCertUtils::qcaKnownConstraint( QCA::ConstraintTypeKnown constraint )
QString QgsAuthCertUtils::qcaKnownConstraint( QCA::ConstraintTypeKnown constraint )
{
switch ( constraint )
{
@@ -541,7 +541,7 @@ const QString QgsAuthCertUtils::qcaKnownConstraint( QCA::ConstraintTypeKnown con
}
}

const QString QgsAuthCertUtils::certificateUsageTypeString( QgsAuthCertUtils::CertUsageType usagetype )
QString QgsAuthCertUtils::certificateUsageTypeString( QgsAuthCertUtils::CertUsageType usagetype )
{
switch ( usagetype )
{
@@ -788,7 +788,7 @@ bool QgsAuthCertUtils::certificateIsSslClient( const QSslCertificate &cert )
return QgsAuthCertUtils::certificateUsageTypes( cert ).contains( QgsAuthCertUtils::TlsClientUsage );
}

const QString QgsAuthCertUtils::sslErrorEnumString( QSslError::SslError errenum )
QString QgsAuthCertUtils::sslErrorEnumString( QSslError::SslError errenum )
{
switch ( errenum )
{
@@ -849,7 +849,7 @@ const QString QgsAuthCertUtils::sslErrorEnumString( QSslError::SslError errenum
}
}

const QList<QPair<QSslError::SslError, QString> > QgsAuthCertUtils::sslErrorEnumStrings()
QList<QPair<QSslError::SslError, QString> > QgsAuthCertUtils::sslErrorEnumStrings()
{
QList<QPair<QSslError::SslError, QString> > errenums;
errenums << qMakePair( QSslError::UnableToGetIssuerCertificate,

0 comments on commit 1ff02de

Please sign in to comment.
You can’t perform that action at this time.