-
Notifications
You must be signed in to change notification settings - Fork 2.3k
fix(app-check): validate provider name and error on unrecognized values #9106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
c84b832
350e2ad
5137991
ebfd8c4
119c071
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,6 +73,12 @@ - (void)configure:(FIRApp *)app | |
| self.delegateProvider = [[FIRDeviceCheckProvider alloc] initWithApp:app]; | ||
| } | ||
| } | ||
|
|
||
| if (self.delegateProvider == nil) { | ||
| NSLog(@"RNFBAppCheck: Unknown provider name \"%@\". Valid providers are: debug, deviceCheck, " | ||
| @"appAttest, appAttestWithDeviceCheckFallback.", | ||
| providerName); | ||
| } | ||
|
Comment on lines
+77
to
+81
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same concern as the Android nil/ Also worth resetting Proposed parity with Android (touches provider + module):
- (void)configure:(FIRApp *)app
providerName:(NSString *)providerName
debugToken:(NSString *)debugToken {
// ... existing logging ...
// Each configure replaces the prior delegate (same as Android).
self.delegateProvider = nil;
// ... existing providerName if-branches unchanged ...
if (self.delegateProvider == nil) {
NSString *message = [NSString
stringWithFormat:@"Unknown provider name \"%@\". Valid providers are: debug, "
@"deviceCheck, appAttest, appAttestWithDeviceCheckFallback.",
providerName ?: @"(null)"];
NSLog(@"RNFBAppCheck: %@", message);
@throw [NSException exceptionWithName:@"RNFBAppCheckException"
reason:message
userInfo:nil];
}
}
@try {
[[RNFBAppCheckModule sharedInstance].providerFactory configure:firebaseApp
providerName:providerName
debugToken:debugToken];
resolve([NSNull null]);
} @catch (NSException *exception) {
[RNFBSharedUtils rejectPromiseWithUserInfo:reject
userInfo:(NSMutableDictionary *)@{
@"code" : @"unknown",
@"message" : exception.reason ?: @"internal-error",
}];
} |
||
| } | ||
|
|
||
| - (void)getTokenWithCompletion:(nonnull void (^)(FIRAppCheckToken *_Nullable, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.