Эх сурвалжийг харах

Rename oauth2_lowerCamel -> oauth2UpperCamel

Jorge Canizales 10 жил өмнө
parent
commit
721b7a3923

+ 2 - 2
src/objective-c/GRPCClient/GRPCCall+OAuth2.h

@@ -41,9 +41,9 @@
 // authorization header from the request.
 // The value obtained by getting the property is the OAuth2 bearer token if the authorization header
 // of the request has the form "Bearer <token>", or nil otherwise.
-@property(atomic, copy) NSString *oauth2_accessToken;
+@property(atomic, copy) NSString *oauth2AccessToken;
 
 // Returns the value (if any) of the "www-authenticate" response header (the challenge header).
-@property(atomic, readonly) NSString *oauth2_challengeHeader;
+@property(atomic, readonly) NSString *oauth2ChallengeHeader;
 
 @end

+ 3 - 3
src/objective-c/GRPCClient/GRPCCall+OAuth2.m

@@ -39,7 +39,7 @@ static NSString * const kChallengeHeader = @"www-authenticate";
 
 @implementation GRPCCall (OAuth2)
 
-- (NSString *)oauth2_accessToken {
+- (NSString *)oauth2AccessToken {
   NSString *headerValue = self.requestMetadata[kAuthorizationHeader];
   if ([headerValue hasPrefix:kBearerPrefix]) {
     return [headerValue substringFromIndex:kBearerPrefix.length];
@@ -48,7 +48,7 @@ static NSString * const kChallengeHeader = @"www-authenticate";
   }
 }
 
-- (void)setOauth2_accessToken:(NSString *)token {
+- (void)setOauth2AccessToken:(NSString *)token {
   if (token) {
     self.requestMetadata[kAuthorizationHeader] = [kBearerPrefix stringByAppendingString:token];
   } else {
@@ -56,7 +56,7 @@ static NSString * const kChallengeHeader = @"www-authenticate";
   }
 }
 
-- (NSString *)oauth2_challengeHeader {
+- (NSString *)oauth2ChallengeHeader {
   return self.responseMetadata[kChallengeHeader];
 }
 

+ 2 - 2
src/objective-c/tests/GRPCClientTests.m

@@ -161,7 +161,7 @@ static ProtoMethod *kUnaryCallMethod;
                                              path:kUnaryCallMethod.HTTPPath
                                    requestsWriter:requestsWriter];
 
-  call.oauth2_accessToken = @"bogusToken";
+  call.oauth2AccessToken = @"bogusToken";
 
   id<GRXWriteable> responsesWriteable = [[GRXWriteable alloc] initWithValueHandler:^(NSData *value) {
     XCTFail(@"Received unexpected response: %@", value);
@@ -170,7 +170,7 @@ static ProtoMethod *kUnaryCallMethod;
     XCTAssertEqual(errorOrNil.code, 16, @"Finished with unexpected error: %@", errorOrNil);
     XCTAssertEqualObjects(call.responseMetadata, errorOrNil.userInfo[kGRPCStatusMetadataKey],
                           @"Metadata in the NSError object and call object differ.");
-    NSString *challengeHeader = call.oauth2_challengeHeader;
+    NSString *challengeHeader = call.oauth2ChallengeHeader;
     XCTAssertGreaterThan(challengeHeader.length, 0,
                          @"No challenge in response headers %@", call.responseMetadata);
     [expectation fulfill];