Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
Google_Auth_ComputeEngine Class Reference
Inheritance diagram for Google_Auth_ComputeEngine:
Google_Auth_Abstract

Public Member Functions

 __construct (Google_Client $client, $config=null)
 
 acquireAccessToken ()
 Acquires a new access token from the compute engine metadata server.
 
 authenticatedRequest (Google_Http_Request $request)
 Perform an authenticated / signed apiHttpRequest.
 
 getAccessToken ()
 
 isAccessTokenExpired ()
 Returns if the access_token is expired.
 
 setAccessToken ($token)
 
 sign (Google_Http_Request $request)
 Include an accessToken in a given apiHttpRequest.
 

Public Attributes

const METADATA_AUTH_URL
 

Member Function Documentation

◆ acquireAccessToken()

Google_Auth_ComputeEngine::acquireAccessToken ( )

Acquires a new access token from the compute engine metadata server.

Exceptions
Google_Auth_Exception

◆ authenticatedRequest()

Google_Auth_ComputeEngine::authenticatedRequest ( Google_Http_Request $request)

Perform an authenticated / signed apiHttpRequest.

This function takes the apiHttpRequest, calls apiAuth->sign on it (which can modify the request in what ever way fits the auth mechanism) and then calls apiCurlIO\makeRequest on the signed request

Parameters
Google_Http_Request$request
Return values
Google_Http_RequestThe resulting HTTP response including the responseHttpCode, responseHeaders and responseBody.

Reimplemented from Google_Auth_Abstract.

◆ isAccessTokenExpired()

Google_Auth_ComputeEngine::isAccessTokenExpired ( )

Returns if the access_token is expired.

Return values
boolReturns True if the access_token is expired.

◆ setAccessToken()

Google_Auth_ComputeEngine::setAccessToken ( $token)
Parameters
string$token
Exceptions
Google_Auth_Exception

◆ sign()

Google_Auth_ComputeEngine::sign ( Google_Http_Request $request)

Include an accessToken in a given apiHttpRequest.

Parameters
Google_Http_Request$request
Return values
Google_Http_Request
Exceptions
Google_Auth_Exception

Reimplemented from Google_Auth_Abstract.

Member Data Documentation

◆ METADATA_AUTH_URL

const Google_Auth_ComputeEngine::METADATA_AUTH_URL
Initial value:
=
'http://metadata/computeMetadata/v1/instance/service-accounts/default/token'

The documentation for this class was generated from the following file: