Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Refactor Platform.environment call in MetadataServerAuthorizationFlow for Node.js usage #68

Open
CosmicPangolin opened this issue Mar 24, 2020 · 0 comments

Comments

@CosmicPangolin
Copy link

One meaningful use-case platform is Node.js (eg. calling google arbitrary Google APIs using Firebase Functions interop library). It would be nice to be able to call clientFromMetadataServer in these Cloud Functions, which seems precluded only by the following line in MetadataServerAuthorizationFlow:

final metadataHost = Platform.environment[_GCE_METADATA_HOST_ENV_VAR] ??
        _DEFAULT_METADATA_HOST;

Is it possible to protect the Platform.environment call so that this function doesn't error on Node?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant