Skip to content

Commit fc6284c

Browse files
Integrate App Check with Firebase umbrella pod (#7937)
* App Check: add to Firebase pod * Dangerfile: add App Check * Add App Check to Firebase.h * Add App Check to FirebaseManifest.swift * AppCheck: use Firebase version * style * Fix App Check swift tests for --use-libraries * Fix copyright * Revert unecessary changes * Disable tests on CI for pod lib lint with --use-libraries and --use-modular-headers
1 parent 697902b commit fc6284c

File tree

14 files changed

+45
-64
lines changed

14 files changed

+45
-64
lines changed

.github/workflows/app_check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ jobs:
4848
strategy:
4949
matrix:
5050
flags: [
51-
'--use-modular-headers',
52-
'--use-libraries'
51+
'--skip-tests --use-modular-headers',
52+
'--skip-tests --use-libraries'
5353
]
5454
needs: pod_lib_lint
5555
steps:

CoreOnly/Sources/Firebase.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
#import <FirebaseAnalytics/FirebaseAnalytics.h>
2323
#endif
2424
25+
#if __has_include(<FirebaseAppCheck/FirebaseAppCheck.h>)
26+
#import <FirebaseAppCheck/FirebaseAppCheck.h>
27+
#endif
28+
2529
#if __has_include(<FirebaseAppDistribution/FirebaseAppDistribution.h>)
2630
#import <FirebaseAppDistribution/FirebaseAppDistribution.h>
2731
#endif

Dangerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ end
3636
def labelsForModifiedFiles()
3737
labels = []
3838
labels.push("api: abtesting") if @has_abtesting_changes
39+
labels.push("api: appcheck") if @has_appcheck_changes
3940
labels.push("api: appdistribution") if @has_appdistribution_changes
4041
labels.push("api: auth") if @has_auth_changes
4142
labels.push("api: core") if @has_core_changes
@@ -73,6 +74,8 @@ has_license_changes = didModify(["LICENSE"])
7374
## Product directories
7475
@has_abtesting_changes = hasChangesIn("FirebaseABTesting/")
7576
@has_abtesting_api_changes = hasChangesIn("FirebaseABTesting/Sources/Public/")
77+
@has_appcheck_changes = hasChangesIn("FirebaseAppCheck/")
78+
@has_appcheck_api_changes = hasChangesIn("FirebaseAppCheck/Sources/Public/")
7679
@has_appdistribution_changes = hasChangesIn("FirebaseAppDistribution/")
7780
@has_appdistribution_api_changes = hasChangesIn("FirebaseAppDistribution/Sources/Public")
7881
@has_auth_changes = hasChangesIn("FirebaseAuth")
@@ -113,6 +116,7 @@ has_license_changes = didModify(["LICENSE"])
113116

114117
# Convenient flag for all API changes.
115118
@has_api_changes = @has_abtesting_api_changes ||
119+
@has_appcheck_api_changes ||
116120
@has_auth_api_changes ||
117121
@has_appdistribution_api_changes ||
118122
@has_core_api_changes ||

Firebase.podspec

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ Simplify your app development, grow your user base, and monetize more effectivel
8888
ss.ios.dependency 'FirebaseAppDistribution', '~> 7.11.0-beta'
8989
end
9090

91+
s.subspec 'AppCheck' do |ss|
92+
ss.dependency 'Firebase/CoreOnly'
93+
ss.ios.dependency 'FirebaseAppCheck', '~> 7.11.0-beta'
94+
end
95+
9196
s.subspec 'Auth' do |ss|
9297
ss.dependency 'Firebase/CoreOnly'
9398
ss.dependency 'FirebaseAuth', '~> 7.11.0'

FirebaseAppCheck.podspec

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'FirebaseAppCheck'
3-
s.version = '7.6.0-beta'
3+
s.version = '7.11.0-beta'
44
s.summary = 'Firebase App Check SDK.'
55

66
s.description = <<-DESC
@@ -42,15 +42,17 @@ Pod::Spec.new do |s|
4242
s.dependency 'PromisesObjC', '~> 1.2'
4343
s.dependency 'GoogleUtilities/Environment', '~> 7.2'
4444

45-
preprocessor_definitions = 'FIRAppCheck_LIB_VERSION=' + String(s.version)
4645
s.pod_target_xcconfig = {
4746
'GCC_C_LANGUAGE_STANDARD' => 'c99',
48-
'GCC_PREPROCESSOR_DEFINITIONS' => preprocessor_definitions,
4947
'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}"'
5048
}
5149

5250
s.test_spec 'unit' do |unit_tests|
53-
unit_tests.platforms = {:ios => ios_deployment_target, :osx => osx_deployment_target, :tvos => tvos_deployment_target}
51+
unit_tests.platforms = {
52+
:ios => ios_deployment_target,
53+
:osx => osx_deployment_target,
54+
:tvos => tvos_deployment_target
55+
}
5456
unit_tests.source_files = [
5557
base_dir + 'Tests/Unit/**/*.[mh]',
5658
base_dir + 'Tests/Utils/**/*.[mh]',
@@ -65,17 +67,29 @@ Pod::Spec.new do |s|
6567
end
6668

6769
s.test_spec 'integration' do |integration_tests|
68-
integration_tests.platforms = {:ios => ios_deployment_target, :osx => osx_deployment_target, :tvos => tvos_deployment_target}
69-
integration_tests.source_files = base_dir + 'Tests/Integration/**/*.[mh]',
70-
base_dir + 'Tests/Integration/**/*.[mh]',
71-
integration_tests.resources = base_dir + 'Tests/Fixture/**/*'
72-
integration_tests.requires_app_host = true
70+
integration_tests.platforms = {
71+
:ios => ios_deployment_target,
72+
:osx => osx_deployment_target,
73+
:tvos => tvos_deployment_target
74+
}
75+
integration_tests.source_files = [
76+
base_dir + 'Tests/Integration/**/*.[mh]',
77+
base_dir + 'Tests/Integration/**/*.[mh]',
78+
]
79+
integration_tests.resources = base_dir + 'Tests/Fixture/**/*'
80+
integration_tests.requires_app_host = true
7381
end
7482

7583
s.test_spec 'swift-unit' do |swift_unit_tests|
76-
swift_unit_tests.platforms = {:ios => ios_deployment_target, :osx => osx_deployment_target, :tvos => tvos_deployment_target}
77-
swift_unit_tests.source_files = base_dir + 'Tests/Unit/Swift/**/*.swift',
78-
base_dir + 'Tests/Unit/Swift/**/*.h'
84+
swift_unit_tests.platforms = {
85+
:ios => ios_deployment_target,
86+
:osx => osx_deployment_target,
87+
:tvos => tvos_deployment_target
88+
}
89+
swift_unit_tests.source_files = [
90+
base_dir + 'Tests/Unit/Swift/**/*.swift',
91+
base_dir + 'Tests/Unit/Swift/**/*.h',
92+
]
7993
end
8094

8195
end

FirebaseAppCheck/Sources/Core/APIService/FIRAppCheckAPIService.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#import "FirebaseAppCheck/Sources/Core/APIService/FIRAppCheckToken+APIResponse.h"
2525
#import "FirebaseAppCheck/Sources/Core/Errors/FIRAppCheckErrorUtil.h"
2626
#import "FirebaseAppCheck/Sources/Core/FIRAppCheckLogger.h"
27-
#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckVersion.h"
2827

2928
#import "FirebaseCore/Sources/Private/FirebaseCoreInternal.h"
3029

@@ -113,7 +112,7 @@ - (instancetype)initWithURLSession:(NSURLSession *)session
113112
[request setValue:self.APIKey forHTTPHeaderField:kAPIKeyHeaderKey];
114113

115114
NSString *versionHeader =
116-
[NSString stringWithFormat:@"fire-app-check/%s", FIRAppCheckVersionStr];
115+
[NSString stringWithFormat:@"fire-app-check/%@", FIRFirebaseVersion()];
117116
[request setValue:versionHeader forHTTPHeaderField:kUserAgentKey];
118117
// TODO: Uncomment to re-enable platform logging once approved.
119118
// User agent header.

FirebaseAppCheck/Sources/Core/FIRAppCheck.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckProvider.h"
2626
#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckProviderFactory.h"
2727
#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckToken.h"
28-
#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckVersion.h"
2928

3029
#import "FirebaseAppCheck/Sources/Core/Errors/FIRAppCheckErrorUtil.h"
3130
#import "FirebaseAppCheck/Sources/Core/FIRAppCheckLogger.h"

FirebaseAppCheck/Sources/Core/FIRAppCheckVersion.m

Lines changed: 0 additions & 23 deletions
This file was deleted.

FirebaseAppCheck/Sources/DeviceCheckProvider/FIRDeviceCheckProvider.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#import "FBLPromises.h"
2525
#endif
2626

27-
#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckVersion.h"
2827
#import "FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRDeviceCheckProvider.h"
2928

3029
#import "FirebaseAppCheck/Sources/Core/APIService/FIRAppCheckAPIService.h"

FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckVersion.h

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)