firebase-admin 11.8.0 → 11.10.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 +1 -1
- 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 +1 -1
- 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 +2 -2
- package/lib/auth/auth-config.d.ts +76 -1
- package/lib/auth/auth-config.js +194 -4
- 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 +1 -1
- 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 +1 -1
- package/lib/auth/project-config-manager.js +1 -1
- package/lib/auth/project-config.d.ts +12 -2
- package/lib/auth/project-config.js +24 -8
- package/lib/auth/tenant-manager.d.ts +1 -1
- package/lib/auth/tenant-manager.js +1 -1
- package/lib/auth/tenant.d.ts +12 -2
- package/lib/auth/tenant.js +18 -2
- 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 +2 -2
- package/lib/auth/user-import-builder.d.ts +1 -1
- package/lib/auth/user-import-builder.js +1 -1
- package/lib/auth/user-record.d.ts +28 -4
- package/lib/auth/user-record.js +58 -6
- 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/esm/firestore/index.js +1 -0
- package/lib/esm/storage/index.js +1 -0
- package/lib/eventarc/cloudevent.d.ts +1 -1
- 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 +1 -1
- 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 +1 -1
- package/lib/extensions/extensions-api-client-internal.js +1 -1
- 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 +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 +2 -1
- package/lib/firestore/firestore-namespace.js +2 -1
- package/lib/firestore/index.d.ts +68 -24
- package/lib/firestore/index.js +3 -2
- package/lib/functions/functions-api-client-internal.d.ts +3 -2
- package/lib/functions/functions-api-client-internal.js +105 -27
- package/lib/functions/functions-api.d.ts +33 -1
- package/lib/functions/functions-api.js +1 -1
- package/lib/functions/functions.d.ts +7 -1
- package/lib/functions/functions.js +9 -1
- package/lib/functions/index.d.ts +2 -2
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- package/lib/messaging/messaging-api-request-internal.js +1 -1
- package/lib/messaging/messaging-api.d.ts +1 -1
- 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 +1 -1
- package/lib/messaging/messaging.js +1 -1
- 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 +1 -1
- 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 +1 -1
- package/lib/remote-config/remote-config-api-client-internal.js +3 -3
- 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-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 +1 -1
- 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 +14 -1
- package/lib/storage/index.js +29 -7
- 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/storage/utils.d.ts +20 -0
- package/lib/storage/utils.js +21 -0
- package/lib/utils/api-request.d.ts +1 -1
- package/lib/utils/api-request.js +1 -9
- 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 +1 -1
- package/lib/utils/error.js +1 -1
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +1 -1
- package/lib/utils/jwt.d.ts +1 -1
- package/lib/utils/jwt.js +1 -1
- package/lib/utils/validator.d.ts +9 -1
- package/lib/utils/validator.js +17 -2
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! firebase-admin v11.
|
|
2
|
-
import { SmsRegionConfig, MultiFactorConfig, MultiFactorAuthServerConfig, RecaptchaConfig } from './auth-config';
|
|
1
|
+
/*! firebase-admin v11.10.0 */
|
|
2
|
+
import { SmsRegionConfig, MultiFactorConfig, MultiFactorAuthServerConfig, RecaptchaConfig, PasswordPolicyAuthServerConfig, PasswordPolicyConfig } from './auth-config';
|
|
3
3
|
/**
|
|
4
4
|
* Interface representing the properties to update on the provided project config.
|
|
5
5
|
*/
|
|
@@ -19,6 +19,10 @@ export interface UpdateProjectConfigRequest {
|
|
|
19
19
|
* {@link https://cloud.google.com/terms/service-terms | Term of Service}.
|
|
20
20
|
*/
|
|
21
21
|
recaptchaConfig?: RecaptchaConfig;
|
|
22
|
+
/**
|
|
23
|
+
* The password policy configuration to update on the project
|
|
24
|
+
*/
|
|
25
|
+
passwordPolicyConfig?: PasswordPolicyConfig;
|
|
22
26
|
}
|
|
23
27
|
/**
|
|
24
28
|
* Response received when getting or updating the project config.
|
|
@@ -27,6 +31,7 @@ export interface ProjectConfigServerResponse {
|
|
|
27
31
|
smsRegionConfig?: SmsRegionConfig;
|
|
28
32
|
mfa?: MultiFactorAuthServerConfig;
|
|
29
33
|
recaptchaConfig?: RecaptchaConfig;
|
|
34
|
+
passwordPolicyConfig?: PasswordPolicyAuthServerConfig;
|
|
30
35
|
}
|
|
31
36
|
/**
|
|
32
37
|
* Request to update the project config.
|
|
@@ -35,6 +40,7 @@ export interface ProjectConfigClientRequest {
|
|
|
35
40
|
smsRegionConfig?: SmsRegionConfig;
|
|
36
41
|
mfa?: MultiFactorAuthServerConfig;
|
|
37
42
|
recaptchaConfig?: RecaptchaConfig;
|
|
43
|
+
passwordPolicyConfig?: PasswordPolicyAuthServerConfig;
|
|
38
44
|
}
|
|
39
45
|
/**
|
|
40
46
|
* Represents a project configuration.
|
|
@@ -62,6 +68,10 @@ export declare class ProjectConfig {
|
|
|
62
68
|
* The multi-factor auth configuration.
|
|
63
69
|
*/
|
|
64
70
|
get multiFactorConfig(): MultiFactorConfig | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* The password policy configuration for the project
|
|
73
|
+
*/
|
|
74
|
+
readonly passwordPolicyConfig?: PasswordPolicyConfig;
|
|
65
75
|
/**
|
|
66
76
|
* Validates a project config options object. Throws an error on failure.
|
|
67
77
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v11.
|
|
1
|
+
/*! firebase-admin v11.10.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.ProjectConfig = void 0;
|
|
@@ -44,6 +44,7 @@ class ProjectConfig {
|
|
|
44
44
|
smsRegionConfig: true,
|
|
45
45
|
multiFactorConfig: true,
|
|
46
46
|
recaptchaConfig: true,
|
|
47
|
+
passwordPolicyConfig: true,
|
|
47
48
|
};
|
|
48
49
|
// Check for unsupported top level attributes.
|
|
49
50
|
for (const key in request) {
|
|
@@ -63,6 +64,10 @@ class ProjectConfig {
|
|
|
63
64
|
if (typeof request.recaptchaConfig !== 'undefined') {
|
|
64
65
|
auth_config_1.RecaptchaAuthConfig.validate(request.recaptchaConfig);
|
|
65
66
|
}
|
|
67
|
+
// Validate Password policy Config if provided
|
|
68
|
+
if (typeof request.passwordPolicyConfig !== 'undefined') {
|
|
69
|
+
auth_config_1.PasswordPolicyAuthConfig.validate(request.passwordPolicyConfig);
|
|
70
|
+
}
|
|
66
71
|
}
|
|
67
72
|
/**
|
|
68
73
|
* Build the corresponding server request for a UpdateProjectConfigRequest object.
|
|
@@ -73,15 +78,19 @@ class ProjectConfig {
|
|
|
73
78
|
*/
|
|
74
79
|
static buildServerRequest(configOptions) {
|
|
75
80
|
ProjectConfig.validate(configOptions);
|
|
76
|
-
const request =
|
|
77
|
-
if (configOptions.
|
|
81
|
+
const request = {};
|
|
82
|
+
if (typeof configOptions.smsRegionConfig !== 'undefined') {
|
|
83
|
+
request.smsRegionConfig = configOptions.smsRegionConfig;
|
|
84
|
+
}
|
|
85
|
+
if (typeof configOptions.multiFactorConfig !== 'undefined') {
|
|
78
86
|
request.mfa = auth_config_1.MultiFactorAuthConfig.buildServerRequest(configOptions.multiFactorConfig);
|
|
79
87
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
88
|
+
if (typeof configOptions.recaptchaConfig !== 'undefined') {
|
|
89
|
+
request.recaptchaConfig = configOptions.recaptchaConfig;
|
|
90
|
+
}
|
|
91
|
+
if (typeof configOptions.passwordPolicyConfig !== 'undefined') {
|
|
92
|
+
request.passwordPolicyConfig = auth_config_1.PasswordPolicyAuthConfig.buildServerRequest(configOptions.passwordPolicyConfig);
|
|
93
|
+
}
|
|
85
94
|
return request;
|
|
86
95
|
}
|
|
87
96
|
/**
|
|
@@ -109,6 +118,9 @@ class ProjectConfig {
|
|
|
109
118
|
if (typeof response.recaptchaConfig !== 'undefined') {
|
|
110
119
|
this.recaptchaConfig_ = new auth_config_1.RecaptchaAuthConfig(response.recaptchaConfig);
|
|
111
120
|
}
|
|
121
|
+
if (typeof response.passwordPolicyConfig !== 'undefined') {
|
|
122
|
+
this.passwordPolicyConfig = new auth_config_1.PasswordPolicyAuthConfig(response.passwordPolicyConfig);
|
|
123
|
+
}
|
|
112
124
|
}
|
|
113
125
|
/**
|
|
114
126
|
* Returns a JSON-serializable representation of this object.
|
|
@@ -121,6 +133,7 @@ class ProjectConfig {
|
|
|
121
133
|
smsRegionConfig: (0, deep_copy_1.deepCopy)(this.smsRegionConfig),
|
|
122
134
|
multiFactorConfig: (0, deep_copy_1.deepCopy)(this.multiFactorConfig),
|
|
123
135
|
recaptchaConfig: this.recaptchaConfig_?.toJSON(),
|
|
136
|
+
passwordPolicyConfig: (0, deep_copy_1.deepCopy)(this.passwordPolicyConfig),
|
|
124
137
|
};
|
|
125
138
|
if (typeof json.smsRegionConfig === 'undefined') {
|
|
126
139
|
delete json.smsRegionConfig;
|
|
@@ -131,6 +144,9 @@ class ProjectConfig {
|
|
|
131
144
|
if (typeof json.recaptchaConfig === 'undefined') {
|
|
132
145
|
delete json.recaptchaConfig;
|
|
133
146
|
}
|
|
147
|
+
if (typeof json.passwordPolicyConfig === 'undefined') {
|
|
148
|
+
delete json.passwordPolicyConfig;
|
|
149
|
+
}
|
|
134
150
|
return json;
|
|
135
151
|
}
|
|
136
152
|
}
|
package/lib/auth/tenant.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v11.
|
|
1
|
+
/*! firebase-admin v11.10.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, RecaptchaConfig } from './auth-config';
|
|
17
|
+
import { EmailSignInConfigServerRequest, MultiFactorAuthServerConfig, MultiFactorConfig, EmailSignInProviderConfig, SmsRegionConfig, RecaptchaConfig, PasswordPolicyConfig, PasswordPolicyAuthServerConfig } from './auth-config';
|
|
18
18
|
/**
|
|
19
19
|
* Interface representing the properties to update on the provided tenant.
|
|
20
20
|
*/
|
|
@@ -53,6 +53,10 @@ export interface UpdateTenantRequest {
|
|
|
53
53
|
* {@link https://cloud.google.com/terms/service-terms | Term of Service}.
|
|
54
54
|
*/
|
|
55
55
|
recaptchaConfig?: RecaptchaConfig;
|
|
56
|
+
/**
|
|
57
|
+
* The password policy configuration for the tenant
|
|
58
|
+
*/
|
|
59
|
+
passwordPolicyConfig?: PasswordPolicyConfig;
|
|
56
60
|
}
|
|
57
61
|
/**
|
|
58
62
|
* Interface representing the properties to set on a new tenant.
|
|
@@ -68,6 +72,7 @@ export interface TenantOptionsServerRequest extends EmailSignInConfigServerReque
|
|
|
68
72
|
};
|
|
69
73
|
smsRegionConfig?: SmsRegionConfig;
|
|
70
74
|
recaptchaConfig?: RecaptchaConfig;
|
|
75
|
+
passwordPolicyConfig?: PasswordPolicyAuthServerConfig;
|
|
71
76
|
}
|
|
72
77
|
/** The tenant server response interface. */
|
|
73
78
|
export interface TenantServerResponse {
|
|
@@ -82,6 +87,7 @@ export interface TenantServerResponse {
|
|
|
82
87
|
};
|
|
83
88
|
smsRegionConfig?: SmsRegionConfig;
|
|
84
89
|
recaptchaConfig?: RecaptchaConfig;
|
|
90
|
+
passwordPolicyConfig?: PasswordPolicyAuthServerConfig;
|
|
85
91
|
}
|
|
86
92
|
/**
|
|
87
93
|
* Represents a tenant configuration.
|
|
@@ -134,6 +140,10 @@ export declare class Tenant {
|
|
|
134
140
|
* This is based on the calling code of the destination phone number.
|
|
135
141
|
*/
|
|
136
142
|
readonly smsRegionConfig?: SmsRegionConfig;
|
|
143
|
+
/**
|
|
144
|
+
* The password policy configuration for the tenant
|
|
145
|
+
*/
|
|
146
|
+
readonly passwordPolicyConfig?: PasswordPolicyConfig;
|
|
137
147
|
/**
|
|
138
148
|
* Validates a tenant options object. Throws an error on failure.
|
|
139
149
|
*
|
package/lib/auth/tenant.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v11.
|
|
1
|
+
/*! firebase-admin v11.10.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright 2019 Google Inc.
|
|
@@ -76,6 +76,9 @@ class Tenant {
|
|
|
76
76
|
if (typeof tenantOptions.recaptchaConfig !== 'undefined') {
|
|
77
77
|
request.recaptchaConfig = tenantOptions.recaptchaConfig;
|
|
78
78
|
}
|
|
79
|
+
if (typeof tenantOptions.passwordPolicyConfig !== 'undefined') {
|
|
80
|
+
request.passwordPolicyConfig = auth_config_1.PasswordPolicyAuthConfig.buildServerRequest(tenantOptions.passwordPolicyConfig);
|
|
81
|
+
}
|
|
79
82
|
return request;
|
|
80
83
|
}
|
|
81
84
|
/**
|
|
@@ -109,6 +112,7 @@ class Tenant {
|
|
|
109
112
|
testPhoneNumbers: true,
|
|
110
113
|
smsRegionConfig: true,
|
|
111
114
|
recaptchaConfig: true,
|
|
115
|
+
passwordPolicyConfig: true,
|
|
112
116
|
};
|
|
113
117
|
const label = createRequest ? 'CreateTenantRequest' : 'UpdateTenantRequest';
|
|
114
118
|
if (!validator.isNonNullObject(request)) {
|
|
@@ -145,13 +149,18 @@ class Tenant {
|
|
|
145
149
|
auth_config_1.MultiFactorAuthConfig.buildServerRequest(request.multiFactorConfig);
|
|
146
150
|
}
|
|
147
151
|
// Validate SMS Regions Config if provided.
|
|
148
|
-
if (typeof request.smsRegionConfig
|
|
152
|
+
if (typeof request.smsRegionConfig !== 'undefined') {
|
|
149
153
|
auth_config_1.SmsRegionsAuthConfig.validate(request.smsRegionConfig);
|
|
150
154
|
}
|
|
151
155
|
// Validate reCAPTCHAConfig type if provided.
|
|
152
156
|
if (typeof request.recaptchaConfig !== 'undefined') {
|
|
153
157
|
auth_config_1.RecaptchaAuthConfig.validate(request.recaptchaConfig);
|
|
154
158
|
}
|
|
159
|
+
// Validate passwordPolicyConfig type if provided.
|
|
160
|
+
if (typeof request.passwordPolicyConfig !== 'undefined') {
|
|
161
|
+
// This will throw an error if invalid.
|
|
162
|
+
auth_config_1.PasswordPolicyAuthConfig.buildServerRequest(request.passwordPolicyConfig);
|
|
163
|
+
}
|
|
155
164
|
}
|
|
156
165
|
/**
|
|
157
166
|
* The Tenant object constructor.
|
|
@@ -189,6 +198,9 @@ class Tenant {
|
|
|
189
198
|
if (typeof response.recaptchaConfig !== 'undefined') {
|
|
190
199
|
this.recaptchaConfig_ = new auth_config_1.RecaptchaAuthConfig(response.recaptchaConfig);
|
|
191
200
|
}
|
|
201
|
+
if (typeof response.passwordPolicyConfig !== 'undefined') {
|
|
202
|
+
this.passwordPolicyConfig = new auth_config_1.PasswordPolicyAuthConfig(response.passwordPolicyConfig);
|
|
203
|
+
}
|
|
192
204
|
}
|
|
193
205
|
/**
|
|
194
206
|
* The email sign in provider configuration.
|
|
@@ -223,6 +235,7 @@ class Tenant {
|
|
|
223
235
|
testPhoneNumbers: this.testPhoneNumbers,
|
|
224
236
|
smsRegionConfig: (0, deep_copy_1.deepCopy)(this.smsRegionConfig),
|
|
225
237
|
recaptchaConfig: this.recaptchaConfig_?.toJSON(),
|
|
238
|
+
passwordPolicyConfig: (0, deep_copy_1.deepCopy)(this.passwordPolicyConfig),
|
|
226
239
|
};
|
|
227
240
|
if (typeof json.multiFactorConfig === 'undefined') {
|
|
228
241
|
delete json.multiFactorConfig;
|
|
@@ -236,6 +249,9 @@ class Tenant {
|
|
|
236
249
|
if (typeof json.recaptchaConfig === 'undefined') {
|
|
237
250
|
delete json.recaptchaConfig;
|
|
238
251
|
}
|
|
252
|
+
if (typeof json.passwordPolicyConfig === 'undefined') {
|
|
253
|
+
delete json.passwordPolicyConfig;
|
|
254
|
+
}
|
|
239
255
|
return json;
|
|
240
256
|
}
|
|
241
257
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v11.
|
|
1
|
+
/*! firebase-admin v11.10.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright 2018 Google Inc.
|
|
@@ -165,7 +165,7 @@ class FirebaseTokenVerifier {
|
|
|
165
165
|
safeDecode(jwtToken) {
|
|
166
166
|
return (0, jwt_1.decodeJwt)(jwtToken)
|
|
167
167
|
.catch((err) => {
|
|
168
|
-
if (err.code
|
|
168
|
+
if (err.code === jwt_1.JwtErrorCode.INVALID_ARGUMENT) {
|
|
169
169
|
const verifyJwtTokenDocsMessage = ` See ${this.tokenInfo.url} ` +
|
|
170
170
|
`for details on how to retrieve ${this.shortNameArticle} ${this.tokenInfo.shortName}.`;
|
|
171
171
|
const errorMessage = `Decoding ${this.tokenInfo.jwtName} failed. Make sure you passed ` +
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v11.
|
|
1
|
+
/*! firebase-admin v11.10.0 */
|
|
2
2
|
/*!
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2017 Google Inc.
|
|
@@ -19,8 +19,12 @@ export interface MultiFactorInfoResponse {
|
|
|
19
19
|
mfaEnrollmentId: string;
|
|
20
20
|
displayName?: string;
|
|
21
21
|
phoneInfo?: string;
|
|
22
|
+
totpInfo?: TotpInfoResponse;
|
|
22
23
|
enrolledAt?: string;
|
|
23
|
-
[key: string]:
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
}
|
|
26
|
+
export interface TotpInfoResponse {
|
|
27
|
+
[key: string]: unknown;
|
|
24
28
|
}
|
|
25
29
|
export interface ProviderUserInfoResponse {
|
|
26
30
|
rawId: string;
|
|
@@ -64,7 +68,9 @@ export declare abstract class MultiFactorInfo {
|
|
|
64
68
|
*/
|
|
65
69
|
readonly displayName?: string;
|
|
66
70
|
/**
|
|
67
|
-
* The type identifier of the second factor.
|
|
71
|
+
* The type identifier of the second factor.
|
|
72
|
+
* For SMS second factors, this is `phone`.
|
|
73
|
+
* For TOTP second factors, this is `totp`.
|
|
68
74
|
*/
|
|
69
75
|
readonly factorId: string;
|
|
70
76
|
/**
|
|
@@ -97,13 +103,31 @@ export declare class PhoneMultiFactorInfo extends MultiFactorInfo {
|
|
|
97
103
|
*/
|
|
98
104
|
toJSON(): object;
|
|
99
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* `TotpInfo` struct associated with a second factor
|
|
108
|
+
*/
|
|
109
|
+
export declare class TotpInfo {
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Interface representing a TOTP specific user-enrolled second factor.
|
|
113
|
+
*/
|
|
114
|
+
export declare class TotpMultiFactorInfo extends MultiFactorInfo {
|
|
115
|
+
/**
|
|
116
|
+
* `TotpInfo` struct associated with a second factor
|
|
117
|
+
*/
|
|
118
|
+
readonly totpInfo: TotpInfo;
|
|
119
|
+
/**
|
|
120
|
+
* {@inheritdoc MultiFactorInfo.toJSON}
|
|
121
|
+
*/
|
|
122
|
+
toJSON(): object;
|
|
123
|
+
}
|
|
100
124
|
/**
|
|
101
125
|
* The multi-factor related user settings.
|
|
102
126
|
*/
|
|
103
127
|
export declare class MultiFactorSettings {
|
|
104
128
|
/**
|
|
105
129
|
* List of second factors enrolled with the current user.
|
|
106
|
-
* Currently only phone second factors are supported.
|
|
130
|
+
* Currently only phone and TOTP second factors are supported.
|
|
107
131
|
*/
|
|
108
132
|
enrolledFactors: MultiFactorInfo[];
|
|
109
133
|
/**
|
package/lib/auth/user-record.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v11.
|
|
1
|
+
/*! firebase-admin v11.10.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* @license
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* limitations under the License.
|
|
18
18
|
*/
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.UserRecord = exports.UserInfo = exports.UserMetadata = exports.MultiFactorSettings = exports.PhoneMultiFactorInfo = exports.MultiFactorInfo = void 0;
|
|
20
|
+
exports.UserRecord = exports.UserInfo = exports.UserMetadata = exports.MultiFactorSettings = exports.TotpMultiFactorInfo = exports.TotpInfo = exports.PhoneMultiFactorInfo = exports.MultiFactorInfo = void 0;
|
|
21
21
|
const deep_copy_1 = require("../utils/deep-copy");
|
|
22
22
|
const validator_1 = require("../utils/validator");
|
|
23
23
|
const utils = require("../utils");
|
|
@@ -47,6 +47,7 @@ function parseDate(time) {
|
|
|
47
47
|
var MultiFactorId;
|
|
48
48
|
(function (MultiFactorId) {
|
|
49
49
|
MultiFactorId["Phone"] = "phone";
|
|
50
|
+
MultiFactorId["Totp"] = "totp";
|
|
50
51
|
})(MultiFactorId || (MultiFactorId = {}));
|
|
51
52
|
/**
|
|
52
53
|
* Interface representing the common properties of a user-enrolled second factor.
|
|
@@ -61,9 +62,17 @@ class MultiFactorInfo {
|
|
|
61
62
|
*/
|
|
62
63
|
static initMultiFactorInfo(response) {
|
|
63
64
|
let multiFactorInfo = null;
|
|
64
|
-
//
|
|
65
|
+
// PhoneMultiFactorInfo, TotpMultiFactorInfo currently available.
|
|
65
66
|
try {
|
|
66
|
-
|
|
67
|
+
if (response.phoneInfo !== undefined) {
|
|
68
|
+
multiFactorInfo = new PhoneMultiFactorInfo(response);
|
|
69
|
+
}
|
|
70
|
+
else if (response.totpInfo !== undefined) {
|
|
71
|
+
multiFactorInfo = new TotpMultiFactorInfo(response);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
// Ignore the other SDK unsupported MFA factors to prevent blocking developers using the current SDK.
|
|
75
|
+
}
|
|
67
76
|
}
|
|
68
77
|
catch (e) {
|
|
69
78
|
// Ignore error.
|
|
@@ -156,12 +165,55 @@ class PhoneMultiFactorInfo extends MultiFactorInfo {
|
|
|
156
165
|
}
|
|
157
166
|
}
|
|
158
167
|
exports.PhoneMultiFactorInfo = PhoneMultiFactorInfo;
|
|
168
|
+
/**
|
|
169
|
+
* `TotpInfo` struct associated with a second factor
|
|
170
|
+
*/
|
|
171
|
+
class TotpInfo {
|
|
172
|
+
}
|
|
173
|
+
exports.TotpInfo = TotpInfo;
|
|
174
|
+
/**
|
|
175
|
+
* Interface representing a TOTP specific user-enrolled second factor.
|
|
176
|
+
*/
|
|
177
|
+
class TotpMultiFactorInfo extends MultiFactorInfo {
|
|
178
|
+
/**
|
|
179
|
+
* Initializes the `TotpMultiFactorInfo` object using the server side response.
|
|
180
|
+
*
|
|
181
|
+
* @param response - The server side response.
|
|
182
|
+
* @constructor
|
|
183
|
+
* @internal
|
|
184
|
+
*/
|
|
185
|
+
constructor(response) {
|
|
186
|
+
super(response);
|
|
187
|
+
utils.addReadonlyGetter(this, 'totpInfo', response.totpInfo);
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* {@inheritdoc MultiFactorInfo.toJSON}
|
|
191
|
+
*/
|
|
192
|
+
toJSON() {
|
|
193
|
+
return Object.assign(super.toJSON(), {
|
|
194
|
+
totpInfo: this.totpInfo,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Returns the factor ID based on the response provided.
|
|
199
|
+
*
|
|
200
|
+
* @param response - The server side response.
|
|
201
|
+
* @returns The multi-factor ID associated with the provided response. If the response is
|
|
202
|
+
* not associated with any known multi-factor ID, `null` is returned.
|
|
203
|
+
*
|
|
204
|
+
* @internal
|
|
205
|
+
*/
|
|
206
|
+
getFactorId(response) {
|
|
207
|
+
return (response && response.totpInfo) ? MultiFactorId.Totp : null;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
exports.TotpMultiFactorInfo = TotpMultiFactorInfo;
|
|
159
211
|
/**
|
|
160
212
|
* The multi-factor related user settings.
|
|
161
213
|
*/
|
|
162
214
|
class MultiFactorSettings {
|
|
163
215
|
/**
|
|
164
|
-
* Initializes the MultiFactor object using the server side or JWT format response.
|
|
216
|
+
* Initializes the `MultiFactor` object using the server side or JWT format response.
|
|
165
217
|
*
|
|
166
218
|
* @param response - The server side response.
|
|
167
219
|
* @constructor
|
|
@@ -200,7 +252,7 @@ exports.MultiFactorSettings = MultiFactorSettings;
|
|
|
200
252
|
*/
|
|
201
253
|
class UserMetadata {
|
|
202
254
|
/**
|
|
203
|
-
* @param response - The server side response returned from the getAccountInfo
|
|
255
|
+
* @param response - The server side response returned from the `getAccountInfo`
|
|
204
256
|
* endpoint.
|
|
205
257
|
* @constructor
|
|
206
258
|
* @internal
|
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
|
@@ -8,6 +8,7 @@ export const DocumentReference = mod.DocumentReference;
|
|
|
8
8
|
export const DocumentSnapshot = mod.DocumentSnapshot;
|
|
9
9
|
export const FieldPath = mod.FieldPath;
|
|
10
10
|
export const FieldValue = mod.FieldValue;
|
|
11
|
+
export const Filter = mod.Filter;
|
|
11
12
|
export const Firestore = mod.Firestore;
|
|
12
13
|
export const GeoPoint = mod.GeoPoint;
|
|
13
14
|
export const GrpcStatus = mod.GrpcStatus;
|
package/lib/esm/storage/index.js
CHANGED
package/lib/eventarc/eventarc.js
CHANGED
package/lib/eventarc/index.d.ts
CHANGED
package/lib/eventarc/index.js
CHANGED