AuthRequestConfiguration.swift 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // Copyright 2023 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. import Foundation
  15. // TODO: Investigate how to directly depend on FIRHeartbeatLogger instead of using a protocol so
  16. // FirebaseCoreExtension can be an implementation only protocol.
  17. import FirebaseCoreExtension
  18. import FirebaseAppCheckInterop
  19. /** @class FIRAuthRequestConfiguration
  20. @brief Defines configurations to be added to a request to Firebase Auth's backend.
  21. */
  22. @objc(FIRAuthRequestConfiguration) public class AuthRequestConfiguration: NSObject {
  23. /** @property APIKey
  24. @brief The Firebase Auth API key used in the request.
  25. */
  26. @objc(APIKey) public let apiKey: String
  27. /** @property LanguageCode
  28. @brief The language code used in the request.
  29. */
  30. @objc public var languageCode: String?
  31. /// ** @property appID
  32. // @brief The Firebase appID used in the request.
  33. // */
  34. @objc public var appID: String
  35. /** @property auth
  36. @brief The FIRAuth instance used in the request.
  37. */
  38. @objc public weak var auth: Auth?
  39. /// The heartbeat logger used to add heartbeats to the corresponding request's header.
  40. @objc public var heartbeatLogger: FIRHeartbeatLoggerProtocol?
  41. /** @property appCheck
  42. @brief The appCheck is used to generate a token.
  43. */
  44. @objc public var appCheck: AppCheckInterop?
  45. /** @property additionalFrameworkMarker
  46. @brief Additional framework marker that will be added as part of the header of every request.
  47. */
  48. @objc public var additionalFrameworkMarker: String?
  49. /** @property emulatorHostAndPort
  50. @brief If set, the local emulator host and port to point to instead of the remote backend.
  51. */
  52. @objc public var emulatorHostAndPort: String?
  53. @objc(initWithAPIKey:appID:auth:heartbeatLogger:appCheck:)
  54. public init(apiKey: String,
  55. appID: String,
  56. auth: Auth? = nil,
  57. heartbeatLogger: FIRHeartbeatLoggerProtocol? = nil,
  58. appCheck: AppCheckInterop? = nil) {
  59. self.apiKey = apiKey
  60. self.appID = appID
  61. self.auth = auth
  62. self.heartbeatLogger = heartbeatLogger
  63. self.appCheck = appCheck
  64. }
  65. }