From c2bcb16e6b4bb7a0dfd408e9b031a17d926ed19f Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Sun, 1 Nov 2015 14:13:54 +0000 Subject: [PATCH] Add Secrets.h for API tokens .. will be replaced with gems in Travis build. NOTE: Twitter secret is currently public (!) --- src/CalDAV.cpp | 2 ++ src/OAuthDialog.cpp | 1 + src/Secrets.h | 63 +++++++++++++++++++++++++++++++++++++++++++++ src/src.pro | 1 + 4 files changed, 67 insertions(+) create mode 100644 src/Secrets.h diff --git a/src/CalDAV.cpp b/src/CalDAV.cpp index 31cdbf394..4f0367263 100644 --- a/src/CalDAV.cpp +++ b/src/CalDAV.cpp @@ -16,6 +16,8 @@ * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "Secrets.h" + #include "CalDAV.h" #include "MainWindow.h" #include "Athlete.h" diff --git a/src/OAuthDialog.cpp b/src/OAuthDialog.cpp index 2fb0a2beb..18a9fdbbd 100644 --- a/src/OAuthDialog.cpp +++ b/src/OAuthDialog.cpp @@ -15,6 +15,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., 51 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "Secrets.h" #include "OAuthDialog.h" #include "Athlete.h" diff --git a/src/Secrets.h b/src/Secrets.h new file mode 100644 index 000000000..41ca6e29b --- /dev/null +++ b/src/Secrets.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2015 Mark Liversedge (liversedge@gmail.com) + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + + +// Web based services that offer an API typically require you to sign +// up to a terms of service and will provide an access token or 'secret' +// to use when making calls. +// +// Because these are registered to the GoldenCheetah project they are +// not made public. If you want to build with these services enabled +// you will need to request a token from the provider and add a line +// to your gcconfig.pri file off the form: +// DEFINES += GC_TWITTER_CONSUMER_SECRET="xxxxxxx" +// +// This file is modified by the travis build scripts to replace the +// __XXXX_SECRET__ token with the secret gem held within the travis +// build environment. +// +// ********* DO NOT MODIFY THIS FILE EXCEPT TO ADD NEW ************ +// ********* API TOKENS SINCE THE DEFINES ARE UPDATED ************ +// ********* AUTOMATICALLY BY THE TRAVIS BUILD SYSTEM ************ + +#ifndef _GC_SECRETS_H +#define _GC_SECRETS_H 1 + +// used by OAuthDialog.cpp and CalDAV.cpp for Google Calendar +#ifndef GC_GOOGLE_CALENDAR_CLIENT_SECRET +#define GC_GOOGLE_CALENDAR_CLIENT_SECRET "__GC_GOOGLE_CALENDAR_CLIENT_SECRET__" +#endif + +// used by OAuthDialog.cpp (but currently public in Settings.h (!!) +//#ifndef GC_TWITTER_CONSUMER_SECRET +//#define GC_TWITTER_CONSUMER_SECRET "__GC_TWITTER_CONSUMER_SECRET__" +//#endif + +#ifndef GC_DROPBOX_CLIENT_SECRET +#define GC_DROPBOX_CLIENT_SECRET "__GC_DROPBOX_CLIENT_SECRET__" +#endif + +#ifndef GC_STRAVA_CLIENT_SECRET +#define GC_STRAVA_CLIENT_SECRET "__GC_STRAVA_CLIENT_SECRET__" +#endif + +#ifndef GC_CYCLINGANALYTICS_CLIENT_SECRET +#define GC_CYCLINGANALYTICS_CLIENT_SECRET "__GC_CYCLINGANALYTICS_CLIENT_SECRET__" +#endif + +#endif diff --git a/src/src.pro b/src/src.pro index 904e4133b..e72036008 100644 --- a/src/src.pro +++ b/src/src.pro @@ -480,6 +480,7 @@ HEADERS += \ ScatterWindow.h \ Season.h \ SeasonParser.h \ + Secrets.h \ Serial.h \ Settings.h \ ShareDialog.h \