GACAppCheckDebugProviderAPIService.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright 2020 Google LLC
  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. @class FBLPromise<Result>;
  18. @class GACAppCheckToken;
  19. @protocol GACAppCheckAPIServiceProtocol;
  20. NS_ASSUME_NONNULL_BEGIN
  21. @protocol GACAppCheckDebugProviderAPIServiceProtocol <NSObject>
  22. - (FBLPromise<GACAppCheckToken *> *)appCheckTokenWithDebugToken:(NSString *)debugToken;
  23. @end
  24. @interface GACAppCheckDebugProviderAPIService
  25. : NSObject <GACAppCheckDebugProviderAPIServiceProtocol>
  26. /// Default initializer.
  27. ///
  28. /// TODO(andrewheard): Remove or refactor the `limitedUse` parameter from this constructor when the
  29. /// short-lived (limited-use) token feature is fully implemented.
  30. ///
  31. /// @param APIService An instance implementing `GACAppCheckAPIServiceProtocol` to be used to send
  32. /// network requests to the App Check backend.
  33. /// @param resourceName The name of the resource protected by App Check; for a Firebase App this is
  34. /// "projects/{project_id}/apps/{app_id}". See https://google.aip.dev/122 for more details about
  35. /// resource names.
  36. /// @param limitedUse If YES, forces a short-lived token with a 5 minute TTL.
  37. - (instancetype)initWithAPIService:(id<GACAppCheckAPIServiceProtocol>)APIService
  38. resourceName:(NSString *)resourceName
  39. limitedUse:(BOOL)limitedUse NS_DESIGNATED_INITIALIZER;
  40. - (instancetype)init NS_UNAVAILABLE;
  41. @end
  42. NS_ASSUME_NONNULL_END