Skip to content

Commit 645e281

Browse files
committed
update fake and create test
1 parent 69058b6 commit 645e281

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

GoogleSignIn/Sources/GIDAuthStateMigration/GIDAuthStateMigration.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
<<<<<<< HEAD
1516
#import "GoogleSignIn/Sources/GIDAuthStateMigration.h"
17+
=======
18+
#import "GoogleSignIn/Sources/GIDAuthStateMigration/GIDAuthStateMigration.h"
19+
>>>>>>> 43b6160 (update fake and create test)
1620

1721
#import "GoogleSignIn/Sources/GIDSignInCallbackSchemes.h"
1822

@@ -107,10 +111,13 @@ - (void)performDataProtectedMigrationIfNeeded {
107111
if (authSession) {
108112
NSError *err;
109113
[self.keychainStore saveAuthSession:authSession error:&err];
114+
<<<<<<< HEAD
110115
// If we're unable to save to the keychain, return without marking migration performed.
111116
if (err) {
112117
return;
113118
};
119+
=======
120+
>>>>>>> 43b6160 (update fake and create test)
114121
[keychainStoreLegacy removeAuthSessionWithError:nil];
115122
}
116123

@@ -138,10 +145,13 @@ - (void)performGIDMigrationIfNeededWithTokenURL:(NSURL *)tokenURL
138145
if (authSession) {
139146
NSError *err;
140147
[self.keychainStore saveAuthSession:authSession error:&err];
148+
<<<<<<< HEAD
141149
// If we're unable to save to the keychain, return without marking migration performed.
142150
if (err) {
143151
return;
144152
};
153+
=======
154+
>>>>>>> 43b6160 (update fake and create test)
145155
}
146156

147157
// Mark the migration check as having been performed.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright 2021 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#import <Foundation/Foundation.h>
18+
19+
@class GTMKeychainStore;
20+
@class GTMAuthSession;
21+
22+
NS_ASSUME_NONNULL_BEGIN
23+
24+
/// A class providing migration support for auth state saved by older versions of the SDK.
25+
@interface GIDAuthStateMigration : NSObject
26+
27+
/// Creates an instance of this migration type with the keychain storage wrapper it will use.
28+
- (instancetype)initWithKeychainStore:(GTMKeychainStore *)keychainStore NS_DESIGNATED_INITIALIZER;
29+
30+
/// Perform necessary migrations from legacy auth state storage to most recent GTMAppAuth version.
31+
- (void)migrateIfNeededWithTokenURL:(NSURL *)tokenURL
32+
callbackPath:(NSString *)callbackPath
33+
keychainName:(NSString *)keychainName
34+
isFreshInstall:(BOOL)isFreshInstall;
35+
36+
@end
37+
38+
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)