Skip to content

Commit 7bc430a

Browse files
authored
fixes
1 parent ecc0b00 commit 7bc430a

7 files changed

Lines changed: 2 additions & 227 deletions

File tree

FirebaseAppCheck/CHANGELOG.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# Unreleased
2-
- [added] Added reCAPTCHA Enterprise provider.
3-
41
# 10.27.0
52
- [fixed] [CocoaPods] missing symbol error for FIRGetLoggerLevel. (#12899)
63

FirebaseAppCheck/Sources/Core/FIRAppCheckLogger.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@
3535
// FIRDeviceCheckProvider.m
3636
NSString *const kFIRLoggerAppCheckMessageDeviceCheckProviderIncompleteFIROptions = @"I-FAA006001";
3737

38-
// FIRRecaptchaEnterpriseProvider.m
39-
NSString *const kFIRLoggerAppCheckMessageRecaptchaEnterpriseProviderIncompleteFIROptions =
40-
@"I-FAA007001";
41-
4238
#pragma mark - Log functions
4339

4440
void FIRAppCheckDebugLog(NSString *messageCode, NSString *message, ...) {
Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +0,0 @@
1-
/*
2-
* Copyright 2026 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-
17-
#import <Foundation/Foundation.h>
18-
#import "FIRAppCheckProviderFactory.h"
19-
20-
NS_ASSUME_NONNULL_BEGIN
21-
22-
NS_SWIFT_NAME(AppCheckRecaptchaEnterpriseProviderFactory)
23-
@interface FIRAppCheckRecaptchaEnterpriseProviderFactory : NSObject <FIRAppCheckProviderFactory>
24-
25-
- (instancetype)init NS_UNAVAILABLE;
26-
- (nullable instancetype)initWithSiteKey:(NSString *)siteKey;
27-
28-
@end
29-
NS_ASSUME_NONNULL_END
Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +0,0 @@
1-
/*
2-
* Copyright 2026 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-
17-
#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckRecaptchaEnterpriseProviderFactory.h"
18-
19-
#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheck.h"
20-
#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRRecaptchaEnterpriseProvider.h"
21-
22-
@interface FIRAppCheckRecaptchaEnterpriseProviderFactory ()
23-
24-
@property(nonatomic, readonly) NSString *siteKey;
25-
26-
@end
27-
28-
@implementation FIRAppCheckRecaptchaEnterpriseProviderFactory
29-
30-
- (nullable instancetype)initWithSiteKey:(NSString *)siteKey {
31-
self = [super init];
32-
if (self) {
33-
_siteKey = [siteKey copy];
34-
}
35-
return self;
36-
}
37-
38-
- (nullable id<FIRAppCheckProvider>)createProviderWithApp:(nonnull FIRApp *)app {
39-
return [[FIRRecaptchaEnterpriseProvider alloc] initWithApp:app siteKey:self.siteKey];
40-
}
41-
42-
@end
Lines changed: 0 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +0,0 @@
1-
/*
2-
* Copyright 2026 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-
17-
#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRRecaptchaEnterpriseProvider.h"
18-
#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckAvailability.h"
19-
20-
#import <AppCheckCore/AppCheckCore.h>
21-
22-
@import RecaptchaEnterpriseProvider;
23-
24-
#import "FirebaseAppCheck/Sources/Core/FIRApp+AppCheck.h"
25-
26-
#import "FirebaseAppCheck/Sources/Core/FIRAppCheckLogger.h"
27-
#import "FirebaseAppCheck/Sources/Core/FIRAppCheckToken+Internal.h"
28-
#import "FirebaseAppCheck/Sources/Core/FIRAppCheckValidator.h"
29-
#import "FirebaseAppCheck/Sources/Core/FIRHeartbeatLogger+AppCheck.h"
30-
31-
#import "FirebaseCore/Extension/FirebaseCoreInternal.h"
32-
33-
@interface FIRRecaptchaEnterpriseProvider ()
34-
35-
@property(nonatomic, readonly) GACRecaptchaEnterpriseProvider *recaptchaEnterpriseProvider;
36-
37-
@end
38-
39-
@implementation FIRRecaptchaEnterpriseProvider
40-
41-
- (instancetype)initWithRecaptchaEnterpriseProvider:
42-
(GACRecaptchaEnterpriseProvider *)recaptchaEnterpriseProvider {
43-
self = [super init];
44-
if (self) {
45-
_recaptchaEnterpriseProvider = recaptchaEnterpriseProvider;
46-
}
47-
return self;
48-
}
49-
50-
- (nullable instancetype)initWithApp:(FIRApp *)app siteKey:(NSString *)siteKey {
51-
NSArray<NSString *> *missingOptionsFields =
52-
[FIRAppCheckValidator tokenExchangeMissingFieldsInOptions:app.options];
53-
if (missingOptionsFields.count > 0) {
54-
FIRLogError(kFIRLoggerAppCheck,
55-
kFIRLoggerAppCheckMessageRecaptchaEnterpriseProviderIncompleteFIROptions,
56-
@"Cannot instantiate `FIRRecaptchaEnterpriseProvider` for app: %@. The following "
57-
@"`FirebaseOptions` fields are missing: %@",
58-
app.name, [missingOptionsFields componentsJoinedByString:@", "]);
59-
return nil;
60-
}
61-
62-
id heartbeatHook = [app.heartbeatLogger requestHook];
63-
GACRecaptchaEnterpriseProvider *recaptchaEnterpriseProvider =
64-
[[GACRecaptchaEnterpriseProvider alloc]
65-
initWithSiteKey:siteKey
66-
resourceName:app.resourceName
67-
APIKey:app.options.APIKey
68-
requestHooks:heartbeatHook ? @[ heartbeatHook ] : @[]];
69-
70-
return [self initWithRecaptchaEnterpriseProvider:recaptchaEnterpriseProvider];
71-
}
72-
73-
#pragma mark - FIRAppCheckProvider
74-
75-
- (void)getTokenWithCompletion:(void (^)(FIRAppCheckToken *_Nullable token,
76-
NSError *_Nullable error))handler {
77-
[self.recaptchaEnterpriseProvider
78-
getTokenWithCompletion:^(GACAppCheckToken *_Nullable internalToken,
79-
NSError *_Nullable error) {
80-
if (error) {
81-
handler(nil, error);
82-
return;
83-
}
84-
85-
handler([[FIRAppCheckToken alloc] initWithInternalToken:internalToken], nil);
86-
}];
87-
}
88-
89-
- (void)getLimitedUseTokenWithCompletion:(void (^)(FIRAppCheckToken *_Nullable,
90-
NSError *_Nullable))handler {
91-
[self.recaptchaEnterpriseProvider
92-
getLimitedUseTokenWithCompletion:^(GACAppCheckToken *_Nullable internalToken,
93-
NSError *_Nullable error) {
94-
if (error) {
95-
handler(nil, error);
96-
return;
97-
}
98-
99-
handler([[FIRAppCheckToken alloc] initWithInternalToken:internalToken], nil);
100-
}];
101-
}
102-
103-
@end
Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +0,0 @@
1-
/*
2-
* Copyright 2026 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-
17-
#import <XCTest/XCTest.h>
18-
19-
#import <FirebaseAppCheck/FIRAppCheckRecaptchaEnterpriseProviderFactory.h>
20-
#import <FirebaseAppCheck/FIRRecaptchaEnterpriseProvider.h>
21-
22-
#import "FirebaseCore/Extension/FirebaseCoreInternal.h"
23-
24-
@interface FIRAppCheckRecaptchaEnterpriseProviderFactoryTests : XCTestCase
25-
@end
26-
27-
@implementation FIRAppCheckRecaptchaEnterpriseProviderFactoryTests
28-
29-
- (void)testCreateProviderWithApp {
30-
FIROptions *options = [[FIROptions alloc] initWithGoogleAppID:@"app_id" GCMSenderID:@"sender_id"];
31-
options.APIKey = @"api_key";
32-
options.projectID = @"project_id";
33-
FIRApp *app = [[FIRApp alloc] initInstanceWithName:@"testCreateProviderWithApp" options:options];
34-
app.dataCollectionDefaultEnabled = NO;
35-
36-
NSString *siteKey = @"test_site_key";
37-
FIRAppCheckRecaptchaEnterpriseProviderFactory *factory =
38-
[[FIRAppCheckRecaptchaEnterpriseProviderFactory alloc] initWithSiteKey:siteKey];
39-
40-
FIRRecaptchaEnterpriseProvider *createdProvider = [factory createProviderWithApp:app];
41-
42-
XCTAssert([createdProvider isKindOfClass:[FIRRecaptchaEnterpriseProvider class]]);
43-
}
44-
45-
@end

Package.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ let package = Package(
172172
url: "https://github.com/google/interop-ios-for-google-sdks.git",
173173
"101.0.0" ..< "102.0.0"
174174
),
175-
appCheckDependency(),
175+
.package(url: "https://github.com/google/app-check.git",
176+
"11.0.1" ..< "12.0.0"),
176177
],
177178
targets: [
178179
.target(

0 commit comments

Comments
 (0)