Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(app-check): recaptchaEnterprise for iOS and Android #17782

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

Draft
MichaelVerdon wants to merge 4 commits into main
base: main
Choose a base branch
Loading
from enterprise-recaptcha-mobile
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ private Task<Void> activate(Map<String, Object> arguments) {
PlayIntegrityAppCheckProviderFactory.getInstance());
break;
}
case recaptchaEnterprise:
{
FirebaseAppCheck firebaseAppCheck = getAppCheck(arguments);
firebaseAppCheck.installAppCheckProviderFactory(
ReCaptchaEnterpriseAppCheckProviderFactory.getInstance());
break;
}
}
taskCompletionSource.setResult(null);
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ - (void)configure:(FIRApp *)app
self.delegateProvider = [[FIRDeviceCheckProvider alloc] initWithApp:app];
}
}

if ([providerName isEqualToString:@"recaptchaEnterprise"]) {
self.delegateProvider = [[FIRReCaptchaEnterpriseProvider alloc] initWithApp:app];
}
}

- (void)getTokenWithCompletion:(nonnull void (^)(FIRAppCheckToken *_Nullable,
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export 'package:firebase_app_check_platform_interface/firebase_app_check_platfor
AppleAppAttestProvider,
AppleAppAttestWithDeviceCheckFallbackProvider,
ReCaptchaEnterpriseProvider,
ReCaptchaV3Provider;
AndroidReCaptchaEnterpriseProvider,
AppleReCaptchaEnterpriseProvider;
export 'package:firebase_core_platform_interface/firebase_core_platform_interface.dart'
show FirebaseException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,12 @@ class AndroidDebugProvider extends AndroidAppCheckProvider {
class AndroidPlayIntegrityProvider extends AndroidAppCheckProvider {
const AndroidPlayIntegrityProvider() : super('playIntegrity');
}

/// ReCaptcha Enterprise provider for Android.
///
/// See documentation: <link to docs>
class AndroidReCaptchaEnterpriseProvider extends AndroidAppCheckProvider {
const AndroidReCaptchaEnterpriseProvider(this.siteKey)
: super('recaptchaEnterprise');
final String siteKey;
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,12 @@ class AppleAppAttestWithDeviceCheckFallbackProvider
const AppleAppAttestWithDeviceCheckFallbackProvider()
: super('appAttestWithDeviceCheckFallback');
}

/// ReCaptcha Enterprise provider for Apple platforms.
///
/// See documentation: <link to docs>
class AppleReCaptchaEnterpriseProvider extends AppleAppCheckProvider {
const AppleReCaptchaEnterpriseProvider(this.siteKey)
: super('recaptchaEnterprise');
final String siteKey;
}
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,36 @@ void main() {
},
skip: defaultTargetPlatform != TargetPlatform.iOS,
);

test(
'recaptchaEnterprise on Android',
() async {
await expectLater(
FirebaseAppCheck.instance.activate(
providerAndroid: const AndroidReCaptchaEnterpriseProvider(
siteKey: '6Lemcn0dAAAAABLkf6aiiHvpGD6x-zF3nOSDU2M8',
),
),
completes,
);
},
skip: defaultTargetPlatform != TargetPlatform.android,
);

test(
'recaptchaEnterprise on iOS',
() async {
await expectLater(
FirebaseAppCheck.instance.activate(
providerApple: const AppleReCaptchaEnterpriseProvider(
siteKey: '6Lemcn0dAAAAABLkf6aiiHvpGD6x-zF3nOSDU2M8',
),
),
completes,
);
},
skip: defaultTargetPlatform != TargetPlatform.iOS,
);
},
);
}
Loading

AltStyle によって変換されたページ (->オリジナル) /