Skip to content

Commit 83f59eb

Browse files
committed
remove keychain name param
1 parent 0f6c28f commit 83f59eb

7 files changed

Lines changed: 6 additions & 21 deletions

File tree

GoogleSignIn/Sources/GIDAuthStateMigration/Fake/GIDFakeAuthStateMigration.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
/// Callback that is called when `migrateIfNeededWithTokenURL` is invoked.
2323
@property (nonatomic, nullable) void (^migrationInvokedCallback)
24-
(NSURL * _Nullable tokenURL, NSString * _Nullable callbackPath, NSString * _Nullable keychainName,
25-
BOOL isFreshInstall);
24+
(NSURL * _Nullable tokenURL, NSString * _Nullable callbackPath, BOOL isFreshInstall);
2625

2726
@end

GoogleSignIn/Sources/GIDAuthStateMigration/Fake/GIDFakeAuthStateMigration.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ - (instancetype)init {
3333

3434
- (void)migrateIfNeededWithTokenURL:(NSURL *)tokenURL
3535
callbackPath:(NSString *)callbackPath
36-
keychainName:(NSString *)keychainName
3736
isFreshInstall:(BOOL)isFreshInstall {
3837
if (_migrationInvokedCallback) {
39-
_migrationInvokedCallback(tokenURL, callbackPath, keychainName, isFreshInstall);
38+
_migrationInvokedCallback(tokenURL, callbackPath, isFreshInstall);
4039
}
4140
return;
4241
}

GoogleSignIn/Sources/GIDAuthStateMigration/GIDAuthStateMigration.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ NS_ASSUME_NONNULL_BEGIN
3030
/// Perform necessary migrations from legacy auth state storage to most recent GTMAppAuth version.
3131
- (void)migrateIfNeededWithTokenURL:(NSURL *)tokenURL
3232
callbackPath:(NSString *)callbackPath
33-
keychainName:(NSString *)keychainName
3433
isFreshInstall:(BOOL)isFreshInstall;
3534

3635
@end

GoogleSignIn/Sources/GIDAuthStateMigration/Implementation/GIDAuthStateMigration.m

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ - (instancetype)init {
6565

6666
- (void)migrateIfNeededWithTokenURL:(NSURL *)tokenURL
6767
callbackPath:(NSString *)callbackPath
68-
keychainName:(NSString *)keychainName
6968
isFreshInstall:(BOOL)isFreshInstall {
7069
// If this is a fresh install, take no action and mark the migration checks as having been
7170
// performed.
@@ -83,8 +82,7 @@ - (void)migrateIfNeededWithTokenURL:(NSURL *)tokenURL
8382
[self performDataProtectedMigrationIfNeeded];
8483
#elif TARGET_OS_IOS
8584
[self performGIDMigrationIfNeededWithTokenURL:tokenURL
86-
callbackPath:callbackPath
87-
keychainName:keychainName];
85+
callbackPath:callbackPath];
8886
#endif // TARGET_OS_OSX || TARGET_OS_MACCATALYST
8987
}
9088

@@ -122,8 +120,7 @@ - (void)performDataProtectedMigrationIfNeeded {
122120
// Migrate from GPPSignIn 1.x or GIDSignIn 1.0 - 4.x to the GTMAppAuth storage introduced in
123121
// GIDSignIn 5.0.
124122
- (void)performGIDMigrationIfNeededWithTokenURL:(NSURL *)tokenURL
125-
callbackPath:(NSString *)callbackPath
126-
keychainName:(NSString *)keychainName {
123+
callbackPath:(NSString *)callbackPath {
127124
// See if we've performed the migration check previously.
128125
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
129126
if ([defaults boolForKey:kGTMAppAuthMigrationCheckPerformedKey]) {

GoogleSignIn/Sources/GIDSignIn.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,6 @@ - (instancetype)initWithKeychainStore:(GTMKeychainStore *)keychainStore
567567
// Perform migration of auth state from old versions of the SDK if needed.
568568
[authStateMigrationService migrateIfNeededWithTokenURL:_appAuthConfiguration.tokenEndpoint
569569
callbackPath:kBrowserCallbackPath
570-
keychainName:kGTMAppAuthKeychainName
571570
isFreshInstall:isFreshInstall];
572571
}
573572
return self;

GoogleSignIn/Tests/Unit/GIDAuthStateMigrationTest.m

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ - (void)testMigrateIfNeeded_NoPreviousMigration_DataProtectedMigration {
154154
[[GIDAuthStateMigration alloc] initWithKeychainStore:_mockGTMKeychainStore];
155155
[migration migrateIfNeededWithTokenURL:[NSURL URLWithString:kTokenURL]
156156
callbackPath:kCallbackPath
157-
keychainName:kKeychainName
158157
isFreshInstall:NO];
159158

160159
// verify that the auth session was removed during migration
@@ -179,7 +178,6 @@ - (void)testMigrateIfNeeded_KeychainFailure_DataProtectedMigration {
179178
[[GIDAuthStateMigration alloc] initWithKeychainStore:_mockGTMKeychainStore];
180179
[migration migrateIfNeededWithTokenURL:[NSURL URLWithString:kTokenURL]
181180
callbackPath:kCallbackPath
182-
keychainName:kKeychainName
183181
isFreshInstall:NO];
184182
XCTAssertNotNil([_realLegacyGTMKeychainStore retrieveAuthSessionWithError:nil]);
185183
}
@@ -198,7 +196,6 @@ - (void)testMigrateIfNeeded_NoPreviousMigration_GTMAppAuthMigration {
198196
[[GIDAuthStateMigration alloc] initWithKeychainStore:_mockGTMKeychainStore];
199197
[migration migrateIfNeededWithTokenURL:[NSURL URLWithString:kTokenURL]
200198
callbackPath:kCallbackPath
201-
keychainName:kKeychainName
202199
isFreshInstall:NO];
203200
}
204201

@@ -215,7 +212,6 @@ - (void)testMigrateIfNeeded_KeychainFailure_GTMAppAuthMigration {
215212
[[GIDAuthStateMigration alloc] initWithKeychainStore:_mockGTMKeychainStore];
216213
[migration migrateIfNeededWithTokenURL:[NSURL URLWithString:kTokenURL]
217214
callbackPath:kCallbackPath
218-
keychainName:kKeychainName
219215
isFreshInstall:NO];
220216
}
221217

@@ -258,7 +254,6 @@ - (void)testMigrateIfNeeded_HasPreviousMigration {
258254
[[GIDAuthStateMigration alloc] initWithKeychainStore:_mockGTMKeychainStore];
259255
[migration migrateIfNeededWithTokenURL:[NSURL URLWithString:kTokenURL]
260256
callbackPath:kCallbackPath
261-
keychainName:kKeychainName
262257
isFreshInstall:NO];
263258
}
264259

@@ -274,7 +269,6 @@ - (void)testMigrateIfNeeded_isFreshInstall {
274269
[[GIDAuthStateMigration alloc] initWithKeychainStore:_mockGTMKeychainStore];
275270
[migration migrateIfNeededWithTokenURL:[NSURL URLWithString:kTokenURL]
276271
callbackPath:kCallbackPath
277-
keychainName:kKeychainName
278272
isFreshInstall:YES];
279273
}
280274

GoogleSignIn/Tests/Unit/GIDSignInTest.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -498,16 +498,14 @@ - (void)testInitWithKeychainStore_invalidConfig {
498498
}
499499

500500
- (void)testInitWithKeychainStore_attemptsMigration {
501-
NSString *expectedKeychainName = @"foo";
502-
503501
XCTestExpectation *expectation = [self expectationWithDescription:@"Callback should be called."];
504502
_authStateMigrationService.migrationInvokedCallback =
505-
^(NSURL *tokenURL, NSString *callbackPath, NSString *keychainName, BOOL isFreshInstall) {
503+
^(NSURL *tokenURL, NSString *callbackPath, BOOL isFreshInstall) {
506504
XCTAssertFalse(isFreshInstall);
507505
[expectation fulfill];
508506
};
509507

510-
GTMKeychainStore *store = [[GTMKeychainStore alloc] initWithItemName:expectedKeychainName];
508+
GTMKeychainStore *store = [[GTMKeychainStore alloc] initWithItemName:kKeychainName];
511509
GIDSignIn *signIn;
512510
signIn = [[GIDSignIn alloc] initWithKeychainStore:store
513511
authStateMigrationService:_authStateMigrationService];

0 commit comments

Comments
 (0)