From 721b7a3923996c7ac8aa7258f1fe7d5bc416af2b Mon Sep 17 00:00:00 2001 From: Jorge Canizales Date: Fri, 7 Aug 2015 10:11:16 -0700 Subject: [PATCH] Rename oauth2_lowerCamel -> oauth2UpperCamel --- src/objective-c/GRPCClient/GRPCCall+OAuth2.h | 4 ++-- src/objective-c/GRPCClient/GRPCCall+OAuth2.m | 6 +++--- src/objective-c/tests/GRPCClientTests.m | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/objective-c/GRPCClient/GRPCCall+OAuth2.h b/src/objective-c/GRPCClient/GRPCCall+OAuth2.h index f14fe254b0f..2e379a71572 100644 --- a/src/objective-c/GRPCClient/GRPCCall+OAuth2.h +++ b/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 ", 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 diff --git a/src/objective-c/GRPCClient/GRPCCall+OAuth2.m b/src/objective-c/GRPCClient/GRPCCall+OAuth2.m index 77d00f260eb..ed39d4b0f7a 100644 --- a/src/objective-c/GRPCClient/GRPCCall+OAuth2.m +++ b/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]; } diff --git a/src/objective-c/tests/GRPCClientTests.m b/src/objective-c/tests/GRPCClientTests.m index 1c8461c8e64..e85dd6e65cd 100644 --- a/src/objective-c/tests/GRPCClientTests.m +++ b/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 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];