feat: Add Recaptcha attestation provider (#94)

Signed-off-by: Nick Cooke <36927374+ncooke3@users.noreply.github.com>
Co-authored-by: Hitesh Maurya <hiteshmaurya@google.com>
Co-authored-by: Paul Beusterien <paulbeusterien@google.com>
This commit is contained in:
authored and GitHub committed 2026-06-09 16:44:19 -04:00
1 parent f50adb523d
commit f6b4582ed1
57 files changed
+1869 -272

No files matched your search

@@ -26,24 +26,24 @@
#import "AppCheckCore/Sources/Public/AppCheckCore/GACDeviceCheckProvider.h"
#import "AppCheckCore/Sources/Core/APIService/GACAppCheckAPIService.h"
#import "AppCheckCore/Sources/Core/Backoff/GACAppCheckBackoffWrapper.h"
#import "AppCheckCore/Sources/Core/Errors/GACAppCheckErrorUtil.h"
#import "AppCheckCore/Sources/Core/GACAppCheckLogger+Internal.h"
#import "AppCheckCore/Sources/DeviceCheckProvider/API/GACDeviceCheckAPIService.h"
#import "AppCheckCore/Sources/DeviceCheckProvider/DCDevice+GACDeviceCheckTokenGenerator.h"
#import "AppCheckCore/Sources/Public/AppCheckCore/GACAppCheckToken.h"
#import "AppCheckCore/Sources/Public/AppCheckCore/_GACAppCheckAPIService.h"
#import "AppCheckCore/Sources/Public/AppCheckCore/_GACAppCheckBackoffWrapper.h"
#import "AppCheckCore/Sources/Public/AppCheckCore/_GACAppCheckErrorUtil.h"
NS_ASSUME_NONNULL_BEGIN
@interface GACDeviceCheckProvider ()
@property(nonatomic, readonly) id<GACDeviceCheckAPIServiceProtocol> APIService;
@property(nonatomic, readonly) id<GACDeviceCheckTokenGenerator> deviceTokenGenerator;
@property(nonatomic, readonly) id<GACAppCheckBackoffWrapperProtocol> backoffWrapper;
@property(nonatomic, readonly) id<_GACAppCheckBackoffWrapperProtocol> backoffWrapper;
- (instancetype)initWithAPIService:(id<GACDeviceCheckAPIServiceProtocol>)APIService
deviceTokenGenerator:(id<GACDeviceCheckTokenGenerator>)deviceTokenGenerator
backoffWrapper:(id<GACAppCheckBackoffWrapperProtocol>)backoffWrapper
backoffWrapper:(id<_GACAppCheckBackoffWrapperProtocol>)backoffWrapper
NS_DESIGNATED_INITIALIZER;
@end
@@ -52,7 +52,7 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initWithAPIService:(id<GACDeviceCheckAPIServiceProtocol>)APIService
deviceTokenGenerator:(id<GACDeviceCheckTokenGenerator>)deviceTokenGenerator
backoffWrapper:(id<GACAppCheckBackoffWrapperProtocol>)backoffWrapper {
backoffWrapper:(id<_GACAppCheckBackoffWrapperProtocol>)backoffWrapper {
self = [super init];
if (self) {
_APIService = APIService;
@@ -63,7 +63,7 @@ NS_ASSUME_NONNULL_BEGIN
}
- (instancetype)initWithAPIService:(id<GACDeviceCheckAPIServiceProtocol>)APIService {
GACAppCheckBackoffWrapper *backoffWrapper = [[GACAppCheckBackoffWrapper alloc] init];
_GACAppCheckBackoffWrapper *backoffWrapper = [[_GACAppCheckBackoffWrapper alloc] init];
return [self initWithAPIService:APIService
deviceTokenGenerator:[DCDevice currentDevice]
backoffWrapper:backoffWrapper];
@@ -76,11 +76,11 @@ NS_ASSUME_NONNULL_BEGIN
NSURLSession *URLSession = [NSURLSession
sessionWithConfiguration:[NSURLSessionConfiguration ephemeralSessionConfiguration]];
GACAppCheckAPIService *APIService =
[[GACAppCheckAPIService alloc] initWithURLSession:URLSession
baseURL:nil
APIKey:APIKey
requestHooks:requestHooks];
_GACAppCheckAPIService *APIService =
[[_GACAppCheckAPIService alloc] initWithURLSession:URLSession
baseURL:nil
APIKey:APIKey
requestHooks:requestHooks];
GACDeviceCheckAPIService *deviceCheckAPIService =
[[GACDeviceCheckAPIService alloc] initWithAPIService:APIService resourceName:resourceName];
@@ -146,7 +146,7 @@ NS_ASSUME_NONNULL_BEGIN
if (self.deviceTokenGenerator.isSupported) {
return [FBLPromise resolvedWith:[NSNull null]];
} else {
NSError *error = [GACAppCheckErrorUtil unsupportedAttestationProvider:@"DeviceCheckProvider"];
NSError *error = [_GACAppCheckErrorUtil unsupportedAttestationProvider:@"DeviceCheckProvider"];
FBLPromise *rejectedPromise = [FBLPromise pendingPromise];
[rejectedPromise reject:error];
return rejectedPromise;