From 79fead55160d1a8b4f0726ca72b3eda7a3e9290a Mon Sep 17 00:00:00 2001 From: kirrg001 Date: Tue, 19 Sep 2017 11:47:59 +0200 Subject: [PATCH] Removed private configuration endpoint refs https://github.com/TryGhost/Ghost/issues/8859 - We don't need the config option for Unsplash anymore - The private endpoint (/configuration/private) was introduced for Unsplash --- core/server/api/configuration.js | 13 ------------- .../integration/api/api_configuration_spec.js | 17 ----------------- 2 files changed, 30 deletions(-) diff --git a/core/server/api/configuration.js b/core/server/api/configuration.js index c491b6ebcd..282ae5b239 100644 --- a/core/server/api/configuration.js +++ b/core/server/api/configuration.js @@ -14,14 +14,6 @@ function fetchAvailableTimezones() { return timezones; } -function fetchPrivateConfig() { - var unsplashConfig = config.get('unsplash') || {}; - - return { - unsplashAPI: unsplashConfig - }; -} - function getAboutConfig() { return { version: ghostVersion.full, @@ -81,11 +73,6 @@ configuration = { return Promise.resolve({configuration: [fetchAvailableTimezones()]}); } - // Private configuration config for API keys used by the client - if (options.key === 'private') { - return Promise.resolve({configuration: [fetchPrivateConfig()]}); - } - return Promise.resolve({configuration: []}); } }; diff --git a/core/test/integration/api/api_configuration_spec.js b/core/test/integration/api/api_configuration_spec.js index e298b432e7..f7495f638e 100644 --- a/core/test/integration/api/api_configuration_spec.js +++ b/core/test/integration/api/api_configuration_spec.js @@ -71,21 +71,4 @@ describe('Configuration API', function () { done(); }).catch(done); }); - - it('can read private config and get all expected properties', function (done) { - ConfigurationAPI.read({key: 'private'}).then(function (response) { - var props; - - should.exist(response); - should.exist(response.configuration); - response.configuration.should.be.an.Array().with.lengthOf(1); - props = response.configuration[0]; - - // property is set, but value not available, because settings API was not called yet - props.should.have.property('unsplashAPI').which.is.an.Object(); - props.unsplashAPI.should.be.empty(); - - done(); - }).catch(done); - }); });