firebase-admin 13.9.0 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -2
- package/lib/app/core.d.ts +2 -38
- package/lib/app/core.js +1 -1
- package/lib/app/credential-factory.d.ts +1 -1
- package/lib/app/credential-factory.js +1 -1
- package/lib/app/credential-internal.d.ts +1 -1
- package/lib/app/credential-internal.js +48 -17
- package/lib/app/credential.d.ts +1 -1
- package/lib/app/credential.js +1 -1
- package/lib/app/error.d.ts +47 -0
- package/lib/app/error.js +57 -0
- package/lib/app/firebase-app.d.ts +1 -1
- package/lib/app/firebase-app.js +28 -12
- package/lib/app/index.d.ts +4 -3
- package/lib/app/index.js +6 -4
- package/lib/app/lifecycle.d.ts +2 -2
- package/lib/app/lifecycle.js +46 -21
- package/lib/app-check/app-check-api-client-internal.d.ts +2 -16
- package/lib/app-check/app-check-api-client-internal.js +71 -47
- package/lib/app-check/app-check-api.d.ts +19 -1
- package/lib/app-check/app-check-api.js +1 -1
- package/lib/app-check/app-check.d.ts +1 -1
- package/lib/app-check/app-check.js +7 -3
- package/lib/app-check/error.d.ts +47 -0
- package/lib/app-check/error.js +65 -0
- package/lib/app-check/index.d.ts +2 -1
- package/lib/app-check/index.js +5 -2
- package/lib/app-check/token-generator.d.ts +1 -1
- package/lib/app-check/token-generator.js +43 -13
- package/lib/app-check/token-verifier.d.ts +1 -1
- package/lib/app-check/token-verifier.js +39 -11
- package/lib/auth/action-code-settings-builder.d.ts +1 -1
- package/lib/auth/action-code-settings-builder.js +16 -16
- package/lib/auth/auth-api-request.d.ts +6 -4
- package/lib/auth/auth-api-request.js +277 -166
- package/lib/auth/auth-config.d.ts +31 -2
- package/lib/auth/auth-config.js +103 -103
- package/lib/auth/auth.d.ts +1 -1
- package/lib/auth/auth.js +1 -1
- package/lib/auth/base-auth.d.ts +2 -1
- package/lib/auth/base-auth.js +29 -27
- package/lib/auth/error.d.ts +137 -0
- package/lib/auth/error.js +690 -0
- package/lib/auth/identifier.d.ts +1 -1
- package/lib/auth/identifier.js +1 -1
- package/lib/auth/index.d.ts +2 -2
- package/lib/auth/index.js +4 -4
- package/lib/auth/project-config-manager.d.ts +1 -1
- package/lib/auth/project-config-manager.js +1 -1
- package/lib/auth/project-config.d.ts +1 -1
- package/lib/auth/project-config.js +4 -4
- package/lib/auth/tenant-manager.d.ts +2 -1
- package/lib/auth/tenant-manager.js +13 -10
- package/lib/auth/tenant.d.ts +1 -1
- package/lib/auth/tenant.js +7 -7
- package/lib/auth/token-generator.d.ts +1 -1
- package/lib/auth/token-generator.js +13 -13
- package/lib/auth/token-verifier.d.ts +1 -1
- package/lib/auth/token-verifier.js +22 -22
- package/lib/auth/user-import-builder.d.ts +1 -1
- package/lib/auth/user-import-builder.js +22 -22
- package/lib/auth/user-record.d.ts +1 -1
- package/lib/auth/user-record.js +6 -6
- package/lib/credential/index.d.ts +1 -1
- package/lib/credential/index.js +1 -1
- package/lib/data-connect/data-connect-api-client-internal.d.ts +1 -16
- package/lib/data-connect/data-connect-api-client-internal.js +122 -65
- package/lib/data-connect/data-connect-api.d.ts +1 -1
- package/lib/data-connect/data-connect-api.js +1 -1
- package/lib/data-connect/data-connect.d.ts +1 -1
- package/lib/data-connect/data-connect.js +1 -1
- package/lib/data-connect/error.d.ts +47 -0
- package/lib/data-connect/error.js +66 -0
- package/lib/data-connect/index.d.ts +2 -1
- package/lib/data-connect/index.js +5 -2
- package/lib/data-connect/validate-admin-args.d.ts +1 -1
- package/lib/data-connect/validate-admin-args.js +6 -3
- package/lib/database/database.d.ts +1 -1
- package/lib/database/database.js +11 -6
- package/lib/database/error.d.ts +39 -0
- package/lib/database/error.js +49 -0
- package/lib/database/index.d.ts +2 -2
- package/lib/database/index.js +4 -3
- package/lib/esm/app/index.js +2 -1
- package/lib/esm/app-check/index.js +2 -0
- package/lib/esm/auth/index.js +1 -1
- package/lib/esm/data-connect/index.js +2 -0
- package/lib/esm/database/index.js +1 -0
- package/lib/esm/eventarc/index.js +2 -0
- package/lib/esm/extensions/index.js +2 -0
- package/lib/esm/firebase-admin/index.js +13 -0
- package/lib/esm/firestore/index.js +1 -0
- package/lib/esm/functions/index.js +2 -0
- package/lib/esm/installations/index.js +1 -1
- package/lib/esm/machine-learning/index.js +2 -0
- package/lib/esm/messaging/index.js +1 -1
- package/lib/esm/phone-number-verification/index.js +2 -0
- package/lib/esm/project-management/index.js +1 -0
- package/lib/esm/remote-config/index.js +2 -0
- package/lib/esm/security-rules/index.js +2 -0
- package/lib/esm/storage/index.js +2 -0
- package/lib/eventarc/cloudevent.d.ts +1 -1
- package/lib/eventarc/cloudevent.js +1 -1
- package/lib/eventarc/error.d.ts +38 -0
- package/lib/eventarc/error.js +47 -0
- package/lib/eventarc/eventarc-client-internal.d.ts +1 -1
- package/lib/eventarc/eventarc-client-internal.js +24 -9
- package/lib/eventarc/eventarc-utils.d.ts +1 -13
- package/lib/eventarc/eventarc-utils.js +36 -26
- package/lib/eventarc/eventarc.d.ts +1 -1
- package/lib/eventarc/eventarc.js +18 -6
- package/lib/eventarc/index.d.ts +2 -1
- package/lib/eventarc/index.js +5 -2
- package/lib/extensions/error.d.ts +41 -0
- package/lib/extensions/error.js +50 -0
- package/lib/extensions/extensions-api-client-internal.d.ts +1 -13
- package/lib/extensions/extensions-api-client-internal.js +40 -28
- package/lib/extensions/extensions-api.d.ts +1 -1
- package/lib/extensions/extensions-api.js +1 -1
- package/lib/extensions/extensions.d.ts +1 -1
- package/lib/extensions/extensions.js +18 -5
- package/lib/extensions/index.d.ts +2 -1
- package/lib/extensions/index.js +5 -2
- package/lib/firestore/error.d.ts +41 -0
- package/lib/firestore/error.js +51 -0
- package/lib/firestore/firestore-internal.d.ts +2 -1
- package/lib/firestore/firestore-internal.js +6 -6
- package/lib/firestore/index.d.ts +2 -2
- package/lib/firestore/index.js +7 -7
- package/lib/functions/error.d.ts +48 -0
- package/lib/functions/error.js +67 -0
- package/lib/functions/functions-api-client-internal.d.ts +1 -16
- package/lib/functions/functions-api-client-internal.js +111 -71
- package/lib/functions/functions-api.d.ts +1 -1
- package/lib/functions/functions-api.js +1 -1
- package/lib/functions/functions.d.ts +1 -1
- package/lib/functions/functions.js +14 -4
- package/lib/functions/index.d.ts +2 -1
- package/lib/functions/index.js +5 -2
- package/lib/index.d.ts +13 -8
- package/lib/index.js +19 -3
- package/lib/installations/error.d.ts +48 -0
- package/lib/installations/error.js +73 -0
- package/lib/installations/index.d.ts +2 -2
- package/lib/installations/index.js +4 -4
- package/lib/installations/installations-request-handler.d.ts +1 -1
- package/lib/installations/installations-request-handler.js +11 -5
- package/lib/installations/installations.d.ts +1 -1
- package/lib/installations/installations.js +3 -3
- package/lib/machine-learning/error.d.ts +53 -0
- package/lib/machine-learning/error.js +84 -0
- package/lib/machine-learning/index.d.ts +2 -1
- package/lib/machine-learning/index.js +5 -2
- package/lib/machine-learning/machine-learning-api-client.d.ts +1 -1
- package/lib/machine-learning/machine-learning-api-client.js +61 -24
- package/lib/machine-learning/machine-learning.d.ts +1 -1
- package/lib/machine-learning/machine-learning.js +21 -9
- package/lib/messaging/error.d.ts +63 -0
- package/lib/messaging/error.js +286 -0
- package/lib/messaging/index.d.ts +3 -3
- package/lib/messaging/index.js +4 -4
- package/lib/messaging/messaging-api-request-internal.d.ts +1 -1
- package/lib/messaging/messaging-api-request-internal.js +1 -1
- package/lib/messaging/messaging-api.d.ts +1 -280
- package/lib/messaging/messaging-api.js +1 -1
- package/lib/messaging/messaging-errors-internal.d.ts +2 -2
- package/lib/messaging/messaging-errors-internal.js +11 -8
- package/lib/messaging/messaging-internal.d.ts +1 -1
- package/lib/messaging/messaging-internal.js +48 -48
- package/lib/messaging/messaging.d.ts +1 -1
- package/lib/messaging/messaging.js +47 -50
- package/lib/phone-number-verification/error.d.ts +43 -0
- package/lib/phone-number-verification/error.js +48 -0
- package/lib/phone-number-verification/index.d.ts +2 -1
- package/lib/phone-number-verification/index.js +5 -2
- package/lib/phone-number-verification/phone-number-verification-api-client-internal.d.ts +1 -18
- package/lib/phone-number-verification/phone-number-verification-api-client-internal.js +2 -26
- package/lib/phone-number-verification/phone-number-verification-api.d.ts +2 -2
- package/lib/phone-number-verification/phone-number-verification-api.js +5 -4
- package/lib/phone-number-verification/phone-number-verification.d.ts +1 -1
- package/lib/phone-number-verification/phone-number-verification.js +1 -1
- package/lib/phone-number-verification/token-verifier.d.ts +1 -1
- package/lib/phone-number-verification/token-verifier.js +68 -20
- package/lib/project-management/android-app.d.ts +1 -1
- package/lib/project-management/android-app.js +15 -6
- package/lib/project-management/app-metadata.d.ts +1 -1
- package/lib/project-management/app-metadata.js +1 -1
- package/lib/project-management/error.d.ts +45 -0
- package/lib/project-management/error.js +55 -0
- package/lib/project-management/index.d.ts +2 -2
- package/lib/project-management/index.js +4 -3
- package/lib/project-management/ios-app.d.ts +1 -1
- package/lib/project-management/ios-app.js +6 -3
- package/lib/project-management/project-management-api-request-internal.d.ts +1 -1
- package/lib/project-management/project-management-api-request-internal.js +18 -6
- package/lib/project-management/project-management.d.ts +1 -1
- package/lib/project-management/project-management.js +13 -7
- package/lib/remote-config/condition-evaluator-internal.d.ts +1 -1
- package/lib/remote-config/condition-evaluator-internal.js +4 -4
- package/lib/remote-config/error.d.ts +49 -0
- package/lib/remote-config/error.js +70 -0
- package/lib/remote-config/index.d.ts +2 -1
- package/lib/remote-config/index.js +5 -2
- package/lib/remote-config/internal/value-impl.d.ts +1 -1
- package/lib/remote-config/internal/value-impl.js +1 -1
- package/lib/remote-config/remote-config-api-client-internal.d.ts +2 -13
- package/lib/remote-config/remote-config-api-client-internal.js +80 -52
- package/lib/remote-config/remote-config-api.d.ts +1 -1
- package/lib/remote-config/remote-config-api.js +1 -1
- package/lib/remote-config/remote-config.d.ts +1 -1
- package/lib/remote-config/remote-config.js +92 -23
- package/lib/security-rules/error.d.ts +45 -0
- package/lib/security-rules/error.js +54 -0
- package/lib/security-rules/index.d.ts +2 -1
- package/lib/security-rules/index.js +5 -2
- package/lib/security-rules/security-rules-api-client-internal.d.ts +1 -1
- package/lib/security-rules/security-rules-api-client-internal.js +50 -18
- package/lib/security-rules/security-rules.d.ts +1 -1
- package/lib/security-rules/security-rules.js +32 -11
- package/lib/storage/error.d.ts +41 -0
- package/lib/storage/error.js +50 -0
- package/lib/storage/index.d.ts +2 -1
- package/lib/storage/index.js +8 -5
- package/lib/storage/storage.d.ts +1 -1
- package/lib/storage/storage.js +12 -12
- package/lib/storage/utils.d.ts +1 -1
- package/lib/storage/utils.js +1 -1
- package/lib/utils/api-request.d.ts +12 -12
- package/lib/utils/api-request.js +97 -55
- package/lib/utils/crypto-signer.d.ts +1 -1
- package/lib/utils/crypto-signer.js +2 -7
- package/lib/utils/deep-copy.d.ts +1 -1
- package/lib/utils/deep-copy.js +1 -1
- package/lib/utils/error.d.ts +75 -570
- package/lib/utils/error.js +53 -1047
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +2 -2
- package/lib/utils/jwt.d.ts +1 -1
- package/lib/utils/jwt.js +1 -2
- package/lib/utils/validator.d.ts +1 -1
- package/lib/utils/validator.js +1 -1
- package/package.json +25 -33
- package/lib/app/firebase-namespace.d.ts +0 -163
- package/lib/app/firebase-namespace.js +0 -335
- package/lib/app-check/app-check-namespace.d.ts +0 -72
- package/lib/app-check/app-check-namespace.js +0 -18
- package/lib/auth/auth-namespace.d.ts +0 -257
- package/lib/auth/auth-namespace.js +0 -18
- package/lib/database/database-namespace.d.ts +0 -95
- package/lib/database/database-namespace.js +0 -23
- package/lib/default-namespace.d.ts +0 -24
- package/lib/default-namespace.js +0 -30
- package/lib/esm/instance-id/index.js +0 -6
- package/lib/firebase-namespace-api.d.ts +0 -91
- package/lib/firebase-namespace-api.js +0 -58
- package/lib/firestore/firestore-namespace.d.ts +0 -71
- package/lib/firestore/firestore-namespace.js +0 -52
- package/lib/installations/installations-namespace.d.ts +0 -55
- package/lib/installations/installations-namespace.js +0 -18
- package/lib/instance-id/index.d.ts +0 -62
- package/lib/instance-id/index.js +0 -74
- package/lib/instance-id/instance-id-namespace.d.ts +0 -38
- package/lib/instance-id/instance-id-namespace.js +0 -3
- package/lib/instance-id/instance-id.d.ts +0 -47
- package/lib/instance-id/instance-id.js +0 -77
- package/lib/machine-learning/machine-learning-namespace.d.ts +0 -81
- package/lib/machine-learning/machine-learning-namespace.js +0 -18
- package/lib/machine-learning/machine-learning-utils.d.ts +0 -22
- package/lib/machine-learning/machine-learning-utils.js +0 -47
- package/lib/messaging/messaging-namespace.d.ts +0 -161
- package/lib/messaging/messaging-namespace.js +0 -18
- package/lib/project-management/project-management-namespace.d.ts +0 -82
- package/lib/project-management/project-management-namespace.js +0 -18
- package/lib/remote-config/remote-config-namespace.d.ts +0 -141
- package/lib/remote-config/remote-config-namespace.js +0 -18
- package/lib/security-rules/security-rules-internal.d.ts +0 -21
- package/lib/security-rules/security-rules-internal.js +0 -26
- package/lib/security-rules/security-rules-namespace.d.ts +0 -69
- package/lib/security-rules/security-rules-namespace.js +0 -18
- package/lib/storage/storage-namespace.d.ts +0 -45
- package/lib/storage/storage-namespace.js +0 -18
package/lib/auth/identifier.d.ts
CHANGED
package/lib/auth/identifier.js
CHANGED
package/lib/auth/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v14.0.0 */
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright 2020 Google LLC
|
|
4
4
|
*
|
|
@@ -55,4 +55,4 @@ export { ProjectConfigManager, } from './project-config-manager';
|
|
|
55
55
|
export { DecodedIdToken, DecodedAuthBlockingToken } from './token-verifier';
|
|
56
56
|
export { HashAlgorithmType, UserImportOptions, UserImportRecord, UserImportResult, UserMetadataRequest, UserProviderRequest, } from './user-import-builder';
|
|
57
57
|
export { MultiFactorInfo, MultiFactorSettings, PhoneMultiFactorInfo, UserInfo, UserMetadata, UserRecord, } from './user-record';
|
|
58
|
-
export { FirebaseAuthError,
|
|
58
|
+
export { FirebaseAuthError, AuthErrorCode, } from './error';
|
package/lib/auth/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v14.0.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright 2020 Google LLC
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.
|
|
19
|
+
exports.AuthErrorCode = exports.FirebaseAuthError = exports.UserRecord = exports.UserMetadata = exports.UserInfo = exports.PhoneMultiFactorInfo = exports.MultiFactorSettings = exports.MultiFactorInfo = exports.ProjectConfigManager = exports.ProjectConfig = exports.TenantManager = exports.TenantAwareAuth = exports.Tenant = exports.BaseAuth = exports.Auth = void 0;
|
|
20
20
|
exports.getAuth = getAuth;
|
|
21
21
|
/**
|
|
22
22
|
* Firebase Authentication.
|
|
@@ -73,6 +73,6 @@ Object.defineProperty(exports, "PhoneMultiFactorInfo", { enumerable: true, get:
|
|
|
73
73
|
Object.defineProperty(exports, "UserInfo", { enumerable: true, get: function () { return user_record_1.UserInfo; } });
|
|
74
74
|
Object.defineProperty(exports, "UserMetadata", { enumerable: true, get: function () { return user_record_1.UserMetadata; } });
|
|
75
75
|
Object.defineProperty(exports, "UserRecord", { enumerable: true, get: function () { return user_record_1.UserRecord; } });
|
|
76
|
-
var error_1 = require("
|
|
76
|
+
var error_1 = require("./error");
|
|
77
77
|
Object.defineProperty(exports, "FirebaseAuthError", { enumerable: true, get: function () { return error_1.FirebaseAuthError; } });
|
|
78
|
-
Object.defineProperty(exports, "
|
|
78
|
+
Object.defineProperty(exports, "AuthErrorCode", { enumerable: true, get: function () { return error_1.AuthErrorCode; } });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v14.0.0 */
|
|
2
2
|
import { SmsRegionConfig, MultiFactorConfig, MultiFactorAuthServerConfig, RecaptchaConfig, RecaptchaAuthServerConfig, PasswordPolicyAuthServerConfig, PasswordPolicyConfig, EmailPrivacyConfig, MobileLinksConfig } from './auth-config';
|
|
3
3
|
/**
|
|
4
4
|
* Interface representing the properties to update on the provided project config.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v14.0.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.ProjectConfig = void 0;
|
|
@@ -18,7 +18,7 @@ exports.ProjectConfig = void 0;
|
|
|
18
18
|
* limitations under the License.
|
|
19
19
|
*/
|
|
20
20
|
const validator = require("../utils/validator");
|
|
21
|
-
const error_1 = require("
|
|
21
|
+
const error_1 = require("./error");
|
|
22
22
|
const auth_config_1 = require("./auth-config");
|
|
23
23
|
const deep_copy_1 = require("../utils/deep-copy");
|
|
24
24
|
/**
|
|
@@ -44,7 +44,7 @@ class ProjectConfig {
|
|
|
44
44
|
*/
|
|
45
45
|
static validate(request) {
|
|
46
46
|
if (!validator.isNonNullObject(request)) {
|
|
47
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
47
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_ARGUMENT, '"UpdateProjectConfigRequest" must be a valid non-null object.');
|
|
48
48
|
}
|
|
49
49
|
const validKeys = {
|
|
50
50
|
smsRegionConfig: true,
|
|
@@ -57,7 +57,7 @@ class ProjectConfig {
|
|
|
57
57
|
// Check for unsupported top level attributes.
|
|
58
58
|
for (const key in request) {
|
|
59
59
|
if (!(key in validKeys)) {
|
|
60
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
60
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_ARGUMENT, `"${key}" is not a valid UpdateProjectConfigRequest parameter.`);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
// Validate SMS Regions Config if provided.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v14.0.0 */
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
*
|
|
@@ -85,6 +85,7 @@ export declare class TenantManager {
|
|
|
85
85
|
private readonly app;
|
|
86
86
|
private readonly authRequestHandler;
|
|
87
87
|
private readonly tenantsMap;
|
|
88
|
+
private readonly emulatorHost;
|
|
88
89
|
/**
|
|
89
90
|
* Returns a `TenantAwareAuth` instance bound to the given tenant ID.
|
|
90
91
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v14.0.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright 2019 Google LLC
|
|
@@ -19,7 +19,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
19
19
|
exports.TenantManager = exports.TenantAwareAuth = void 0;
|
|
20
20
|
const validator = require("../utils/validator");
|
|
21
21
|
const utils = require("../utils/index");
|
|
22
|
-
const error_1 = require("
|
|
22
|
+
const error_1 = require("./error");
|
|
23
23
|
const base_auth_1 = require("./base-auth");
|
|
24
24
|
const tenant_1 = require("./tenant");
|
|
25
25
|
const auth_api_request_1 = require("./auth-api-request");
|
|
@@ -46,11 +46,13 @@ class TenantAwareAuth extends base_auth_1.BaseAuth {
|
|
|
46
46
|
*
|
|
47
47
|
* @param app - The app that created this tenant.
|
|
48
48
|
* @param tenantId - The corresponding tenant ID.
|
|
49
|
+
* @param emHost - Optional emulator host captured at init time.
|
|
49
50
|
* @constructor
|
|
50
51
|
* @internal
|
|
51
52
|
*/
|
|
52
|
-
constructor(app, tenantId) {
|
|
53
|
-
|
|
53
|
+
constructor(app, tenantId, emHost) {
|
|
54
|
+
const emIsSet = emHost !== undefined;
|
|
55
|
+
super(app, new auth_api_request_1.TenantAwareAuthRequestHandler(app, tenantId, emHost), (0, base_auth_1.createFirebaseTokenGenerator)(app, tenantId, emIsSet ? !!emHost : undefined));
|
|
54
56
|
utils.addReadonlyGetter(this, 'tenantId', tenantId);
|
|
55
57
|
}
|
|
56
58
|
/**
|
|
@@ -61,7 +63,7 @@ class TenantAwareAuth extends base_auth_1.BaseAuth {
|
|
|
61
63
|
.then((decodedClaims) => {
|
|
62
64
|
// Validate tenant ID.
|
|
63
65
|
if (decodedClaims.firebase.tenant !== this.tenantId) {
|
|
64
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
66
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.MISMATCHING_TENANT_ID);
|
|
65
67
|
}
|
|
66
68
|
return decodedClaims;
|
|
67
69
|
});
|
|
@@ -72,11 +74,11 @@ class TenantAwareAuth extends base_auth_1.BaseAuth {
|
|
|
72
74
|
createSessionCookie(idToken, sessionCookieOptions) {
|
|
73
75
|
// Validate arguments before processing.
|
|
74
76
|
if (!validator.isNonEmptyString(idToken)) {
|
|
75
|
-
return Promise.reject(new error_1.FirebaseAuthError(error_1.
|
|
77
|
+
return Promise.reject(new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_ID_TOKEN));
|
|
76
78
|
}
|
|
77
79
|
if (!validator.isNonNullObject(sessionCookieOptions) ||
|
|
78
80
|
!validator.isNumber(sessionCookieOptions.expiresIn)) {
|
|
79
|
-
return Promise.reject(new error_1.FirebaseAuthError(error_1.
|
|
81
|
+
return Promise.reject(new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_SESSION_COOKIE_DURATION));
|
|
80
82
|
}
|
|
81
83
|
// This will verify the ID token and then match the tenant ID before creating the session cookie.
|
|
82
84
|
return this.verifyIdToken(idToken)
|
|
@@ -91,7 +93,7 @@ class TenantAwareAuth extends base_auth_1.BaseAuth {
|
|
|
91
93
|
return super.verifySessionCookie(sessionCookie, checkRevoked)
|
|
92
94
|
.then((decodedClaims) => {
|
|
93
95
|
if (decodedClaims.firebase.tenant !== this.tenantId) {
|
|
94
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
96
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.MISMATCHING_TENANT_ID);
|
|
95
97
|
}
|
|
96
98
|
return decodedClaims;
|
|
97
99
|
});
|
|
@@ -121,6 +123,7 @@ class TenantManager {
|
|
|
121
123
|
constructor(app) {
|
|
122
124
|
this.app = app;
|
|
123
125
|
this.authRequestHandler = new auth_api_request_1.AuthRequestHandler(app);
|
|
126
|
+
this.emulatorHost = this.authRequestHandler.emulatorHostValue;
|
|
124
127
|
this.tenantsMap = {};
|
|
125
128
|
}
|
|
126
129
|
/**
|
|
@@ -132,10 +135,10 @@ class TenantManager {
|
|
|
132
135
|
*/
|
|
133
136
|
authForTenant(tenantId) {
|
|
134
137
|
if (!validator.isNonEmptyString(tenantId)) {
|
|
135
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
138
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_TENANT_ID);
|
|
136
139
|
}
|
|
137
140
|
if (typeof this.tenantsMap[tenantId] === 'undefined') {
|
|
138
|
-
this.tenantsMap[tenantId] = new TenantAwareAuth(this.app, tenantId);
|
|
141
|
+
this.tenantsMap[tenantId] = new TenantAwareAuth(this.app, tenantId, this.emulatorHost ?? null);
|
|
139
142
|
}
|
|
140
143
|
return this.tenantsMap[tenantId];
|
|
141
144
|
}
|
package/lib/auth/tenant.d.ts
CHANGED
package/lib/auth/tenant.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v14.0.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright 2019 Google LLC
|
|
@@ -19,7 +19,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
19
19
|
exports.Tenant = void 0;
|
|
20
20
|
const validator = require("../utils/validator");
|
|
21
21
|
const deep_copy_1 = require("../utils/deep-copy");
|
|
22
|
-
const error_1 = require("
|
|
22
|
+
const error_1 = require("./error");
|
|
23
23
|
const auth_config_1 = require("./auth-config");
|
|
24
24
|
/**
|
|
25
25
|
* Represents a tenant configuration.
|
|
@@ -120,18 +120,18 @@ class Tenant {
|
|
|
120
120
|
};
|
|
121
121
|
const label = createRequest ? 'CreateTenantRequest' : 'UpdateTenantRequest';
|
|
122
122
|
if (!validator.isNonNullObject(request)) {
|
|
123
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
123
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_ARGUMENT, `"${label}" must be a valid non-null object.`);
|
|
124
124
|
}
|
|
125
125
|
// Check for unsupported top level attributes.
|
|
126
126
|
for (const key in request) {
|
|
127
127
|
if (!(key in validKeys)) {
|
|
128
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
128
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_ARGUMENT, `"${key}" is not a valid ${label} parameter.`);
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
// Validate displayName type if provided.
|
|
132
132
|
if (typeof request.displayName !== 'undefined' &&
|
|
133
133
|
!validator.isNonEmptyString(request.displayName)) {
|
|
134
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
134
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_ARGUMENT, `"${label}.displayName" must be a valid non-empty string.`);
|
|
135
135
|
}
|
|
136
136
|
// Validate emailSignInConfig type if provided.
|
|
137
137
|
if (typeof request.emailSignInConfig !== 'undefined') {
|
|
@@ -145,7 +145,7 @@ class Tenant {
|
|
|
145
145
|
}
|
|
146
146
|
else if (request.testPhoneNumbers === null && createRequest) {
|
|
147
147
|
// null allowed only for update operations.
|
|
148
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
148
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_ARGUMENT, `"${label}.testPhoneNumbers" must be a non-null object.`);
|
|
149
149
|
}
|
|
150
150
|
// Validate multiFactorConfig type if provided.
|
|
151
151
|
if (typeof request.multiFactorConfig !== 'undefined') {
|
|
@@ -180,7 +180,7 @@ class Tenant {
|
|
|
180
180
|
constructor(response) {
|
|
181
181
|
const tenantId = Tenant.getTenantIdFromResourceName(response.name);
|
|
182
182
|
if (!tenantId) {
|
|
183
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
183
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Invalid tenant response');
|
|
184
184
|
}
|
|
185
185
|
this.tenantId = tenantId;
|
|
186
186
|
this.displayName = response.displayName;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v14.0.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* @license
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.FirebaseTokenGenerator = exports.EmulatedSigner = exports.BLACKLISTED_CLAIMS = void 0;
|
|
21
21
|
exports.handleCryptoSignerError = handleCryptoSignerError;
|
|
22
|
-
const error_1 = require("
|
|
22
|
+
const error_1 = require("./error");
|
|
23
23
|
const crypto_signer_1 = require("../utils/crypto-signer");
|
|
24
24
|
const validator = require("../utils/validator");
|
|
25
25
|
const utils_1 = require("../utils");
|
|
@@ -69,10 +69,10 @@ class FirebaseTokenGenerator {
|
|
|
69
69
|
constructor(signer, tenantId) {
|
|
70
70
|
this.tenantId = tenantId;
|
|
71
71
|
if (!validator.isNonNullObject(signer)) {
|
|
72
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
72
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_CREDENTIAL, 'INTERNAL ASSERT: Must provide a CryptoSigner to use FirebaseTokenGenerator.');
|
|
73
73
|
}
|
|
74
74
|
if (typeof this.tenantId !== 'undefined' && !validator.isNonEmptyString(this.tenantId)) {
|
|
75
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
75
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_ARGUMENT, '`tenantId` argument must be a non-empty string.');
|
|
76
76
|
}
|
|
77
77
|
this.signer = signer;
|
|
78
78
|
}
|
|
@@ -97,7 +97,7 @@ class FirebaseTokenGenerator {
|
|
|
97
97
|
errorMessage = '`developerClaims` argument must be a valid, non-null object containing the developer claims.';
|
|
98
98
|
}
|
|
99
99
|
if (errorMessage) {
|
|
100
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
100
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_ARGUMENT, errorMessage);
|
|
101
101
|
}
|
|
102
102
|
const claims = {};
|
|
103
103
|
if (typeof developerClaims !== 'undefined') {
|
|
@@ -105,7 +105,7 @@ class FirebaseTokenGenerator {
|
|
|
105
105
|
/* istanbul ignore else */
|
|
106
106
|
if (Object.prototype.hasOwnProperty.call(developerClaims, key)) {
|
|
107
107
|
if (exports.BLACKLISTED_CLAIMS.indexOf(key) !== -1) {
|
|
108
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
108
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_ARGUMENT, `Developer claim "${key}" is reserved and cannot be specified.`);
|
|
109
109
|
}
|
|
110
110
|
claims[key] = developerClaims[key];
|
|
111
111
|
}
|
|
@@ -178,21 +178,21 @@ function handleCryptoSignerError(err) {
|
|
|
178
178
|
const description = 'Please refer to https://firebase.google.com/docs/auth/admin/create-custom-tokens ' +
|
|
179
179
|
'for more details on how to use and troubleshoot this feature.';
|
|
180
180
|
const errorMsg = `${errorResponse.error.message}; ${description}`;
|
|
181
|
-
return error_1.FirebaseAuthError.fromServerError(errorCode, errorMsg,
|
|
181
|
+
return error_1.FirebaseAuthError.fromServerError(errorCode, errorMsg, httpError);
|
|
182
182
|
}
|
|
183
|
-
return new error_1.FirebaseAuthError(error_1.
|
|
183
|
+
return new error_1.FirebaseAuthError(error_1.authClientErrorCode.INTERNAL_ERROR, 'Error returned from server: ' + errorResponse + '. Additionally, an ' +
|
|
184
184
|
'internal error occurred while attempting to extract the ' +
|
|
185
185
|
'errorcode from the error.');
|
|
186
186
|
}
|
|
187
|
-
return new error_1.FirebaseAuthError(
|
|
187
|
+
return new error_1.FirebaseAuthError(mapToAuthErrorInfo(err.code), err.message);
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function mapToAuthErrorInfo(code) {
|
|
190
190
|
switch (code) {
|
|
191
191
|
case crypto_signer_1.CryptoSignerErrorCode.INVALID_CREDENTIAL:
|
|
192
|
-
return error_1.
|
|
192
|
+
return error_1.authClientErrorCode.INVALID_CREDENTIAL;
|
|
193
193
|
case crypto_signer_1.CryptoSignerErrorCode.INVALID_ARGUMENT:
|
|
194
|
-
return error_1.
|
|
194
|
+
return error_1.authClientErrorCode.INVALID_ARGUMENT;
|
|
195
195
|
default:
|
|
196
|
-
return error_1.
|
|
196
|
+
return error_1.authClientErrorCode.INTERNAL_ERROR;
|
|
197
197
|
}
|
|
198
198
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v14.0.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright 2018 Google LLC
|
|
@@ -20,7 +20,7 @@ exports.FirebaseTokenVerifier = exports.SESSION_COOKIE_INFO = exports.AUTH_BLOCK
|
|
|
20
20
|
exports.createIdTokenVerifier = createIdTokenVerifier;
|
|
21
21
|
exports.createAuthBlockingTokenVerifier = createAuthBlockingTokenVerifier;
|
|
22
22
|
exports.createSessionCookieVerifier = createSessionCookieVerifier;
|
|
23
|
-
const error_1 = require("
|
|
23
|
+
const error_1 = require("./error");
|
|
24
24
|
const util = require("../utils/index");
|
|
25
25
|
const validator = require("../utils/validator");
|
|
26
26
|
const jwt_1 = require("../utils/jwt");
|
|
@@ -42,7 +42,7 @@ exports.ID_TOKEN_INFO = {
|
|
|
42
42
|
verifyApiName: 'verifyIdToken()',
|
|
43
43
|
jwtName: 'Firebase ID token',
|
|
44
44
|
shortName: 'ID token',
|
|
45
|
-
expiredErrorCode: error_1.
|
|
45
|
+
expiredErrorCode: error_1.authClientErrorCode.ID_TOKEN_EXPIRED,
|
|
46
46
|
};
|
|
47
47
|
/**
|
|
48
48
|
* User facing token information related to the Firebase Auth Blocking token.
|
|
@@ -54,7 +54,7 @@ exports.AUTH_BLOCKING_TOKEN_INFO = {
|
|
|
54
54
|
verifyApiName: '_verifyAuthBlockingToken()',
|
|
55
55
|
jwtName: 'Firebase Auth Blocking token',
|
|
56
56
|
shortName: 'Auth Blocking token',
|
|
57
|
-
expiredErrorCode: error_1.
|
|
57
|
+
expiredErrorCode: error_1.authClientErrorCode.AUTH_BLOCKING_TOKEN_EXPIRED,
|
|
58
58
|
};
|
|
59
59
|
/**
|
|
60
60
|
* User facing token information related to the Firebase session cookie.
|
|
@@ -66,7 +66,7 @@ exports.SESSION_COOKIE_INFO = {
|
|
|
66
66
|
verifyApiName: 'verifySessionCookie()',
|
|
67
67
|
jwtName: 'Firebase session cookie',
|
|
68
68
|
shortName: 'session cookie',
|
|
69
|
-
expiredErrorCode: error_1.
|
|
69
|
+
expiredErrorCode: error_1.authClientErrorCode.SESSION_COOKIE_EXPIRED,
|
|
70
70
|
};
|
|
71
71
|
/**
|
|
72
72
|
* Class for verifying general purpose Firebase JWTs. This verifies ID tokens and session cookies.
|
|
@@ -79,28 +79,28 @@ class FirebaseTokenVerifier {
|
|
|
79
79
|
this.tokenInfo = tokenInfo;
|
|
80
80
|
this.app = app;
|
|
81
81
|
if (!validator.isURL(clientCertUrl)) {
|
|
82
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
82
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_ARGUMENT, 'The provided public client certificate URL is an invalid URL.');
|
|
83
83
|
}
|
|
84
84
|
else if (!validator.isURL(issuer)) {
|
|
85
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
85
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_ARGUMENT, 'The provided JWT issuer is an invalid URL.');
|
|
86
86
|
}
|
|
87
87
|
else if (!validator.isNonNullObject(tokenInfo)) {
|
|
88
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
88
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_ARGUMENT, 'The provided JWT information is not an object or null.');
|
|
89
89
|
}
|
|
90
90
|
else if (!validator.isURL(tokenInfo.url)) {
|
|
91
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
91
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_ARGUMENT, 'The provided JWT verification documentation URL is invalid.');
|
|
92
92
|
}
|
|
93
93
|
else if (!validator.isNonEmptyString(tokenInfo.verifyApiName)) {
|
|
94
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
94
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_ARGUMENT, 'The JWT verify API name must be a non-empty string.');
|
|
95
95
|
}
|
|
96
96
|
else if (!validator.isNonEmptyString(tokenInfo.jwtName)) {
|
|
97
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
97
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_ARGUMENT, 'The JWT public full name must be a non-empty string.');
|
|
98
98
|
}
|
|
99
99
|
else if (!validator.isNonEmptyString(tokenInfo.shortName)) {
|
|
100
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
100
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_ARGUMENT, 'The JWT public short name must be a non-empty string.');
|
|
101
101
|
}
|
|
102
102
|
else if (!validator.isNonNullObject(tokenInfo.expiredErrorCode) || !('code' in tokenInfo.expiredErrorCode)) {
|
|
103
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
103
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_ARGUMENT, 'The JWT expiration error code must be a non-null ErrorInfo object.');
|
|
104
104
|
}
|
|
105
105
|
this.shortNameArticle = tokenInfo.shortName.charAt(0).match(/[aeiou]/i) ? 'an' : 'a';
|
|
106
106
|
this.signatureVerifier =
|
|
@@ -116,7 +116,7 @@ class FirebaseTokenVerifier {
|
|
|
116
116
|
*/
|
|
117
117
|
verifyJWT(jwtToken, isEmulator = false) {
|
|
118
118
|
if (!validator.isString(jwtToken)) {
|
|
119
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
119
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_ARGUMENT, `First argument to ${this.tokenInfo.verifyApiName} must be a ${this.tokenInfo.jwtName} string.`);
|
|
120
120
|
}
|
|
121
121
|
return this.ensureProjectId()
|
|
122
122
|
.then((projectId) => {
|
|
@@ -132,7 +132,7 @@ class FirebaseTokenVerifier {
|
|
|
132
132
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
133
133
|
_verifyAuthBlockingToken(jwtToken, isEmulator, audience) {
|
|
134
134
|
if (!validator.isString(jwtToken)) {
|
|
135
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
135
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_ARGUMENT, `First argument to ${this.tokenInfo.verifyApiName} must be a ${this.tokenInfo.jwtName} string.`);
|
|
136
136
|
}
|
|
137
137
|
return this.ensureProjectId()
|
|
138
138
|
.then((projectId) => {
|
|
@@ -151,7 +151,7 @@ class FirebaseTokenVerifier {
|
|
|
151
151
|
return util.findProjectId(this.app)
|
|
152
152
|
.then((projectId) => {
|
|
153
153
|
if (!validator.isNonEmptyString(projectId)) {
|
|
154
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
154
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_CREDENTIAL, 'Must initialize app with a cert credential or set your Firebase project ID as the ' +
|
|
155
155
|
`GOOGLE_CLOUD_PROJECT environment variable to call ${this.tokenInfo.verifyApiName}.`);
|
|
156
156
|
}
|
|
157
157
|
return Promise.resolve(projectId);
|
|
@@ -174,9 +174,9 @@ class FirebaseTokenVerifier {
|
|
|
174
174
|
const errorMessage = `Decoding ${this.tokenInfo.jwtName} failed. Make sure you passed ` +
|
|
175
175
|
`the entire string JWT which represents ${this.shortNameArticle} ` +
|
|
176
176
|
`${this.tokenInfo.shortName}.` + verifyJwtTokenDocsMessage;
|
|
177
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
177
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_ARGUMENT, errorMessage);
|
|
178
178
|
}
|
|
179
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
179
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.INTERNAL_ERROR, err.message);
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
182
|
/**
|
|
@@ -245,7 +245,7 @@ class FirebaseTokenVerifier {
|
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
247
|
if (errorMessage) {
|
|
248
|
-
throw new error_1.FirebaseAuthError(error_1.
|
|
248
|
+
throw new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_ARGUMENT, errorMessage);
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
verifySignature(jwtToken, isEmulator) {
|
|
@@ -272,15 +272,15 @@ class FirebaseTokenVerifier {
|
|
|
272
272
|
}
|
|
273
273
|
else if (error.code === jwt_1.JwtErrorCode.INVALID_SIGNATURE) {
|
|
274
274
|
const errorMessage = `${this.tokenInfo.jwtName} has invalid signature.` + verifyJwtTokenDocsMessage;
|
|
275
|
-
return new error_1.FirebaseAuthError(error_1.
|
|
275
|
+
return new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_ARGUMENT, errorMessage);
|
|
276
276
|
}
|
|
277
277
|
else if (error.code === jwt_1.JwtErrorCode.NO_MATCHING_KID) {
|
|
278
278
|
const errorMessage = `${this.tokenInfo.jwtName} has "kid" claim which does not ` +
|
|
279
279
|
`correspond to a known public key. Most likely the ${this.tokenInfo.shortName} ` +
|
|
280
280
|
'is expired, so get a fresh token from your client app and try again.';
|
|
281
|
-
return new error_1.FirebaseAuthError(error_1.
|
|
281
|
+
return new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_ARGUMENT, errorMessage);
|
|
282
282
|
}
|
|
283
|
-
return new error_1.FirebaseAuthError(error_1.
|
|
283
|
+
return new error_1.FirebaseAuthError(error_1.authClientErrorCode.INVALID_ARGUMENT, error.message);
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
exports.FirebaseTokenVerifier = FirebaseTokenVerifier;
|