diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2022-09-28 13:43:23 +0300 |
---|---|---|
committer | Hannah von Reth <hannah.vonreth@owncloud.com> | 2022-09-28 13:58:56 +0300 |
commit | 06dff75eebbcfbf46985722aa021bdd10eeb7fc0 (patch) | |
tree | 623522b4ca8856e7ebb0dac42f8728e38e80ef21 | |
parent | a55be8dd4504603e88c67755de1121febd2ee628 (diff) |
Remove unsupported TOKEN_AUTH_ONLY build optionwork/TOKEN_AUTH_ONLY
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/cmd/cmd.cpp | 15 | ||||
-rw-r--r-- | src/common/utility.h | 2 | ||||
-rw-r--r-- | src/common/utility_unix.cpp | 2 | ||||
-rw-r--r-- | src/common/utility_win.cpp | 2 | ||||
-rw-r--r-- | src/csync/CMakeLists.txt | 5 | ||||
-rw-r--r-- | src/libsync/CMakeLists.txt | 17 | ||||
-rw-r--r-- | src/libsync/account.cpp | 2 | ||||
-rw-r--r-- | src/libsync/account.h | 7 | ||||
-rw-r--r-- | src/libsync/configfile.cpp | 11 | ||||
-rw-r--r-- | src/libsync/networkjobs.cpp | 4 | ||||
-rw-r--r-- | src/libsync/networkjobs.h | 2 | ||||
-rw-r--r-- | src/libsync/owncloudtheme.cpp | 5 | ||||
-rw-r--r-- | src/libsync/owncloudtheme.h | 2 | ||||
-rw-r--r-- | src/libsync/theme.cpp | 8 | ||||
-rw-r--r-- | src/libsync/theme.h | 9 |
17 files changed, 8 insertions, 95 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d7b77b2da..d421405f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,10 +78,6 @@ message(STATUS "GIT_SHA1 ${GIT_SHA1}") set(SYSCONFDIR ${SYSCONF_INSTALL_DIR}) -# this option removes Http authentication, keychain, shibboleth etc and is intended for -# external authentication mechanisms -option(TOKEN_AUTH_ONLY "TOKEN_AUTH_ONLY" OFF) - option(NO_MSG_HANDLER "Don't redirect QDebug outputs to the log window/file" OFF) # this option builds the shell integration diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e6822fbf0..9b33b555f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,11 +1,9 @@ -find_package(Qt5 5.15 COMPONENTS Core Network Xml Concurrent REQUIRED) +find_package(Qt5 5.15 COMPONENTS Core Concurrent Network Widgets Xml REQUIRED) get_target_property (QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION) message(STATUS "Using Qt ${Qt5Core_VERSION} (${QT_QMAKE_EXECUTABLE})") -if(NOT TOKEN_AUTH_ONLY) - find_package(Qt5Keychain REQUIRED) -endif() +find_package(Qt5Keychain REQUIRED) # TODO: Mingw64 7.3 might also need to be excluded here as it seems to not automatically link libssp if(NOT WIN32) diff --git a/src/cmd/cmd.cpp b/src/cmd/cmd.cpp index e64b6527f..96c0f8aca 100644 --- a/src/cmd/cmd.cpp +++ b/src/cmd/cmd.cpp @@ -27,14 +27,10 @@ #include <qdebug.h> #include "account.h" -#include "configfile.h" // ONLY ACCESS THE STATIC FUNCTIONS! -#ifdef TOKEN_AUTH_ONLY -# include "creds/tokencredentials.h" -#else -# include "creds/httpcredentials.h" -#endif #include "common/syncjournaldb.h" #include "config.h" +#include "configfile.h" // ONLY ACCESS THE STATIC FUNCTIONS! +#include "creds/httpcredentials.h" #include "csync_exclude.h" #include "networkjobs/checkserverjobfactory.h" #include "networkjobs/jsonjob.h" @@ -270,7 +266,6 @@ QString queryPassword(const QString &user) return QString::fromStdString(s); } -#ifndef TOKEN_AUTH_ONLY class HttpCredentialsText : public HttpCredentials { public: @@ -287,7 +282,6 @@ public: emit asked(); } }; -#endif /* TOKEN_AUTH_ONLY */ [[noreturn]] void help() { @@ -528,10 +522,6 @@ int main(int argc, char **argv) f.close(); } -#ifdef TOKEN_AUTH_ONLY - TokenCredentials *cred = new TokenCredentials(ctx.user, password, ""); - account->setCredentials(cred); -#else HttpCredentialsText *cred = new HttpCredentialsText(ctx.user, password); ctx.account->setCredentials(cred); if (ctx.options.trustSSL) { @@ -549,7 +539,6 @@ int main(int argc, char **argv) qFatal("If you trust the certificate and want to ignore the errors, use the --trust option."); }); } -#endif ctx.account->setUrl(ctx.credentialFreeUrl); diff --git a/src/common/utility.h b/src/common/utility.h index 0dd67b8aa..7eec941c5 100644 --- a/src/common/utility.h +++ b/src/common/utility.h @@ -109,7 +109,6 @@ OCSYNC_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcUtility) OCSYNC_EXPORT QString durationToDescriptiveString1(quint64 msecs); OCSYNC_EXPORT QString durationToDescriptiveString2(quint64 msecs); -#ifndef TOKEN_AUTH_ONLY /** * @brief hasDarkSystray - determines whether the systray is dark or light. * @@ -121,7 +120,6 @@ OCSYNC_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcUtility) * @return bool which is true for systems with dark systray. */ OCSYNC_EXPORT bool hasDarkSystray(); -#endif // convenience OS detection methods inline bool isWindows(); diff --git a/src/common/utility_unix.cpp b/src/common/utility_unix.cpp index 5976ad329..a6a501e57 100644 --- a/src/common/utility_unix.cpp +++ b/src/common/utility_unix.cpp @@ -124,11 +124,9 @@ bool Utility::runningInAppImage() } #endif -#ifndef TOKEN_AUTH_ONLY bool Utility::hasDarkSystray() { return true; } -#endif } // namespace OCC diff --git a/src/common/utility_win.cpp b/src/common/utility_win.cpp index db2cf6edf..0289cf420 100644 --- a/src/common/utility_win.cpp +++ b/src/common/utility_win.cpp @@ -82,13 +82,11 @@ void Utility::setLaunchOnStartup(const QString &appName, const QString &guiName, } } -#ifndef TOKEN_AUTH_ONLY bool Utility::hasDarkSystray() { const QSettings settings(systemThemesC(), QSettings::NativeFormat); return !settings.value(QStringLiteral("SystemUsesLightTheme"), false).toBool(); } -#endif QVariant Utility::registryGetKeyValue(HKEY hRootKey, const QString &subKey, const QString &valueName) { diff --git a/src/csync/CMakeLists.txt b/src/csync/CMakeLists.txt index 7b9eb3292..17bbec855 100644 --- a/src/csync/CMakeLists.txt +++ b/src/csync/CMakeLists.txt @@ -37,11 +37,6 @@ target_include_directories(csync apply_common_target_settings(csync) -if(TOKEN_AUTH_ONLY) - message("Compiling with token authentication") - target_compile_definitions(csync PUBLIC -DTOKEN_AUTH_ONLY=1) -endif() - if(NO_MSG_HANDLER) target_compile_definitions(csync PUBLIC -DNO_MSG_HANDLER=1) endif() diff --git a/src/libsync/CMakeLists.txt b/src/libsync/CMakeLists.txt index f84c1bc6c..339f695d9 100644 --- a/src/libsync/CMakeLists.txt +++ b/src/libsync/CMakeLists.txt @@ -65,11 +65,7 @@ set(libsync_SRCS appprovider.cpp ) -if(TOKEN_AUTH_ONLY) - set (libsync_SRCS ${libsync_SRCS} creds/tokencredentials.cpp) -else() - set(libsync_SRCS ${libsync_SRCS} creds/httpcredentials.cpp) -endif() +set(libsync_SRCS ${libsync_SRCS} creds/httpcredentials.cpp) # These headers are installed for libowncloudsync to be used by 3rd party apps INSTALL( @@ -88,9 +84,11 @@ target_link_libraries(libsync csync Qt5::Core Qt5::Network + Qt5::Widgets PRIVATE Qt5::Concurrent ZLIB::ZLIB + qt5keychain ) apply_common_target_settings(libsync) @@ -106,15 +104,6 @@ if ( APPLE ) ) endif() -if (NOT TOKEN_AUTH_ONLY) - find_package(Qt5 REQUIRED COMPONENTS Widgets) - target_link_libraries(libsync - PUBLIC - Qt5::Widgets - PRIVATE - qt5keychain) -endif() - if(Inotify_FOUND) target_include_directories(libsync PRIVATE ${Inotify_INCLUDE_DIRS}) target_link_libraries(libsync PUBLIC ${Inotify_LIBRARIES}) diff --git a/src/libsync/account.cpp b/src/libsync/account.cpp index e7920264b..fe329e1ed 100644 --- a/src/libsync/account.cpp +++ b/src/libsync/account.cpp @@ -99,7 +99,6 @@ void Account::setDavUser(const QString &newDavUser) emit wantsAccountSaved(this); } -#ifndef TOKEN_AUTH_ONLY QPixmap Account::avatar() const { return _avatarImg; @@ -109,7 +108,6 @@ void Account::setAvatar(const QPixmap &img) _avatarImg = img; emit accountChangedAvatar(); } -#endif QString Account::displayName() const { diff --git a/src/libsync/account.h b/src/libsync/account.h index 497e4e173..5c7ca79df 100644 --- a/src/libsync/account.h +++ b/src/libsync/account.h @@ -34,10 +34,7 @@ #include <QSslSocket> #include <QUrl> #include <QUuid> - -#ifndef TOKEN_AUTH_ONLY #include <QPixmap> -#endif #include <memory> @@ -108,10 +105,8 @@ public: QString davDisplayName() const; void setDavDisplayName(const QString &newDisplayName); -#ifndef TOKEN_AUTH_ONLY QPixmap avatar() const; void setAvatar(const QPixmap &img); -#endif /// The name of the account as shown in the toolbar QString displayName() const; @@ -240,9 +235,7 @@ private: QString _davUser; QString _displayName; QString _defaultSyncRoot; -#ifndef TOKEN_AUTH_ONLY QPixmap _avatarImg; -#endif QMap<QString, QVariant> _settingsMap; QUrl _url; diff --git a/src/libsync/configfile.cpp b/src/libsync/configfile.cpp index b520c432d..687e497bc 100644 --- a/src/libsync/configfile.cpp +++ b/src/libsync/configfile.cpp @@ -25,11 +25,8 @@ #include "csync_exclude.h" -#ifndef TOKEN_AUTH_ONLY #include <QWidget> #include <QHeaderView> -#endif - #include <QCoreApplication> #include <QDir> #include <QFile> @@ -192,25 +189,20 @@ void ConfigFile::setOptionalDesktopNotifications(bool show) void ConfigFile::saveGeometry(QWidget *w) { -#ifndef TOKEN_AUTH_ONLY OC_ASSERT(!w->objectName().isNull()); auto settings = makeQSettings(); settings.beginGroup(w->objectName()); settings.setValue(geometryC(), w->saveGeometry()); settings.sync(); -#endif } void ConfigFile::restoreGeometry(QWidget *w) { -#ifndef TOKEN_AUTH_ONLY w->restoreGeometry(getValue(geometryC(), w->objectName()).toByteArray()); -#endif } void ConfigFile::saveGeometryHeader(QHeaderView *header) { -#ifndef TOKEN_AUTH_ONLY if (!header) return; OC_ASSERT(!header->objectName().isEmpty()); @@ -219,12 +211,10 @@ void ConfigFile::saveGeometryHeader(QHeaderView *header) settings.beginGroup(header->objectName()); settings.setValue(geometryC(), header->saveState()); settings.sync(); -#endif } bool ConfigFile::restoreGeometryHeader(QHeaderView *header) { -#ifndef TOKEN_AUTH_ONLY Q_ASSERT(header && !header->objectName().isNull()); auto settings = makeQSettings(); @@ -233,7 +223,6 @@ bool ConfigFile::restoreGeometryHeader(QHeaderView *header) header->restoreState(settings.value(geometryC()).toByteArray()); return true; } -#endif return false; } diff --git a/src/libsync/networkjobs.cpp b/src/libsync/networkjobs.cpp index ad7db24db..fb2ca6490 100644 --- a/src/libsync/networkjobs.cpp +++ b/src/libsync/networkjobs.cpp @@ -27,10 +27,8 @@ #include <QStringList> #include <QTimer> #include <QXmlStreamReader> -#ifndef TOKEN_AUTH_ONLY #include <QPainter> #include <QPainterPath> -#endif #include "account.h" #include "networkjobs.h" @@ -416,7 +414,6 @@ void PropfindJob::start() /*********************************************************************************************/ -#ifndef TOKEN_AUTH_ONLY AvatarJob::AvatarJob(AccountPtr account, const QString &userId, int size, QObject *parent) : AbstractNetworkJob(account, account->url(), QStringLiteral("remote.php/dav/avatars/%1/%2.png").arg(userId, QString::number(size)), parent) { @@ -464,7 +461,6 @@ void AvatarJob::finished() } emit avatarPixmap(avImage); } -#endif /*********************************************************************************************/ diff --git a/src/libsync/networkjobs.h b/src/libsync/networkjobs.h index 21f92c266..b741b21fe 100644 --- a/src/libsync/networkjobs.h +++ b/src/libsync/networkjobs.h @@ -136,7 +136,6 @@ private: bool _done = false; }; -#ifndef TOKEN_AUTH_ONLY /** * @brief Retrieves the account users avatar from the server using a GET request. * @@ -169,7 +168,6 @@ signals: private slots: void finished() override; }; -#endif /** * @brief The MkColJob class diff --git a/src/libsync/owncloudtheme.cpp b/src/libsync/owncloudtheme.cpp index 13c0349c2..bcdfd7dc2 100644 --- a/src/libsync/owncloudtheme.cpp +++ b/src/libsync/owncloudtheme.cpp @@ -16,10 +16,8 @@ #include <QString> #include <QVariant> -#ifndef TOKEN_AUTH_ONLY #include <QPixmap> #include <QIcon> -#endif #include <QCoreApplication> #include "common/utility.h" @@ -33,7 +31,6 @@ ownCloudTheme::ownCloudTheme() { } -#ifndef TOKEN_AUTH_ONLY QColor ownCloudTheme::wizardHeaderBackgroundColor() const { return QColor(4, 30, 66); @@ -53,6 +50,4 @@ QIcon ownCloudTheme::aboutIcon() const { return themeUniversalIcon(QStringLiteral("oc-image-about")); } - -#endif } diff --git a/src/libsync/owncloudtheme.h b/src/libsync/owncloudtheme.h index c80e14714..e25f9d375 100644 --- a/src/libsync/owncloudtheme.h +++ b/src/libsync/owncloudtheme.h @@ -28,12 +28,10 @@ class ownCloudTheme : public Theme Q_OBJECT public: ownCloudTheme(); -#ifndef TOKEN_AUTH_ONLY QColor wizardHeaderBackgroundColor() const override; QColor wizardHeaderTitleColor() const override; QIcon wizardHeaderLogo() const override; QIcon aboutIcon() const override; -#endif // For owncloud-brandings *do* show the virtual files option. bool showVirtualFilesOption() const override { return true; } diff --git a/src/libsync/theme.cpp b/src/libsync/theme.cpp index b1b74c6a8..a8a6a683c 100644 --- a/src/libsync/theme.cpp +++ b/src/libsync/theme.cpp @@ -21,11 +21,9 @@ #include "configfile.h" #include <QtCore> -#ifndef TOKEN_AUTH_ONLY #include <QtGui> #include <QStyle> #include <QApplication> -#endif #include <QSslSocket> #include "owncloudtheme.h" @@ -146,8 +144,6 @@ QString Theme::configFileName() const return QStringLiteral(APPLICATION_EXECUTABLE ".cfg"); } -#ifndef TOKEN_AUTH_ONLY - QIcon Theme::applicationIcon() const { return themeUniversalIcon(QStringLiteral(APPLICATION_ICON_NAME "-icon")); @@ -270,8 +266,6 @@ QString Theme::systrayIconFlavor(bool mono, bool sysTrayMenuVisible) const return flavor; } -#endif - Theme::Theme() : QObject(nullptr) { @@ -471,7 +465,6 @@ bool Theme::aboutShowCopyright() const return true; } -#ifndef TOKEN_AUTH_ONLY QIcon Theme::syncStateIcon(SyncResult::Status status, bool sysTray, bool sysTrayMenuVisible) const { return syncStateIcon(SyncResult { status }, sysTray, sysTrayMenuVisible); @@ -562,7 +555,6 @@ QPixmap Theme::wizardHeaderBanner(const QSize &size) const pix.fill(c); return pix; } -#endif QString Theme::webDavPath() const { diff --git a/src/libsync/theme.h b/src/libsync/theme.h index dd72752a3..0a838109b 100644 --- a/src/libsync/theme.h +++ b/src/libsync/theme.h @@ -90,7 +90,6 @@ public: */ virtual QString configFileName() const; -#ifndef TOKEN_AUTH_ONLY /** * Wehther we allow a fallback to a vanilla icon */ @@ -123,7 +122,6 @@ public: * Whether the branding allows the dark theme */ bool allowDarkTheme() const; -#endif virtual QString statusHeaderText(SyncResult::Status) const; @@ -196,7 +194,6 @@ public: */ virtual QString enforcedLocale() const { return QString(); } -#ifndef TOKEN_AUTH_ONLY /** colored, white or black */ QString systrayIconFlavor(bool mono, bool sysTrayMenuVisible = false) const; @@ -218,7 +215,6 @@ public: * @return banner for the setup wizard. */ [[deprecated]] virtual QPixmap wizardHeaderBanner(const QSize &size) const; -#endif /** * The SHA sum of the released git commit @@ -459,11 +455,10 @@ public: virtual bool wizardEnableWebfinger() const; protected: -#ifndef TOKEN_AUTH_ONLY QIcon themeUniversalIcon(const QString &name, IconType iconType = IconType::BrandedIcon) const; QIcon themeTrayIcon(const QString &name, bool sysTrayMenuVisible = false, IconType iconType = IconType::BrandedIconWithFallbackToVanillaIcon) const; QIcon themeIcon(const QString &name, IconType iconType = IconType::BrandedIconWithFallbackToVanillaIcon) const; -#endif + Theme(); signals: @@ -479,14 +474,12 @@ private: static Theme *_instance; bool _mono = false; -#ifndef TOKEN_AUTH_ONLY mutable QMap<QString, QIcon> _iconCache; // <<is vanilla, theme name>, bool // caches the availability of themes for branded and unbranded themes mutable QMap<QPair<bool, QString>, bool> _themeCache; const bool _hasBrandedColored = hasTheme(IconType::BrandedIcon, QStringLiteral("colored")); const bool _hasBrandedDark = hasTheme(IconType::BrandedIcon, QStringLiteral("dark")); -#endif }; template <> |