Skip to content

Commit

Permalink
Add GC_XERT_CLIENT_ID
Browse files Browse the repository at this point in the history
  • Loading branch information
grauser committed Jul 9, 2022
1 parent cb1e59f commit d3fb4f1
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -39,6 +39,7 @@ env:
- secure: eTSJmS38EsTkI22yvDJLUrBxSyLDwd3pDRsyLQfZ3ThN0UJ9cQN2uB7aLy3OzNYadpi+Axlr46MgG0G5qGV1hHXkf+C4orGkURQWxHA7L5R/oE98TuYMO1bisZu9dJEVbmEM4cehCjbB7DExzxK4m6+oTJsWhVbIwlNh5Poq/v4=
- secure: gUDTEErUOhzkSVofEvdw1jqHHsE/K+/SOqRBKDToaFPhi6XK+Tvu1LqPMjfPdjYLaCSiwc/R79fJrAEuK+7KSwdiLEnDv3RMpRS5g1UWyJ/ZYd5xNR+WiBqUvnY/S/CJokuNw7gBbGq7JCO4pmIGV5YB9FA4Na6MG/eHzTSOIig=
- secure: Qk+gzBLwjrB8abUYzxap10dYSpIeKpB1gqhdoMbqS23G0r1lejnsjutIfReuJGK/efCmhisKN1xIX/InvJWD8z6GsLJFmf3F0oRj7aDJ/X5UIn9Upflje9xgHQafP1FJuzZBWtzandNfPE8EmEOgAQsJZ3c7xBE1SY/6xcJaQTc=
- secure: m4+k3/QcYvqmMoRO8uq3ef2jAO1FWeRVDG/XtlbjBlgmB5OR/zW5c7c1Ywm6IM5yzsi1rRks8GFffZ6gYqXhML10EfGKVbnyBcZZ7HVylNtvxDF68W1BLacChzDs4mGYQSV8kJRGI3EaVNdyFJ5yln/HUZ6qBbQ473MtxprO6BI=

jobs:
include:
Expand Down
3 changes: 3 additions & 0 deletions appveyor.yml
Expand Up @@ -39,6 +39,8 @@ environment:
secure: /OFVjEBwU7o3SItIQVf/YlJ8XErxneXIT2N0JyPMSXR1tCbdZVWixMHpqKNWoNk4
GC_NOLIO_SECRET:
secure: mmMksvVnfBiXufBDn2gAhQY53n0J9BokSCtDY51uU918QJ/LL4XOojtJp5tMFn8T7ugyDhNASpqZXiK55vxSD53vm+tjufpfzppKEeh93Babvc/VrndLB1X/RZCRUQTR6rka05fYl4e0eBzP1H091A==
GC_XERT_CLIENT_SECRET:
secure: /1rVLT8LyJCZ4xNJ5W+NtAcZ1rtKaUjW9SYm/T3gHoc=

init:
# Setup QT 5.15 - 64Bit
Expand Down Expand Up @@ -151,6 +153,7 @@ before_build:
- ps: (Get-Content src\Core\Secrets.h) -replace '__GC_POLARFLOW_CLIENT_SECRET__', $env:GC_POLARFLOW_CLIENT_SECRET | Set-Content src\Core\Secrets.h
- ps: (Get-Content src\Core\Secrets.h) -replace '__GC_SPORTTRACKS_CLIENT_SECRET__', $env:GC_SPORTTRACKS_CLIENT_SECRET | Set-Content src\Core\Secrets.h
- ps: (Get-Content src\Core\Secrets.h) -replace '__GC_RWGPS_API_KEY__', $env:GC_RWGPS_API_KEY | Set-Content src\Core\Secrets.h
- ps: (Get-Content src\Core\Secrets.h) -replace '__GC_XERT_CLIENT_SECRET__', $env:GC_XERT_CLIENT_SECRET | Set-Content src\Core\Secrets.h

build_script:
- qmake.exe build.pro -r -spec win32-msvc
Expand Down
2 changes: 1 addition & 1 deletion src/Cloud/OAuthDialog.cpp
Expand Up @@ -334,7 +334,7 @@ OAuthDialog::urlChanged(const QUrl &url)
params.addQueryItem("password", service->getSetting(GC_XERTPASS, "").toString());
params.addQueryItem("grant_type", "password");

authheader = QString("%1:%1").arg("xert_public");
authheader = QString("%1:%2").arg(GC_XERT_CLIENT_ID).arg(GC_XERT_CLIENT_SECRET);
} else if (site == RIDEWITHGPS) {
urlstr = QString("https://ridewithgps.com/users/current.json");
params.addQueryItem("apikey", GC_RWGPS_API_KEY);
Expand Down
3 changes: 2 additions & 1 deletion src/Cloud/Xert.cpp
Expand Up @@ -100,7 +100,8 @@ Xert::open(QStringList &errors)
QNetworkRequest request(QUrl("https://www.xertonline.com/oauth/token"));
request.setRawHeader("Content-Type", "application/x-www-form-urlencoded");

QString authheader = QString("%1:%1").arg("xert_public");
QString authheader = QString("%1:%2").arg(GC_XERT_CLIENT_ID).arg(GC_XERT_CLIENT_SECRET);

request.setRawHeader("Authorization", "Basic " + authheader.toLatin1().toBase64());

// set params
Expand Down
5 changes: 5 additions & 0 deletions src/Core/Secrets.h
Expand Up @@ -122,3 +122,8 @@
#ifndef GC_NOLIO_SECRET
#define GC_NOLIO_SECRET "__GC_NOLIO_SECRET__"
#endif

// XERT
#ifndef GC_XERT_CLIENT_SECRET
#define GC_XERT_CLIENT_SECRET "__GC_XERT_CLIENT_SECRET__"
#endif
5 changes: 5 additions & 0 deletions src/Core/Settings.h
Expand Up @@ -64,6 +64,11 @@
#define GC_POLARFLOW_CLIENT_ID "Not defined"
#endif

// Xert
#ifndef GC_XERT_CLIENT_ID
#define GC_XERT_CLIENT_ID "xert_goldencheetah"
#endif

/*
* GoldenCheetah Properties are stored in different locations, depending on the prefix defined in the property name. The following different prefixes are supported
* <system>
Expand Down

0 comments on commit d3fb4f1

Please sign in to comment.