Skip to content
Open
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
6 changes: 6 additions & 0 deletions app_check/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ set(common_SRCS
src/include/firebase/app_check/play_integrity_provider.h
src/include/firebase/app_check/device_check_provider.h
src/include/firebase/app_check/app_attest_provider.h
src/include/firebase/app_check/recaptcha_enterprise_provider.h
)

# Run gradle command to make jar
Expand All @@ -49,6 +50,8 @@ set(android_SRCS
# Unsupported providers
src/stub/app_attest_provider_stub.cc
src/stub/device_check_provider_stub.cc
# TODO: Move when implemented
src/stub/recaptcha_enterprise_provider_stub.cc
)

# Source files used by the iOS implementation.
Expand All @@ -64,6 +67,8 @@ set(ios_SRCS
src/ios/device_check_provider_ios.mm
# Unsupported providers
src/stub/play_integrity_provider_stub.cc
# TODO: Move when implemented
src/stub/recaptcha_enterprise_provider_stub.cc
)

# Flatbuffer resource files used by desktop
Expand Down Expand Up @@ -114,6 +119,7 @@ set(desktop_SRCS
src/stub/app_attest_provider_stub.cc
src/stub/device_check_provider_stub.cc
src/stub/play_integrity_provider_stub.cc
src/stub/recaptcha_enterprise_provider_stub.cc
)

if(ANDROID)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef FIREBASE_APP_CHECK_SRC_INCLUDE_FIREBASE_APP_CHECK_RECAPTCHA_ENTERPRISE_PROVIDER_H_
#define FIREBASE_APP_CHECK_SRC_INCLUDE_FIREBASE_APP_CHECK_RECAPTCHA_ENTERPRISE_PROVIDER_H_

#include "firebase/app_check.h"

namespace firebase {
namespace app_check {

namespace internal {
class RecaptchaEnterpriseProviderFactoryInternal;
}

/// Implementation of an {@link AppCheckProviderFactory} that builds
/// RecaptchaEnterpriseProviders. This is the default implementation.
class RecaptchaEnterpriseProviderFactory : public AppCheckProviderFactory {
public:
#if !defined(DOXYGEN)
RecaptchaEnterpriseProviderFactory(
const RecaptchaEnterpriseProviderFactory&) = delete;
RecaptchaEnterpriseProviderFactory& operator=(
const RecaptchaEnterpriseProviderFactory&) = delete;
#endif // !defined(DOXYGEN)

/// Gets an instance of this class for installation into a
/// firebase::app_check::AppCheck instance.
static RecaptchaEnterpriseProviderFactory* GetInstance();

/// Gets the AppCheckProvider associated with the given
/// {@link App} instance, or creates one if none
/// already exists.
firebase::app_check::AppCheckProvider* CreateProvider(App* app) override;

private:
RecaptchaEnterpriseProviderFactory();
~RecaptchaEnterpriseProviderFactory() override;

internal::RecaptchaEnterpriseProviderFactoryInternal* internal_;
};

} // namespace app_check
} // namespace firebase

#endif // FIREBASE_APP_CHECK_SRC_INCLUDE_FIREBASE_APP_CHECK_RECAPTCHA_ENTERPRISE_PROVIDER_H_
37 changes: 37 additions & 0 deletions app_check/src/stub/recaptcha_enterprise_provider_stub.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "app/src/log.h"
#include "firebase/app_check/recaptcha_enterprise_provider.h"

namespace firebase {
namespace app_check {

RecaptchaEnterpriseProviderFactory*
RecaptchaEnterpriseProviderFactory::GetInstance() {
LogError("Recaptcha Enterprise is not supported on this platform.");
return nullptr;
}

RecaptchaEnterpriseProviderFactory::RecaptchaEnterpriseProviderFactory()
: internal_(nullptr) {}

RecaptchaEnterpriseProviderFactory::~RecaptchaEnterpriseProviderFactory() {}

AppCheckProvider* RecaptchaEnterpriseProviderFactory::CreateProvider(App* app) {
return nullptr;
}

} // namespace app_check
} // namespace firebase
Loading