firebase-admin 10.0.0 → 10.1.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.
Files changed (174) hide show
  1. package/lib/app/core.d.ts +1 -1
  2. package/lib/app/core.js +1 -1
  3. package/lib/app/credential-factory.d.ts +1 -1
  4. package/lib/app/credential-factory.js +1 -1
  5. package/lib/app/credential-internal.d.ts +1 -1
  6. package/lib/app/credential-internal.js +2 -1
  7. package/lib/app/credential.d.ts +1 -1
  8. package/lib/app/credential.js +1 -1
  9. package/lib/app/firebase-app.d.ts +1 -1
  10. package/lib/app/firebase-app.js +4 -1
  11. package/lib/app/firebase-namespace.d.ts +1 -1
  12. package/lib/app/firebase-namespace.js +1 -1
  13. package/lib/app/index.d.ts +1 -1
  14. package/lib/app/index.js +1 -1
  15. package/lib/app/lifecycle.d.ts +1 -1
  16. package/lib/app/lifecycle.js +1 -1
  17. package/lib/app-check/app-check-api-client-internal.d.ts +1 -1
  18. package/lib/app-check/app-check-api-client-internal.js +1 -1
  19. package/lib/app-check/app-check-api.d.ts +1 -1
  20. package/lib/app-check/app-check-api.js +1 -1
  21. package/lib/app-check/app-check-namespace.d.ts +1 -1
  22. package/lib/app-check/app-check-namespace.js +1 -1
  23. package/lib/app-check/app-check.d.ts +1 -1
  24. package/lib/app-check/app-check.js +1 -1
  25. package/lib/app-check/index.d.ts +1 -1
  26. package/lib/app-check/index.js +1 -1
  27. package/lib/app-check/token-generator.d.ts +1 -1
  28. package/lib/app-check/token-generator.js +2 -4
  29. package/lib/app-check/token-verifier.d.ts +1 -1
  30. package/lib/app-check/token-verifier.js +1 -2
  31. package/lib/auth/action-code-settings-builder.d.ts +1 -1
  32. package/lib/auth/action-code-settings-builder.js +1 -1
  33. package/lib/auth/auth-api-request.d.ts +1 -1
  34. package/lib/auth/auth-api-request.js +6 -4
  35. package/lib/auth/auth-config.d.ts +1 -1
  36. package/lib/auth/auth-config.js +1 -1
  37. package/lib/auth/auth-namespace.d.ts +4 -2
  38. package/lib/auth/auth-namespace.js +1 -1
  39. package/lib/auth/auth.d.ts +1 -1
  40. package/lib/auth/auth.js +1 -1
  41. package/lib/auth/base-auth.d.ts +5 -3
  42. package/lib/auth/base-auth.js +12 -2
  43. package/lib/auth/identifier.d.ts +1 -1
  44. package/lib/auth/identifier.js +1 -1
  45. package/lib/auth/index.d.ts +2 -2
  46. package/lib/auth/index.js +1 -1
  47. package/lib/auth/tenant-manager.d.ts +1 -1
  48. package/lib/auth/tenant-manager.js +1 -1
  49. package/lib/auth/tenant.d.ts +1 -1
  50. package/lib/auth/tenant.js +1 -1
  51. package/lib/auth/token-generator.d.ts +1 -1
  52. package/lib/auth/token-generator.js +2 -2
  53. package/lib/auth/token-verifier.d.ts +70 -1
  54. package/lib/auth/token-verifier.js +54 -7
  55. package/lib/auth/user-import-builder.d.ts +1 -1
  56. package/lib/auth/user-import-builder.js +1 -1
  57. package/lib/auth/user-record.d.ts +1 -1
  58. package/lib/auth/user-record.js +1 -1
  59. package/lib/credential/index.d.ts +1 -1
  60. package/lib/credential/index.js +1 -1
  61. package/lib/database/database-namespace.d.ts +1 -1
  62. package/lib/database/database-namespace.js +1 -1
  63. package/lib/database/database.d.ts +1 -1
  64. package/lib/database/database.js +1 -1
  65. package/lib/database/index.d.ts +1 -1
  66. package/lib/database/index.js +2 -1
  67. package/lib/default-namespace.d.ts +1 -1
  68. package/lib/default-namespace.js +1 -1
  69. package/lib/esm/firestore/index.js +1 -0
  70. package/lib/firebase-namespace-api.d.ts +1 -1
  71. package/lib/firebase-namespace-api.js +1 -1
  72. package/lib/firestore/firestore-internal.d.ts +1 -1
  73. package/lib/firestore/firestore-internal.js +1 -1
  74. package/lib/firestore/firestore-namespace.d.ts +6 -1
  75. package/lib/firestore/firestore-namespace.js +2 -1
  76. package/lib/firestore/index.d.ts +2 -2
  77. package/lib/firestore/index.js +2 -1
  78. package/lib/index.d.ts +1 -1
  79. package/lib/index.js +1 -1
  80. package/lib/installations/index.d.ts +1 -1
  81. package/lib/installations/index.js +1 -1
  82. package/lib/installations/installations-namespace.d.ts +1 -1
  83. package/lib/installations/installations-namespace.js +1 -1
  84. package/lib/installations/installations-request-handler.d.ts +1 -1
  85. package/lib/installations/installations-request-handler.js +1 -1
  86. package/lib/installations/installations.d.ts +1 -1
  87. package/lib/installations/installations.js +1 -1
  88. package/lib/instance-id/index.d.ts +1 -1
  89. package/lib/instance-id/index.js +1 -1
  90. package/lib/instance-id/instance-id-namespace.d.ts +1 -1
  91. package/lib/instance-id/instance-id-namespace.js +1 -1
  92. package/lib/instance-id/instance-id.d.ts +1 -1
  93. package/lib/instance-id/instance-id.js +1 -1
  94. package/lib/machine-learning/index.d.ts +1 -1
  95. package/lib/machine-learning/index.js +1 -1
  96. package/lib/machine-learning/machine-learning-api-client.d.ts +1 -1
  97. package/lib/machine-learning/machine-learning-api-client.js +1 -1
  98. package/lib/machine-learning/machine-learning-namespace.d.ts +1 -1
  99. package/lib/machine-learning/machine-learning-namespace.js +1 -1
  100. package/lib/machine-learning/machine-learning-utils.d.ts +1 -1
  101. package/lib/machine-learning/machine-learning-utils.js +1 -1
  102. package/lib/machine-learning/machine-learning.d.ts +1 -1
  103. package/lib/machine-learning/machine-learning.js +1 -1
  104. package/lib/messaging/batch-request-internal.d.ts +1 -1
  105. package/lib/messaging/batch-request-internal.js +1 -1
  106. package/lib/messaging/index.d.ts +1 -1
  107. package/lib/messaging/index.js +1 -1
  108. package/lib/messaging/messaging-api-request-internal.d.ts +1 -1
  109. package/lib/messaging/messaging-api-request-internal.js +1 -1
  110. package/lib/messaging/messaging-api.d.ts +1 -1
  111. package/lib/messaging/messaging-api.js +1 -1
  112. package/lib/messaging/messaging-errors-internal.d.ts +1 -1
  113. package/lib/messaging/messaging-errors-internal.js +1 -1
  114. package/lib/messaging/messaging-internal.d.ts +1 -1
  115. package/lib/messaging/messaging-internal.js +1 -1
  116. package/lib/messaging/messaging-namespace.d.ts +1 -1
  117. package/lib/messaging/messaging-namespace.js +1 -1
  118. package/lib/messaging/messaging.d.ts +1 -1
  119. package/lib/messaging/messaging.js +1 -2
  120. package/lib/project-management/android-app.d.ts +1 -1
  121. package/lib/project-management/android-app.js +1 -1
  122. package/lib/project-management/app-metadata.d.ts +1 -1
  123. package/lib/project-management/app-metadata.js +1 -1
  124. package/lib/project-management/index.d.ts +1 -1
  125. package/lib/project-management/index.js +1 -1
  126. package/lib/project-management/ios-app.d.ts +1 -1
  127. package/lib/project-management/ios-app.js +1 -1
  128. package/lib/project-management/project-management-api-request-internal.d.ts +1 -1
  129. package/lib/project-management/project-management-api-request-internal.js +1 -1
  130. package/lib/project-management/project-management-namespace.d.ts +1 -1
  131. package/lib/project-management/project-management-namespace.js +1 -1
  132. package/lib/project-management/project-management.d.ts +1 -1
  133. package/lib/project-management/project-management.js +1 -1
  134. package/lib/remote-config/index.d.ts +1 -1
  135. package/lib/remote-config/index.js +1 -1
  136. package/lib/remote-config/remote-config-api-client-internal.d.ts +1 -1
  137. package/lib/remote-config/remote-config-api-client-internal.js +1 -1
  138. package/lib/remote-config/remote-config-api.d.ts +1 -1
  139. package/lib/remote-config/remote-config-api.js +1 -1
  140. package/lib/remote-config/remote-config-namespace.d.ts +1 -1
  141. package/lib/remote-config/remote-config-namespace.js +1 -1
  142. package/lib/remote-config/remote-config.d.ts +1 -1
  143. package/lib/remote-config/remote-config.js +1 -1
  144. package/lib/security-rules/index.d.ts +1 -1
  145. package/lib/security-rules/index.js +1 -1
  146. package/lib/security-rules/security-rules-api-client-internal.d.ts +1 -1
  147. package/lib/security-rules/security-rules-api-client-internal.js +1 -1
  148. package/lib/security-rules/security-rules-internal.d.ts +1 -1
  149. package/lib/security-rules/security-rules-internal.js +1 -1
  150. package/lib/security-rules/security-rules-namespace.d.ts +1 -1
  151. package/lib/security-rules/security-rules-namespace.js +1 -1
  152. package/lib/security-rules/security-rules.d.ts +1 -1
  153. package/lib/security-rules/security-rules.js +1 -1
  154. package/lib/storage/index.d.ts +1 -1
  155. package/lib/storage/index.js +1 -1
  156. package/lib/storage/storage-namespace.d.ts +1 -1
  157. package/lib/storage/storage-namespace.js +1 -1
  158. package/lib/storage/storage.d.ts +1 -1
  159. package/lib/storage/storage.js +1 -1
  160. package/lib/utils/api-request.d.ts +1 -1
  161. package/lib/utils/api-request.js +1 -1
  162. package/lib/utils/crypto-signer.d.ts +1 -1
  163. package/lib/utils/crypto-signer.js +1 -1
  164. package/lib/utils/deep-copy.d.ts +1 -1
  165. package/lib/utils/deep-copy.js +1 -1
  166. package/lib/utils/error.d.ts +5 -1
  167. package/lib/utils/error.js +7 -1
  168. package/lib/utils/index.d.ts +1 -1
  169. package/lib/utils/index.js +1 -1
  170. package/lib/utils/jwt.d.ts +1 -1
  171. package/lib/utils/jwt.js +1 -1
  172. package/lib/utils/validator.d.ts +1 -1
  173. package/lib/utils/validator.js +1 -1
  174. package/package.json +15 -15
package/lib/app/core.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2021 Google Inc.
package/lib/app/core.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2020 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -87,6 +87,7 @@ var ServiceAccountCredential = /** @class */ (function () {
87
87
  };
88
88
  return requestAccessToken(this.httpClient, request);
89
89
  };
90
+ // eslint-disable-next-line @typescript-eslint/naming-convention
90
91
  ServiceAccountCredential.prototype.createAuthJwt_ = function () {
91
92
  var claims = {
92
93
  scope: [
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2017 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -27,6 +27,7 @@ var TOKEN_EXPIRY_THRESHOLD_MILLIS = 5 * 60 * 1000;
27
27
  * Internals of a FirebaseApp instance.
28
28
  */
29
29
  var FirebaseAppInternals = /** @class */ (function () {
30
+ // eslint-disable-next-line @typescript-eslint/naming-convention
30
31
  function FirebaseAppInternals(credential_) {
31
32
  this.credential_ = credential_;
32
33
  this.tokenListeners_ = [];
@@ -196,6 +197,7 @@ var FirebaseApp = /** @class */ (function () {
196
197
  _this.isDeleted_ = true;
197
198
  });
198
199
  };
200
+ // eslint-disable-next-line @typescript-eslint/naming-convention
199
201
  FirebaseApp.prototype.ensureService_ = function (serviceName, initializer) {
200
202
  this.checkDestroyed_();
201
203
  if (!(serviceName in this.services_)) {
@@ -206,6 +208,7 @@ var FirebaseApp = /** @class */ (function () {
206
208
  /**
207
209
  * Throws an Error if the FirebaseApp instance has already been deleted.
208
210
  */
211
+ // eslint-disable-next-line @typescript-eslint/naming-convention
209
212
  FirebaseApp.prototype.checkDestroyed_ = function () {
210
213
  if (this.isDeleted_) {
211
214
  throw new error_1.FirebaseAppError(error_1.AppErrorCodes.APP_DELETED, "Firebase app named \"" + this.name_ + "\" has already been deleted.");
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2017 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2021 Google Inc.
package/lib/app/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  /*!
3
3
  * Copyright 2021 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -79,9 +79,7 @@ var AppCheckTokenGenerator = /** @class */ (function () {
79
79
  typ: 'JWT',
80
80
  };
81
81
  var iat = Math.floor(Date.now() / 1000);
82
- var body = __assign({ iss: account, sub: account,
83
- // eslint-disable-next-line @typescript-eslint/camelcase
84
- app_id: appId, aud: FIREBASE_APP_CHECK_AUDIENCE, exp: iat + (ONE_MINUTE_IN_SECONDS * 5), iat: iat }, customOptions);
82
+ var body = __assign({ iss: account, sub: account, app_id: appId, aud: FIREBASE_APP_CHECK_AUDIENCE, exp: iat + (ONE_MINUTE_IN_SECONDS * 5), iat: iat }, customOptions);
85
83
  var token = _this.encodeSegment(header) + "." + _this.encodeSegment(body);
86
84
  return _this.signer.sign(Buffer.from(token))
87
85
  .then(function (signature) {
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  /*!
3
3
  * Copyright 2021 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2021 Google Inc.
@@ -50,7 +50,6 @@ var AppCheckTokenVerifier = /** @class */ (function () {
50
50
  })
51
51
  .then(function (decoded) {
52
52
  var decodedAppCheckToken = decoded.payload;
53
- // eslint-disable-next-line @typescript-eslint/camelcase
54
53
  decodedAppCheckToken.app_id = decodedAppCheckToken.sub;
55
54
  return decodedAppCheckToken;
56
55
  });
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  /*!
3
3
  * Copyright 2018 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2018 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2017 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1612,8 +1612,10 @@ var AbstractAuthRequestHandler = /** @class */ (function () {
1612
1612
  return urlBuilder.getUrl(apiSettings.getEndpoint(), additionalResourceParams)
1613
1613
  .then(function (url) {
1614
1614
  // Validate request.
1615
- var requestValidator = apiSettings.getRequestValidator();
1616
- requestValidator(requestData);
1615
+ if (requestData) {
1616
+ var requestValidator = apiSettings.getRequestValidator();
1617
+ requestValidator(requestData);
1618
+ }
1617
1619
  // Process request.
1618
1620
  var req = {
1619
1621
  method: apiSettings.getHttpMethod(),
@@ -1801,7 +1803,7 @@ var AuthRequestHandler = /** @class */ (function (_super) {
1801
1803
  if (!validator.isNonEmptyString(tenantId)) {
1802
1804
  return Promise.reject(new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INVALID_TENANT_ID));
1803
1805
  }
1804
- return this.invokeRequestHandler(this.tenantMgmtResourceBuilder, DELETE_TENANT, {}, { tenantId: tenantId })
1806
+ return this.invokeRequestHandler(this.tenantMgmtResourceBuilder, DELETE_TENANT, undefined, { tenantId: tenantId })
1805
1807
  .then(function () {
1806
1808
  // Return nothing.
1807
1809
  });
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  /*!
3
3
  * Copyright 2018 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2018 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  /*!
3
3
  * Copyright 2021 Google Inc.
4
4
  *
@@ -22,7 +22,7 @@ import { BaseAuth as TBaseAuth, DeleteUsersResult as TDeleteUsersResult, GetUser
22
22
  import { EmailIdentifier as TEmailIdentifier, PhoneIdentifier as TPhoneIdentifier, ProviderIdentifier as TProviderIdentifier, UserIdentifier as TUserIdentifier, UidIdentifier as TUidIdentifier } from './identifier';
23
23
  import { CreateTenantRequest as TCreateTenantRequest, Tenant as TTenant, UpdateTenantRequest as TUpdateTenantRequest } from './tenant';
24
24
  import { ListTenantsResult as TListTenantsResult, TenantAwareAuth as TTenantAwareAuth, TenantManager as TTenantManager } from './tenant-manager';
25
- import { DecodedIdToken as TDecodedIdToken } from './token-verifier';
25
+ import { DecodedIdToken as TDecodedIdToken, DecodedAuthBlockingToken as TDecodedAuthBlockingToken } from './token-verifier';
26
26
  import { HashAlgorithmType as THashAlgorithmType, UserImportOptions as TUserImportOptions, UserImportRecord as TUserImportRecord, UserImportResult as TUserImportResult, UserMetadataRequest as TUserMetadataRequest, UserProviderRequest as TUserProviderRequest } from './user-import-builder';
27
27
  import { MultiFactorInfo as TMultiFactorInfo, MultiFactorSettings as TMultiFactorSettings, PhoneMultiFactorInfo as TPhoneMultiFactorInfo, UserInfo as TUserInfo, UserMetadata as TUserMetadata, UserRecord as TUserRecord } from './user-record';
28
28
  /**
@@ -92,6 +92,8 @@ export declare namespace auth {
92
92
  * Type alias to {@link firebase-admin.auth#DecodedIdToken}.
93
93
  */
94
94
  type DecodedIdToken = TDecodedIdToken;
95
+ /** @alpha */
96
+ type DecodedAuthBlockingToken = TDecodedAuthBlockingToken;
95
97
  /**
96
98
  * Type alias to {@link firebase-admin.auth#DeleteUsersResult}.
97
99
  */
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2017 Google Inc.
package/lib/auth/auth.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  /*!
3
3
  * Copyright 2021 Google Inc.
4
4
  *
@@ -15,7 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import { FirebaseArrayIndexError } from '../app';
18
- import { DecodedIdToken } from './token-verifier';
18
+ import { DecodedIdToken, DecodedAuthBlockingToken } from './token-verifier';
19
19
  import { AuthProviderConfig, AuthProviderConfigFilter, ListProviderConfigResults, UpdateAuthProviderRequest, CreateRequest, UpdateRequest } from './auth-config';
20
20
  import { UserRecord } from './user-record';
21
21
  import { UserIdentifier } from './identifier';
@@ -263,7 +263,7 @@ export declare abstract class BaseAuth {
263
263
  /**
264
264
  * Updates an existing user.
265
265
  *
266
- * See {@link https://firebsae.google.com/docs/auth/admin/manage-users#update_a_user | Update a user}
266
+ * See {@link https://firebase.google.com/docs/auth/admin/manage-users#update_a_user | Update a user}
267
267
  * for code samples and detailed documentation.
268
268
  *
269
269
  * @param uid - The `uid` corresponding to the user to update.
@@ -599,6 +599,8 @@ export declare abstract class BaseAuth {
599
599
  * @returns A promise that resolves with the created provider configuration.
600
600
  */
601
601
  createProviderConfig(config: AuthProviderConfig): Promise<AuthProviderConfig>;
602
+ /** @alpha */
603
+ _verifyAuthBlockingToken(token: string, audience?: string): Promise<DecodedAuthBlockingToken>;
602
604
  /**
603
605
  * Verifies the decoded Firebase issued JWT is not revoked or disabled. Returns a promise that
604
606
  * resolves with the decoded claims on success. Rejects the promise with revocation error if revoked
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2021 Google Inc.
@@ -66,6 +66,7 @@ var BaseAuth = /** @class */ (function () {
66
66
  }
67
67
  this.sessionCookieVerifier = token_verifier_1.createSessionCookieVerifier(app);
68
68
  this.idTokenVerifier = token_verifier_1.createIdTokenVerifier(app);
69
+ this.authBlockingTokenVerifier = token_verifier_1.createAuthBlockingTokenVerifier(app);
69
70
  }
70
71
  /**
71
72
  * Creates a new Firebase custom token (JWT) that can be sent back to a client
@@ -402,7 +403,7 @@ var BaseAuth = /** @class */ (function () {
402
403
  /**
403
404
  * Updates an existing user.
404
405
  *
405
- * See {@link https://firebsae.google.com/docs/auth/admin/manage-users#update_a_user | Update a user}
406
+ * See {@link https://firebase.google.com/docs/auth/admin/manage-users#update_a_user | Update a user}
406
407
  * for code samples and detailed documentation.
407
408
  *
408
409
  * @param uid - The `uid` corresponding to the user to update.
@@ -914,6 +915,15 @@ var BaseAuth = /** @class */ (function () {
914
915
  }
915
916
  return Promise.reject(new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INVALID_PROVIDER_ID));
916
917
  };
918
+ /** @alpha */
919
+ // eslint-disable-next-line @typescript-eslint/naming-convention
920
+ BaseAuth.prototype._verifyAuthBlockingToken = function (token, audience) {
921
+ var isEmulator = auth_api_request_1.useEmulator();
922
+ return this.authBlockingTokenVerifier._verifyAuthBlockingToken(token, isEmulator, audience)
923
+ .then(function (decodedAuthBlockingToken) {
924
+ return decodedAuthBlockingToken;
925
+ });
926
+ };
917
927
  /**
918
928
  * Verifies the decoded Firebase issued JWT is not revoked or disabled. Returns a promise that
919
929
  * resolves with the decoded claims on success. Rejects the promise with revocation error if revoked
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -50,6 +50,6 @@ export { BaseAuth, DeleteUsersResult, GetUsersResult, ListUsersResult, SessionCo
50
50
  export { EmailIdentifier, PhoneIdentifier, ProviderIdentifier, UidIdentifier, UserIdentifier, } from './identifier';
51
51
  export { CreateTenantRequest, Tenant, UpdateTenantRequest, } from './tenant';
52
52
  export { ListTenantsResult, TenantAwareAuth, TenantManager, } from './tenant-manager';
53
- export { DecodedIdToken } from './token-verifier';
53
+ export { DecodedIdToken, DecodedAuthBlockingToken } from './token-verifier';
54
54
  export { HashAlgorithmType, UserImportOptions, UserImportRecord, UserImportResult, UserMetadataRequest, UserProviderRequest, } from './user-import-builder';
55
55
  export { MultiFactorInfo, MultiFactorSettings, PhoneMultiFactorInfo, UserInfo, UserMetadata, UserRecord, } from './user-record';
package/lib/auth/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  /*!
3
3
  * Copyright 2019 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2019 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  /*!
3
3
  * Copyright 2019 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2019 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2017 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -127,7 +127,6 @@ var FirebaseTokenGenerator = /** @class */ (function () {
127
127
  uid: uid,
128
128
  };
129
129
  if (_this.tenantId) {
130
- // eslint-disable-next-line @typescript-eslint/camelcase
131
130
  body.tenant_id = _this.tenantId;
132
131
  }
133
132
  if (Object.keys(claims).length > 0) {
@@ -153,6 +152,7 @@ var FirebaseTokenGenerator = /** @class */ (function () {
153
152
  * @param developerClaims - Optional developer claims to validate.
154
153
  * @returns True if the provided claims are valid; otherwise, false.
155
154
  */
155
+ // eslint-disable-next-line @typescript-eslint/naming-convention
156
156
  FirebaseTokenGenerator.prototype.isDeveloperClaimsValid_ = function (developerClaims) {
157
157
  if (typeof developerClaims === 'undefined') {
158
158
  return true;
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v10.0.0 */
1
+ /*! firebase-admin v10.1.0 */
2
2
  /*!
3
3
  * Copyright 2018 Google Inc.
4
4
  *
@@ -148,3 +148,72 @@ export interface DecodedIdToken {
148
148
  */
149
149
  [key: string]: any;
150
150
  }
151
+ /** @alpha */
152
+ export interface DecodedAuthBlockingSharedUserInfo {
153
+ uid: string;
154
+ display_name?: string;
155
+ email?: string;
156
+ photo_url?: string;
157
+ phone_number?: string;
158
+ }
159
+ /** @alpha */
160
+ export interface DecodedAuthBlockingMetadata {
161
+ creation_time?: number;
162
+ last_sign_in_time?: number;
163
+ }
164
+ /** @alpha */
165
+ export interface DecodedAuthBlockingUserInfo extends DecodedAuthBlockingSharedUserInfo {
166
+ provider_id: string;
167
+ }
168
+ /** @alpha */
169
+ export interface DecodedAuthBlockingMfaInfo {
170
+ uid: string;
171
+ display_name?: string;
172
+ phone_number?: string;
173
+ enrollment_time?: string;
174
+ factor_id?: string;
175
+ }
176
+ /** @alpha */
177
+ export interface DecodedAuthBlockingEnrolledFactors {
178
+ enrolled_factors?: DecodedAuthBlockingMfaInfo[];
179
+ }
180
+ /** @alpha */
181
+ export interface DecodedAuthBlockingUserRecord extends DecodedAuthBlockingSharedUserInfo {
182
+ email_verified?: boolean;
183
+ disabled?: boolean;
184
+ metadata?: DecodedAuthBlockingMetadata;
185
+ password_hash?: string;
186
+ password_salt?: string;
187
+ provider_data?: DecodedAuthBlockingUserInfo[];
188
+ multi_factor?: DecodedAuthBlockingEnrolledFactors;
189
+ custom_claims?: any;
190
+ tokens_valid_after_time?: number;
191
+ tenant_id?: string;
192
+ [key: string]: any;
193
+ }
194
+ /** @alpha */
195
+ export interface DecodedAuthBlockingToken {
196
+ aud: string;
197
+ exp: number;
198
+ iat: number;
199
+ iss: string;
200
+ sub: string;
201
+ event_id: string;
202
+ event_type: string;
203
+ ip_address: string;
204
+ user_agent?: string;
205
+ locale?: string;
206
+ sign_in_method?: string;
207
+ user_record?: DecodedAuthBlockingUserRecord;
208
+ tenant_id?: string;
209
+ raw_user_info?: string;
210
+ sign_in_attributes?: {
211
+ [key: string]: any;
212
+ };
213
+ oauth_id_token?: string;
214
+ oauth_access_token?: string;
215
+ oauth_refresh_token?: string;
216
+ oauth_token_secret?: string;
217
+ oauth_expires_in?: number;
218
+ [key: string]: any;
219
+ }