Closed stephenplusplus closed 7 years ago
Inspired by https://github.com/GoogleCloudPlatform/google-cloud-node/pull/1808
This adds new helper methods to detect the environment an app is running in. Ideally, this will live in google-auth-library someday. At that time, these new methods can still exist, and will simply swap out where the legwork is taking place.
var auth = require('google-auto-auth')() auth.getEnvironment(function(err, env) { env = { IS_APP_ENGINE: Boolean, IS_CLOUD_FUNCTION: Boolean, IS_COMPUTE_ENGINE: Boolean } }) auth.isAppEngine(function(err, isAppEngine) { isAppEngine = Boolean }) auth.isCloudFunction(function(err, isCloudFunction) { isCloudFunction = Boolean }) auth.isComputeEngine(function(err, isComputeEngine) { isComputeEngine = Boolean })
@jmdobry PTAL
Inspired by https://github.com/GoogleCloudPlatform/google-cloud-node/pull/1808
This adds new helper methods to detect the environment an app is running in. Ideally, this will live in google-auth-library someday. At that time, these new methods can still exist, and will simply swap out where the legwork is taking place.