Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
f717e12
Extract GACAppCheckSettings from FIRAppCheckSettings (#11214)
andrewheard May 5, 2023
49e1725
Fork App Check dir for use outside of Firebase (#11247)
andrewheard May 9, 2023
f9d1794
Add AppCheck as a dependency of FirebaseAppCheck (#11257)
andrewheard May 9, 2023
0904e5e
[App Check] Rename FIR symbols in unit tests for generic SDK (#11267)
andrewheard May 10, 2023
e494411
Replace GACAppCheckLogger macros with NSLog wrappers (#11269)
andrewheard May 10, 2023
80f1c4d
Remove Firebase-specific implementation in GACAppCheckStorage (#11273)
andrewheard May 10, 2023
85c4a3d
Extract heartbeat logger from GACAppCheckAPIService (#11277)
andrewheard May 11, 2023
6d95814
[App Check] Expose `initWithApp:appCheckProvider:` (#11288)
andrewheard May 15, 2023
2cf85ca
Remove AppCheckProviderFactory from App Check Lite (#11290)
andrewheard May 15, 2023
de2e1b4
Extract Firebase-specific IDs from GACAppAttestAPIService (#11291)
andrewheard May 16, 2023
f46cf8e
Integrate FirebaseAppCheck changes into AppCheck (#11308)
andrewheard May 22, 2023
b729256
Remove Firebase IDs from GACAppAttestKeyIDStorage (#11309)
andrewheard May 22, 2023
6ce0a6c
Remove Firebase-specific implementation from GACAppCheckAPIService (#…
andrewheard May 24, 2023
ec95877
Extract Firebase symbols from GACAppAttestArtifactStorage (#11334)
andrewheard May 26, 2023
98254b0
Remove FIRApp dependencies from GACAppAttestProvider (#11340)
andrewheard May 26, 2023
aeb8e3f
[App Check] Remove Firebase specifics from Debug Provider (#11349)
andrewheard May 29, 2023
810caea
[App Check] Remove Firebase specifics from DeviceCheck Provider (#11352)
andrewheard May 30, 2023
ebfa41b
Add CI infrastructure for App Check (#11358)
andrewheard May 31, 2023
dde80cd
Remove Firebase specifics from `GACAppCheck` (#11368)
andrewheard May 31, 2023
fa377b0
[App Check] Rename symbols in GACAppCheckLogger (#11381)
andrewheard Jun 2, 2023
e6ebe87
Remove `AppCheckInterop` headers from the `AppCheck` SDK (#11404)
andrewheard Jun 6, 2023
d4abe44
Remove `GACAppCheckSettings` from FirebaseAppCheck (#11375)
andrewheard Jun 6, 2023
7565d0c
Replace `FIRAppCheckDebugProvider` with `GACAppCheckDebugProvider` sh…
andrewheard Jun 7, 2023
2e18f30
Replace `FIRAppAttestProvider` with `GACAppAttestProvider` shim (#11418)
andrewheard Jun 13, 2023
5de35f5
Replace `FIRDeviceCheckProvider` with `GACDeviceCheckProvider` shim (…
andrewheard Jun 15, 2023
f29bd3f
Move `GACAppCheckSettings` implementation back to `FIRAppCheckSetting…
andrewheard Jun 20, 2023
24446ae
[App Check] Remove non-interop API surface (#11512)
andrewheard Jul 6, 2023
482739e
[App Check] Replace token refresh `NSNotification`s with delegate (#1…
andrewheard Jul 11, 2023
20ce34b
[App Check] Copy SharedTestUtilities for Lite SDK (#11530)
andrewheard Jul 11, 2023
a35b0a4
[App Check] Depend on FirebaseCoreExtension via podspec (#11538)
andrewheard Jul 13, 2023
3f54723
[App Check] Support custom base URL (#11542)
andrewheard Jul 13, 2023
4ccfe4f
[App Check] Set `limited_use` request param for App Attest (#11544)
andrewheard Jul 13, 2023
611edba
[App Check] Add `limitedUse` parameter to `GACAppAttestProvider` (#11…
andrewheard Jul 13, 2023
a09b332
[App Check] Add log filtering based on log level (#11570)
andrewheard Jul 19, 2023
d186167
[App Check] Replace `gGACAppCheckLogLevel` with class property (#11572)
andrewheard Jul 20, 2023
40f00d3
Rename Swift symbols to AppCheckCore* (#11576)
andrewheard Jul 20, 2023
ed0e3fe
Cleanup some Firebase references in App Check Core (#11578)
andrewheard Jul 20, 2023
8185a36
Renamed `AppCheck` to `AppCheckCore` (#11581)
andrewheard Jul 21, 2023
0b257f8
Make `tokenDelegate` nullable in `GACAppCheck` (#11592)
andrewheard Jul 24, 2023
59b1a64
Implement `FIRAppCheckSettings` as subclass (#11597)
andrewheard Jul 24, 2023
fb660ae
Remove App Check Core Interop SDK (#11595)
andrewheard Jul 24, 2023
4defb65
[App Check] Rename `instanceName` and `storageID` to `serviceName` (#…
andrewheard Jul 25, 2023
e3f76d7
Depend on `AppCheckCore` staged in `SpecsDev` (#11641)
andrewheard Aug 2, 2023
2b2ee22
Add `baseURL:nil` in debug provider
andrewheard Sep 20, 2023
2169855
Remove `AppCheckCore` directory (#11834)
andrewheard Sep 20, 2023
84dbf97
Implement `FIRAppCheck` as a shim of `GACAppCheck` (#11721)
andrewheard Sep 22, 2023
6b1b752
Fix AppCheckCore import
andrewheard Oct 31, 2023
b481cb5
Replace `@import AppCheckCore` with `#import <...>`
andrewheard Oct 31, 2023
b2758ad
Fix AppCheckE2ETests
andrewheard Oct 31, 2023
a5318a1
Remove FirebaseAppCheckIntegration SPM testTarget
andrewheard Oct 31, 2023
8002773
Update AppCheckCore dependency to 10.18.0 (#12030)
andrewheard Nov 2, 2023
7ace85e
Convert errors from `GACAppCheckErrorDomain` to `FIRAppCheckErrorDoma…
andrewheard Nov 6, 2023
1f1ee2b
[Release] Require `GoogleUtilities/Logger` `7.12` in FirebaseCore (#1…
andrewheard Nov 7, 2023
3db9651
[Core] Add `FIRGetLoggerLevel` function (#12065)
andrewheard Nov 7, 2023
4ff62df
Set `GACAppCheckLogger.logLevel` in Firebase App Check (#12066)
andrewheard Nov 7, 2023
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
Prev Previous commit
Next Next commit
Remove App Check Core Interop SDK (#11595)
The ObjC Protocol-only interop SDK is not needed by our integrators.
  • Loading branch information
andrewheard committed Nov 1, 2023
commit fb660ae24dc8c80707fbe903c91c772706ce1e23
1 change: 0 additions & 1 deletion AppCheckCore.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ Pod::Spec.new do |s|
s.osx.weak_framework = 'DeviceCheck'
s.tvos.weak_framework = 'DeviceCheck'

s.dependency 'AppCheckCoreInterop', '~> 10.11'
s.dependency 'PromisesObjC', '~> 2.1'
s.dependency 'GoogleUtilities/Environment', '~> 7.8'

Expand Down
27 changes: 0 additions & 27 deletions AppCheckCore/Interop/CMakeLists.txt

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

17 changes: 0 additions & 17 deletions AppCheckCore/Interop/dummy.m

This file was deleted.

14 changes: 7 additions & 7 deletions AppCheckCore/Sources/Core/GACAppCheck.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
#import "FBLPromises.h"
#endif

@import AppCheckCoreInterop;

#import "AppCheckCore/Sources/Public/AppCheckCore/GACAppCheckErrors.h"
#import "AppCheckCore/Sources/Public/AppCheckCore/GACAppCheckProvider.h"
#import "AppCheckCore/Sources/Public/AppCheckCore/GACAppCheckSettings.h"
Expand All @@ -42,6 +40,9 @@

static NSString *const kDummyFACTokenValue = @"eyJlcnJvciI6IlVOS05PV05fRVJST1IifQ==";

typedef void (^GACAppCheckTokenHandler)(id<GACAppCheckTokenProtocol> _Nullable token,
NSError *_Nullable error);

@interface GACAppCheck ()

@property(nonatomic, readonly) NSString *instanceName;
Expand Down Expand Up @@ -112,10 +113,9 @@ - (instancetype)initWithInstanceName:(NSString *)instanceName

#pragma mark - GACAppCheckInterop

- (void)getTokenForcingRefresh:(BOOL)forcingRefresh
completion:(GACAppCheckTokenHandlerInterop)handler {
- (void)getTokenForcingRefresh:(BOOL)forcingRefresh completion:(GACAppCheckTokenHandler)handler {
[self retrieveOrRefreshTokenForcingRefresh:forcingRefresh]
.then(^id _Nullable(GACAppCheckToken *token) {
.then(^id _Nullable(id<GACAppCheckTokenProtocol> token) {
handler(token, nil);
return token;
})
Expand All @@ -124,9 +124,9 @@ - (void)getTokenForcingRefresh:(BOOL)forcingRefresh
});
}

- (void)getLimitedUseTokenWithCompletion:(GACAppCheckTokenHandlerInterop)handler {
- (void)getLimitedUseTokenWithCompletion:(GACAppCheckTokenHandler)handler {
[self limitedUseToken]
.then(^id _Nullable(GACAppCheckToken *token) {
.then(^id _Nullable(id<GACAppCheckTokenProtocol> token) {
handler(token, nil);
return token;
})
Expand Down
4 changes: 4 additions & 0 deletions AppCheckCore/Sources/Core/GACAppCheckToken.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

@implementation GACAppCheckToken

@synthesize token = _token;
@synthesize expirationDate = _expirationDate;
@synthesize receivedAtDate = _receivedAtDate;

- (instancetype)initWithToken:(NSString *)token
expirationDate:(NSDate *)expirationDate
receivedAtDate:(NSDate *)receivedAtDate {
Expand Down
29 changes: 26 additions & 3 deletions AppCheckCore/Sources/Public/AppCheckCore/GACAppCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,41 @@

#import <Foundation/Foundation.h>

@import AppCheckCoreInterop;

@class GACAppCheckToken;
@protocol GACAppCheckProvider;
@protocol GACAppCheckSettingsProtocol;
@protocol GACAppCheckTokenDelegate;
@protocol GACAppCheckTokenProtocol;

NS_ASSUME_NONNULL_BEGIN

NS_SWIFT_NAME(AppCheckCoreProtocol) @protocol GACAppCheckProtocol

/// Requests Firebase app check token.
///
/// @param forcingRefresh If `YES`, a new Firebase app check token is requested and the token
/// cache is ignored. If `NO`, the cached token is used if it exists and has not expired yet. In
/// most cases, `NO` should be used. `YES` should only be used if the server explicitly returns an
/// error, indicating a revoked token.
/// @param handler The completion handler. Includes the app check token if the request succeeds,
/// or an error if the request fails.
- (void)getTokenForcingRefresh:(BOOL)forcingRefresh
completion:(void (^)(id<GACAppCheckTokenProtocol> _Nullable token,
NSError *_Nullable error))handler
NS_SWIFT_NAME(token(forcingRefresh:completion:));

/// Retrieve a new limited-use App Check token
///
/// This method does not affect the token generation behavior of the
/// ``tokenForcingRefresh()`` method.
- (void)getLimitedUseTokenWithCompletion:(void (^)(id<GACAppCheckTokenProtocol> _Nullable token,
NSError *_Nullable error))handler;

@end

/// A class used to manage App Check tokens for a given resource.
NS_SWIFT_NAME(AppCheckCore)
@interface GACAppCheck : NSObject <GACAppCheckInterop>
@interface GACAppCheck : NSObject <GACAppCheckProtocol>

- (instancetype)init NS_UNAVAILABLE;

Expand Down
13 changes: 8 additions & 5 deletions AppCheckCore/Sources/Public/AppCheckCore/GACAppCheckToken.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@

#import <Foundation/Foundation.h>

@import AppCheckCoreInterop;

NS_ASSUME_NONNULL_BEGIN

/// An object representing a Firebase App Check token.
NS_SWIFT_NAME(AppCheckCoreToken)
@interface GACAppCheckToken : NSObject <GACAppCheckTokenInterop>
NS_SWIFT_NAME(AppCheckCoreTokenProtocol)
@protocol GACAppCheckTokenProtocol <NSObject>

/// A Firebase App Check token.
@property(nonatomic, readonly) NSString *token;
Expand All @@ -33,6 +30,12 @@ NS_SWIFT_NAME(AppCheckCoreToken)
/// The date when the App Check token was received in the device's local time.
@property(nonatomic, readonly) NSDate *receivedAtDate;

@end

/// An object representing a Firebase App Check token.
NS_SWIFT_NAME(AppCheckCoreToken)
@interface GACAppCheckToken : NSObject <GACAppCheckTokenProtocol>

- (instancetype)init NS_UNAVAILABLE;

/// Convenience initializer that uses the current device local time to set `receivedAtDate`.
Expand Down
24 changes: 12 additions & 12 deletions AppCheckCore/Tests/Unit/Core/GACAppCheckTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
static NSString *const kAppName = @"GACAppCheckTests";
static NSString *const kAppGroupID = @"app_group_id";

@interface GACAppCheck (Tests) <GACAppCheckInterop>
@interface GACAppCheck (Tests)

- (instancetype)initWithInstanceName:(NSString *)instanceName
appCheckProvider:(id<GACAppCheckProvider>)appCheckProvider
Expand All @@ -59,7 +59,7 @@ @interface GACAppCheckTests : XCTestCase
@property(nonatomic) OCMockObject<GACAppCheckTokenRefresherProtocol> *mockTokenRefresher;
@property(nonatomic) OCMockObject<GACAppCheckSettingsProtocol> *mockSettings;
@property(nonatomic) OCMockObject<GACAppCheckTokenDelegate> *mockTokenDelegate;
@property(nonatomic) GACAppCheck<GACAppCheckInterop> *appCheck;
@property(nonatomic) GACAppCheck *appCheck;

@property(nonatomic, copy, nullable) GACAppCheckTokenRefreshBlock tokenRefreshHandler;

Expand Down Expand Up @@ -184,7 +184,7 @@ - (void)testInteropGetToken_WhenNoCache_Success {
// 2. Request token and verify result.
[self.appCheck
getTokenForcingRefresh:NO
completion:^(id<GACAppCheckTokenInterop> _Nullable token, NSError *error) {
completion:^(id<GACAppCheckTokenProtocol> _Nullable token, NSError *error) {
[expectation fulfill];
XCTAssertNotNil(token);
XCTAssertEqualObjects(token.token, expectedToken.token);
Expand All @@ -210,7 +210,7 @@ - (void)testInteropGetTokenForcingRefresh_WhenCachedTokenIsValid_Success {
// 2. Request token and verify result.
[self.appCheck
getTokenForcingRefresh:YES
completion:^(id<GACAppCheckTokenInterop> _Nullable token, NSError *error) {
completion:^(id<GACAppCheckTokenProtocol> _Nullable token, NSError *error) {
[expectation fulfill];
XCTAssertNotNil(token);
XCTAssertEqualObjects(token.token, expectedToken.token);
Expand All @@ -232,7 +232,7 @@ - (void)testInteropGetToken_WhenCachedTokenExpired_Success {
// 2. Request token and verify result.
[self.appCheck
getTokenForcingRefresh:NO
completion:^(id<GACAppCheckTokenInterop> _Nullable token, NSError *error) {
completion:^(id<GACAppCheckTokenProtocol> _Nullable token, NSError *error) {
[expectation fulfill];
XCTAssertNotNil(token);
XCTAssertEqualObjects(token.token, expectedToken.token);
Expand All @@ -255,7 +255,7 @@ - (void)testInteropGetToken_AppCheckProviderError {
// 2. Request token and verify result.
[self.appCheck
getTokenForcingRefresh:NO
completion:^(id<GACAppCheckTokenInterop> _Nullable token, NSError *error) {
completion:^(id<GACAppCheckTokenProtocol> _Nullable token, NSError *error) {
[expectation fulfill];
XCTAssertNil(token);
XCTAssertEqualObjects(error, providerError);
Expand Down Expand Up @@ -357,7 +357,7 @@ - (void)testLimitedUseTokenWithSuccess {
// 5. Expect token request to be completed.
XCTestExpectation *getTokenExpectation = [self expectationWithDescription:@"getToken"];

[self.appCheck getLimitedUseTokenWithCompletion:^(id<GACAppCheckTokenInterop> _Nullable token,
[self.appCheck getLimitedUseTokenWithCompletion:^(id<GACAppCheckTokenProtocol> _Nullable token,
NSError *_Nullable error) {
[getTokenExpectation fulfill];
XCTAssertNotNil(token);
Expand Down Expand Up @@ -386,7 +386,7 @@ - (void)testLimitedUseToken_WhenTokenGenerationErrors {
// 5. Expect token request to be completed.
XCTestExpectation *getTokenExpectation = [self expectationWithDescription:@"getToken"];

[self.appCheck getLimitedUseTokenWithCompletion:^(id<GACAppCheckTokenInterop> _Nullable token,
[self.appCheck getLimitedUseTokenWithCompletion:^(id<GACAppCheckTokenProtocol> _Nullable token,
NSError *_Nullable error) {
[getTokenExpectation fulfill];
XCTAssertNotNil(error);
Expand Down Expand Up @@ -426,7 +426,7 @@ - (void)testInteropGetToken_WhenCalledSeveralTimesSuccess_ThenThereIsOnlyOneOper
// 3.2. Request token and verify result.
[self.appCheck
getTokenForcingRefresh:NO
completion:^(id<GACAppCheckTokenInterop> _Nullable token, NSError *error) {
completion:^(id<GACAppCheckTokenProtocol> _Nullable token, NSError *error) {
[getTokenExpectation fulfill];
XCTAssertNotNil(token);
XCTAssertEqualObjects(token.token, expectedToken.token);
Expand Down Expand Up @@ -471,7 +471,7 @@ - (void)testInteropGetToken_WhenCalledSeveralTimesError_ThenThereIsOnlyOneOperat
// 3.2. Request token and verify result.
[self.appCheck
getTokenForcingRefresh:NO
completion:^(id<GACAppCheckTokenInterop> _Nullable token, NSError *error) {
completion:^(id<GACAppCheckTokenProtocol> _Nullable token, NSError *error) {
[getTokenExpectation fulfill];
XCTAssertNil(token);
XCTAssertEqualObjects(error, storageError);
Expand Down Expand Up @@ -522,7 +522,7 @@ - (void)assertGetToken_WhenCachedTokenIsValid_Success {

// 2. Request token and verify result.
[self.appCheck getTokenForcingRefresh:NO
completion:^(id<GACAppCheckTokenInterop> _Nullable token,
completion:^(id<GACAppCheckTokenProtocol> _Nullable token,
NSError *_Nullable error) {
[expectation fulfill];
XCTAssertNotNil(token);
Expand All @@ -545,7 +545,7 @@ - (void)assertInteropGetToken_WhenCachedTokenIsValid_Success {
// 2. Request token and verify result.
[self.appCheck
getTokenForcingRefresh:NO
completion:^(id<GACAppCheckTokenInterop> _Nullable token, NSError *error) {
completion:^(id<GACAppCheckTokenProtocol> _Nullable token, NSError *error) {
[expectation fulfill];
XCTAssertNotNil(token);
XCTAssertEqualObjects(token.token, cachedToken.token);
Expand Down
Loading