AuthRequestConfiguration.swift 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
  23. @objc(FIRAuthRequestConfiguration) public class AuthRequestConfiguration: NSObject {
  24. /** @property APIKey
  25. @brief The Firebase Auth API key used in the request.
  26. */
  27. @objc(APIKey) public let apiKey: String
  28. /** @property LanguageCode
  29. @brief The language code used in the request.
  30. */
  31. @objc public var languageCode: String?
  32. /// ** @property appID
  33. // @brief The Firebase appID used in the request.
  34. // */
  35. @objc public var appID: String
  36. /** @property auth
  37. @brief The FIRAuth instance used in the request.
  38. */
  39. @objc public weak var auth: Auth?
  40. /// The heartbeat logger used to add heartbeats to the corresponding request's header.
  41. @objc public var heartbeatLogger: FIRHeartbeatLoggerProtocol?
  42. /** @property appCheck
  43. @brief The appCheck is used to generate a token.
  44. */
  45. @objc public var appCheck: AppCheckInterop?
  46. /** @property additionalFrameworkMarker
  47. @brief Additional framework marker that will be added as part of the header of every request.
  48. */
  49. @objc public var additionalFrameworkMarker: String?
  50. /** @property emulatorHostAndPort
  51. @brief If set, the local emulator host and port to point to instead of the remote backend.
  52. */
  53. @objc public var emulatorHostAndPort: String?
  54. @objc(initWithAPIKey:appID:auth:heartbeatLogger:appCheck:)
  55. public init(apiKey: String,
  56. appID: String,
  57. auth: Auth? = nil,
  58. heartbeatLogger: FIRHeartbeatLoggerProtocol? = nil,
  59. appCheck: AppCheckInterop? = nil) {
  60. self.apiKey = apiKey
  61. self.appID = appID
  62. self.auth = auth
  63. self.heartbeatLogger = heartbeatLogger
  64. self.appCheck = appCheck
  65. }
  66. }