AuthRequestConfiguration.swift 2.5 KB

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