FIRAuthRequestConfiguration.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. @protocol FIRHeartbeatLoggerProtocol;
  20. NS_ASSUME_NONNULL_BEGIN
  21. /** @class FIRAuthRequestConfiguration
  22. @brief Defines configurations to be added to a request to Firebase Auth's backend.
  23. */
  24. @interface FIRAuthRequestConfiguration : NSObject
  25. /** @property APIKey
  26. @brief The Firebase Auth API key used in the request.
  27. */
  28. @property(nonatomic, copy, readonly) NSString *APIKey;
  29. /** @property appID
  30. @brief The Firebase appID used in the request.
  31. */
  32. @property(nonatomic, copy, readonly) NSString *appID;
  33. /** @property heartbeatLogger
  34. @brief The heartbeat logger used to add heartbeats to the corresponding request's header.
  35. */
  36. @property(nonatomic, copy, nullable) id<FIRHeartbeatLoggerProtocol> heartbeatLogger;
  37. /** @property appCheck
  38. @brief The appCheck is used to generate a token.
  39. */
  40. @property(nonatomic, copy, nullable) id<FIRAppCheckInterop> appCheck;
  41. /** @property LanguageCode
  42. @brief The language code used in the request.
  43. */
  44. @property(nonatomic, copy, nullable) NSString *languageCode;
  45. /** @property additionalFrameworkMarker
  46. @brief Additional framework marker that will be added as part of the header of every request.
  47. */
  48. @property(nonatomic, copy, nullable) NSString *additionalFrameworkMarker;
  49. /** @property emulatorHostAndPort
  50. @brief If set, the local emulator host and port to point to instead of the remote backend.
  51. */
  52. @property(nonatomic, copy, nullable) NSString *emulatorHostAndPort;
  53. - (instancetype)init NS_UNAVAILABLE;
  54. /** @fn initWithAPIKey:appID:
  55. @brief Convenience initializer.
  56. @param APIKey The API key to be used in the request.
  57. @param appID The Firebase app ID to be passed in the request header.
  58. */
  59. - (nullable instancetype)initWithAPIKey:(NSString *)APIKey appID:(NSString *)appID;
  60. /** @fn initWithAPIKey:appID:heartbeatLogger:appCheck:
  61. @brief Designated initializer.
  62. @param APIKey The API key to be used in the request.
  63. @param appID The Firebase app ID to be passed in the request header.
  64. @param heartbeatLogger The heartbeat logger used to add heartbeats to the request header.
  65. @param appCheck The appCheck interop is a library to generate app check token.
  66. */
  67. - (nullable instancetype)initWithAPIKey:(NSString *)APIKey
  68. appID:(NSString *)appID
  69. heartbeatLogger:(nullable id<FIRHeartbeatLoggerProtocol>)heartbeatLogger
  70. appCheck:(nullable id<FIRAppCheckInterop>)appCheck
  71. NS_DESIGNATED_INITIALIZER;
  72. @end
  73. NS_ASSUME_NONNULL_END