\Google\AdsApi\Common\UtilLogMessageScrubbers

Static utility methods for scrubbing sensitive information from logs for outgoing requests.

Summary

Methods
Properties
Constants
scrubRequestHttpHeaders()
scrubRequestSoapHeaders()
scrubRequestSoapBodyTags()
scrubHttpHeadersArray()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
__construct()
$HTTP_REQUEST_HEADER_REGEX
$SOAP_REQUEST_HEADER_TAG_REGEX
$SOAP_REQUEST_BODY_TAG_REGEX
$REDACTED
N/A

Properties

$HTTP_REQUEST_HEADER_REGEX

$HTTP_REQUEST_HEADER_REGEX :string

Type

string—regex template for finding an HTTP header's name; e.g., will find 'Authorization: ' from 'Authorization: Bearer xyz'

$SOAP_REQUEST_HEADER_TAG_REGEX

$SOAP_REQUEST_HEADER_TAG_REGEX :string

Type

string—regex template for finding a SOAP XML tag in a SOAP header; e.g., will find '<developerToken>' and '</developerToken>' from '<developerToken>value</developerToken>'

$SOAP_REQUEST_BODY_TAG_REGEX

$SOAP_REQUEST_BODY_TAG_REGEX :string

Type

string—regex template for finding a SOAP XML tag in a SOAP body; e.g., find '<httpAuthorizationHeader>' and '</httpAuthorizationHeader>' from '<httpAuthorizationHeader>value</httpAuthorizationHeader>'

$REDACTED

$REDACTED :string

Type

string—text to use for redacted information

Methods

scrubRequestHttpHeaders()

scrubRequestHttpHeaders(string  $httpHeaders,array<mixed,string>  $headersToScrub): string

Scrubs the specified header values, replacing all occurrences in the specified request HTTP headers with a redacted token.

Parameters

string $httpHeaders
array<mixed,string> $headersToScrub

which HTTP headers to scrub

Returns

string —

the HTTP headers with any sensitive info removed

scrubRequestSoapHeaders()

scrubRequestSoapHeaders(string  $soapXml,array<mixed,string>  $headersToScrub): string

Scrubs the specified header values, replacing their occurrences in the specified request SOAP XML with a redacted token.

Parameters

string $soapXml
array<mixed,string> $headersToScrub

which SOAP headers to scrub

Returns

string —

the SOAP XML with any sensitive info removed from its headers

scrubRequestSoapBodyTags()

scrubRequestSoapBodyTags(string  $soapXml,array<mixed,string>  $tagsToScrub): string

Scrubs the values of specified tags, replacing their occurrences in the specified request SOAP XML with a redacted token.

Parameters

string $soapXml
array<mixed,string> $tagsToScrub

which SOAP tags to scrub

Returns

string —

the SOAP XML with any sensitive info removed from its headers

scrubHttpHeadersArray()

scrubHttpHeadersArray(array<mixed,string>  $httpHeaders,array<mixed,string>  $headersToScrub): array<mixed,string>

Scrubs an array of HTTP headers by replacing their values with a redacted token.

Parameters

array<mixed,string> $httpHeaders
array<mixed,string> $headersToScrub

which HTTP headers to scrub

Returns

array<mixed,string> —

the list of HTTP headers with any sensitive info removed

__construct()

__construct()