Skip to content

Commit

Permalink
chore: Merging main branch into modular-sdk (#1443)
Browse files Browse the repository at this point in the history
* chore(core): Automate Daily Integration Tests (#1130)

* Automate daily integration tests

* Rename to nightly

* Change to 6am and 8pm PT & remove tar verification

* Fix schedule comment

* Updating Google Cloud naming (#1122)

* Reinstating tag that devsite needs present to supress machine translation.

* Updating a couple of references to GCP/Google Cloud Platform per new branding guidelines.

* update typo in interface name (#1138)

FireabseErrorInterface -> FirebaseErrorInterface

* Improve token verification logic with Auth Emulator. (#1148)

* Improve token verification logic with Auth Emulator.

* Clean up comments.

* Fix linting issues.

* Address review comments.

* Use mock for auth emulator unit test.

* Implement session cookies.

* Call useEmulator() only once.

* Update tests.

* Delete unused test helper.

* Add unit tests for checking revocation.

* Fix typo in test comments.

* feat: Exporting all types of Messages so they can be used by consumers (#1147)

* feat: Exporting all types of Messages so they can be used by consumers

Fixes #1146

* feat(exportMessageTypes): Testing TokenMessage

* feat(exportMessageTypes): Added tests for all Message types

* feat(exportMessageTypes): Fixed build

* feat(exportMessageTypes): Better unit tests

* feat(exportMessageTypes): Deleted unneeded separate TS test

* feat(exportMessageTypes): Fixed build

* feat(exportMessageTypes): Fixed linting

* feat(auth): Implement getUserByProviderId (#769)

RELEASE NOTE: Added a new getUserByProviderId() to lookup user accounts by their providers.

* Allow enabling of anonymous provider via tenant configuration (#802)

RELEASE NOTES: Allow enabling of anonymous provider via tenant configuration.

* feat(auth): Add ability to link a federated ID with the `updateUser()` method. (#770)

* (chore): Export UserProvider type and add it to toc.yaml (#1165)

- Export UserProvider type
- Add UserProvider to toc.yaml

* [chore] Release 9.5.0 (#1167)

Release 9.5.0

* chore: Updated doc generator for typedoc 0.19.0 (#1166)

* Update HOME.md (#1181)

Quick addition of a little bit of clarifying verbiage per an internal bug report.  Thanks!

* feat(rtdb): Support emulator mode for rules management operations (#1190)

* feat(rtdb): Support emulator mode for rules management operations

* fix: Adding namespace to emulated URL string

* fix: Consolidated unit testing

* fix: Removed extra whitespace

* fix: Decoupled proactive token refresh from FirebaseApp (#1194)

* fix: Decoupled proactive token refresh from FirebaseApp

* fix: Defined constants for duration values

* fix: Logging errors encountered while scheduling a refresh

* fix: Renamed some variables for clarity

* fix(rtdb): Fixing the RTDB token listener callback (#1203)

* Add emulator-based integration tests. (#1155)

* Add emulator-based integration tests.

* Move emulator stuff out of package.json.

* Update CONTRIBUTING.md too.

* Add npx.

* Skip new unsupported tests.

* Inline commands in ci.yml.

* Disable one flaky tests in emulator. (#1205)

* [chore] Release 9.6.0 (#1209)

* (chore): Add JWT Decoder and Signature Verifier (#1204)

* (chore): Add JWT Decoder

* Add signature verifier and key fetcher abstractions

* Add unit tests for utils/jwt

* chore: Add Mailgun send email action (#1210)

* Add Mailgun send email github action
* Add send email action in nightly workflow

* chore: Fix bug in send-email action code (#1214)

* chore: Fix bug in send-email action code

* Add run id and trigger on repo dispatch event

* Change dispatch event name in nightly workflow (#1216)

- Change dispatch event name to `firebase_nightly_build`

* chore: Clean up nightly workflow trigger tests (#1212)

- Remove failing integration test added to trigger the send email workflow in nightly builds.

* Add support for FIREBASE_STORAGE_EMULATOR_HOST env var (#1175)

* Add support for FIREBASE_STORAGE_EMULATOR_HOST env var

* Fixes lint error

* Add test for FIREBASE_STORAGE_EMULATOR_HOST support

* Lint fix

* Minor fixes to storage tests

* Address review comments

* Address review suggestion

Co-authored-by: Samuel Bushi <ssbushi@google.com>

* Revert "Disable one flaky tests in emulator. (#1205)" (#1227)

This reverts commit 19660d9.

* fix(rtdb): Fixing a token refresh livelock in Cloud Functions (#1234)

* [chore] Release 9.7.0 (#1240)

* fix: adds missing EMAIL_NOT_FOUND error code (#1246)

Catch `EMAIL_NOT_FOUND` and translate to `auth/email-not-found` when `/accounts:sendOobCode` is called for password reset on a user that does not exist.
Fixes #1202

* build(deps-dev): bump lodash from 4.17.19 to 4.17.21 (#1255)

Bumps [lodash](https://github.com/lodash/lodash) from 4.17.19 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.19...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: Upgraded RTDB and other @firebase dependencies (#1250)

* build(deps): bump y18n from 3.2.1 to 3.2.2 (#1208)

Bumps [y18n](https://github.com/yargs/y18n) from 3.2.1 to 3.2.2.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix storage emulator env formatting (#1257)

* Fix storage emulator env formatting

* Repair test

* Rename test

* Dang tests 2 good 4 me

* Fix test

* Fix tests again

* build(deps): bump hosted-git-info from 2.8.8 to 2.8.9 (#1260)

Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](npm/hosted-git-info@v2.8.8...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Hiranya Jayathilaka <hiranya911@gmail.com>

* feat: Add abuse reduction support (#1264)

- Add abuse reduction support APIs

* Fix @types/node conflict with grpc and port type (#1258)

Upgraded the @types/node dependency to v12.12.47

* [chore] Release 9.8.0 (#1266)

* build(deps): bump handlebars from 4.7.6 to 4.7.7 (#1253)

Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.7.6 to 4.7.7.
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/handlebars-lang/handlebars.js/blob/master/release-notes.md)
- [Commits](handlebars-lang/handlebars.js@v4.7.6...v4.7.7)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump jose from 2.0.4 to 2.0.5 (#1265)

Bumps [jose](https://github.com/panva/jose) from 2.0.4 to 2.0.5.
- [Release notes](https://github.com/panva/jose/releases)
- [Changelog](https://github.com/panva/jose/blob/v2.0.5/CHANGELOG.md)
- [Commits](panva/jose@v2.0.4...v2.0.5)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: Revert regression introduced in #1257 (#1277)

* fix(auth): make MFA uid optional for updateUser operations (#1278)

* fix(auth): make MFA uid optional for updateUser operations

MFA `uid` should be optional for `updateUser` operations.
When not specified, the backend will provision a `uid` for the
enrolled second factor.

Fixes #1276

* chore: Enabled dependabot (#1279)

* chore: Remove gulp-replace dependency (#1285)

* build(deps-dev): bump gulp-header from 1.8.12 to 2.0.9 (#1283)

Bumps [gulp-header](https://github.com/tracker1/gulp-header) from 1.8.12 to 2.0.9.
- [Release notes](https://github.com/tracker1/gulp-header/releases)
- [Changelog](https://github.com/gulp-community/gulp-header/blob/master/changelog.md)
- [Commits](gulp-community/gulp-header@v1.8.12...v2.0.9)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump run-sequence from 1.2.2 to 2.2.1 (#1282)

Bumps [run-sequence](https://github.com/OverZealous/run-sequence) from 1.2.2 to 2.2.1.
- [Release notes](https://github.com/OverZealous/run-sequence/releases)
- [Changelog](https://github.com/OverZealous/run-sequence/blob/master/CHANGELOG.md)
- [Commits](OverZealous/run-sequence@v1.2.2...v2.2.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump sinon from 9.0.2 to 9.2.4 (#1289)

Bumps [sinon](https://github.com/sinonjs/sinon) from 9.0.2 to 9.2.4.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](sinonjs/sinon@v9.0.2...v9.2.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump nyc from 14.1.1 to 15.1.0 (#1290)

Bumps [nyc](https://github.com/istanbuljs/nyc) from 14.1.1 to 15.1.0.
- [Release notes](https://github.com/istanbuljs/nyc/releases)
- [Changelog](https://github.com/istanbuljs/nyc/blob/master/CHANGELOG.md)
- [Commits](istanbuljs/nyc@v14.1.1...v15.1.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump chalk from 1.1.3 to 4.1.1 (#1288)

Bumps [chalk](https://github.com/chalk/chalk) from 1.1.3 to 4.1.1.
- [Release notes](https://github.com/chalk/chalk/releases)
- [Commits](chalk/chalk@v1.1.3...v4.1.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump @microsoft/api-extractor from 7.11.2 to 7.15.2 (#1291)

Bumps [@microsoft/api-extractor](https://github.com/microsoft/rushstack) from 7.11.2 to 7.15.2.
- [Release notes](https://github.com/microsoft/rushstack/releases)
- [Commits](https://github.com/microsoft/rushstack/compare/@microsoft/api-extractor_v7.11.2...@microsoft/api-extractor_v7.15.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: Teporarily disabling sendToDeviceGroup integration test (#1292)

* feat(auth): Added code flow support for OIDC flow. (#1220)

* OIDC codeflow support

* improve configs to simulate the real cases

* update for changes in signiture

* resolve comments

* improve validator logic

* remove unnecessary logic

* add tests and fix errors

* add auth-api-request rests

* Update supported Node version to 10.13.0v (#1300)

* Fixed integration test failure of skipped tests (#1299)

* Fix integration test failure of skipped testss

* Trigger integration tests

* [chore] Release 9.9.0 (#1302)

* Update OIDC reference docs (#1305)

* Add OAuthResponseType to ToC (#1303)

* fix(auth): Better type hierarchies for Auth API (#1294)

* fix(auth): Better type heirarchies for Auth API

* fix: Moved factorId back to the base types

* fix: Updated API report

* fix: Fixed a grammar error in comment

* fix: Update to comment text

* build(deps-dev): bump nock from 13.0.5 to 13.0.11 (#1311)

Bumps [nock](https://github.com/nock/nock) from 13.0.5 to 13.0.11.
- [Release notes](https://github.com/nock/nock/releases)
- [Changelog](https://github.com/nock/nock/blob/main/CHANGELOG.md)
- [Commits](nock/nock@v13.0.5...v13.0.11)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump ws from 7.3.1 to 7.4.6 (#1309)

Bumps [ws](https://github.com/websockets/ws) from 7.3.1 to 7.4.6.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](websockets/ws@7.3.1...7.4.6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump del from 2.2.2 to 6.0.0 (#1310)

Bumps [del](https://github.com/sindresorhus/del) from 2.2.2 to 6.0.0.
- [Release notes](https://github.com/sindresorhus/del/releases)
- [Commits](sindresorhus/del@v2.2.2...v6.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump @types/jsonwebtoken from 8.5.0 to 8.5.1 (#1315)

Bumps [@types/jsonwebtoken](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jsonwebtoken) from 8.5.0 to 8.5.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jsonwebtoken)

---
updated-dependencies:
- dependency-name: "@types/jsonwebtoken"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump nock from 13.0.11 to 13.1.0 (#1313)

Bumps [nock](https://github.com/nock/nock) from 13.0.11 to 13.1.0.
- [Release notes](https://github.com/nock/nock/releases)
- [Changelog](https://github.com/nock/nock/blob/main/CHANGELOG.md)
- [Commits](nock/nock@v13.0.11...v13.1.0)

---
updated-dependencies:
- dependency-name: nock
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump @types/sinon-chai from 3.2.4 to 3.2.5 (#1316)

Bumps [@types/sinon-chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/sinon-chai) from 3.2.4 to 3.2.5.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/sinon-chai)

---
updated-dependencies:
- dependency-name: "@types/sinon-chai"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump bcrypt from 5.0.0 to 5.0.1 (#1324)

Bumps [bcrypt](https://github.com/kelektiv/node.bcrypt.js) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/kelektiv/node.bcrypt.js/releases)
- [Changelog](https://github.com/kelektiv/node.bcrypt.js/blob/master/CHANGELOG.md)
- [Commits](kelektiv/node.bcrypt.js@v5.0.0...v5.0.1)

---
updated-dependencies:
- dependency-name: bcrypt
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump @google-cloud/firestore from 4.5.0 to 4.12.2 (#1325)

Bumps [@google-cloud/firestore](https://github.com/googleapis/nodejs-firestore) from 4.5.0 to 4.12.2.
- [Release notes](https://github.com/googleapis/nodejs-firestore/releases)
- [Changelog](https://github.com/googleapis/nodejs-firestore/blob/master/CHANGELOG.md)
- [Commits](googleapis/nodejs-firestore@v4.5.0...v4.12.2)

---
updated-dependencies:
- dependency-name: "@google-cloud/firestore"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump @types/mocha from 2.2.48 to 8.2.2 (#1323)

Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 2.2.48 to 8.2.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

---
updated-dependencies:
- dependency-name: "@types/mocha"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump @firebase/app from 0.6.21 to 0.6.26 (#1329)

Bumps [@firebase/app](https://github.com/firebase/firebase-js-sdk/tree/HEAD/packages/app) from 0.6.21 to 0.6.26.
- [Release notes](https://github.com/firebase/firebase-js-sdk/releases)
- [Changelog](https://github.com/firebase/firebase-js-sdk/blob/@firebase/app@0.6.26/packages/app/CHANGELOG.md)
- [Commits](https://github.com/firebase/firebase-js-sdk/commits/@firebase/app@0.6.26/packages/app)

---
updated-dependencies:
- dependency-name: "@firebase/app"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump @firebase/database from 0.10.0 to 0.10.4 (#1328)

Bumps [@firebase/database](https://github.com/firebase/firebase-js-sdk/tree/HEAD/packages/database) from 0.10.0 to 0.10.4.
- [Release notes](https://github.com/firebase/firebase-js-sdk/releases)
- [Changelog](https://github.com/firebase/firebase-js-sdk/blob/master/packages/database/CHANGELOG.md)
- [Commits](https://github.com/firebase/firebase-js-sdk/commits/@firebase/database@0.10.4/packages/database)

---
updated-dependencies:
- dependency-name: "@firebase/database"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump request-promise from 4.2.5 to 4.2.6 (#1331)

Bumps [request-promise](https://github.com/request/request-promise) from 4.2.5 to 4.2.6.
- [Release notes](https://github.com/request/request-promise/releases)
- [Commits](request/request-promise@v4.2.5...v4.2.6)

---
updated-dependencies:
- dependency-name: request-promise
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump gulp-filter from 6.0.0 to 7.0.0 (#1334)

Bumps [gulp-filter](https://github.com/sindresorhus/gulp-filter) from 6.0.0 to 7.0.0.
- [Release notes](https://github.com/sindresorhus/gulp-filter/releases)
- [Commits](sindresorhus/gulp-filter@v6.0.0...v7.0.0)

---
updated-dependencies:
- dependency-name: gulp-filter
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump @types/minimist from 1.2.0 to 1.2.1 (#1336)

Bumps [@types/minimist](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/minimist) from 1.2.0 to 1.2.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/minimist)

---
updated-dependencies:
- dependency-name: "@types/minimist"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(docs): replace all global.html -> admin.html (#1341)

Co-authored-by: Hiranya Jayathilaka <hiranya911@gmail.com>

* feat(fis): Adding the admin.installations() API for deleting Firebase installation IDs (#1187)

* feat(fis): Added admin.installations() API

* fix: Marked IID APIs deprecated

* fix: Deprecated App.instanceId() method; Added more unit and integration tests

* fix: Throwing FirebaseInstallationsError from constructor

* fix: Some docs updates

* fix: Minor update to API doc comment

* fix: Added Installations class to API ref toc

* fix: Minor doc updates

* fix: Updated TOC for new Auth type aliases (#1342)

* [chore] Release 9.10.0 (#1345)

* build(deps-dev): bump @types/request-promise from 4.1.46 to 4.1.47 (#1338)

Bumps [@types/request-promise](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/request-promise) from 4.1.46 to 4.1.47.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/request-promise)

---
updated-dependencies:
- dependency-name: "@types/request-promise"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump @firebase/database from 0.10.4 to 0.10.5 (#1350)

Bumps [@firebase/database](https://github.com/firebase/firebase-js-sdk/tree/HEAD/packages/database) from 0.10.4 to 0.10.5.
- [Release notes](https://github.com/firebase/firebase-js-sdk/releases)
- [Changelog](https://github.com/firebase/firebase-js-sdk/blob/master/packages/database/CHANGELOG.md)
- [Commits](https://github.com/firebase/firebase-js-sdk/commits/@firebase/database@0.10.5/packages/database)

---
updated-dependencies:
- dependency-name: "@firebase/database"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump @types/nock from 9.3.1 to 11.1.0 (#1351)

Bumps [@types/nock](https://github.com/nock/nock) from 9.3.1 to 11.1.0.
- [Release notes](https://github.com/nock/nock/releases)
- [Changelog](https://github.com/nock/nock/blob/main/CHANGELOG.md)
- [Commits](nock/nock@v9.3.1...v11.1.0)

---
updated-dependencies:
- dependency-name: "@types/nock"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump @types/sinon from 9.0.4 to 10.0.2 (#1326)

Bumps [@types/sinon](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/sinon) from 9.0.4 to 10.0.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/sinon)

---
updated-dependencies:
- dependency-name: "@types/sinon"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump @firebase/database from 0.10.5 to 0.10.6 (#1356)

Bumps [@firebase/database](https://github.com/firebase/firebase-js-sdk/tree/HEAD/packages/database) from 0.10.5 to 0.10.6.
- [Release notes](https://github.com/firebase/firebase-js-sdk/releases)
- [Changelog](https://github.com/firebase/firebase-js-sdk/blob/master/packages/database/CHANGELOG.md)
- [Commits](https://github.com/firebase/firebase-js-sdk/commits/@firebase/database@0.10.6/packages/database)

---
updated-dependencies:
- dependency-name: "@firebase/database"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump jwks-rsa from 2.0.2 to 2.0.3 (#1361)

Bumps [jwks-rsa](https://github.com/auth0/node-jwks-rsa) from 2.0.2 to 2.0.3.
- [Release notes](https://github.com/auth0/node-jwks-rsa/releases)
- [Changelog](https://github.com/auth0/node-jwks-rsa/blob/master/CHANGELOG.md)
- [Commits](auth0/node-jwks-rsa@v2.0.2...v2.0.3)

---
updated-dependencies:
- dependency-name: jwks-rsa
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump yargs from 16.1.0 to 17.0.1 (#1357)

Bumps [yargs](https://github.com/yargs/yargs) from 16.1.0 to 17.0.1.
- [Release notes](https://github.com/yargs/yargs/releases)
- [Changelog](https://github.com/yargs/yargs/blob/master/CHANGELOG.md)
- [Commits](yargs/yargs@v16.1.0...v17.0.1)

---
updated-dependencies:
- dependency-name: yargs
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump @types/chai from 4.2.11 to 4.2.21 (#1365)

Bumps [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai) from 4.2.11 to 4.2.21.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai)

---
updated-dependencies:
- dependency-name: "@types/chai"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update index.ts (#1367)

Fix typo in comments: `sendMulticase` -> `sendMulticast`

* build(deps): bump @google-cloud/firestore from 4.12.2 to 4.13.1 (#1369)

Bumps [@google-cloud/firestore](https://github.com/googleapis/nodejs-firestore) from 4.12.2 to 4.13.1.
- [Release notes](https://github.com/googleapis/nodejs-firestore/releases)
- [Changelog](https://github.com/googleapis/nodejs-firestore/blob/master/CHANGELOG.md)
- [Commits](googleapis/nodejs-firestore@v4.12.2...v4.13.1)

---
updated-dependencies:
- dependency-name: "@google-cloud/firestore"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat(fac): Add custom TTL options for App Check (#1363)

* Add custom ttl options for App Check

* PR fixes

* Add integration tests

* PR fixes

* Reduce App Check custom token exp to 5 mins (#1372)

* Add AppCheckTokenOptions type to ToC (#1375)

Add `AppCheckTokenOptions` to `ToC`

* Fix typo and formatting in docs (#1378)

- Fix typo and add back-ticks

* [chore] Release 9.11.0 (#1376)

- Release 9.11.0

* build(deps-dev): bump nock from 13.1.0 to 13.1.1 (#1370)

Bumps [nock](https://github.com/nock/nock) from 13.1.0 to 13.1.1.
- [Release notes](https://github.com/nock/nock/releases)
- [Changelog](https://github.com/nock/nock/blob/main/CHANGELOG.md)
- [Commits](nock/nock@v13.1.0...v13.1.1)

---
updated-dependencies:
- dependency-name: nock
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump @types/bcrypt from 2.0.0 to 5.0.0 (#1384)

Bumps [@types/bcrypt](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/bcrypt) from 2.0.0 to 5.0.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/bcrypt)

---
updated-dependencies:
- dependency-name: "@types/bcrypt"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump @firebase/database from 0.10.6 to 0.10.7 (#1385)

Bumps [@firebase/database](https://github.com/firebase/firebase-js-sdk/tree/HEAD/packages/database) from 0.10.6 to 0.10.7.
- [Release notes](https://github.com/firebase/firebase-js-sdk/releases)
- [Changelog](https://github.com/firebase/firebase-js-sdk/blob/master/packages/database/CHANGELOG.md)
- [Commits](https://github.com/firebase/firebase-js-sdk/commits/@firebase/database@0.10.7/packages/database)

---
updated-dependencies:
- dependency-name: "@firebase/database"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump @types/lodash from 4.14.157 to 4.14.171 (#1386)

Bumps [@types/lodash](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/lodash) from 4.14.157 to 4.14.171.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/lodash)

---
updated-dependencies:
- dependency-name: "@types/lodash"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump @types/request from 2.48.5 to 2.48.6 (#1387)

Bumps [@types/request](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/request) from 2.48.5 to 2.48.6.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/request)

---
updated-dependencies:
- dependency-name: "@types/request"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump @types/minimist from 1.2.1 to 1.2.2 (#1388)

Bumps [@types/minimist](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/minimist) from 1.2.1 to 1.2.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/minimist)

---
updated-dependencies:
- dependency-name: "@types/minimist"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump jwks-rsa from 2.0.3 to 2.0.4 (#1393)

Bumps [jwks-rsa](https://github.com/auth0/node-jwks-rsa) from 2.0.3 to 2.0.4.
- [Release notes](https://github.com/auth0/node-jwks-rsa/releases)
- [Changelog](https://github.com/auth0/node-jwks-rsa/blob/master/CHANGELOG.md)
- [Commits](auth0/node-jwks-rsa@v2.0.3...2.0.4)

---
updated-dependencies:
- dependency-name: jwks-rsa
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump @microsoft/api-extractor from 7.15.2 to 7.18.4 (#1379)

* build(deps-dev): bump @microsoft/api-extractor from 7.15.2 to 7.18.4

Bumps [@microsoft/api-extractor](https://github.com/microsoft/rushstack) from 7.15.2 to 7.18.4.
- [Release notes](https://github.com/microsoft/rushstack/releases)
- [Commits](https://github.com/microsoft/rushstack/compare/@microsoft/api-extractor_v7.15.2...@microsoft/api-extractor_v7.18.4)

---
updated-dependencies:
- dependency-name: "@microsoft/api-extractor"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: Updated API report with the new API Extractor version

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Hiranya Jayathilaka <hiranya911@gmail.com>

* build(deps): bump tar from 6.1.0 to 6.1.3 (#1399)

Bumps [tar](https://github.com/npm/node-tar) from 6.1.0 to 6.1.3.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](isaacs/node-tar@v6.1.0...v6.1.3)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump ts-node from 9.0.0 to 10.2.0 (#1402)

Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 9.0.0 to 10.2.0.
- [Release notes](https://github.com/TypeStrong/ts-node/releases)
- [Commits](TypeStrong/ts-node@v9.0.0...v10.2.0)

---
updated-dependencies:
- dependency-name: ts-node
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: Add emulator tests to nightlies (#1409)

* Add emulator tests to nightlies

- Run emulator based integration tests as part of the nightly tests.

* Trigger CI

* fix: Throw error on user disabled and check revoked set true (#1401)

* fix: Throw error on user disabled and check revoked set true

* resolve 2 calls on getUser(), improve tests and lints

* remove currentUser.reload

* add return

* Tweak tests

* small fix

* Use async and await instead of chain in integration test and change CI dependency

* retry

* Add special case of authEmulator

* fix emulator on issue

* remove firebase-tool version changes

* useMockIdToken for unit test

* fix typos

* build(deps-dev): bump yargs from 17.0.1 to 17.1.1 (#1412)

Bumps [yargs](https://github.com/yargs/yargs) from 17.0.1 to 17.1.1.
- [Release notes](https://github.com/yargs/yargs/releases)
- [Changelog](https://github.com/yargs/yargs/blob/master/CHANGELOG.md)
- [Commits](yargs/yargs@v17.0.1...v17.1.1)

---
updated-dependencies:
- dependency-name: yargs
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump path-parse from 1.0.6 to 1.0.7 (#1413)

Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: Update comments in index files (#1414)

* add comments in index files

* change signature in firebase-admin-node

* small fixes

* small fixes

* fixes

* [chore] Release 9.11.1 (#1415)

* fix typo (#1420)

* build(deps-dev): bump @microsoft/api-extractor from 7.18.4 to 7.18.7 (#1423)

Bumps [@microsoft/api-extractor](https://github.com/microsoft/rushstack) from 7.18.4 to 7.18.7.
- [Release notes](https://github.com/microsoft/rushstack/releases)
- [Commits](https://github.com/microsoft/rushstack/compare/@microsoft/api-extractor_v7.18.4...@microsoft/api-extractor_v7.18.7)

---
updated-dependencies:
- dependency-name: "@microsoft/api-extractor"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat(rc): Add Remote Config Parameter Value Type Support (#1424)

go/admin-sdk-rc-parameter-value-types

Add RC Parameter Value Type.
Update unit tests.
- Integration tests will be added following the REST API launch.
Added release:stage to trigger existing integration tests (to test backward compatibility).
- Do not merge until the BE is updated.
Update:
- Integration tests are updated.

RELEASE NOTE: Added Remote Config Parameter Value Type Support.

* build(deps-dev): bump @types/lodash from 4.14.171 to 4.14.173 (#1435)

Bumps [@types/lodash](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/lodash) from 4.14.171 to 4.14.173.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/lodash)

---
updated-dependencies:
- dependency-name: "@types/lodash"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump tar from 6.1.3 to 6.1.11 (#1430)

Bumps [tar](https://github.com/npm/node-tar) from 6.1.3 to 6.1.11.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](isaacs/node-tar@v6.1.3...v6.1.11)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Pin @types/jsonwebtoken to 8.5.1 (#1438)

* fix(rtdb): Changed admin.database to use database-compat package (#1437)

* fix: Changed admin.database to use database-compat package

* fix: Upgraded to latest staged versions of compat packages

* fix: Added dom for test compilation which includes Auth types

* fix: Using single quotes as per our convention

* fix: Using the new database-compat/standalone entrypoint

* fix: Changed versions to released tags

* fix(fac): Verify Token: Change the jwks cache duration from 1 day to 6 hours (#1439)

Change the jwks cache duration (used by the verify token API) from 1 day to 6 hours.

* [chore] Release 9.12.0 (#1442)

* fix: Merged missing commits from #1401

* fix: Updated integration tests

* fix: Temporary with for RTDB type incompatibility issue

* fix: Cleaned up faulty API doc annotations

Co-authored-by: Lahiru Maramba <llahiru@gmail.com>
Co-authored-by: egilmorez <egilmore@google.com>
Co-authored-by: batuxd <9674241+suchcodemuchwow@users.noreply.github.com>
Co-authored-by: Yuchen Shi <yuchenshi@google.com>
Co-authored-by: Marc Bornträger <marc.borntraeger@gmail.com>
Co-authored-by: rsgowman <rgowman@google.com>
Co-authored-by: Abe Haskins <abeisgreat@abeisgreat.com>
Co-authored-by: Samuel Bushi <ssbushi@google.com>
Co-authored-by: bojeil-google <bojeil-google@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nikhil Agarwal <54072321+nikhilag@users.noreply.github.com>
Co-authored-by: Xin Li <xinxinxin@google.com>
Co-authored-by: NothingEverHappens <kirjs@google.com>
Co-authored-by: Daniel Hritzkiv <daniel.hritzkiv@gmail.com>
Co-authored-by: Arthur Gubaidullin <lapteuh@gmail.com>
  • Loading branch information
16 people committed Sep 30, 2021
1 parent 744caca commit ccd4aca
Show file tree
Hide file tree
Showing 37 changed files with 2,074 additions and 1,833 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
subject: 'Nightly build ${{github.run_id}} of ${{github.repository}} failed!'
html: >
<b>Nightly workflow ${{github.run_id}} failed on: ${{github.repository}}</b>
<br /><br />Navigate to the
<br /><br />Navigate to the
<a href="https://github.com/firebase/firebase-admin-node/actions/runs/${{github.run_id}}">failed workflow</a>.
continue-on-error: true

Expand All @@ -97,6 +97,6 @@ jobs:
subject: 'Nightly build ${{github.run_id}} of ${{github.repository}} cancelled!'
html: >
<b>Nightly workflow ${{github.run_id}} cancelled on: ${{github.repository}}</b>
<br /><br />Navigate to the
<br /><br />Navigate to the
<a href="https://github.com/firebase/firebase-admin-node/actions/runs/${{github.run_id}}">cancelled workflow</a>.
continue-on-error: true
2 changes: 2 additions & 0 deletions etc/firebase-admin.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,8 @@ export namespace remoteConfig {
export type ListVersionsOptions = ListVersionsOptions;
// Warning: (ae-forgotten-export) The symbol "ListVersionsResult" needs to be exported by the entry point default-namespace.d.ts
export type ListVersionsResult = ListVersionsResult;
// Warning: (ae-forgotten-export) The symbol "ParameterValueType" needs to be exported by the entry point default-namespace.d.ts
export type ParameterValueType = ParameterValueType;
// Warning: (ae-forgotten-export) The symbol "RemoteConfig" needs to be exported by the entry point default-namespace.d.ts
export type RemoteConfig = RemoteConfig;
// Warning: (ae-forgotten-export) The symbol "RemoteConfigCondition" needs to be exported by the entry point default-namespace.d.ts
Expand Down
1 change: 0 additions & 1 deletion etc/firebase-admin.installations.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export function getInstallations(app?: App): Installations;

// @public
export class Installations {
constructor(app: App);
get app(): App;
deleteInstallation(fid: string): Promise<void>;
}
Expand Down
4 changes: 4 additions & 0 deletions etc/firebase-admin.remote-config.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ export interface ListVersionsResult {
versions: Version[];
}

// @public
export type ParameterValueType = 'STRING' | 'BOOLEAN' | 'NUMBER' | 'JSON';

// @public
export class RemoteConfig {
// (undocumented)
Expand Down Expand Up @@ -67,6 +70,7 @@ export interface RemoteConfigParameter {
};
defaultValue?: RemoteConfigParameterValue;
description?: string;
valueType?: ParameterValueType;
}

// @public
Expand Down
4 changes: 3 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ var paths = {
// emitted.
var buildProject = ts.createProject('tsconfig.json', { rootDir: 'src', declarationMap: true });

var buildTest = ts.createProject('tsconfig.json');
// Include dom libraries during test compilation since we use some web SDK
// libraries in our tests.
var buildTest = ts.createProject('tsconfig.json', { lib: ['es2018', 'dom'] });

var banner = `/*! firebase-admin v${pkg.version} */\n`;

Expand Down
3,391 changes: 1,637 additions & 1,754 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
}
},
"dependencies": {
"@firebase/database": "^0.10.0",
"@firebase/database-compat": "^0.1.1",
"@firebase/database-types": "^0.7.2",
"@types/node": ">=12.12.47",
"dicer": "^0.3.0",
Expand All @@ -173,15 +173,15 @@
},
"devDependencies": {
"@firebase/api-documenter": "^0.1.2",
"@firebase/app": "^0.6.21",
"@firebase/auth": "^0.16.5",
"@firebase/app-compat": "^0.1.2",
"@firebase/auth-compat": "^0.1.3",
"@firebase/auth-types": "^0.10.3",
"@microsoft/api-extractor": "^7.11.2",
"@types/bcrypt": "^5.0.0",
"@types/chai": "^4.0.0",
"@types/chai-as-promised": "^7.1.0",
"@types/firebase-token-generator": "^2.0.28",
"@types/jsonwebtoken": "^8.5.0",
"@types/jsonwebtoken": "8.5.1",
"@types/lodash": "^4.14.104",
"@types/minimist": "^1.2.0",
"@types/mocha": "^8.2.2",
Expand Down
4 changes: 2 additions & 2 deletions src/app-check/token-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class AppCheckTokenGenerator {
*
* @param appId The Application ID to use for the generated token.
*
* @return A Promise fulfilled with a custom token signed with a service account key
* @returns A Promise fulfilled with a custom token signed with a service account key
* that can be exchanged to an App Check token.
*/
public createCustomToken(appId: string, options?: AppCheckTokenOptions): Promise<string> {
Expand Down Expand Up @@ -141,7 +141,7 @@ export class AppCheckTokenGenerator {
* details from a CryptoSignerError.
*
* @param err The Error to convert into a FirebaseAppCheckError error
* @return A Firebase App Check error that can be returned to the user.
* @returns A Firebase App Check error that can be returned to the user.
*/
export function appCheckErrorFromCryptoSignerError(err: Error): Error {
if (!(err instanceof CryptoSignerError)) {
Expand Down
2 changes: 1 addition & 1 deletion src/app-check/token-verifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class AppCheckTokenVerifier {
* Verifies the format and signature of a Firebase App Check token.
*
* @param token The Firebase Auth JWT token to verify.
* @return A promise fulfilled with the decoded claims of the Firebase App Check token.
* @returns A promise fulfilled with the decoded claims of the Firebase App Check token.
*/
public verifyToken(token: string): Promise<DecodedAppCheckToken> {
if (!validator.isString(token)) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/firebase-namespace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class FirebaseNamespace {
};

// eslint-disable-next-line @typescript-eslint/no-var-requires
return Object.assign(fn, require('@firebase/database'));
return Object.assign(fn, require('@firebase/database-compat/standalone'));
}

/**
Expand Down
2 changes: 0 additions & 2 deletions src/auth/auth-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1369,7 +1369,6 @@ export class OIDCConfig implements OIDCAuthProviderConfig {
'"OIDCAuthProviderConfig.responseType.idToken" must be a boolean.',
);
}

const code = options.responseType.code;
if (typeof code !== 'undefined') {
if (!validator.isBoolean(code)) {
Expand All @@ -1378,7 +1377,6 @@ export class OIDCConfig implements OIDCAuthProviderConfig {
'"OIDCAuthProviderConfig.responseType.code" must be a boolean.',
);
}

// If code flow is enabled, client secret must be provided.
if (code && typeof options.clientSecret === 'undefined') {
throw new FirebaseAuthError(
Expand Down
60 changes: 42 additions & 18 deletions src/auth/base-auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { deepCopy } from '../utils/deep-copy';
import * as validator from '../utils/validator';

import { AbstractAuthRequestHandler, useEmulator } from './auth-api-request';
import { FirebaseTokenGenerator, EmulatedSigner } from './token-generator';
import { FirebaseTokenGenerator, EmulatedSigner, handleCryptoSignerError } from './token-generator';
import {
FirebaseTokenVerifier, createSessionCookieVerifier, createIdTokenVerifier,
DecodedIdToken,
Expand All @@ -37,7 +37,6 @@ import {
import { UserImportOptions, UserImportRecord, UserImportResult } from './user-import-builder';
import { ActionCodeSettings } from './action-code-settings-builder';
import { cryptoSignerFromApp } from '../utils/crypto-signer';
import { FirebaseApp } from '../app/firebase-app';

/** Represents the result of the {@link BaseAuth.getUsers} API. */
export interface GetUsersResult {
Expand Down Expand Up @@ -109,6 +108,19 @@ export interface SessionCookieOptions {
expiresIn: number;
}

/**
* @internal
*/
export function createFirebaseTokenGenerator(app: App,
tenantId?: string): FirebaseTokenGenerator {
try {
const signer = useEmulator() ? new EmulatedSigner() : cryptoSignerFromApp(app);
return new FirebaseTokenGenerator(signer, tenantId);
} catch (err) {
throw handleCryptoSignerError(err);
}
}

/**
* Common parent interface for both `Auth` and `TenantAwareAuth` APIs.
*/
Expand All @@ -134,13 +146,12 @@ export abstract class BaseAuth {
*/
constructor(
app: App,
/** @internal */protected readonly authRequestHandler: AbstractAuthRequestHandler,
/** @internal */ protected readonly authRequestHandler: AbstractAuthRequestHandler,
tokenGenerator?: FirebaseTokenGenerator) {
if (tokenGenerator) {
this.tokenGenerator = tokenGenerator;
} else {
const cryptoSigner = useEmulator() ? new EmulatedSigner() : cryptoSignerFromApp(app as FirebaseApp);
this.tokenGenerator = new FirebaseTokenGenerator(cryptoSigner);
this.tokenGenerator = createFirebaseTokenGenerator(app);
}

this.sessionCookieVerifier = createSessionCookieVerifier(app);
Expand Down Expand Up @@ -171,8 +182,12 @@ export abstract class BaseAuth {
* Verifies a Firebase ID token (JWT). If the token is valid, the promise is
* fulfilled with the token's decoded claims; otherwise, the promise is
* rejected.
* An optional flag can be passed to additionally check whether the ID token
* was revoked.
*
* If `checkRevoked` is set to true, first verifies whether the corresponding
* user is disabled. If yes, an `auth/user-disabled` error is thrown. If no,
* verifies if the session corresponding to the ID token was revoked. If the
* corresponding user's session was invalidated, an `auth/id-token-revoked`
* error is thrown. If not specified the check is not applied.
*
* See {@link https://firebase.google.com/docs/auth/admin/verify-id-tokens | Verify ID Tokens}
* for code samples and detailed documentation.
Expand All @@ -193,7 +208,7 @@ export abstract class BaseAuth {
.then((decodedIdToken: DecodedIdToken) => {
// Whether to check if the token was revoked.
if (checkRevoked || isEmulator) {
return this.verifyDecodedJWTNotRevoked(
return this.verifyDecodedJWTNotRevokedOrDisabled(
decodedIdToken,
AuthClientErrorCode.ID_TOKEN_REVOKED);
}
Expand Down Expand Up @@ -669,11 +684,14 @@ export abstract class BaseAuth {

/**
* Verifies a Firebase session cookie. Returns a Promise with the cookie claims.
* Rejects the promise if the cookie could not be verified. If `checkRevoked` is
* set to true, verifies if the session corresponding to the session cookie was
* revoked. If the corresponding user's session was revoked, an
* `auth/session-cookie-revoked` error is thrown. If not specified the check is
* not performed.
* Rejects the promise if the cookie could not be verified.
*
* If `checkRevoked` is set to true, first verifies whether the corresponding
* user is disabled: If yes, an `auth/user-disabled` error is thrown. If no,
* verifies if the session corresponding to the session cookie was revoked.
* If the corresponding user's session was invalidated, an
* `auth/session-cookie-revoked` error is thrown. If not specified the check
* is not performed.
*
* See {@link https://firebase.google.com/docs/auth/admin/manage-cookies#verify_session_cookie_and_check_permissions |
* Verify Session Cookies}
Expand All @@ -696,7 +714,7 @@ export abstract class BaseAuth {
.then((decodedIdToken: DecodedIdToken) => {
// Whether to check if the token was revoked.
if (checkRevoked || isEmulator) {
return this.verifyDecodedJWTNotRevoked(
return this.verifyDecodedJWTNotRevokedOrDisabled(
decodedIdToken,
AuthClientErrorCode.SESSION_COOKIE_REVOKED);
}
Expand Down Expand Up @@ -1038,19 +1056,25 @@ export abstract class BaseAuth {
}

/**
* Verifies the decoded Firebase issued JWT is not revoked. Returns a promise that resolves
* with the decoded claims on success. Rejects the promise with revocation error if revoked.
* Verifies the decoded Firebase issued JWT is not revoked or disabled. Returns a promise that
* resolves with the decoded claims on success. Rejects the promise with revocation error if revoked
* or user disabled.
*
* @param decodedIdToken The JWT's decoded claims.
* @param revocationErrorInfo The revocation error info to throw on revocation
* detection.
* @returns A Promise that will be fulfilled after a successful verification.
* @returns A promise that will be fulfilled after a successful verification.
*/
private verifyDecodedJWTNotRevoked(
private verifyDecodedJWTNotRevokedOrDisabled(
decodedIdToken: DecodedIdToken, revocationErrorInfo: ErrorInfo): Promise<DecodedIdToken> {
// Get tokens valid after time for the corresponding user.
return this.getUser(decodedIdToken.sub)
.then((user: UserRecord) => {
if (user.disabled) {
throw new FirebaseAuthError(
AuthClientErrorCode.USER_DISABLED,
'The user record is disabled.');
}
// If no tokens valid after time available, token is not revoked.
if (user.tokensValidAfterTime) {
// Get the ID token authentication time and convert to milliseconds UTC.
Expand Down
12 changes: 4 additions & 8 deletions src/auth/tenant-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,12 @@ import { App } from '../app';
import * as utils from '../utils/index';
import { AuthClientErrorCode, FirebaseAuthError } from '../utils/error';

import { BaseAuth, SessionCookieOptions } from './base-auth';
import { BaseAuth, createFirebaseTokenGenerator, SessionCookieOptions } from './base-auth';
import { Tenant, TenantServerResponse, CreateTenantRequest, UpdateTenantRequest } from './tenant';
import { FirebaseTokenGenerator, EmulatedSigner } from './token-generator';
import {
AuthRequestHandler, TenantAwareAuthRequestHandler, useEmulator,
AuthRequestHandler, TenantAwareAuthRequestHandler,
} from './auth-api-request';
import { DecodedIdToken } from './token-verifier';
import { FirebaseApp } from '../app/firebase-app';
import { cryptoSignerFromApp } from '../utils/crypto-signer';

/**
* Interface representing the object returned from a
Expand Down Expand Up @@ -83,9 +80,8 @@ export class TenantAwareAuth extends BaseAuth {
* @internal
*/
constructor(app: App, tenantId: string) {
const cryptoSigner = useEmulator() ? new EmulatedSigner() : cryptoSignerFromApp(app as FirebaseApp);
const tokenGenerator = new FirebaseTokenGenerator(cryptoSigner, tenantId);
super(app, new TenantAwareAuthRequestHandler(app, tenantId), tokenGenerator);
super(app, new TenantAwareAuthRequestHandler(
app, tenantId), createFirebaseTokenGenerator(app, tenantId));
utils.addReadonlyGetter(this, 'tenantId', tenantId);
}

Expand Down
6 changes: 4 additions & 2 deletions src/auth/token-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ export class EmulatedSigner implements CryptoSigner {

/**
* Class for generating different types of Firebase Auth tokens (JWTs).
*
* @internal
*/
export class FirebaseTokenGenerator {

Expand Down Expand Up @@ -202,8 +204,8 @@ export class FirebaseTokenGenerator {
* Creates a new FirebaseAuthError by extracting the error code, message and other relevant
* details from a CryptoSignerError.
*
* @param {Error} err The Error to convert into a FirebaseAuthError error
* @return {FirebaseAuthError} A Firebase Auth error that can be returned to the user.
* @param err The Error to convert into a FirebaseAuthError error
* @returns A Firebase Auth error that can be returned to the user.
*/
export function handleCryptoSignerError(err: Error): Error {
if (!(err instanceof CryptoSignerError)) {
Expand Down
1 change: 0 additions & 1 deletion src/auth/token-verifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ export class FirebaseTokenVerifier {
fullDecodedToken: DecodedToken,
projectId: string | null,
isEmulator: boolean): void {

const header = fullDecodedToken && fullDecodedToken.header;
const payload = fullDecodedToken && fullDecodedToken.payload;

Expand Down
7 changes: 4 additions & 3 deletions src/database/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
import { URL } from 'url';
import * as path from 'path';

import { Database as DatabaseImpl } from '@firebase/database';
import { FirebaseDatabase } from '@firebase/database-types';
import { FirebaseDatabaseError, AppErrorCodes, FirebaseAppError } from '../utils/error';
import { Database as DatabaseImpl } from '@firebase/database-compat/standalone';

import { App } from '../app';
import { FirebaseApp } from '../app/firebase-app';
import { FirebaseDatabaseError, AppErrorCodes, FirebaseAppError } from '../utils/error';
import * as validator from '../utils/validator';
import { AuthorizedHttpClient, HttpRequestConfig, HttpError } from '../utils/api-request';
import { getSdkVersion } from '../utils/index';
Expand Down Expand Up @@ -124,7 +124,8 @@ export class DatabaseService {

let db: Database = this.databases[dbUrl];
if (typeof db === 'undefined') {
const rtdb = require('@firebase/database'); // eslint-disable-line @typescript-eslint/no-var-requires
// eslint-disable-next-line @typescript-eslint/no-var-requires
const rtdb = require('@firebase/database-compat/standalone');
db = rtdb.initStandalone(this.appInternal, dbUrl, getSdkVersion()).instance;

const rulesClient = new DatabaseRulesClient(this.app, dbUrl);
Expand Down
6 changes: 4 additions & 2 deletions src/database/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import * as rtdb from '@firebase/database-types';
import {
enableLogging as enableLoggingFunc,
ServerValue as serverValueConst,
} from '@firebase/database';
} from '@firebase/database-compat/standalone';

import { App, getApp } from '../app';
import { FirebaseApp } from '../app/firebase-app';
Expand All @@ -40,11 +40,13 @@ export {
ThenableReference,
} from '@firebase/database-types';

// TODO: Remove the following any-cast once the typins in @firebase/database-types are fixed.

/**
* {@link https://firebase.google.com/docs/reference/js/firebase.database#enablelogging | enableLogging}
* function from the `@firebase/database` package.
*/
export const enableLogging: typeof rtdb.enableLogging = enableLoggingFunc;
export const enableLogging: typeof rtdb.enableLogging = enableLoggingFunc as any;

/**
* {@link https://firebase.google.com/docs/reference/js/firebase.database.ServerValue | ServerValue}
Expand Down
2 changes: 1 addition & 1 deletion src/installations/installations-namespace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import { Installations as TInstallations } from './installations';
* return. If not provided, the default `Installations` service is
* returned.
*
* @return The default `Installations` service if
* @returns The default `Installations` service if
* no app is provided or the `Installations` service associated with the
* provided app.
*/
Expand Down

0 comments on commit ccd4aca

Please sign in to comment.