FIRAuthRequestConfiguration.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. * Copyright 2017 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. #import "FirebaseAppCheck/Interop/FIRAppCheckInterop.h"
  18. #import "FirebaseAuth/Sources/Backend/FIRAuthRPCRequest.h"
  19. #import "FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h"
  20. @protocol FIRHeartbeatLoggerProtocol;
  21. NS_ASSUME_NONNULL_BEGIN
  22. /** @class FIRAuthRequestConfiguration
  23. @brief Defines configurations to be added to a request to Firebase Auth's backend.
  24. */
  25. @interface FIRAuthRequestConfiguration : NSObject
  26. /** @property APIKey
  27. @brief The Firebase Auth API key used in the request.
  28. */
  29. @property(nonatomic, copy, readonly) NSString *APIKey;
  30. /** @property appID
  31. @brief The Firebase appID used in the request.
  32. */
  33. @property(nonatomic, copy, readonly) NSString *appID;
  34. /** @property auth
  35. @brief The FIRAuth instance used in the request.
  36. */
  37. @property(nonatomic, weak, readonly, nullable) FIRAuth *auth;
  38. /** @property heartbeatLogger
  39. @brief The heartbeat logger used to add heartbeats to the corresponding request's header.
  40. */
  41. @property(nonatomic, copy, nullable) id<FIRHeartbeatLoggerProtocol> heartbeatLogger;
  42. /** @property appCheck
  43. @brief The appCheck is used to generate a token.
  44. */
  45. @property(nonatomic, copy, nullable) id<FIRAppCheckInterop> appCheck;
  46. /** @property LanguageCode
  47. @brief The language code used in the request.
  48. */
  49. @property(nonatomic, copy, nullable) NSString *languageCode;
  50. /** @property additionalFrameworkMarker
  51. @brief Additional framework marker that will be added as part of the header of every request.
  52. */
  53. @property(nonatomic, copy, nullable) NSString *additionalFrameworkMarker;
  54. /** @property emulatorHostAndPort
  55. @brief If set, the local emulator host and port to point to instead of the remote backend.
  56. */
  57. @property(nonatomic, copy, nullable) NSString *emulatorHostAndPort;
  58. - (instancetype)init NS_UNAVAILABLE;
  59. /** @fn initWithAPIKey:appID:
  60. @brief Convenience initializer.
  61. @param APIKey The API key to be used in the request.
  62. @param appID The Firebase app ID to be passed in the request header.
  63. */
  64. - (nullable instancetype)initWithAPIKey:(NSString *)APIKey appID:(NSString *)appID;
  65. /** @fn initWithAPIKey:appID:auth:
  66. @brief Convenience initializer.
  67. @param APIKey The API key to be used in the request.
  68. @param appID The Firebase app ID to be passed in the request header.
  69. @param auth The FIRAuth instance used in the request.
  70. */
  71. - (nullable instancetype)initWithAPIKey:(NSString *)APIKey
  72. appID:(NSString *)appID
  73. auth:(nullable FIRAuth *)auth;
  74. /** @fn initWithAPIKey:appID:auth:heartbeatLogger:appCheck:
  75. @brief Designated initializer.
  76. @param APIKey The API key to be used in the request.
  77. @param appID The Firebase app ID to be passed in the request header.
  78. @param auth The FIRAuth instance used in the request.
  79. @param heartbeatLogger The heartbeat logger used to add heartbeats to the request header.
  80. @param appCheck The appCheck interop is a library to generate app check token.
  81. */
  82. - (nullable instancetype)initWithAPIKey:(NSString *)APIKey
  83. appID:(NSString *)appID
  84. auth:(nullable FIRAuth *)auth
  85. heartbeatLogger:(nullable id<FIRHeartbeatLoggerProtocol>)heartbeatLogger
  86. appCheck:(nullable id<FIRAppCheckInterop>)appCheck
  87. NS_DESIGNATED_INITIALIZER;
  88. @end
  89. NS_ASSUME_NONNULL_END