-
Notifications
You must be signed in to change notification settings - Fork 248
GIDTokenClaim Implementation + Unit Tests #550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GIDTokenClaim Implementation + Unit Tests #550
Conversation
|
|
||
| - (void)testAuthTimeClaim_PropertiesAreCorrect { | ||
| GIDTokenClaim *claim = [GIDTokenClaim authTimeClaim]; | ||
| XCTAssertEqualObjects(claim.name, @"auth_time"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps useful to add string constants to GIDTokenClaim.h: kAuthTimeClaim. You could then compare to that here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added the string constant.
| #import <XCTest/XCTest.h> | ||
| #import "GoogleSignIn/Sources/Public/GoogleSignIn/GIDTokenClaim.h" | ||
|
|
||
| static NSString *const kAuthTimeClaimName = @"auth_time"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be declared in GIDTokenClaim.h, implemented and used in GIDTokenClaim.m
This pull request introduces the `GIDTokenClaimsInternalOptions` class, a new component designed to handle the validation and JSON serialization of token claims. Key changes: * Adds the `GIDTokenClaimsInternalOptions` class to validate the token claims and return a JSON object. * Adds the `GIDJSONSerializer` protocol with real and fake implementations to support serializing the token claims. * Provides unit tests to validate the implementation.
This pull request introduces the
GIDTokenClaimclass, which allows for requesting specific OIDC claims for an ID token.Key changes:
GIDTokenClaimclass to represent a single OIDC claim.auth_timeclaims.