cloudcms-server 3.2.339 → 3.2.340

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -391,7 +391,9 @@ exports = module.exports = function()
391
391
 
392
392
  if (!profile || !info)
393
393
  {
394
- return handleFailure(null, res);
394
+ return handleFailure({
395
+ "message": "Authentication callback missing both profile and info"
396
+ }, res);
395
397
  }
396
398
 
397
399
  // store these onto request
@@ -16,6 +16,7 @@ exports = module.exports = function()
16
16
 
17
17
  var SENTINEL_NOT_FOUND_VALUE = "null";
18
18
  var BLACKLIST_TTL_SECONDS = 60 * 60 * 24 * 30; // 30 days
19
+ var DISABLED_TTL_SECONDS = 60 * 10; // 10 minutes
19
20
 
20
21
  var VIRTUAL_DRIVER_CACHE_KEY = "virtualdriver";
21
22
 
@@ -115,7 +116,8 @@ exports = module.exports = function()
115
116
  config.baseURL = configuration.virtualDriver.baseURL;
116
117
 
117
118
  // hand back
118
- callback(null, config);
119
+ var disabled = body.disabled ? true : false;
120
+ callback(null, config, disabled);
119
121
  }
120
122
  }
121
123
  else
@@ -183,7 +185,7 @@ exports = module.exports = function()
183
185
  }
184
186
 
185
187
  // load the gitana.json file from Cloud CMS
186
- loadConfigForVirtualHost(host, logMethod, function (err, virtualConfig) {
188
+ loadConfigForVirtualHost(host, logMethod, function (err, virtualConfig, disabled) {
187
189
 
188
190
  if (err)
189
191
  {
@@ -194,7 +196,7 @@ exports = module.exports = function()
194
196
 
195
197
  if (!virtualConfig)
196
198
  {
197
- // mark that it failed (30 minute TTL)
199
+ // mark that it failed (30 day blacklist TTL)
198
200
  return process.cache.write(VCSENTINEL_CACHE_KEY, true, BLACKLIST_TTL_SECONDS, function() {
199
201
  finishedLoading({
200
202
  "message": "No virtual config found for host: " + host
@@ -202,6 +204,16 @@ exports = module.exports = function()
202
204
  });
203
205
  }
204
206
 
207
+ if (disabled)
208
+ {
209
+ // mark that the virtual config is disabled (10 minutes TLL)
210
+ return process.cache.write(VCSENTINEL_CACHE_KEY, true, DISABLED_TTL_SECONDS, function() {
211
+ finishedLoading({
212
+ "message": "The virtual config was found for host: " + host + " but it has been marked as disabled"
213
+ });
214
+ });
215
+ }
216
+
205
217
  // populate gitana.json
206
218
  var gitanaJson = {
207
219
  "clientKey": virtualConfig.clientKey
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "name": "cloudcms-server",
8
8
  "description": "Cloud CMS Application Server Module",
9
- "version": "3.2.339",
9
+ "version": "3.2.340",
10
10
  "repository": {
11
11
  "type": "git",
12
12
  "url": "git://github.com/gitana/cloudcms-server.git"