fh-mbaas-express
Advanced tools
Comparing version 5.9.1 to 5.9.2
@@ -166,9 +166,9 @@ var request = require('request'); | ||
}, function(err, res) { | ||
// Can set API_KEY_VALIDATION_TIMEOUT to expire more frequently than a day | ||
var expiration = parseInt(process.env.API_KEY_AUTH_PROJ_VALIDATION_TIMEOUT, 10) || 300000; // A day | ||
var cacheLength = now + expiration; // A day | ||
// Can set API_KEY_VALIDATION_TIMEOUT to expire more frequently than 5 minutes | ||
var expiration = parseInt(process.env.API_KEY_AUTH_PROJ_VALIDATION_TIMEOUT, 10) || 300000; // 5 minutes | ||
var cacheLength = now + expiration; // 5 minutes | ||
// Explicitly handle 404s from Millicore here - the validate_key_against_authoried_projects endpoint may not exist in this cluster | ||
// If we get a 404, continue | ||
if (res.statusCode === 404) { | ||
if (res && res.statusCode === 404) { | ||
authenticateAppApiKeyAuthProjCache[sentApiKey] = { | ||
@@ -194,5 +194,7 @@ "timeout": cacheLength | ||
} else { | ||
var errorMsg = (res.body && res.body.message) || "Invalid API Key"; | ||
console.log("Issue validating app api key. Status Code: " + res.statusCode + ". Error Message: " + errorMsg); | ||
return cb({ | ||
code: UNAUTHORISED_HTTP_CODE, | ||
message: "Invalid API Key" | ||
message: errorMsg | ||
}); | ||
@@ -199,0 +201,0 @@ } |
{ | ||
"name": "fh-mbaas-express", | ||
"version": "5.9.1", | ||
"version": "5.9.2", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "async": { |
{ | ||
"name": "fh-mbaas-express", | ||
"version": "5.9.1", | ||
"version": "5.9.2", | ||
"description": "FeedHenry MBAAS Express", | ||
@@ -5,0 +5,0 @@ "main": "lib/webapp.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1584964
4781