Rename pemXxx parameters to PEMXxx

pull/16190/head
Muxi Yan 6 years ago
parent 2c1c22c3f1
commit 0fc040d19a
  1. 12
      src/objective-c/GRPCClient/GRPCCallOptions.h
  2. 84
      src/objective-c/GRPCClient/GRPCCallOptions.m
  3. 24
      src/objective-c/GRPCClient/private/GRPCChannelPool.m
  4. 14
      src/objective-c/GRPCClient/private/GRPCHost.m
  5. 2
      src/objective-c/tests/InteropTests.h
  6. 8
      src/objective-c/tests/InteropTests.m
  7. 2
      src/objective-c/tests/InteropTestsLocalCleartext.m
  8. 2
      src/objective-c/tests/InteropTestsLocalSSL.m
  9. 2
      src/objective-c/tests/InteropTestsMultipleChannels/InteropTestsMultipleChannels.m
  10. 2
      src/objective-c/tests/InteropTestsRemote.m

@ -146,17 +146,17 @@ typedef NS_ENUM(NSInteger, GRPCTransportType) {
* PEM format root certifications that is trusted. If set to nil, gRPC uses a list of default
* root certificates.
*/
@property(copy, readonly) NSString *pemRootCert;
@property(copy, readonly) NSString *PEMRootCertificates;
/**
* PEM format private key for client authentication, if required by the server.
*/
@property(copy, readonly) NSString *pemPrivateKey;
@property(copy, readonly) NSString *PEMPrivateKey;
/**
* PEM format certificate chain for client authentication, if required by the server.
*/
@property(copy, readonly) NSString *pemCertChain;
@property(copy, readonly) NSString *PEMCertChain;
/**
* Select the transport type to be used for this call.
@ -278,17 +278,17 @@ typedef NS_ENUM(NSInteger, GRPCTransportType) {
* PEM format root certifications that is trusted. If set to nil, gRPC uses a list of default
* root certificates.
*/
@property(copy, readwrite) NSString *pemRootCert;
@property(copy, readwrite) NSString *PEMRootCertificates;
/**
* PEM format private key for client authentication, if required by the server.
*/
@property(copy, readwrite) NSString *pemPrivateKey;
@property(copy, readwrite) NSString *PEMPrivateKey;
/**
* PEM format certificate chain for client authentication, if required by the server.
*/
@property(copy, readwrite) NSString *pemCertChain;
@property(copy, readwrite) NSString *PEMCertChain;
/**
* Select the transport type to be used for this call.

@ -32,9 +32,9 @@ static const NSTimeInterval kDefaultConnectMinTimeout = 0;
static const NSTimeInterval kDefaultConnectInitialBackoff = 0;
static const NSTimeInterval kDefaultConnectMaxBackoff = 0;
static NSDictionary *const kDefaultAdditionalChannelArgs = nil;
static NSString *const kDefaultPemRootCert = nil;
static NSString *const kDefaultPemPrivateKey = nil;
static NSString *const kDefaultPemCertChain = nil;
static NSString *const kDefaultPEMRootCertificates = nil;
static NSString *const kDefaultPEMPrivateKey = nil;
static NSString *const kDefaultPEMCertChain = nil;
static NSString *const kDefaultOauth2AccessToken = nil;
static const id<GRPCAuthorizationProtocol> kDefaultAuthTokenProvider = nil;
static const GRPCTransportType kDefaultTransportType = GRPCTransportTypeChttp2BoringSSL;
@ -60,9 +60,9 @@ static NSUInteger kDefaultChannelId = 0;
NSTimeInterval _connectInitialBackoff;
NSTimeInterval _connectMaxBackoff;
NSDictionary *_additionalChannelArgs;
NSString *_pemRootCert;
NSString *_pemPrivateKey;
NSString *_pemCertChain;
NSString *_PEMRootCertificates;
NSString *_PEMPrivateKey;
NSString *_PEMCertChain;
GRPCTransportType _transportType;
NSString *_hostNameOverride;
id _logContext;
@ -85,9 +85,9 @@ static NSUInteger kDefaultChannelId = 0;
@synthesize connectInitialBackoff = _connectInitialBackoff;
@synthesize connectMaxBackoff = _connectMaxBackoff;
@synthesize additionalChannelArgs = _additionalChannelArgs;
@synthesize pemRootCert = _pemRootCert;
@synthesize pemPrivateKey = _pemPrivateKey;
@synthesize pemCertChain = _pemCertChain;
@synthesize PEMRootCertificates = _PEMRootCertificates;
@synthesize PEMPrivateKey = _PEMPrivateKey;
@synthesize PEMCertChain = _PEMCertChain;
@synthesize transportType = _transportType;
@synthesize hostNameOverride = _hostNameOverride;
@synthesize logContext = _logContext;
@ -110,9 +110,9 @@ static NSUInteger kDefaultChannelId = 0;
connectInitialBackoff:kDefaultConnectInitialBackoff
connectMaxBackoff:kDefaultConnectMaxBackoff
additionalChannelArgs:kDefaultAdditionalChannelArgs
pemRootCert:kDefaultPemRootCert
pemPrivateKey:kDefaultPemPrivateKey
pemCertChain:kDefaultPemCertChain
PEMRootCertificates:kDefaultPEMRootCertificates
PEMPrivateKey:kDefaultPEMPrivateKey
PEMCertChain:kDefaultPEMCertChain
transportType:kDefaultTransportType
hostNameOverride:kDefaultHostNameOverride
logContext:kDefaultLogContext
@ -135,9 +135,9 @@ static NSUInteger kDefaultChannelId = 0;
connectInitialBackoff:(NSTimeInterval)connectInitialBackoff
connectMaxBackoff:(NSTimeInterval)connectMaxBackoff
additionalChannelArgs:(NSDictionary *)additionalChannelArgs
pemRootCert:(NSString *)pemRootCert
pemPrivateKey:(NSString *)pemPrivateKey
pemCertChain:(NSString *)pemCertChain
PEMRootCertificates:(NSString *)PEMRootCertificates
PEMPrivateKey:(NSString *)PEMPrivateKey
PEMCertChain:(NSString *)PEMCertChain
transportType:(GRPCTransportType)transportType
hostNameOverride:(NSString *)hostNameOverride
logContext:(id)logContext
@ -159,9 +159,9 @@ static NSUInteger kDefaultChannelId = 0;
_connectInitialBackoff = connectInitialBackoff;
_connectMaxBackoff = connectMaxBackoff;
_additionalChannelArgs = additionalChannelArgs;
_pemRootCert = pemRootCert;
_pemPrivateKey = pemPrivateKey;
_pemCertChain = pemCertChain;
_PEMRootCertificates = PEMRootCertificates;
_PEMPrivateKey = PEMPrivateKey;
_PEMCertChain = PEMCertChain;
_transportType = transportType;
_hostNameOverride = hostNameOverride;
_logContext = logContext;
@ -188,9 +188,9 @@ static NSUInteger kDefaultChannelId = 0;
connectInitialBackoff:_connectInitialBackoff
connectMaxBackoff:_connectMaxBackoff
additionalChannelArgs:[_additionalChannelArgs copy]
pemRootCert:_pemRootCert
pemPrivateKey:_pemPrivateKey
pemCertChain:_pemCertChain
PEMRootCertificates:_PEMRootCertificates
PEMPrivateKey:_PEMPrivateKey
PEMCertChain:_PEMCertChain
transportType:_transportType
hostNameOverride:_hostNameOverride
logContext:_logContext
@ -216,9 +216,9 @@ static NSUInteger kDefaultChannelId = 0;
connectInitialBackoff:_connectInitialBackoff
connectMaxBackoff:_connectMaxBackoff
additionalChannelArgs:[_additionalChannelArgs copy]
pemRootCert:_pemRootCert
pemPrivateKey:_pemPrivateKey
pemCertChain:_pemCertChain
PEMRootCertificates:_PEMRootCertificates
PEMPrivateKey:_PEMPrivateKey
PEMCertChain:_PEMCertChain
transportType:_transportType
hostNameOverride:_hostNameOverride
logContext:_logContext
@ -246,9 +246,9 @@ static NSUInteger kDefaultChannelId = 0;
@dynamic connectInitialBackoff;
@dynamic connectMaxBackoff;
@dynamic additionalChannelArgs;
@dynamic pemRootCert;
@dynamic pemPrivateKey;
@dynamic pemCertChain;
@dynamic PEMRootCertificates;
@dynamic PEMPrivateKey;
@dynamic PEMCertChain;
@dynamic transportType;
@dynamic hostNameOverride;
@dynamic logContext;
@ -271,9 +271,9 @@ static NSUInteger kDefaultChannelId = 0;
connectInitialBackoff:kDefaultConnectInitialBackoff
connectMaxBackoff:kDefaultConnectMaxBackoff
additionalChannelArgs:kDefaultAdditionalChannelArgs
pemRootCert:kDefaultPemRootCert
pemPrivateKey:kDefaultPemPrivateKey
pemCertChain:kDefaultPemCertChain
PEMRootCertificates:kDefaultPEMRootCertificates
PEMPrivateKey:kDefaultPEMPrivateKey
PEMCertChain:kDefaultPEMCertChain
transportType:kDefaultTransportType
hostNameOverride:kDefaultHostNameOverride
logContext:kDefaultLogContext
@ -298,9 +298,9 @@ static NSUInteger kDefaultChannelId = 0;
connectInitialBackoff:_connectInitialBackoff
connectMaxBackoff:_connectMaxBackoff
additionalChannelArgs:[_additionalChannelArgs copy]
pemRootCert:_pemRootCert
pemPrivateKey:_pemPrivateKey
pemCertChain:_pemCertChain
PEMRootCertificates:_PEMRootCertificates
PEMPrivateKey:_PEMPrivateKey
PEMCertChain:_PEMCertChain
transportType:_transportType
hostNameOverride:_hostNameOverride
logContext:_logContext
@ -326,9 +326,9 @@ static NSUInteger kDefaultChannelId = 0;
connectInitialBackoff:_connectInitialBackoff
connectMaxBackoff:_connectMaxBackoff
additionalChannelArgs:[_additionalChannelArgs copy]
pemRootCert:_pemRootCert
pemPrivateKey:_pemPrivateKey
pemCertChain:_pemCertChain
PEMRootCertificates:_PEMRootCertificates
PEMPrivateKey:_PEMPrivateKey
PEMCertChain:_PEMCertChain
transportType:_transportType
hostNameOverride:_hostNameOverride
logContext:_logContext
@ -421,16 +421,16 @@ static NSUInteger kDefaultChannelId = 0;
_additionalChannelArgs = additionalChannelArgs;
}
- (void)setPemRootCert:(NSString *)pemRootCert {
_pemRootCert = pemRootCert;
- (void)setPEMRootCertificates:(NSString *)PEMRootCertificates {
_PEMRootCertificates = PEMRootCertificates;
}
- (void)setPemPrivateKey:(NSString *)pemPrivateKey {
_pemPrivateKey = pemPrivateKey;
- (void)setPEMPrivateKey:(NSString *)PEMPrivateKey {
_PEMPrivateKey = PEMPrivateKey;
}
- (void)setPemCertChain:(NSString *)pemCertChain {
_pemCertChain = pemCertChain;
- (void)setPEMCertChain:(NSString *)PEMCertChain {
_PEMCertChain = PEMCertChain;
}
- (void)setTransportType:(GRPCTransportType)transportType {

@ -54,9 +54,9 @@ const NSTimeInterval kChannelDestroyDelay = 30;
#ifdef GRPC_COMPILE_WITH_CRONET
if (![GRPCCall isUsingCronet]) {
#endif
factory = [GRPCSecureChannelFactory factoryWithPEMRootCerts:_callOptions.pemRootCert
privateKey:_callOptions.pemPrivateKey
certChain:_callOptions.pemCertChain
factory = [GRPCSecureChannelFactory factoryWithPEMRootCerts:_callOptions.PEMRootCertificates
privateKey:_callOptions.PEMPrivateKey
certChain:_callOptions.PEMCertChain
error:&error];
if (error) {
NSLog(@"Error creating secure channel factory: %@", error);
@ -167,14 +167,14 @@ const NSTimeInterval kChannelDestroyDelay = 30;
[obj.callOptions.additionalChannelArgs
isEqualToDictionary:_callOptions.additionalChannelArgs]))
return NO;
if (!(obj.callOptions.pemRootCert == _callOptions.pemRootCert ||
[obj.callOptions.pemRootCert isEqualToString:_callOptions.pemRootCert]))
if (!(obj.callOptions.PEMRootCertificates == _callOptions.PEMRootCertificates ||
[obj.callOptions.PEMRootCertificates isEqualToString:_callOptions.PEMRootCertificates]))
return NO;
if (!(obj.callOptions.pemPrivateKey == _callOptions.pemPrivateKey ||
[obj.callOptions.pemPrivateKey isEqualToString:_callOptions.pemPrivateKey]))
if (!(obj.callOptions.PEMPrivateKey == _callOptions.PEMPrivateKey ||
[obj.callOptions.PEMPrivateKey isEqualToString:_callOptions.PEMPrivateKey]))
return NO;
if (!(obj.callOptions.pemCertChain == _callOptions.pemCertChain ||
[obj.callOptions.pemCertChain isEqualToString:_callOptions.pemCertChain]))
if (!(obj.callOptions.PEMCertChain == _callOptions.PEMCertChain ||
[obj.callOptions.PEMCertChain isEqualToString:_callOptions.PEMCertChain]))
return NO;
if (!(obj.callOptions.hostNameOverride == _callOptions.hostNameOverride ||
[obj.callOptions.hostNameOverride isEqualToString:_callOptions.hostNameOverride]))
@ -204,9 +204,9 @@ const NSTimeInterval kChannelDestroyDelay = 30;
result ^= (unsigned int)(_callOptions.connectInitialBackoff * 1000);
result ^= (unsigned int)(_callOptions.connectMaxBackoff * 1000);
result ^= _callOptions.additionalChannelArgs.hash;
result ^= _callOptions.pemRootCert.hash;
result ^= _callOptions.pemPrivateKey.hash;
result ^= _callOptions.pemCertChain.hash;
result ^= _callOptions.PEMRootCertificates.hash;
result ^= _callOptions.PEMPrivateKey.hash;
result ^= _callOptions.PEMCertChain.hash;
result ^= _callOptions.hostNameOverride.hash;
result ^= _callOptions.transportType;
result ^= [_callOptions.logContext hash];

@ -38,8 +38,8 @@ NS_ASSUME_NONNULL_BEGIN
static NSMutableDictionary *kHostCache;
@implementation GRPCHost {
NSString *_pemRootCerts;
NSString *_pemPrivateKey;
NSString *_PEMRootCertificates;
NSString *_PEMPrivateKey;
NSString *_pemCertChain;
}
@ -92,8 +92,8 @@ static NSMutableDictionary *kHostCache;
withPrivateKey:(nullable NSString *)pemPrivateKey
withCertChain:(nullable NSString *)pemCertChain
error:(NSError **)errorPtr {
_pemRootCerts = pemRootCerts;
_pemPrivateKey = pemPrivateKey;
_PEMRootCertificates = pemRootCerts;
_PEMPrivateKey = pemPrivateKey;
_pemCertChain = pemCertChain;
return YES;
}
@ -109,9 +109,9 @@ static NSMutableDictionary *kHostCache;
options.connectMinTimeout = (NSTimeInterval)_minConnectTimeout / 1000;
options.connectInitialBackoff = (NSTimeInterval)_initialConnectBackoff / 1000;
options.connectMaxBackoff = (NSTimeInterval)_maxConnectBackoff / 1000;
options.pemRootCert = _pemRootCerts;
options.pemPrivateKey = _pemPrivateKey;
options.pemCertChain = _pemCertChain;
options.PEMRootCertificates = _PEMRootCertificates;
options.PEMPrivateKey = _PEMPrivateKey;
options.PEMCertChain = _pemCertChain;
options.hostNameOverride = _hostNameOverride;
options.transportType = _transportType;
options.logContext = _logContext;

@ -51,7 +51,7 @@
* The root certificates to be used. The base implementation returns nil. Subclasses should override
* to appropriate settings.
*/
+ (NSString *)pemRootCert;
+ (NSString *)PEMRootCertificates;
/**
* The root certificates to be used. The base implementation returns nil. Subclasses should override

@ -147,7 +147,7 @@ BOOL isRemoteInteropTest(NSString *host) {
return GRPCTransportTypeChttp2BoringSSL;
}
+ (NSString *)pemRootCert {
+ (NSString *)PEMRootCertificates {
return nil;
}
@ -202,7 +202,7 @@ BOOL isRemoteInteropTest(NSString *host) {
GPBEmpty *request = [GPBEmpty message];
GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc] init];
options.transportType = self.class.transportType;
options.pemRootCert = self.class.pemRootCert;
options.PEMRootCertificates = self.class.PEMRootCertificates;
options.hostNameOverride = self.class.hostNameOverride;
[_service
@ -484,7 +484,7 @@ BOOL isRemoteInteropTest(NSString *host) {
requestedResponseSize:responses[index]];
GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc] init];
options.transportType = self.class.transportType;
options.pemRootCert = self.class.pemRootCert;
options.PEMRootCertificates = self.class.PEMRootCertificates;
options.hostNameOverride = self.class.hostNameOverride;
__block GRPCStreamingProtoCall *call = [_service
@ -629,7 +629,7 @@ BOOL isRemoteInteropTest(NSString *host) {
GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc] init];
options.transportType = self.class.transportType;
options.pemRootCert = self.class.pemRootCert;
options.PEMRootCertificates = self.class.PEMRootCertificates;
options.hostNameOverride = self.class.hostNameOverride;
id request =

@ -41,7 +41,7 @@ static int32_t kLocalInteropServerOverhead = 10;
return kLocalCleartextHost;
}
+ (NSString *)pemRootCert {
+ (NSString *)PEMRootCertificates {
return nil;
}

@ -40,7 +40,7 @@ static int32_t kLocalInteropServerOverhead = 10;
return kLocalSSLHost;
}
+ (NSString *)pemRootCert {
+ (NSString *)PEMRootCertificates {
NSBundle *bundle = [NSBundle bundleForClass:self.class];
NSString *certsPath =
[bundle pathForResource:@"TestCertificates.bundle/test-certificates" ofType:@"pem"];

@ -115,7 +115,7 @@ dispatch_once_t initCronet;
options = [[GRPCCallOptions alloc] init];
options.transportType = GRPCTransportTypeChttp2BoringSSL;
options.pemRootCert = certs;
options.PEMRootCertificates = certs;
options.hostNameOverride = @"foo.test.google.fr";
_localSSLService.options = options;
}

@ -41,7 +41,7 @@ static int32_t kRemoteInteropServerOverhead = 12;
return kRemoteSSLHost;
}
+ (NSString *)pemRootCert {
+ (NSString *)PEMRootCertificates {
return nil;
}

Loading…
Cancel
Save