Skip to content

Commit e8c8250

Browse files
committed
fix(AppCheck): add siteKey validation and cleanup Package.swift
1 parent e3f36aa commit e8c8250

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

FirebaseAppCheck/Sources/RecaptchaProvider/FIRAppCheckRecaptchaEnterpriseProviderFactory.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ @interface FIRAppCheckRecaptchaEnterpriseProviderFactory ()
2828
@implementation FIRAppCheckRecaptchaEnterpriseProviderFactory
2929

3030
- (instancetype)initWithSiteKey:(NSString *)siteKey {
31+
NSParameterAssert(siteKey.length > 0);
3132
self = [super init];
3233

3334
if (self) {

FirebaseAppCheck/Sources/RecaptchaProvider/FIRRecaptchaEnterpriseProvider.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ - (instancetype)initWithRecaptchaEnterpriseProvider:
4848
}
4949

5050
- (nullable instancetype)initWithApp:(FIRApp *)app siteKey:(NSString *)siteKey {
51+
if (siteKey.length == 0) {
52+
return nil;
53+
}
5154
NSArray<NSString *> *missingOptionsFields =
55+
5256
[FIRAppCheckValidator tokenExchangeMissingFieldsInOptions:app.options];
5357
if (missingOptionsFields.count > 0) {
5458
FIRLogError(kFIRLoggerAppCheck,

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1264,8 +1264,8 @@ let package = Package(
12641264
.product(name: "AppCheckCore", package: "app-check"),
12651265
.product(name: "RecaptchaEnterpriseProvider", package: "app-check"),
12661266
.product(name: "GULEnvironment", package: "GoogleUtilities"),
1267-
12681267
.product(name: "GULUserDefaults", package: "GoogleUtilities"),
1268+
12691269
],
12701270
path: "FirebaseAppCheck/Sources",
12711271
publicHeadersPath: "Public",

0 commit comments

Comments
 (0)