auth.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*! firebase-admin v12.1.1 */
  2. "use strict";
  3. /*!
  4. * @license
  5. * Copyright 2017 Google Inc.
  6. *
  7. * Licensed under the Apache License, Version 2.0 (the "License");
  8. * you may not use this file except in compliance with the License.
  9. * You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS,
  15. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. * See the License for the specific language governing permissions and
  17. * limitations under the License.
  18. */
  19. Object.defineProperty(exports, "__esModule", { value: true });
  20. exports.Auth = void 0;
  21. const auth_api_request_1 = require("./auth-api-request");
  22. const tenant_manager_1 = require("./tenant-manager");
  23. const base_auth_1 = require("./base-auth");
  24. const project_config_manager_1 = require("./project-config-manager");
  25. /**
  26. * Auth service bound to the provided app.
  27. * An Auth instance can have multiple tenants.
  28. */
  29. class Auth extends base_auth_1.BaseAuth {
  30. /**
  31. * @param app - The app for this Auth service.
  32. * @constructor
  33. * @internal
  34. */
  35. constructor(app) {
  36. super(app, new auth_api_request_1.AuthRequestHandler(app));
  37. this.app_ = app;
  38. this.tenantManager_ = new tenant_manager_1.TenantManager(app);
  39. this.projectConfigManager_ = new project_config_manager_1.ProjectConfigManager(app);
  40. }
  41. /**
  42. * Returns the app associated with this Auth instance.
  43. *
  44. * @returns The app associated with this Auth instance.
  45. */
  46. get app() {
  47. return this.app_;
  48. }
  49. /**
  50. * Returns the tenant manager instance associated with the current project.
  51. *
  52. * @returns The tenant manager instance associated with the current project.
  53. */
  54. tenantManager() {
  55. return this.tenantManager_;
  56. }
  57. /**
  58. * Returns the project config manager instance associated with the current project.
  59. *
  60. * @returns The project config manager instance associated with the current project.
  61. */
  62. projectConfigManager() {
  63. return this.projectConfigManager_;
  64. }
  65. }
  66. exports.Auth = Auth;