Simply check app.oauthProxy

Part of #6
This commit is contained in:
Girish Ramakrishnan
2016-09-07 00:31:25 -07:00
parent 452c976aa6
commit 5014ca7742
3 changed files with 4 additions and 16 deletions

View File

@@ -11,7 +11,6 @@ var assert = require('assert'),
shell = require('./shell.js');
exports = module.exports = {
requiresOAuthProxy: requiresOAuthProxy,
configureAdmin: configureAdmin,
configureApp: configureApp,
unconfigureApp: unconfigureApp,
@@ -21,18 +20,6 @@ exports = module.exports = {
var NGINX_APPCONFIG_EJS = fs.readFileSync(__dirname + '/../setup/start/nginx/appconfig.ejs', { encoding: 'utf8' }),
RELOAD_NGINX_CMD = path.join(__dirname, 'scripts/reloadnginx.sh');
function requiresOAuthProxy(app) {
assert.strictEqual(typeof app, 'object');
var tmp = app.accessRestriction;
// if no accessRestriction set, or the app uses one of the auth modules, we do not need the oauth proxy
if (tmp === null) return false;
if (app.manifest.addons['ldap'] || app.manifest.addons['oauth'] || app.manifest.addons['simpleauth']) return false;
return true;
}
function configureAdmin(certFilePath, keyFilePath, callback) {
assert.strictEqual(typeof certFilePath, 'string');
assert.strictEqual(typeof keyFilePath, 'string');
@@ -62,7 +49,7 @@ function configureApp(app, certFilePath, keyFilePath, callback) {
assert.strictEqual(typeof callback, 'function');
var sourceDir = path.resolve(__dirname, '..');
var oauthProxy = requiresOAuthProxy(app);
var oauthProxy = app.oauthProxy;
var endpoint = oauthProxy ? 'oauthproxy' : 'app';
var vhost = app.altDomain || config.appFqdn(app.location);