FIRAuthRequestConfiguration.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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 HTTPMethod
  51. @brief The HTTP method used in the request.
  52. */
  53. @property(nonatomic, copy, nonnull) NSString *HTTPMethod;
  54. /** @property additionalFrameworkMarker
  55. @brief Additional framework marker that will be added as part of the header of every request.
  56. */
  57. @property(nonatomic, copy, nullable) NSString *additionalFrameworkMarker;
  58. /** @property emulatorHostAndPort
  59. @brief If set, the local emulator host and port to point to instead of the remote backend.
  60. */
  61. @property(nonatomic, copy, nullable) NSString *emulatorHostAndPort;
  62. - (instancetype)init NS_UNAVAILABLE;
  63. /** @fn initWithAPIKey:appID:
  64. @brief Convenience initializer.
  65. @param APIKey The API key to be used in the request.
  66. @param appID The Firebase app ID to be passed in the request header.
  67. */
  68. - (nullable instancetype)initWithAPIKey:(NSString *)APIKey appID:(NSString *)appID;
  69. /** @fn initWithAPIKey:appID:auth:
  70. @brief Convenience initializer.
  71. @param APIKey The API key to be used in the request.
  72. @param appID The Firebase app ID to be passed in the request header.
  73. @param auth The FIRAuth instance used in the request.
  74. */
  75. - (nullable instancetype)initWithAPIKey:(NSString *)APIKey
  76. appID:(NSString *)appID
  77. auth:(nullable FIRAuth *)auth;
  78. /** @fn initWithAPIKey:appID:auth:heartbeatLogger:appCheck:
  79. @brief Designated initializer.
  80. @param APIKey The API key to be used in the request.
  81. @param appID The Firebase app ID to be passed in the request header.
  82. @param auth The FIRAuth instance used in the request.
  83. @param heartbeatLogger The heartbeat logger used to add heartbeats to the request header.
  84. @param appCheck The appCheck interop is a library to generate app check token.
  85. */
  86. - (nullable instancetype)initWithAPIKey:(NSString *)APIKey
  87. appID:(NSString *)appID
  88. auth:(nullable FIRAuth *)auth
  89. heartbeatLogger:(nullable id<FIRHeartbeatLoggerProtocol>)heartbeatLogger
  90. appCheck:(nullable id<FIRAppCheckInterop>)appCheck
  91. NS_DESIGNATED_INITIALIZER;
  92. @end
  93. NS_ASSUME_NONNULL_END