Skip to content

Commit f65deae

Browse files
lahirumarambaegilmorezsuchcodemuchwowyuchenshiBorntraegerMarc
authored
chore: Merge main branch into modular-sdk (#1312)
* 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 <[email protected]> * 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] <[email protected]> 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] <[email protected]> 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] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Hiranya Jayathilaka <[email protected]> * 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] <[email protected]> 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] <[email protected]> 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] <[email protected]> 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] <[email protected]> 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] <[email protected]> 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] <[email protected]> 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] <[email protected]> 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] <[email protected]> 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 * Fix build issues * Add new auth type hierarchies from the main branch * Update import paths * Update package-lock * Export new auth types from the entry point Co-authored-by: egilmorez <[email protected]> Co-authored-by: batuxd <[email protected]> Co-authored-by: Yuchen Shi <[email protected]> Co-authored-by: Marc Bornträger <[email protected]> Co-authored-by: rsgowman <[email protected]> Co-authored-by: Hiranya Jayathilaka <[email protected]> Co-authored-by: Abe Haskins <[email protected]> Co-authored-by: Samuel Bushi <[email protected]> Co-authored-by: bojeil-google <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Nikhil Agarwal <[email protected]> Co-authored-by: Xin Li <[email protected]>
1 parent 5d91953 commit f65deae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+6346
-3394
lines changed

.github/dependabot.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/scripts/run_integration_tests.sh

+2
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,6 @@ gpg --quiet --batch --yes --decrypt --passphrase="${FIREBASE_SERVICE_ACCT_KEY}"
2222

2323
echo "${FIREBASE_API_KEY}" > test/resources/apikey.txt
2424

25+
echo "${FIREBASE_APP_ID}" > test/resources/appid.txt
26+
2527
npm run test:integration -- --updateRules --testMultiTenancy

.github/workflows/nightly.yml

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ jobs:
5555
env:
5656
FIREBASE_SERVICE_ACCT_KEY: ${{ secrets.FIREBASE_SERVICE_ACCT_KEY }}
5757
FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }}
58+
FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }}
5859

5960
- name: Package release artifacts
6061
run: |

.github/workflows/release.yml

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ jobs:
6666
env:
6767
FIREBASE_SERVICE_ACCT_KEY: ${{ secrets.FIREBASE_SERVICE_ACCT_KEY }}
6868
FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }}
69+
FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }}
6970

7071
- name: Package release artifacts
7172
run: |

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ node_modules/
1414
# Real key file should not be checked in
1515
test/resources/key.json
1616
test/resources/apikey.txt
17+
test/resources/appid.txt
1718

1819
# Release tarballs should not be checked in
1920
firebase-admin-*.tgz

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ information on using pull requests.
8787

8888
### Prerequisites
8989

90-
1. Node.js 10.10.0 or higher.
90+
1. Node.js 10.13.0 or higher.
9191
2. NPM 5 or higher (NPM 6 recommended).
9292
3. Google Cloud SDK ([`gcloud`](https://cloud.google.com/sdk/downloads) utility)
9393

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ requests, code review feedback, and also pull requests.
5555

5656
## Supported Environments
5757

58-
We support Node.js 10.10.0 and higher.
58+
We support Node.js 10.13.0 and higher.
5959

6060
Please also note that the Admin SDK should only
6161
be used in server-side/back-end environments controlled by the app developer.

etc/firebase-admin.api.md

+33
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export function app(name?: string): app.App;
1717
export namespace app {
1818
// Warning: (ae-forgotten-export) The symbol "App" needs to be exported by the entry point default-namespace.d.ts
1919
export interface App extends App {
20+
// (undocumented)
21+
appCheck(): appCheck.AppCheck;
2022
// (undocumented)
2123
auth(): auth.Auth;
2224
// (undocumented)
@@ -41,6 +43,37 @@ export namespace app {
4143
}
4244
}
4345

46+
// @public
47+
export function appCheck(app?: app.App): appCheck.AppCheck;
48+
49+
// @public (undocumented)
50+
export namespace appCheck {
51+
export interface AppCheck {
52+
// (undocumented)
53+
app: app.App;
54+
createToken(appId: string): Promise<AppCheckToken>;
55+
verifyToken(appCheckToken: string): Promise<VerifyAppCheckTokenResponse>;
56+
}
57+
export interface AppCheckToken {
58+
token: string;
59+
ttlMillis: number;
60+
}
61+
export interface DecodedAppCheckToken {
62+
// (undocumented)
63+
[key: string]: any;
64+
app_id: string;
65+
aud: string[];
66+
exp: number;
67+
iat: number;
68+
iss: string;
69+
sub: string;
70+
}
71+
export interface VerifyAppCheckTokenResponse {
72+
appId: string;
73+
token: appCheck.DecodedAppCheckToken;
74+
}
75+
}
76+
4477
// @public
4578
export interface AppOptions {
4679
// Warning: (ae-forgotten-export) The symbol "Credential" needs to be exported by the entry point default-namespace.d.ts

etc/firebase-admin.auth.api.md

+35-16
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,7 @@ export class Auth extends BaseAuth {
3232
export type AuthFactorType = 'phone';
3333

3434
// @public
35-
export interface AuthProviderConfig {
36-
displayName?: string;
37-
enabled: boolean;
38-
providerId: string;
39-
}
35+
export type AuthProviderConfig = SAMLAuthProviderConfig | OIDCAuthProviderConfig;
4036

4137
// @public
4238
export interface AuthProviderConfigFilter {
@@ -75,13 +71,31 @@ export abstract class BaseAuth {
7571
}
7672

7773
// @public
78-
export interface CreateMultiFactorInfoRequest {
74+
export interface BaseAuthProviderConfig {
75+
displayName?: string;
76+
enabled: boolean;
77+
providerId: string;
78+
}
79+
80+
// @public
81+
export interface BaseCreateMultiFactorInfoRequest {
7982
displayName?: string;
8083
factorId: string;
8184
}
8285

8386
// @public
84-
export interface CreatePhoneMultiFactorInfoRequest extends CreateMultiFactorInfoRequest {
87+
export interface BaseUpdateMultiFactorInfoRequest {
88+
displayName?: string;
89+
enrollmentTime?: string;
90+
factorId: string;
91+
uid?: string;
92+
}
93+
94+
// @public
95+
export type CreateMultiFactorInfoRequest = CreatePhoneMultiFactorInfoRequest;
96+
97+
// @public
98+
export interface CreatePhoneMultiFactorInfoRequest extends BaseCreateMultiFactorInfoRequest {
8599
phoneNumber: string;
86100
}
87101

@@ -205,17 +219,27 @@ export interface MultiFactorUpdateSettings {
205219
}
206220

207221
// @public
208-
export interface OIDCAuthProviderConfig extends AuthProviderConfig {
222+
export interface OAuthResponseType {
223+
code?: boolean;
224+
idToken?: boolean;
225+
}
226+
227+
// @public
228+
export interface OIDCAuthProviderConfig extends BaseAuthProviderConfig {
209229
clientId: string;
230+
clientSecret?: string;
210231
issuer: string;
232+
responseType?: OAuthResponseType;
211233
}
212234

213235
// @public
214236
export interface OIDCUpdateAuthProviderRequest {
215237
clientId?: string;
238+
clientSecret?: string;
216239
displayName?: string;
217240
enabled?: boolean;
218241
issuer?: string;
242+
responseType?: OAuthResponseType;
219243
}
220244

221245
// @public
@@ -239,7 +263,7 @@ export interface ProviderIdentifier {
239263
}
240264

241265
// @public
242-
export interface SAMLAuthProviderConfig extends AuthProviderConfig {
266+
export interface SAMLAuthProviderConfig extends BaseAuthProviderConfig {
243267
callbackURL?: string;
244268
idpEntityId: string;
245269
rpEntityId: string;
@@ -305,15 +329,10 @@ export interface UidIdentifier {
305329
export type UpdateAuthProviderRequest = SAMLUpdateAuthProviderRequest | OIDCUpdateAuthProviderRequest;
306330

307331
// @public
308-
export interface UpdateMultiFactorInfoRequest {
309-
displayName?: string;
310-
enrollmentTime?: string;
311-
factorId: string;
312-
uid?: string;
313-
}
332+
export type UpdateMultiFactorInfoRequest = UpdatePhoneMultiFactorInfoRequest;
314333

315334
// @public
316-
export interface UpdatePhoneMultiFactorInfoRequest extends UpdateMultiFactorInfoRequest {
335+
export interface UpdatePhoneMultiFactorInfoRequest extends BaseUpdateMultiFactorInfoRequest {
317336
phoneNumber: string;
318337
}
319338

0 commit comments

Comments
 (0)