Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: firebase/firebase-functions
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.2.0
Choose a base ref
...
head repository: firebase/firebase-functions
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.3.0
Choose a head ref
  • 6 commits
  • 5 files changed
  • 3 contributors

Commits on Jul 24, 2019

  1. Copy the full SHA
    a4266b7 View commit details

Commits on Jul 25, 2019

  1. Update CODEOWNERS

    thechenky authored Jul 25, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e32e8cc View commit details

Commits on Aug 1, 2019

  1. Fix sed command that breaks on linux (#545)

    * fix sed command that breaks on linux
    
    * fixing rm error
    thechenky authored Aug 1, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    381c733 View commit details

Commits on Oct 7, 2019

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8057d11 View commit details
  2. Copy the full SHA
    a001a85 View commit details

Commits on Oct 10, 2019

  1. Copy the full SHA
    bf5f3b5 View commit details
Showing with 26 additions and 7 deletions.
  1. +1 −1 .github/CODEOWNERS
  2. +1 −2 changelog.txt
  3. +9 −3 integration_test/run_tests.sh
  4. +1 −1 package.json
  5. +14 −0 src/apps.ts
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @kevinajian @thechenky

3 changes: 1 addition & 2 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
feature - Adds support for Test Lab triggered functions with `functions.testLab`.
fixed - Upgrade lodash dependency to resolve security vulnerability CVE-2019-10744.
feature - Add a helper function for the Firebase Emulator suite.
12 changes: 9 additions & 3 deletions integration_test/run_tests.sh
Original file line number Diff line number Diff line change
@@ -41,13 +41,19 @@ function build_sdk {
function pick_node8 {
cd "${DIR}"
cp package.node8.json functions/package.json
sed -i '' "s/firebase-functions.tgz/firebase-functions-${TIMESTAMP}.tgz/g" functions/package.json
# we have to do the -e flag here so that it work both on linux and mac os, but that creates an extra
# backup file called package.json-e that we should clean up afterwards.
sed -i -e "s/firebase-functions.tgz/firebase-functions-${TIMESTAMP}.tgz/g" functions/package.json
rm -f functions/package.json-e
}

function pick_node10 {
cd "${DIR}"
cp package.node10.json functions/package.json
sed -i '' "s/firebase-functions.tgz/firebase-functions-${TIMESTAMP}.tgz/g" functions/package.json
# we have to do the -e flag here so that it work both on linux and mac os, but that creates an extra
# backup file called package.json-e that we should clean up afterwards.
sed -i -e "s/firebase-functions.tgz/firebase-functions-${TIMESTAMP}.tgz/g" functions/package.json
rm -f functions/package.json-e
}

function install_deps {
@@ -101,7 +107,7 @@ function run_tests {
function cleanup {
announce "Performing cleanup..."
delete_all_functions
rm "${DIR}/functions/firebase-functions-*.tgz"
rm "${DIR}/functions/firebase-functions-${TIMESTAMP}.tgz"
rm "${DIR}/functions/package.json"
rm -f "${DIR}/functions/firebase-debug.log"
rm -rf "${DIR}/functions/lib"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "firebase-functions",
"version": "3.2.0",
"version": "3.3.0",
"description": "Firebase SDK for Cloud Functions",
"keywords": [
"firebase",
14 changes: 14 additions & 0 deletions src/apps.ts
Original file line number Diff line number Diff line change
@@ -58,6 +58,7 @@ export namespace apps {

export class Apps {
private _refCounter: RefCounter;
private _emulatedAdminApp?: firebase.app.App;

constructor() {
this._refCounter = {};
@@ -105,12 +106,25 @@ export namespace apps {
}

get admin(): firebase.app.App {
if (this._emulatedAdminApp) {
return this._emulatedAdminApp;
}

if (this._appAlive('__admin__')) {
return firebase.app('__admin__');
}
return firebase.initializeApp(this.firebaseArgs, '__admin__');
}

/**
* This function allows the Firebase Emulator Suite to override the FirebaseApp instance
* used by the Firebase Functions SDK. Developers should never call this function for
* other purposes.
*/
setEmulatedAdminApp(app: firebase.app.App) {
this._emulatedAdminApp = app;
}

private get firebaseArgs() {
return _.assign({}, firebaseConfig(), {
credential: firebase.credential.applicationDefault(),