Make user() available throught AbsctractCredentials

This commit is contained in:
Daniel Molkentin 2013-11-13 13:59:35 +01:00
parent ca79d3b437
commit 2ff4ebc72f
6 changed files with 16 additions and 1 deletions

View file

@ -33,6 +33,7 @@ public:
virtual void syncContextPreStart(CSYNC* ctx) = 0;
virtual bool changed(AbstractCredentials* credentials) const = 0;
virtual QString authType() const = 0;
virtual QString user() const = 0;
virtual QNetworkAccessManager* getQNAM() const = 0;
virtual bool ready() const = 0;
virtual void fetch(Account *account) = 0;

View file

@ -35,6 +35,11 @@ QString DummyCredentials::authType() const
return QString::fromLatin1("dummy");
}
QString DummyCredentials::user() const
{
return QString();
}
QNetworkAccessManager* DummyCredentials::getQNAM() const
{
return new MirallAccessManager;

View file

@ -28,6 +28,7 @@ public:
void syncContextPreStart(CSYNC* ctx);
bool changed(AbstractCredentials* credentials) const;
QString authType() const;
QString user() const;
QNetworkAccessManager* getQNAM() const;
bool ready() const;
void fetch(Account*);

View file

@ -47,7 +47,6 @@ public:
bool ready() const;
void fetch(Account *account);
void persist(Account *account);
QString user() const;
QString password() const;

View file

@ -146,6 +146,14 @@ QString ShibbolethCredentials::authType() const
return QString::fromLatin1("shibboleth");
}
QString ShibbolethCredentials::user() const
{
// ### TODO: If we had a way to extract the currently authenticated user
// somehow, we could return its id token (email) here (stored in REMOTE_USER)
// The server doesn't return it by default
return QString();
}
QNetworkCookie ShibbolethCredentials::cookie() const
{
return _shibCookie;

View file

@ -38,6 +38,7 @@ public:
void syncContextPreStart(CSYNC* ctx);
bool changed(AbstractCredentials* credentials) const;
QString authType() const;
QString user() const;
QNetworkAccessManager* getQNAM() const;
bool ready() const;
void fetch(Account *account);