diff --git a/.github/workflows/app_check.yml b/.github/workflows/app_check.yml index 9e1c8129e9..e7b92138b9 100644 --- a/.github/workflows/app_check.yml +++ b/.github/workflows/app_check.yml @@ -48,8 +48,8 @@ jobs: strategy: matrix: flags: [ - '--use-modular-headers', - '--use-libraries' + '--skip-tests --use-modular-headers', + '--skip-tests --use-libraries' ] needs: pod_lib_lint steps: diff --git a/CoreOnly/Sources/Firebase.h b/CoreOnly/Sources/Firebase.h index 3cf4503fdb..3d6ac97e7e 100755 --- a/CoreOnly/Sources/Firebase.h +++ b/CoreOnly/Sources/Firebase.h @@ -22,6 +22,10 @@ #import #endif + #if __has_include() + #import + #endif + #if __has_include() #import #endif diff --git a/Dangerfile b/Dangerfile index a69d6b08ac..357782b6c2 100644 --- a/Dangerfile +++ b/Dangerfile @@ -36,6 +36,7 @@ end def labelsForModifiedFiles() labels = [] labels.push("api: abtesting") if @has_abtesting_changes + labels.push("api: appcheck") if @has_appcheck_changes labels.push("api: appdistribution") if @has_appdistribution_changes labels.push("api: auth") if @has_auth_changes labels.push("api: core") if @has_core_changes @@ -73,6 +74,8 @@ has_license_changes = didModify(["LICENSE"]) ## Product directories @has_abtesting_changes = hasChangesIn("FirebaseABTesting/") @has_abtesting_api_changes = hasChangesIn("FirebaseABTesting/Sources/Public/") +@has_appcheck_changes = hasChangesIn("FirebaseAppCheck/") +@has_appcheck_api_changes = hasChangesIn("FirebaseAppCheck/Sources/Public/") @has_appdistribution_changes = hasChangesIn("FirebaseAppDistribution/") @has_appdistribution_api_changes = hasChangesIn("FirebaseAppDistribution/Sources/Public") @has_auth_changes = hasChangesIn("FirebaseAuth") @@ -113,6 +116,7 @@ has_license_changes = didModify(["LICENSE"]) # Convenient flag for all API changes. @has_api_changes = @has_abtesting_api_changes || + @has_appcheck_api_changes || @has_auth_api_changes || @has_appdistribution_api_changes || @has_core_api_changes || diff --git a/Firebase.podspec b/Firebase.podspec index b6fd2e8c1d..71fde2e0db 100644 --- a/Firebase.podspec +++ b/Firebase.podspec @@ -88,6 +88,11 @@ Simplify your app development, grow your user base, and monetize more effectivel ss.ios.dependency 'FirebaseAppDistribution', '~> 7.11.0-beta' end + s.subspec 'AppCheck' do |ss| + ss.dependency 'Firebase/CoreOnly' + ss.ios.dependency 'FirebaseAppCheck', '~> 7.11.0-beta' + end + s.subspec 'Auth' do |ss| ss.dependency 'Firebase/CoreOnly' ss.dependency 'FirebaseAuth', '~> 7.11.0' diff --git a/FirebaseAppCheck.podspec b/FirebaseAppCheck.podspec index 92d6f6b2eb..0e39e6c1b8 100644 --- a/FirebaseAppCheck.podspec +++ b/FirebaseAppCheck.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'FirebaseAppCheck' - s.version = '7.6.0-beta' + s.version = '7.11.0-beta' s.summary = 'Firebase App Check SDK.' s.description = <<-DESC @@ -42,15 +42,17 @@ Pod::Spec.new do |s| s.dependency 'PromisesObjC', '~> 1.2' s.dependency 'GoogleUtilities/Environment', '~> 7.2' - preprocessor_definitions = 'FIRAppCheck_LIB_VERSION=' + String(s.version) s.pod_target_xcconfig = { 'GCC_C_LANGUAGE_STANDARD' => 'c99', - 'GCC_PREPROCESSOR_DEFINITIONS' => preprocessor_definitions, 'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}"' } s.test_spec 'unit' do |unit_tests| - unit_tests.platforms = {:ios => ios_deployment_target, :osx => osx_deployment_target, :tvos => tvos_deployment_target} + unit_tests.platforms = { + :ios => ios_deployment_target, + :osx => osx_deployment_target, + :tvos => tvos_deployment_target + } unit_tests.source_files = [ base_dir + 'Tests/Unit/**/*.[mh]', base_dir + 'Tests/Utils/**/*.[mh]', @@ -65,17 +67,29 @@ Pod::Spec.new do |s| end s.test_spec 'integration' do |integration_tests| - integration_tests.platforms = {:ios => ios_deployment_target, :osx => osx_deployment_target, :tvos => tvos_deployment_target} - integration_tests.source_files = base_dir + 'Tests/Integration/**/*.[mh]', - base_dir + 'Tests/Integration/**/*.[mh]', - integration_tests.resources = base_dir + 'Tests/Fixture/**/*' - integration_tests.requires_app_host = true + integration_tests.platforms = { + :ios => ios_deployment_target, + :osx => osx_deployment_target, + :tvos => tvos_deployment_target + } + integration_tests.source_files = [ + base_dir + 'Tests/Integration/**/*.[mh]', + base_dir + 'Tests/Integration/**/*.[mh]', + ] + integration_tests.resources = base_dir + 'Tests/Fixture/**/*' + integration_tests.requires_app_host = true end s.test_spec 'swift-unit' do |swift_unit_tests| - swift_unit_tests.platforms = {:ios => ios_deployment_target, :osx => osx_deployment_target, :tvos => tvos_deployment_target} - swift_unit_tests.source_files = base_dir + 'Tests/Unit/Swift/**/*.swift', - base_dir + 'Tests/Unit/Swift/**/*.h' + swift_unit_tests.platforms = { + :ios => ios_deployment_target, + :osx => osx_deployment_target, + :tvos => tvos_deployment_target + } + swift_unit_tests.source_files = [ + base_dir + 'Tests/Unit/Swift/**/*.swift', + base_dir + 'Tests/Unit/Swift/**/*.h', + ] end end diff --git a/FirebaseAppCheck/Sources/Core/APIService/FIRAppCheckAPIService.m b/FirebaseAppCheck/Sources/Core/APIService/FIRAppCheckAPIService.m index 4d2a65f520..f6ba7fb805 100644 --- a/FirebaseAppCheck/Sources/Core/APIService/FIRAppCheckAPIService.m +++ b/FirebaseAppCheck/Sources/Core/APIService/FIRAppCheckAPIService.m @@ -24,7 +24,6 @@ #import "FirebaseAppCheck/Sources/Core/APIService/FIRAppCheckToken+APIResponse.h" #import "FirebaseAppCheck/Sources/Core/Errors/FIRAppCheckErrorUtil.h" #import "FirebaseAppCheck/Sources/Core/FIRAppCheckLogger.h" -#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckVersion.h" #import "FirebaseCore/Sources/Private/FirebaseCoreInternal.h" @@ -113,7 +112,7 @@ static NSString *const kDefaultBaseURL = @"https://firebaseappcheck.googleapis.c [request setValue:self.APIKey forHTTPHeaderField:kAPIKeyHeaderKey]; NSString *versionHeader = - [NSString stringWithFormat:@"fire-app-check/%s", FIRAppCheckVersionStr]; + [NSString stringWithFormat:@"fire-app-check/%@", FIRFirebaseVersion()]; [request setValue:versionHeader forHTTPHeaderField:kUserAgentKey]; // TODO: Uncomment to re-enable platform logging once approved. // User agent header. diff --git a/FirebaseAppCheck/Sources/Core/FIRAppCheck.m b/FirebaseAppCheck/Sources/Core/FIRAppCheck.m index 79de68c42f..4a59a55af4 100644 --- a/FirebaseAppCheck/Sources/Core/FIRAppCheck.m +++ b/FirebaseAppCheck/Sources/Core/FIRAppCheck.m @@ -25,7 +25,6 @@ #import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckProvider.h" #import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckProviderFactory.h" #import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckToken.h" -#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckVersion.h" #import "FirebaseAppCheck/Sources/Core/Errors/FIRAppCheckErrorUtil.h" #import "FirebaseAppCheck/Sources/Core/FIRAppCheckLogger.h" diff --git a/FirebaseAppCheck/Sources/Core/FIRAppCheckVersion.m b/FirebaseAppCheck/Sources/Core/FIRAppCheckVersion.m deleted file mode 100644 index 408976d65c..0000000000 --- a/FirebaseAppCheck/Sources/Core/FIRAppCheckVersion.m +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2020 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. - */ - -#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckVersion.h" - -// Convert the macro to a string -#define STR(x) STR_EXPAND(x) -#define STR_EXPAND(x) #x - -const char *const FIRAppCheckVersionStr = (const char *const)STR(FIRAppCheck_LIB_VERSION); diff --git a/FirebaseAppCheck/Sources/DeviceCheckProvider/FIRDeviceCheckProvider.m b/FirebaseAppCheck/Sources/DeviceCheckProvider/FIRDeviceCheckProvider.m index 2af0cf9d5e..3f3407f7f1 100644 --- a/FirebaseAppCheck/Sources/DeviceCheckProvider/FIRDeviceCheckProvider.m +++ b/FirebaseAppCheck/Sources/DeviceCheckProvider/FIRDeviceCheckProvider.m @@ -24,7 +24,6 @@ #import "FBLPromises.h" #endif -#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckVersion.h" #import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRDeviceCheckProvider.h" #import "FirebaseAppCheck/Sources/Core/APIService/FIRAppCheckAPIService.h" diff --git a/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckVersion.h b/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckVersion.h deleted file mode 100644 index 32c86d3b14..0000000000 --- a/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckVersion.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2020 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. - */ - -#import - -FOUNDATION_EXPORT const char *const FIRAppCheckVersionStr; diff --git a/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FirebaseAppCheck.h b/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FirebaseAppCheck.h index f2fc0a3a8a..234abeebf3 100644 --- a/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FirebaseAppCheck.h +++ b/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FirebaseAppCheck.h @@ -18,7 +18,6 @@ #import "FIRAppCheckProvider.h" #import "FIRAppCheckProviderFactory.h" #import "FIRAppCheckToken.h" -#import "FIRAppCheckVersion.h" // Debug provider #import "FIRAppCheckDebugProvider.h" diff --git a/FirebaseAppCheck/Tests/Unit/Core/FIRAppCheckAPIServiceTests.m b/FirebaseAppCheck/Tests/Unit/Core/FIRAppCheckAPIServiceTests.m index 901f51a388..9e3646620e 100644 --- a/FirebaseAppCheck/Tests/Unit/Core/FIRAppCheckAPIServiceTests.m +++ b/FirebaseAppCheck/Tests/Unit/Core/FIRAppCheckAPIServiceTests.m @@ -19,8 +19,6 @@ #import "FBLPromise+Testing.h" #import "OCMock.h" -#import - #import #import @@ -93,7 +91,7 @@ // TODO: Replace the assertions by the commented below once platform logging approved. NSString *appCheckVersionHeader = - [NSString stringWithFormat:@"fire-app-check/%s", FIRAppCheckVersionStr]; + [NSString stringWithFormat:@"fire-app-check/%@", FIRFirebaseVersion()]; XCTAssertEqualObjects(request.allHTTPHeaderFields[@"x-firebase-client"], appCheckVersionHeader); XCTAssertNil(request.allHTTPHeaderFields[@"X-firebase-client-log-type"]); // XCTAssertEqualObjects(request.allHTTPHeaderFields[@"x-firebase-client"], diff --git a/FirebaseAppCheck/Tests/Unit/Swift/AppCheckTests.swift b/FirebaseAppCheck/Tests/Unit/Swift/AppCheckTests.swift index 3e22e285d0..57c5f01b7a 100644 --- a/FirebaseAppCheck/Tests/Unit/Swift/AppCheckTests.swift +++ b/FirebaseAppCheck/Tests/Unit/Swift/AppCheckTests.swift @@ -15,6 +15,7 @@ */ import XCTest + import FirebaseCore import FirebaseAppCheck diff --git a/ReleaseTooling/Sources/FirebaseManifest/FirebaseManifest.swift b/ReleaseTooling/Sources/FirebaseManifest/FirebaseManifest.swift index 2c28046738..6cf1a4e849 100755 --- a/ReleaseTooling/Sources/FirebaseManifest/FirebaseManifest.swift +++ b/ReleaseTooling/Sources/FirebaseManifest/FirebaseManifest.swift @@ -31,6 +31,7 @@ public let shared = Manifest( Pod("FirebaseAnalytics", isClosedSource: true, platforms: ["ios"], zip: true), Pod("FirebaseAnalyticsSwift", isBeta: true, platforms: ["ios"]), Pod("FirebaseABTesting", zip: true), + Pod("FirebaseAppCheck", isBeta: true, zip: true), Pod("FirebaseRemoteConfig", zip: true), Pod("FirebaseAppDistribution", isBeta: true, platforms: ["ios"], zip: true), Pod("FirebaseAuth", zip: true),