firebase-admin 11.6.0 → 11.7.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/lib/app/core.d.ts +1 -1
- 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 +36 -36
- package/lib/app/credential.d.ts +1 -1
- package/lib/app/credential.js +1 -1
- package/lib/app/firebase-app.d.ts +1 -1
- package/lib/app/firebase-app.js +1 -1
- package/lib/app/firebase-namespace.d.ts +1 -1
- package/lib/app/firebase-namespace.js +1 -1
- package/lib/app/index.d.ts +1 -1
- package/lib/app/index.js +1 -1
- package/lib/app/lifecycle.d.ts +1 -1
- package/lib/app/lifecycle.js +1 -1
- package/lib/app-check/app-check-api-client-internal.d.ts +2 -2
- package/lib/app-check/app-check-api-client-internal.js +1 -1
- package/lib/app-check/app-check-api.d.ts +1 -1
- package/lib/app-check/app-check-api.js +1 -1
- package/lib/app-check/app-check-namespace.d.ts +1 -1
- package/lib/app-check/app-check-namespace.js +1 -1
- package/lib/app-check/app-check.d.ts +1 -1
- package/lib/app-check/app-check.js +1 -1
- package/lib/app-check/index.d.ts +1 -1
- package/lib/app-check/index.js +1 -1
- package/lib/app-check/token-generator.d.ts +1 -1
- package/lib/app-check/token-generator.js +1 -1
- package/lib/app-check/token-verifier.d.ts +1 -1
- package/lib/app-check/token-verifier.js +1 -1
- package/lib/auth/action-code-settings-builder.d.ts +1 -1
- package/lib/auth/action-code-settings-builder.js +1 -1
- package/lib/auth/auth-api-request.d.ts +1 -1
- package/lib/auth/auth-api-request.js +12 -12
- package/lib/auth/auth-config.d.ts +98 -9
- package/lib/auth/auth-config.js +227 -123
- package/lib/auth/auth-namespace.d.ts +1 -1
- package/lib/auth/auth-namespace.js +1 -1
- package/lib/auth/auth.d.ts +1 -1
- package/lib/auth/auth.js +1 -1
- package/lib/auth/base-auth.d.ts +1 -1
- package/lib/auth/base-auth.js +1 -1
- package/lib/auth/identifier.d.ts +2 -2
- package/lib/auth/identifier.js +1 -1
- package/lib/auth/index.d.ts +2 -2
- package/lib/auth/index.js +1 -1
- package/lib/auth/project-config-manager.d.ts +2 -5
- package/lib/auth/project-config-manager.js +2 -5
- package/lib/auth/project-config.d.ts +26 -7
- package/lib/auth/project-config.js +36 -18
- package/lib/auth/tenant-manager.d.ts +1 -1
- package/lib/auth/tenant-manager.js +1 -1
- package/lib/auth/tenant.d.ts +23 -3
- package/lib/auth/tenant.js +56 -35
- package/lib/auth/token-generator.d.ts +1 -1
- package/lib/auth/token-generator.js +1 -1
- package/lib/auth/token-verifier.d.ts +1 -1
- package/lib/auth/token-verifier.js +1 -1
- package/lib/auth/user-import-builder.d.ts +3 -3
- package/lib/auth/user-import-builder.js +1 -1
- package/lib/auth/user-record.d.ts +1 -1
- package/lib/auth/user-record.js +11 -11
- package/lib/credential/index.d.ts +1 -1
- package/lib/credential/index.js +1 -1
- package/lib/database/database-namespace.d.ts +1 -1
- package/lib/database/database-namespace.js +1 -1
- package/lib/database/database.d.ts +1 -1
- package/lib/database/database.js +1 -1
- package/lib/database/index.d.ts +1 -1
- package/lib/database/index.js +1 -1
- package/lib/default-namespace.d.ts +1 -1
- package/lib/default-namespace.js +1 -1
- package/lib/eventarc/cloudevent.d.ts +2 -2
- package/lib/eventarc/cloudevent.js +1 -1
- package/lib/eventarc/eventarc-client-internal.d.ts +1 -1
- package/lib/eventarc/eventarc-client-internal.js +1 -1
- package/lib/eventarc/eventarc-utils.d.ts +2 -2
- package/lib/eventarc/eventarc-utils.js +1 -1
- package/lib/eventarc/eventarc.d.ts +1 -1
- package/lib/eventarc/eventarc.js +1 -1
- package/lib/eventarc/index.d.ts +1 -1
- package/lib/eventarc/index.js +1 -1
- package/lib/extensions/extensions-api-client-internal.d.ts +2 -2
- package/lib/extensions/extensions-api-client-internal.js +1 -1
- package/lib/extensions/extensions-api.d.ts +2 -2
- package/lib/extensions/extensions-api.js +1 -1
- package/lib/extensions/extensions.d.ts +1 -1
- package/lib/extensions/extensions.js +1 -1
- package/lib/extensions/index.d.ts +1 -1
- package/lib/extensions/index.js +1 -1
- package/lib/firebase-namespace-api.d.ts +1 -1
- package/lib/firebase-namespace-api.js +1 -1
- package/lib/firestore/firestore-internal.d.ts +1 -1
- package/lib/firestore/firestore-internal.js +1 -1
- package/lib/firestore/firestore-namespace.d.ts +1 -1
- package/lib/firestore/firestore-namespace.js +1 -1
- package/lib/firestore/index.d.ts +1 -1
- package/lib/firestore/index.js +1 -1
- package/lib/functions/functions-api-client-internal.d.ts +2 -2
- package/lib/functions/functions-api-client-internal.js +1 -1
- package/lib/functions/functions-api.d.ts +3 -3
- package/lib/functions/functions-api.js +1 -1
- package/lib/functions/functions.d.ts +1 -1
- package/lib/functions/functions.js +1 -1
- package/lib/functions/index.d.ts +1 -1
- package/lib/functions/index.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/installations/index.d.ts +1 -1
- package/lib/installations/index.js +1 -1
- package/lib/installations/installations-namespace.d.ts +1 -1
- package/lib/installations/installations-namespace.js +1 -1
- package/lib/installations/installations-request-handler.d.ts +1 -1
- package/lib/installations/installations-request-handler.js +1 -1
- package/lib/installations/installations.d.ts +1 -1
- package/lib/installations/installations.js +1 -1
- package/lib/instance-id/index.d.ts +1 -1
- package/lib/instance-id/index.js +1 -1
- package/lib/instance-id/instance-id-namespace.d.ts +1 -1
- package/lib/instance-id/instance-id-namespace.js +1 -1
- package/lib/instance-id/instance-id.d.ts +1 -1
- package/lib/instance-id/instance-id.js +1 -1
- package/lib/machine-learning/index.d.ts +1 -1
- package/lib/machine-learning/index.js +1 -1
- package/lib/machine-learning/machine-learning-api-client.d.ts +3 -3
- package/lib/machine-learning/machine-learning-api-client.js +1 -1
- package/lib/machine-learning/machine-learning-namespace.d.ts +1 -1
- package/lib/machine-learning/machine-learning-namespace.js +1 -1
- package/lib/machine-learning/machine-learning-utils.d.ts +2 -2
- package/lib/machine-learning/machine-learning-utils.js +1 -1
- package/lib/machine-learning/machine-learning.d.ts +1 -1
- package/lib/machine-learning/machine-learning.js +1 -1
- package/lib/messaging/batch-request-internal.d.ts +1 -1
- package/lib/messaging/batch-request-internal.js +1 -1
- package/lib/messaging/index.d.ts +1 -1
- package/lib/messaging/index.js +1 -1
- package/lib/messaging/messaging-api-request-internal.d.ts +12 -2
- package/lib/messaging/messaging-api-request-internal.js +34 -1
- package/lib/messaging/messaging-api.d.ts +2 -2
- package/lib/messaging/messaging-api.js +1 -1
- package/lib/messaging/messaging-errors-internal.d.ts +1 -1
- package/lib/messaging/messaging-errors-internal.js +1 -1
- package/lib/messaging/messaging-internal.d.ts +1 -1
- package/lib/messaging/messaging-internal.js +1 -1
- package/lib/messaging/messaging-namespace.d.ts +1 -1
- package/lib/messaging/messaging-namespace.js +1 -1
- package/lib/messaging/messaging.d.ts +48 -6
- package/lib/messaging/messaging.js +116 -6
- package/lib/project-management/android-app.d.ts +1 -1
- package/lib/project-management/android-app.js +1 -1
- package/lib/project-management/app-metadata.d.ts +1 -1
- package/lib/project-management/app-metadata.js +1 -1
- package/lib/project-management/index.d.ts +1 -1
- package/lib/project-management/index.js +1 -1
- package/lib/project-management/ios-app.d.ts +1 -1
- package/lib/project-management/ios-app.js +1 -1
- package/lib/project-management/project-management-api-request-internal.d.ts +1 -1
- package/lib/project-management/project-management-api-request-internal.js +10 -10
- package/lib/project-management/project-management-namespace.d.ts +1 -1
- package/lib/project-management/project-management-namespace.js +1 -1
- package/lib/project-management/project-management.d.ts +1 -1
- package/lib/project-management/project-management.js +1 -1
- package/lib/remote-config/index.d.ts +1 -1
- package/lib/remote-config/index.js +1 -1
- package/lib/remote-config/remote-config-api-client-internal.d.ts +2 -2
- package/lib/remote-config/remote-config-api-client-internal.js +1 -1
- package/lib/remote-config/remote-config-api.d.ts +4 -4
- package/lib/remote-config/remote-config-api.js +1 -1
- package/lib/remote-config/remote-config-namespace.d.ts +1 -1
- package/lib/remote-config/remote-config-namespace.js +1 -1
- package/lib/remote-config/remote-config.d.ts +1 -1
- package/lib/remote-config/remote-config.js +1 -1
- package/lib/security-rules/index.d.ts +1 -1
- package/lib/security-rules/index.js +1 -1
- package/lib/security-rules/security-rules-api-client-internal.d.ts +1 -1
- package/lib/security-rules/security-rules-api-client-internal.js +1 -1
- package/lib/security-rules/security-rules-internal.d.ts +2 -2
- package/lib/security-rules/security-rules-internal.js +1 -1
- package/lib/security-rules/security-rules-namespace.d.ts +1 -1
- package/lib/security-rules/security-rules-namespace.js +1 -1
- package/lib/security-rules/security-rules.d.ts +1 -1
- package/lib/security-rules/security-rules.js +1 -1
- package/lib/storage/index.d.ts +1 -1
- package/lib/storage/index.js +1 -1
- package/lib/storage/storage-namespace.d.ts +1 -1
- package/lib/storage/storage-namespace.js +1 -1
- package/lib/storage/storage.d.ts +1 -1
- package/lib/storage/storage.js +1 -1
- package/lib/utils/api-request.d.ts +3 -3
- package/lib/utils/api-request.js +7 -7
- package/lib/utils/crypto-signer.d.ts +1 -1
- package/lib/utils/crypto-signer.js +1 -1
- package/lib/utils/deep-copy.d.ts +1 -1
- package/lib/utils/deep-copy.js +1 -1
- package/lib/utils/error.d.ts +14 -2
- package/lib/utils/error.js +19 -1
- package/lib/utils/index.d.ts +2 -2
- package/lib/utils/index.js +1 -1
- package/lib/utils/jwt.d.ts +3 -3
- package/lib/utils/jwt.js +1 -1
- package/lib/utils/validator.d.ts +1 -1
- package/lib/utils/validator.js +1 -1
- package/package.json +6 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v11.
|
|
1
|
+
/*! firebase-admin v11.7.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.ProjectConfig = void 0;
|
|
@@ -25,23 +25,6 @@ const deep_copy_1 = require("../utils/deep-copy");
|
|
|
25
25
|
* Represents a project configuration.
|
|
26
26
|
*/
|
|
27
27
|
class ProjectConfig {
|
|
28
|
-
/**
|
|
29
|
-
* The Project Config object constructor.
|
|
30
|
-
*
|
|
31
|
-
* @param response - The server side response used to initialize the Project Config object.
|
|
32
|
-
* @constructor
|
|
33
|
-
* @internal
|
|
34
|
-
*/
|
|
35
|
-
constructor(response) {
|
|
36
|
-
if (typeof response.smsRegionConfig !== 'undefined') {
|
|
37
|
-
this.smsRegionConfig = response.smsRegionConfig;
|
|
38
|
-
}
|
|
39
|
-
//Backend API returns "mfa" in case of project config and "mfaConfig" in case of tenant config.
|
|
40
|
-
//The SDK exposes it as multiFactorConfig always.
|
|
41
|
-
if (typeof response.mfa !== 'undefined') {
|
|
42
|
-
this.multiFactorConfig_ = new auth_config_1.MultiFactorAuthConfig(response.mfa);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
28
|
/**
|
|
46
29
|
* The multi-factor auth configuration.
|
|
47
30
|
*/
|
|
@@ -60,6 +43,7 @@ class ProjectConfig {
|
|
|
60
43
|
const validKeys = {
|
|
61
44
|
smsRegionConfig: true,
|
|
62
45
|
multiFactorConfig: true,
|
|
46
|
+
recaptchaConfig: true,
|
|
63
47
|
};
|
|
64
48
|
// Check for unsupported top level attributes.
|
|
65
49
|
for (const key in request) {
|
|
@@ -75,6 +59,10 @@ class ProjectConfig {
|
|
|
75
59
|
if (typeof request.multiFactorConfig !== 'undefined') {
|
|
76
60
|
auth_config_1.MultiFactorAuthConfig.validate(request.multiFactorConfig);
|
|
77
61
|
}
|
|
62
|
+
// Validate reCAPTCHA config attribute.
|
|
63
|
+
if (typeof request.recaptchaConfig !== 'undefined') {
|
|
64
|
+
auth_config_1.RecaptchaAuthConfig.validate(request.recaptchaConfig);
|
|
65
|
+
}
|
|
78
66
|
}
|
|
79
67
|
/**
|
|
80
68
|
* Build the corresponding server request for a UpdateProjectConfigRequest object.
|
|
@@ -96,6 +84,32 @@ class ProjectConfig {
|
|
|
96
84
|
delete request.multiFactorConfig;
|
|
97
85
|
return request;
|
|
98
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* The reCAPTCHA configuration.
|
|
89
|
+
*/
|
|
90
|
+
get recaptchaConfig() {
|
|
91
|
+
return this.recaptchaConfig_;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* The Project Config object constructor.
|
|
95
|
+
*
|
|
96
|
+
* @param response - The server side response used to initialize the Project Config object.
|
|
97
|
+
* @constructor
|
|
98
|
+
* @internal
|
|
99
|
+
*/
|
|
100
|
+
constructor(response) {
|
|
101
|
+
if (typeof response.smsRegionConfig !== 'undefined') {
|
|
102
|
+
this.smsRegionConfig = response.smsRegionConfig;
|
|
103
|
+
}
|
|
104
|
+
//Backend API returns "mfa" in case of project config and "mfaConfig" in case of tenant config.
|
|
105
|
+
//The SDK exposes it as multiFactorConfig always.
|
|
106
|
+
if (typeof response.mfa !== 'undefined') {
|
|
107
|
+
this.multiFactorConfig_ = new auth_config_1.MultiFactorAuthConfig(response.mfa);
|
|
108
|
+
}
|
|
109
|
+
if (typeof response.recaptchaConfig !== 'undefined') {
|
|
110
|
+
this.recaptchaConfig_ = new auth_config_1.RecaptchaAuthConfig(response.recaptchaConfig);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
99
113
|
/**
|
|
100
114
|
* Returns a JSON-serializable representation of this object.
|
|
101
115
|
*
|
|
@@ -106,6 +120,7 @@ class ProjectConfig {
|
|
|
106
120
|
const json = {
|
|
107
121
|
smsRegionConfig: (0, deep_copy_1.deepCopy)(this.smsRegionConfig),
|
|
108
122
|
multiFactorConfig: (0, deep_copy_1.deepCopy)(this.multiFactorConfig),
|
|
123
|
+
recaptchaConfig: this.recaptchaConfig_?.toJSON(),
|
|
109
124
|
};
|
|
110
125
|
if (typeof json.smsRegionConfig === 'undefined') {
|
|
111
126
|
delete json.smsRegionConfig;
|
|
@@ -113,6 +128,9 @@ class ProjectConfig {
|
|
|
113
128
|
if (typeof json.multiFactorConfig === 'undefined') {
|
|
114
129
|
delete json.multiFactorConfig;
|
|
115
130
|
}
|
|
131
|
+
if (typeof json.recaptchaConfig === 'undefined') {
|
|
132
|
+
delete json.recaptchaConfig;
|
|
133
|
+
}
|
|
116
134
|
return json;
|
|
117
135
|
}
|
|
118
136
|
}
|
package/lib/auth/tenant.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v11.
|
|
1
|
+
/*! firebase-admin v11.7.0 */
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright 2019 Google Inc.
|
|
4
4
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { EmailSignInConfigServerRequest, MultiFactorAuthServerConfig, MultiFactorConfig, EmailSignInProviderConfig, SmsRegionConfig } from './auth-config';
|
|
17
|
+
import { EmailSignInConfigServerRequest, MultiFactorAuthServerConfig, MultiFactorConfig, EmailSignInProviderConfig, SmsRegionConfig, RecaptchaConfig } from './auth-config';
|
|
18
18
|
/**
|
|
19
19
|
* Interface representing the properties to update on the provided tenant.
|
|
20
20
|
*/
|
|
@@ -46,11 +46,18 @@ export interface UpdateTenantRequest {
|
|
|
46
46
|
* The SMS configuration to update on the project.
|
|
47
47
|
*/
|
|
48
48
|
smsRegionConfig?: SmsRegionConfig;
|
|
49
|
+
/**
|
|
50
|
+
* The reCAPTCHA configuration to update on the tenant.
|
|
51
|
+
* By enabling reCAPTCHA Enterprise integration, you are
|
|
52
|
+
* agreeing to the reCAPTCHA Enterprise
|
|
53
|
+
* {@link https://cloud.google.com/terms/service-terms | Term of Service}.
|
|
54
|
+
*/
|
|
55
|
+
recaptchaConfig?: RecaptchaConfig;
|
|
49
56
|
}
|
|
50
57
|
/**
|
|
51
58
|
* Interface representing the properties to set on a new tenant.
|
|
52
59
|
*/
|
|
53
|
-
export
|
|
60
|
+
export type CreateTenantRequest = UpdateTenantRequest;
|
|
54
61
|
/** The corresponding server side representation of a TenantOptions object. */
|
|
55
62
|
export interface TenantOptionsServerRequest extends EmailSignInConfigServerRequest {
|
|
56
63
|
displayName?: string;
|
|
@@ -60,6 +67,7 @@ export interface TenantOptionsServerRequest extends EmailSignInConfigServerReque
|
|
|
60
67
|
[key: string]: string;
|
|
61
68
|
};
|
|
62
69
|
smsRegionConfig?: SmsRegionConfig;
|
|
70
|
+
recaptchaConfig?: RecaptchaConfig;
|
|
63
71
|
}
|
|
64
72
|
/** The tenant server response interface. */
|
|
65
73
|
export interface TenantServerResponse {
|
|
@@ -73,6 +81,7 @@ export interface TenantServerResponse {
|
|
|
73
81
|
[key: string]: string;
|
|
74
82
|
};
|
|
75
83
|
smsRegionConfig?: SmsRegionConfig;
|
|
84
|
+
recaptchaConfig?: RecaptchaConfig;
|
|
76
85
|
}
|
|
77
86
|
/**
|
|
78
87
|
* Represents a tenant configuration.
|
|
@@ -112,6 +121,13 @@ export declare class Tenant {
|
|
|
112
121
|
};
|
|
113
122
|
private readonly emailSignInConfig_?;
|
|
114
123
|
private readonly multiFactorConfig_?;
|
|
124
|
+
/**
|
|
125
|
+
* The map conatining the reCAPTCHA config.
|
|
126
|
+
* By enabling reCAPTCHA Enterprise Integration you are
|
|
127
|
+
* agreeing to reCAPTCHA Enterprise
|
|
128
|
+
* {@link https://cloud.google.com/terms/service-terms | Term of Service}.
|
|
129
|
+
*/
|
|
130
|
+
private readonly recaptchaConfig_?;
|
|
115
131
|
/**
|
|
116
132
|
* The SMS Regions Config to update a tenant.
|
|
117
133
|
* Configures the regions where users are allowed to send verification SMS.
|
|
@@ -133,6 +149,10 @@ export declare class Tenant {
|
|
|
133
149
|
* The multi-factor auth configuration on the current tenant.
|
|
134
150
|
*/
|
|
135
151
|
get multiFactorConfig(): MultiFactorConfig | undefined;
|
|
152
|
+
/**
|
|
153
|
+
* The recaptcha config auth configuration of the current tenant.
|
|
154
|
+
*/
|
|
155
|
+
get recaptchaConfig(): RecaptchaConfig | undefined;
|
|
136
156
|
/**
|
|
137
157
|
* Returns a JSON-serializable representation of this object.
|
|
138
158
|
*
|
package/lib/auth/tenant.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v11.
|
|
1
|
+
/*! firebase-admin v11.7.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright 2019 Google Inc.
|
|
@@ -42,40 +42,6 @@ const auth_config_1 = require("./auth-config");
|
|
|
42
42
|
* from the Cloud Console UI.
|
|
43
43
|
*/
|
|
44
44
|
class Tenant {
|
|
45
|
-
/**
|
|
46
|
-
* The Tenant object constructor.
|
|
47
|
-
*
|
|
48
|
-
* @param response - The server side response used to initialize the Tenant object.
|
|
49
|
-
* @constructor
|
|
50
|
-
* @internal
|
|
51
|
-
*/
|
|
52
|
-
constructor(response) {
|
|
53
|
-
const tenantId = Tenant.getTenantIdFromResourceName(response.name);
|
|
54
|
-
if (!tenantId) {
|
|
55
|
-
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Invalid tenant response');
|
|
56
|
-
}
|
|
57
|
-
this.tenantId = tenantId;
|
|
58
|
-
this.displayName = response.displayName;
|
|
59
|
-
try {
|
|
60
|
-
this.emailSignInConfig_ = new auth_config_1.EmailSignInConfig(response);
|
|
61
|
-
}
|
|
62
|
-
catch (e) {
|
|
63
|
-
// If allowPasswordSignup is undefined, it is disabled by default.
|
|
64
|
-
this.emailSignInConfig_ = new auth_config_1.EmailSignInConfig({
|
|
65
|
-
allowPasswordSignup: false,
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
this.anonymousSignInEnabled = !!response.enableAnonymousUser;
|
|
69
|
-
if (typeof response.mfaConfig !== 'undefined') {
|
|
70
|
-
this.multiFactorConfig_ = new auth_config_1.MultiFactorAuthConfig(response.mfaConfig);
|
|
71
|
-
}
|
|
72
|
-
if (typeof response.testPhoneNumbers !== 'undefined') {
|
|
73
|
-
this.testPhoneNumbers = (0, deep_copy_1.deepCopy)(response.testPhoneNumbers || {});
|
|
74
|
-
}
|
|
75
|
-
if (typeof response.smsRegionConfig !== 'undefined') {
|
|
76
|
-
this.smsRegionConfig = (0, deep_copy_1.deepCopy)(response.smsRegionConfig);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
45
|
/**
|
|
80
46
|
* Builds the corresponding server request for a TenantOptions object.
|
|
81
47
|
*
|
|
@@ -107,6 +73,9 @@ class Tenant {
|
|
|
107
73
|
if (typeof tenantOptions.smsRegionConfig !== 'undefined') {
|
|
108
74
|
request.smsRegionConfig = tenantOptions.smsRegionConfig;
|
|
109
75
|
}
|
|
76
|
+
if (typeof tenantOptions.recaptchaConfig !== 'undefined') {
|
|
77
|
+
request.recaptchaConfig = tenantOptions.recaptchaConfig;
|
|
78
|
+
}
|
|
110
79
|
return request;
|
|
111
80
|
}
|
|
112
81
|
/**
|
|
@@ -139,6 +108,7 @@ class Tenant {
|
|
|
139
108
|
multiFactorConfig: true,
|
|
140
109
|
testPhoneNumbers: true,
|
|
141
110
|
smsRegionConfig: true,
|
|
111
|
+
recaptchaConfig: true,
|
|
142
112
|
};
|
|
143
113
|
const label = createRequest ? 'CreateTenantRequest' : 'UpdateTenantRequest';
|
|
144
114
|
if (!validator.isNonNullObject(request)) {
|
|
@@ -178,6 +148,47 @@ class Tenant {
|
|
|
178
148
|
if (typeof request.smsRegionConfig != 'undefined') {
|
|
179
149
|
auth_config_1.SmsRegionsAuthConfig.validate(request.smsRegionConfig);
|
|
180
150
|
}
|
|
151
|
+
// Validate reCAPTCHAConfig type if provided.
|
|
152
|
+
if (typeof request.recaptchaConfig !== 'undefined') {
|
|
153
|
+
auth_config_1.RecaptchaAuthConfig.validate(request.recaptchaConfig);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* The Tenant object constructor.
|
|
158
|
+
*
|
|
159
|
+
* @param response - The server side response used to initialize the Tenant object.
|
|
160
|
+
* @constructor
|
|
161
|
+
* @internal
|
|
162
|
+
*/
|
|
163
|
+
constructor(response) {
|
|
164
|
+
const tenantId = Tenant.getTenantIdFromResourceName(response.name);
|
|
165
|
+
if (!tenantId) {
|
|
166
|
+
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Invalid tenant response');
|
|
167
|
+
}
|
|
168
|
+
this.tenantId = tenantId;
|
|
169
|
+
this.displayName = response.displayName;
|
|
170
|
+
try {
|
|
171
|
+
this.emailSignInConfig_ = new auth_config_1.EmailSignInConfig(response);
|
|
172
|
+
}
|
|
173
|
+
catch (e) {
|
|
174
|
+
// If allowPasswordSignup is undefined, it is disabled by default.
|
|
175
|
+
this.emailSignInConfig_ = new auth_config_1.EmailSignInConfig({
|
|
176
|
+
allowPasswordSignup: false,
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
this.anonymousSignInEnabled = !!response.enableAnonymousUser;
|
|
180
|
+
if (typeof response.mfaConfig !== 'undefined') {
|
|
181
|
+
this.multiFactorConfig_ = new auth_config_1.MultiFactorAuthConfig(response.mfaConfig);
|
|
182
|
+
}
|
|
183
|
+
if (typeof response.testPhoneNumbers !== 'undefined') {
|
|
184
|
+
this.testPhoneNumbers = (0, deep_copy_1.deepCopy)(response.testPhoneNumbers || {});
|
|
185
|
+
}
|
|
186
|
+
if (typeof response.smsRegionConfig !== 'undefined') {
|
|
187
|
+
this.smsRegionConfig = (0, deep_copy_1.deepCopy)(response.smsRegionConfig);
|
|
188
|
+
}
|
|
189
|
+
if (typeof response.recaptchaConfig !== 'undefined') {
|
|
190
|
+
this.recaptchaConfig_ = new auth_config_1.RecaptchaAuthConfig(response.recaptchaConfig);
|
|
191
|
+
}
|
|
181
192
|
}
|
|
182
193
|
/**
|
|
183
194
|
* The email sign in provider configuration.
|
|
@@ -191,6 +202,12 @@ class Tenant {
|
|
|
191
202
|
get multiFactorConfig() {
|
|
192
203
|
return this.multiFactorConfig_;
|
|
193
204
|
}
|
|
205
|
+
/**
|
|
206
|
+
* The recaptcha config auth configuration of the current tenant.
|
|
207
|
+
*/
|
|
208
|
+
get recaptchaConfig() {
|
|
209
|
+
return this.recaptchaConfig_;
|
|
210
|
+
}
|
|
194
211
|
/**
|
|
195
212
|
* Returns a JSON-serializable representation of this object.
|
|
196
213
|
*
|
|
@@ -205,6 +222,7 @@ class Tenant {
|
|
|
205
222
|
anonymousSignInEnabled: this.anonymousSignInEnabled,
|
|
206
223
|
testPhoneNumbers: this.testPhoneNumbers,
|
|
207
224
|
smsRegionConfig: (0, deep_copy_1.deepCopy)(this.smsRegionConfig),
|
|
225
|
+
recaptchaConfig: this.recaptchaConfig_?.toJSON(),
|
|
208
226
|
};
|
|
209
227
|
if (typeof json.multiFactorConfig === 'undefined') {
|
|
210
228
|
delete json.multiFactorConfig;
|
|
@@ -215,6 +233,9 @@ class Tenant {
|
|
|
215
233
|
if (typeof json.smsRegionConfig === 'undefined') {
|
|
216
234
|
delete json.smsRegionConfig;
|
|
217
235
|
}
|
|
236
|
+
if (typeof json.recaptchaConfig === 'undefined') {
|
|
237
|
+
delete json.recaptchaConfig;
|
|
238
|
+
}
|
|
218
239
|
return json;
|
|
219
240
|
}
|
|
220
241
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v11.
|
|
1
|
+
/*! firebase-admin v11.7.0 */
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright 2018 Google Inc.
|
|
4
4
|
*
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
/// <reference types="node" />
|
|
18
18
|
import { FirebaseArrayIndexError } from '../app/index';
|
|
19
19
|
import { UpdateMultiFactorInfoRequest, MultiFactorUpdateSettings } from './auth-config';
|
|
20
|
-
export
|
|
20
|
+
export type HashAlgorithmType = 'SCRYPT' | 'STANDARD_SCRYPT' | 'HMAC_SHA512' | 'HMAC_SHA256' | 'HMAC_SHA1' | 'HMAC_MD5' | 'MD5' | 'PBKDF_SHA1' | 'BCRYPT' | 'PBKDF2_SHA256' | 'SHA512' | 'SHA256' | 'SHA1';
|
|
21
21
|
/**
|
|
22
22
|
* Interface representing the user import options needed for
|
|
23
23
|
* {@link BaseAuth.importUsers} method. This is used to
|
|
@@ -259,7 +259,7 @@ export interface UploadAccountRequest extends UploadAccountOptions {
|
|
|
259
259
|
users?: UploadAccountUser[];
|
|
260
260
|
}
|
|
261
261
|
/** Callback function to validate an UploadAccountUser object. */
|
|
262
|
-
export
|
|
262
|
+
export type ValidatorFunction = (data: UploadAccountUser) => void;
|
|
263
263
|
/**
|
|
264
264
|
* Converts a client format second factor object to server format.
|
|
265
265
|
* @param multiFactorInfo - The client format second factor.
|
package/lib/auth/user-record.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v11.
|
|
1
|
+
/*! firebase-admin v11.7.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* @license
|
|
@@ -52,16 +52,6 @@ var MultiFactorId;
|
|
|
52
52
|
* Interface representing the common properties of a user-enrolled second factor.
|
|
53
53
|
*/
|
|
54
54
|
class MultiFactorInfo {
|
|
55
|
-
/**
|
|
56
|
-
* Initializes the MultiFactorInfo object using the server side response.
|
|
57
|
-
*
|
|
58
|
-
* @param response - The server side response.
|
|
59
|
-
* @constructor
|
|
60
|
-
* @internal
|
|
61
|
-
*/
|
|
62
|
-
constructor(response) {
|
|
63
|
-
this.initFromServerResponse(response);
|
|
64
|
-
}
|
|
65
55
|
/**
|
|
66
56
|
* Initializes the MultiFactorInfo associated subclass using the server side.
|
|
67
57
|
* If no MultiFactorInfo is associated with the response, null is returned.
|
|
@@ -80,6 +70,16 @@ class MultiFactorInfo {
|
|
|
80
70
|
}
|
|
81
71
|
return multiFactorInfo;
|
|
82
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Initializes the MultiFactorInfo object using the server side response.
|
|
75
|
+
*
|
|
76
|
+
* @param response - The server side response.
|
|
77
|
+
* @constructor
|
|
78
|
+
* @internal
|
|
79
|
+
*/
|
|
80
|
+
constructor(response) {
|
|
81
|
+
this.initFromServerResponse(response);
|
|
82
|
+
}
|
|
83
83
|
/**
|
|
84
84
|
* Returns a JSON-serializable representation of this object.
|
|
85
85
|
*
|
package/lib/credential/index.js
CHANGED
package/lib/database/database.js
CHANGED
package/lib/database/index.d.ts
CHANGED
package/lib/database/index.js
CHANGED
package/lib/default-namespace.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v11.
|
|
1
|
+
/*! firebase-admin v11.7.0 */
|
|
2
2
|
/*!
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2022 Google Inc.
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
/**
|
|
19
19
|
* A CloudEvent version.
|
|
20
20
|
*/
|
|
21
|
-
export
|
|
21
|
+
export type CloudEventVersion = '1.0';
|
|
22
22
|
/**
|
|
23
23
|
* A CloudEvent describes event data.
|
|
24
24
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v11.
|
|
1
|
+
/*! firebase-admin v11.7.0 */
|
|
2
2
|
/*!
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2022 Google Inc.
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import { PrefixedFirebaseError } from '../utils/error';
|
|
19
19
|
import { CloudEvent } from './cloudevent';
|
|
20
|
-
export
|
|
20
|
+
export type EventarcErrorCode = 'unknown-error' | 'invalid-argument';
|
|
21
21
|
/**
|
|
22
22
|
* Firebase Eventarc error code structure. This extends PrefixedFirebaseError.
|
|
23
23
|
*
|
package/lib/eventarc/eventarc.js
CHANGED
package/lib/eventarc/index.d.ts
CHANGED
package/lib/eventarc/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v11.
|
|
1
|
+
/*! firebase-admin v11.7.0 */
|
|
2
2
|
/*!
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2022 Google Inc.
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
import { PrefixedFirebaseError } from '../utils/error';
|
|
19
|
-
|
|
19
|
+
type ExtensionsErrorCode = 'invalid-argument' | 'not-found' | 'forbidden' | 'internal-error' | 'unknown-error';
|
|
20
20
|
/**
|
|
21
21
|
* Firebase Extensions error code structure. This extends PrefixedFirebaseError.
|
|
22
22
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v11.
|
|
1
|
+
/*! firebase-admin v11.7.0 */
|
|
2
2
|
/*!
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2022 Google Inc.
|
|
@@ -41,4 +41,4 @@
|
|
|
41
41
|
* To report the ongoing status of an extension's function, use `console.log`
|
|
42
42
|
* or the Cloud Functions logger SDK.
|
|
43
43
|
*/
|
|
44
|
-
export
|
|
44
|
+
export type SettableProcessingState = 'NONE' | 'PROCESSING_COMPLETE' | 'PROCESSING_WARNING' | 'PROCESSING_FAILED';
|