Send and receive oauthProxy in REST routes

Part of #6
This commit is contained in:
Girish Ramakrishnan
2016-09-06 21:56:36 -07:00
parent e915e6fd44
commit 408dd61408
4 changed files with 15 additions and 5 deletions

View File

@@ -95,6 +95,8 @@ function postProcess(result) {
// TODO remove later once all apps have this attribute
result.xFrameOptions = result.xFrameOptions || 'SAMEORIGIN';
result.oauthProxy = !!result.oauthProxy; // make it bool
}
function get(id, callback) {
@@ -181,11 +183,12 @@ function add(id, appStoreId, manifest, location, portBindings, data, callback) {
var xFrameOptions = data.xFrameOptions || '';
var installationState = data.installationState || exports.ISTATE_PENDING_INSTALL;
var lastBackupId = data.lastBackupId || null; // used when cloning
var oauthProxy = data.oauthProxy || false;
var queries = [ ];
queries.push({
query: 'INSERT INTO apps (id, appStoreId, manifestJson, installationState, location, accessRestrictionJson, memoryLimit, altDomain, xFrameOptions, lastBackupId) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)',
args: [ id, appStoreId, manifestJson, installationState, location, accessRestrictionJson, memoryLimit, altDomain, xFrameOptions, lastBackupId ]
query: 'INSERT INTO apps (id, appStoreId, manifestJson, installationState, location, accessRestrictionJson, memoryLimit, altDomain, xFrameOptions, lastBackupId, oauthProxy) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)',
args: [ id, appStoreId, manifestJson, installationState, location, accessRestrictionJson, memoryLimit, altDomain, xFrameOptions, lastBackupId, oauthProxy ]
});
Object.keys(portBindings).forEach(function (env) {