PluginProbe ʕ •ᴥ•ʔ
WP Mail SMTP by WPForms – The Most Popular SMTP and Email Log Plugin / 4.9.0
WP Mail SMTP by WPForms – The Most Popular SMTP and Email Log Plugin v4.9.0
4.9.0 0.9.6 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 1.5.2 1.6.0 1.6.2 1.7.0 1.7.1 1.8.0 1.8.1 1.9.0 2.0.0 2.0.1 2.1.1 2.2.1 2.3.1 2.4.0 2.5.0 2.5.1 2.6.0 2.7.0 2.8.0 2.9.0 3.0.1 3.0.2 3.0.3 3.1.0 3.10.0 3.11.0 3.11.1 3.2.0 3.2.1 3.3.0 3.4.0 3.5.0 3.5.1 3.5.2 3.6.1 3.7.0 3.8.0 3.8.2 3.9.0 4.0.1 4.1.0 4.1.1 4.2.0 4.3.0 4.4.0 4.5.0 4.6.0 4.7.0 4.7.1 4.8.0 trunk 0.10.0 0.10.1 0.11.1 0.11.2 0.3.1 0.3.2 0.4 0.4.1 0.4.2 0.5.0 0.5.1 0.5.2 0.6 0.7 0.8 0.8.2 0.8.3 0.8.4 0.8.5 0.8.6 0.8.7 0.9.0 0.9.1 0.9.2 0.9.3 0.9.4 0.9.5
wp-mail-smtp / vendor_prefixed / google / auth / src / UpdateMetadataTrait.php
wp-mail-smtp / vendor_prefixed / google / auth / src Last commit date
Cache 5 days ago CredentialSource 5 days ago Credentials 5 days ago HttpHandler 5 days ago Middleware 5 days ago AccessToken.php 5 days ago ApplicationDefaultCredentials.php 5 days ago CacheTrait.php 5 days ago CredentialsLoader.php 5 days ago ExternalAccountCredentialSourceInterface.php 5 days ago FetchAuthTokenCache.php 5 days ago FetchAuthTokenInterface.php 5 days ago GCECache.php 5 days ago GetQuotaProjectInterface.php 5 days ago GetUniverseDomainInterface.php 5 days ago Iam.php 5 days ago IamSignerTrait.php 5 days ago OAuth2.php 5 days ago ProjectIdProviderInterface.php 5 days ago ServiceAccountSignerTrait.php 5 days ago SignBlobInterface.php 5 days ago UpdateMetadataInterface.php 5 days ago UpdateMetadataTrait.php 5 days ago
UpdateMetadataTrait.php
63 lines
1 <?php
2
3 /*
4 * Copyright 2023 Google LLC
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18 namespace WPMailSMTP\Vendor\Google\Auth;
19
20 /**
21 * Provides shared methods for updating request metadata (request headers).
22 *
23 * Should implement {@see UpdateMetadataInterface} and {@see FetchAuthTokenInterface}.
24 *
25 * @internal
26 */
27 trait UpdateMetadataTrait
28 {
29 /**
30 * export a callback function which updates runtime metadata.
31 *
32 * @return callable updateMetadata function
33 * @deprecated
34 */
35 public function getUpdateMetadataFunc()
36 {
37 return [$this, 'updateMetadata'];
38 }
39 /**
40 * Updates metadata with the authorization token.
41 *
42 * @param array<mixed> $metadata metadata hashmap
43 * @param string $authUri optional auth uri
44 * @param callable $httpHandler callback which delivers psr7 request
45 * @return array<mixed> updated metadata hashmap
46 */
47 public function updateMetadata($metadata, $authUri = null, ?callable $httpHandler = null)
48 {
49 if (isset($metadata[self::AUTH_METADATA_KEY])) {
50 // Auth metadata has already been set
51 return $metadata;
52 }
53 $result = $this->fetchAuthToken($httpHandler);
54 $metadata_copy = $metadata;
55 if (isset($result['access_token'])) {
56 $metadata_copy[self::AUTH_METADATA_KEY] = ['Bearer ' . $result['access_token']];
57 } elseif (isset($result['id_token'])) {
58 $metadata_copy[self::AUTH_METADATA_KEY] = ['Bearer ' . $result['id_token']];
59 }
60 return $metadata_copy;
61 }
62 }
63