Skip to content

Commit 439b138

Browse files
committed
Merge pull request googleapis#56 from ianbarber/master
Replacing tabs with spaces
2 parents 4149acd + b6f2581 commit 439b138

File tree

2 files changed

+37
-37
lines changed

2 files changed

+37
-37
lines changed

src/Google/Client.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -379,15 +379,15 @@ public function verifyIdToken($token = null)
379379
}
380380

381381
/**
382-
* Verify a JWT that was signed with your own certificates.
383-
*
384-
* @param $jwt the token
385-
* @param $certs array of certificates
386-
* @param $required_audience the expected consumer of the token
387-
* @param [$issuer] the expected issues, defaults to Google
388-
* @param [$max_expiry] the max lifetime of a token, defaults to MAX_TOKEN_LIFETIME_SECS
389-
* @return token information if valid, false if not
390-
*/
382+
* Verify a JWT that was signed with your own certificates.
383+
*
384+
* @param $jwt the token
385+
* @param $certs array of certificates
386+
* @param $required_audience the expected consumer of the token
387+
* @param [$issuer] the expected issues, defaults to Google
388+
* @param [$max_expiry] the max lifetime of a token, defaults to MAX_TOKEN_LIFETIME_SECS
389+
* @return token information if valid, false if not
390+
*/
391391
public function verifySignedJwt($id_token, $cert_location, $audience, $issuer, $max_expiry = null)
392392
{
393393
$auth = new Google_Auth_OAuth2($this);

tests/general/ApiClientTest.php

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -120,34 +120,34 @@ public function testAppEngineAutoConfig() {
120120
$this->assertInstanceOf('Google_Cache_Memcache', $client->getCache());
121121
unset($_SERVER['SERVER_SOFTWARE']);
122122
}
123-
123+
124124
public function testJsonConfig() {
125125
// Device config
126-
$config = new Google_Config();
127-
$client = new Google_Client($config);
128-
$device = '{"installed":{"auth_uri":"https://accounts.google.com/o/oauth2/auth","client_secret":"N0aHCBT1qX1VAcF5J1pJAn6S","token_uri":"https://accounts.google.com/o/oauth2/token","client_email":"","redirect_uris":["urn:ietf:wg:oauth:2.0:oob","oob"],"client_x509_cert_url":"","client_id":"123456789.apps.googleusercontent.com","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs"}}';
129-
$dObj = json_decode($device);
130-
$client->setAuthConfig($device);
131-
$cfg = $config->getClassConfig('Google_Auth_OAuth2');
132-
$this->assertEquals($cfg['client_id'], $dObj->installed->client_id);
133-
$this->assertEquals($cfg['client_secret'], $dObj->installed->client_secret);
134-
$this->assertEquals($cfg['redirect_uri'], $dObj->installed->redirect_uris[0]);
135-
136-
// Web config
137-
$config = new Google_Config();
138-
$client = new Google_Client($config);
139-
$web = '{"web":{"auth_uri":"https://accounts.google.com/o/oauth2/auth","client_secret":"lpoubuib8bj-Fmke_YhhyHGgXc","token_uri":"https://accounts.google.com/o/oauth2/token","client_email":"123456789@developer.gserviceaccount.com","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/123456789@developer.gserviceaccount.com","client_id":"123456789.apps.googleusercontent.com","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs"}}';
140-
$wObj = json_decode($web);
141-
$client->setAuthConfig($web);
142-
$cfg = $config->getClassConfig('Google_Auth_OAuth2');
143-
$this->assertEquals($cfg['client_id'], $wObj->web->client_id);
144-
$this->assertEquals($cfg['client_secret'], $wObj->web->client_secret);
145-
$this->assertEquals($cfg['redirect_uri'], '');
146-
}
147-
148-
public function testIniConfig() {
149-
$config = new Google_Config(__DIR__ . "/testdata/test.ini");
150-
$this->assertEquals('My Test application', $config->getApplicationName());
151-
$this->assertEquals('gjfiwnGinpena3', $config->getClassConfig('Google_Auth_OAuth2', 'client_secret'));
152-
}
126+
$config = new Google_Config();
127+
$client = new Google_Client($config);
128+
$device = '{"installed":{"auth_uri":"https://accounts.google.com/o/oauth2/auth","client_secret":"N0aHCBT1qX1VAcF5J1pJAn6S","token_uri":"https://accounts.google.com/o/oauth2/token","client_email":"","redirect_uris":["urn:ietf:wg:oauth:2.0:oob","oob"],"client_x509_cert_url":"","client_id":"123456789.apps.googleusercontent.com","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs"}}';
129+
$dObj = json_decode($device);
130+
$client->setAuthConfig($device);
131+
$cfg = $config->getClassConfig('Google_Auth_OAuth2');
132+
$this->assertEquals($cfg['client_id'], $dObj->installed->client_id);
133+
$this->assertEquals($cfg['client_secret'], $dObj->installed->client_secret);
134+
$this->assertEquals($cfg['redirect_uri'], $dObj->installed->redirect_uris[0]);
135+
136+
// Web config
137+
$config = new Google_Config();
138+
$client = new Google_Client($config);
139+
$web = '{"web":{"auth_uri":"https://accounts.google.com/o/oauth2/auth","client_secret":"lpoubuib8bj-Fmke_YhhyHGgXc","token_uri":"https://accounts.google.com/o/oauth2/token","client_email":"123456789@developer.gserviceaccount.com","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/123456789@developer.gserviceaccount.com","client_id":"123456789.apps.googleusercontent.com","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs"}}';
140+
$wObj = json_decode($web);
141+
$client->setAuthConfig($web);
142+
$cfg = $config->getClassConfig('Google_Auth_OAuth2');
143+
$this->assertEquals($cfg['client_id'], $wObj->web->client_id);
144+
$this->assertEquals($cfg['client_secret'], $wObj->web->client_secret);
145+
$this->assertEquals($cfg['redirect_uri'], '');
146+
}
147+
148+
public function testIniConfig() {
149+
$config = new Google_Config(__DIR__ . "/testdata/test.ini");
150+
$this->assertEquals('My Test application', $config->getApplicationName());
151+
$this->assertEquals('gjfiwnGinpena3', $config->getClassConfig('Google_Auth_OAuth2', 'client_secret'));
152+
}
153153
}

0 commit comments

Comments
 (0)