Copied!

For connect to emulator.

  • TODO: implement HeaderCredentialsInterface instead of extending CredentialsWrapper
CloneableInstantiable
Methods
public __construct()
public static Google\ApiCore\CredentialsWrapper::build(array $args = [], string $universeDomain = 'googleapis.com'Google\Auth\GetUniverseDomainInterface::DEFAULT_UNIVERSE_DOMAIN)
 

Factory method to create a CredentialsWrapper from an array of options.

  • param array $args { An array of optional arguments.
    @type string|array $keyFile
          Credentials to be used. Accepts either a path to a credentials file, or a decoded
          credentials file as a PHP array. If this is not specified, application default
          credentials will be used.
    @type string[] $scopes
          A string array of scopes to use when acquiring credentials.
    @type callable $authHttpHandler
          A handler used to deliver PSR-7 requests specifically
          for authentication. Should match a signature of
          `function (RequestInterface $request, array $options) : ResponseInterface`.
    @type bool $enableCaching
          Enable caching of access tokens. Defaults to true.
    @type CacheItemPoolInterface $authCache
          A cache for storing access tokens. Defaults to a simple in memory implementation.
    @type array $authCacheOptions
          Cache configuration options.
    @type string $quotaProject
          Specifies a user project to bill for access charges associated with the request.
    @type string[] $defaultScopes
          A string array of default scopes to use when acquiring
          credentials.
    @type bool $useJwtAccessWithScope
          Ensures service account credentials use JWT Access (also known as self-signed
          JWTs), even when user-defined scopes are supplied.
    
    }
  • param string $universeDomain The expected universe of the credentials. Defaults to "googleapis.com"
  • return \CredentialsWrapper
  • throws \ValidationException
public checkUniverseDomain() : void
public getAuthorizationHeaderCallback( $audience = NULL) : ?callable
 
  • param string $audience
  • return callable|null Returns null so the gRPC can accept it as an insecure channel.
public Google\ApiCore\CredentialsWrapper::getBearerString()
 
  • deprecated
  • return string Bearer string containing access token.
public Google\ApiCore\CredentialsWrapper::getProjectId(?callable $httpHandler = NULL) : ?string
public Google\ApiCore\CredentialsWrapper::getQuotaProject() : ?string
 
  • return string|null The quota project associated with the credentials.
public static Google\ApiCore\CredentialsWrapper::validate(array $arr, array $requiredKeys)
 
  • param array $arr Associative array
  • param array $requiredKeys List of keys to check for in $arr
  • return array Returns $arr for fluent use
public static Google\ApiCore\CredentialsWrapper::validateNotNull(array $arr, array $requiredKeys)
 
  • param array $arr Associative array
  • param array $requiredKeys List of keys to check for in $arr
  • return array Returns $arr for fluent use
Methods
public static Google\ApiCore\CredentialsWrapper::build(array $args = [], string $universeDomain = 'googleapis.com'Google\Auth\GetUniverseDomainInterface::DEFAULT_UNIVERSE_DOMAIN)
 

Factory method to create a CredentialsWrapper from an array of options.

  • param array $args { An array of optional arguments.
    @type string|array $keyFile
          Credentials to be used. Accepts either a path to a credentials file, or a decoded
          credentials file as a PHP array. If this is not specified, application default
          credentials will be used.
    @type string[] $scopes
          A string array of scopes to use when acquiring credentials.
    @type callable $authHttpHandler
          A handler used to deliver PSR-7 requests specifically
          for authentication. Should match a signature of
          `function (RequestInterface $request, array $options) : ResponseInterface`.
    @type bool $enableCaching
          Enable caching of access tokens. Defaults to true.
    @type CacheItemPoolInterface $authCache
          A cache for storing access tokens. Defaults to a simple in memory implementation.
    @type array $authCacheOptions
          Cache configuration options.
    @type string $quotaProject
          Specifies a user project to bill for access charges associated with the request.
    @type string[] $defaultScopes
          A string array of default scopes to use when acquiring
          credentials.
    @type bool $useJwtAccessWithScope
          Ensures service account credentials use JWT Access (also known as self-signed
          JWTs), even when user-defined scopes are supplied.
    
    }
  • param string $universeDomain The expected universe of the credentials. Defaults to "googleapis.com"
  • return \CredentialsWrapper
  • throws \ValidationException
public static Google\ApiCore\CredentialsWrapper::validate(array $arr, array $requiredKeys)
 
  • param array $arr Associative array
  • param array $requiredKeys List of keys to check for in $arr
  • return array Returns $arr for fluent use
public static Google\ApiCore\CredentialsWrapper::validateNotNull(array $arr, array $requiredKeys)
 
  • param array $arr Associative array
  • param array $requiredKeys List of keys to check for in $arr
  • return array Returns $arr for fluent use
© 2025 Bruce Wells
Search Namespaces \ Classes
Configuration