Skip to content

Commit

Permalink
Merge pull request #6 from salman-mahmood/main
Browse files Browse the repository at this point in the history
Credentialsloader patched
  • Loading branch information
zfhassaan committed May 4, 2023
2 parents c3d213d + 7873a89 commit 1d4e1ec
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Genlytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Google\Analytics\Data\V1beta\DateRange;
use Google\Analytics\Data\V1beta\Dimension;
use Google\Analytics\Data\V1beta\Metric;
use Google\Auth\CredentialsLoader;
use Google\Auth\Credentialsloader;
use Google\Service\AnalyticsReporting\DimensionFilter;
use Throwable;

Expand Down
8 changes: 4 additions & 4 deletions src/overrides/ApplicationDefaultCredentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public static function getCredentials(
) {
$creds = null;

$jsonKey = CredentialsLoader::fromWellKnownFile();
$jsonKey = Credentialsloader::fromWellKnownFile();
$anyScope = $scope ?: $defaultScope;

if (!$httpHandler) {
Expand All @@ -177,7 +177,7 @@ public static function getCredentials(
if ($quotaProject) {
$jsonKey['quota_project_id'] = $quotaProject;
}
$creds = CredentialsLoader::makeCredentials(
$creds = Credentialsloader::makeCredentials(
$scope,
$jsonKey,
$defaultScope
Expand Down Expand Up @@ -273,8 +273,8 @@ public static function getIdTokenCredentials(
CacheItemPoolInterface $cache = null
) {
$creds = null;
$jsonKey = CredentialsLoader::fromEnv()
?: CredentialsLoader::fromWellKnownFile();
$jsonKey = Credentialsloader::fromEnv()
?: Credentialsloader::fromWellKnownFile();

if (!$httpHandler) {
if (!($client = HttpClientCache::getHttpClient())) {
Expand Down
4 changes: 2 additions & 2 deletions src/overrides/CredentialsWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use zfhassaan\genlytics\overrides\ApplicationDefaultCredentials;
use Google\Auth\Cache\MemoryCacheItemPool;
use Google\Auth\Credentials\ServiceAccountCredentials;
use Google\Auth\CredentialsLoader;
use Google\Auth\Credentialsloader;
use Google\Auth\FetchAuthTokenCache;
use Google\Auth\FetchAuthTokenInterface;
use Google\Auth\GetQuotaProjectInterface;
Expand Down Expand Up @@ -119,7 +119,7 @@ public static function build(array $args = [])
$keyFile['quota_project_id'] = $args['quotaProject'];
}

$loader = CredentialsLoader::makeCredentials(
$loader = Credentialsloader::makeCredentials(
$args['scopes'],
$keyFile,
$args['defaultScopes']
Expand Down
4 changes: 2 additions & 2 deletions src/overrides/Credentialsloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
use UnexpectedValueException;

/**
* CredentialsLoader contains the behaviour used to locate and find default
* Credentialsloader contains the behaviour used to locate and find default
* credentials files on the file system.
*/
abstract class CredentialsLoader implements
abstract class Credentialsloader implements
FetchAuthTokenInterface,
UpdateMetadataInterface
{
Expand Down
6 changes: 3 additions & 3 deletions src/overrides/GapicClientTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
use Google\ApiCore\Transport\GrpcTransport;
use zfhassaan\genlytics\overrides\RestTransport;
use Google\ApiCore\Transport\TransportInterface;
use Google\Auth\CredentialsLoader;
use Google\Auth\Credentialsloader;
use Google\Auth\FetchAuthTokenInterface;
use Google\LongRunning\Operation;
use Google\Protobuf\Internal\Message;
Expand Down Expand Up @@ -235,8 +235,8 @@ private function buildClientOptions(array $options)

// mTLS: detect and load the default clientCertSource if the environment variable
// "GOOGLE_API_USE_CLIENT_CERTIFICATE" is true, and the cert source is available
if (empty($options['clientCertSource']) && CredentialsLoader::shouldLoadClientCertSource()) {
if ($defaultCertSource = CredentialsLoader::getDefaultClientCertSource()) {
if (empty($options['clientCertSource']) && Credentialsloader::shouldLoadClientCertSource()) {
if ($defaultCertSource = Credentialsloader::getDefaultClientCertSource()) {
$options['clientCertSource'] = function () use ($defaultCertSource) {
$cert = call_user_func($defaultCertSource);

Expand Down

0 comments on commit 1d4e1ec

Please sign in to comment.