Skip to content

Commit 1f8a6b1

Browse files
authored
Remove references to first VwG EAP. (#538)
1 parent 3859395 commit 1f8a6b1

File tree

18 files changed

+43
-712
lines changed

18 files changed

+43
-712
lines changed

GoogleSignIn/Sources/GIDRestrictedScopesRegistry.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ @implementation GIDRestrictedScopesRegistry
2424
- (instancetype)init {
2525
self = [super init];
2626
if (self) {
27-
_restrictedScopes = [NSSet setWithObjects:kAccountDetailTypeAgeOver18Scope, nil];
28-
_scopeToClassMapping = @{
29-
kAccountDetailTypeAgeOver18Scope: [GIDVerifyAccountDetail class],
30-
};
27+
_restrictedScopes = [NSSet set];
28+
_scopeToClassMapping = @{};
3129
}
3230
return self;
3331
}

GoogleSignIn/Sources/GIDVerifyAccountDetail/Implementations/GIDVerifiableAccountDetail.m

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818

1919
#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
2020

21-
NSString *const kAccountDetailTypeAgeOver18Scope = @"https://www.googleapis.com/auth/verified.age.over18.standard";
22-
2321
@implementation GIDVerifiableAccountDetail
2422

2523
- (instancetype)initWithAccountDetailType:(GIDAccountDetailType)accountDetailType {
@@ -31,12 +29,7 @@ - (instancetype)initWithAccountDetailType:(GIDAccountDetailType)accountDetailTyp
3129
}
3230

3331
- (nullable NSString *)scope {
34-
switch (self.accountDetailType) {
35-
case GIDAccountDetailTypeAgeOver18:
36-
return kAccountDetailTypeAgeOver18Scope;
37-
default:
38-
return nil;
39-
}
32+
return nil;
4033
}
4134

4235
- (BOOL)isEqual:(id)object {
@@ -51,9 +44,6 @@ - (NSUInteger)hash {
5144
}
5245

5346
+ (GIDAccountDetailType)detailTypeWithString:(NSString *)detailTypeString {
54-
if ([detailTypeString isEqualToString:kAccountDetailTypeAgeOver18Scope]) {
55-
return GIDAccountDetailTypeAgeOver18;
56-
}
5747
return GIDAccountDetailTypeUnknown;
5848
}
5949

GoogleSignIn/Sources/Public/GoogleSignIn/GIDVerifiableAccountDetail.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,8 @@ NS_ASSUME_NONNULL_BEGIN
2626
typedef NS_ENUM(NSInteger, GIDAccountDetailType) {
2727
/// Used when the account detail type is unspecified or cannot be matched.
2828
GIDAccountDetailTypeUnknown,
29-
/// User account detail for age over 18.
30-
GIDAccountDetailTypeAgeOver18,
3129
};
3230

33-
/// String scope representing the account detail type for age over 18.
34-
extern NSString *const kAccountDetailTypeAgeOver18Scope;
35-
3631
/// Helper object used to hold the enumeration representing a list of
3732
/// account details that Google can verify via GSI.
3833
@interface GIDVerifiableAccountDetail : NSObject

GoogleSignIn/Tests/Unit/GIDRestrictedScopesRegistryTest.m

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,16 @@ @implementation GIDRestrictedScopesRegistryTest
2727

2828
- (void)testIsScopeRestricted {
2929
GIDRestrictedScopesRegistry *registry = [[GIDRestrictedScopesRegistry alloc] init];
30-
BOOL isRestricted = [registry isScopeRestricted:kAccountDetailTypeAgeOver18Scope];
31-
XCTAssertTrue(isRestricted);
30+
BOOL isRestricted = [registry isScopeRestricted:@"some_scope"];
31+
XCTAssertFalse(isRestricted);
3232
}
3333

3434
- (void)testRestrictedScopesToClassMappingInSet {
3535
GIDRestrictedScopesRegistry *registry = [[GIDRestrictedScopesRegistry alloc] init];
36-
NSSet<NSString *> *scopes = [NSSet setWithObjects:kAccountDetailTypeAgeOver18Scope, @"some_other_scope", nil];
36+
NSSet<NSString *> *scopes = [NSSet setWithObjects:@"some_scope", @"some_other_scope", nil];
3737
NSDictionary<NSString *, Class> *mapping = [registry restrictedScopesToClassMappingInSet:scopes];
3838

39-
XCTAssertEqual(mapping.count, 1);
40-
XCTAssertEqualObjects(mapping[kAccountDetailTypeAgeOver18Scope], [GIDVerifyAccountDetail class]);
41-
XCTAssertNil(mapping[@"some_other_scope"]);
39+
XCTAssertEqual(mapping.count, 0);
4240
}
4341

4442
@end

GoogleSignIn/Tests/Unit/GIDSignInInternalOptionsTest.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ - (void)testDefaultOptionsForVerificationFlow {
4040
hostedDomain:nil
4141
openIDRealm:kOpenIDRealm];
4242
UIViewController *presentingViewController = [[UIViewController alloc] init];
43-
GIDVerifiableAccountDetail *ageOver18Detail = [[GIDVerifiableAccountDetail alloc] initWithAccountDetailType:GIDAccountDetailTypeAgeOver18];
44-
NSArray<GIDVerifiableAccountDetail *> *accountDetailsToVerify = @[ageOver18Detail];
43+
GIDVerifiableAccountDetail *testAccountDetail =
44+
[[GIDVerifiableAccountDetail alloc] initWithAccountDetailType:GIDAccountDetailTypeUnknown];
45+
NSArray<GIDVerifiableAccountDetail *> *accountDetailsToVerify = @[testAccountDetail];
4546
NSString *loginHint = @"login_hint";
4647

4748
GIDSignInInternalOptions *options =

GoogleSignIn/Tests/Unit/GIDSignInTest.m

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,32 +1341,6 @@ - (void)testTokenEndpointEMMError {
13411341
XCTAssertNil(_signIn.currentUser, @"should not have current user");
13421342
}
13431343

1344-
- (void)testValidScopesException {
1345-
NSString *requestedScope = @"https://www.googleapis.com/auth/verified.age.over18.standard";
1346-
NSString *expectedException =
1347-
[NSString stringWithFormat:@"The following scopes are not supported in the 'addScopes' flow. "
1348-
"Please use the appropriate classes to handle these:\n%@ -> %@\n",
1349-
requestedScope, NSStringFromClass([GIDVerifyAccountDetail class])];
1350-
BOOL threw = NO;
1351-
@try {
1352-
[_signIn addScopes:@[requestedScope]
1353-
#if TARGET_OS_IOS || TARGET_OS_MACCATALYST
1354-
presentingViewController:_presentingViewController
1355-
#elif TARGET_OS_OSX
1356-
presentingWindow:_presentingWindow
1357-
#endif // TARGET_OS_IOS || TARGET_OS_MACCATALYST
1358-
completion:_completion];
1359-
} @catch (NSException *exception) {
1360-
threw = YES;
1361-
XCTAssertEqualObjects(exception.description, expectedException);
1362-
} @finally {
1363-
}
1364-
XCTAssert(threw);
1365-
1366-
// TODO: Keep mocks from carrying forward to subsequent tests. (#410)
1367-
[_authState stopMocking];
1368-
}
1369-
13701344
#endif // TARGET_OS_IOS && !TARGET_OS_MACCATALYST
13711345

13721346
#pragma mark - Helpers

GoogleSignIn/Tests/Unit/GIDVerifiableAccountDetailTest.m

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,23 @@ @interface GIDVerifiableAccountDetailTests : XCTestCase
2323
@implementation GIDVerifiableAccountDetailTests
2424

2525
- (void)testDesignatedInitializer {
26-
GIDVerifiableAccountDetail *detail = [[GIDVerifiableAccountDetail alloc] initWithAccountDetailType:GIDAccountDetailTypeAgeOver18];
26+
GIDVerifiableAccountDetail *detail =
27+
[[GIDVerifiableAccountDetail alloc] initWithAccountDetailType:GIDAccountDetailTypeUnknown];
2728
XCTAssertNotNil(detail);
28-
XCTAssertEqual(detail.accountDetailType, GIDAccountDetailTypeAgeOver18);
29+
XCTAssertEqual(detail.accountDetailType, GIDAccountDetailTypeUnknown);
2930
}
3031

3132
- (void)testScopeRetrieval {
32-
GIDVerifiableAccountDetail *detail = [[GIDVerifiableAccountDetail alloc] initWithAccountDetailType:GIDAccountDetailTypeAgeOver18];
33+
GIDVerifiableAccountDetail *detail =
34+
[[GIDVerifiableAccountDetail alloc] initWithAccountDetailType:GIDAccountDetailTypeUnknown];
3335
NSString *retrievedScope = [detail scope];
34-
XCTAssertEqualObjects(retrievedScope, kAccountDetailTypeAgeOver18Scope);
36+
XCTAssertNil(retrievedScope);
3537
}
3638

3739
- (void)testScopeRetrieval_MissingScope {
3840
NSInteger missingScope = 5;
39-
GIDVerifiableAccountDetail *detail = [[GIDVerifiableAccountDetail alloc] initWithAccountDetailType:missingScope];
41+
GIDVerifiableAccountDetail *detail =
42+
[[GIDVerifiableAccountDetail alloc] initWithAccountDetailType:missingScope];
4043
NSString *retrievedScope = [detail scope];
4144
XCTAssertNil(retrievedScope);
4245
}

GoogleSignIn/Tests/Unit/GIDVerifiedAccountDetailResultTest.m

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ - (void)testInit {
3636
OIDAuthState *authState = [OIDAuthState testInstance];
3737

3838
GIDVerifiableAccountDetail *verifiedAccountDetail =
39-
[[GIDVerifiableAccountDetail alloc] initWithAccountDetailType:GIDAccountDetailTypeAgeOver18];
39+
[[GIDVerifiableAccountDetail alloc] initWithAccountDetailType:GIDAccountDetailTypeUnknown];
4040

4141
NSArray<GIDVerifiableAccountDetail *> *verifiedList =
4242
@[verifiedAccountDetail, verifiedAccountDetail];
@@ -52,32 +52,23 @@ - (void)testInit {
5252
XCTAssertEqual(result.refreshToken.tokenString, authState.lastTokenResponse.refreshToken);
5353
}
5454

55-
- (void)testRefreshTokensWithCompletion_success {
56-
GIDVerifiableAccountDetail *verifiedAccountDetail =
57-
[[GIDVerifiableAccountDetail alloc] initWithAccountDetailType:GIDAccountDetailTypeAgeOver18];
58-
59-
NSString *kAccountDetailList = [NSString stringWithFormat:@"%@",
60-
kAccountDetailTypeAgeOver18Scope];
55+
- (void)testRefreshTokensWithCompletion_randomScope {
56+
NSString *kAccountDetailList = [NSString stringWithFormat:@"some_scope"];
6157
OIDTokenResponse *tokenResponse = [OIDTokenResponse testInstanceWithScope:kAccountDetailList];
6258
OIDAuthState *authState = [OIDAuthState testInstanceWithTokenResponse:tokenResponse];
6359
GIDVerifiedAccountDetailHandlingFake *result =
6460
[[GIDVerifiedAccountDetailHandlingFake alloc] initWithTokenResponse:authState.lastTokenResponse
6561
verifiedAuthState:authState
6662
error:nil];
6763

68-
NSArray<GIDVerifiableAccountDetail *> *expectedVerifiedList =
69-
@[verifiedAccountDetail];
70-
GIDVerifiedAccountDetailResult *expectedResult =
71-
[[GIDVerifiedAccountDetailResult alloc] initWithAccountDetails:expectedVerifiedList
72-
authState:authState];
73-
7464
XCTestExpectation *expectation =
7565
[self expectationWithDescription:@"Refreshed verified account details completion called"];
7666
[result refreshTokensWithCompletion:^(GIDVerifiedAccountDetailResult * _Nullable refreshedResult,
7767
NSError * _Nullable error) {
7868
XCTAssertNil(error);
7969
XCTAssertNotNil(refreshedResult);
80-
XCTAssertTrue([refreshedResult isEqual:expectedResult]);
70+
XCTAssertEqual([refreshedResult.verifiedAccountDetails count], 0,
71+
@"verifiedAccountDetails should have a count of 0");
8172
[expectation fulfill];
8273
}];
8374

@@ -103,8 +94,8 @@ - (void)testRefreshTokensWithCompletion_noTokenResponse {
10394
XCTAssertEqual(error, expectedError);
10495
XCTAssertEqual(error.code, kGIDSignInErrorCodeUnknown);
10596
XCTAssertNotNil(refreshedResult);
106-
XCTAssertTrue([refreshedResult.verifiedAccountDetails count] == 0,
107-
@"verifiedAccountDetails should have a count of 0");
97+
XCTAssertEqual([refreshedResult.verifiedAccountDetails count], 0,
98+
@"verifiedAccountDetails should have a count of 0");
10899
[expectation fulfill];
109100
}];
110101

GoogleSignIn/Tests/Unit/GIDVerifyAccountDetailTest.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ - (void)setUp {
6565

6666
_verifyAccountDetail = [[GIDVerifyAccountDetail alloc] init];
6767

68-
GIDVerifiableAccountDetail *ageOver18Detail =
69-
[[GIDVerifiableAccountDetail alloc] initWithAccountDetailType:GIDAccountDetailTypeAgeOver18];
70-
_verifiableAccountDetails = @[ageOver18Detail];
68+
GIDVerifiableAccountDetail *testAccountDetail =
69+
[[GIDVerifiableAccountDetail alloc] initWithAccountDetailType:GIDAccountDetailTypeUnknown];
70+
_verifiableAccountDetails = @[testAccountDetail];
7171

7272
_fakeMainBundle = [[GIDFakeMainBundle alloc] initWithClientID:kClientId
7373
serverClientID:kServerClientId

Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj/project.pbxproj

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
641495132C405D0200C9A613 /* VerifiedAgeViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 641495122C405D0200C9A613 /* VerifiedAgeViewModel.swift */; };
11-
641495152C405E1400C9A613 /* VerificationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 641495142C405E1400C9A613 /* VerificationView.swift */; };
12-
641495172C405E3600C9A613 /* VerificationLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 641495162C405E3600C9A613 /* VerificationLoader.swift */; };
13-
6499D22A2C4B2F4200825B30 /* Verification.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6499D2292C4B2F4200825B30 /* Verification.swift */; };
14-
6499D22C2C4B3B1500825B30 /* AgeVerificationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6499D22B2C4B3B1500825B30 /* AgeVerificationView.swift */; };
1510
7345AD032703D9470020AFB1 /* DaysUntilBirthday.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7345AD022703D9470020AFB1 /* DaysUntilBirthday.swift */; };
1611
7345AD052703D9470020AFB1 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7345AD042703D9470020AFB1 /* ContentView.swift */; };
1712
7345AD072703D9480020AFB1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7345AD062703D9480020AFB1 /* Assets.xcassets */; };
@@ -58,11 +53,6 @@
5853
/* End PBXContainerItemProxy section */
5954

6055
/* Begin PBXFileReference section */
61-
641495122C405D0200C9A613 /* VerifiedAgeViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VerifiedAgeViewModel.swift; sourceTree = "<group>"; };
62-
641495142C405E1400C9A613 /* VerificationView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VerificationView.swift; sourceTree = "<group>"; };
63-
641495162C405E3600C9A613 /* VerificationLoader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VerificationLoader.swift; sourceTree = "<group>"; };
64-
6499D2292C4B2F4200825B30 /* Verification.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Verification.swift; sourceTree = "<group>"; };
65-
6499D22B2C4B3B1500825B30 /* AgeVerificationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AgeVerificationView.swift; sourceTree = "<group>"; };
6656
7345ACFF2703D9470020AFB1 /* DaysUntilBirthday (iOS).app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "DaysUntilBirthday (iOS).app"; sourceTree = BUILT_PRODUCTS_DIR; };
6757
7345AD022703D9470020AFB1 /* DaysUntilBirthday.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DaysUntilBirthday.swift; sourceTree = "<group>"; };
6858
7345AD042703D9470020AFB1 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
@@ -213,9 +203,7 @@
213203
children = (
214204
7345AD042703D9470020AFB1 /* ContentView.swift */,
215205
739FCC45270E467600C92042 /* BirthdayView.swift */,
216-
6499D22B2C4B3B1500825B30 /* AgeVerificationView.swift */,
217206
7345AD112703D9C30020AFB1 /* SignInView.swift */,
218-
641495142C405E1400C9A613 /* VerificationView.swift */,
219207
7345AD142703D9C30020AFB1 /* UserProfileImageView.swift */,
220208
);
221209
path = Views;
@@ -225,7 +213,6 @@
225213
isa = PBXGroup;
226214
children = (
227215
739FCC47270E659A00C92042 /* Birthday.swift */,
228-
6499D2292C4B2F4200825B30 /* Verification.swift */,
229216
);
230217
path = Models;
231218
sourceTree = "<group>";
@@ -234,7 +221,6 @@
234221
isa = PBXGroup;
235222
children = (
236223
7345AD162703D9C30020AFB1 /* AuthenticationViewModel.swift */,
237-
641495122C405D0200C9A613 /* VerifiedAgeViewModel.swift */,
238224
736F49BB270E102C00580053 /* BirthdayViewModel.swift */,
239225
);
240226
path = ViewModels;
@@ -245,7 +231,6 @@
245231
children = (
246232
7345AD172703D9C30020AFB1 /* GoogleSignInAuthenticator.swift */,
247233
736F49B9270E05E200580053 /* BirthdayLoader.swift */,
248-
641495162C405E3600C9A613 /* VerificationLoader.swift */,
249234
7345AD192703D9C30020AFB1 /* UserProfileImageLoader.swift */,
250235
);
251236
path = Services;
@@ -389,9 +374,7 @@
389374
isa = PBXSourcesBuildPhase;
390375
buildActionMask = 2147483647;
391376
files = (
392-
6499D22A2C4B2F4200825B30 /* Verification.swift in Sources */,
393377
739FCC48270E659A00C92042 /* Birthday.swift in Sources */,
394-
6499D22C2C4B3B1500825B30 /* AgeVerificationView.swift in Sources */,
395378
739FCC46270E467600C92042 /* BirthdayView.swift in Sources */,
396379
7345AD1B2703D9C30020AFB1 /* SignInView.swift in Sources */,
397380
7345AD212703D9C30020AFB1 /* GoogleSignInAuthenticator.swift in Sources */,
@@ -400,12 +383,9 @@
400383
736F49BC270E102C00580053 /* BirthdayViewModel.swift in Sources */,
401384
736F49BA270E05E200580053 /* BirthdayLoader.swift in Sources */,
402385
7345AD242703D9C30020AFB1 /* UserProfileView.swift in Sources */,
403-
641495172C405E3600C9A613 /* VerificationLoader.swift in Sources */,
404386
7345AD202703D9C30020AFB1 /* AuthenticationViewModel.swift in Sources */,
405-
641495132C405D0200C9A613 /* VerifiedAgeViewModel.swift in Sources */,
406387
7345AD052703D9470020AFB1 /* ContentView.swift in Sources */,
407388
7345AD032703D9470020AFB1 /* DaysUntilBirthday.swift in Sources */,
408-
641495152C405E1400C9A613 /* VerificationView.swift in Sources */,
409389
);
410390
runOnlyForDeploymentPostprocessing = 0;
411391
};

0 commit comments

Comments
 (0)