add sso route parameter to app install

presumably, we don't allow this to be changed post installation
This commit is contained in:
Girish Ramakrishnan
2016-11-11 10:55:44 +05:30
parent 6064db9467
commit 9c0f2175f7
2 changed files with 7 additions and 2 deletions

View File

@@ -477,7 +477,8 @@ function install(data, auditSource, callback) {
memoryLimit = data.memoryLimit || 0,
altDomain = data.altDomain || null,
xFrameOptions = data.xFrameOptions || 'SAMEORIGIN',
oauthProxy = data.oauthProxy === true;
oauthProxy = data.oauthProxy === true,
sso = 'sso' in data ? data.sso : null;
assert(data.appStoreId || data.manifest); // atleast one of them is required
@@ -505,6 +506,8 @@ function install(data, auditSource, callback) {
error = validateXFrameOptions(xFrameOptions);
if (error) return callback(error);
if ('sso' in data && !('optionalAuth' in manifest)) return callback(new AppsError(AppsError.BAD_FIELD, 'sso can only be specified for apps with optionalAuth'));
if (altDomain !== null && !validator.isFQDN(altDomain)) return callback(new AppsError(AppsError.BAD_FIELD, 'Invalid alt domain'));
// singleUser mode requires accessRestriction to contain exactly one user
@@ -534,7 +537,8 @@ function install(data, auditSource, callback) {
memoryLimit: memoryLimit,
altDomain: altDomain,
xFrameOptions: xFrameOptions,
oauthProxy: oauthProxy
oauthProxy: oauthProxy,
sso: sso
};
var from = (location ? location : manifest.title.toLowerCase().replace(/[^a-zA-Z0-9]/g, '')) + '.app';