Skip to content

Commit

Permalink
feat: Add support for apiEndpoint and deprecate serviceAddress… (#2231)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and jdpedrie committed Aug 7, 2019
1 parent c30eb61 commit 0c289dd
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private static function getClientDefaults()
{
return [
'serviceName' => self::SERVICE_NAME,
'serviceAddress' => self::SERVICE_ADDRESS.':'.self::DEFAULT_SERVICE_PORT,
'apiEndpoint' => self::SERVICE_ADDRESS.':'.self::DEFAULT_SERVICE_PORT,
'clientConfig' => __DIR__.'/../resources/web_security_scanner_client_config.json',
'descriptorsConfigPath' => __DIR__.'/../resources/web_security_scanner_descriptor_config.php',
'gcpApiConfigPath' => __DIR__.'/../resources/web_security_scanner_grpc_config.json',
Expand Down Expand Up @@ -317,6 +317,9 @@ public static function parseName($formattedName, $template = null)
* Optional. Options for configuring the service API wrapper.
*
* @type string $serviceAddress
* **Deprecated**. This option will be removed in a future major release. Please
* utilize the `$apiEndpoint` option instead.
* @type string $apiEndpoint
* The address of the API remote host. May optionally include the port, formatted
* as "<uri>:<port>". Default 'websecurityscanner.googleapis.com:443'.
* @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials
Expand Down Expand Up @@ -344,7 +347,7 @@ public static function parseName($formattedName, $template = null)
* or `grpc`. Defaults to `grpc` if gRPC support is detected on the system.
* *Advanced usage*: Additionally, it is possible to pass in an already instantiated
* {@see \Google\ApiCore\Transport\TransportInterface} object. Note that when this
* object is provided, any settings in $transportConfig, and any $serviceAddress
* object is provided, any settings in $transportConfig, and any `$apiEndpoint`
* setting, will be ignored.
* @type array $transportConfig
* Configuration options that will be used to construct the transport. Options for
Expand Down
14 changes: 11 additions & 3 deletions WebSecurityScanner/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
{
"updateTime": "2019-05-23T18:09:44.813901Z",
"updateTime": "2019-08-07T18:07:22.635920Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.20.0",
"dockerImage": "googleapis/artman@sha256:3246adac900f4bdbd62920e80de2e5877380e44036b3feae13667ec255ebf5ec"
"version": "0.29.1",
"dockerImage": "googleapis/artman@sha256:b2a73f4dda03ef8fcaa973e3ba26d0cf34091f6c22c70add663af325931aef4d"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "3a1b46a6668194a527e532a2c355b404c79b0e6a",
"internalRef": "262167956"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,23 @@ private function createTransport($deserialize = null)
return new MockTransport($deserialize);
}

/**
* @return CredentialsWrapper
*/
private function createCredentials()
{
return $this->getMockBuilder(CredentialsWrapper::class)
->disableOriginalConstructor()
->getMock();
}

/**
* @return WebSecurityScannerClient
*/
private function createClient(array $options = [])
{
$options += [
'credentials' => $this->getMockBuilder(CredentialsWrapper::class)
->disableOriginalConstructor()
->getMock(),
'credentials' => $this->createCredentials(),
];

return new WebSecurityScannerClient($options);
Expand Down

0 comments on commit 0c289dd

Please sign in to comment.