1414 * limitations under the License.
1515 */
1616
17- #import " GoogleSignIn/Sources/GIDTokenClaimsInternalOptions .h"
17+ #import " GoogleSignIn/Sources/GIDClaimsInternalOptions .h"
1818
1919#import " GoogleSignIn/Sources/GIDJSONSerializer/API/GIDJSONSerializer.h"
2020#import " GoogleSignIn/Sources/GIDJSONSerializer/Implementation/GIDJSONSerializerImpl.h"
2121#import " GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignIn.h"
22- #import " GoogleSignIn/Sources/Public/GoogleSignIn/GIDTokenClaim .h"
22+ #import " GoogleSignIn/Sources/Public/GoogleSignIn/GIDClaim .h"
2323
24- NSString * const kGIDTokenClaimErrorDescription =
24+ NSString * const kGIDClaimErrorDescription =
2525 @" The claim was requested as both essential and non-essential. "
2626 @" Please provide only one version." ;
27- NSString * const kGIDTokenClaimEssentialPropertyKey = @" essential" ;
28- NSString * const kGIDTokenClaimKeyName = @" id_token" ;
27+ NSString * const kGIDClaimEssentialPropertyKey = @" essential" ;
28+ NSString * const kGIDClaimKeyName = @" id_token" ;
2929
30- @interface GIDTokenClaimsInternalOptions ()
30+ @interface GIDClaimsInternalOptions ()
3131@property (nonatomic , readonly ) id <GIDJSONSerializer> jsonSerializer;
3232@end
3333
34- @implementation GIDTokenClaimsInternalOptions
34+ @implementation GIDClaimsInternalOptions
3535
3636- (instancetype )init {
3737 return [self initWithJSONSerializer: [[GIDJSONSerializerImpl alloc ] init ]];
@@ -44,45 +44,45 @@ - (instancetype)initWithJSONSerializer:(id<GIDJSONSerializer>)jsonSerializer {
4444 return self;
4545}
4646
47- - (nullable NSString *)validatedJSONStringForClaims : (nullable NSSet <GIDTokenClaim *> *)claims
47+ - (nullable NSString *)validatedJSONStringForClaims : (nullable NSSet <GIDClaim *> *)claims
4848 error : (NSError *_Nullable *_Nullable)error {
4949 if (!claims || claims.count == 0 ) {
5050 return nil ;
5151 }
5252
5353 // === Step 1: Check for claims with ambiguous essential property. ===
54- NSMutableDictionary <NSString *, GIDTokenClaim *> *validTokenClaims =
54+ NSMutableDictionary <NSString *, GIDClaim *> *validClaims =
5555 [[NSMutableDictionary alloc ] init ];
5656
57- for (GIDTokenClaim *currentClaim in claims) {
58- GIDTokenClaim *existingClaim = validTokenClaims [currentClaim.name];
57+ for (GIDClaim *currentClaim in claims) {
58+ GIDClaim *existingClaim = validClaims [currentClaim.name];
5959
6060 // Check for a conflict: a claim with the same name but different essentiality.
6161 if (existingClaim && existingClaim.isEssential != currentClaim.isEssential ) {
6262 if (error) {
6363 *error = [NSError errorWithDomain: kGIDSignInErrorDomain
6464 code: kGIDSignInErrorCodeAmbiguousClaims
6565 userInfo: @{
66- NSLocalizedDescriptionKey :kGIDTokenClaimErrorDescription
66+ NSLocalizedDescriptionKey :kGIDClaimErrorDescription
6767 }];
6868 }
6969 return nil ;
7070 }
71- validTokenClaims [currentClaim.name] = currentClaim;
71+ validClaims [currentClaim.name] = currentClaim;
7272 }
7373
7474 // === Step 2: Build the dictionary structure required for OIDC JSON ===
75- NSMutableDictionary <NSString *, NSDictionary *> *tokenClaimsDictionary =
75+ NSMutableDictionary <NSString *, NSDictionary *> *claimsDictionary =
7676 [[NSMutableDictionary alloc ] init ];
77- for (GIDTokenClaim *claim in validTokenClaims .allValues ) {
77+ for (GIDClaim *claim in validClaims .allValues ) {
7878 if (claim.isEssential ) {
79- tokenClaimsDictionary [claim.name] = @{ kGIDTokenClaimEssentialPropertyKey : @YES };
79+ claimsDictionary [claim.name] = @{ kGIDClaimEssentialPropertyKey : @YES };
8080 } else {
81- tokenClaimsDictionary [claim.name] = @{ kGIDTokenClaimEssentialPropertyKey : @NO };
81+ claimsDictionary [claim.name] = @{ kGIDClaimEssentialPropertyKey : @NO };
8282 }
8383 }
8484 NSDictionary <NSString *, id > *finalRequestDictionary =
85- @{ kGIDTokenClaimKeyName : tokenClaimsDictionary };
85+ @{ kGIDClaimKeyName : claimsDictionary };
8686
8787 // === Step 3: Serialize the final dictionary into a JSON string ===
8888 return [_jsonSerializer stringWithJSONObject: finalRequestDictionary error: error];
0 commit comments