firebase-admin 11.5.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 +120 -21
- package/lib/auth/auth-config.js +279 -112
- 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 +39 -6
- package/lib/auth/project-config.js +58 -11
- 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 +11 -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 +52 -6
- package/lib/messaging/messaging.js +120 -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 +10 -10
package/lib/app/core.d.ts
CHANGED
package/lib/app/core.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
|
|
@@ -115,6 +115,15 @@ exports.ServiceAccountCredential = ServiceAccountCredential;
|
|
|
115
115
|
* A struct containing the properties necessary to use service account JSON credentials.
|
|
116
116
|
*/
|
|
117
117
|
class ServiceAccount {
|
|
118
|
+
static fromPath(filePath) {
|
|
119
|
+
try {
|
|
120
|
+
return new ServiceAccount(JSON.parse(fs.readFileSync(filePath, 'utf8')));
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
// Throw a nicely formed error message if the file contents cannot be parsed
|
|
124
|
+
throw new error_1.FirebaseAppError(error_1.AppErrorCodes.INVALID_CREDENTIAL, 'Failed to parse service account json file: ' + error);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
118
127
|
constructor(json) {
|
|
119
128
|
if (!util.isNonNullObject(json)) {
|
|
120
129
|
throw new error_1.FirebaseAppError(error_1.AppErrorCodes.INVALID_CREDENTIAL, 'Service account must be an object.');
|
|
@@ -144,15 +153,6 @@ class ServiceAccount {
|
|
|
144
153
|
throw new error_1.FirebaseAppError(error_1.AppErrorCodes.INVALID_CREDENTIAL, 'Failed to parse private key: ' + error);
|
|
145
154
|
}
|
|
146
155
|
}
|
|
147
|
-
static fromPath(filePath) {
|
|
148
|
-
try {
|
|
149
|
-
return new ServiceAccount(JSON.parse(fs.readFileSync(filePath, 'utf8')));
|
|
150
|
-
}
|
|
151
|
-
catch (error) {
|
|
152
|
-
// Throw a nicely formed error message if the file contents cannot be parsed
|
|
153
|
-
throw new error_1.FirebaseAppError(error_1.AppErrorCodes.INVALID_CREDENTIAL, 'Failed to parse service account json file: ' + error);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
156
|
}
|
|
157
157
|
/**
|
|
158
158
|
* Implementation of Credential that gets access tokens from the metadata service available
|
|
@@ -261,6 +261,19 @@ class RefreshTokenCredential {
|
|
|
261
261
|
}
|
|
262
262
|
exports.RefreshTokenCredential = RefreshTokenCredential;
|
|
263
263
|
class RefreshToken {
|
|
264
|
+
/*
|
|
265
|
+
* Tries to load a RefreshToken from a path. Throws if the path doesn't exist or the
|
|
266
|
+
* data at the path is invalid.
|
|
267
|
+
*/
|
|
268
|
+
static fromPath(filePath) {
|
|
269
|
+
try {
|
|
270
|
+
return new RefreshToken(JSON.parse(fs.readFileSync(filePath, 'utf8')));
|
|
271
|
+
}
|
|
272
|
+
catch (error) {
|
|
273
|
+
// Throw a nicely formed error message if the file contents cannot be parsed
|
|
274
|
+
throw new error_1.FirebaseAppError(error_1.AppErrorCodes.INVALID_CREDENTIAL, 'Failed to parse refresh token file: ' + error);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
264
277
|
constructor(json) {
|
|
265
278
|
copyAttr(this, json, 'clientId', 'client_id');
|
|
266
279
|
copyAttr(this, json, 'clientSecret', 'client_secret');
|
|
@@ -283,19 +296,6 @@ class RefreshToken {
|
|
|
283
296
|
throw new error_1.FirebaseAppError(error_1.AppErrorCodes.INVALID_CREDENTIAL, errorMessage);
|
|
284
297
|
}
|
|
285
298
|
}
|
|
286
|
-
/*
|
|
287
|
-
* Tries to load a RefreshToken from a path. Throws if the path doesn't exist or the
|
|
288
|
-
* data at the path is invalid.
|
|
289
|
-
*/
|
|
290
|
-
static fromPath(filePath) {
|
|
291
|
-
try {
|
|
292
|
-
return new RefreshToken(JSON.parse(fs.readFileSync(filePath, 'utf8')));
|
|
293
|
-
}
|
|
294
|
-
catch (error) {
|
|
295
|
-
// Throw a nicely formed error message if the file contents cannot be parsed
|
|
296
|
-
throw new error_1.FirebaseAppError(error_1.AppErrorCodes.INVALID_CREDENTIAL, 'Failed to parse refresh token file: ' + error);
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
299
|
}
|
|
300
300
|
/**
|
|
301
301
|
* Implementation of Credential that uses impersonated service account.
|
|
@@ -342,6 +342,19 @@ exports.ImpersonatedServiceAccountCredential = ImpersonatedServiceAccountCredent
|
|
|
342
342
|
* A struct containing the properties necessary to use impersonated service account JSON credentials.
|
|
343
343
|
*/
|
|
344
344
|
class ImpersonatedServiceAccount {
|
|
345
|
+
/*
|
|
346
|
+
* Tries to load a ImpersonatedServiceAccount from a path. Throws if the path doesn't exist or the
|
|
347
|
+
* data at the path is invalid.
|
|
348
|
+
*/
|
|
349
|
+
static fromPath(filePath) {
|
|
350
|
+
try {
|
|
351
|
+
return new ImpersonatedServiceAccount(JSON.parse(fs.readFileSync(filePath, 'utf8')));
|
|
352
|
+
}
|
|
353
|
+
catch (error) {
|
|
354
|
+
// Throw a nicely formed error message if the file contents cannot be parsed
|
|
355
|
+
throw new error_1.FirebaseAppError(error_1.AppErrorCodes.INVALID_CREDENTIAL, 'Failed to parse impersonated service account file: ' + error);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
345
358
|
constructor(json) {
|
|
346
359
|
const sourceCredentials = json['source_credentials'];
|
|
347
360
|
if (sourceCredentials) {
|
|
@@ -367,19 +380,6 @@ class ImpersonatedServiceAccount {
|
|
|
367
380
|
throw new error_1.FirebaseAppError(error_1.AppErrorCodes.INVALID_CREDENTIAL, errorMessage);
|
|
368
381
|
}
|
|
369
382
|
}
|
|
370
|
-
/*
|
|
371
|
-
* Tries to load a ImpersonatedServiceAccount from a path. Throws if the path doesn't exist or the
|
|
372
|
-
* data at the path is invalid.
|
|
373
|
-
*/
|
|
374
|
-
static fromPath(filePath) {
|
|
375
|
-
try {
|
|
376
|
-
return new ImpersonatedServiceAccount(JSON.parse(fs.readFileSync(filePath, 'utf8')));
|
|
377
|
-
}
|
|
378
|
-
catch (error) {
|
|
379
|
-
// Throw a nicely formed error message if the file contents cannot be parsed
|
|
380
|
-
throw new error_1.FirebaseAppError(error_1.AppErrorCodes.INVALID_CREDENTIAL, 'Failed to parse impersonated service account file: ' + error);
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
383
|
}
|
|
384
384
|
/**
|
|
385
385
|
* Checks if the given credential was loaded via the application default credentials mechanism. This
|
package/lib/app/credential.d.ts
CHANGED
package/lib/app/credential.js
CHANGED
package/lib/app/firebase-app.js
CHANGED
package/lib/app/index.d.ts
CHANGED
package/lib/app/index.js
CHANGED
package/lib/app/lifecycle.d.ts
CHANGED
package/lib/app/lifecycle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v11.
|
|
1
|
+
/*! firebase-admin v11.7.0 */
|
|
2
2
|
/*!
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2021 Google Inc.
|
|
@@ -19,7 +19,7 @@ import { PrefixedFirebaseError } from '../utils/error';
|
|
|
19
19
|
export declare const APP_CHECK_ERROR_CODE_MAPPING: {
|
|
20
20
|
[key: string]: AppCheckErrorCode;
|
|
21
21
|
};
|
|
22
|
-
export
|
|
22
|
+
export type AppCheckErrorCode = 'aborted' | 'invalid-argument' | 'invalid-credential' | 'internal-error' | 'permission-denied' | 'unauthenticated' | 'not-found' | 'app-check-token-expired' | 'unknown-error';
|
|
23
23
|
/**
|
|
24
24
|
* Firebase App Check error code structure. This extends PrefixedFirebaseError.
|
|
25
25
|
*
|
package/lib/app-check/index.d.ts
CHANGED
package/lib/app-check/index.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
|
|
@@ -813,17 +813,6 @@ const LIST_INBOUND_SAML_CONFIGS = new api_request_1.ApiSettings('/inboundSamlCon
|
|
|
813
813
|
* @internal
|
|
814
814
|
*/
|
|
815
815
|
class AbstractAuthRequestHandler {
|
|
816
|
-
/**
|
|
817
|
-
* @param app - The app used to fetch access tokens to sign API requests.
|
|
818
|
-
* @constructor
|
|
819
|
-
*/
|
|
820
|
-
constructor(app) {
|
|
821
|
-
this.app = app;
|
|
822
|
-
if (typeof app !== 'object' || app === null || !('options' in app)) {
|
|
823
|
-
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INVALID_ARGUMENT, 'First argument passed to admin.auth() must be a valid Firebase app instance.');
|
|
824
|
-
}
|
|
825
|
-
this.httpClient = new AuthHttpClient(app);
|
|
826
|
-
}
|
|
827
816
|
/**
|
|
828
817
|
* @param response - The response to check for errors.
|
|
829
818
|
* @returns The error code if present; null otherwise.
|
|
@@ -868,6 +857,17 @@ class AbstractAuthRequestHandler {
|
|
|
868
857
|
: request.federatedUserId = [federatedUserId];
|
|
869
858
|
return request;
|
|
870
859
|
}
|
|
860
|
+
/**
|
|
861
|
+
* @param app - The app used to fetch access tokens to sign API requests.
|
|
862
|
+
* @constructor
|
|
863
|
+
*/
|
|
864
|
+
constructor(app) {
|
|
865
|
+
this.app = app;
|
|
866
|
+
if (typeof app !== 'object' || app === null || !('options' in app)) {
|
|
867
|
+
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INVALID_ARGUMENT, 'First argument passed to admin.auth() must be a valid Firebase app instance.');
|
|
868
|
+
}
|
|
869
|
+
this.httpClient = new AuthHttpClient(app);
|
|
870
|
+
}
|
|
871
871
|
/**
|
|
872
872
|
* Creates a new Firebase session cookie with the specified duration that can be used for
|
|
873
873
|
* session management (set as a server side session cookie with custom cookie policy).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v11.
|
|
1
|
+
/*! firebase-admin v11.7.0 */
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright 2018 Google Inc.
|
|
4
4
|
*
|
|
@@ -42,7 +42,7 @@ export interface CreatePhoneMultiFactorInfoRequest extends BaseCreateMultiFactor
|
|
|
42
42
|
* Type representing the properties of a user-enrolled second factor
|
|
43
43
|
* for a `CreateRequest`.
|
|
44
44
|
*/
|
|
45
|
-
export
|
|
45
|
+
export type CreateMultiFactorInfoRequest = CreatePhoneMultiFactorInfoRequest;
|
|
46
46
|
/**
|
|
47
47
|
* Interface representing common properties of a user-enrolled second factor
|
|
48
48
|
* for an `UpdateRequest`.
|
|
@@ -80,7 +80,7 @@ export interface UpdatePhoneMultiFactorInfoRequest extends BaseUpdateMultiFactor
|
|
|
80
80
|
* Type representing the properties of a user-enrolled second factor
|
|
81
81
|
* for an `UpdateRequest`.
|
|
82
82
|
*/
|
|
83
|
-
export
|
|
83
|
+
export type UpdateMultiFactorInfoRequest = UpdatePhoneMultiFactorInfoRequest;
|
|
84
84
|
/**
|
|
85
85
|
* The multi-factor related user settings for create operations.
|
|
86
86
|
*/
|
|
@@ -316,7 +316,7 @@ export interface OIDCUpdateAuthProviderRequest {
|
|
|
316
316
|
*/
|
|
317
317
|
responseType?: OAuthResponseType;
|
|
318
318
|
}
|
|
319
|
-
export
|
|
319
|
+
export type UpdateAuthProviderRequest = SAMLUpdateAuthProviderRequest | OIDCUpdateAuthProviderRequest;
|
|
320
320
|
/** A maximum of 10 test phone number / code pairs can be configured. */
|
|
321
321
|
export declare const MAXIMUM_TEST_PHONE_NUMBERS = 10;
|
|
322
322
|
/** The server side SAML configuration request interface. */
|
|
@@ -381,20 +381,21 @@ export interface EmailSignInConfigServerRequest {
|
|
|
381
381
|
enableEmailLinkSignin?: boolean;
|
|
382
382
|
}
|
|
383
383
|
/** Identifies the server side second factor type. */
|
|
384
|
-
|
|
384
|
+
type AuthFactorServerType = 'PHONE_SMS';
|
|
385
385
|
/** Server side multi-factor configuration. */
|
|
386
386
|
export interface MultiFactorAuthServerConfig {
|
|
387
387
|
state?: MultiFactorConfigState;
|
|
388
388
|
enabledProviders?: AuthFactorServerType[];
|
|
389
|
+
providerConfigs?: MultiFactorProviderConfig[];
|
|
389
390
|
}
|
|
390
391
|
/**
|
|
391
392
|
* Identifies a second factor type.
|
|
392
393
|
*/
|
|
393
|
-
export
|
|
394
|
+
export type AuthFactorType = 'phone';
|
|
394
395
|
/**
|
|
395
396
|
* Identifies a multi-factor configuration state.
|
|
396
397
|
*/
|
|
397
|
-
export
|
|
398
|
+
export type MultiFactorConfigState = 'ENABLED' | 'DISABLED';
|
|
398
399
|
/**
|
|
399
400
|
* Interface representing a multi-factor configuration.
|
|
400
401
|
* This can be used to define whether multi-factor authentication is enabled
|
|
@@ -410,22 +411,31 @@ export interface MultiFactorConfig {
|
|
|
410
411
|
* Currently only ‘phone’ is supported.
|
|
411
412
|
*/
|
|
412
413
|
factorIds?: AuthFactorType[];
|
|
414
|
+
/**
|
|
415
|
+
* A list of multi-factor provider configurations.
|
|
416
|
+
* MFA providers (except phone) indicate whether they're enabled through this field. */
|
|
417
|
+
providerConfigs?: MultiFactorProviderConfig[];
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* Interface representing a multi-factor auth provider configuration.
|
|
421
|
+
* This interface is used for second factor auth providers other than SMS.
|
|
422
|
+
* Currently, only TOTP is supported.
|
|
423
|
+
*/ export interface MultiFactorProviderConfig {
|
|
424
|
+
/**
|
|
425
|
+
* Indicates whether this multi-factor provider is enabled or disabled. */
|
|
426
|
+
state: MultiFactorConfigState;
|
|
427
|
+
/**
|
|
428
|
+
* TOTP multi-factor provider config. */
|
|
429
|
+
totpProviderConfig?: TotpMultiFactorProviderConfig;
|
|
413
430
|
}
|
|
414
431
|
/**
|
|
415
|
-
*
|
|
416
|
-
* to a format that is understood by the Auth server.
|
|
432
|
+
* Interface representing configuration settings for TOTP second factor auth.
|
|
417
433
|
*/
|
|
418
|
-
export
|
|
419
|
-
readonly state: MultiFactorConfigState;
|
|
420
|
-
readonly factorIds: AuthFactorType[];
|
|
434
|
+
export interface TotpMultiFactorProviderConfig {
|
|
421
435
|
/**
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
*/
|
|
426
|
-
private static validate;
|
|
427
|
-
/** @returns The plain object representation of the multi-factor config instance. */
|
|
428
|
-
toJSON(): object;
|
|
436
|
+
* The allowed number of adjacent intervals that will be used for verification
|
|
437
|
+
* to compensate for clock skew. */
|
|
438
|
+
adjacentIntervals?: number;
|
|
429
439
|
}
|
|
430
440
|
/**
|
|
431
441
|
* Validates the provided map of test phone number / code pairs.
|
|
@@ -571,13 +581,13 @@ export interface OIDCAuthProviderConfig extends BaseAuthProviderConfig {
|
|
|
571
581
|
* The Auth provider configuration type.
|
|
572
582
|
* {@link BaseAuth.createProviderConfig}.
|
|
573
583
|
*/
|
|
574
|
-
export
|
|
584
|
+
export type AuthProviderConfig = SAMLAuthProviderConfig | OIDCAuthProviderConfig;
|
|
575
585
|
/**
|
|
576
586
|
* The request interface for updating a SMS Region Config.
|
|
577
587
|
* Configures the regions where users are allowed to send verification SMS.
|
|
578
588
|
* This is based on the calling code of the destination phone number.
|
|
579
589
|
*/
|
|
580
|
-
export
|
|
590
|
+
export type SmsRegionConfig = AllowByDefaultWrap | AllowlistOnlyWrap;
|
|
581
591
|
/**
|
|
582
592
|
* Mutual exclusive SMS Region Config of AllowByDefault interface
|
|
583
593
|
*/
|
|
@@ -627,4 +637,93 @@ export interface AllowlistOnly {
|
|
|
627
637
|
*/
|
|
628
638
|
allowedRegions: string[];
|
|
629
639
|
}
|
|
640
|
+
/**
|
|
641
|
+
* Enforcement state of reCAPTCHA protection.
|
|
642
|
+
* - 'OFF': Unenforced.
|
|
643
|
+
* - 'AUDIT': Create assessment but don't enforce the result.
|
|
644
|
+
* - 'ENFORCE': Create assessment and enforce the result.
|
|
645
|
+
*/
|
|
646
|
+
export type RecaptchaProviderEnforcementState = 'OFF' | 'AUDIT' | 'ENFORCE';
|
|
647
|
+
/**
|
|
648
|
+
* The actions to take for reCAPTCHA-protected requests.
|
|
649
|
+
* - 'BLOCK': The reCAPTCHA-protected request will be blocked.
|
|
650
|
+
*/
|
|
651
|
+
export type RecaptchaAction = 'BLOCK';
|
|
652
|
+
/**
|
|
653
|
+
* The config for a reCAPTCHA action rule.
|
|
654
|
+
*/
|
|
655
|
+
export interface RecaptchaManagedRule {
|
|
656
|
+
/**
|
|
657
|
+
* The action will be enforced if the reCAPTCHA score of a request is larger than endScore.
|
|
658
|
+
*/
|
|
659
|
+
endScore: number;
|
|
660
|
+
/**
|
|
661
|
+
* The action for reCAPTCHA-protected requests.
|
|
662
|
+
*/
|
|
663
|
+
action?: RecaptchaAction;
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
* The key's platform type.
|
|
667
|
+
*/
|
|
668
|
+
export type RecaptchaKeyClientType = 'WEB' | 'IOS' | 'ANDROID';
|
|
669
|
+
/**
|
|
670
|
+
* The reCAPTCHA key config.
|
|
671
|
+
*/
|
|
672
|
+
export interface RecaptchaKey {
|
|
673
|
+
/**
|
|
674
|
+
* The key's client platform type.
|
|
675
|
+
*/
|
|
676
|
+
type?: RecaptchaKeyClientType;
|
|
677
|
+
/**
|
|
678
|
+
* The reCAPTCHA site key.
|
|
679
|
+
*/
|
|
680
|
+
key: string;
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* The request interface for updating a reCAPTCHA Config.
|
|
684
|
+
* By enabling reCAPTCHA Enterprise Integration you are
|
|
685
|
+
* agreeing to reCAPTCHA Enterprise
|
|
686
|
+
* {@link https://cloud.google.com/terms/service-terms | Term of Service}.
|
|
687
|
+
*/
|
|
688
|
+
export interface RecaptchaConfig {
|
|
689
|
+
/**
|
|
690
|
+
* The enforcement state of the email password provider.
|
|
691
|
+
*/
|
|
692
|
+
emailPasswordEnforcementState?: RecaptchaProviderEnforcementState;
|
|
693
|
+
/**
|
|
694
|
+
* The reCAPTCHA managed rules.
|
|
695
|
+
*/
|
|
696
|
+
managedRules?: RecaptchaManagedRule[];
|
|
697
|
+
/**
|
|
698
|
+
* The reCAPTCHA keys.
|
|
699
|
+
*/
|
|
700
|
+
recaptchaKeys?: RecaptchaKey[];
|
|
701
|
+
/**
|
|
702
|
+
* Whether to use account defender for reCAPTCHA assessment.
|
|
703
|
+
* The default value is false.
|
|
704
|
+
*/
|
|
705
|
+
useAccountDefender?: boolean;
|
|
706
|
+
}
|
|
707
|
+
export declare class RecaptchaAuthConfig implements RecaptchaConfig {
|
|
708
|
+
readonly emailPasswordEnforcementState?: RecaptchaProviderEnforcementState;
|
|
709
|
+
readonly managedRules?: RecaptchaManagedRule[];
|
|
710
|
+
readonly recaptchaKeys?: RecaptchaKey[];
|
|
711
|
+
readonly useAccountDefender?: boolean;
|
|
712
|
+
constructor(recaptchaConfig: RecaptchaConfig);
|
|
713
|
+
/**
|
|
714
|
+
* Validates the RecaptchaConfig options object. Throws an error on failure.
|
|
715
|
+
* @param options - The options object to validate.
|
|
716
|
+
*/
|
|
717
|
+
static validate(options: RecaptchaConfig): void;
|
|
718
|
+
/**
|
|
719
|
+
* Validate each element in ManagedRule array
|
|
720
|
+
* @param options - The options object to validate.
|
|
721
|
+
*/
|
|
722
|
+
private static validateManagedRule;
|
|
723
|
+
/**
|
|
724
|
+
* Returns a JSON-serializable representation of this object.
|
|
725
|
+
* @returns The JSON-serializable object representation of the ReCaptcha config instance
|
|
726
|
+
*/
|
|
727
|
+
toJSON(): object;
|
|
728
|
+
}
|
|
630
729
|
export {};
|