Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// @flow
const log = require('mwp-logger-plugin').logger;
const avro = require('avsc');
const uuidv1 = require('uuid/v1');
const AWS = require('aws-sdk');
const canUsePubSub =
process.env.GAE_INSTANCE || process.env.GOOGLE_APPLICATION_CREDENTIALS;
const sts = new AWS.STS();
/*
* There are currently 2 distinct analytics logging methods
* 1. `stdout`: used in dev and compatible with https://github.com/meetup/blt-fluentd
* in k8s-based applications in GCP
* 2. Google Pub/Sub, which is used in GAE and any environment with GOOGLE_APPLICATION_CREDENTIALS
* environment variable set to point toward Google JSON client credentials file
*
* @see https://meetup.atlassian.net/wiki/display/MUP/Analytics+Logging#AnalyticsLogging-Theinputmechanism