From 85c3e45cdea8e4d719c5a661008a7c114853e28d Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Sun, 29 Mar 2020 09:23:45 -0700 Subject: [PATCH] remove oauth addon code --- src/addons.js | 37 ------------------------------------- src/test/apptask-test.js | 21 --------------------- 2 files changed, 58 deletions(-) diff --git a/src/addons.js b/src/addons.js index bc5ff6c47..50e4429f4 100644 --- a/src/addons.js +++ b/src/addons.js @@ -22,10 +22,6 @@ exports = module.exports = { getServiceDetails: getServiceDetails, - // exported for testing - _setupOauth: setupOauth, - _teardownOauth: teardownOauth, - SERVICE_STATUS_STARTING: 'starting', // container up, waiting for healthcheck SERVICE_STATUS_ACTIVE: 'active', SERVICE_STATUS_STOPPED: 'stopped' @@ -109,13 +105,6 @@ var KNOWN_ADDONS = { restore: restoreMySql, clear: clearMySql, }, - oauth: { - setup: setupOauth, - teardown: teardownOauth, - backup: NOOP, - restore: setupOauth, - clear: NOOP, - }, postgresql: { setup: setupPostgreSql, teardown: teardownPostgreSql, @@ -783,32 +772,6 @@ function teardownLocalStorage(app, options, callback) { ], callback); } -function setupOauth(app, options, callback) { - assert.strictEqual(typeof app, 'object'); - assert.strictEqual(typeof options, 'object'); - assert.strictEqual(typeof callback, 'function'); - - debugApp(app, 'setupOauth'); - - if (!app.sso) return callback(null); - - const env = []; - - debugApp(app, 'Setting oauth addon config to %j', env); - - appdb.setAddonConfig(app.id, 'oauth', env, callback); -} - -function teardownOauth(app, options, callback) { - assert.strictEqual(typeof app, 'object'); - assert.strictEqual(typeof options, 'object'); - assert.strictEqual(typeof callback, 'function'); - - debugApp(app, 'teardownOauth'); - - appdb.unsetAddonConfig(app.id, 'oauth', callback); -} - function setupEmail(app, options, callback) { assert.strictEqual(typeof app, 'object'); assert.strictEqual(typeof options, 'object'); diff --git a/src/test/apptask-test.js b/src/test/apptask-test.js index 6196544ba..574bdc1e2 100644 --- a/src/test/apptask-test.js +++ b/src/test/apptask-test.js @@ -184,27 +184,6 @@ describe('apptask', function () { }); }); - it('allocate OAuth credentials', function (done) { - addons._setupOauth(APP, {}, function (error) { - expect(error).to.be(null); - done(); - }); - }); - - it('remove OAuth credentials', function (done) { - addons._teardownOauth(APP, {}, function (error) { - expect(error).to.be(null); - done(); - }); - }); - - it('remove OAuth credentials twice succeeds', function (done) { - addons._teardownOauth(APP, {}, function (error) { - expect(!error).to.be.ok(); - done(); - }); - }); - it('barfs on empty manifest', function (done) { var badApp = _.extend({ }, APP); badApp.manifest = { };