Skip to content

Commit e86a142

Browse files
committed
Add Recaptcha App Check Provider stubs
1 parent 4863376 commit e86a142

3 files changed

Lines changed: 97 additions & 0 deletions

File tree

app_check/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ set(common_SRCS
2424
src/include/firebase/app_check/play_integrity_provider.h
2525
src/include/firebase/app_check/device_check_provider.h
2626
src/include/firebase/app_check/app_attest_provider.h
27+
src/include/firebase/recaptcha_enterprise_provider.h
2728
)
2829

2930
# Run gradle command to make jar
@@ -49,6 +50,8 @@ set(android_SRCS
4950
# Unsupported providers
5051
src/stub/app_attest_provider_stub.cc
5152
src/stub/device_check_provider_stub.cc
53+
# TODO: Move when implemented
54+
src/stub/recaptcha_enterprise_provider_stub.cc
5255
)
5356

5457
# Source files used by the iOS implementation.
@@ -64,6 +67,8 @@ set(ios_SRCS
6467
src/ios/device_check_provider_ios.mm
6568
# Unsupported providers
6669
src/stub/play_integrity_provider_stub.cc
70+
# TODO: Move when implemented
71+
src/stub/recaptcha_enterprise_provider_stub.cc
6772
)
6873

6974
# Flatbuffer resource files used by desktop
@@ -114,6 +119,7 @@ set(desktop_SRCS
114119
src/stub/app_attest_provider_stub.cc
115120
src/stub/device_check_provider_stub.cc
116121
src/stub/play_integrity_provider_stub.cc
122+
src/stub/recaptcha_enterprise_provider_stub.cc
117123
)
118124

119125
if(ANDROID)
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// Copyright 2026 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#ifndef FIREBASE_APP_CHECK_SRC_INCLUDE_FIREBASE_APP_CHECK_RECAPTCHA_ENTERPRISE_PROVIDER_H_
16+
#define FIREBASE_APP_CHECK_SRC_INCLUDE_FIREBASE_APP_CHECK_RECAPTCHA_ENTERPRISE_PROVIDER_H_
17+
18+
#include "firebase/app_check.h"
19+
20+
namespace firebase {
21+
namespace app_check {
22+
23+
namespace internal {
24+
class RecaptchaEnterpriseProviderFactoryInternal;
25+
}
26+
27+
/// Implementation of an {@link AppCheckProviderFactory} that builds
28+
/// RecaptchaEnterpriseProviders. This is the default implementation.
29+
class RecaptchaEnterpriseProviderFactory : public AppCheckProviderFactory {
30+
public:
31+
#if !defined(DOXYGEN)
32+
RecaptchaEnterpriseProviderFactory(const RecaptchaEnterpriseProviderFactory&) = delete;
33+
RecaptchaEnterpriseProviderFactory& operator=(const RecaptchaEnterpriseProviderFactory&) =
34+
delete;
35+
#endif // !defined(DOXYGEN)
36+
37+
/// Gets an instance of this class for installation into a
38+
/// firebase::app_check::AppCheck instance.
39+
static RecaptchaEnterpriseProviderFactory* GetInstance();
40+
41+
/// Gets the AppCheckProvider associated with the given
42+
/// {@link App} instance, or creates one if none
43+
/// already exists.
44+
firebase::app_check::AppCheckProvider* CreateProvider(App* app) override;
45+
46+
private:
47+
RecaptchaEnterpriseProviderFactory();
48+
~RecaptchaEnterpriseProviderFactory() override;
49+
50+
internal::RecaptchaEnterpriseProviderFactoryInternal* internal_;
51+
};
52+
53+
} // namespace app_check
54+
} // namespace firebase
55+
56+
#endif // FIREBASE_APP_CHECK_SRC_INCLUDE_FIREBASE_APP_CHECK_RECAPTCHA_ENTERPRISE_PROVIDER_H_
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Copyright 2026 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#include "app/src/log.h"
16+
#include "firebase/app_check/recaptcha_enterprise_provider.h"
17+
18+
namespace firebase {
19+
namespace app_check {
20+
21+
RecaptchaEnterpriseProviderFactory* RecaptchaEnterpriseProviderFactory::GetInstance() {
22+
LogError("Recaptcha Enterprise is not supported on this platform.");
23+
return nullptr;
24+
}
25+
26+
RecaptchaEnterpriseProviderFactory::RecaptchaEnterpriseProviderFactory() {}
27+
28+
RecaptchaEnterpriseProviderFactory::~RecaptchaEnterpriseProviderFactory() {}
29+
30+
AppCheckProvider* RecaptchaEnterpriseProviderFactory::CreateProvider(App* app) {
31+
return nullptr;
32+
}
33+
34+
} // namespace app_check
35+
} // namespace firebase

0 commit comments

Comments
 (0)