diff --git a/.github/workflows/security-scan.yml b/.github/workflows/security-scan.yml
index 23316bebe..b30f14760 100644
--- a/.github/workflows/security-scan.yml
+++ b/.github/workflows/security-scan.yml
@@ -13,7 +13,7 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@v4
+ uses: actions/checkout@v6
- name: Run Security Check
id: test
diff --git a/changelog.txt b/changelog.txt
index 0073b7e5e..4c2743d4a 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,4 +1,11 @@
== Changelog ==
+= 4.1.3-RC1 =
+* COMPATIBILITY - PolyLang Compatibility replaced with [WP-Stateless – Polylang Pro Addon](https://wordpress.org/plugins/wp-stateless-polylang-pro-addon/).
+* ENHANCEMENT - updated `firebase/php-jwt` library from from 6.10.1 to 6.10.2.
+* ENHANCEMENT - updated `wpmetabox/meta-box` library from from 5.10.1 to 5.10.2.
+* ENHANCEMENT - Updated Client library for Google APIs from 2.17.0 to 2.18.2.
+* FIX - apply `Cache Control` setting to all files (previously applied only to images).
+
= 4.1.2 =
* ENHANCEMENT - added `REST API Endpoint` setting, which useful when WordPress dashboard and frontend website utilize different domain names.
* ENHANCEMENT - extended `Status Info` with the information to help diagnose REST API or AJAX issues.
diff --git a/changes.md b/changes.md
index 18b0e455d..f18c6cb47 100644
--- a/changes.md
+++ b/changes.md
@@ -1,3 +1,10 @@
+#### 4.1.3-RC1
+* COMPATIBILITY - PolyLang Compatibility replaced with [WP-Stateless – Polylang Pro Addon](https://wordpress.org/plugins/wp-stateless-polylang-pro-addon/).
+* ENHANCEMENT - updated `firebase/php-jwt` library from from 6.10.1 to 6.10.2.
+* ENHANCEMENT - updated `wpmetabox/meta-box` library from from 5.10.1 to 5.10.2.
+* ENHANCEMENT - Updated Client library for Google APIs from 2.17.0 to 2.18.2.
+* FIX - apply `Cache Control` setting to all files (previously applied only to images).
+
#### 4.1.2
* ENHANCEMENT - added `REST API Endpoint` setting, which useful when WordPress dashboard and frontend website utilize different domain names.
* ENHANCEMENT - extended `Status Info` with the information to help diagnose REST API or AJAX issues.
diff --git a/composer.json b/composer.json
index 926de7cab..29d55a80f 100644
--- a/composer.json
+++ b/composer.json
@@ -22,7 +22,7 @@
],
"require": {
"php": ">=5.6.20",
- "composer/installers": "~2.2",
+ "composer/installers": "~2.3",
"ccampbell/chromephp": "^4.1",
"firebase/php-jwt": "^6.1.2",
"wpmetabox/meta-box": "^5.6.3",
@@ -94,7 +94,7 @@
},
"require-dev": {
"coenjacobs/mozart": "0.7.1",
- "deliciousbrains/wp-background-processing": "^1.0"
+ "deliciousbrains/wp-background-processing": "1.3.1"
},
"config": {
"allow-plugins": {
diff --git a/composer.lock b/composer.lock
index 8255db5c6..6815f9ccc 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "d4dc2a56ca8676c853b9b81d56944b35",
+ "content-hash": "15618c6fa8c965afa9466b50cfd54421",
"packages": [
{
"name": "ccampbell/chromephp",
@@ -201,16 +201,16 @@
},
{
"name": "firebase/php-jwt",
- "version": "v6.10.1",
+ "version": "v6.10.2",
"source": {
"type": "git",
"url": "https://github.com/firebase/php-jwt.git",
- "reference": "500501c2ce893c824c801da135d02661199f60c5"
+ "reference": "30c19ed0f3264cb660ea496895cfb6ef7ee3653b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/firebase/php-jwt/zipball/500501c2ce893c824c801da135d02661199f60c5",
- "reference": "500501c2ce893c824c801da135d02661199f60c5",
+ "url": "https://api.github.com/repos/firebase/php-jwt/zipball/30c19ed0f3264cb660ea496895cfb6ef7ee3653b",
+ "reference": "30c19ed0f3264cb660ea496895cfb6ef7ee3653b",
"shasum": ""
},
"require": {
@@ -258,9 +258,9 @@
],
"support": {
"issues": "https://github.com/firebase/php-jwt/issues",
- "source": "https://github.com/firebase/php-jwt/tree/v6.10.1"
+ "source": "https://github.com/firebase/php-jwt/tree/v6.10.2"
},
- "time": "2024-05-18T18:05:11+00:00"
+ "time": "2024-11-24T11:22:49+00:00"
},
{
"name": "udx/lib-ud-api-client",
@@ -340,16 +340,16 @@
},
{
"name": "wpmetabox/meta-box",
- "version": "5.10.1",
+ "version": "5.10.2",
"source": {
"type": "git",
"url": "https://github.com/wpmetabox/meta-box.git",
- "reference": "6f571c95c2928703509f60de09be9c3d6df8ce0a"
+ "reference": "c28a96abe84cff63e3cec0e6c9d525602212c998"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/wpmetabox/meta-box/zipball/6f571c95c2928703509f60de09be9c3d6df8ce0a",
- "reference": "6f571c95c2928703509f60de09be9c3d6df8ce0a",
+ "url": "https://api.github.com/repos/wpmetabox/meta-box/zipball/c28a96abe84cff63e3cec0e6c9d525602212c998",
+ "reference": "c28a96abe84cff63e3cec0e6c9d525602212c998",
"shasum": ""
},
"require-dev": {
@@ -386,9 +386,9 @@
],
"support": {
"issues": "https://github.com/wpmetabox/meta-box/issues",
- "source": "https://github.com/wpmetabox/meta-box/tree/5.10.1"
+ "source": "https://github.com/wpmetabox/meta-box/tree/5.10.2"
},
- "time": "2024-09-07T03:49:09+00:00"
+ "time": "2024-09-26T09:55:59+00:00"
}
],
"packages-dev": [
@@ -705,16 +705,16 @@
},
{
"name": "symfony/console",
- "version": "v5.4.44",
+ "version": "v5.4.47",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "5b5a0aa66e3296e303e22490f90f521551835a83"
+ "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/5b5a0aa66e3296e303e22490f90f521551835a83",
- "reference": "5b5a0aa66e3296e303e22490f90f521551835a83",
+ "url": "https://api.github.com/repos/symfony/console/zipball/c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed",
+ "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed",
"shasum": ""
},
"require": {
@@ -784,7 +784,7 @@
"terminal"
],
"support": {
- "source": "https://github.com/symfony/console/tree/v5.4.44"
+ "source": "https://github.com/symfony/console/tree/v5.4.47"
},
"funding": [
{
@@ -800,7 +800,7 @@
"type": "tidelift"
}
],
- "time": "2024-09-20T07:56:40+00:00"
+ "time": "2024-11-06T11:30:55+00:00"
},
{
"name": "symfony/deprecation-contracts",
@@ -821,12 +821,12 @@
},
"type": "library",
"extra": {
+ "thanks": {
+ "url": "https://github.com/symfony/contracts",
+ "name": "symfony/contracts"
+ },
"branch-alias": {
"dev-main": "3.0-dev"
- },
- "thanks": {
- "name": "symfony/contracts",
- "url": "https://github.com/symfony/contracts"
}
},
"autoload": {
@@ -871,16 +871,16 @@
},
{
"name": "symfony/finder",
- "version": "v5.4.43",
+ "version": "v5.4.45",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
- "reference": "ae25a9145a900764158d439653d5630191155ca0"
+ "reference": "63741784cd7b9967975eec610b256eed3ede022b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/finder/zipball/ae25a9145a900764158d439653d5630191155ca0",
- "reference": "ae25a9145a900764158d439653d5630191155ca0",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/63741784cd7b9967975eec610b256eed3ede022b",
+ "reference": "63741784cd7b9967975eec610b256eed3ede022b",
"shasum": ""
},
"require": {
@@ -914,7 +914,7 @@
"description": "Finds files and directories via an intuitive fluent interface",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/finder/tree/v5.4.43"
+ "source": "https://github.com/symfony/finder/tree/v5.4.45"
},
"funding": [
{
@@ -930,7 +930,7 @@
"type": "tidelift"
}
],
- "time": "2024-08-13T14:03:51+00:00"
+ "time": "2024-09-28T13:32:08+00:00"
},
{
"name": "symfony/polyfill-ctype",
@@ -958,8 +958,8 @@
"type": "library",
"extra": {
"thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
+ "url": "https://github.com/symfony/polyfill",
+ "name": "symfony/polyfill"
}
},
"autoload": {
@@ -1034,8 +1034,8 @@
"type": "library",
"extra": {
"thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
+ "url": "https://github.com/symfony/polyfill",
+ "name": "symfony/polyfill"
}
},
"autoload": {
@@ -1112,8 +1112,8 @@
"type": "library",
"extra": {
"thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
+ "url": "https://github.com/symfony/polyfill",
+ "name": "symfony/polyfill"
}
},
"autoload": {
@@ -1196,8 +1196,8 @@
"type": "library",
"extra": {
"thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
+ "url": "https://github.com/symfony/polyfill",
+ "name": "symfony/polyfill"
}
},
"autoload": {
@@ -1270,8 +1270,8 @@
"type": "library",
"extra": {
"thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
+ "url": "https://github.com/symfony/polyfill",
+ "name": "symfony/polyfill"
}
},
"autoload": {
@@ -1346,8 +1346,8 @@
"type": "library",
"extra": {
"thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
+ "url": "https://github.com/symfony/polyfill",
+ "name": "symfony/polyfill"
}
},
"autoload": {
@@ -1432,12 +1432,12 @@
},
"type": "library",
"extra": {
+ "thanks": {
+ "url": "https://github.com/symfony/contracts",
+ "name": "symfony/contracts"
+ },
"branch-alias": {
"dev-main": "3.0-dev"
- },
- "thanks": {
- "name": "symfony/contracts",
- "url": "https://github.com/symfony/contracts"
}
},
"autoload": {
diff --git a/lib/Google/CHANGELOG.md b/lib/Google/CHANGELOG.md
index a43c59d90..00f046fb5 100644
--- a/lib/Google/CHANGELOG.md
+++ b/lib/Google/CHANGELOG.md
@@ -1,5 +1,31 @@
# Changelog
+## [2.18.2](https://github.com/googleapis/google-api-php-client/compare/v2.18.1...v2.18.2) (2024-12-16)
+
+
+### Bug Fixes
+
+* Correct type for jwt constructor arg ([#2648](https://github.com/googleapis/google-api-php-client/issues/2648)) ([31a9861](https://github.com/googleapis/google-api-php-client/commit/31a9861af02a8e9070b395f05caed7ffce0ef8be))
+
+## [2.18.1](https://github.com/googleapis/google-api-php-client/compare/v2.18.0...v2.18.1) (2024-11-24)
+
+
+### Bug Fixes
+
+* Implicitly marking parameter as nullable is deprecated ([#2638](https://github.com/googleapis/google-api-php-client/issues/2638)) ([de57db2](https://github.com/googleapis/google-api-php-client/commit/de57db2fdc0d56de1abbf778b28b77c3347eb3fd))
+
+## [2.18.0](https://github.com/googleapis/google-api-php-client/compare/v2.17.0...v2.18.0) (2024-10-16)
+
+
+### Features
+
+* **docs:** Use doctum shared workflow for reference docs ([#2618](https://github.com/googleapis/google-api-php-client/issues/2618)) ([242e2cb](https://github.com/googleapis/google-api-php-client/commit/242e2cb09ad5b25b047a862b4d521037e74cae29))
+
+
+### Bug Fixes
+
+* Explicit token caching issue ([#2358](https://github.com/googleapis/google-api-php-client/issues/2358)) ([dc13e5e](https://github.com/googleapis/google-api-php-client/commit/dc13e5e3f517148d3c66d151a5ab133b7840d8fb))
+
## [2.17.0](https://github.com/googleapis/google-api-php-client/compare/v2.16.0...v2.17.0) (2024-07-10)
diff --git a/lib/Google/README.md b/lib/Google/README.md
index 95150d9f1..93b52cacb 100644
--- a/lib/Google/README.md
+++ b/lib/Google/README.md
@@ -7,7 +7,7 @@ list of [Google cloud packages](https://cloud.google.com/php/docs/reference) fir
these are the recommended libraries.
- - Reference Docs
- https://googleapis.github.io/google-api-php-client/main/
+ - Reference Docs
- https://googleapis.github.io/google-api-php-client/
- License
- Apache 2.0
diff --git a/lib/Google/composer.json b/lib/Google/composer.json
index bfe4a74e2..363efcf26 100644
--- a/lib/Google/composer.json
+++ b/lib/Google/composer.json
@@ -14,15 +14,15 @@
"phpseclib/phpseclib": "^3.0.36",
"guzzlehttp/guzzle": "^7.4.5",
"guzzlehttp/psr7": "^2.6",
- "google/cloud-storage": "^1.42",
- "google/cloud-core": "^1.59"
+ "google/cloud-storage": "^1.45",
+ "google/cloud-core": "^1.60"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.8",
"symfony/dom-crawler": "~2.1",
"symfony/css-selector": "~2.1",
"phpcompatibility/php-compatibility": "^9.2",
- "composer/composer": "^1.10.23",
+ "composer/composer": "^2.0.0",
"phpspec/prophecy-phpunit": "^2.1",
"phpunit/phpunit": "^9.6"
},
@@ -44,11 +44,11 @@
"pre-autoload-dump": "Google\\Task\\Composer::cleanup"
},
"extra": {
- "branch-alias": {
- "dev-main": "2.x-dev"
- },
"google/apiclient-services": [
"Storage"
- ]
+ ],
+ "branch-alias": {
+ "dev-main": "2.x-dev"
+ }
}
}
diff --git a/lib/Google/composer.lock b/lib/Google/composer.lock
index 9e09f86ec..4d2661567 100644
--- a/lib/Google/composer.lock
+++ b/lib/Google/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "5f8095bfc4b39d1dfaa576eaf319db82",
+ "content-hash": "87c129ac8420ebb85af071226ee62b25",
"packages": [
{
"name": "brick/math",
@@ -63,16 +63,16 @@
},
{
"name": "firebase/php-jwt",
- "version": "v6.10.1",
+ "version": "v6.10.2",
"source": {
"type": "git",
"url": "https://github.com/firebase/php-jwt.git",
- "reference": "500501c2ce893c824c801da135d02661199f60c5"
+ "reference": "30c19ed0f3264cb660ea496895cfb6ef7ee3653b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/firebase/php-jwt/zipball/500501c2ce893c824c801da135d02661199f60c5",
- "reference": "500501c2ce893c824c801da135d02661199f60c5",
+ "url": "https://api.github.com/repos/firebase/php-jwt/zipball/30c19ed0f3264cb660ea496895cfb6ef7ee3653b",
+ "reference": "30c19ed0f3264cb660ea496895cfb6ef7ee3653b",
"shasum": ""
},
"require": {
@@ -120,22 +120,22 @@
],
"support": {
"issues": "https://github.com/firebase/php-jwt/issues",
- "source": "https://github.com/firebase/php-jwt/tree/v6.10.1"
+ "source": "https://github.com/firebase/php-jwt/tree/v6.10.2"
},
- "time": "2024-05-18T18:05:11+00:00"
+ "time": "2024-11-24T11:22:49+00:00"
},
{
"name": "google/apiclient-services",
- "version": "v0.363.0",
+ "version": "v0.389.0",
"source": {
"type": "git",
"url": "https://github.com/googleapis/google-api-php-client-services.git",
- "reference": "5a0943e498e98e23dccdd98c5a3f74bc1b442053"
+ "reference": "6274e67ee52b1a416ccee0a4eaf337d1139cdaf8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/5a0943e498e98e23dccdd98c5a3f74bc1b442053",
- "reference": "5a0943e498e98e23dccdd98c5a3f74bc1b442053",
+ "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/6274e67ee52b1a416ccee0a4eaf337d1139cdaf8",
+ "reference": "6274e67ee52b1a416ccee0a4eaf337d1139cdaf8",
"shasum": ""
},
"require": {
@@ -164,22 +164,22 @@
],
"support": {
"issues": "https://github.com/googleapis/google-api-php-client-services/issues",
- "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.363.0"
+ "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.389.0"
},
- "time": "2024-07-02T01:04:18+00:00"
+ "time": "2025-01-05T01:04:21+00:00"
},
{
"name": "google/auth",
- "version": "v1.40.0",
+ "version": "v1.45.0",
"source": {
"type": "git",
"url": "https://github.com/googleapis/google-auth-library-php.git",
- "reference": "bff9f2d01677e71a98394b5ac981b99523df5178"
+ "reference": "cfcb93162341ed5022fa976e621f0fa2b05ba6ad"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/bff9f2d01677e71a98394b5ac981b99523df5178",
- "reference": "bff9f2d01677e71a98394b5ac981b99523df5178",
+ "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/cfcb93162341ed5022fa976e621f0fa2b05ba6ad",
+ "reference": "cfcb93162341ed5022fa976e621f0fa2b05ba6ad",
"shasum": ""
},
"require": {
@@ -188,7 +188,8 @@
"guzzlehttp/psr7": "^2.4.5",
"php": "^8.0",
"psr/cache": "^2.0||^3.0",
- "psr/http-message": "^1.1||^2.0"
+ "psr/http-message": "^1.1||^2.0",
+ "psr/log": "^3.0"
},
"require-dev": {
"guzzlehttp/promises": "^2.0",
@@ -224,27 +225,27 @@
"support": {
"docs": "https://googleapis.github.io/google-auth-library-php/main/",
"issues": "https://github.com/googleapis/google-auth-library-php/issues",
- "source": "https://github.com/googleapis/google-auth-library-php/tree/v1.40.0"
+ "source": "https://github.com/googleapis/google-auth-library-php/tree/v1.45.0"
},
- "time": "2024-05-31T19:16:15+00:00"
+ "time": "2024-12-11T02:10:48+00:00"
},
{
"name": "google/cloud-core",
- "version": "v1.59.1",
+ "version": "v1.60.1",
"source": {
"type": "git",
"url": "https://github.com/googleapis/google-cloud-php-core.git",
- "reference": "35aae23dc4d0b860b6c3733e5cf381a510b506d9"
+ "reference": "c149dd075a77bc8555a0eff46267522f1c4e0bfd"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/googleapis/google-cloud-php-core/zipball/35aae23dc4d0b860b6c3733e5cf381a510b506d9",
- "reference": "35aae23dc4d0b860b6c3733e5cf381a510b506d9",
+ "url": "https://api.github.com/repos/googleapis/google-cloud-php-core/zipball/c149dd075a77bc8555a0eff46267522f1c4e0bfd",
+ "reference": "c149dd075a77bc8555a0eff46267522f1c4e0bfd",
"shasum": ""
},
"require": {
"google/auth": "^1.34",
- "google/gax": "^1.34.0",
+ "google/gax": "^1.36.0",
"guzzlehttp/guzzle": "^6.5.8|^7.4.4",
"guzzlehttp/promises": "^1.4||^2.0",
"guzzlehttp/psr7": "^2.6",
@@ -257,7 +258,7 @@
"erusev/parsedown": "^1.6",
"google/cloud-common-protos": "~0.5",
"opis/closure": "^3",
- "phpdocumentor/reflection": "^5.3.3",
+ "phpdocumentor/reflection": "^5.3.3||^6.0",
"phpdocumentor/reflection-docblock": "^5.3",
"phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^9.0",
@@ -274,9 +275,9 @@
"extra": {
"component": {
"id": "cloud-core",
- "target": "googleapis/google-cloud-php-core.git",
"path": "Core",
- "entry": "src/ServiceBuilder.php"
+ "entry": "src/ServiceBuilder.php",
+ "target": "googleapis/google-cloud-php-core.git"
}
},
"autoload": {
@@ -290,33 +291,33 @@
],
"description": "Google Cloud PHP shared dependency, providing functionality useful to all components.",
"support": {
- "source": "https://github.com/googleapis/google-cloud-php-core/tree/v1.59.1"
+ "source": "https://github.com/googleapis/google-cloud-php-core/tree/v1.60.1"
},
- "time": "2024-08-10T02:24:23+00:00"
+ "time": "2024-12-12T21:15:35+00:00"
},
{
"name": "google/cloud-storage",
- "version": "v1.42.1",
+ "version": "v1.45.0",
"source": {
"type": "git",
"url": "https://github.com/googleapis/google-cloud-php-storage.git",
- "reference": "2a418cad887e44d08a86de19a878ea3607212edb"
+ "reference": "9873cb5a27f4adc20909329d0eae85f2b3b0dba6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/googleapis/google-cloud-php-storage/zipball/2a418cad887e44d08a86de19a878ea3607212edb",
- "reference": "2a418cad887e44d08a86de19a878ea3607212edb",
+ "url": "https://api.github.com/repos/googleapis/google-cloud-php-storage/zipball/9873cb5a27f4adc20909329d0eae85f2b3b0dba6",
+ "reference": "9873cb5a27f4adc20909329d0eae85f2b3b0dba6",
"shasum": ""
},
"require": {
- "google/cloud-core": "^1.55",
+ "google/cloud-core": "^1.57",
"php": "^8.0",
"ramsey/uuid": "^4.2.3"
},
"require-dev": {
"erusev/parsedown": "^1.6",
"google/cloud-pubsub": "^2.0",
- "phpdocumentor/reflection": "^5.3.3",
+ "phpdocumentor/reflection": "^5.3.3||^6.0",
"phpdocumentor/reflection-docblock": "^5.3",
"phpseclib/phpseclib": "^2.0||^3.0",
"phpspec/prophecy-phpunit": "^2.0",
@@ -331,9 +332,9 @@
"extra": {
"component": {
"id": "cloud-storage",
- "target": "googleapis/google-cloud-php-storage.git",
"path": "Storage",
- "entry": "src/StorageClient.php"
+ "entry": "src/StorageClient.php",
+ "target": "googleapis/google-cloud-php-storage.git"
}
},
"autoload": {
@@ -347,22 +348,22 @@
],
"description": "Cloud Storage Client for PHP",
"support": {
- "source": "https://github.com/googleapis/google-cloud-php-storage/tree/v1.42.1"
+ "source": "https://github.com/googleapis/google-cloud-php-storage/tree/v1.45.0"
},
- "time": "2024-07-08T23:14:13+00:00"
+ "time": "2024-12-12T21:15:35+00:00"
},
{
"name": "google/common-protos",
- "version": "v4.7.0",
+ "version": "4.8.3",
"source": {
"type": "git",
"url": "https://github.com/googleapis/common-protos-php.git",
- "reference": "e58068776f57605c336e32c7db373f0a81da17b8"
+ "reference": "38a9a8bb459fa618da797d25d7bf36bb21d1103d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/googleapis/common-protos-php/zipball/e58068776f57605c336e32c7db373f0a81da17b8",
- "reference": "e58068776f57605c336e32c7db373f0a81da17b8",
+ "url": "https://api.github.com/repos/googleapis/common-protos-php/zipball/38a9a8bb459fa618da797d25d7bf36bb21d1103d",
+ "reference": "38a9a8bb459fa618da797d25d7bf36bb21d1103d",
"shasum": ""
},
"require": {
@@ -373,6 +374,14 @@
"phpunit/phpunit": "^9.6"
},
"type": "library",
+ "extra": {
+ "component": {
+ "id": "common-protos",
+ "path": "CommonProtos",
+ "entry": "README.md",
+ "target": "googleapis/common-protos-php.git"
+ }
+ },
"autoload": {
"psr-4": {
"Google\\Api\\": "src/Api",
@@ -398,27 +407,26 @@
"google"
],
"support": {
- "issues": "https://github.com/googleapis/common-protos-php/issues",
- "source": "https://github.com/googleapis/common-protos-php/tree/v4.7.0"
+ "source": "https://github.com/googleapis/common-protos-php/tree/v4.8.3"
},
- "time": "2024-07-25T20:20:43+00:00"
+ "time": "2024-09-07T01:37:15+00:00"
},
{
"name": "google/gax",
- "version": "v1.34.1",
+ "version": "v1.36.0",
"source": {
"type": "git",
"url": "https://github.com/googleapis/gax-php.git",
- "reference": "173f0a97323284f91fd453c4ed7ed8317ecf6cfa"
+ "reference": "140599cf5eae2432363ce6198e9fdff851625a7a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/googleapis/gax-php/zipball/173f0a97323284f91fd453c4ed7ed8317ecf6cfa",
- "reference": "173f0a97323284f91fd453c4ed7ed8317ecf6cfa",
+ "url": "https://api.github.com/repos/googleapis/gax-php/zipball/140599cf5eae2432363ce6198e9fdff851625a7a",
+ "reference": "140599cf5eae2432363ce6198e9fdff851625a7a",
"shasum": ""
},
"require": {
- "google/auth": "^1.34.0",
+ "google/auth": "^1.45",
"google/common-protos": "^4.4",
"google/grpc-gcp": "^0.4",
"google/longrunning": "~0.4",
@@ -434,7 +442,7 @@
},
"require-dev": {
"phpspec/prophecy-phpunit": "^2.1",
- "phpstan/phpstan": "^1.10",
+ "phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^9.6",
"squizlabs/php_codesniffer": "3.*"
},
@@ -456,9 +464,9 @@
],
"support": {
"issues": "https://github.com/googleapis/gax-php/issues",
- "source": "https://github.com/googleapis/gax-php/tree/v1.34.1"
+ "source": "https://github.com/googleapis/gax-php/tree/v1.36.0"
},
- "time": "2024-08-15T18:00:58+00:00"
+ "time": "2024-12-11T02:47:43+00:00"
},
{
"name": "google/grpc-gcp",
@@ -507,20 +515,20 @@
},
{
"name": "google/longrunning",
- "version": "0.4.3",
+ "version": "0.4.6",
"source": {
"type": "git",
"url": "https://github.com/googleapis/php-longrunning.git",
- "reference": "ed718a735e407826c3332b7197a44602eb03e608"
+ "reference": "4eb04d47bba8095d5a47f75334b9204c2a4a7ac6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/googleapis/php-longrunning/zipball/ed718a735e407826c3332b7197a44602eb03e608",
- "reference": "ed718a735e407826c3332b7197a44602eb03e608",
+ "url": "https://api.github.com/repos/googleapis/php-longrunning/zipball/4eb04d47bba8095d5a47f75334b9204c2a4a7ac6",
+ "reference": "4eb04d47bba8095d5a47f75334b9204c2a4a7ac6",
"shasum": ""
},
"require-dev": {
- "google/gax": "^1.34.0",
+ "google/gax": "^1.36.0",
"phpunit/phpunit": "^9.0"
},
"type": "library",
@@ -545,22 +553,22 @@
],
"description": "Google LongRunning Client for PHP",
"support": {
- "source": "https://github.com/googleapis/php-longrunning/tree/v0.4.3"
+ "source": "https://github.com/googleapis/php-longrunning/tree/v0.4.6"
},
- "time": "2024-06-01T03:14:01+00:00"
+ "time": "2024-12-12T21:15:35+00:00"
},
{
"name": "google/protobuf",
- "version": "v4.27.3",
+ "version": "v4.29.3",
"source": {
"type": "git",
"url": "https://github.com/protocolbuffers/protobuf-php.git",
- "reference": "ff079fe467bf86ac8f3359e2eb77a1613ebd204d"
+ "reference": "ab5077c2cfdd1f415f42d11fdbdf903ba8e3d9b7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/ff079fe467bf86ac8f3359e2eb77a1613ebd204d",
- "reference": "ff079fe467bf86ac8f3359e2eb77a1613ebd204d",
+ "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/ab5077c2cfdd1f415f42d11fdbdf903ba8e3d9b7",
+ "reference": "ab5077c2cfdd1f415f42d11fdbdf903ba8e3d9b7",
"shasum": ""
},
"require": {
@@ -589,9 +597,9 @@
"proto"
],
"support": {
- "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.27.3"
+ "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.29.3"
},
- "time": "2024-07-31T13:27:16+00:00"
+ "time": "2025-01-08T21:00:13+00:00"
},
{
"name": "grpc/grpc",
@@ -639,22 +647,22 @@
},
{
"name": "guzzlehttp/guzzle",
- "version": "7.8.1",
+ "version": "7.9.2",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
- "reference": "41042bc7ab002487b876a0683fc8dce04ddce104"
+ "reference": "d281ed313b989f213357e3be1a179f02196ac99b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/41042bc7ab002487b876a0683fc8dce04ddce104",
- "reference": "41042bc7ab002487b876a0683fc8dce04ddce104",
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d281ed313b989f213357e3be1a179f02196ac99b",
+ "reference": "d281ed313b989f213357e3be1a179f02196ac99b",
"shasum": ""
},
"require": {
"ext-json": "*",
- "guzzlehttp/promises": "^1.5.3 || ^2.0.1",
- "guzzlehttp/psr7": "^1.9.1 || ^2.5.1",
+ "guzzlehttp/promises": "^1.5.3 || ^2.0.3",
+ "guzzlehttp/psr7": "^2.7.0",
"php": "^7.2.5 || ^8.0",
"psr/http-client": "^1.0",
"symfony/deprecation-contracts": "^2.2 || ^3.0"
@@ -665,9 +673,9 @@
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
"ext-curl": "*",
- "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999",
+ "guzzle/client-integration-tests": "3.0.2",
"php-http/message-factory": "^1.1",
- "phpunit/phpunit": "^8.5.36 || ^9.6.15",
+ "phpunit/phpunit": "^8.5.39 || ^9.6.20",
"psr/log": "^1.1 || ^2.0 || ^3.0"
},
"suggest": {
@@ -745,7 +753,7 @@
],
"support": {
"issues": "https://github.com/guzzle/guzzle/issues",
- "source": "https://github.com/guzzle/guzzle/tree/7.8.1"
+ "source": "https://github.com/guzzle/guzzle/tree/7.9.2"
},
"funding": [
{
@@ -761,20 +769,20 @@
"type": "tidelift"
}
],
- "time": "2023-12-03T20:35:24+00:00"
+ "time": "2024-07-24T11:22:20+00:00"
},
{
"name": "guzzlehttp/promises",
- "version": "2.0.2",
+ "version": "2.0.4",
"source": {
"type": "git",
"url": "https://github.com/guzzle/promises.git",
- "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223"
+ "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/promises/zipball/bbff78d96034045e58e13dedd6ad91b5d1253223",
- "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223",
+ "url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455",
+ "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455",
"shasum": ""
},
"require": {
@@ -782,7 +790,7 @@
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
- "phpunit/phpunit": "^8.5.36 || ^9.6.15"
+ "phpunit/phpunit": "^8.5.39 || ^9.6.20"
},
"type": "library",
"extra": {
@@ -828,7 +836,7 @@
],
"support": {
"issues": "https://github.com/guzzle/promises/issues",
- "source": "https://github.com/guzzle/promises/tree/2.0.2"
+ "source": "https://github.com/guzzle/promises/tree/2.0.4"
},
"funding": [
{
@@ -844,20 +852,20 @@
"type": "tidelift"
}
],
- "time": "2023-12-03T20:19:20+00:00"
+ "time": "2024-10-17T10:06:22+00:00"
},
{
"name": "guzzlehttp/psr7",
- "version": "2.6.2",
+ "version": "2.7.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
- "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221"
+ "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/psr7/zipball/45b30f99ac27b5ca93cb4831afe16285f57b8221",
- "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221",
+ "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201",
+ "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201",
"shasum": ""
},
"require": {
@@ -872,8 +880,8 @@
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
- "http-interop/http-factory-tests": "^0.9",
- "phpunit/phpunit": "^8.5.36 || ^9.6.15"
+ "http-interop/http-factory-tests": "0.9.0",
+ "phpunit/phpunit": "^8.5.39 || ^9.6.20"
},
"suggest": {
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
@@ -944,7 +952,7 @@
],
"support": {
"issues": "https://github.com/guzzle/psr7/issues",
- "source": "https://github.com/guzzle/psr7/tree/2.6.2"
+ "source": "https://github.com/guzzle/psr7/tree/2.7.0"
},
"funding": [
{
@@ -960,20 +968,20 @@
"type": "tidelift"
}
],
- "time": "2023-12-03T20:05:35+00:00"
+ "time": "2024-07-18T11:15:46+00:00"
},
{
"name": "monolog/monolog",
- "version": "2.9.3",
+ "version": "2.10.0",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
- "reference": "a30bfe2e142720dfa990d0a7e573997f5d884215"
+ "reference": "5cf826f2991858b54d5c3809bee745560a1042a7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Seldaek/monolog/zipball/a30bfe2e142720dfa990d0a7e573997f5d884215",
- "reference": "a30bfe2e142720dfa990d0a7e573997f5d884215",
+ "url": "https://api.github.com/repos/Seldaek/monolog/zipball/5cf826f2991858b54d5c3809bee745560a1042a7",
+ "reference": "5cf826f2991858b54d5c3809bee745560a1042a7",
"shasum": ""
},
"require": {
@@ -1050,7 +1058,7 @@
],
"support": {
"issues": "https://github.com/Seldaek/monolog/issues",
- "source": "https://github.com/Seldaek/monolog/tree/2.9.3"
+ "source": "https://github.com/Seldaek/monolog/tree/2.10.0"
},
"funding": [
{
@@ -1062,7 +1070,7 @@
"type": "tidelift"
}
],
- "time": "2024-04-12T20:52:51+00:00"
+ "time": "2024-11-12T12:43:37+00:00"
},
{
"name": "paragonie/constant_time_encoding",
@@ -1183,16 +1191,16 @@
},
{
"name": "phpseclib/phpseclib",
- "version": "3.0.39",
+ "version": "3.0.43",
"source": {
"type": "git",
"url": "https://github.com/phpseclib/phpseclib.git",
- "reference": "211ebc399c6e73c225a018435fe5ae209d1d1485"
+ "reference": "709ec107af3cb2f385b9617be72af8cf62441d02"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/211ebc399c6e73c225a018435fe5ae209d1d1485",
- "reference": "211ebc399c6e73c225a018435fe5ae209d1d1485",
+ "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/709ec107af3cb2f385b9617be72af8cf62441d02",
+ "reference": "709ec107af3cb2f385b9617be72af8cf62441d02",
"shasum": ""
},
"require": {
@@ -1273,7 +1281,7 @@
],
"support": {
"issues": "https://github.com/phpseclib/phpseclib/issues",
- "source": "https://github.com/phpseclib/phpseclib/tree/3.0.39"
+ "source": "https://github.com/phpseclib/phpseclib/tree/3.0.43"
},
"funding": [
{
@@ -1289,7 +1297,7 @@
"type": "tidelift"
}
],
- "time": "2024-06-24T06:27:33+00:00"
+ "time": "2024-12-14T21:12:59+00:00"
},
{
"name": "psr/cache",
@@ -1502,30 +1510,30 @@
},
{
"name": "psr/log",
- "version": "1.1.4",
+ "version": "3.0.2",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
- "reference": "d49695b909c3b7628b6289db5479a1c204601f11"
+ "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
- "reference": "d49695b909c3b7628b6289db5479a1c204601f11",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
+ "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
"shasum": ""
},
"require": {
- "php": ">=5.3.0"
+ "php": ">=8.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.1.x-dev"
+ "dev-master": "3.x-dev"
}
},
"autoload": {
"psr-4": {
- "Psr\\Log\\": "Psr/Log/"
+ "Psr\\Log\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -1546,9 +1554,9 @@
"psr-3"
],
"support": {
- "source": "https://github.com/php-fig/log/tree/1.1.4"
+ "source": "https://github.com/php-fig/log/tree/3.0.2"
},
- "time": "2021-05-03T11:20:27+00:00"
+ "time": "2024-09-11T13:17:53+00:00"
},
{
"name": "ralouphie/getallheaders",
@@ -1778,16 +1786,16 @@
},
{
"name": "rize/uri-template",
- "version": "0.3.6",
+ "version": "0.3.8",
"source": {
"type": "git",
"url": "https://github.com/rize/UriTemplate.git",
- "reference": "34efe65c79710eed0883884f2285ae6d4a0aad19"
+ "reference": "34a5b96d0b65a5dddb7d20f09b6527a43faede24"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/rize/UriTemplate/zipball/34efe65c79710eed0883884f2285ae6d4a0aad19",
- "reference": "34efe65c79710eed0883884f2285ae6d4a0aad19",
+ "url": "https://api.github.com/repos/rize/UriTemplate/zipball/34a5b96d0b65a5dddb7d20f09b6527a43faede24",
+ "reference": "34a5b96d0b65a5dddb7d20f09b6527a43faede24",
"shasum": ""
},
"require": {
@@ -1820,7 +1828,7 @@
],
"support": {
"issues": "https://github.com/rize/UriTemplate/issues",
- "source": "https://github.com/rize/UriTemplate/tree/0.3.6"
+ "source": "https://github.com/rize/UriTemplate/tree/0.3.8"
},
"funding": [
{
@@ -1836,7 +1844,7 @@
"type": "open_collective"
}
],
- "time": "2024-03-10T08:07:49+00:00"
+ "time": "2024-08-30T07:09:40+00:00"
},
{
"name": "symfony/deprecation-contracts",
@@ -1857,12 +1865,12 @@
},
"type": "library",
"extra": {
+ "thanks": {
+ "url": "https://github.com/symfony/contracts",
+ "name": "symfony/contracts"
+ },
"branch-alias": {
"dev-main": "3.0-dev"
- },
- "thanks": {
- "name": "symfony/contracts",
- "url": "https://github.com/symfony/contracts"
}
},
"autoload": {
@@ -1907,26 +1915,26 @@
},
{
"name": "symfony/polyfill-php81",
- "version": "v1.30.0",
+ "version": "v1.31.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php81.git",
- "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af"
+ "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/3fb075789fb91f9ad9af537c4012d523085bd5af",
- "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af",
+ "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c",
+ "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c",
"shasum": ""
},
"require": {
- "php": ">=7.1"
+ "php": ">=7.2"
},
"type": "library",
"extra": {
"thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
+ "url": "https://github.com/symfony/polyfill",
+ "name": "symfony/polyfill"
}
},
"autoload": {
@@ -1963,7 +1971,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php81/tree/v1.30.0"
+ "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0"
},
"funding": [
{
@@ -1979,22 +1987,22 @@
"type": "tidelift"
}
],
- "time": "2024-06-19T12:30:46+00:00"
+ "time": "2024-09-09T11:45:10+00:00"
}
],
"packages-dev": [
{
"name": "composer/ca-bundle",
- "version": "1.5.1",
+ "version": "1.5.5",
"source": {
"type": "git",
"url": "https://github.com/composer/ca-bundle.git",
- "reference": "063d9aa8696582f5a41dffbbaf3c81024f0a604a"
+ "reference": "08c50d5ec4c6ced7d0271d2862dec8c1033283e6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/ca-bundle/zipball/063d9aa8696582f5a41dffbbaf3c81024f0a604a",
- "reference": "063d9aa8696582f5a41dffbbaf3c81024f0a604a",
+ "url": "https://api.github.com/repos/composer/ca-bundle/zipball/08c50d5ec4c6ced7d0271d2862dec8c1033283e6",
+ "reference": "08c50d5ec4c6ced7d0271d2862dec8c1033283e6",
"shasum": ""
},
"require": {
@@ -2004,8 +2012,8 @@
},
"require-dev": {
"phpstan/phpstan": "^1.10",
+ "phpunit/phpunit": "^8 || ^9",
"psr/log": "^1.0 || ^2.0 || ^3.0",
- "symfony/phpunit-bridge": "^4.2 || ^5",
"symfony/process": "^4.0 || ^5.0 || ^6.0 || ^7.0"
},
"type": "library",
@@ -2041,7 +2049,7 @@
"support": {
"irc": "irc://irc.freenode.org/composer",
"issues": "https://github.com/composer/ca-bundle/issues",
- "source": "https://github.com/composer/ca-bundle/tree/1.5.1"
+ "source": "https://github.com/composer/ca-bundle/tree/1.5.5"
},
"funding": [
{
@@ -2057,43 +2065,125 @@
"type": "tidelift"
}
],
- "time": "2024-07-08T15:28:20+00:00"
+ "time": "2025-01-08T16:17:16+00:00"
+ },
+ {
+ "name": "composer/class-map-generator",
+ "version": "1.5.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/composer/class-map-generator.git",
+ "reference": "4b0a223cf5be7c9ee7e0ef1bc7db42b4a97c9915"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/composer/class-map-generator/zipball/4b0a223cf5be7c9ee7e0ef1bc7db42b4a97c9915",
+ "reference": "4b0a223cf5be7c9ee7e0ef1bc7db42b4a97c9915",
+ "shasum": ""
+ },
+ "require": {
+ "composer/pcre": "^2.1 || ^3.1",
+ "php": "^7.2 || ^8.0",
+ "symfony/finder": "^4.4 || ^5.3 || ^6 || ^7"
+ },
+ "require-dev": {
+ "phpstan/phpstan": "^1.12 || ^2",
+ "phpstan/phpstan-deprecation-rules": "^1 || ^2",
+ "phpstan/phpstan-phpunit": "^1 || ^2",
+ "phpstan/phpstan-strict-rules": "^1.1 || ^2",
+ "phpunit/phpunit": "^8",
+ "symfony/filesystem": "^5.4 || ^6"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Composer\\ClassMapGenerator\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be",
+ "homepage": "https://seld.be"
+ }
+ ],
+ "description": "Utilities to scan PHP code and generate class maps.",
+ "keywords": [
+ "classmap"
+ ],
+ "support": {
+ "issues": "https://github.com/composer/class-map-generator/issues",
+ "source": "https://github.com/composer/class-map-generator/tree/1.5.0"
+ },
+ "funding": [
+ {
+ "url": "https://packagist.com",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/composer",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-11-25T16:11:06+00:00"
},
{
"name": "composer/composer",
- "version": "1.10.27",
+ "version": "2.7.7",
"source": {
"type": "git",
"url": "https://github.com/composer/composer.git",
- "reference": "f8f49191eec76f039b466aa1f161406fe43aff50"
+ "reference": "291942978f39435cf904d33739f98d7d4eca7b23"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/composer/zipball/f8f49191eec76f039b466aa1f161406fe43aff50",
- "reference": "f8f49191eec76f039b466aa1f161406fe43aff50",
+ "url": "https://api.github.com/repos/composer/composer/zipball/291942978f39435cf904d33739f98d7d4eca7b23",
+ "reference": "291942978f39435cf904d33739f98d7d4eca7b23",
"shasum": ""
},
"require": {
"composer/ca-bundle": "^1.0",
- "composer/semver": "^1.0",
- "composer/spdx-licenses": "^1.2",
- "composer/xdebug-handler": "^1.1",
- "justinrainbow/json-schema": "^5.2.10",
- "php": "^5.3.2 || ^7.0 || ^8.0",
- "psr/log": "^1.0",
+ "composer/class-map-generator": "^1.3.3",
+ "composer/metadata-minifier": "^1.0",
+ "composer/pcre": "^2.1 || ^3.1",
+ "composer/semver": "^3.3",
+ "composer/spdx-licenses": "^1.5.7",
+ "composer/xdebug-handler": "^2.0.2 || ^3.0.3",
+ "justinrainbow/json-schema": "^5.2.11",
+ "php": "^7.2.5 || ^8.0",
+ "psr/log": "^1.0 || ^2.0 || ^3.0",
+ "react/promise": "^2.8 || ^3",
"seld/jsonlint": "^1.4",
- "seld/phar-utils": "^1.0",
- "symfony/console": "^2.7 || ^3.0 || ^4.0 || ^5.0",
- "symfony/filesystem": "^2.7 || ^3.0 || ^4.0 || ^5.0",
- "symfony/finder": "^2.7 || ^3.0 || ^4.0 || ^5.0",
- "symfony/process": "^2.7 || ^3.0 || ^4.0 || ^5.0"
- },
- "conflict": {
- "symfony/console": "2.8.38"
+ "seld/phar-utils": "^1.2",
+ "seld/signal-handler": "^2.0",
+ "symfony/console": "^5.4.11 || ^6.0.11 || ^7",
+ "symfony/filesystem": "^5.4 || ^6.0 || ^7",
+ "symfony/finder": "^5.4 || ^6.0 || ^7",
+ "symfony/polyfill-php73": "^1.24",
+ "symfony/polyfill-php80": "^1.24",
+ "symfony/polyfill-php81": "^1.24",
+ "symfony/process": "^5.4 || ^6.0 || ^7"
},
"require-dev": {
- "phpspec/prophecy": "^1.10",
- "symfony/phpunit-bridge": "^4.2"
+ "phpstan/phpstan": "^1.11.0",
+ "phpstan/phpstan-deprecation-rules": "^1.2.0",
+ "phpstan/phpstan-phpunit": "^1.4.0",
+ "phpstan/phpstan-strict-rules": "^1.6.0",
+ "phpstan/phpstan-symfony": "^1.4.0",
+ "symfony/phpunit-bridge": "^6.4.1 || ^7.0.1"
},
"suggest": {
"ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages",
@@ -2105,13 +2195,18 @@
],
"type": "library",
"extra": {
+ "phpstan": {
+ "includes": [
+ "phpstan/rules.neon"
+ ]
+ },
"branch-alias": {
- "dev-master": "1.10-dev"
+ "dev-main": "2.7-dev"
}
},
"autoload": {
"psr-4": {
- "Composer\\": "src/Composer"
+ "Composer\\": "src/Composer/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -2122,12 +2217,12 @@
{
"name": "Nils Adermann",
"email": "naderman@naderman.de",
- "homepage": "http://www.naderman.de"
+ "homepage": "https://www.naderman.de"
},
{
"name": "Jordi Boggiano",
"email": "j.boggiano@seld.be",
- "homepage": "http://seld.be"
+ "homepage": "https://seld.be"
}
],
"description": "Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.",
@@ -2138,9 +2233,79 @@
"package"
],
"support": {
- "irc": "irc://irc.freenode.org/composer",
+ "irc": "ircs://irc.libera.chat:6697/composer",
"issues": "https://github.com/composer/composer/issues",
- "source": "https://github.com/composer/composer/tree/1.10.27"
+ "security": "https://github.com/composer/composer/security/policy",
+ "source": "https://github.com/composer/composer/tree/2.7.7"
+ },
+ "funding": [
+ {
+ "url": "https://packagist.com",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/composer",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-06-10T20:11:12+00:00"
+ },
+ {
+ "name": "composer/metadata-minifier",
+ "version": "1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/composer/metadata-minifier.git",
+ "reference": "c549d23829536f0d0e984aaabbf02af91f443207"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/composer/metadata-minifier/zipball/c549d23829536f0d0e984aaabbf02af91f443207",
+ "reference": "c549d23829536f0d0e984aaabbf02af91f443207",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.3.2 || ^7.0 || ^8.0"
+ },
+ "require-dev": {
+ "composer/composer": "^2",
+ "phpstan/phpstan": "^0.12.55",
+ "symfony/phpunit-bridge": "^4.2 || ^5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Composer\\MetadataMinifier\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be",
+ "homepage": "http://seld.be"
+ }
+ ],
+ "description": "Small utility library that handles metadata minification and expansion.",
+ "keywords": [
+ "composer",
+ "compression"
+ ],
+ "support": {
+ "issues": "https://github.com/composer/metadata-minifier/issues",
+ "source": "https://github.com/composer/metadata-minifier/tree/1.0.0"
},
"funding": [
{
@@ -2156,32 +2321,112 @@
"type": "tidelift"
}
],
- "time": "2023-09-29T08:50:23+00:00"
+ "time": "2021-04-07T13:37:33+00:00"
+ },
+ {
+ "name": "composer/pcre",
+ "version": "3.3.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/composer/pcre.git",
+ "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e",
+ "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.4 || ^8.0"
+ },
+ "conflict": {
+ "phpstan/phpstan": "<1.11.10"
+ },
+ "require-dev": {
+ "phpstan/phpstan": "^1.12 || ^2",
+ "phpstan/phpstan-strict-rules": "^1 || ^2",
+ "phpunit/phpunit": "^8 || ^9"
+ },
+ "type": "library",
+ "extra": {
+ "phpstan": {
+ "includes": [
+ "extension.neon"
+ ]
+ },
+ "branch-alias": {
+ "dev-main": "3.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Composer\\Pcre\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be",
+ "homepage": "http://seld.be"
+ }
+ ],
+ "description": "PCRE wrapping library that offers type-safe preg_* replacements.",
+ "keywords": [
+ "PCRE",
+ "preg",
+ "regex",
+ "regular expression"
+ ],
+ "support": {
+ "issues": "https://github.com/composer/pcre/issues",
+ "source": "https://github.com/composer/pcre/tree/3.3.2"
+ },
+ "funding": [
+ {
+ "url": "https://packagist.com",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/composer",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-11-12T16:29:46+00:00"
},
{
"name": "composer/semver",
- "version": "1.7.2",
+ "version": "3.4.3",
"source": {
"type": "git",
"url": "https://github.com/composer/semver.git",
- "reference": "647490bbcaf7fc4891c58f47b825eb99d19c377a"
+ "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/semver/zipball/647490bbcaf7fc4891c58f47b825eb99d19c377a",
- "reference": "647490bbcaf7fc4891c58f47b825eb99d19c377a",
+ "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12",
+ "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12",
"shasum": ""
},
"require": {
"php": "^5.3.2 || ^7.0 || ^8.0"
},
"require-dev": {
- "phpunit/phpunit": "^4.5 || ^5.0.5"
+ "phpstan/phpstan": "^1.11",
+ "symfony/phpunit-bridge": "^3 || ^7"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.x-dev"
+ "dev-main": "3.x-dev"
}
},
"autoload": {
@@ -2218,9 +2463,9 @@
"versioning"
],
"support": {
- "irc": "irc://irc.freenode.org/composer",
+ "irc": "ircs://irc.libera.chat:6697/composer",
"issues": "https://github.com/composer/semver/issues",
- "source": "https://github.com/composer/semver/tree/1.7.2"
+ "source": "https://github.com/composer/semver/tree/3.4.3"
},
"funding": [
{
@@ -2236,7 +2481,7 @@
"type": "tidelift"
}
],
- "time": "2020-12-03T15:47:16+00:00"
+ "time": "2024-09-19T14:15:21+00:00"
},
{
"name": "composer/spdx-licenses",
@@ -2320,25 +2565,27 @@
},
{
"name": "composer/xdebug-handler",
- "version": "1.4.6",
+ "version": "3.0.5",
"source": {
"type": "git",
"url": "https://github.com/composer/xdebug-handler.git",
- "reference": "f27e06cd9675801df441b3656569b328e04aa37c"
+ "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f27e06cd9675801df441b3656569b328e04aa37c",
- "reference": "f27e06cd9675801df441b3656569b328e04aa37c",
+ "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef",
+ "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef",
"shasum": ""
},
"require": {
- "php": "^5.3.2 || ^7.0 || ^8.0",
- "psr/log": "^1.0"
+ "composer/pcre": "^1 || ^2 || ^3",
+ "php": "^7.2.5 || ^8.0",
+ "psr/log": "^1 || ^2 || ^3"
},
"require-dev": {
- "phpstan/phpstan": "^0.12.55",
- "symfony/phpunit-bridge": "^4.2 || ^5"
+ "phpstan/phpstan": "^1.0",
+ "phpstan/phpstan-strict-rules": "^1.1",
+ "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5"
},
"type": "library",
"autoload": {
@@ -2362,9 +2609,9 @@
"performance"
],
"support": {
- "irc": "irc://irc.freenode.org/composer",
+ "irc": "ircs://irc.libera.chat:6697/composer",
"issues": "https://github.com/composer/xdebug-handler/issues",
- "source": "https://github.com/composer/xdebug-handler/tree/1.4.6"
+ "source": "https://github.com/composer/xdebug-handler/tree/3.0.5"
},
"funding": [
{
@@ -2380,33 +2627,31 @@
"type": "tidelift"
}
],
- "time": "2021-03-25T17:01:18+00:00"
+ "time": "2024-05-06T16:37:16+00:00"
},
{
"name": "doctrine/deprecations",
- "version": "1.1.3",
+ "version": "1.1.4",
"source": {
"type": "git",
"url": "https://github.com/doctrine/deprecations.git",
- "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab"
+ "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab",
- "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab",
+ "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9",
+ "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"require-dev": {
- "doctrine/coding-standard": "^9",
- "phpstan/phpstan": "1.4.10 || 1.10.15",
- "phpstan/phpstan-phpunit": "^1.0",
+ "doctrine/coding-standard": "^9 || ^12",
+ "phpstan/phpstan": "1.4.10 || 2.0.3",
+ "phpstan/phpstan-phpunit": "^1.0 || ^2",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
- "psalm/plugin-phpunit": "0.18.4",
- "psr/log": "^1 || ^2 || ^3",
- "vimeo/psalm": "4.30.0 || 5.12.0"
+ "psr/log": "^1 || ^2 || ^3"
},
"suggest": {
"psr/log": "Allows logging deprecations via PSR-3 logger implementation"
@@ -2414,7 +2659,7 @@
"type": "library",
"autoload": {
"psr-4": {
- "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations"
+ "Doctrine\\Deprecations\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -2425,9 +2670,9 @@
"homepage": "https://www.doctrine-project.org/",
"support": {
"issues": "https://github.com/doctrine/deprecations/issues",
- "source": "https://github.com/doctrine/deprecations/tree/1.1.3"
+ "source": "https://github.com/doctrine/deprecations/tree/1.1.4"
},
- "time": "2024-01-30T19:34:25+00:00"
+ "time": "2024-12-07T21:18:45+00:00"
},
{
"name": "doctrine/instantiator",
@@ -2566,16 +2811,16 @@
},
{
"name": "myclabs/deep-copy",
- "version": "1.12.0",
+ "version": "1.12.1",
"source": {
"type": "git",
"url": "https://github.com/myclabs/DeepCopy.git",
- "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c"
+ "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c",
- "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c",
+ "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845",
+ "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845",
"shasum": ""
},
"require": {
@@ -2614,7 +2859,7 @@
],
"support": {
"issues": "https://github.com/myclabs/DeepCopy/issues",
- "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0"
+ "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1"
},
"funding": [
{
@@ -2622,20 +2867,20 @@
"type": "tidelift"
}
],
- "time": "2024-06-12T14:39:25+00:00"
+ "time": "2024-11-08T17:47:46+00:00"
},
{
"name": "nikic/php-parser",
- "version": "v5.1.0",
+ "version": "v5.4.0",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
- "reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1"
+ "reference": "447a020a1f875a434d62f2a401f53b82a396e494"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/683130c2ff8c2739f4822ff7ac5c873ec529abd1",
- "reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1",
+ "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494",
+ "reference": "447a020a1f875a434d62f2a401f53b82a396e494",
"shasum": ""
},
"require": {
@@ -2678,9 +2923,9 @@
],
"support": {
"issues": "https://github.com/nikic/PHP-Parser/issues",
- "source": "https://github.com/nikic/PHP-Parser/tree/v5.1.0"
+ "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0"
},
- "time": "2024-07-01T20:03:41+00:00"
+ "time": "2024-12-30T11:07:19+00:00"
},
{
"name": "phar-io/manifest",
@@ -2917,16 +3162,16 @@
},
{
"name": "phpdocumentor/reflection-docblock",
- "version": "5.4.1",
+ "version": "5.6.1",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
- "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c"
+ "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c",
- "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c",
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8",
+ "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8",
"shasum": ""
},
"require": {
@@ -2935,17 +3180,17 @@
"php": "^7.4 || ^8.0",
"phpdocumentor/reflection-common": "^2.2",
"phpdocumentor/type-resolver": "^1.7",
- "phpstan/phpdoc-parser": "^1.7",
+ "phpstan/phpdoc-parser": "^1.7|^2.0",
"webmozart/assert": "^1.9.1"
},
"require-dev": {
- "mockery/mockery": "~1.3.5",
+ "mockery/mockery": "~1.3.5 || ~1.6.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.8",
"phpstan/phpstan-mockery": "^1.1",
"phpstan/phpstan-webmozart-assert": "^1.2",
"phpunit/phpunit": "^9.5",
- "vimeo/psalm": "^5.13"
+ "psalm/phar": "^5.26"
},
"type": "library",
"extra": {
@@ -2975,29 +3220,29 @@
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"support": {
"issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
- "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.4.1"
+ "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.1"
},
- "time": "2024-05-21T05:55:05+00:00"
+ "time": "2024-12-07T09:39:29+00:00"
},
{
"name": "phpdocumentor/type-resolver",
- "version": "1.8.2",
+ "version": "1.10.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git",
- "reference": "153ae662783729388a584b4361f2545e4d841e3c"
+ "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/153ae662783729388a584b4361f2545e4d841e3c",
- "reference": "153ae662783729388a584b4361f2545e4d841e3c",
+ "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/679e3ce485b99e84c775d28e2e96fade9a7fb50a",
+ "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a",
"shasum": ""
},
"require": {
"doctrine/deprecations": "^1.0",
"php": "^7.3 || ^8.0",
"phpdocumentor/reflection-common": "^2.0",
- "phpstan/phpdoc-parser": "^1.13"
+ "phpstan/phpdoc-parser": "^1.18|^2.0"
},
"require-dev": {
"ext-tokenizer": "*",
@@ -3033,32 +3278,33 @@
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
"support": {
"issues": "https://github.com/phpDocumentor/TypeResolver/issues",
- "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.8.2"
+ "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.10.0"
},
- "time": "2024-02-23T11:10:43+00:00"
+ "time": "2024-11-09T15:12:26+00:00"
},
{
"name": "phpspec/prophecy",
- "version": "v1.19.0",
+ "version": "v1.20.0",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
- "reference": "67a759e7d8746d501c41536ba40cd9c0a07d6a87"
+ "reference": "a0165c648cab6a80311c74ffc708a07bb53ecc93"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpspec/prophecy/zipball/67a759e7d8746d501c41536ba40cd9c0a07d6a87",
- "reference": "67a759e7d8746d501c41536ba40cd9c0a07d6a87",
+ "url": "https://api.github.com/repos/phpspec/prophecy/zipball/a0165c648cab6a80311c74ffc708a07bb53ecc93",
+ "reference": "a0165c648cab6a80311c74ffc708a07bb53ecc93",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.2 || ^2.0",
- "php": "^7.2 || 8.0.* || 8.1.* || 8.2.* || 8.3.*",
+ "php": "^7.2 || 8.0.* || 8.1.* || 8.2.* || 8.3.* || 8.4.*",
"phpdocumentor/reflection-docblock": "^5.2",
"sebastian/comparator": "^3.0 || ^4.0 || ^5.0 || ^6.0",
"sebastian/recursion-context": "^3.0 || ^4.0 || ^5.0 || ^6.0"
},
"require-dev": {
+ "friendsofphp/php-cs-fixer": "^3.40",
"phpspec/phpspec": "^6.0 || ^7.0",
"phpstan/phpstan": "^1.9",
"phpunit/phpunit": "^8.0 || ^9.0 || ^10.0"
@@ -3102,22 +3348,22 @@
],
"support": {
"issues": "https://github.com/phpspec/prophecy/issues",
- "source": "https://github.com/phpspec/prophecy/tree/v1.19.0"
+ "source": "https://github.com/phpspec/prophecy/tree/v1.20.0"
},
- "time": "2024-02-29T11:52:51+00:00"
+ "time": "2024-11-19T13:12:41+00:00"
},
{
"name": "phpspec/prophecy-phpunit",
- "version": "v2.2.0",
+ "version": "v2.3.0",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy-phpunit.git",
- "reference": "16e1247e139434bce0bac09848bc5c8d882940fc"
+ "reference": "8819516c1b489ecee4c60db5f5432fac1ea8ac6f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpspec/prophecy-phpunit/zipball/16e1247e139434bce0bac09848bc5c8d882940fc",
- "reference": "16e1247e139434bce0bac09848bc5c8d882940fc",
+ "url": "https://api.github.com/repos/phpspec/prophecy-phpunit/zipball/8819516c1b489ecee4c60db5f5432fac1ea8ac6f",
+ "reference": "8819516c1b489ecee4c60db5f5432fac1ea8ac6f",
"shasum": ""
},
"require": {
@@ -3125,6 +3371,9 @@
"phpspec/prophecy": "^1.18",
"phpunit/phpunit": "^9.1 || ^10.1 || ^11.0"
},
+ "require-dev": {
+ "phpstan/phpstan": "^1.10"
+ },
"type": "library",
"extra": {
"branch-alias": {
@@ -3154,36 +3403,36 @@
],
"support": {
"issues": "https://github.com/phpspec/prophecy-phpunit/issues",
- "source": "https://github.com/phpspec/prophecy-phpunit/tree/v2.2.0"
+ "source": "https://github.com/phpspec/prophecy-phpunit/tree/v2.3.0"
},
- "time": "2024-03-01T08:33:58+00:00"
+ "time": "2024-11-19T13:24:17+00:00"
},
{
"name": "phpstan/phpdoc-parser",
- "version": "1.29.1",
+ "version": "2.0.0",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpdoc-parser.git",
- "reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4"
+ "reference": "c00d78fb6b29658347f9d37ebe104bffadf36299"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/fcaefacf2d5c417e928405b71b400d4ce10daaf4",
- "reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4",
+ "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/c00d78fb6b29658347f9d37ebe104bffadf36299",
+ "reference": "c00d78fb6b29658347f9d37ebe104bffadf36299",
"shasum": ""
},
"require": {
- "php": "^7.2 || ^8.0"
+ "php": "^7.4 || ^8.0"
},
"require-dev": {
"doctrine/annotations": "^2.0",
- "nikic/php-parser": "^4.15",
+ "nikic/php-parser": "^5.3.0",
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpstan/extension-installer": "^1.0",
- "phpstan/phpstan": "^1.5",
- "phpstan/phpstan-phpunit": "^1.1",
- "phpstan/phpstan-strict-rules": "^1.0",
- "phpunit/phpunit": "^9.5",
+ "phpstan/phpstan": "^2.0",
+ "phpstan/phpstan-phpunit": "^2.0",
+ "phpstan/phpstan-strict-rules": "^2.0",
+ "phpunit/phpunit": "^9.6",
"symfony/process": "^5.2"
},
"type": "library",
@@ -3201,41 +3450,41 @@
"description": "PHPDoc parser with support for nullable, intersection and generic types",
"support": {
"issues": "https://github.com/phpstan/phpdoc-parser/issues",
- "source": "https://github.com/phpstan/phpdoc-parser/tree/1.29.1"
+ "source": "https://github.com/phpstan/phpdoc-parser/tree/2.0.0"
},
- "time": "2024-05-31T08:52:43+00:00"
+ "time": "2024-10-13T11:29:49+00:00"
},
{
"name": "phpunit/php-code-coverage",
- "version": "9.2.31",
+ "version": "9.2.32",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965"
+ "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48c34b5d8d983006bd2adc2d0de92963b9155965",
- "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5",
+ "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-libxml": "*",
"ext-xmlwriter": "*",
- "nikic/php-parser": "^4.18 || ^5.0",
+ "nikic/php-parser": "^4.19.1 || ^5.1.0",
"php": ">=7.3",
- "phpunit/php-file-iterator": "^3.0.3",
- "phpunit/php-text-template": "^2.0.2",
- "sebastian/code-unit-reverse-lookup": "^2.0.2",
- "sebastian/complexity": "^2.0",
- "sebastian/environment": "^5.1.2",
- "sebastian/lines-of-code": "^1.0.3",
- "sebastian/version": "^3.0.1",
- "theseer/tokenizer": "^1.2.0"
+ "phpunit/php-file-iterator": "^3.0.6",
+ "phpunit/php-text-template": "^2.0.4",
+ "sebastian/code-unit-reverse-lookup": "^2.0.3",
+ "sebastian/complexity": "^2.0.3",
+ "sebastian/environment": "^5.1.5",
+ "sebastian/lines-of-code": "^1.0.4",
+ "sebastian/version": "^3.0.2",
+ "theseer/tokenizer": "^1.2.3"
},
"require-dev": {
- "phpunit/phpunit": "^9.3"
+ "phpunit/phpunit": "^9.6"
},
"suggest": {
"ext-pcov": "PHP extension that provides line coverage",
@@ -3244,7 +3493,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "9.2-dev"
+ "dev-main": "9.2.x-dev"
}
},
"autoload": {
@@ -3273,7 +3522,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
- "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.31"
+ "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32"
},
"funding": [
{
@@ -3281,7 +3530,7 @@
"type": "github"
}
],
- "time": "2024-03-02T06:37:42+00:00"
+ "time": "2024-08-22T04:23:01+00:00"
},
{
"name": "phpunit/php-file-iterator",
@@ -3526,16 +3775,16 @@
},
{
"name": "phpunit/phpunit",
- "version": "9.6.20",
+ "version": "9.6.22",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "49d7820565836236411f5dc002d16dd689cde42f"
+ "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/49d7820565836236411f5dc002d16dd689cde42f",
- "reference": "49d7820565836236411f5dc002d16dd689cde42f",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c",
+ "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c",
"shasum": ""
},
"require": {
@@ -3546,11 +3795,11 @@
"ext-mbstring": "*",
"ext-xml": "*",
"ext-xmlwriter": "*",
- "myclabs/deep-copy": "^1.12.0",
+ "myclabs/deep-copy": "^1.12.1",
"phar-io/manifest": "^2.0.4",
"phar-io/version": "^3.2.1",
"php": ">=7.3",
- "phpunit/php-code-coverage": "^9.2.31",
+ "phpunit/php-code-coverage": "^9.2.32",
"phpunit/php-file-iterator": "^3.0.6",
"phpunit/php-invoker": "^3.1.1",
"phpunit/php-text-template": "^2.0.4",
@@ -3609,7 +3858,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
- "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.20"
+ "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22"
},
"funding": [
{
@@ -3625,7 +3874,7 @@
"type": "tidelift"
}
],
- "time": "2024-07-10T11:45:39+00:00"
+ "time": "2024-12-05T13:48:26+00:00"
},
{
"name": "psr/container",
@@ -3680,6 +3929,79 @@
},
"time": "2021-11-05T16:47:00+00:00"
},
+ {
+ "name": "react/promise",
+ "version": "v3.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/reactphp/promise.git",
+ "reference": "8a164643313c71354582dc850b42b33fa12a4b63"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63",
+ "reference": "8a164643313c71354582dc850b42b33fa12a4b63",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1.0"
+ },
+ "require-dev": {
+ "phpstan/phpstan": "1.10.39 || 1.4.10",
+ "phpunit/phpunit": "^9.6 || ^7.5"
+ },
+ "type": "library",
+ "autoload": {
+ "files": [
+ "src/functions_include.php"
+ ],
+ "psr-4": {
+ "React\\Promise\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jan Sorgalla",
+ "email": "jsorgalla@gmail.com",
+ "homepage": "https://sorgalla.com/"
+ },
+ {
+ "name": "Christian Lück",
+ "email": "christian@clue.engineering",
+ "homepage": "https://clue.engineering/"
+ },
+ {
+ "name": "Cees-Jan Kiewiet",
+ "email": "reactphp@ceesjankiewiet.nl",
+ "homepage": "https://wyrihaximus.net/"
+ },
+ {
+ "name": "Chris Boden",
+ "email": "cboden@gmail.com",
+ "homepage": "https://cboden.dev/"
+ }
+ ],
+ "description": "A lightweight implementation of CommonJS Promises/A for PHP",
+ "keywords": [
+ "promise",
+ "promises"
+ ],
+ "support": {
+ "issues": "https://github.com/reactphp/promise/issues",
+ "source": "https://github.com/reactphp/promise/tree/v3.2.0"
+ },
+ "funding": [
+ {
+ "url": "https://opencollective.com/reactphp",
+ "type": "open_collective"
+ }
+ ],
+ "time": "2024-05-24T10:39:05+00:00"
+ },
{
"name": "sebastian/cli-parser",
"version": "1.0.2",
@@ -4645,23 +4967,23 @@
},
{
"name": "seld/jsonlint",
- "version": "1.10.2",
+ "version": "1.11.0",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/jsonlint.git",
- "reference": "9bb7db07b5d66d90f6ebf542f09fc67d800e5259"
+ "reference": "1748aaf847fc731cfad7725aec413ee46f0cc3a2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/9bb7db07b5d66d90f6ebf542f09fc67d800e5259",
- "reference": "9bb7db07b5d66d90f6ebf542f09fc67d800e5259",
+ "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/1748aaf847fc731cfad7725aec413ee46f0cc3a2",
+ "reference": "1748aaf847fc731cfad7725aec413ee46f0cc3a2",
"shasum": ""
},
"require": {
"php": "^5.3 || ^7.0 || ^8.0"
},
"require-dev": {
- "phpstan/phpstan": "^1.5",
+ "phpstan/phpstan": "^1.11",
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^8.5.13"
},
"bin": [
@@ -4693,7 +5015,7 @@
],
"support": {
"issues": "https://github.com/Seldaek/jsonlint/issues",
- "source": "https://github.com/Seldaek/jsonlint/tree/1.10.2"
+ "source": "https://github.com/Seldaek/jsonlint/tree/1.11.0"
},
"funding": [
{
@@ -4705,7 +5027,7 @@
"type": "tidelift"
}
],
- "time": "2024-02-07T12:57:50+00:00"
+ "time": "2024-07-11T14:55:45+00:00"
},
{
"name": "seld/phar-utils",
@@ -4755,18 +5077,79 @@
},
"time": "2022-08-31T10:31:18+00:00"
},
+ {
+ "name": "seld/signal-handler",
+ "version": "2.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Seldaek/signal-handler.git",
+ "reference": "04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Seldaek/signal-handler/zipball/04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98",
+ "reference": "04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.0"
+ },
+ "require-dev": {
+ "phpstan/phpstan": "^1",
+ "phpstan/phpstan-deprecation-rules": "^1.0",
+ "phpstan/phpstan-phpunit": "^1",
+ "phpstan/phpstan-strict-rules": "^1.3",
+ "phpunit/phpunit": "^7.5.20 || ^8.5.23",
+ "psr/log": "^1 || ^2 || ^3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "2.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Seld\\Signal\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be",
+ "homepage": "http://seld.be"
+ }
+ ],
+ "description": "Simple unix signal handler that silently fails where signals are not supported for easy cross-platform development",
+ "keywords": [
+ "posix",
+ "sigint",
+ "signal",
+ "sigterm",
+ "unix"
+ ],
+ "support": {
+ "issues": "https://github.com/Seldaek/signal-handler/issues",
+ "source": "https://github.com/Seldaek/signal-handler/tree/2.0.2"
+ },
+ "time": "2023-09-03T09:24:00+00:00"
+ },
{
"name": "squizlabs/php_codesniffer",
- "version": "3.10.1",
+ "version": "3.11.2",
"source": {
"type": "git",
"url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
- "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877"
+ "reference": "1368f4a58c3c52114b86b1abe8f4098869cb0079"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/8f90f7a53ce271935282967f53d0894f8f1ff877",
- "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877",
+ "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/1368f4a58c3c52114b86b1abe8f4098869cb0079",
+ "reference": "1368f4a58c3c52114b86b1abe8f4098869cb0079",
"shasum": ""
},
"require": {
@@ -4833,50 +5216,46 @@
"type": "open_collective"
}
],
- "time": "2024-05-22T21:24:41+00:00"
+ "time": "2024-12-11T16:04:26+00:00"
},
{
"name": "symfony/console",
- "version": "v5.4.41",
+ "version": "v6.0.19",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "6473d441a913cb997123b59ff2dbe3d1cf9e11ba"
+ "reference": "c3ebc83d031b71c39da318ca8b7a07ecc67507ed"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/6473d441a913cb997123b59ff2dbe3d1cf9e11ba",
- "reference": "6473d441a913cb997123b59ff2dbe3d1cf9e11ba",
+ "url": "https://api.github.com/repos/symfony/console/zipball/c3ebc83d031b71c39da318ca8b7a07ecc67507ed",
+ "reference": "c3ebc83d031b71c39da318ca8b7a07ecc67507ed",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
- "symfony/deprecation-contracts": "^2.1|^3",
+ "php": ">=8.0.2",
"symfony/polyfill-mbstring": "~1.0",
- "symfony/polyfill-php73": "^1.9",
- "symfony/polyfill-php80": "^1.16",
"symfony/service-contracts": "^1.1|^2|^3",
- "symfony/string": "^5.1|^6.0"
+ "symfony/string": "^5.4|^6.0"
},
"conflict": {
- "psr/log": ">=3",
- "symfony/dependency-injection": "<4.4",
- "symfony/dotenv": "<5.1",
- "symfony/event-dispatcher": "<4.4",
- "symfony/lock": "<4.4",
- "symfony/process": "<4.4"
+ "symfony/dependency-injection": "<5.4",
+ "symfony/dotenv": "<5.4",
+ "symfony/event-dispatcher": "<5.4",
+ "symfony/lock": "<5.4",
+ "symfony/process": "<5.4"
},
"provide": {
- "psr/log-implementation": "1.0|2.0"
+ "psr/log-implementation": "1.0|2.0|3.0"
},
"require-dev": {
- "psr/log": "^1|^2",
- "symfony/config": "^4.4|^5.0|^6.0",
- "symfony/dependency-injection": "^4.4|^5.0|^6.0",
- "symfony/event-dispatcher": "^4.4|^5.0|^6.0",
- "symfony/lock": "^4.4|^5.0|^6.0",
- "symfony/process": "^4.4|^5.0|^6.0",
- "symfony/var-dumper": "^4.4|^5.0|^6.0"
+ "psr/log": "^1|^2|^3",
+ "symfony/config": "^5.4|^6.0",
+ "symfony/dependency-injection": "^5.4|^6.0",
+ "symfony/event-dispatcher": "^5.4|^6.0",
+ "symfony/lock": "^5.4|^6.0",
+ "symfony/process": "^5.4|^6.0",
+ "symfony/var-dumper": "^5.4|^6.0"
},
"suggest": {
"psr/log": "For using the console logger",
@@ -4911,12 +5290,12 @@
"homepage": "https://symfony.com",
"keywords": [
"cli",
- "command-line",
+ "command line",
"console",
"terminal"
],
"support": {
- "source": "https://github.com/symfony/console/tree/v5.4.41"
+ "source": "https://github.com/symfony/console/tree/v6.0.19"
},
"funding": [
{
@@ -4932,7 +5311,7 @@
"type": "tidelift"
}
],
- "time": "2024-06-28T07:48:55+00:00"
+ "time": "2023-01-01T08:36:10+00:00"
},
{
"name": "symfony/css-selector",
@@ -5052,26 +5431,22 @@
},
{
"name": "symfony/filesystem",
- "version": "v5.4.41",
+ "version": "v6.0.19",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
- "reference": "6d29dd9340b372fa603f04e6df4dd76bb808591e"
+ "reference": "3d49eec03fda1f0fc19b7349fbbe55ebc1004214"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/filesystem/zipball/6d29dd9340b372fa603f04e6df4dd76bb808591e",
- "reference": "6d29dd9340b372fa603f04e6df4dd76bb808591e",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/3d49eec03fda1f0fc19b7349fbbe55ebc1004214",
+ "reference": "3d49eec03fda1f0fc19b7349fbbe55ebc1004214",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
+ "php": ">=8.0.2",
"symfony/polyfill-ctype": "~1.8",
- "symfony/polyfill-mbstring": "~1.8",
- "symfony/polyfill-php80": "^1.16"
- },
- "require-dev": {
- "symfony/process": "^5.4|^6.4"
+ "symfony/polyfill-mbstring": "~1.8"
},
"type": "library",
"autoload": {
@@ -5099,7 +5474,7 @@
"description": "Provides basic utilities for the filesystem",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/filesystem/tree/v5.4.41"
+ "source": "https://github.com/symfony/filesystem/tree/v6.0.19"
},
"funding": [
{
@@ -5115,26 +5490,24 @@
"type": "tidelift"
}
],
- "time": "2024-06-28T09:36:24+00:00"
+ "time": "2023-01-20T17:44:14+00:00"
},
{
"name": "symfony/finder",
- "version": "v5.4.40",
+ "version": "v6.0.19",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
- "reference": "f51cff4687547641c7d8180d74932ab40b2205ce"
+ "reference": "5cc9cac6586fc0c28cd173780ca696e419fefa11"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/finder/zipball/f51cff4687547641c7d8180d74932ab40b2205ce",
- "reference": "f51cff4687547641c7d8180d74932ab40b2205ce",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/5cc9cac6586fc0c28cd173780ca696e419fefa11",
+ "reference": "5cc9cac6586fc0c28cd173780ca696e419fefa11",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
- "symfony/deprecation-contracts": "^2.1|^3",
- "symfony/polyfill-php80": "^1.16"
+ "php": ">=8.0.2"
},
"type": "library",
"autoload": {
@@ -5162,7 +5535,7 @@
"description": "Finds files and directories via an intuitive fluent interface",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/finder/tree/v5.4.40"
+ "source": "https://github.com/symfony/finder/tree/v6.0.19"
},
"funding": [
{
@@ -5178,24 +5551,24 @@
"type": "tidelift"
}
],
- "time": "2024-05-31T14:33:22+00:00"
+ "time": "2023-01-20T17:44:14+00:00"
},
{
"name": "symfony/polyfill-ctype",
- "version": "v1.30.0",
+ "version": "v1.31.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
- "reference": "0424dff1c58f028c451efff2045f5d92410bd540"
+ "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540",
- "reference": "0424dff1c58f028c451efff2045f5d92410bd540",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638",
+ "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638",
"shasum": ""
},
"require": {
- "php": ">=7.1"
+ "php": ">=7.2"
},
"provide": {
"ext-ctype": "*"
@@ -5206,8 +5579,8 @@
"type": "library",
"extra": {
"thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
+ "url": "https://github.com/symfony/polyfill",
+ "name": "symfony/polyfill"
}
},
"autoload": {
@@ -5241,7 +5614,7 @@
"portable"
],
"support": {
- "source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0"
+ "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0"
},
"funding": [
{
@@ -5257,24 +5630,24 @@
"type": "tidelift"
}
],
- "time": "2024-05-31T15:07:36+00:00"
+ "time": "2024-09-09T11:45:10+00:00"
},
{
"name": "symfony/polyfill-intl-grapheme",
- "version": "v1.30.0",
+ "version": "v1.31.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-grapheme.git",
- "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a"
+ "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/64647a7c30b2283f5d49b874d84a18fc22054b7a",
- "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe",
+ "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe",
"shasum": ""
},
"require": {
- "php": ">=7.1"
+ "php": ">=7.2"
},
"suggest": {
"ext-intl": "For best performance"
@@ -5282,8 +5655,8 @@
"type": "library",
"extra": {
"thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
+ "url": "https://github.com/symfony/polyfill",
+ "name": "symfony/polyfill"
}
},
"autoload": {
@@ -5319,7 +5692,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.30.0"
+ "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0"
},
"funding": [
{
@@ -5335,24 +5708,24 @@
"type": "tidelift"
}
],
- "time": "2024-05-31T15:07:36+00:00"
+ "time": "2024-09-09T11:45:10+00:00"
},
{
"name": "symfony/polyfill-intl-normalizer",
- "version": "v1.30.0",
+ "version": "v1.31.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-normalizer.git",
- "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb"
+ "reference": "3833d7255cc303546435cb650316bff708a1c75c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/a95281b0be0d9ab48050ebd988b967875cdb9fdb",
- "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c",
+ "reference": "3833d7255cc303546435cb650316bff708a1c75c",
"shasum": ""
},
"require": {
- "php": ">=7.1"
+ "php": ">=7.2"
},
"suggest": {
"ext-intl": "For best performance"
@@ -5360,8 +5733,8 @@
"type": "library",
"extra": {
"thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
+ "url": "https://github.com/symfony/polyfill",
+ "name": "symfony/polyfill"
}
},
"autoload": {
@@ -5400,7 +5773,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.30.0"
+ "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0"
},
"funding": [
{
@@ -5416,24 +5789,24 @@
"type": "tidelift"
}
],
- "time": "2024-05-31T15:07:36+00:00"
+ "time": "2024-09-09T11:45:10+00:00"
},
{
"name": "symfony/polyfill-mbstring",
- "version": "v1.30.0",
+ "version": "v1.31.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c"
+ "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c",
- "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341",
+ "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341",
"shasum": ""
},
"require": {
- "php": ">=7.1"
+ "php": ">=7.2"
},
"provide": {
"ext-mbstring": "*"
@@ -5444,8 +5817,8 @@
"type": "library",
"extra": {
"thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
+ "url": "https://github.com/symfony/polyfill",
+ "name": "symfony/polyfill"
}
},
"autoload": {
@@ -5480,7 +5853,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0"
},
"funding": [
{
@@ -5496,30 +5869,30 @@
"type": "tidelift"
}
],
- "time": "2024-06-19T12:30:46+00:00"
+ "time": "2024-09-09T11:45:10+00:00"
},
{
"name": "symfony/polyfill-php73",
- "version": "v1.30.0",
+ "version": "v1.31.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php73.git",
- "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1"
+ "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/ec444d3f3f6505bb28d11afa41e75faadebc10a1",
- "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1",
+ "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/0f68c03565dcaaf25a890667542e8bd75fe7e5bb",
+ "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb",
"shasum": ""
},
"require": {
- "php": ">=7.1"
+ "php": ">=7.2"
},
"type": "library",
"extra": {
"thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
+ "url": "https://github.com/symfony/polyfill",
+ "name": "symfony/polyfill"
}
},
"autoload": {
@@ -5556,7 +5929,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php73/tree/v1.30.0"
+ "source": "https://github.com/symfony/polyfill-php73/tree/v1.31.0"
},
"funding": [
{
@@ -5572,30 +5945,30 @@
"type": "tidelift"
}
],
- "time": "2024-05-31T15:07:36+00:00"
+ "time": "2024-09-09T11:45:10+00:00"
},
{
"name": "symfony/polyfill-php80",
- "version": "v1.30.0",
+ "version": "v1.31.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
- "reference": "77fa7995ac1b21ab60769b7323d600a991a90433"
+ "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433",
- "reference": "77fa7995ac1b21ab60769b7323d600a991a90433",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",
+ "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8",
"shasum": ""
},
"require": {
- "php": ">=7.1"
+ "php": ">=7.2"
},
"type": "library",
"extra": {
"thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
+ "url": "https://github.com/symfony/polyfill",
+ "name": "symfony/polyfill"
}
},
"autoload": {
@@ -5636,7 +6009,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0"
+ "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0"
},
"funding": [
{
@@ -5652,25 +6025,24 @@
"type": "tidelift"
}
],
- "time": "2024-05-31T15:07:36+00:00"
+ "time": "2024-09-09T11:45:10+00:00"
},
{
"name": "symfony/process",
- "version": "v5.4.40",
+ "version": "v6.0.19",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
- "reference": "deedcb3bb4669cae2148bc920eafd2b16dc7c046"
+ "reference": "2114fd60f26a296cc403a7939ab91478475a33d4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/process/zipball/deedcb3bb4669cae2148bc920eafd2b16dc7c046",
- "reference": "deedcb3bb4669cae2148bc920eafd2b16dc7c046",
+ "url": "https://api.github.com/repos/symfony/process/zipball/2114fd60f26a296cc403a7939ab91478475a33d4",
+ "reference": "2114fd60f26a296cc403a7939ab91478475a33d4",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
- "symfony/polyfill-php80": "^1.16"
+ "php": ">=8.0.2"
},
"type": "library",
"autoload": {
@@ -5698,7 +6070,7 @@
"description": "Executes commands in sub-processes",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/process/tree/v5.4.40"
+ "source": "https://github.com/symfony/process/tree/v6.0.19"
},
"funding": [
{
@@ -5714,7 +6086,7 @@
"type": "tidelift"
}
],
- "time": "2024-05-31T14:33:22+00:00"
+ "time": "2023-01-01T08:36:10+00:00"
},
{
"name": "symfony/service-contracts",
@@ -5742,12 +6114,12 @@
},
"type": "library",
"extra": {
+ "thanks": {
+ "url": "https://github.com/symfony/contracts",
+ "name": "symfony/contracts"
+ },
"branch-alias": {
"dev-main": "3.0-dev"
- },
- "thanks": {
- "name": "symfony/contracts",
- "url": "https://github.com/symfony/contracts"
}
},
"autoload": {
diff --git a/lib/Google/src/AccessToken/Revoke.php b/lib/Google/src/AccessToken/Revoke.php
index dd94fe0f2..dc8b0c351 100644
--- a/lib/Google/src/AccessToken/Revoke.php
+++ b/lib/Google/src/AccessToken/Revoke.php
@@ -39,7 +39,7 @@ class Revoke
* Instantiates the class, but does not initiate the login flow, leaving it
* to the discretion of the caller.
*/
- public function __construct(ClientInterface $http = null)
+ public function __construct(?ClientInterface $http = null)
{
$this->http = $http;
}
diff --git a/lib/Google/src/AccessToken/Verify.php b/lib/Google/src/AccessToken/Verify.php
index d957908ba..5529450e5 100644
--- a/lib/Google/src/AccessToken/Verify.php
+++ b/lib/Google/src/AccessToken/Verify.php
@@ -59,7 +59,7 @@ class Verify
/**
* @var \Firebase\JWT\JWT
- */
+ */
public $jwt;
/**
@@ -67,9 +67,9 @@ class Verify
* to the discretion of the caller.
*/
public function __construct(
- ClientInterface $http = null,
- CacheItemPoolInterface $cache = null,
- $jwt = null
+ ?ClientInterface $http = null,
+ ?CacheItemPoolInterface $cache = null,
+ ?JWT $jwt = null
) {
if (null === $http) {
$http = new Client();
@@ -130,7 +130,7 @@ public function verifyIdToken($idToken, $audience = null)
return false;
}
- return (array) $payload;
+ return (array)$payload;
} catch (ExpiredException $e) { // @phpstan-ignore-line
return false;
} catch (ExpiredExceptionV3 $e) {
@@ -154,8 +154,8 @@ private function getCache()
* Retrieve and cache a certificates file.
*
* @param string $url location
- * @throws \Google\Exception
* @return array certificates
+ * @throws \Google\Exception
*/
private function retrieveCertsFromLocation($url)
{
@@ -163,8 +163,8 @@ private function retrieveCertsFromLocation($url)
if (0 !== strpos($url, 'http')) {
if (!$file = file_get_contents($url)) {
throw new GoogleException(
- "Failed to retrieve verification certificates: '" .
- $url . "'."
+ "Failed to retrieve verification certificates: '".
+ $url."'."
);
}
@@ -175,7 +175,7 @@ private function retrieveCertsFromLocation($url)
$response = $this->http->get($url);
if ($response->getStatusCode() == 200) {
- return json_decode((string) $response->getBody(), true);
+ return json_decode((string)$response->getBody(), true);
}
throw new GoogleException(
sprintf(
diff --git a/lib/Google/src/AuthHandler/Guzzle6AuthHandler.php b/lib/Google/src/AuthHandler/Guzzle6AuthHandler.php
index 7e8a815c2..352cf915c 100644
--- a/lib/Google/src/AuthHandler/Guzzle6AuthHandler.php
+++ b/lib/Google/src/AuthHandler/Guzzle6AuthHandler.php
@@ -20,7 +20,7 @@ class Guzzle6AuthHandler
protected $cache;
protected $cacheConfig;
- public function __construct(CacheItemPoolInterface $cache = null, array $cacheConfig = [])
+ public function __construct(?CacheItemPoolInterface $cache = null, array $cacheConfig = [])
{
$this->cache = $cache;
$this->cacheConfig = $cacheConfig;
@@ -29,7 +29,7 @@ public function __construct(CacheItemPoolInterface $cache = null, array $cacheCo
public function attachCredentials(
ClientInterface $http,
CredentialsLoader $credentials,
- callable $tokenCallback = null
+ ?callable $tokenCallback = null
) {
// use the provided cache
if ($this->cache) {
@@ -46,7 +46,7 @@ public function attachCredentials(
public function attachCredentialsCache(
ClientInterface $http,
FetchAuthTokenCache $credentials,
- callable $tokenCallback = null
+ ?callable $tokenCallback = null
) {
// if we end up needing to make an HTTP request to retrieve credentials, we
// can use our existing one, but we need to throw exceptions so the error
@@ -74,10 +74,18 @@ public function attachToken(ClientInterface $http, array $token, array $scopes)
return $token['access_token'];
};
+ // Derive a cache prefix from the token, to ensure setting a new token
+ // results in a cache-miss.
+ // Note: Supplying a custom "prefix" will bust this behavior.
+ $cacheConfig = $this->cacheConfig;
+ if (!isset($cacheConfig['prefix']) && isset($token['access_token'])) {
+ $cacheConfig['prefix'] = substr(sha1($token['access_token']), -10);
+ }
+
$middleware = new ScopedAccessTokenMiddleware(
$tokenFunc,
$scopes,
- $this->cacheConfig,
+ $cacheConfig,
$this->cache
);
diff --git a/lib/Google/src/Client.php b/lib/Google/src/Client.php
index 330e8ac6b..edfb1f83e 100644
--- a/lib/Google/src/Client.php
+++ b/lib/Google/src/Client.php
@@ -321,7 +321,7 @@ public function refreshTokenWithAssertion()
* @param ClientInterface $authHttp optional.
* @return array access token
*/
- public function fetchAccessTokenWithAssertion(ClientInterface $authHttp = null)
+ public function fetchAccessTokenWithAssertion(?ClientInterface $authHttp = null)
{
if (!$this->isUsingApplicationDefaultCredentials()) {
throw new DomainException(
@@ -454,7 +454,7 @@ public function createAuthUrl($scope = null, array $queryParams = [])
* @param ClientInterface $http the http client object.
* @return ClientInterface the http client object
*/
- public function authorize(ClientInterface $http = null)
+ public function authorize(?ClientInterface $http = null)
{
$http = $http ?: $this->getHttpClient();
$authHandler = $this->getAuthHandler();
@@ -1043,7 +1043,8 @@ public function setAuthConfig($config)
$key = isset($config['installed']) ? 'installed' : 'web';
if (isset($config['type']) && $config['type'] == 'service_account') {
- // application default credentials
+ // @TODO(v3): Remove this, as it isn't accurate. ADC applies only to determining
+ // credentials based on the user's environment.
$this->useApplicationDefaultCredentials();
// set the information from the config
diff --git a/lib/Google/src/Http/REST.php b/lib/Google/src/Http/REST.php
index 70e48e4b8..c3d3270db 100644
--- a/lib/Google/src/Http/REST.php
+++ b/lib/Google/src/Http/REST.php
@@ -54,7 +54,7 @@ public static function execute(
) {
$runner = new Runner(
$config,
- sprintf('%s %s', $request->getMethod(), (string) $request->getUri()),
+ sprintf('%s %s', $request->getMethod(), (string)$request->getUri()),
[self::class, 'doExecute'],
[$client, $request, $expectedClass]
);
@@ -120,7 +120,7 @@ interface_exists('\GuzzleHttp\Message\ResponseInterface')
*/
public static function decodeHttpResponse(
ResponseInterface $response,
- RequestInterface $request = null,
+ ?RequestInterface $request = null,
$expectedClass = null
) {
$code = $response->getStatusCode();
@@ -128,7 +128,7 @@ public static function decodeHttpResponse(
// retry strategy
if (intVal($code) >= 400) {
// if we errored out, it should be safe to grab the response body
- $body = (string) $response->getBody();
+ $body = (string)$response->getBody();
// Check if we received errors, and add those to the Exception for convenience
throw new GoogleServiceException($body, $code, null, self::getResponseErrors($body));
@@ -147,17 +147,17 @@ public static function decodeHttpResponse(
return $response;
}
- private static function decodeBody(ResponseInterface $response, RequestInterface $request = null)
+ private static function decodeBody(ResponseInterface $response, ?RequestInterface $request = null)
{
if (self::isAltMedia($request)) {
// don't decode the body, it's probably a really long string
return '';
}
- return (string) $response->getBody();
+ return (string)$response->getBody();
}
- private static function determineExpectedClass($expectedClass, RequestInterface $request = null)
+ private static function determineExpectedClass($expectedClass, ?RequestInterface $request = null)
{
// "false" is used to explicitly prevent an expected class from being returned
if (false === $expectedClass) {
@@ -184,7 +184,7 @@ private static function getResponseErrors($body)
return null;
}
- private static function isAltMedia(RequestInterface $request = null)
+ private static function isAltMedia(?RequestInterface $request = null)
{
if ($request && $qs = $request->getUri()->getQuery()) {
parse_str($qs, $query);
diff --git a/lib/Google/src/Service/Exception.php b/lib/Google/src/Service/Exception.php
index 6e88169c2..d79a2e75d 100644
--- a/lib/Google/src/Service/Exception.php
+++ b/lib/Google/src/Service/Exception.php
@@ -39,7 +39,7 @@ class Exception extends GoogleException
public function __construct(
$message,
$code = 0,
- Exception $previous = null,
+ ?Exception $previous = null,
$errors = []
) {
if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
diff --git a/lib/Google/src/Task/Composer.php b/lib/Google/src/Task/Composer.php
index 04969f207..fcad6bd13 100644
--- a/lib/Google/src/Task/Composer.php
+++ b/lib/Google/src/Task/Composer.php
@@ -30,7 +30,7 @@ class Composer
*/
public static function cleanup(
Event $event,
- Filesystem $filesystem = null
+ ?Filesystem $filesystem = null
) {
$composer = $event->getComposer();
$extra = $composer->getPackage()->getExtra();
diff --git a/lib/Google/vendor/composer/autoload_psr4.php b/lib/Google/vendor/composer/autoload_psr4.php
index a6b60b0d6..941b62a92 100644
--- a/lib/Google/vendor/composer/autoload_psr4.php
+++ b/lib/Google/vendor/composer/autoload_psr4.php
@@ -11,7 +11,7 @@
'Rize\\' => array($vendorDir . '/rize/uri-template/src/Rize'),
'Ramsey\\Uuid\\' => array($vendorDir . '/ramsey/uuid/src'),
'Ramsey\\Collection\\' => array($vendorDir . '/ramsey/collection/src'),
- 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
+ 'Psr\\Log\\' => array($vendorDir . '/psr/log/src'),
'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'),
'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'),
'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'),
diff --git a/lib/Google/vendor/composer/autoload_static.php b/lib/Google/vendor/composer/autoload_static.php
index 2cad9318a..a87ff2e68 100644
--- a/lib/Google/vendor/composer/autoload_static.php
+++ b/lib/Google/vendor/composer/autoload_static.php
@@ -108,7 +108,7 @@ class ComposerStaticInitbd131085cfdbf47b26d7ae00fe412ae4
),
'Psr\\Log\\' =>
array (
- 0 => __DIR__ . '/..' . '/psr/log/Psr/Log',
+ 0 => __DIR__ . '/..' . '/psr/log/src',
),
'Psr\\Http\\Message\\' =>
array (
diff --git a/lib/Google/vendor/composer/installed.json b/lib/Google/vendor/composer/installed.json
index fee314ef9..0243111ea 100644
--- a/lib/Google/vendor/composer/installed.json
+++ b/lib/Google/vendor/composer/installed.json
@@ -60,17 +60,17 @@
},
{
"name": "firebase/php-jwt",
- "version": "v6.10.1",
- "version_normalized": "6.10.1.0",
+ "version": "v6.10.2",
+ "version_normalized": "6.10.2.0",
"source": {
"type": "git",
"url": "https://github.com/firebase/php-jwt.git",
- "reference": "500501c2ce893c824c801da135d02661199f60c5"
+ "reference": "30c19ed0f3264cb660ea496895cfb6ef7ee3653b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/firebase/php-jwt/zipball/500501c2ce893c824c801da135d02661199f60c5",
- "reference": "500501c2ce893c824c801da135d02661199f60c5",
+ "url": "https://api.github.com/repos/firebase/php-jwt/zipball/30c19ed0f3264cb660ea496895cfb6ef7ee3653b",
+ "reference": "30c19ed0f3264cb660ea496895cfb6ef7ee3653b",
"shasum": ""
},
"require": {
@@ -88,7 +88,7 @@
"ext-sodium": "Support EdDSA (Ed25519) signatures",
"paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present"
},
- "time": "2024-05-18T18:05:11+00:00",
+ "time": "2024-11-24T11:22:49+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -120,23 +120,23 @@
],
"support": {
"issues": "https://github.com/firebase/php-jwt/issues",
- "source": "https://github.com/firebase/php-jwt/tree/v6.10.1"
+ "source": "https://github.com/firebase/php-jwt/tree/v6.10.2"
},
"install-path": "../firebase/php-jwt"
},
{
"name": "google/apiclient-services",
- "version": "v0.363.0",
- "version_normalized": "0.363.0.0",
+ "version": "v0.389.0",
+ "version_normalized": "0.389.0.0",
"source": {
"type": "git",
"url": "https://github.com/googleapis/google-api-php-client-services.git",
- "reference": "5a0943e498e98e23dccdd98c5a3f74bc1b442053"
+ "reference": "6274e67ee52b1a416ccee0a4eaf337d1139cdaf8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/5a0943e498e98e23dccdd98c5a3f74bc1b442053",
- "reference": "5a0943e498e98e23dccdd98c5a3f74bc1b442053",
+ "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/6274e67ee52b1a416ccee0a4eaf337d1139cdaf8",
+ "reference": "6274e67ee52b1a416ccee0a4eaf337d1139cdaf8",
"shasum": ""
},
"require": {
@@ -145,7 +145,7 @@
"require-dev": {
"phpunit/phpunit": "^9.6"
},
- "time": "2024-07-02T01:04:18+00:00",
+ "time": "2025-01-05T01:04:21+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -167,23 +167,23 @@
],
"support": {
"issues": "https://github.com/googleapis/google-api-php-client-services/issues",
- "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.363.0"
+ "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.389.0"
},
"install-path": "../google/apiclient-services"
},
{
"name": "google/auth",
- "version": "v1.40.0",
- "version_normalized": "1.40.0.0",
+ "version": "v1.45.0",
+ "version_normalized": "1.45.0.0",
"source": {
"type": "git",
"url": "https://github.com/googleapis/google-auth-library-php.git",
- "reference": "bff9f2d01677e71a98394b5ac981b99523df5178"
+ "reference": "cfcb93162341ed5022fa976e621f0fa2b05ba6ad"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/bff9f2d01677e71a98394b5ac981b99523df5178",
- "reference": "bff9f2d01677e71a98394b5ac981b99523df5178",
+ "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/cfcb93162341ed5022fa976e621f0fa2b05ba6ad",
+ "reference": "cfcb93162341ed5022fa976e621f0fa2b05ba6ad",
"shasum": ""
},
"require": {
@@ -192,7 +192,8 @@
"guzzlehttp/psr7": "^2.4.5",
"php": "^8.0",
"psr/cache": "^2.0||^3.0",
- "psr/http-message": "^1.1||^2.0"
+ "psr/http-message": "^1.1||^2.0",
+ "psr/log": "^3.0"
},
"require-dev": {
"guzzlehttp/promises": "^2.0",
@@ -208,7 +209,7 @@
"suggest": {
"phpseclib/phpseclib": "May be used in place of OpenSSL for signing strings or for token management. Please require version ^2."
},
- "time": "2024-05-31T19:16:15+00:00",
+ "time": "2024-12-11T02:10:48+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -230,28 +231,28 @@
"support": {
"docs": "https://googleapis.github.io/google-auth-library-php/main/",
"issues": "https://github.com/googleapis/google-auth-library-php/issues",
- "source": "https://github.com/googleapis/google-auth-library-php/tree/v1.40.0"
+ "source": "https://github.com/googleapis/google-auth-library-php/tree/v1.45.0"
},
"install-path": "../google/auth"
},
{
"name": "google/cloud-core",
- "version": "v1.59.1",
- "version_normalized": "1.59.1.0",
+ "version": "v1.60.1",
+ "version_normalized": "1.60.1.0",
"source": {
"type": "git",
"url": "https://github.com/googleapis/google-cloud-php-core.git",
- "reference": "35aae23dc4d0b860b6c3733e5cf381a510b506d9"
+ "reference": "c149dd075a77bc8555a0eff46267522f1c4e0bfd"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/googleapis/google-cloud-php-core/zipball/35aae23dc4d0b860b6c3733e5cf381a510b506d9",
- "reference": "35aae23dc4d0b860b6c3733e5cf381a510b506d9",
+ "url": "https://api.github.com/repos/googleapis/google-cloud-php-core/zipball/c149dd075a77bc8555a0eff46267522f1c4e0bfd",
+ "reference": "c149dd075a77bc8555a0eff46267522f1c4e0bfd",
"shasum": ""
},
"require": {
"google/auth": "^1.34",
- "google/gax": "^1.34.0",
+ "google/gax": "^1.36.0",
"guzzlehttp/guzzle": "^6.5.8|^7.4.4",
"guzzlehttp/promises": "^1.4||^2.0",
"guzzlehttp/psr7": "^2.6",
@@ -264,7 +265,7 @@
"erusev/parsedown": "^1.6",
"google/cloud-common-protos": "~0.5",
"opis/closure": "^3",
- "phpdocumentor/reflection": "^5.3.3",
+ "phpdocumentor/reflection": "^5.3.3||^6.0",
"phpdocumentor/reflection-docblock": "^5.3",
"phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^9.0",
@@ -274,7 +275,7 @@
"opis/closure": "May be used to serialize closures to process jobs in the batch daemon. Please require version ^3.",
"symfony/lock": "Required for the Spanner cached based session pool. Please require the following commit: 3.3.x-dev#1ba6ac9"
},
- "time": "2024-08-10T02:24:23+00:00",
+ "time": "2024-12-12T21:15:35+00:00",
"bin": [
"bin/google-cloud-batch"
],
@@ -282,9 +283,9 @@
"extra": {
"component": {
"id": "cloud-core",
- "target": "googleapis/google-cloud-php-core.git",
"path": "Core",
- "entry": "src/ServiceBuilder.php"
+ "entry": "src/ServiceBuilder.php",
+ "target": "googleapis/google-cloud-php-core.git"
}
},
"installation-source": "dist",
@@ -299,34 +300,34 @@
],
"description": "Google Cloud PHP shared dependency, providing functionality useful to all components.",
"support": {
- "source": "https://github.com/googleapis/google-cloud-php-core/tree/v1.59.1"
+ "source": "https://github.com/googleapis/google-cloud-php-core/tree/v1.60.1"
},
"install-path": "../google/cloud-core"
},
{
"name": "google/cloud-storage",
- "version": "v1.42.1",
- "version_normalized": "1.42.1.0",
+ "version": "v1.45.0",
+ "version_normalized": "1.45.0.0",
"source": {
"type": "git",
"url": "https://github.com/googleapis/google-cloud-php-storage.git",
- "reference": "2a418cad887e44d08a86de19a878ea3607212edb"
+ "reference": "9873cb5a27f4adc20909329d0eae85f2b3b0dba6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/googleapis/google-cloud-php-storage/zipball/2a418cad887e44d08a86de19a878ea3607212edb",
- "reference": "2a418cad887e44d08a86de19a878ea3607212edb",
+ "url": "https://api.github.com/repos/googleapis/google-cloud-php-storage/zipball/9873cb5a27f4adc20909329d0eae85f2b3b0dba6",
+ "reference": "9873cb5a27f4adc20909329d0eae85f2b3b0dba6",
"shasum": ""
},
"require": {
- "google/cloud-core": "^1.55",
+ "google/cloud-core": "^1.57",
"php": "^8.0",
"ramsey/uuid": "^4.2.3"
},
"require-dev": {
"erusev/parsedown": "^1.6",
"google/cloud-pubsub": "^2.0",
- "phpdocumentor/reflection": "^5.3.3",
+ "phpdocumentor/reflection": "^5.3.3||^6.0",
"phpdocumentor/reflection-docblock": "^5.3",
"phpseclib/phpseclib": "^2.0||^3.0",
"phpspec/prophecy-phpunit": "^2.0",
@@ -337,14 +338,14 @@
"google/cloud-pubsub": "May be used to register a topic to receive bucket notifications.",
"phpseclib/phpseclib": "May be used in place of OpenSSL for creating signed Cloud Storage URLs. Please require version ^2."
},
- "time": "2024-07-08T23:14:13+00:00",
+ "time": "2024-12-12T21:15:35+00:00",
"type": "library",
"extra": {
"component": {
"id": "cloud-storage",
- "target": "googleapis/google-cloud-php-storage.git",
"path": "Storage",
- "entry": "src/StorageClient.php"
+ "entry": "src/StorageClient.php",
+ "target": "googleapis/google-cloud-php-storage.git"
}
},
"installation-source": "dist",
@@ -359,23 +360,23 @@
],
"description": "Cloud Storage Client for PHP",
"support": {
- "source": "https://github.com/googleapis/google-cloud-php-storage/tree/v1.42.1"
+ "source": "https://github.com/googleapis/google-cloud-php-storage/tree/v1.45.0"
},
"install-path": "../google/cloud-storage"
},
{
"name": "google/common-protos",
- "version": "v4.7.0",
- "version_normalized": "4.7.0.0",
+ "version": "4.8.3",
+ "version_normalized": "4.8.3.0",
"source": {
"type": "git",
"url": "https://github.com/googleapis/common-protos-php.git",
- "reference": "e58068776f57605c336e32c7db373f0a81da17b8"
+ "reference": "38a9a8bb459fa618da797d25d7bf36bb21d1103d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/googleapis/common-protos-php/zipball/e58068776f57605c336e32c7db373f0a81da17b8",
- "reference": "e58068776f57605c336e32c7db373f0a81da17b8",
+ "url": "https://api.github.com/repos/googleapis/common-protos-php/zipball/38a9a8bb459fa618da797d25d7bf36bb21d1103d",
+ "reference": "38a9a8bb459fa618da797d25d7bf36bb21d1103d",
"shasum": ""
},
"require": {
@@ -385,8 +386,16 @@
"require-dev": {
"phpunit/phpunit": "^9.6"
},
- "time": "2024-07-25T20:20:43+00:00",
+ "time": "2024-09-07T01:37:15+00:00",
"type": "library",
+ "extra": {
+ "component": {
+ "id": "common-protos",
+ "path": "CommonProtos",
+ "entry": "README.md",
+ "target": "googleapis/common-protos-php.git"
+ }
+ },
"installation-source": "dist",
"autoload": {
"psr-4": {
@@ -413,28 +422,27 @@
"google"
],
"support": {
- "issues": "https://github.com/googleapis/common-protos-php/issues",
- "source": "https://github.com/googleapis/common-protos-php/tree/v4.7.0"
+ "source": "https://github.com/googleapis/common-protos-php/tree/v4.8.3"
},
"install-path": "../google/common-protos"
},
{
"name": "google/gax",
- "version": "v1.34.1",
- "version_normalized": "1.34.1.0",
+ "version": "v1.36.0",
+ "version_normalized": "1.36.0.0",
"source": {
"type": "git",
"url": "https://github.com/googleapis/gax-php.git",
- "reference": "173f0a97323284f91fd453c4ed7ed8317ecf6cfa"
+ "reference": "140599cf5eae2432363ce6198e9fdff851625a7a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/googleapis/gax-php/zipball/173f0a97323284f91fd453c4ed7ed8317ecf6cfa",
- "reference": "173f0a97323284f91fd453c4ed7ed8317ecf6cfa",
+ "url": "https://api.github.com/repos/googleapis/gax-php/zipball/140599cf5eae2432363ce6198e9fdff851625a7a",
+ "reference": "140599cf5eae2432363ce6198e9fdff851625a7a",
"shasum": ""
},
"require": {
- "google/auth": "^1.34.0",
+ "google/auth": "^1.45",
"google/common-protos": "^4.4",
"google/grpc-gcp": "^0.4",
"google/longrunning": "~0.4",
@@ -450,11 +458,11 @@
},
"require-dev": {
"phpspec/prophecy-phpunit": "^2.1",
- "phpstan/phpstan": "^1.10",
+ "phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^9.6",
"squizlabs/php_codesniffer": "3.*"
},
- "time": "2024-08-15T18:00:58+00:00",
+ "time": "2024-12-11T02:47:43+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -474,7 +482,7 @@
],
"support": {
"issues": "https://github.com/googleapis/gax-php/issues",
- "source": "https://github.com/googleapis/gax-php/tree/v1.34.1"
+ "source": "https://github.com/googleapis/gax-php/tree/v1.36.0"
},
"install-path": "../google/gax"
},
@@ -528,24 +536,24 @@
},
{
"name": "google/longrunning",
- "version": "0.4.3",
- "version_normalized": "0.4.3.0",
+ "version": "0.4.6",
+ "version_normalized": "0.4.6.0",
"source": {
"type": "git",
"url": "https://github.com/googleapis/php-longrunning.git",
- "reference": "ed718a735e407826c3332b7197a44602eb03e608"
+ "reference": "4eb04d47bba8095d5a47f75334b9204c2a4a7ac6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/googleapis/php-longrunning/zipball/ed718a735e407826c3332b7197a44602eb03e608",
- "reference": "ed718a735e407826c3332b7197a44602eb03e608",
+ "url": "https://api.github.com/repos/googleapis/php-longrunning/zipball/4eb04d47bba8095d5a47f75334b9204c2a4a7ac6",
+ "reference": "4eb04d47bba8095d5a47f75334b9204c2a4a7ac6",
"shasum": ""
},
"require-dev": {
- "google/gax": "^1.34.0",
+ "google/gax": "^1.36.0",
"phpunit/phpunit": "^9.0"
},
- "time": "2024-06-01T03:14:01+00:00",
+ "time": "2024-12-12T21:15:35+00:00",
"type": "library",
"extra": {
"component": {
@@ -569,23 +577,23 @@
],
"description": "Google LongRunning Client for PHP",
"support": {
- "source": "https://github.com/googleapis/php-longrunning/tree/v0.4.3"
+ "source": "https://github.com/googleapis/php-longrunning/tree/v0.4.6"
},
"install-path": "../google/longrunning"
},
{
"name": "google/protobuf",
- "version": "v4.27.3",
- "version_normalized": "4.27.3.0",
+ "version": "v4.29.3",
+ "version_normalized": "4.29.3.0",
"source": {
"type": "git",
"url": "https://github.com/protocolbuffers/protobuf-php.git",
- "reference": "ff079fe467bf86ac8f3359e2eb77a1613ebd204d"
+ "reference": "ab5077c2cfdd1f415f42d11fdbdf903ba8e3d9b7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/ff079fe467bf86ac8f3359e2eb77a1613ebd204d",
- "reference": "ff079fe467bf86ac8f3359e2eb77a1613ebd204d",
+ "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/ab5077c2cfdd1f415f42d11fdbdf903ba8e3d9b7",
+ "reference": "ab5077c2cfdd1f415f42d11fdbdf903ba8e3d9b7",
"shasum": ""
},
"require": {
@@ -597,7 +605,7 @@
"suggest": {
"ext-bcmath": "Need to support JSON deserialization"
},
- "time": "2024-07-31T13:27:16+00:00",
+ "time": "2025-01-08T21:00:13+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -616,7 +624,7 @@
"proto"
],
"support": {
- "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.27.3"
+ "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.29.3"
},
"install-path": "../google/protobuf"
},
@@ -669,23 +677,23 @@
},
{
"name": "guzzlehttp/guzzle",
- "version": "7.8.1",
- "version_normalized": "7.8.1.0",
+ "version": "7.9.2",
+ "version_normalized": "7.9.2.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
- "reference": "41042bc7ab002487b876a0683fc8dce04ddce104"
+ "reference": "d281ed313b989f213357e3be1a179f02196ac99b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/41042bc7ab002487b876a0683fc8dce04ddce104",
- "reference": "41042bc7ab002487b876a0683fc8dce04ddce104",
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d281ed313b989f213357e3be1a179f02196ac99b",
+ "reference": "d281ed313b989f213357e3be1a179f02196ac99b",
"shasum": ""
},
"require": {
"ext-json": "*",
- "guzzlehttp/promises": "^1.5.3 || ^2.0.1",
- "guzzlehttp/psr7": "^1.9.1 || ^2.5.1",
+ "guzzlehttp/promises": "^1.5.3 || ^2.0.3",
+ "guzzlehttp/psr7": "^2.7.0",
"php": "^7.2.5 || ^8.0",
"psr/http-client": "^1.0",
"symfony/deprecation-contracts": "^2.2 || ^3.0"
@@ -696,9 +704,9 @@
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
"ext-curl": "*",
- "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999",
+ "guzzle/client-integration-tests": "3.0.2",
"php-http/message-factory": "^1.1",
- "phpunit/phpunit": "^8.5.36 || ^9.6.15",
+ "phpunit/phpunit": "^8.5.39 || ^9.6.20",
"psr/log": "^1.1 || ^2.0 || ^3.0"
},
"suggest": {
@@ -706,7 +714,7 @@
"ext-intl": "Required for Internationalized Domain Name (IDN) support",
"psr/log": "Required for using the Log middleware"
},
- "time": "2023-12-03T20:35:24+00:00",
+ "time": "2024-07-24T11:22:20+00:00",
"type": "library",
"extra": {
"bamarni-bin": {
@@ -778,7 +786,7 @@
],
"support": {
"issues": "https://github.com/guzzle/guzzle/issues",
- "source": "https://github.com/guzzle/guzzle/tree/7.8.1"
+ "source": "https://github.com/guzzle/guzzle/tree/7.9.2"
},
"funding": [
{
@@ -798,17 +806,17 @@
},
{
"name": "guzzlehttp/promises",
- "version": "2.0.2",
- "version_normalized": "2.0.2.0",
+ "version": "2.0.4",
+ "version_normalized": "2.0.4.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/promises.git",
- "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223"
+ "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/promises/zipball/bbff78d96034045e58e13dedd6ad91b5d1253223",
- "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223",
+ "url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455",
+ "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455",
"shasum": ""
},
"require": {
@@ -816,9 +824,9 @@
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
- "phpunit/phpunit": "^8.5.36 || ^9.6.15"
+ "phpunit/phpunit": "^8.5.39 || ^9.6.20"
},
- "time": "2023-12-03T20:19:20+00:00",
+ "time": "2024-10-17T10:06:22+00:00",
"type": "library",
"extra": {
"bamarni-bin": {
@@ -864,7 +872,7 @@
],
"support": {
"issues": "https://github.com/guzzle/promises/issues",
- "source": "https://github.com/guzzle/promises/tree/2.0.2"
+ "source": "https://github.com/guzzle/promises/tree/2.0.4"
},
"funding": [
{
@@ -884,17 +892,17 @@
},
{
"name": "guzzlehttp/psr7",
- "version": "2.6.2",
- "version_normalized": "2.6.2.0",
+ "version": "2.7.0",
+ "version_normalized": "2.7.0.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
- "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221"
+ "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/psr7/zipball/45b30f99ac27b5ca93cb4831afe16285f57b8221",
- "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221",
+ "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201",
+ "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201",
"shasum": ""
},
"require": {
@@ -909,13 +917,13 @@
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
- "http-interop/http-factory-tests": "^0.9",
- "phpunit/phpunit": "^8.5.36 || ^9.6.15"
+ "http-interop/http-factory-tests": "0.9.0",
+ "phpunit/phpunit": "^8.5.39 || ^9.6.20"
},
"suggest": {
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
},
- "time": "2023-12-03T20:05:35+00:00",
+ "time": "2024-07-18T11:15:46+00:00",
"type": "library",
"extra": {
"bamarni-bin": {
@@ -983,7 +991,7 @@
],
"support": {
"issues": "https://github.com/guzzle/psr7/issues",
- "source": "https://github.com/guzzle/psr7/tree/2.6.2"
+ "source": "https://github.com/guzzle/psr7/tree/2.7.0"
},
"funding": [
{
@@ -1003,17 +1011,17 @@
},
{
"name": "monolog/monolog",
- "version": "2.9.3",
- "version_normalized": "2.9.3.0",
+ "version": "2.10.0",
+ "version_normalized": "2.10.0.0",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
- "reference": "a30bfe2e142720dfa990d0a7e573997f5d884215"
+ "reference": "5cf826f2991858b54d5c3809bee745560a1042a7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Seldaek/monolog/zipball/a30bfe2e142720dfa990d0a7e573997f5d884215",
- "reference": "a30bfe2e142720dfa990d0a7e573997f5d884215",
+ "url": "https://api.github.com/repos/Seldaek/monolog/zipball/5cf826f2991858b54d5c3809bee745560a1042a7",
+ "reference": "5cf826f2991858b54d5c3809bee745560a1042a7",
"shasum": ""
},
"require": {
@@ -1059,7 +1067,7 @@
"rollbar/rollbar": "Allow sending log messages to Rollbar",
"ruflin/elastica": "Allow sending log messages to an Elastic Search server"
},
- "time": "2024-04-12T20:52:51+00:00",
+ "time": "2024-11-12T12:43:37+00:00",
"type": "library",
"extra": {
"branch-alias": {
@@ -1092,7 +1100,7 @@
],
"support": {
"issues": "https://github.com/Seldaek/monolog/issues",
- "source": "https://github.com/Seldaek/monolog/tree/2.9.3"
+ "source": "https://github.com/Seldaek/monolog/tree/2.10.0"
},
"funding": [
{
@@ -1231,17 +1239,17 @@
},
{
"name": "phpseclib/phpseclib",
- "version": "3.0.39",
- "version_normalized": "3.0.39.0",
+ "version": "3.0.43",
+ "version_normalized": "3.0.43.0",
"source": {
"type": "git",
"url": "https://github.com/phpseclib/phpseclib.git",
- "reference": "211ebc399c6e73c225a018435fe5ae209d1d1485"
+ "reference": "709ec107af3cb2f385b9617be72af8cf62441d02"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/211ebc399c6e73c225a018435fe5ae209d1d1485",
- "reference": "211ebc399c6e73c225a018435fe5ae209d1d1485",
+ "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/709ec107af3cb2f385b9617be72af8cf62441d02",
+ "reference": "709ec107af3cb2f385b9617be72af8cf62441d02",
"shasum": ""
},
"require": {
@@ -1259,7 +1267,7 @@
"ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.",
"ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations."
},
- "time": "2024-06-24T06:27:33+00:00",
+ "time": "2024-12-14T21:12:59+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -1324,7 +1332,7 @@
],
"support": {
"issues": "https://github.com/phpseclib/phpseclib/issues",
- "source": "https://github.com/phpseclib/phpseclib/tree/3.0.39"
+ "source": "https://github.com/phpseclib/phpseclib/tree/3.0.43"
},
"funding": [
{
@@ -1565,33 +1573,33 @@
},
{
"name": "psr/log",
- "version": "1.1.4",
- "version_normalized": "1.1.4.0",
+ "version": "3.0.2",
+ "version_normalized": "3.0.2.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
- "reference": "d49695b909c3b7628b6289db5479a1c204601f11"
+ "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
- "reference": "d49695b909c3b7628b6289db5479a1c204601f11",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
+ "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
"shasum": ""
},
"require": {
- "php": ">=5.3.0"
+ "php": ">=8.0.0"
},
- "time": "2021-05-03T11:20:27+00:00",
+ "time": "2024-09-11T13:17:53+00:00",
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.1.x-dev"
+ "dev-master": "3.x-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
- "Psr\\Log\\": "Psr/Log/"
+ "Psr\\Log\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -1612,7 +1620,7 @@
"psr-3"
],
"support": {
- "source": "https://github.com/php-fig/log/tree/1.1.4"
+ "source": "https://github.com/php-fig/log/tree/3.0.2"
},
"install-path": "../psr/log"
},
@@ -1853,17 +1861,17 @@
},
{
"name": "rize/uri-template",
- "version": "0.3.6",
- "version_normalized": "0.3.6.0",
+ "version": "0.3.8",
+ "version_normalized": "0.3.8.0",
"source": {
"type": "git",
"url": "https://github.com/rize/UriTemplate.git",
- "reference": "34efe65c79710eed0883884f2285ae6d4a0aad19"
+ "reference": "34a5b96d0b65a5dddb7d20f09b6527a43faede24"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/rize/UriTemplate/zipball/34efe65c79710eed0883884f2285ae6d4a0aad19",
- "reference": "34efe65c79710eed0883884f2285ae6d4a0aad19",
+ "url": "https://api.github.com/repos/rize/UriTemplate/zipball/34a5b96d0b65a5dddb7d20f09b6527a43faede24",
+ "reference": "34a5b96d0b65a5dddb7d20f09b6527a43faede24",
"shasum": ""
},
"require": {
@@ -1872,7 +1880,7 @@
"require-dev": {
"phpunit/phpunit": "~4.8.36"
},
- "time": "2024-03-10T08:07:49+00:00",
+ "time": "2024-08-30T07:09:40+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -1898,7 +1906,7 @@
],
"support": {
"issues": "https://github.com/rize/UriTemplate/issues",
- "source": "https://github.com/rize/UriTemplate/tree/0.3.6"
+ "source": "https://github.com/rize/UriTemplate/tree/0.3.8"
},
"funding": [
{
@@ -1988,28 +1996,28 @@
},
{
"name": "symfony/polyfill-php81",
- "version": "v1.30.0",
- "version_normalized": "1.30.0.0",
+ "version": "v1.31.0",
+ "version_normalized": "1.31.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php81.git",
- "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af"
+ "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/3fb075789fb91f9ad9af537c4012d523085bd5af",
- "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af",
+ "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c",
+ "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c",
"shasum": ""
},
"require": {
- "php": ">=7.1"
+ "php": ">=7.2"
},
- "time": "2024-06-19T12:30:46+00:00",
+ "time": "2024-09-09T11:45:10+00:00",
"type": "library",
"extra": {
"thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
+ "url": "https://github.com/symfony/polyfill",
+ "name": "symfony/polyfill"
}
},
"installation-source": "dist",
@@ -2047,7 +2055,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php81/tree/v1.30.0"
+ "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0"
},
"funding": [
{
diff --git a/lib/Google/vendor/composer/installed.php b/lib/Google/vendor/composer/installed.php
index 66824ea8c..b1531f40b 100644
--- a/lib/Google/vendor/composer/installed.php
+++ b/lib/Google/vendor/composer/installed.php
@@ -3,7 +3,7 @@
'name' => 'google/apiclient',
'pretty_version' => 'dev-latest',
'version' => 'dev-latest',
- 'reference' => 'ef13b8486768945c2b8c6b32e4aa2914eaeb468d',
+ 'reference' => '37c3d25a1eb876a65a1b147acd45aa3cfc7a266b',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -20,9 +20,9 @@
'dev_requirement' => false,
),
'firebase/php-jwt' => array(
- 'pretty_version' => 'v6.10.1',
- 'version' => '6.10.1.0',
- 'reference' => '500501c2ce893c824c801da135d02661199f60c5',
+ 'pretty_version' => 'v6.10.2',
+ 'version' => '6.10.2.0',
+ 'reference' => '30c19ed0f3264cb660ea496895cfb6ef7ee3653b',
'type' => 'library',
'install_path' => __DIR__ . '/../firebase/php-jwt',
'aliases' => array(),
@@ -31,61 +31,61 @@
'google/apiclient' => array(
'pretty_version' => 'dev-latest',
'version' => 'dev-latest',
- 'reference' => 'ef13b8486768945c2b8c6b32e4aa2914eaeb468d',
+ 'reference' => '37c3d25a1eb876a65a1b147acd45aa3cfc7a266b',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev_requirement' => false,
),
'google/apiclient-services' => array(
- 'pretty_version' => 'v0.363.0',
- 'version' => '0.363.0.0',
- 'reference' => '5a0943e498e98e23dccdd98c5a3f74bc1b442053',
+ 'pretty_version' => 'v0.389.0',
+ 'version' => '0.389.0.0',
+ 'reference' => '6274e67ee52b1a416ccee0a4eaf337d1139cdaf8',
'type' => 'library',
'install_path' => __DIR__ . '/../google/apiclient-services',
'aliases' => array(),
'dev_requirement' => false,
),
'google/auth' => array(
- 'pretty_version' => 'v1.40.0',
- 'version' => '1.40.0.0',
- 'reference' => 'bff9f2d01677e71a98394b5ac981b99523df5178',
+ 'pretty_version' => 'v1.45.0',
+ 'version' => '1.45.0.0',
+ 'reference' => 'cfcb93162341ed5022fa976e621f0fa2b05ba6ad',
'type' => 'library',
'install_path' => __DIR__ . '/../google/auth',
'aliases' => array(),
'dev_requirement' => false,
),
'google/cloud-core' => array(
- 'pretty_version' => 'v1.59.1',
- 'version' => '1.59.1.0',
- 'reference' => '35aae23dc4d0b860b6c3733e5cf381a510b506d9',
+ 'pretty_version' => 'v1.60.1',
+ 'version' => '1.60.1.0',
+ 'reference' => 'c149dd075a77bc8555a0eff46267522f1c4e0bfd',
'type' => 'library',
'install_path' => __DIR__ . '/../google/cloud-core',
'aliases' => array(),
'dev_requirement' => false,
),
'google/cloud-storage' => array(
- 'pretty_version' => 'v1.42.1',
- 'version' => '1.42.1.0',
- 'reference' => '2a418cad887e44d08a86de19a878ea3607212edb',
+ 'pretty_version' => 'v1.45.0',
+ 'version' => '1.45.0.0',
+ 'reference' => '9873cb5a27f4adc20909329d0eae85f2b3b0dba6',
'type' => 'library',
'install_path' => __DIR__ . '/../google/cloud-storage',
'aliases' => array(),
'dev_requirement' => false,
),
'google/common-protos' => array(
- 'pretty_version' => 'v4.7.0',
- 'version' => '4.7.0.0',
- 'reference' => 'e58068776f57605c336e32c7db373f0a81da17b8',
+ 'pretty_version' => '4.8.3',
+ 'version' => '4.8.3.0',
+ 'reference' => '38a9a8bb459fa618da797d25d7bf36bb21d1103d',
'type' => 'library',
'install_path' => __DIR__ . '/../google/common-protos',
'aliases' => array(),
'dev_requirement' => false,
),
'google/gax' => array(
- 'pretty_version' => 'v1.34.1',
- 'version' => '1.34.1.0',
- 'reference' => '173f0a97323284f91fd453c4ed7ed8317ecf6cfa',
+ 'pretty_version' => 'v1.36.0',
+ 'version' => '1.36.0.0',
+ 'reference' => '140599cf5eae2432363ce6198e9fdff851625a7a',
'type' => 'library',
'install_path' => __DIR__ . '/../google/gax',
'aliases' => array(),
@@ -101,18 +101,18 @@
'dev_requirement' => false,
),
'google/longrunning' => array(
- 'pretty_version' => '0.4.3',
- 'version' => '0.4.3.0',
- 'reference' => 'ed718a735e407826c3332b7197a44602eb03e608',
+ 'pretty_version' => '0.4.6',
+ 'version' => '0.4.6.0',
+ 'reference' => '4eb04d47bba8095d5a47f75334b9204c2a4a7ac6',
'type' => 'library',
'install_path' => __DIR__ . '/../google/longrunning',
'aliases' => array(),
'dev_requirement' => false,
),
'google/protobuf' => array(
- 'pretty_version' => 'v4.27.3',
- 'version' => '4.27.3.0',
- 'reference' => 'ff079fe467bf86ac8f3359e2eb77a1613ebd204d',
+ 'pretty_version' => 'v4.29.3',
+ 'version' => '4.29.3.0',
+ 'reference' => 'ab5077c2cfdd1f415f42d11fdbdf903ba8e3d9b7',
'type' => 'library',
'install_path' => __DIR__ . '/../google/protobuf',
'aliases' => array(),
@@ -128,36 +128,36 @@
'dev_requirement' => false,
),
'guzzlehttp/guzzle' => array(
- 'pretty_version' => '7.8.1',
- 'version' => '7.8.1.0',
- 'reference' => '41042bc7ab002487b876a0683fc8dce04ddce104',
+ 'pretty_version' => '7.9.2',
+ 'version' => '7.9.2.0',
+ 'reference' => 'd281ed313b989f213357e3be1a179f02196ac99b',
'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/guzzle',
'aliases' => array(),
'dev_requirement' => false,
),
'guzzlehttp/promises' => array(
- 'pretty_version' => '2.0.2',
- 'version' => '2.0.2.0',
- 'reference' => 'bbff78d96034045e58e13dedd6ad91b5d1253223',
+ 'pretty_version' => '2.0.4',
+ 'version' => '2.0.4.0',
+ 'reference' => 'f9c436286ab2892c7db7be8c8da4ef61ccf7b455',
'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/promises',
'aliases' => array(),
'dev_requirement' => false,
),
'guzzlehttp/psr7' => array(
- 'pretty_version' => '2.6.2',
- 'version' => '2.6.2.0',
- 'reference' => '45b30f99ac27b5ca93cb4831afe16285f57b8221',
+ 'pretty_version' => '2.7.0',
+ 'version' => '2.7.0.0',
+ 'reference' => 'a70f5c95fb43bc83f07c9c948baa0dc1829bf201',
'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/psr7',
'aliases' => array(),
'dev_requirement' => false,
),
'monolog/monolog' => array(
- 'pretty_version' => '2.9.3',
- 'version' => '2.9.3.0',
- 'reference' => 'a30bfe2e142720dfa990d0a7e573997f5d884215',
+ 'pretty_version' => '2.10.0',
+ 'version' => '2.10.0.0',
+ 'reference' => '5cf826f2991858b54d5c3809bee745560a1042a7',
'type' => 'library',
'install_path' => __DIR__ . '/../monolog/monolog',
'aliases' => array(),
@@ -182,9 +182,9 @@
'dev_requirement' => false,
),
'phpseclib/phpseclib' => array(
- 'pretty_version' => '3.0.39',
- 'version' => '3.0.39.0',
- 'reference' => '211ebc399c6e73c225a018435fe5ae209d1d1485',
+ 'pretty_version' => '3.0.43',
+ 'version' => '3.0.43.0',
+ 'reference' => '709ec107af3cb2f385b9617be72af8cf62441d02',
'type' => 'library',
'install_path' => __DIR__ . '/../phpseclib/phpseclib',
'aliases' => array(),
@@ -245,9 +245,9 @@
),
),
'psr/log' => array(
- 'pretty_version' => '1.1.4',
- 'version' => '1.1.4.0',
- 'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
+ 'pretty_version' => '3.0.2',
+ 'version' => '3.0.2.0',
+ 'reference' => 'f16e1d5863e37f8d8c2a01719f5b34baa2b714d3',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/log',
'aliases' => array(),
@@ -293,9 +293,9 @@
),
),
'rize/uri-template' => array(
- 'pretty_version' => '0.3.6',
- 'version' => '0.3.6.0',
- 'reference' => '34efe65c79710eed0883884f2285ae6d4a0aad19',
+ 'pretty_version' => '0.3.8',
+ 'version' => '0.3.8.0',
+ 'reference' => '34a5b96d0b65a5dddb7d20f09b6527a43faede24',
'type' => 'library',
'install_path' => __DIR__ . '/../rize/uri-template',
'aliases' => array(),
@@ -311,9 +311,9 @@
'dev_requirement' => false,
),
'symfony/polyfill-php81' => array(
- 'pretty_version' => 'v1.30.0',
- 'version' => '1.30.0.0',
- 'reference' => '3fb075789fb91f9ad9af537c4012d523085bd5af',
+ 'pretty_version' => 'v1.31.0',
+ 'version' => '1.31.0.0',
+ 'reference' => '4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-php81',
'aliases' => array(),
diff --git a/lib/Google/vendor/firebase/php-jwt/CHANGELOG.md b/lib/Google/vendor/firebase/php-jwt/CHANGELOG.md
index 2662b0502..5feeb5a67 100644
--- a/lib/Google/vendor/firebase/php-jwt/CHANGELOG.md
+++ b/lib/Google/vendor/firebase/php-jwt/CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog
+## [6.10.2](https://github.com/firebase/php-jwt/compare/v6.10.1...v6.10.2) (2024-11-24)
+
+
+### Bug Fixes
+
+* Mitigate PHP8.4 deprecation warnings ([#570](https://github.com/firebase/php-jwt/issues/570)) ([76808fa](https://github.com/firebase/php-jwt/commit/76808fa227f3811aa5cdb3bf81233714b799a5b5))
+* support php 8.4 ([#583](https://github.com/firebase/php-jwt/issues/583)) ([e3d68b0](https://github.com/firebase/php-jwt/commit/e3d68b044421339443c74199edd020e03fb1887e))
+
## [6.10.1](https://github.com/firebase/php-jwt/compare/v6.10.0...v6.10.1) (2024-05-18)
diff --git a/lib/Google/vendor/firebase/php-jwt/src/CachedKeySet.php b/lib/Google/vendor/firebase/php-jwt/src/CachedKeySet.php
index 65bab74f2..8e8e8d68c 100644
--- a/lib/Google/vendor/firebase/php-jwt/src/CachedKeySet.php
+++ b/lib/Google/vendor/firebase/php-jwt/src/CachedKeySet.php
@@ -80,9 +80,9 @@ public function __construct(
ClientInterface $httpClient,
RequestFactoryInterface $httpFactory,
CacheItemPoolInterface $cache,
- int $expiresAfter = null,
+ ?int $expiresAfter = null,
bool $rateLimit = false,
- string $defaultAlg = null
+ ?string $defaultAlg = null
) {
$this->jwksUri = $jwksUri;
$this->httpClient = $httpClient;
@@ -180,7 +180,7 @@ private function keyIdExists(string $keyId): bool
$jwksResponse = $this->httpClient->sendRequest($request);
if ($jwksResponse->getStatusCode() !== 200) {
throw new UnexpectedValueException(
- sprintf('HTTP Error: %d %s for URI "%s"',
+ \sprintf('HTTP Error: %d %s for URI "%s"',
$jwksResponse->getStatusCode(),
$jwksResponse->getReasonPhrase(),
$this->jwksUri,
diff --git a/lib/Google/vendor/firebase/php-jwt/src/JWK.php b/lib/Google/vendor/firebase/php-jwt/src/JWK.php
index 63fb2484b..6efc2fe38 100644
--- a/lib/Google/vendor/firebase/php-jwt/src/JWK.php
+++ b/lib/Google/vendor/firebase/php-jwt/src/JWK.php
@@ -52,7 +52,7 @@ class JWK
*
* @uses parseKey
*/
- public static function parseKeySet(array $jwks, string $defaultAlg = null): array
+ public static function parseKeySet(array $jwks, ?string $defaultAlg = null): array
{
$keys = [];
@@ -93,7 +93,7 @@ public static function parseKeySet(array $jwks, string $defaultAlg = null): arra
*
* @uses createPemFromModulusAndExponent
*/
- public static function parseKey(array $jwk, string $defaultAlg = null): ?Key
+ public static function parseKey(array $jwk, ?string $defaultAlg = null): ?Key
{
if (empty($jwk)) {
throw new InvalidArgumentException('JWK must not be empty');
@@ -212,7 +212,7 @@ private static function createPemFromCrvAndXYCoordinates(string $crv, string $x,
)
);
- return sprintf(
+ return \sprintf(
"-----BEGIN PUBLIC KEY-----\n%s\n-----END PUBLIC KEY-----\n",
wordwrap(base64_encode($pem), 64, "\n", true)
);
diff --git a/lib/Google/vendor/firebase/php-jwt/src/JWT.php b/lib/Google/vendor/firebase/php-jwt/src/JWT.php
index e9d756398..dd9292a43 100644
--- a/lib/Google/vendor/firebase/php-jwt/src/JWT.php
+++ b/lib/Google/vendor/firebase/php-jwt/src/JWT.php
@@ -96,7 +96,7 @@ class JWT
public static function decode(
string $jwt,
$keyOrKeyArray,
- stdClass &$headers = null
+ ?stdClass &$headers = null
): stdClass {
// Validate JWT
$timestamp = \is_null(static::$timestamp) ? \time() : static::$timestamp;
@@ -200,11 +200,11 @@ public static function encode(
array $payload,
$key,
string $alg,
- string $keyId = null,
- array $head = null
+ ?string $keyId = null,
+ ?array $head = null
): string {
$header = ['typ' => 'JWT'];
- if (isset($head) && \is_array($head)) {
+ if (isset($head)) {
$header = \array_merge($header, $head);
}
$header['alg'] = $alg;
@@ -387,12 +387,7 @@ public static function jsonDecode(string $input)
*/
public static function jsonEncode(array $input): string
{
- if (PHP_VERSION_ID >= 50400) {
- $json = \json_encode($input, \JSON_UNESCAPED_SLASHES);
- } else {
- // PHP 5.3 only
- $json = \json_encode($input);
- }
+ $json = \json_encode($input, \JSON_UNESCAPED_SLASHES);
if ($errno = \json_last_error()) {
self::handleJsonError($errno);
} elseif ($json === 'null') {
diff --git a/lib/Google/vendor/google/apiclient-services/README.md b/lib/Google/vendor/google/apiclient-services/README.md
index b0bb0df27..8dcf29603 100644
--- a/lib/Google/vendor/google/apiclient-services/README.md
+++ b/lib/Google/vendor/google/apiclient-services/README.md
@@ -1,6 +1,8 @@
Google PHP API Client Services
==============================
+[Reference Documentation](https://googleapis.github.io/google-api-php-client-services)
+
**NOTE**: please check to see if the package you'd like to install is available in our
list of [Google cloud packages](https://cloud.google.com/php/docs/reference) first, as
these are the recommended libraries.
@@ -12,6 +14,6 @@ these are the recommended libraries.
## Usage
This library is automatically updated daily with new API changes, and tagged weekly.
-It is installed as part of the
+It is installed as part of the
[Google API PHP Client](https://github.com/googleapis/google-api-php-client/releases)
library via Composer, which will pull down the most recent tag.
diff --git a/lib/Google/vendor/google/apiclient-services/src/Storage.php b/lib/Google/vendor/google/apiclient-services/src/Storage.php
index 4efde3e30..38cedc75e 100644
--- a/lib/Google/vendor/google/apiclient-services/src/Storage.php
+++ b/lib/Google/vendor/google/apiclient-services/src/Storage.php
@@ -346,6 +346,10 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
'type' => 'string',
'required' => true,
],
+ 'generation' => [
+ 'location' => 'query',
+ 'type' => 'string',
+ ],
'ifMetagenerationMatch' => [
'location' => 'query',
'type' => 'string',
@@ -358,6 +362,10 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
'location' => 'query',
'type' => 'string',
],
+ 'softDeleted' => [
+ 'location' => 'query',
+ 'type' => 'boolean',
+ ],
'userProject' => [
'location' => 'query',
'type' => 'string',
@@ -450,6 +458,10 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
'location' => 'query',
'type' => 'string',
],
+ 'softDeleted' => [
+ 'location' => 'query',
+ 'type' => 'boolean',
+ ],
'userProject' => [
'location' => 'query',
'type' => 'string',
@@ -508,6 +520,39 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
'type' => 'string',
],
],
+ ],'relocate' => [
+ 'path' => 'b/{bucket}/relocate',
+ 'httpMethod' => 'POST',
+ 'parameters' => [
+ 'bucket' => [
+ 'location' => 'path',
+ 'type' => 'string',
+ 'required' => true,
+ ],
+ ],
+ ],'restore' => [
+ 'path' => 'b/{bucket}/restore',
+ 'httpMethod' => 'POST',
+ 'parameters' => [
+ 'bucket' => [
+ 'location' => 'path',
+ 'type' => 'string',
+ 'required' => true,
+ ],
+ 'generation' => [
+ 'location' => 'query',
+ 'type' => 'string',
+ 'required' => true,
+ ],
+ 'projection' => [
+ 'location' => 'query',
+ 'type' => 'string',
+ ],
+ 'userProject' => [
+ 'location' => 'query',
+ 'type' => 'string',
+ ],
+ ],
],'setIamPolicy' => [
'path' => 'b/{bucket}/iam',
'httpMethod' => 'PUT',
@@ -1456,6 +1501,10 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
'location' => 'query',
'type' => 'string',
],
+ 'restoreToken' => [
+ 'location' => 'query',
+ 'type' => 'string',
+ ],
'softDeleted' => [
'location' => 'query',
'type' => 'boolean',
@@ -1600,6 +1649,62 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
'type' => 'boolean',
],
],
+ ],'move' => [
+ 'path' => 'b/{bucket}/o/{sourceObject}/moveTo/o/{destinationObject}',
+ 'httpMethod' => 'POST',
+ 'parameters' => [
+ 'bucket' => [
+ 'location' => 'path',
+ 'type' => 'string',
+ 'required' => true,
+ ],
+ 'sourceObject' => [
+ 'location' => 'path',
+ 'type' => 'string',
+ 'required' => true,
+ ],
+ 'destinationObject' => [
+ 'location' => 'path',
+ 'type' => 'string',
+ 'required' => true,
+ ],
+ 'ifGenerationMatch' => [
+ 'location' => 'query',
+ 'type' => 'string',
+ ],
+ 'ifGenerationNotMatch' => [
+ 'location' => 'query',
+ 'type' => 'string',
+ ],
+ 'ifMetagenerationMatch' => [
+ 'location' => 'query',
+ 'type' => 'string',
+ ],
+ 'ifMetagenerationNotMatch' => [
+ 'location' => 'query',
+ 'type' => 'string',
+ ],
+ 'ifSourceGenerationMatch' => [
+ 'location' => 'query',
+ 'type' => 'string',
+ ],
+ 'ifSourceGenerationNotMatch' => [
+ 'location' => 'query',
+ 'type' => 'string',
+ ],
+ 'ifSourceMetagenerationMatch' => [
+ 'location' => 'query',
+ 'type' => 'string',
+ ],
+ 'ifSourceMetagenerationNotMatch' => [
+ 'location' => 'query',
+ 'type' => 'string',
+ ],
+ 'userProject' => [
+ 'location' => 'query',
+ 'type' => 'string',
+ ],
+ ],
],'patch' => [
'path' => 'b/{bucket}/o/{object}',
'httpMethod' => 'PATCH',
@@ -1694,6 +1799,10 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
'location' => 'query',
'type' => 'string',
],
+ 'restoreToken' => [
+ 'location' => 'query',
+ 'type' => 'string',
+ ],
'userProject' => [
'location' => 'query',
'type' => 'string',
@@ -1947,7 +2056,22 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
'operations',
[
'methods' => [
- 'cancel' => [
+ 'advanceRelocateBucket' => [
+ 'path' => 'b/{bucket}/operations/{operationId}/advanceRelocateBucket',
+ 'httpMethod' => 'POST',
+ 'parameters' => [
+ 'bucket' => [
+ 'location' => 'path',
+ 'type' => 'string',
+ 'required' => true,
+ ],
+ 'operationId' => [
+ 'location' => 'path',
+ 'type' => 'string',
+ 'required' => true,
+ ],
+ ],
+ ],'cancel' => [
'path' => 'b/{bucket}/operations/{operationId}/cancel',
'httpMethod' => 'POST',
'parameters' => [
diff --git a/lib/Google/vendor/google/apiclient-services/src/Storage/AdvanceRelocateBucketOperationRequest.php b/lib/Google/vendor/google/apiclient-services/src/Storage/AdvanceRelocateBucketOperationRequest.php
new file mode 100644
index 000000000..ce4bcfae2
--- /dev/null
+++ b/lib/Google/vendor/google/apiclient-services/src/Storage/AdvanceRelocateBucketOperationRequest.php
@@ -0,0 +1,62 @@
+expireTime = $expireTime;
+ }
+ /**
+ * @return string
+ */
+ public function getExpireTime()
+ {
+ return $this->expireTime;
+ }
+ /**
+ * @param string
+ */
+ public function setTtl($ttl)
+ {
+ $this->ttl = $ttl;
+ }
+ /**
+ * @return string
+ */
+ public function getTtl()
+ {
+ return $this->ttl;
+ }
+}
+
+// Adding a class alias for backwards compatibility with the previous class name.
+class_alias(AdvanceRelocateBucketOperationRequest::class, 'Google_Service_Storage_AdvanceRelocateBucketOperationRequest');
diff --git a/lib/Google/vendor/google/apiclient-services/src/Storage/Bucket.php b/lib/Google/vendor/google/apiclient-services/src/Storage/Bucket.php
index 690ce0694..374eeee79 100644
--- a/lib/Google/vendor/google/apiclient-services/src/Storage/Bucket.php
+++ b/lib/Google/vendor/google/apiclient-services/src/Storage/Bucket.php
@@ -42,6 +42,14 @@ class Bucket extends \Google\Collection
* @var string
*/
public $etag;
+ /**
+ * @var string
+ */
+ public $generation;
+ /**
+ * @var string
+ */
+ public $hardDeleteTime;
protected $hierarchicalNamespaceType = BucketHierarchicalNamespace::class;
protected $hierarchicalNamespaceDataType = '';
protected $iamConfigurationType = BucketIamConfiguration::class;
@@ -50,6 +58,8 @@ class Bucket extends \Google\Collection
* @var string
*/
public $id;
+ protected $ipFilterType = BucketIpFilter::class;
+ protected $ipFilterDataType = '';
/**
* @var string
*/
@@ -92,6 +102,10 @@ class Bucket extends \Google\Collection
* @var string
*/
public $rpo;
+ /**
+ * @var bool
+ */
+ public $satisfiesPZI;
/**
* @var bool
*/
@@ -102,6 +116,10 @@ class Bucket extends \Google\Collection
public $selfLink;
protected $softDeletePolicyType = BucketSoftDeletePolicy::class;
protected $softDeletePolicyDataType = '';
+ /**
+ * @var string
+ */
+ public $softDeleteTime;
/**
* @var string
*/
@@ -245,6 +263,34 @@ public function getEtag()
{
return $this->etag;
}
+ /**
+ * @param string
+ */
+ public function setGeneration($generation)
+ {
+ $this->generation = $generation;
+ }
+ /**
+ * @return string
+ */
+ public function getGeneration()
+ {
+ return $this->generation;
+ }
+ /**
+ * @param string
+ */
+ public function setHardDeleteTime($hardDeleteTime)
+ {
+ $this->hardDeleteTime = $hardDeleteTime;
+ }
+ /**
+ * @return string
+ */
+ public function getHardDeleteTime()
+ {
+ return $this->hardDeleteTime;
+ }
/**
* @param BucketHierarchicalNamespace
*/
@@ -287,6 +333,20 @@ public function getId()
{
return $this->id;
}
+ /**
+ * @param BucketIpFilter
+ */
+ public function setIpFilter(BucketIpFilter $ipFilter)
+ {
+ $this->ipFilter = $ipFilter;
+ }
+ /**
+ * @return BucketIpFilter
+ */
+ public function getIpFilter()
+ {
+ return $this->ipFilter;
+ }
/**
* @param string
*/
@@ -469,6 +529,20 @@ public function getRpo()
{
return $this->rpo;
}
+ /**
+ * @param bool
+ */
+ public function setSatisfiesPZI($satisfiesPZI)
+ {
+ $this->satisfiesPZI = $satisfiesPZI;
+ }
+ /**
+ * @return bool
+ */
+ public function getSatisfiesPZI()
+ {
+ return $this->satisfiesPZI;
+ }
/**
* @param bool
*/
@@ -511,6 +585,20 @@ public function getSoftDeletePolicy()
{
return $this->softDeletePolicy;
}
+ /**
+ * @param string
+ */
+ public function setSoftDeleteTime($softDeleteTime)
+ {
+ $this->softDeleteTime = $softDeleteTime;
+ }
+ /**
+ * @return string
+ */
+ public function getSoftDeleteTime()
+ {
+ return $this->softDeleteTime;
+ }
/**
* @param string
*/
diff --git a/lib/Google/vendor/google/apiclient-services/src/Storage/BucketIpFilter.php b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketIpFilter.php
new file mode 100644
index 000000000..8528a0550
--- /dev/null
+++ b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketIpFilter.php
@@ -0,0 +1,77 @@
+mode = $mode;
+ }
+ /**
+ * @return string
+ */
+ public function getMode()
+ {
+ return $this->mode;
+ }
+ /**
+ * @param BucketIpFilterPublicNetworkSource
+ */
+ public function setPublicNetworkSource(BucketIpFilterPublicNetworkSource $publicNetworkSource)
+ {
+ $this->publicNetworkSource = $publicNetworkSource;
+ }
+ /**
+ * @return BucketIpFilterPublicNetworkSource
+ */
+ public function getPublicNetworkSource()
+ {
+ return $this->publicNetworkSource;
+ }
+ /**
+ * @param BucketIpFilterVpcNetworkSources[]
+ */
+ public function setVpcNetworkSources($vpcNetworkSources)
+ {
+ $this->vpcNetworkSources = $vpcNetworkSources;
+ }
+ /**
+ * @return BucketIpFilterVpcNetworkSources[]
+ */
+ public function getVpcNetworkSources()
+ {
+ return $this->vpcNetworkSources;
+ }
+}
+
+// Adding a class alias for backwards compatibility with the previous class name.
+class_alias(BucketIpFilter::class, 'Google_Service_Storage_BucketIpFilter');
diff --git a/lib/Google/vendor/google/apiclient-services/src/Storage/BucketIpFilterPublicNetworkSource.php b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketIpFilterPublicNetworkSource.php
new file mode 100644
index 000000000..f217d816d
--- /dev/null
+++ b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketIpFilterPublicNetworkSource.php
@@ -0,0 +1,45 @@
+allowedIpCidrRanges = $allowedIpCidrRanges;
+ }
+ /**
+ * @return string[]
+ */
+ public function getAllowedIpCidrRanges()
+ {
+ return $this->allowedIpCidrRanges;
+ }
+}
+
+// Adding a class alias for backwards compatibility with the previous class name.
+class_alias(BucketIpFilterPublicNetworkSource::class, 'Google_Service_Storage_BucketIpFilterPublicNetworkSource');
diff --git a/lib/Google/vendor/google/apiclient-services/src/Storage/BucketIpFilterVpcNetworkSources.php b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketIpFilterVpcNetworkSources.php
new file mode 100644
index 000000000..6521e666d
--- /dev/null
+++ b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketIpFilterVpcNetworkSources.php
@@ -0,0 +1,63 @@
+allowedIpCidrRanges = $allowedIpCidrRanges;
+ }
+ /**
+ * @return string[]
+ */
+ public function getAllowedIpCidrRanges()
+ {
+ return $this->allowedIpCidrRanges;
+ }
+ /**
+ * @param string
+ */
+ public function setNetwork($network)
+ {
+ $this->network = $network;
+ }
+ /**
+ * @return string
+ */
+ public function getNetwork()
+ {
+ return $this->network;
+ }
+}
+
+// Adding a class alias for backwards compatibility with the previous class name.
+class_alias(BucketIpFilterVpcNetworkSources::class, 'Google_Service_Storage_BucketIpFilterVpcNetworkSources');
diff --git a/lib/Google/vendor/google/apiclient-services/src/Storage/RelocateBucketRequest.php b/lib/Google/vendor/google/apiclient-services/src/Storage/RelocateBucketRequest.php
new file mode 100644
index 000000000..257afce4d
--- /dev/null
+++ b/lib/Google/vendor/google/apiclient-services/src/Storage/RelocateBucketRequest.php
@@ -0,0 +1,78 @@
+destinationCustomPlacementConfig = $destinationCustomPlacementConfig;
+ }
+ /**
+ * @return RelocateBucketRequestDestinationCustomPlacementConfig
+ */
+ public function getDestinationCustomPlacementConfig()
+ {
+ return $this->destinationCustomPlacementConfig;
+ }
+ /**
+ * @param string
+ */
+ public function setDestinationLocation($destinationLocation)
+ {
+ $this->destinationLocation = $destinationLocation;
+ }
+ /**
+ * @return string
+ */
+ public function getDestinationLocation()
+ {
+ return $this->destinationLocation;
+ }
+ /**
+ * @param bool
+ */
+ public function setValidateOnly($validateOnly)
+ {
+ $this->validateOnly = $validateOnly;
+ }
+ /**
+ * @return bool
+ */
+ public function getValidateOnly()
+ {
+ return $this->validateOnly;
+ }
+}
+
+// Adding a class alias for backwards compatibility with the previous class name.
+class_alias(RelocateBucketRequest::class, 'Google_Service_Storage_RelocateBucketRequest');
diff --git a/lib/Google/vendor/google/apiclient-services/src/Storage/RelocateBucketRequestDestinationCustomPlacementConfig.php b/lib/Google/vendor/google/apiclient-services/src/Storage/RelocateBucketRequestDestinationCustomPlacementConfig.php
new file mode 100644
index 000000000..a68be2988
--- /dev/null
+++ b/lib/Google/vendor/google/apiclient-services/src/Storage/RelocateBucketRequestDestinationCustomPlacementConfig.php
@@ -0,0 +1,45 @@
+dataLocations = $dataLocations;
+ }
+ /**
+ * @return string[]
+ */
+ public function getDataLocations()
+ {
+ return $this->dataLocations;
+ }
+}
+
+// Adding a class alias for backwards compatibility with the previous class name.
+class_alias(RelocateBucketRequestDestinationCustomPlacementConfig::class, 'Google_Service_Storage_RelocateBucketRequestDestinationCustomPlacementConfig');
diff --git a/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Buckets.php b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Buckets.php
index 453ea479d..3816df7c5 100644
--- a/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Buckets.php
+++ b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Buckets.php
@@ -20,7 +20,9 @@
use Google\Service\Storage\Bucket;
use Google\Service\Storage\BucketStorageLayout;
use Google\Service\Storage\Buckets as BucketsModel;
+use Google\Service\Storage\GoogleLongrunningOperation;
use Google\Service\Storage\Policy;
+use Google\Service\Storage\RelocateBucketRequest;
use Google\Service\Storage\TestIamPermissionsResponse;
/**
@@ -34,7 +36,8 @@
class Buckets extends \Google\Service\Resource
{
/**
- * Permanently deletes an empty bucket. (buckets.delete)
+ * Deletes an empty bucket. Deletions are permanent unless soft delete is
+ * enabled on the bucket. (buckets.delete)
*
* @param string $bucket Name of a bucket.
* @param array $optParams Optional parameters.
@@ -59,6 +62,8 @@ public function delete($bucket, $optParams = [])
* @param string $bucket Name of a bucket.
* @param array $optParams Optional parameters.
*
+ * @opt_param string generation If present, specifies the generation of the
+ * bucket. This is required if softDeleted is true.
* @opt_param string ifMetagenerationMatch Makes the return of the bucket
* metadata conditional on whether the bucket's current metageneration matches
* the given value.
@@ -66,6 +71,9 @@ public function delete($bucket, $optParams = [])
* metadata conditional on whether the bucket's current metageneration does not
* match the given value.
* @opt_param string projection Set of properties to return. Defaults to noAcl.
+ * @opt_param bool softDeleted If true, return the soft-deleted version of this
+ * bucket. The default is false. For more information, see [Soft
+ * Delete](https://cloud.google.com/storage/docs/soft-delete).
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return Bucket
@@ -157,6 +165,9 @@ public function insert($project, Bucket $postBody, $optParams = [])
* @opt_param string prefix Filter results to buckets whose names begin with
* this prefix.
* @opt_param string projection Set of properties to return. Defaults to noAcl.
+ * @opt_param bool softDeleted If true, only soft-deleted bucket versions will
+ * be returned. The default is false. For more information, see [Soft
+ * Delete](https://cloud.google.com/storage/docs/soft-delete).
* @opt_param string userProject The project to be billed for this request.
* @return BucketsModel
* @throws \Google\Service\Exception
@@ -217,6 +228,41 @@ public function patch($bucket, Bucket $postBody, $optParams = [])
$params = array_merge($params, $optParams);
return $this->call('patch', [$params], Bucket::class);
}
+ /**
+ * Initiates a long-running Relocate Bucket operation on the specified bucket.
+ * (buckets.relocate)
+ *
+ * @param string $bucket Name of the bucket to be moved.
+ * @param RelocateBucketRequest $postBody
+ * @param array $optParams Optional parameters.
+ * @return GoogleLongrunningOperation
+ * @throws \Google\Service\Exception
+ */
+ public function relocate($bucket, RelocateBucketRequest $postBody, $optParams = [])
+ {
+ $params = ['bucket' => $bucket, 'postBody' => $postBody];
+ $params = array_merge($params, $optParams);
+ return $this->call('relocate', [$params], GoogleLongrunningOperation::class);
+ }
+ /**
+ * Restores a soft-deleted bucket. (buckets.restore)
+ *
+ * @param string $bucket Name of a bucket.
+ * @param string $generation Generation of a bucket.
+ * @param array $optParams Optional parameters.
+ *
+ * @opt_param string projection Set of properties to return. Defaults to full.
+ * @opt_param string userProject The project to be billed for this request.
+ * Required for Requester Pays buckets.
+ * @return Bucket
+ * @throws \Google\Service\Exception
+ */
+ public function restore($bucket, $generation, $optParams = [])
+ {
+ $params = ['bucket' => $bucket, 'generation' => $generation];
+ $params = array_merge($params, $optParams);
+ return $this->call('restore', [$params], Bucket::class);
+ }
/**
* Updates an IAM policy for the specified bucket. (buckets.setIamPolicy)
*
diff --git a/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Objects.php b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Objects.php
index 9c1c5b5ce..725c488ad 100644
--- a/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Objects.php
+++ b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Objects.php
@@ -211,8 +211,14 @@ public function delete($bucket, $object, $optParams = [])
* @opt_param string ifMetagenerationNotMatch Makes the operation conditional on
* whether the object's current metageneration does not match the given value.
* @opt_param string projection Set of properties to return. Defaults to noAcl.
+ * @opt_param string restoreToken Restore token used to differentiate soft-
+ * deleted objects with the same name and generation. Only applicable for
+ * hierarchical namespace buckets and if softDeleted is set to true. This
+ * parameter is optional, and is only required in the rare case when there are
+ * multiple soft-deleted objects with the same name and generation.
* @opt_param bool softDeleted If true, only soft-deleted object versions will
- * be listed. The default is false. For more information, see Soft Delete.
+ * be listed. The default is false. For more information, see [Soft
+ * Delete](https://cloud.google.com/storage/docs/soft-delete).
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return StorageObject
@@ -328,7 +334,8 @@ public function insert($bucket, StorageObject $postBody, $optParams = [])
* this prefix.
* @opt_param string projection Set of properties to return. Defaults to noAcl.
* @opt_param bool softDeleted If true, only soft-deleted object versions will
- * be listed. The default is false. For more information, see Soft Delete.
+ * be listed. The default is false. For more information, see [Soft
+ * Delete](https://cloud.google.com/storage/docs/soft-delete).
* @opt_param string startOffset Filter results to objects whose names are
* lexicographically equal to or after startOffset. If endOffset is also set,
* the objects listed will have names between startOffset (inclusive) and
@@ -336,7 +343,8 @@ public function insert($bucket, StorageObject $postBody, $optParams = [])
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @opt_param bool versions If true, lists all versions of an object as distinct
- * results. The default is false. For more information, see Object Versioning.
+ * results. The default is false. For more information, see [Object
+ * Versioning](https://cloud.google.com/storage/docs/object-versioning).
* @return ObjectsModel
* @throws \Google\Service\Exception
*/
@@ -346,6 +354,70 @@ public function listObjects($bucket, $optParams = [])
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ObjectsModel::class);
}
+ /**
+ * Moves the source object to the destination object in the same bucket.
+ * (objects.move)
+ *
+ * @param string $bucket Name of the bucket in which the object resides.
+ * @param string $sourceObject Name of the source object. For information about
+ * how to URL encode object names to be path safe, see [Encoding URI Path
+ * Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
+ * @param string $destinationObject Name of the destination object. For
+ * information about how to URL encode object names to be path safe, see
+ * [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-
+ * endpoints#encoding).
+ * @param array $optParams Optional parameters.
+ *
+ * @opt_param string ifGenerationMatch Makes the operation conditional on
+ * whether the destination object's current generation matches the given value.
+ * Setting to 0 makes the operation succeed only if there are no live versions
+ * of the object. `ifGenerationMatch` and `ifGenerationNotMatch` conditions are
+ * mutually exclusive: it's an error for both of them to be set in the request.
+ * @opt_param string ifGenerationNotMatch Makes the operation conditional on
+ * whether the destination object's current generation does not match the given
+ * value. If no live object exists, the precondition fails. Setting to 0 makes
+ * the operation succeed only if there is a live version of the
+ * object.`ifGenerationMatch` and `ifGenerationNotMatch` conditions are mutually
+ * exclusive: it's an error for both of them to be set in the request.
+ * @opt_param string ifMetagenerationMatch Makes the operation conditional on
+ * whether the destination object's current metageneration matches the given
+ * value. `ifMetagenerationMatch` and `ifMetagenerationNotMatch` conditions are
+ * mutually exclusive: it's an error for both of them to be set in the request.
+ * @opt_param string ifMetagenerationNotMatch Makes the operation conditional on
+ * whether the destination object's current metageneration does not match the
+ * given value. `ifMetagenerationMatch` and `ifMetagenerationNotMatch`
+ * conditions are mutually exclusive: it's an error for both of them to be set
+ * in the request.
+ * @opt_param string ifSourceGenerationMatch Makes the operation conditional on
+ * whether the source object's current generation matches the given value.
+ * `ifSourceGenerationMatch` and `ifSourceGenerationNotMatch` conditions are
+ * mutually exclusive: it's an error for both of them to be set in the request.
+ * @opt_param string ifSourceGenerationNotMatch Makes the operation conditional
+ * on whether the source object's current generation does not match the given
+ * value. `ifSourceGenerationMatch` and `ifSourceGenerationNotMatch` conditions
+ * are mutually exclusive: it's an error for both of them to be set in the
+ * request.
+ * @opt_param string ifSourceMetagenerationMatch Makes the operation conditional
+ * on whether the source object's current metageneration matches the given
+ * value. `ifSourceMetagenerationMatch` and `ifSourceMetagenerationNotMatch`
+ * conditions are mutually exclusive: it's an error for both of them to be set
+ * in the request.
+ * @opt_param string ifSourceMetagenerationNotMatch Makes the operation
+ * conditional on whether the source object's current metageneration does not
+ * match the given value. `ifSourceMetagenerationMatch` and
+ * `ifSourceMetagenerationNotMatch` conditions are mutually exclusive: it's an
+ * error for both of them to be set in the request.
+ * @opt_param string userProject The project to be billed for this request.
+ * Required for Requester Pays buckets.
+ * @return StorageObject
+ * @throws \Google\Service\Exception
+ */
+ public function move($bucket, $sourceObject, $destinationObject, $optParams = [])
+ {
+ $params = ['bucket' => $bucket, 'sourceObject' => $sourceObject, 'destinationObject' => $destinationObject];
+ $params = array_merge($params, $optParams);
+ return $this->call('move', [$params], StorageObject::class);
+ }
/**
* Patches an object's metadata. (objects.patch)
*
@@ -391,7 +463,8 @@ public function patch($bucket, $object, StorageObject $postBody, $optParams = []
*
* @param string $bucket Name of the bucket in which the object resides.
* @param string $object Name of the object. For information about how to URL
- * encode object names to be path safe, see Encoding URI Path Parts.
+ * encode object names to be path safe, see [Encoding URI Path
+ * Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
* @param string $generation Selects a specific revision of this object.
* @param array $optParams Optional parameters.
*
@@ -410,6 +483,11 @@ public function patch($bucket, $object, StorageObject $postBody, $optParams = []
* @opt_param string ifMetagenerationNotMatch Makes the operation conditional on
* whether none of the object's live metagenerations match the given value.
* @opt_param string projection Set of properties to return. Defaults to full.
+ * @opt_param string restoreToken Restore token used to differentiate sof-
+ * deleted objects with the same name and generation. Only applicable for
+ * hierarchical namespace buckets. This parameter is optional, and is only
+ * required in the rare case when there are multiple soft-deleted objects with
+ * the same name and generation.
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @return StorageObject
@@ -620,7 +698,8 @@ public function update($bucket, $object, StorageObject $postBody, $optParams = [
* @opt_param string userProject The project to be billed for this request.
* Required for Requester Pays buckets.
* @opt_param bool versions If true, lists all versions of an object as distinct
- * results. The default is false. For more information, see Object Versioning.
+ * results. The default is false. For more information, see [Object
+ * Versioning](https://cloud.google.com/storage/docs/object-versioning).
* @return Channel
* @throws \Google\Service\Exception
*/
diff --git a/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Operations.php b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Operations.php
index 6d473ab66..f4d5616fb 100644
--- a/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Operations.php
+++ b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Operations.php
@@ -17,6 +17,7 @@
namespace Google\Service\Storage\Resource;
+use Google\Service\Storage\AdvanceRelocateBucketOperationRequest;
use Google\Service\Storage\GoogleLongrunningListOperationsResponse;
use Google\Service\Storage\GoogleLongrunningOperation;
@@ -30,6 +31,25 @@
*/
class Operations extends \Google\Service\Resource
{
+ /**
+ * Starts asynchronous advancement of the relocate bucket operation in the case
+ * of required write downtime, to allow it to lock the bucket at the source
+ * location, and proceed with the bucket location swap. The server makes a best
+ * effort to advance the relocate bucket operation, but success is not
+ * guaranteed. (operations.advanceRelocateBucket)
+ *
+ * @param string $bucket Name of the bucket to advance the relocate for.
+ * @param string $operationId ID of the operation resource.
+ * @param AdvanceRelocateBucketOperationRequest $postBody
+ * @param array $optParams Optional parameters.
+ * @throws \Google\Service\Exception
+ */
+ public function advanceRelocateBucket($bucket, $operationId, AdvanceRelocateBucketOperationRequest $postBody, $optParams = [])
+ {
+ $params = ['bucket' => $bucket, 'operationId' => $operationId, 'postBody' => $postBody];
+ $params = array_merge($params, $optParams);
+ return $this->call('advanceRelocateBucket', [$params]);
+ }
/**
* Starts asynchronous cancellation on a long-running operation. The server
* makes a best effort to cancel the operation, but success is not guaranteed.
diff --git a/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/ProjectsHmacKeys.php b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/ProjectsHmacKeys.php
index 18c94e69c..9ecaae0ff 100644
--- a/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/ProjectsHmacKeys.php
+++ b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/ProjectsHmacKeys.php
@@ -112,8 +112,9 @@ public function listProjectsHmacKeys($projectId, $optParams = [])
return $this->call('list', [$params], HmacKeysMetadata::class);
}
/**
- * Updates the state of an HMAC key. See the HMAC Key resource descriptor for
- * valid states. (hmacKeys.update)
+ * Updates the state of an HMAC key. See the [HMAC Key resource descriptor](http
+ * s://cloud.google.com/storage/docs/json_api/v1/projects/hmacKeys/update#reques
+ * t-body) for valid states. (hmacKeys.update)
*
* @param string $projectId Project ID owning the service account of the updated
* key.
diff --git a/lib/Google/vendor/google/apiclient-services/src/Storage/StorageObject.php b/lib/Google/vendor/google/apiclient-services/src/Storage/StorageObject.php
index cb666b2ae..8f4b75b0d 100644
--- a/lib/Google/vendor/google/apiclient-services/src/Storage/StorageObject.php
+++ b/lib/Google/vendor/google/apiclient-services/src/Storage/StorageObject.php
@@ -110,6 +110,10 @@ class StorageObject extends \Google\Collection
public $name;
protected $ownerType = StorageObjectOwner::class;
protected $ownerDataType = '';
+ /**
+ * @var string
+ */
+ public $restoreToken;
protected $retentionType = StorageObjectRetention::class;
protected $retentionDataType = '';
/**
@@ -144,6 +148,10 @@ class StorageObject extends \Google\Collection
* @var string
*/
public $timeDeleted;
+ /**
+ * @var string
+ */
+ public $timeFinalized;
/**
* @var string
*/
@@ -489,6 +497,20 @@ public function getOwner()
{
return $this->owner;
}
+ /**
+ * @param string
+ */
+ public function setRestoreToken($restoreToken)
+ {
+ $this->restoreToken = $restoreToken;
+ }
+ /**
+ * @return string
+ */
+ public function getRestoreToken()
+ {
+ return $this->restoreToken;
+ }
/**
* @param StorageObjectRetention
*/
@@ -615,6 +637,20 @@ public function getTimeDeleted()
{
return $this->timeDeleted;
}
+ /**
+ * @param string
+ */
+ public function setTimeFinalized($timeFinalized)
+ {
+ $this->timeFinalized = $timeFinalized;
+ }
+ /**
+ * @return string
+ */
+ public function getTimeFinalized()
+ {
+ return $this->timeFinalized;
+ }
/**
* @param string
*/
diff --git a/lib/Google/vendor/google/auth/README.md b/lib/Google/vendor/google/auth/README.md
index eac25a236..ce23622af 100644
--- a/lib/Google/vendor/google/auth/README.md
+++ b/lib/Google/vendor/google/auth/README.md
@@ -282,6 +282,58 @@ $auth->verify($idToken, [
[google-id-tokens]: https://developers.google.com/identity/sign-in/web/backend-auth
[iap-id-tokens]: https://cloud.google.com/iap/docs/signed-headers-howto
+## Caching
+Caching is enabled by passing a PSR-6 `CacheItemPoolInterface`
+instance to the constructor when instantiating the credentials.
+
+We offer some caching classes out of the box under the `Google\Auth\Cache` namespace.
+
+```php
+use Google\Auth\ApplicationDefaultCredentials;
+use Google\Auth\Cache\MemoryCacheItemPool;
+
+// Cache Instance
+$memoryCache = new MemoryCacheItemPool;
+
+// Get the credentials
+// From here, the credentials will cache the access token
+$middleware = ApplicationDefaultCredentials::getCredentials($scope, cache: $memoryCache);
+```
+
+### FileSystemCacheItemPool Cache
+The `FileSystemCacheItemPool` class is a `PSR-6` compliant cache that stores its
+serialized objects on disk, caching data between processes and making it possible
+to use data between different requests.
+
+```php
+use Google\Auth\Cache\FileSystemCacheItemPool;
+use Google\Auth\ApplicationDefaultCredentials;
+
+// Create a Cache pool instance
+$cache = new FileSystemCacheItemPool(__DIR__ . '/cache');
+
+// Pass your Cache to the Auth Library
+$credentials = ApplicationDefaultCredentials::getCredentials($scope, cache: $cache);
+
+// This token will be cached and be able to be used for the next request
+$token = $credentials->fetchAuthToken();
+```
+
+### Integrating with a third party cache
+You can use a third party that follows the `PSR-6` interface of your choice.
+
+```php
+// run "composer require symfony/cache"
+use Google\Auth\ApplicationDefaultCredentials;
+use Symfony\Component\Cache\Adapter\FilesystemAdapter;
+
+// Create the cache instance
+$filesystemCache = new FilesystemAdapter();
+
+// Create Get the credentials
+$credentials = ApplicationDefaultCredentials::getCredentials($targetAudience, cache: $filesystemCache);
+```
+
## License
This library is licensed under Apache 2.0. Full license text is
diff --git a/lib/Google/vendor/google/auth/VERSION b/lib/Google/vendor/google/auth/VERSION
index 32b7211cb..50aceaa7b 100644
--- a/lib/Google/vendor/google/auth/VERSION
+++ b/lib/Google/vendor/google/auth/VERSION
@@ -1 +1 @@
-1.40.0
+1.45.0
diff --git a/lib/Google/vendor/google/auth/composer.json b/lib/Google/vendor/google/auth/composer.json
index 41a1d0532..33428c5fa 100644
--- a/lib/Google/vendor/google/auth/composer.json
+++ b/lib/Google/vendor/google/auth/composer.json
@@ -14,7 +14,8 @@
"guzzlehttp/guzzle": "^7.4.5",
"guzzlehttp/psr7": "^2.4.5",
"psr/http-message": "^1.1||^2.0",
- "psr/cache": "^2.0||^3.0"
+ "psr/cache": "^2.0||^3.0",
+ "psr/log": "^3.0"
},
"require-dev": {
"guzzlehttp/promises": "^2.0",
diff --git a/lib/Google/vendor/google/auth/src/AccessToken.php b/lib/Google/vendor/google/auth/src/AccessToken.php
index 630b27961..9e27b692e 100644
--- a/lib/Google/vendor/google/auth/src/AccessToken.php
+++ b/lib/Google/vendor/google/auth/src/AccessToken.php
@@ -65,12 +65,12 @@ class AccessToken
private $cache;
/**
- * @param callable $httpHandler [optional] An HTTP Handler to deliver PSR-7 requests.
- * @param CacheItemPoolInterface $cache [optional] A PSR-6 compatible cache implementation.
+ * @param callable|null $httpHandler [optional] An HTTP Handler to deliver PSR-7 requests.
+ * @param CacheItemPoolInterface|null $cache [optional] A PSR-6 compatible cache implementation.
*/
public function __construct(
- callable $httpHandler = null,
- CacheItemPoolInterface $cache = null
+ ?callable $httpHandler = null,
+ ?CacheItemPoolInterface $cache = null
) {
$this->httpHandler = $httpHandler
?: HttpHandlerFactory::build(HttpClientCache::getHttpClient());
diff --git a/lib/Google/vendor/google/auth/src/ApplicationDefaultCredentials.php b/lib/Google/vendor/google/auth/src/ApplicationDefaultCredentials.php
index 80437c8c9..39107c790 100644
--- a/lib/Google/vendor/google/auth/src/ApplicationDefaultCredentials.php
+++ b/lib/Google/vendor/google/auth/src/ApplicationDefaultCredentials.php
@@ -21,14 +21,17 @@
use Google\Auth\Credentials\AppIdentityCredentials;
use Google\Auth\Credentials\GCECredentials;
use Google\Auth\Credentials\ServiceAccountCredentials;
+use Google\Auth\Credentials\UserRefreshCredentials;
use Google\Auth\HttpHandler\HttpClientCache;
use Google\Auth\HttpHandler\HttpHandlerFactory;
+use Google\Auth\Logging\StdOutLogger;
use Google\Auth\Middleware\AuthTokenMiddleware;
use Google\Auth\Middleware\ProxyAuthTokenMiddleware;
use Google\Auth\Subscriber\AuthTokenSubscriber;
use GuzzleHttp\Client;
use InvalidArgumentException;
use Psr\Cache\CacheItemPoolInterface;
+use Psr\Log\LoggerInterface;
/**
* ApplicationDefaultCredentials obtains the default credentials for
@@ -69,6 +72,8 @@
*/
class ApplicationDefaultCredentials
{
+ private const SDK_DEBUG_ENV_VAR = 'GOOGLE_SDK_PHP_LOGGING';
+
/**
* @deprecated
*
@@ -80,18 +85,18 @@ class ApplicationDefaultCredentials
*
* @param string|string[] $scope the scope of the access request, expressed
* either as an Array or as a space-delimited String.
- * @param callable $httpHandler callback which delivers psr7 request
- * @param array $cacheConfig configuration for the cache when it's present
- * @param CacheItemPoolInterface $cache A cache implementation, may be
+ * @param callable|null $httpHandler callback which delivers psr7 request
+ * @param array|null $cacheConfig configuration for the cache when it's present
+ * @param CacheItemPoolInterface|null $cache A cache implementation, may be
* provided if you have one already available for use.
* @return AuthTokenSubscriber
* @throws DomainException if no implementation can be obtained.
*/
public static function getSubscriber(// @phpstan-ignore-line
$scope = null,
- callable $httpHandler = null,
- array $cacheConfig = null,
- CacheItemPoolInterface $cache = null
+ ?callable $httpHandler = null,
+ ?array $cacheConfig = null,
+ ?CacheItemPoolInterface $cache = null
) {
$creds = self::getCredentials($scope, $httpHandler, $cacheConfig, $cache);
@@ -108,9 +113,9 @@ public static function getSubscriber(// @phpstan-ignore-line
*
* @param string|string[] $scope the scope of the access request, expressed
* either as an Array or as a space-delimited String.
- * @param callable $httpHandler callback which delivers psr7 request
- * @param array $cacheConfig configuration for the cache when it's present
- * @param CacheItemPoolInterface $cache A cache implementation, may be
+ * @param callable|null $httpHandler callback which delivers psr7 request
+ * @param array|null $cacheConfig configuration for the cache when it's present
+ * @param CacheItemPoolInterface|null $cache A cache implementation, may be
* provided if you have one already available for use.
* @param string $quotaProject specifies a project to bill for access
* charges associated with the request.
@@ -119,9 +124,9 @@ public static function getSubscriber(// @phpstan-ignore-line
*/
public static function getMiddleware(
$scope = null,
- callable $httpHandler = null,
- array $cacheConfig = null,
- CacheItemPoolInterface $cache = null,
+ ?callable $httpHandler = null,
+ ?array $cacheConfig = null,
+ ?CacheItemPoolInterface $cache = null,
$quotaProject = null
) {
$creds = self::getCredentials($scope, $httpHandler, $cacheConfig, $cache, $quotaProject);
@@ -135,29 +140,31 @@ public static function getMiddleware(
*
* @param string|string[] $scope the scope of the access request, expressed
* either as an Array or as a space-delimited String.
- * @param callable $httpHandler callback which delivers psr7 request
- * @param array $cacheConfig configuration for the cache when it's present
- * @param CacheItemPoolInterface $cache A cache implementation, may be
+ * @param callable|null $httpHandler callback which delivers psr7 request
+ * @param array|null $cacheConfig configuration for the cache when it's present
+ * @param CacheItemPoolInterface|null $cache A cache implementation, may be
* provided if you have one already available for use.
- * @param string $quotaProject specifies a project to bill for access
+ * @param string|null $quotaProject specifies a project to bill for access
* charges associated with the request.
- * @param string|string[] $defaultScope The default scope to use if no
+ * @param string|string[]|null $defaultScope The default scope to use if no
* user-defined scopes exist, expressed either as an Array or as a
* space-delimited string.
- * @param string $universeDomain Specifies a universe domain to use for the
- * calling client library
+ * @param string|null $universeDomain Specifies a universe domain to use for the
+ * calling client library.
+ * @param null|false|LoggerInterface $logger A PSR3 compliant LoggerInterface.
*
* @return FetchAuthTokenInterface
* @throws DomainException if no implementation can be obtained.
*/
public static function getCredentials(
$scope = null,
- callable $httpHandler = null,
- array $cacheConfig = null,
- CacheItemPoolInterface $cache = null,
+ ?callable $httpHandler = null,
+ ?array $cacheConfig = null,
+ ?CacheItemPoolInterface $cache = null,
$quotaProject = null,
$defaultScope = null,
- string $universeDomain = null
+ ?string $universeDomain = null,
+ null|false|LoggerInterface $logger = null,
) {
$creds = null;
$jsonKey = CredentialsLoader::fromEnv()
@@ -170,7 +177,7 @@ public static function getCredentials(
HttpClientCache::setHttpClient($client);
}
- $httpHandler = HttpHandlerFactory::build($client);
+ $httpHandler = HttpHandlerFactory::build($client, $logger);
}
if (is_null($quotaProject)) {
@@ -215,18 +222,18 @@ public static function getCredentials(
* ID token.
*
* @param string $targetAudience The audience for the ID token.
- * @param callable $httpHandler callback which delivers psr7 request
- * @param array $cacheConfig configuration for the cache when it's present
- * @param CacheItemPoolInterface $cache A cache implementation, may be
+ * @param callable|null $httpHandler callback which delivers psr7 request
+ * @param array|null $cacheConfig configuration for the cache when it's present
+ * @param CacheItemPoolInterface|null $cache A cache implementation, may be
* provided if you have one already available for use.
* @return AuthTokenMiddleware
* @throws DomainException if no implementation can be obtained.
*/
public static function getIdTokenMiddleware(
$targetAudience,
- callable $httpHandler = null,
- array $cacheConfig = null,
- CacheItemPoolInterface $cache = null
+ ?callable $httpHandler = null,
+ ?array $cacheConfig = null,
+ ?CacheItemPoolInterface $cache = null
) {
$creds = self::getIdTokenCredentials($targetAudience, $httpHandler, $cacheConfig, $cache);
@@ -242,18 +249,18 @@ public static function getIdTokenMiddleware(
* ID token.
*
* @param string $targetAudience The audience for the ID token.
- * @param callable $httpHandler callback which delivers psr7 request
- * @param array $cacheConfig configuration for the cache when it's present
- * @param CacheItemPoolInterface $cache A cache implementation, may be
+ * @param callable|null $httpHandler callback which delivers psr7 request
+ * @param array|null $cacheConfig configuration for the cache when it's present
+ * @param CacheItemPoolInterface|null $cache A cache implementation, may be
* provided if you have one already available for use.
* @return ProxyAuthTokenMiddleware
* @throws DomainException if no implementation can be obtained.
*/
public static function getProxyIdTokenMiddleware(
$targetAudience,
- callable $httpHandler = null,
- array $cacheConfig = null,
- CacheItemPoolInterface $cache = null
+ ?callable $httpHandler = null,
+ ?array $cacheConfig = null,
+ ?CacheItemPoolInterface $cache = null
) {
$creds = self::getIdTokenCredentials($targetAudience, $httpHandler, $cacheConfig, $cache);
@@ -266,9 +273,9 @@ public static function getProxyIdTokenMiddleware(
* token.
*
* @param string $targetAudience The audience for the ID token.
- * @param callable $httpHandler callback which delivers psr7 request
- * @param array $cacheConfig configuration for the cache when it's present
- * @param CacheItemPoolInterface $cache A cache implementation, may be
+ * @param callable|null $httpHandler callback which delivers psr7 request
+ * @param array|null $cacheConfig configuration for the cache when it's present
+ * @param CacheItemPoolInterface|null $cache A cache implementation, may be
* provided if you have one already available for use.
* @return FetchAuthTokenInterface
* @throws DomainException if no implementation can be obtained.
@@ -276,9 +283,9 @@ public static function getProxyIdTokenMiddleware(
*/
public static function getIdTokenCredentials(
$targetAudience,
- callable $httpHandler = null,
- array $cacheConfig = null,
- CacheItemPoolInterface $cache = null
+ ?callable $httpHandler = null,
+ ?array $cacheConfig = null,
+ ?CacheItemPoolInterface $cache = null
) {
$creds = null;
$jsonKey = CredentialsLoader::fromEnv()
@@ -298,15 +305,11 @@ public static function getIdTokenCredentials(
throw new \InvalidArgumentException('json key is missing the type field');
}
- if ($jsonKey['type'] == 'authorized_user') {
- throw new InvalidArgumentException('ID tokens are not supported for end user credentials');
- }
-
- if ($jsonKey['type'] != 'service_account') {
- throw new InvalidArgumentException('invalid value in the type field');
- }
-
- $creds = new ServiceAccountCredentials(null, $jsonKey, null, $targetAudience);
+ $creds = match ($jsonKey['type']) {
+ 'authorized_user' => new UserRefreshCredentials(null, $jsonKey, $targetAudience),
+ 'service_account' => new ServiceAccountCredentials(null, $jsonKey, null, $targetAudience),
+ default => throw new InvalidArgumentException('invalid value in the type field')
+ };
} elseif (self::onGce($httpHandler, $cacheConfig, $cache)) {
$creds = new GCECredentials(null, null, $targetAudience);
$creds->setIsOnGce(true); // save the credentials a trip to the metadata server
@@ -321,6 +324,36 @@ public static function getIdTokenCredentials(
return $creds;
}
+ /**
+ * Returns a StdOutLogger instance
+ *
+ * @internal
+ *
+ * @return null|LoggerInterface
+ */
+ public static function getDefaultLogger(): null|LoggerInterface
+ {
+ $loggingFlag = getenv(self::SDK_DEBUG_ENV_VAR);
+
+ // Env var is not set
+ if (empty($loggingFlag)) {
+ return null;
+ }
+
+ $loggingFlag = strtolower($loggingFlag);
+
+ // Env Var is not true
+ if ($loggingFlag !== 'true') {
+ if ($loggingFlag !== 'false') {
+ trigger_error('The ' . self::SDK_DEBUG_ENV_VAR . ' is set, but it is set to another value than false or true. Logging is disabled');
+ }
+
+ return null;
+ }
+
+ return new StdOutLogger();
+ }
+
/**
* @return string
*/
@@ -334,15 +367,15 @@ private static function notFound()
}
/**
- * @param callable $httpHandler
- * @param array $cacheConfig
- * @param CacheItemPoolInterface $cache
+ * @param callable|null $httpHandler
+ * @param array|null $cacheConfig
+ * @param CacheItemPoolInterface|null $cache
* @return bool
*/
private static function onGce(
- callable $httpHandler = null,
- array $cacheConfig = null,
- CacheItemPoolInterface $cache = null
+ ?callable $httpHandler = null,
+ ?array $cacheConfig = null,
+ ?CacheItemPoolInterface $cache = null
) {
$gceCacheConfig = [];
foreach (['lifetime', 'prefix'] as $key) {
diff --git a/lib/Google/vendor/google/auth/src/Cache/FileSystemCacheItemPool.php b/lib/Google/vendor/google/auth/src/Cache/FileSystemCacheItemPool.php
new file mode 100644
index 000000000..ee0651a4e
--- /dev/null
+++ b/lib/Google/vendor/google/auth/src/Cache/FileSystemCacheItemPool.php
@@ -0,0 +1,230 @@
+
+ */
+ private array $buffer = [];
+
+ /**
+ * Creates a FileSystemCacheItemPool cache that stores values in local storage
+ *
+ * @param string $path The string representation of the path where the cache will store the serialized objects.
+ */
+ public function __construct(string $path)
+ {
+ $this->cachePath = $path;
+
+ if (is_dir($this->cachePath)) {
+ return;
+ }
+
+ if (!mkdir($this->cachePath)) {
+ throw new ErrorException("Cache folder couldn't be created.");
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getItem(string $key): CacheItemInterface
+ {
+ if (!$this->validKey($key)) {
+ throw new InvalidArgumentException("The key '$key' is not valid. The key should follow the pattern |^[a-zA-Z0-9_\.! ]+$|");
+ }
+
+ $item = new TypedItem($key);
+
+ $itemPath = $this->cacheFilePath($key);
+
+ if (!file_exists($itemPath)) {
+ return $item;
+ }
+
+ $serializedItem = file_get_contents($itemPath);
+
+ if ($serializedItem === false) {
+ return $item;
+ }
+
+ $item->set(unserialize($serializedItem));
+
+ return $item;
+ }
+
+ /**
+ * {@inheritdoc}
+ *
+ * @return iterable An iterable object containing all the
+ * A traversable collection of Cache Items keyed by the cache keys of
+ * each item. A Cache item will be returned for each key, even if that
+ * key is not found. However, if no keys are specified then an empty
+ * traversable MUST be returned instead.
+ */
+ public function getItems(array $keys = []): iterable
+ {
+ $result = [];
+
+ foreach ($keys as $key) {
+ $result[$key] = $this->getItem($key);
+ }
+
+ return $result;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function save(CacheItemInterface $item): bool
+ {
+ if (!$this->validKey($item->getKey())) {
+ return false;
+ }
+
+ $itemPath = $this->cacheFilePath($item->getKey());
+ $serializedItem = serialize($item->get());
+
+ $result = file_put_contents($itemPath, $serializedItem);
+
+ // 0 bytes write is considered a successful operation
+ if ($result === false) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function hasItem(string $key): bool
+ {
+ return $this->getItem($key)->isHit();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function clear(): bool
+ {
+ $this->buffer = [];
+
+ if (!is_dir($this->cachePath)) {
+ return false;
+ }
+
+ $files = scandir($this->cachePath);
+ if (!$files) {
+ return false;
+ }
+
+ foreach ($files as $fileName) {
+ if ($fileName === '.' || $fileName === '..') {
+ continue;
+ }
+
+ if (!unlink($this->cachePath . '/' . $fileName)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function deleteItem(string $key): bool
+ {
+ if (!$this->validKey($key)) {
+ throw new InvalidArgumentException("The key '$key' is not valid. The key should follow the pattern |^[a-zA-Z0-9_\.! ]+$|");
+ }
+
+ $itemPath = $this->cacheFilePath($key);
+
+ if (!file_exists($itemPath)) {
+ return true;
+ }
+
+ return unlink($itemPath);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function deleteItems(array $keys): bool
+ {
+ $result = true;
+
+ foreach ($keys as $key) {
+ if (!$this->deleteItem($key)) {
+ $result = false;
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function saveDeferred(CacheItemInterface $item): bool
+ {
+ array_push($this->buffer, $item);
+
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function commit(): bool
+ {
+ $result = true;
+
+ foreach ($this->buffer as $item) {
+ if (!$this->save($item)) {
+ $result = false;
+ }
+ }
+
+ return $result;
+ }
+
+ private function cacheFilePath(string $key): string
+ {
+ return $this->cachePath . '/' . $key;
+ }
+
+ private function validKey(string $key): bool
+ {
+ return (bool) preg_match('|^[a-zA-Z0-9_\.]+$|', $key);
+ }
+}
diff --git a/lib/Google/vendor/google/auth/src/CredentialSource/AwsNativeSource.php b/lib/Google/vendor/google/auth/src/CredentialSource/AwsNativeSource.php
index 460d9e5ea..880ca1001 100644
--- a/lib/Google/vendor/google/auth/src/CredentialSource/AwsNativeSource.php
+++ b/lib/Google/vendor/google/auth/src/CredentialSource/AwsNativeSource.php
@@ -50,9 +50,9 @@ class AwsNativeSource implements ExternalAccountCredentialSourceInterface
public function __construct(
string $audience,
string $regionalCredVerificationUrl,
- string $regionUrl = null,
- string $securityCredentialsUrl = null,
- string $imdsv2SessionTokenUrl = null
+ ?string $regionUrl = null,
+ ?string $securityCredentialsUrl = null,
+ ?string $imdsv2SessionTokenUrl = null
) {
$this->audience = $audience;
$this->regionalCredVerificationUrl = $regionalCredVerificationUrl;
@@ -61,7 +61,7 @@ public function __construct(
$this->imdsv2SessionTokenUrl = $imdsv2SessionTokenUrl;
}
- public function fetchSubjectToken(callable $httpHandler = null): string
+ public function fetchSubjectToken(?callable $httpHandler = null): string
{
if (is_null($httpHandler)) {
$httpHandler = HttpHandlerFactory::build(HttpClientCache::getHttpClient());
@@ -103,7 +103,7 @@ public function fetchSubjectToken(callable $httpHandler = null): string
$headers['x-goog-cloud-target-resource'] = $this->audience;
// Format headers as they're expected in the subject token
- $formattedHeaders= array_map(
+ $formattedHeaders = array_map(
fn ($k, $v) => ['key' => $k, 'value' => $v],
array_keys($headers),
$headers,
@@ -328,6 +328,21 @@ public static function getSigningVarsFromEnv(): ?array
return null;
}
+ /**
+ * Gets the unique key for caching
+ * For AwsNativeSource the values are:
+ * Imdsv2SessionTokenUrl.SecurityCredentialsUrl.RegionUrl.RegionalCredVerificationUrl
+ *
+ * @return string
+ */
+ public function getCacheKey(): string
+ {
+ return ($this->imdsv2SessionTokenUrl ?? '') .
+ '.' . ($this->securityCredentialsUrl ?? '') .
+ '.' . $this->regionUrl .
+ '.' . $this->regionalCredVerificationUrl;
+ }
+
/**
* Return HMAC hash in binary string
*/
diff --git a/lib/Google/vendor/google/auth/src/CredentialSource/ExecutableSource.php b/lib/Google/vendor/google/auth/src/CredentialSource/ExecutableSource.php
index 7661fc9cc..f6255bec9 100644
--- a/lib/Google/vendor/google/auth/src/CredentialSource/ExecutableSource.php
+++ b/lib/Google/vendor/google/auth/src/CredentialSource/ExecutableSource.php
@@ -88,12 +88,12 @@ class ExecutableSource implements ExternalAccountCredentialSourceInterface
/**
* @param string $command The string command to run to get the subject token.
- * @param string $outputFile
+ * @param string|null $outputFile
*/
public function __construct(
string $command,
?string $outputFile,
- ExecutableHandler $executableHandler = null,
+ ?ExecutableHandler $executableHandler = null,
) {
$this->command = $command;
$this->outputFile = $outputFile;
@@ -101,12 +101,24 @@ public function __construct(
}
/**
- * @param callable $httpHandler unused.
+ * Gets the unique key for caching
+ * The format for the cache key is:
+ * Command.OutputFile
+ *
+ * @return ?string
+ */
+ public function getCacheKey(): ?string
+ {
+ return $this->command . '.' . $this->outputFile;
+ }
+
+ /**
+ * @param callable|null $httpHandler unused.
* @return string
* @throws RuntimeException if the executable is not allowed to run.
* @throws ExecutableResponseError if the executable response is invalid.
*/
- public function fetchSubjectToken(callable $httpHandler = null): string
+ public function fetchSubjectToken(?callable $httpHandler = null): string
{
// Check if the executable is allowed to run.
if (getenv(self::GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES) !== '1') {
diff --git a/lib/Google/vendor/google/auth/src/CredentialSource/FileSource.php b/lib/Google/vendor/google/auth/src/CredentialSource/FileSource.php
index e2afc6c58..2e79119b8 100644
--- a/lib/Google/vendor/google/auth/src/CredentialSource/FileSource.php
+++ b/lib/Google/vendor/google/auth/src/CredentialSource/FileSource.php
@@ -31,15 +31,15 @@ class FileSource implements ExternalAccountCredentialSourceInterface
private ?string $subjectTokenFieldName;
/**
- * @param string $file The file to read the subject token from.
- * @param string $format The format of the token in the file. Can be null or "json".
- * @param string $subjectTokenFieldName The name of the field containing the token in the file. This is required
- * when format is "json".
+ * @param string $file The file to read the subject token from.
+ * @param string|null $format The format of the token in the file. Can be null or "json".
+ * @param string|null $subjectTokenFieldName The name of the field containing the token in the file. This is required
+ * when format is "json".
*/
public function __construct(
string $file,
- string $format = null,
- string $subjectTokenFieldName = null
+ ?string $format = null,
+ ?string $subjectTokenFieldName = null
) {
$this->file = $file;
@@ -53,7 +53,7 @@ public function __construct(
$this->subjectTokenFieldName = $subjectTokenFieldName;
}
- public function fetchSubjectToken(callable $httpHandler = null): string
+ public function fetchSubjectToken(?callable $httpHandler = null): string
{
$contents = file_get_contents($this->file);
if ($this->format === 'json') {
@@ -72,4 +72,16 @@ public function fetchSubjectToken(callable $httpHandler = null): string
return $contents;
}
+
+ /**
+ * Gets the unique key for caching.
+ * The format for the cache key one of the following:
+ * Filename
+ *
+ * @return string
+ */
+ public function getCacheKey(): ?string
+ {
+ return $this->file;
+ }
}
diff --git a/lib/Google/vendor/google/auth/src/CredentialSource/UrlSource.php b/lib/Google/vendor/google/auth/src/CredentialSource/UrlSource.php
index 0acb3c6ef..d2f875ebf 100644
--- a/lib/Google/vendor/google/auth/src/CredentialSource/UrlSource.php
+++ b/lib/Google/vendor/google/auth/src/CredentialSource/UrlSource.php
@@ -39,17 +39,17 @@ class UrlSource implements ExternalAccountCredentialSourceInterface
private ?array $headers;
/**
- * @param string $url The URL to fetch the subject token from.
- * @param string $format The format of the token in the response. Can be null or "json".
- * @param string $subjectTokenFieldName The name of the field containing the token in the response. This is required
+ * @param string $url The URL to fetch the subject token from.
+ * @param string|null $format The format of the token in the response. Can be null or "json".
+ * @param string|null $subjectTokenFieldName The name of the field containing the token in the response. This is required
* when format is "json".
- * @param array $headers Request headers to send in with the request to the URL.
+ * @param array|null $headers Request headers to send in with the request to the URL.
*/
public function __construct(
string $url,
- string $format = null,
- string $subjectTokenFieldName = null,
- array $headers = null
+ ?string $format = null,
+ ?string $subjectTokenFieldName = null,
+ ?array $headers = null
) {
$this->url = $url;
@@ -64,7 +64,7 @@ public function __construct(
$this->headers = $headers;
}
- public function fetchSubjectToken(callable $httpHandler = null): string
+ public function fetchSubjectToken(?callable $httpHandler = null): string
{
if (is_null($httpHandler)) {
$httpHandler = HttpHandlerFactory::build(HttpClientCache::getHttpClient());
@@ -94,4 +94,16 @@ public function fetchSubjectToken(callable $httpHandler = null): string
return $body;
}
+
+ /**
+ * Get the cache key for the credentials.
+ * The format for the cache key is:
+ * URL
+ *
+ * @return ?string
+ */
+ public function getCacheKey(): ?string
+ {
+ return $this->url;
+ }
}
diff --git a/lib/Google/vendor/google/auth/src/Credentials/AppIdentityCredentials.php b/lib/Google/vendor/google/auth/src/Credentials/AppIdentityCredentials.php
index db29438ab..5e4cfa53a 100644
--- a/lib/Google/vendor/google/auth/src/Credentials/AppIdentityCredentials.php
+++ b/lib/Google/vendor/google/auth/src/Credentials/AppIdentityCredentials.php
@@ -116,7 +116,7 @@ public static function onAppEngine()
* As the AppIdentityService uses protobufs to fetch the access token,
* the GuzzleHttp\ClientInterface instance passed in will not be used.
*
- * @param callable $httpHandler callback which delivers psr7 request
+ * @param callable|null $httpHandler callback which delivers psr7 request
* @return array {
* A set of auth related metadata, containing the following
*
@@ -124,7 +124,7 @@ public static function onAppEngine()
* @type string $expiration_time
* }
*/
- public function fetchAuthToken(callable $httpHandler = null)
+ public function fetchAuthToken(?callable $httpHandler = null)
{
try {
$this->checkAppEngineContext();
@@ -161,10 +161,10 @@ public function signBlob($stringToSign, $forceOpenSsl = false)
*
* Returns null if AppIdentityService is unavailable.
*
- * @param callable $httpHandler Not used by this type.
+ * @param callable|null $httpHandler Not used by this type.
* @return string|null
*/
- public function getProjectId(callable $httpHandler = null)
+ public function getProjectId(?callable $httpHandler = null)
{
try {
$this->checkAppEngineContext();
@@ -181,11 +181,11 @@ public function getProjectId(callable $httpHandler = null)
*
* Subsequent calls to this method will return a cached value.
*
- * @param callable $httpHandler Not used in this implementation.
+ * @param callable|null $httpHandler Not used in this implementation.
* @return string
* @throws \Exception If AppEngine SDK or mock is not available.
*/
- public function getClientName(callable $httpHandler = null)
+ public function getClientName(?callable $httpHandler = null)
{
$this->checkAppEngineContext();
diff --git a/lib/Google/vendor/google/auth/src/Credentials/ExternalAccountCredentials.php b/lib/Google/vendor/google/auth/src/Credentials/ExternalAccountCredentials.php
index 98f427a33..478063be1 100644
--- a/lib/Google/vendor/google/auth/src/Credentials/ExternalAccountCredentials.php
+++ b/lib/Google/vendor/google/auth/src/Credentials/ExternalAccountCredentials.php
@@ -98,9 +98,7 @@ public function __construct(
);
}
- if (array_key_exists('service_account_impersonation_url', $jsonKey)) {
- $this->serviceAccountImpersonationUrl = $jsonKey['service_account_impersonation_url'];
- }
+ $this->serviceAccountImpersonationUrl = $jsonKey['service_account_impersonation_url'] ?? null;
$this->quotaProject = $jsonKey['quota_project_id'] ?? null;
$this->workforcePoolUserProject = $jsonKey['workforce_pool_user_project'] ?? null;
@@ -213,7 +211,7 @@ private static function buildCredentialSource(array $jsonKey): ExternalAccountCr
/**
* @param string $stsToken
- * @param callable $httpHandler
+ * @param callable|null $httpHandler
*
* @return array {
* A set of auth related metadata, containing the following
@@ -222,7 +220,7 @@ private static function buildCredentialSource(array $jsonKey): ExternalAccountCr
* @type int $expires_at
* }
*/
- private function getImpersonatedAccessToken(string $stsToken, callable $httpHandler = null): array
+ private function getImpersonatedAccessToken(string $stsToken, ?callable $httpHandler = null): array
{
if (!isset($this->serviceAccountImpersonationUrl)) {
throw new InvalidArgumentException(
@@ -253,7 +251,9 @@ private function getImpersonatedAccessToken(string $stsToken, callable $httpHand
}
/**
- * @param callable $httpHandler
+ * @param callable|null $httpHandler
+ * @param array $headers [optional] Metrics headers to be inserted
+ * into the token endpoint request present.
*
* @return array {
* A set of auth related metadata, containing the following
@@ -265,9 +265,9 @@ private function getImpersonatedAccessToken(string $stsToken, callable $httpHand
* @type string $token_type (identity pool only)
* }
*/
- public function fetchAuthToken(callable $httpHandler = null)
+ public function fetchAuthToken(?callable $httpHandler = null, array $headers = [])
{
- $stsToken = $this->auth->fetchAuthToken($httpHandler);
+ $stsToken = $this->auth->fetchAuthToken($httpHandler, $headers);
if (isset($this->serviceAccountImpersonationUrl)) {
return $this->getImpersonatedAccessToken($stsToken['access_token'], $httpHandler);
@@ -276,9 +276,27 @@ public function fetchAuthToken(callable $httpHandler = null)
return $stsToken;
}
- public function getCacheKey()
+ /**
+ * Get the cache token key for the credentials.
+ * The cache token key format depends on the type of source
+ * The format for the cache key one of the following:
+ * FetcherCacheKey.Scope.[ServiceAccount].[TokenType].[WorkforcePoolUserProject]
+ * FetcherCacheKey.Audience.[ServiceAccount].[TokenType].[WorkforcePoolUserProject]
+ *
+ * @return ?string;
+ */
+ public function getCacheKey(): ?string
{
- return $this->auth->getCacheKey();
+ $scopeOrAudience = $this->auth->getAudience();
+ if (!$scopeOrAudience) {
+ $scopeOrAudience = $this->auth->getScope();
+ }
+
+ return $this->auth->getSubjectTokenFetcher()->getCacheKey() .
+ '.' . $scopeOrAudience .
+ '.' . ($this->serviceAccountImpersonationUrl ?? '') .
+ '.' . ($this->auth->getSubjectTokenType() ?? '') .
+ '.' . ($this->workforcePoolUserProject ?? '');
}
public function getLastReceivedToken()
@@ -309,13 +327,13 @@ public function getUniverseDomain(): string
/**
* Get the project ID.
*
- * @param callable $httpHandler Callback which delivers psr7 request
- * @param string $accessToken The access token to use to sign the blob. If
+ * @param callable|null $httpHandler Callback which delivers psr7 request
+ * @param string|null $accessToken The access token to use to sign the blob. If
* provided, saves a call to the metadata server for a new access
* token. **Defaults to** `null`.
* @return string|null
*/
- public function getProjectId(callable $httpHandler = null, string $accessToken = null)
+ public function getProjectId(?callable $httpHandler = null, ?string $accessToken = null)
{
if (isset($this->projectId)) {
return $this->projectId;
diff --git a/lib/Google/vendor/google/auth/src/Credentials/GCECredentials.php b/lib/Google/vendor/google/auth/src/Credentials/GCECredentials.php
index 5fed54763..ab6753bd8 100644
--- a/lib/Google/vendor/google/auth/src/Credentials/GCECredentials.php
+++ b/lib/Google/vendor/google/auth/src/Credentials/GCECredentials.php
@@ -100,7 +100,7 @@ class GCECredentials extends CredentialsLoader implements
/**
* The metadata path of the project ID.
*/
- const UNIVERSE_DOMAIN_URI_PATH = 'v1/universe/universe_domain';
+ const UNIVERSE_DOMAIN_URI_PATH = 'v1/universe/universe-domain';
/**
* The header whose presence indicates GCE presence.
@@ -199,7 +199,7 @@ class GCECredentials extends CredentialsLoader implements
private ?string $universeDomain;
/**
- * @param Iam $iam [optional] An IAM instance.
+ * @param Iam|null $iam [optional] An IAM instance.
* @param string|string[] $scope [optional] the scope of the access request,
* expressed either as an array or as a space-delimited string.
* @param string $targetAudience [optional] The audience for the ID token.
@@ -207,16 +207,16 @@ class GCECredentials extends CredentialsLoader implements
* charges associated with the request.
* @param string $serviceAccountIdentity [optional] Specify a service
* account identity name to use instead of "default".
- * @param string $universeDomain [optional] Specify a universe domain to use
+ * @param string|null $universeDomain [optional] Specify a universe domain to use
* instead of fetching one from the metadata server.
*/
public function __construct(
- Iam $iam = null,
+ ?Iam $iam = null,
$scope = null,
$targetAudience = null,
$quotaProject = null,
$serviceAccountIdentity = null,
- string $universeDomain = null
+ ?string $universeDomain = null
) {
$this->iam = $iam;
@@ -355,10 +355,10 @@ public static function onAppEngineFlexible()
* host.
* If $httpHandler is not specified a the default HttpHandler is used.
*
- * @param callable $httpHandler callback which delivers psr7 request
+ * @param callable|null $httpHandler callback which delivers psr7 request
* @return bool True if this a GCEInstance, false otherwise
*/
- public static function onGce(callable $httpHandler = null)
+ public static function onGce(?callable $httpHandler = null)
{
$httpHandler = $httpHandler
?: HttpHandlerFactory::build(HttpClientCache::getHttpClient());
@@ -426,12 +426,12 @@ private static function detectResidencyWindows(string $registryProductKey): bool
try {
$productName = $shell->regRead($registryProductKey);
- } catch(com_exception) {
+ } catch (com_exception) {
// This means that we tried to read a key that doesn't exist on the registry
// which might mean that it is a windows instance that is not on GCE
return false;
}
-
+
return 0 === strpos($productName, self::PRODUCT_NAME);
}
@@ -441,7 +441,9 @@ private static function detectResidencyWindows(string $registryProductKey): bool
* Fetches the auth tokens from the GCE metadata host if it is available.
* If $httpHandler is not specified a the default HttpHandler is used.
*
- * @param callable $httpHandler callback which delivers psr7 request
+ * @param callable|null $httpHandler callback which delivers psr7 request
+ * @param array $headers [optional] Headers to be inserted
+ * into the token endpoint request present.
*
* @return array {
* A set of auth related metadata, based on the token type.
@@ -453,7 +455,7 @@ private static function detectResidencyWindows(string $registryProductKey): bool
* }
* @throws \Exception
*/
- public function fetchAuthToken(callable $httpHandler = null)
+ public function fetchAuthToken(?callable $httpHandler = null, array $headers = [])
{
$httpHandler = $httpHandler
?: HttpHandlerFactory::build(HttpClientCache::getHttpClient());
@@ -469,7 +471,7 @@ public function fetchAuthToken(callable $httpHandler = null)
$response = $this->getFromMetadata(
$httpHandler,
$this->tokenUri,
- $this->applyTokenEndpointMetrics([], $this->targetAudience ? 'it' : 'at')
+ $this->applyTokenEndpointMetrics($headers, $this->targetAudience ? 'it' : 'at')
);
if ($this->targetAudience) {
@@ -489,11 +491,15 @@ public function fetchAuthToken(callable $httpHandler = null)
}
/**
+ * Returns the Cache Key for the credential token.
+ * The format for the cache key is:
+ * TokenURI
+ *
* @return string
*/
public function getCacheKey()
{
- return self::cacheKey;
+ return $this->tokenUri;
}
/**
@@ -520,10 +526,10 @@ public function getLastReceivedToken()
*
* Subsequent calls will return a cached value.
*
- * @param callable $httpHandler callback which delivers psr7 request
+ * @param callable|null $httpHandler callback which delivers psr7 request
* @return string
*/
- public function getClientName(callable $httpHandler = null)
+ public function getClientName(?callable $httpHandler = null)
{
if ($this->clientName) {
return $this->clientName;
@@ -554,10 +560,10 @@ public function getClientName(callable $httpHandler = null)
*
* Returns null if called outside GCE.
*
- * @param callable $httpHandler Callback which delivers psr7 request
+ * @param callable|null $httpHandler Callback which delivers psr7 request
* @return string|null
*/
- public function getProjectId(callable $httpHandler = null)
+ public function getProjectId(?callable $httpHandler = null)
{
if ($this->projectId) {
return $this->projectId;
@@ -582,10 +588,10 @@ public function getProjectId(callable $httpHandler = null)
/**
* Fetch the default universe domain from the metadata server.
*
- * @param callable $httpHandler Callback which delivers psr7 request
+ * @param callable|null $httpHandler Callback which delivers psr7 request
* @return string
*/
- public function getUniverseDomain(callable $httpHandler = null): string
+ public function getUniverseDomain(?callable $httpHandler = null): string
{
if (null !== $this->universeDomain) {
return $this->universeDomain;
diff --git a/lib/Google/vendor/google/auth/src/Credentials/IAMCredentials.php b/lib/Google/vendor/google/auth/src/Credentials/IAMCredentials.php
index 98780c6e0..96d1df734 100644
--- a/lib/Google/vendor/google/auth/src/Credentials/IAMCredentials.php
+++ b/lib/Google/vendor/google/auth/src/Credentials/IAMCredentials.php
@@ -71,7 +71,7 @@ public function getUpdateMetadataFunc()
*
* @param array $metadata metadata hashmap
* @param string $unusedAuthUri optional auth uri
- * @param callable $httpHandler callback which delivers psr7 request
+ * @param callable|null $httpHandler callback which delivers psr7 request
* Note: this param is unused here, only included here for
* consistency with other credentials class
*
@@ -80,7 +80,7 @@ public function getUpdateMetadataFunc()
public function updateMetadata(
$metadata,
$unusedAuthUri = null,
- callable $httpHandler = null
+ ?callable $httpHandler = null
) {
$metadata_copy = $metadata;
$metadata_copy[self::SELECTOR_KEY] = $this->selector;
diff --git a/lib/Google/vendor/google/auth/src/Credentials/ImpersonatedServiceAccountCredentials.php b/lib/Google/vendor/google/auth/src/Credentials/ImpersonatedServiceAccountCredentials.php
index 791fe985a..b907d8d96 100644
--- a/lib/Google/vendor/google/auth/src/Credentials/ImpersonatedServiceAccountCredentials.php
+++ b/lib/Google/vendor/google/auth/src/Credentials/ImpersonatedServiceAccountCredentials.php
@@ -18,12 +18,20 @@
namespace Google\Auth\Credentials;
+use Google\Auth\CacheTrait;
use Google\Auth\CredentialsLoader;
+use Google\Auth\FetchAuthTokenInterface;
+use Google\Auth\HttpHandler\HttpClientCache;
+use Google\Auth\HttpHandler\HttpHandlerFactory;
use Google\Auth\IamSignerTrait;
use Google\Auth\SignBlobInterface;
+use GuzzleHttp\Psr7\Request;
+use InvalidArgumentException;
+use LogicException;
class ImpersonatedServiceAccountCredentials extends CredentialsLoader implements SignBlobInterface
{
+ use CacheTrait;
use IamSignerTrait;
private const CRED_TYPE = 'imp';
@@ -33,19 +41,36 @@ class ImpersonatedServiceAccountCredentials extends CredentialsLoader implements
*/
protected $impersonatedServiceAccountName;
+ protected FetchAuthTokenInterface $sourceCredentials;
+
+ private string $serviceAccountImpersonationUrl;
+
+ /**
+ * @var string[]
+ */
+ private array $delegates;
+
/**
- * @var UserRefreshCredentials
+ * @var string|string[]
*/
- protected $sourceCredentials;
+ private string|array $targetScope;
+
+ private int $lifetime;
/**
* Instantiate an instance of ImpersonatedServiceAccountCredentials from a credentials file that
- * has be created with the --impersonated-service-account flag.
+ * has be created with the --impersonate-service-account flag.
+ *
+ * @param string|string[]|null $scope The scope of the access request, expressed either as an
+ * array or as a space-delimited string.
+ * @param string|array $jsonKey JSON credential file path or JSON array credentials {
+ * JSON credentials as an associative array.
*
- * @param string|string[] $scope The scope of the access request, expressed either as an
- * array or as a space-delimited string.
- * @param string|array $jsonKey JSON credential file path or JSON credentials
- * as an associative array.
+ * @type string $service_account_impersonation_url The URL to the service account
+ * @type string|FetchAuthTokenInterface $source_credentials The source credentials to impersonate
+ * @type int $lifetime The lifetime of the impersonated credentials
+ * @type string[] $delegates The delegates to impersonate
+ * }
*/
public function __construct(
$scope,
@@ -53,30 +78,38 @@ public function __construct(
) {
if (is_string($jsonKey)) {
if (!file_exists($jsonKey)) {
- throw new \InvalidArgumentException('file does not exist');
+ throw new InvalidArgumentException('file does not exist');
}
$json = file_get_contents($jsonKey);
if (!$jsonKey = json_decode((string) $json, true)) {
- throw new \LogicException('invalid json for auth config');
+ throw new LogicException('invalid json for auth config');
}
}
if (!array_key_exists('service_account_impersonation_url', $jsonKey)) {
- throw new \LogicException(
+ throw new LogicException(
'json key is missing the service_account_impersonation_url field'
);
}
if (!array_key_exists('source_credentials', $jsonKey)) {
- throw new \LogicException('json key is missing the source_credentials field');
+ throw new LogicException('json key is missing the source_credentials field');
+ }
+ if (is_array($jsonKey['source_credentials'])) {
+ if (!array_key_exists('type', $jsonKey['source_credentials'])) {
+ throw new InvalidArgumentException('json key source credentials are missing the type field');
+ }
+ $jsonKey['source_credentials'] = CredentialsLoader::makeCredentials($scope, $jsonKey['source_credentials']);
}
+ $this->targetScope = $scope ?? [];
+ $this->lifetime = $jsonKey['lifetime'] ?? 3600;
+ $this->delegates = $jsonKey['delegates'] ?? [];
+
+ $this->serviceAccountImpersonationUrl = $jsonKey['service_account_impersonation_url'];
$this->impersonatedServiceAccountName = $this->getImpersonatedServiceAccountNameFromUrl(
- $jsonKey['service_account_impersonation_url']
+ $this->serviceAccountImpersonationUrl
);
- $this->sourceCredentials = new UserRefreshCredentials(
- $scope,
- $jsonKey['source_credentials']
- );
+ $this->sourceCredentials = $jsonKey['source_credentials'];
}
/**
@@ -103,13 +136,13 @@ private function getImpersonatedServiceAccountNameFromUrl(
* @param callable|null $unusedHttpHandler not used by this credentials type.
* @return string Token issuer email
*/
- public function getClientName(callable $unusedHttpHandler = null)
+ public function getClientName(?callable $unusedHttpHandler = null)
{
return $this->impersonatedServiceAccountName;
}
/**
- * @param callable $httpHandler
+ * @param callable|null $httpHandler
*
* @return array {
* A set of auth related metadata, containing the following
@@ -121,21 +154,58 @@ public function getClientName(callable $unusedHttpHandler = null)
* @type string $id_token
* }
*/
- public function fetchAuthToken(callable $httpHandler = null)
+ public function fetchAuthToken(?callable $httpHandler = null)
{
- // We don't support id token endpoint requests as of now for Impersonated Cred
- return $this->sourceCredentials->fetchAuthToken(
+ $httpHandler = $httpHandler ?? HttpHandlerFactory::build(HttpClientCache::getHttpClient());
+
+ // The FetchAuthTokenInterface technically does not have a "headers" argument, but all of
+ // the implementations do. Additionally, passing in more parameters than the function has
+ // defined is allowed in PHP. So we'll just ignore the phpstan error here.
+ // @phpstan-ignore-next-line
+ $authToken = $this->sourceCredentials->fetchAuthToken(
$httpHandler,
$this->applyTokenEndpointMetrics([], 'at')
);
+
+ $headers = $this->applyTokenEndpointMetrics([
+ 'Content-Type' => 'application/json',
+ 'Cache-Control' => 'no-store',
+ 'Authorization' => sprintf('Bearer %s', $authToken['access_token'] ?? $authToken['id_token']),
+ ], 'at');
+
+ $body = [
+ 'scope' => $this->targetScope,
+ 'delegates' => $this->delegates,
+ 'lifetime' => sprintf('%ss', $this->lifetime),
+ ];
+
+ $request = new Request(
+ 'POST',
+ $this->serviceAccountImpersonationUrl,
+ $headers,
+ (string) json_encode($body)
+ );
+
+ $response = $httpHandler($request);
+ $body = json_decode((string) $response->getBody(), true);
+
+ return [
+ 'access_token' => $body['accessToken'],
+ 'expires_at' => strtotime($body['expireTime']),
+ ];
}
/**
+ * Returns the Cache Key for the credentials
+ * The cache key is the same as the UserRefreshCredentials class
+ *
* @return string
*/
public function getCacheKey()
{
- return $this->sourceCredentials->getCacheKey();
+ return $this->getFullCacheKey(
+ $this->serviceAccountImpersonationUrl . $this->sourceCredentials->getCacheKey()
+ );
}
/**
diff --git a/lib/Google/vendor/google/auth/src/Credentials/InsecureCredentials.php b/lib/Google/vendor/google/auth/src/Credentials/InsecureCredentials.php
index 9b9e24b11..5a2bef1c5 100644
--- a/lib/Google/vendor/google/auth/src/Credentials/InsecureCredentials.php
+++ b/lib/Google/vendor/google/auth/src/Credentials/InsecureCredentials.php
@@ -36,10 +36,10 @@ class InsecureCredentials implements FetchAuthTokenInterface
/**
* Fetches the auth token. In this case it returns an empty string.
*
- * @param callable $httpHandler
+ * @param callable|null $httpHandler
* @return array{access_token:string} A set of auth related metadata
*/
- public function fetchAuthToken(callable $httpHandler = null)
+ public function fetchAuthToken(?callable $httpHandler = null)
{
return $this->token;
}
diff --git a/lib/Google/vendor/google/auth/src/Credentials/ServiceAccountCredentials.php b/lib/Google/vendor/google/auth/src/Credentials/ServiceAccountCredentials.php
index 91238029d..3d23f71af 100644
--- a/lib/Google/vendor/google/auth/src/Credentials/ServiceAccountCredentials.php
+++ b/lib/Google/vendor/google/auth/src/Credentials/ServiceAccountCredentials.php
@@ -17,8 +17,10 @@
namespace Google\Auth\Credentials;
+use Firebase\JWT\JWT;
use Google\Auth\CredentialsLoader;
use Google\Auth\GetQuotaProjectInterface;
+use Google\Auth\Iam;
use Google\Auth\OAuth2;
use Google\Auth\ProjectIdProviderInterface;
use Google\Auth\ServiceAccountSignerTrait;
@@ -71,6 +73,7 @@ class ServiceAccountCredentials extends CredentialsLoader implements
* @var string
*/
private const CRED_TYPE = 'sa';
+ private const IAM_SCOPE = 'https://www.googleapis.com/auth/iam';
/**
* The OAuth2 instance used to conduct authorization.
@@ -111,6 +114,12 @@ class ServiceAccountCredentials extends CredentialsLoader implements
*/
private string $universeDomain;
+ /**
+ * Whether this is an ID token request or an access token request. Used when
+ * building the metric header.
+ */
+ private bool $isIdTokenRequest = false;
+
/**
* Create a new ServiceAccountCredentials.
*
@@ -158,6 +167,7 @@ public function __construct(
$additionalClaims = [];
if ($targetAudience) {
$additionalClaims = ['target_audience' => $targetAudience];
+ $this->isIdTokenRequest = true;
}
$this->auth = new OAuth2([
'audience' => self::TOKEN_CREDENTIAL_URI,
@@ -165,6 +175,7 @@ public function __construct(
'scope' => $scope,
'signingAlgorithm' => 'RS256',
'signingKey' => $jsonKey['private_key'],
+ 'signingKeyId' => $jsonKey['private_key_id'] ?? null,
'sub' => $sub,
'tokenCredentialUri' => self::TOKEN_CREDENTIAL_URI,
'additionalClaims' => $additionalClaims,
@@ -189,7 +200,9 @@ public function useJwtAccessWithScope()
}
/**
- * @param callable $httpHandler
+ * @param callable|null $httpHandler
+ * @param array $headers [optional] Headers to be inserted
+ * into the token endpoint request present.
*
* @return array {
* A set of auth related metadata, containing the following
@@ -199,7 +212,7 @@ public function useJwtAccessWithScope()
* @type string $token_type
* }
*/
- public function fetchAuthToken(callable $httpHandler = null)
+ public function fetchAuthToken(?callable $httpHandler = null, array $headers = [])
{
if ($this->useSelfSignedJwt()) {
$jwtCreds = $this->createJwtAccessCredentials();
@@ -213,19 +226,54 @@ public function fetchAuthToken(callable $httpHandler = null)
return $accessToken;
}
- $authRequestType = empty($this->auth->getAdditionalClaims()['target_audience'])
- ? 'at' : 'it';
- return $this->auth->fetchAuthToken($httpHandler, $this->applyTokenEndpointMetrics([], $authRequestType));
+
+ if ($this->isIdTokenRequest && $this->getUniverseDomain() !== self::DEFAULT_UNIVERSE_DOMAIN) {
+ $now = time();
+ $jwt = Jwt::encode(
+ [
+ 'iss' => $this->auth->getIssuer(),
+ 'sub' => $this->auth->getIssuer(),
+ 'scope' => self::IAM_SCOPE,
+ 'exp' => ($now + $this->auth->getExpiry()),
+ 'iat' => ($now - OAuth2::DEFAULT_SKEW_SECONDS),
+ ],
+ $this->auth->getSigningKey(),
+ $this->auth->getSigningAlgorithm(),
+ $this->auth->getSigningKeyId()
+ );
+ // We create a new instance of Iam each time because the `$httpHandler` might change.
+ $idToken = (new Iam($httpHandler, $this->getUniverseDomain()))->generateIdToken(
+ $this->auth->getIssuer(),
+ $this->auth->getAdditionalClaims()['target_audience'],
+ $jwt,
+ $this->applyTokenEndpointMetrics($headers, 'it')
+ );
+ return ['id_token' => $idToken];
+ }
+ return $this->auth->fetchAuthToken(
+ $httpHandler,
+ $this->applyTokenEndpointMetrics($headers, $this->isIdTokenRequest ? 'it' : 'at')
+ );
}
/**
+ * Return the Cache Key for the credentials.
+ * For the cache key format is one of the following:
+ * ClientEmail.Scope[.Sub]
+ * ClientEmail.Audience[.Sub]
+ *
* @return string
*/
public function getCacheKey()
{
- $key = $this->auth->getIssuer() . ':' . $this->auth->getCacheKey();
+ $scopeOrAudience = $this->auth->getScope();
+ if (!$scopeOrAudience) {
+ $scopeOrAudience = $this->auth->getAudience();
+ }
+
+ $key = $this->auth->getIssuer() . '.' . $scopeOrAudience;
if ($sub = $this->auth->getSub()) {
- $key .= ':' . $sub;
+ $key .= '.' . $sub;
}
return $key;
@@ -248,10 +296,10 @@ public function getLastReceivedToken()
*
* Returns null if the project ID does not exist in the keyfile.
*
- * @param callable $httpHandler Not used by this credentials type.
+ * @param callable|null $httpHandler Not used by this credentials type.
* @return string|null
*/
- public function getProjectId(callable $httpHandler = null)
+ public function getProjectId(?callable $httpHandler = null)
{
return $this->projectId;
}
@@ -261,13 +309,13 @@ public function getProjectId(callable $httpHandler = null)
*
* @param array $metadata metadata hashmap
* @param string $authUri optional auth uri
- * @param callable $httpHandler callback which delivers psr7 request
+ * @param callable|null $httpHandler callback which delivers psr7 request
* @return array updated metadata hashmap
*/
public function updateMetadata(
$metadata,
$authUri = null,
- callable $httpHandler = null
+ ?callable $httpHandler = null
) {
// scope exists. use oauth implementation
if (!$this->useSelfSignedJwt()) {
@@ -325,14 +373,26 @@ public function setSub($sub)
*
* In this case, it returns the keyfile's client_email key.
*
- * @param callable $httpHandler Not used by this credentials type.
+ * @param callable|null $httpHandler Not used by this credentials type.
* @return string
*/
- public function getClientName(callable $httpHandler = null)
+ public function getClientName(?callable $httpHandler = null)
{
return $this->auth->getIssuer();
}
+ /**
+ * Get the private key from the keyfile.
+ *
+ * In this case, it returns the keyfile's private_key key, needed for JWT signing.
+ *
+ * @return string
+ */
+ public function getPrivateKey()
+ {
+ return $this->auth->getSigningKey();
+ }
+
/**
* Get the quota project used for this API request
*
@@ -377,8 +437,8 @@ private function useSelfSignedJwt()
return false;
}
- // If claims are set, this call is for "id_tokens"
- if ($this->auth->getAdditionalClaims()) {
+ // Do not use self-signed JWT for ID tokens
+ if ($this->isIdTokenRequest) {
return false;
}
diff --git a/lib/Google/vendor/google/auth/src/Credentials/ServiceAccountJwtAccessCredentials.php b/lib/Google/vendor/google/auth/src/Credentials/ServiceAccountJwtAccessCredentials.php
index 87baa7500..50373760b 100644
--- a/lib/Google/vendor/google/auth/src/Credentials/ServiceAccountJwtAccessCredentials.php
+++ b/lib/Google/vendor/google/auth/src/Credentials/ServiceAccountJwtAccessCredentials.php
@@ -114,13 +114,13 @@ public function __construct($jsonKey, $scope = null)
*
* @param array $metadata metadata hashmap
* @param string $authUri optional auth uri
- * @param callable $httpHandler callback which delivers psr7 request
+ * @param callable|null $httpHandler callback which delivers psr7 request
* @return array updated metadata hashmap
*/
public function updateMetadata(
$metadata,
$authUri = null,
- callable $httpHandler = null
+ ?callable $httpHandler = null
) {
$scope = $this->auth->getScope();
if (empty($authUri) && empty($scope)) {
@@ -135,11 +135,11 @@ public function updateMetadata(
/**
* Implements FetchAuthTokenInterface#fetchAuthToken.
*
- * @param callable $httpHandler
+ * @param callable|null $httpHandler
*
* @return null|array{access_token:string} A set of auth related metadata
*/
- public function fetchAuthToken(callable $httpHandler = null)
+ public function fetchAuthToken(?callable $httpHandler = null)
{
$audience = $this->auth->getAudience();
$scope = $this->auth->getScope();
@@ -166,11 +166,21 @@ public function fetchAuthToken(callable $httpHandler = null)
}
/**
+ * Return the cache key for the credentials.
+ * The format for the Cache Key one of the following:
+ * ClientEmail.Scope
+ * ClientEmail.Audience
+ *
* @return string
*/
public function getCacheKey()
{
- return $this->auth->getCacheKey();
+ $scopeOrAudience = $this->auth->getScope();
+ if (!$scopeOrAudience) {
+ $scopeOrAudience = $this->auth->getAudience();
+ }
+
+ return $this->auth->getIssuer() . '.' . $scopeOrAudience;
}
/**
@@ -186,10 +196,10 @@ public function getLastReceivedToken()
*
* Returns null if the project ID does not exist in the keyfile.
*
- * @param callable $httpHandler Not used by this credentials type.
+ * @param callable|null $httpHandler Not used by this credentials type.
* @return string|null
*/
- public function getProjectId(callable $httpHandler = null)
+ public function getProjectId(?callable $httpHandler = null)
{
return $this->projectId;
}
@@ -199,14 +209,26 @@ public function getProjectId(callable $httpHandler = null)
*
* In this case, it returns the keyfile's client_email key.
*
- * @param callable $httpHandler Not used by this credentials type.
+ * @param callable|null $httpHandler Not used by this credentials type.
* @return string
*/
- public function getClientName(callable $httpHandler = null)
+ public function getClientName(?callable $httpHandler = null)
{
return $this->auth->getIssuer();
}
+ /**
+ * Get the private key from the keyfile.
+ *
+ * In this case, it returns the keyfile's private_key key, needed for JWT signing.
+ *
+ * @return string
+ */
+ public function getPrivateKey()
+ {
+ return $this->auth->getSigningKey();
+ }
+
/**
* Get the quota project used for this API request
*
diff --git a/lib/Google/vendor/google/auth/src/Credentials/UserRefreshCredentials.php b/lib/Google/vendor/google/auth/src/Credentials/UserRefreshCredentials.php
index 69778f7c8..326f6cd86 100644
--- a/lib/Google/vendor/google/auth/src/Credentials/UserRefreshCredentials.php
+++ b/lib/Google/vendor/google/auth/src/Credentials/UserRefreshCredentials.php
@@ -20,6 +20,8 @@
use Google\Auth\CredentialsLoader;
use Google\Auth\GetQuotaProjectInterface;
use Google\Auth\OAuth2;
+use InvalidArgumentException;
+use LogicException;
/**
* Authenticates requests using User Refresh credentials.
@@ -55,48 +57,67 @@ class UserRefreshCredentials extends CredentialsLoader implements GetQuotaProjec
*/
protected $quotaProject;
+ /**
+ * Whether this is an ID token request or an access token request. Used when
+ * building the metric header.
+ */
+ private bool $isIdTokenRequest = false;
+
/**
* Create a new UserRefreshCredentials.
*
- * @param string|string[] $scope the scope of the access request, expressed
+ * @param string|string[]|null $scope the scope of the access request, expressed
* either as an Array or as a space-delimited String.
* @param string|array $jsonKey JSON credential file path or JSON credentials
* as an associative array
+ * @param string|null $targetAudience The audience for the ID token.
*/
public function __construct(
$scope,
- $jsonKey
+ $jsonKey,
+ ?string $targetAudience = null
) {
if (is_string($jsonKey)) {
if (!file_exists($jsonKey)) {
- throw new \InvalidArgumentException('file does not exist');
+ throw new InvalidArgumentException('file does not exist or is unreadable');
}
$json = file_get_contents($jsonKey);
if (!$jsonKey = json_decode((string) $json, true)) {
- throw new \LogicException('invalid json for auth config');
+ throw new LogicException('invalid json for auth config');
}
}
if (!array_key_exists('client_id', $jsonKey)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'json key is missing the client_id field'
);
}
if (!array_key_exists('client_secret', $jsonKey)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'json key is missing the client_secret field'
);
}
if (!array_key_exists('refresh_token', $jsonKey)) {
- throw new \InvalidArgumentException(
+ throw new InvalidArgumentException(
'json key is missing the refresh_token field'
);
}
+ if ($scope && $targetAudience) {
+ throw new InvalidArgumentException(
+ 'Scope and targetAudience cannot both be supplied'
+ );
+ }
+ $additionalClaims = [];
+ if ($targetAudience) {
+ $additionalClaims = ['target_audience' => $targetAudience];
+ $this->isIdTokenRequest = true;
+ }
$this->auth = new OAuth2([
'clientId' => $jsonKey['client_id'],
'clientSecret' => $jsonKey['client_secret'],
'refresh_token' => $jsonKey['refresh_token'],
'scope' => $scope,
'tokenCredentialUri' => self::TOKEN_CREDENTIAL_URI,
+ 'additionalClaims' => $additionalClaims,
]);
if (array_key_exists('quota_project_id', $jsonKey)) {
$this->quotaProject = (string) $jsonKey['quota_project_id'];
@@ -104,8 +125,8 @@ public function __construct(
}
/**
- * @param callable $httpHandler
- * @param array $metricsHeader [optional] Metrics headers to be inserted
+ * @param callable|null $httpHandler
+ * @param array $headers [optional] Metrics headers to be inserted
* into the token endpoint request present.
* This could be passed from ImersonatedServiceAccountCredentials as it uses
* UserRefreshCredentials as source credentials.
@@ -120,21 +141,30 @@ public function __construct(
* @type string $id_token
* }
*/
- public function fetchAuthToken(callable $httpHandler = null, array $metricsHeader = [])
+ public function fetchAuthToken(?callable $httpHandler = null, array $headers = [])
{
- // We don't support id token endpoint requests as of now for User Cred
return $this->auth->fetchAuthToken(
$httpHandler,
- $this->applyTokenEndpointMetrics($metricsHeader, 'at')
+ $this->applyTokenEndpointMetrics($headers, $this->isIdTokenRequest ? 'it' : 'at')
);
}
/**
+ * Return the Cache Key for the credentials.
+ * The format for the Cache key is one of the following:
+ * ClientId.Scope
+ * ClientId.Audience
+ *
* @return string
*/
public function getCacheKey()
{
- return $this->auth->getClientId() . ':' . $this->auth->getCacheKey();
+ $scopeOrAudience = $this->auth->getScope();
+ if (!$scopeOrAudience) {
+ $scopeOrAudience = $this->auth->getAudience();
+ }
+
+ return $this->auth->getClientId() . '.' . $scopeOrAudience;
}
/**
diff --git a/lib/Google/vendor/google/auth/src/CredentialsLoader.php b/lib/Google/vendor/google/auth/src/CredentialsLoader.php
index 746b957a9..6e21a27c0 100644
--- a/lib/Google/vendor/google/auth/src/CredentialsLoader.php
+++ b/lib/Google/vendor/google/auth/src/CredentialsLoader.php
@@ -85,6 +85,7 @@ public static function fromEnv()
throw new \DomainException(self::unableToReadEnv($cause));
}
$jsonKey = file_get_contents($path);
+
return json_decode((string) $jsonKey, true);
}
@@ -165,15 +166,15 @@ public static function makeCredentials(
*
* @param FetchAuthTokenInterface $fetcher is used to fetch the auth token
* @param array $httpClientOptions (optional) Array of request options to apply.
- * @param callable $httpHandler (optional) http client to fetch the token.
- * @param callable $tokenCallback (optional) function to be called when a new token is fetched.
+ * @param callable|null $httpHandler (optional) http client to fetch the token.
+ * @param callable|null $tokenCallback (optional) function to be called when a new token is fetched.
* @return \GuzzleHttp\Client
*/
public static function makeHttpClient(
FetchAuthTokenInterface $fetcher,
array $httpClientOptions = [],
- callable $httpHandler = null,
- callable $tokenCallback = null
+ ?callable $httpHandler = null,
+ ?callable $tokenCallback = null
) {
$middleware = new Middleware\AuthTokenMiddleware(
$fetcher,
diff --git a/lib/Google/vendor/google/auth/src/ExternalAccountCredentialSourceInterface.php b/lib/Google/vendor/google/auth/src/ExternalAccountCredentialSourceInterface.php
index b4d00f8b4..1492c6991 100644
--- a/lib/Google/vendor/google/auth/src/ExternalAccountCredentialSourceInterface.php
+++ b/lib/Google/vendor/google/auth/src/ExternalAccountCredentialSourceInterface.php
@@ -1,5 +1,5 @@
$cacheConfig Configuration for the cache
+ * @param array|null $cacheConfig Configuration for the cache
* @param CacheItemPoolInterface $cache
*/
public function __construct(
FetchAuthTokenInterface $fetcher,
- array $cacheConfig = null,
- CacheItemPoolInterface $cache
+ ?array $cacheConfig = null,
+ ?CacheItemPoolInterface $cache = null
) {
$this->fetcher = $fetcher;
$this->cache = $cache;
@@ -76,11 +76,11 @@ public function getFetcher()
* Checks the cache for a valid auth token and fetches the auth tokens
* from the supplied fetcher.
*
- * @param callable $httpHandler callback which delivers psr7 request
+ * @param callable|null $httpHandler callback which delivers psr7 request
* @return array the response
* @throws \Exception
*/
- public function fetchAuthToken(callable $httpHandler = null)
+ public function fetchAuthToken(?callable $httpHandler = null)
{
if ($cached = $this->fetchAuthTokenFromCache()) {
return $cached;
@@ -112,10 +112,10 @@ public function getLastReceivedToken()
/**
* Get the client name from the fetcher.
*
- * @param callable $httpHandler An HTTP handler to deliver PSR7 requests.
+ * @param callable|null $httpHandler An HTTP handler to deliver PSR7 requests.
* @return string
*/
- public function getClientName(callable $httpHandler = null)
+ public function getClientName(?callable $httpHandler = null)
{
if (!$this->fetcher instanceof SignBlobInterface) {
throw new \RuntimeException(
@@ -176,15 +176,15 @@ public function getQuotaProject()
return null;
}
- /*
+ /**
* Get the Project ID from the fetcher.
*
- * @param callable $httpHandler Callback which delivers psr7 request
+ * @param callable|null $httpHandler Callback which delivers psr7 request
* @return string|null
* @throws \RuntimeException If the fetcher does not implement
* `Google\Auth\ProvidesProjectIdInterface`.
*/
- public function getProjectId(callable $httpHandler = null)
+ public function getProjectId(?callable $httpHandler = null)
{
if (!$this->fetcher instanceof ProjectIdProviderInterface) {
throw new \RuntimeException(
@@ -227,7 +227,7 @@ public function getUniverseDomain(): string
*
* @param array $metadata metadata hashmap
* @param string $authUri optional auth uri
- * @param callable $httpHandler callback which delivers psr7 request
+ * @param callable|null $httpHandler callback which delivers psr7 request
* @return array updated metadata hashmap
* @throws \RuntimeException If the fetcher does not implement
* `Google\Auth\UpdateMetadataInterface`.
@@ -235,7 +235,7 @@ public function getUniverseDomain(): string
public function updateMetadata(
$metadata,
$authUri = null,
- callable $httpHandler = null
+ ?callable $httpHandler = null
) {
if (!$this->fetcher instanceof UpdateMetadataInterface) {
throw new \RuntimeException(
diff --git a/lib/Google/vendor/google/auth/src/FetchAuthTokenInterface.php b/lib/Google/vendor/google/auth/src/FetchAuthTokenInterface.php
index 64659550b..fbbd8b0c9 100644
--- a/lib/Google/vendor/google/auth/src/FetchAuthTokenInterface.php
+++ b/lib/Google/vendor/google/auth/src/FetchAuthTokenInterface.php
@@ -25,10 +25,10 @@ interface FetchAuthTokenInterface
/**
* Fetches the auth tokens based on the current state.
*
- * @param callable $httpHandler callback which delivers psr7 request
+ * @param callable|null $httpHandler callback which delivers psr7 request
* @return array a hash of auth tokens
*/
- public function fetchAuthToken(callable $httpHandler = null);
+ public function fetchAuthToken(?callable $httpHandler = null);
/**
* Obtains a key that can used to cache the results of #fetchAuthToken.
diff --git a/lib/Google/vendor/google/auth/src/GCECache.php b/lib/Google/vendor/google/auth/src/GCECache.php
index 804abdbe2..d3dcd8c6c 100644
--- a/lib/Google/vendor/google/auth/src/GCECache.php
+++ b/lib/Google/vendor/google/auth/src/GCECache.php
@@ -46,8 +46,8 @@ class GCECache
* @param CacheItemPoolInterface $cache
*/
public function __construct(
- array $cacheConfig = null,
- CacheItemPoolInterface $cache = null
+ ?array $cacheConfig = null,
+ ?CacheItemPoolInterface $cache = null
) {
$this->cache = $cache;
$this->cacheConfig = array_merge([
@@ -60,10 +60,10 @@ public function __construct(
* Caches the result of onGce so the metadata server is not called multiple
* times.
*
- * @param callable $httpHandler callback which delivers psr7 request
+ * @param callable|null $httpHandler callback which delivers psr7 request
* @return bool True if this a GCEInstance, false otherwise
*/
- public function onGce(callable $httpHandler = null)
+ public function onGce(?callable $httpHandler = null)
{
if (is_null($this->cache)) {
return GCECredentials::onGce($httpHandler);
diff --git a/lib/Google/vendor/google/auth/src/HttpHandler/Guzzle6HttpHandler.php b/lib/Google/vendor/google/auth/src/HttpHandler/Guzzle6HttpHandler.php
index 53a8865fd..ee2739eca 100644
--- a/lib/Google/vendor/google/auth/src/HttpHandler/Guzzle6HttpHandler.php
+++ b/lib/Google/vendor/google/auth/src/HttpHandler/Guzzle6HttpHandler.php
@@ -16,23 +16,35 @@
*/
namespace Google\Auth\HttpHandler;
+use Google\Auth\Logging\LoggingTrait;
+use Google\Auth\Logging\RpcLogEvent;
use GuzzleHttp\ClientInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
+use Psr\Log\LoggerInterface;
class Guzzle6HttpHandler
{
+ use LoggingTrait;
+
/**
* @var ClientInterface
*/
private $client;
+ /**
+ * @var null|LoggerInterface
+ */
+ private $logger;
+
/**
* @param ClientInterface $client
+ * @param null|LoggerInterface $logger
*/
- public function __construct(ClientInterface $client)
+ public function __construct(ClientInterface $client, ?LoggerInterface $logger = null)
{
$this->client = $client;
+ $this->logger = $logger;
}
/**
@@ -44,7 +56,19 @@ public function __construct(ClientInterface $client)
*/
public function __invoke(RequestInterface $request, array $options = [])
{
- return $this->client->send($request, $options);
+ $requestEvent = null;
+
+ if ($this->logger) {
+ $requestEvent = $this->requestLog($request, $options);
+ }
+
+ $response = $this->client->send($request, $options);
+
+ if ($this->logger) {
+ $this->responseLog($response, $requestEvent);
+ }
+
+ return $response;
}
/**
@@ -57,6 +81,60 @@ public function __invoke(RequestInterface $request, array $options = [])
*/
public function async(RequestInterface $request, array $options = [])
{
- return $this->client->sendAsync($request, $options);
+ $requestEvent = null;
+
+ if ($this->logger) {
+ $requestEvent = $this->requestLog($request, $options);
+ }
+
+ $promise = $this->client->sendAsync($request, $options);
+
+ if ($this->logger) {
+ $promise->then(function (ResponseInterface $response) use ($requestEvent) {
+ $this->responseLog($response, $requestEvent);
+ return $response;
+ });
+ }
+
+ return $promise;
+ }
+
+ /**
+ * @internal
+ * @param RequestInterface $request
+ * @param array $options
+ */
+ public function requestLog(RequestInterface $request, array $options): RpcLogEvent
+ {
+ $requestEvent = new RpcLogEvent();
+
+ $requestEvent->method = $request->getMethod();
+ $requestEvent->url = (string) $request->getUri();
+ $requestEvent->headers = $request->getHeaders();
+ $requestEvent->payload = $request->getBody()->getContents();
+ $requestEvent->retryAttempt = $options['retryAttempt'] ?? null;
+ $requestEvent->serviceName = $options['serviceName'] ?? null;
+ $requestEvent->processId = (int) getmypid();
+ $requestEvent->requestId = $options['requestId'] ?? crc32((string) spl_object_id($request) . getmypid());
+
+ $this->logRequest($requestEvent);
+
+ return $requestEvent;
+ }
+
+ /**
+ * @internal
+ */
+ public function responseLog(ResponseInterface $response, RpcLogEvent $requestEvent): void
+ {
+ $responseEvent = new RpcLogEvent($requestEvent->milliseconds);
+
+ $responseEvent->headers = $response->getHeaders();
+ $responseEvent->payload = $response->getBody()->getContents();
+ $responseEvent->status = $response->getStatusCode();
+ $responseEvent->processId = $requestEvent->processId;
+ $responseEvent->requestId = $requestEvent->requestId;
+
+ $this->logResponse($responseEvent);
}
}
diff --git a/lib/Google/vendor/google/auth/src/HttpHandler/HttpClientCache.php b/lib/Google/vendor/google/auth/src/HttpHandler/HttpClientCache.php
index f4a62b967..0159c8d09 100644
--- a/lib/Google/vendor/google/auth/src/HttpHandler/HttpClientCache.php
+++ b/lib/Google/vendor/google/auth/src/HttpHandler/HttpClientCache.php
@@ -37,7 +37,7 @@ class HttpClientCache
* @param ClientInterface|null $client
* @return void
*/
- public static function setHttpClient(ClientInterface $client = null)
+ public static function setHttpClient(?ClientInterface $client = null)
{
self::$httpClient = $client;
}
diff --git a/lib/Google/vendor/google/auth/src/HttpHandler/HttpHandlerFactory.php b/lib/Google/vendor/google/auth/src/HttpHandler/HttpHandlerFactory.php
index f19f87443..7b1bf045d 100644
--- a/lib/Google/vendor/google/auth/src/HttpHandler/HttpHandlerFactory.php
+++ b/lib/Google/vendor/google/auth/src/HttpHandler/HttpHandlerFactory.php
@@ -16,23 +16,28 @@
*/
namespace Google\Auth\HttpHandler;
+use Google\Auth\ApplicationDefaultCredentials;
use GuzzleHttp\BodySummarizer;
use GuzzleHttp\Client;
use GuzzleHttp\ClientInterface;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Middleware;
+use Psr\Log\LoggerInterface;
class HttpHandlerFactory
{
/**
* Builds out a default http handler for the installed version of guzzle.
*
- * @param ClientInterface $client
+ * @param ClientInterface|null $client
+ * @param null|false|LoggerInterface $logger
* @return Guzzle6HttpHandler|Guzzle7HttpHandler
* @throws \Exception
*/
- public static function build(ClientInterface $client = null)
- {
+ public static function build(
+ ?ClientInterface $client = null,
+ null|false|LoggerInterface $logger = null,
+ ) {
if (is_null($client)) {
$stack = null;
if (class_exists(BodySummarizer::class)) {
@@ -45,6 +50,10 @@ public static function build(ClientInterface $client = null)
$client = new Client(['handler' => $stack]);
}
+ $logger = ($logger === false)
+ ? null
+ : $logger ?? ApplicationDefaultCredentials::getDefaultLogger();
+
$version = null;
if (defined('GuzzleHttp\ClientInterface::MAJOR_VERSION')) {
$version = ClientInterface::MAJOR_VERSION;
@@ -54,9 +63,9 @@ public static function build(ClientInterface $client = null)
switch ($version) {
case 6:
- return new Guzzle6HttpHandler($client);
+ return new Guzzle6HttpHandler($client, $logger);
case 7:
- return new Guzzle7HttpHandler($client);
+ return new Guzzle7HttpHandler($client, $logger);
default:
throw new \Exception('Version not supported');
}
diff --git a/lib/Google/vendor/google/auth/src/Iam.php b/lib/Google/vendor/google/auth/src/Iam.php
index 2f67f0009..b32ac6065 100644
--- a/lib/Google/vendor/google/auth/src/Iam.php
+++ b/lib/Google/vendor/google/auth/src/Iam.php
@@ -36,6 +36,7 @@ class Iam
const SIGN_BLOB_PATH = '%s:signBlob?alt=json';
const SERVICE_ACCOUNT_NAME = 'projects/-/serviceAccounts/%s';
private const IAM_API_ROOT_TEMPLATE = 'https://iamcredentials.UNIVERSE_DOMAIN/v1';
+ private const GENERATE_ID_TOKEN_PATH = '%s:generateIdToken';
/**
* @var callable
@@ -45,10 +46,10 @@ class Iam
private string $universeDomain;
/**
- * @param callable $httpHandler [optional] The HTTP Handler to send requests.
+ * @param callable|null $httpHandler [optional] The HTTP Handler to send requests.
*/
public function __construct(
- callable $httpHandler = null,
+ ?callable $httpHandler = null,
string $universeDomain = GetUniverseDomainInterface::DEFAULT_UNIVERSE_DOMAIN
) {
$this->httpHandler = $httpHandler
@@ -73,7 +74,6 @@ public function __construct(
*/
public function signBlob($email, $accessToken, $stringToSign, array $delegates = [])
{
- $httpHandler = $this->httpHandler;
$name = sprintf(self::SERVICE_ACCOUNT_NAME, $email);
$apiRoot = str_replace('UNIVERSE_DOMAIN', $this->universeDomain, self::IAM_API_ROOT_TEMPLATE);
$uri = $apiRoot . '/' . sprintf(self::SIGN_BLOB_PATH, $name);
@@ -102,9 +102,54 @@ public function signBlob($email, $accessToken, $stringToSign, array $delegates =
Utils::streamFor(json_encode($body))
);
- $res = $httpHandler($request);
+ $res = ($this->httpHandler)($request);
$body = json_decode((string) $res->getBody(), true);
return $body['signedBlob'];
}
+
+ /**
+ * Sign a string using the IAM signBlob API.
+ *
+ * Note that signing using IAM requires your service account to have the
+ * `iam.serviceAccounts.signBlob` permission, part of the "Service Account
+ * Token Creator" IAM role.
+ *
+ * @param string $clientEmail The service account email.
+ * @param string $targetAudience The audience for the ID token.
+ * @param string $bearerToken The token to authenticate the IAM request.
+ * @param array $headers [optional] Additional headers to send with the request.
+ *
+ * @return string The signed string, base64-encoded.
+ */
+ public function generateIdToken(
+ string $clientEmail,
+ string $targetAudience,
+ string $bearerToken,
+ array $headers = []
+ ): string {
+ $name = sprintf(self::SERVICE_ACCOUNT_NAME, $clientEmail);
+ $apiRoot = str_replace('UNIVERSE_DOMAIN', $this->universeDomain, self::IAM_API_ROOT_TEMPLATE);
+ $uri = $apiRoot . '/' . sprintf(self::GENERATE_ID_TOKEN_PATH, $name);
+
+ $headers['Authorization'] = 'Bearer ' . $bearerToken;
+
+ $body = [
+ 'audience' => $targetAudience,
+ 'includeEmail' => true,
+ 'useEmailAzp' => true,
+ ];
+
+ $request = new Psr7\Request(
+ 'POST',
+ $uri,
+ $headers,
+ Utils::streamFor(json_encode($body))
+ );
+
+ $res = ($this->httpHandler)($request);
+ $body = json_decode((string) $res->getBody(), true);
+
+ return $body['token'];
+ }
}
diff --git a/lib/Google/vendor/google/auth/src/Logging/LoggingTrait.php b/lib/Google/vendor/google/auth/src/Logging/LoggingTrait.php
new file mode 100644
index 000000000..2441a9bd7
--- /dev/null
+++ b/lib/Google/vendor/google/auth/src/Logging/LoggingTrait.php
@@ -0,0 +1,137 @@
+ $event->timestamp,
+ 'severity' => strtoupper(LogLevel::DEBUG),
+ 'processId' => $event->processId ?? null,
+ 'requestId' => $event->requestId ?? null,
+ ];
+
+ $debugEvent = array_filter($debugEvent, fn ($value) => !is_null($value));
+
+ $jsonPayload = [
+ 'request.method' => $event->method,
+ 'request.url' => $event->url,
+ 'request.headers' => $event->headers,
+ 'request.payload' => $this->truncatePayload($event->payload),
+ 'request.jwt' => $this->getJwtToken($event->headers ?? []),
+ 'retryAttempt' => $event->retryAttempt
+ ];
+
+ // Remove null values
+ $debugEvent['jsonPayload'] = array_filter($jsonPayload, fn ($value) => !is_null($value));
+
+ $stringifiedEvent = json_encode($debugEvent, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
+
+ // There was an error stringifying the event, return to not break execution
+ if ($stringifiedEvent === false) {
+ return;
+ }
+
+ $this->logger->debug($stringifiedEvent);
+ }
+
+ /**
+ * @param RpcLogEvent $event
+ */
+ private function logResponse(RpcLogEvent $event): void
+ {
+ $debugEvent = [
+ 'timestamp' => $event->timestamp,
+ 'severity' => strtoupper(LogLevel::DEBUG),
+ 'processId' => $event->processId ?? null,
+ 'requestId' => $event->requestId ?? null,
+ 'jsonPayload' => [
+ 'response.status' => $event->status,
+ 'response.headers' => $event->headers,
+ 'response.payload' => $this->truncatePayload($event->payload),
+ 'latencyMillis' => $event->latency,
+ ]
+ ];
+
+ // Remove null values
+ $debugEvent = array_filter($debugEvent, fn ($value) => !is_null($value));
+ $debugEvent['jsonPayload'] = array_filter(
+ $debugEvent['jsonPayload'],
+ fn ($value) => !is_null($value)
+ );
+
+ $stringifiedEvent = json_encode($debugEvent, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
+
+ // There was an error stringifying the event, return to not break execution
+ if ($stringifiedEvent !== false) {
+ $this->logger->debug($stringifiedEvent);
+ }
+ }
+
+ /**
+ * @param array $headers
+ * @return null|array
+ */
+ private function getJwtToken(array $headers): null|array
+ {
+ if (empty($headers)) {
+ return null;
+ }
+
+ $tokenHeader = $headers['Authorization'] ?? '';
+ $token = str_replace('Bearer ', '', $tokenHeader);
+
+ if (substr_count($token, '.') !== 2) {
+ return null;
+ }
+
+ [$header, $token, $_] = explode('.', $token);
+
+ return [
+ 'header' => base64_decode($header),
+ 'token' => base64_decode($token)
+ ];
+ }
+
+ /**
+ * @param null|string $payload
+ * @return string
+ */
+ private function truncatePayload(null|string $payload): null|string
+ {
+ $maxLength = 500;
+
+ if (is_null($payload) || strlen($payload) <= $maxLength) {
+ return $payload;
+ }
+
+ return substr($payload, 0, $maxLength) . '...';
+ }
+}
diff --git a/lib/Google/vendor/google/auth/src/Logging/RpcLogEvent.php b/lib/Google/vendor/google/auth/src/Logging/RpcLogEvent.php
new file mode 100644
index 000000000..50e89fe2f
--- /dev/null
+++ b/lib/Google/vendor/google/auth/src/Logging/RpcLogEvent.php
@@ -0,0 +1,136 @@
+
+ */
+ public null|array $headers = null;
+
+ /**
+ * An array representation of JSON for the response or request
+ *
+ * @var null|string
+ */
+ public null|string $payload = null;
+
+ /**
+ * Status code for REST or gRPC methods
+ *
+ * @var null|int|string
+ */
+ public null|int|string $status = null;
+
+ /**
+ * The latency in milliseconds
+ *
+ * @var null|int
+ */
+ public null|int $latency = null;
+
+ /**
+ * The retry attempt number
+ *
+ * @var null|int
+ */
+ public null|int $retryAttempt = null;
+
+ /**
+ * The name of the gRPC method being called
+ *
+ * @var null|string
+ */
+ public null|string $rpcName = null;
+
+ /**
+ * The Service Name of the gRPC
+ *
+ * @var null|string $serviceName
+ */
+ public null|string $serviceName = null;
+
+ /**
+ * The Process ID for tracing logs
+ *
+ * @var null|int $processId
+ */
+ public null|int $processId = null;
+
+ /**
+ * The Request id for tracing logs
+ *
+ * @var null|int $requestId;
+ */
+ public null|int $requestId = null;
+
+ /**
+ * Creates an object with all the fields required for logging
+ * Passing a string representation of a timestamp calculates the difference between
+ * these two times and sets the latency field with the result.
+ *
+ * @param null|float $startTime (Optional) Parameter to calculate the latency
+ */
+ public function __construct(null|float $startTime = null)
+ {
+ $this->timestamp = date(DATE_RFC3339);
+
+ // Takes the micro time and convets it to millis
+ $this->milliseconds = round(microtime(true) * 1000);
+
+ if ($startTime) {
+ $this->latency = (int) round($this->milliseconds - $startTime);
+ }
+ }
+}
diff --git a/lib/Google/vendor/google/auth/src/Logging/StdOutLogger.php b/lib/Google/vendor/google/auth/src/Logging/StdOutLogger.php
new file mode 100644
index 000000000..27b1f0eb3
--- /dev/null
+++ b/lib/Google/vendor/google/auth/src/Logging/StdOutLogger.php
@@ -0,0 +1,85 @@
+
+ */
+ private array $levelMapping = [
+ LogLevel::EMERGENCY => 7,
+ LogLevel::ALERT => 6,
+ LogLevel::CRITICAL => 5,
+ LogLevel::ERROR => 4,
+ LogLevel::WARNING => 3,
+ LogLevel::NOTICE => 2,
+ LogLevel::INFO => 1,
+ LogLevel::DEBUG => 0,
+ ];
+ private int $level;
+
+ /**
+ * Constructs a basic PSR-3 logger class that logs into StdOut for GCP Logging
+ *
+ * @param string $level The level of the logger instance.
+ */
+ public function __construct(string $level = LogLevel::DEBUG)
+ {
+ $this->level = $this->getLevelFromName($level);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function log($level, string|Stringable $message, array $context = []): void
+ {
+ if ($this->getLevelFromName($level) < $this->level) {
+ return;
+ }
+
+ print($message . "\n");
+ }
+
+ /**
+ * @param string $levelName
+ * @return int
+ * @throws InvalidArgumentException
+ */
+ private function getLevelFromName(string $levelName): int
+ {
+ if (!array_key_exists($levelName, $this->levelMapping)) {
+ throw new InvalidArgumentException('The level supplied to the Logger is not valid');
+ }
+
+ return $this->levelMapping[$levelName];
+ }
+}
diff --git a/lib/Google/vendor/google/auth/src/Middleware/AuthTokenMiddleware.php b/lib/Google/vendor/google/auth/src/Middleware/AuthTokenMiddleware.php
index 798766efa..b8f2c514c 100644
--- a/lib/Google/vendor/google/auth/src/Middleware/AuthTokenMiddleware.php
+++ b/lib/Google/vendor/google/auth/src/Middleware/AuthTokenMiddleware.php
@@ -59,13 +59,13 @@ class AuthTokenMiddleware
* Creates a new AuthTokenMiddleware.
*
* @param FetchAuthTokenInterface $fetcher is used to fetch the auth token
- * @param callable $httpHandler (optional) callback which delivers psr7 request
- * @param callable $tokenCallback (optional) function to be called when a new token is fetched.
+ * @param callable|null $httpHandler (optional) callback which delivers psr7 request
+ * @param callable|null $tokenCallback (optional) function to be called when a new token is fetched.
*/
public function __construct(
FetchAuthTokenInterface $fetcher,
- callable $httpHandler = null,
- callable $tokenCallback = null
+ ?callable $httpHandler = null,
+ ?callable $tokenCallback = null
) {
$this->fetcher = $fetcher;
$this->httpHandler = $httpHandler;
@@ -132,7 +132,8 @@ private function addAuthHeaders(RequestInterface $request)
) {
$token = $this->fetcher->fetchAuthToken();
$request = $request->withHeader(
- 'authorization', 'Bearer ' . ($token['access_token'] ?? $token['id_token'] ?? '')
+ 'authorization',
+ 'Bearer ' . ($token['access_token'] ?? $token['id_token'] ?? '')
);
} else {
$headers = $this->fetcher->updateMetadata($request->getHeaders(), null, $this->httpHandler);
diff --git a/lib/Google/vendor/google/auth/src/Middleware/ProxyAuthTokenMiddleware.php b/lib/Google/vendor/google/auth/src/Middleware/ProxyAuthTokenMiddleware.php
index 0f9ee429f..2c44871f9 100644
--- a/lib/Google/vendor/google/auth/src/Middleware/ProxyAuthTokenMiddleware.php
+++ b/lib/Google/vendor/google/auth/src/Middleware/ProxyAuthTokenMiddleware.php
@@ -53,13 +53,13 @@ class ProxyAuthTokenMiddleware
* Creates a new ProxyAuthTokenMiddleware.
*
* @param FetchAuthTokenInterface $fetcher is used to fetch the auth token
- * @param callable $httpHandler (optional) callback which delivers psr7 request
- * @param callable $tokenCallback (optional) function to be called when a new token is fetched.
+ * @param callable|null $httpHandler (optional) callback which delivers psr7 request
+ * @param callable|null $tokenCallback (optional) function to be called when a new token is fetched.
*/
public function __construct(
FetchAuthTokenInterface $fetcher,
- callable $httpHandler = null,
- callable $tokenCallback = null
+ ?callable $httpHandler = null,
+ ?callable $tokenCallback = null
) {
$this->fetcher = $fetcher;
$this->httpHandler = $httpHandler;
diff --git a/lib/Google/vendor/google/auth/src/Middleware/ScopedAccessTokenMiddleware.php b/lib/Google/vendor/google/auth/src/Middleware/ScopedAccessTokenMiddleware.php
index 8bb1d7a0b..f2f85cc16 100644
--- a/lib/Google/vendor/google/auth/src/Middleware/ScopedAccessTokenMiddleware.php
+++ b/lib/Google/vendor/google/auth/src/Middleware/ScopedAccessTokenMiddleware.php
@@ -54,14 +54,14 @@ class ScopedAccessTokenMiddleware
*
* @param callable $tokenFunc a token generator function
* @param array|string $scopes the token authentication scopes
- * @param array $cacheConfig configuration for the cache when it's present
- * @param CacheItemPoolInterface $cache an implementation of CacheItemPoolInterface
+ * @param array|null $cacheConfig configuration for the cache when it's present
+ * @param CacheItemPoolInterface|null $cache an implementation of CacheItemPoolInterface
*/
public function __construct(
callable $tokenFunc,
$scopes,
- array $cacheConfig = null,
- CacheItemPoolInterface $cache = null
+ ?array $cacheConfig = null,
+ ?CacheItemPoolInterface $cache = null
) {
$this->tokenFunc = $tokenFunc;
if (!(is_string($scopes) || is_array($scopes))) {
diff --git a/lib/Google/vendor/google/auth/src/OAuth2.php b/lib/Google/vendor/google/auth/src/OAuth2.php
index b1f9ae26d..c60b8827f 100644
--- a/lib/Google/vendor/google/auth/src/OAuth2.php
+++ b/lib/Google/vendor/google/auth/src/OAuth2.php
@@ -581,12 +581,12 @@ public function toJwt(array $config = [])
/**
* Generates a request for token credentials.
*
- * @param callable $httpHandler callback which delivers psr7 request
+ * @param callable|null $httpHandler callback which delivers psr7 request
* @param array $headers [optional] Additional headers to pass to
* the token endpoint request.
* @return RequestInterface the authorization Url.
*/
- public function generateCredentialsRequest(callable $httpHandler = null, $headers = [])
+ public function generateCredentialsRequest(?callable $httpHandler = null, array $headers = [])
{
$uri = $this->getTokenCredentialUri();
if (is_null($uri)) {
@@ -611,6 +611,9 @@ public function generateCredentialsRequest(callable $httpHandler = null, $header
break;
case 'refresh_token':
$params['refresh_token'] = $this->getRefreshToken();
+ if (isset($this->getAdditionalClaims()['target_audience'])) {
+ $params['target_audience'] = $this->getAdditionalClaims()['target_audience'];
+ }
$this->addClientCredentials($params);
break;
case self::JWT_URN:
@@ -661,12 +664,12 @@ public function generateCredentialsRequest(callable $httpHandler = null, $header
/**
* Fetches the auth tokens based on the current state.
*
- * @param callable $httpHandler callback which delivers psr7 request
+ * @param callable|null $httpHandler callback which delivers psr7 request
* @param array $headers [optional] If present, add these headers to the token
* endpoint request.
* @return array the response
*/
- public function fetchAuthToken(callable $httpHandler = null, $headers = [])
+ public function fetchAuthToken(?callable $httpHandler = null, array $headers = [])
{
if (is_null($httpHandler)) {
$httpHandler = HttpHandlerFactory::build(HttpClientCache::getHttpClient());
@@ -683,6 +686,8 @@ public function fetchAuthToken(callable $httpHandler = null, $headers = [])
}
/**
+ * @deprecated
+ *
* Obtains a key that can used to cache the results of #fetchAuthToken.
*
* The key is derived from the scopes.
@@ -703,6 +708,16 @@ public function getCacheKey()
return null;
}
+ /**
+ * Gets this instance's SubjectTokenFetcher
+ *
+ * @return null|ExternalAccountCredentialSourceInterface
+ */
+ public function getSubjectTokenFetcher(): ?ExternalAccountCredentialSourceInterface
+ {
+ return $this->subjectTokenFetcher;
+ }
+
/**
* Parses the fetched tokens.
*
@@ -712,7 +727,7 @@ public function getCacheKey()
*/
public function parseTokenResponse(ResponseInterface $resp)
{
- $body = (string)$resp->getBody();
+ $body = (string) $resp->getBody();
if ($resp->hasHeader('Content-Type') &&
$resp->getHeaderLine('Content-Type') == 'application/x-www-form-urlencoded'
) {
@@ -997,13 +1012,13 @@ public function setRedirectUri($uri)
if (!$this->isAbsoluteUri($uri)) {
// "postmessage" is a reserved URI string in Google-land
// @see https://developers.google.com/identity/sign-in/web/server-side-flow
- if ('postmessage' !== (string)$uri) {
+ if ('postmessage' !== (string) $uri) {
throw new InvalidArgumentException(
'Redirect URI must be absolute'
);
}
}
- $this->redirectUri = (string)$uri;
+ $this->redirectUri = (string) $uri;
}
/**
@@ -1020,6 +1035,16 @@ public function getScope()
return implode(' ', $this->scope);
}
+ /**
+ * Gets the subject token type
+ *
+ * @return ?string
+ */
+ public function getSubjectTokenType(): ?string
+ {
+ return $this->subjectTokenType;
+ }
+
/**
* Sets the scope of the access request, expressed either as an Array or as
* a space-delimited String.
@@ -1105,7 +1130,7 @@ public function setGrantType($grantType)
'invalid grant type'
);
}
- $this->grantType = (string)$grantType;
+ $this->grantType = (string) $grantType;
}
}
@@ -1438,7 +1463,7 @@ public function setExpiresIn($expiresIn)
$this->issuedAt = null;
} else {
$this->issuedAt = time();
- $this->expiresIn = (int)$expiresIn;
+ $this->expiresIn = (int) $expiresIn;
}
}
@@ -1661,11 +1686,11 @@ public function getLastReceivedToken()
*
* Alias of {@see Google\Auth\OAuth2::getClientId()}.
*
- * @param callable $httpHandler
+ * @param callable|null $httpHandler
* @return string
* @access private
*/
- public function getClientName(callable $httpHandler = null)
+ public function getClientName(?callable $httpHandler = null)
{
return $this->getClientId();
}
@@ -1746,7 +1771,8 @@ private function getFirebaseJwtKeys($publicKey, $allowedAlgs)
throw new \InvalidArgumentException(
'To have multiple allowed algorithms, You must provide an'
. ' array of Firebase\JWT\Key objects.'
- . ' See https://github.com/firebase/php-jwt for more information.');
+ . ' See https://github.com/firebase/php-jwt for more information.'
+ );
}
$allowedAlg = array_pop($allowedAlgs);
} else {
diff --git a/lib/Google/vendor/google/auth/src/ProjectIdProviderInterface.php b/lib/Google/vendor/google/auth/src/ProjectIdProviderInterface.php
index 0a41f7832..8d10c293a 100644
--- a/lib/Google/vendor/google/auth/src/ProjectIdProviderInterface.php
+++ b/lib/Google/vendor/google/auth/src/ProjectIdProviderInterface.php
@@ -25,8 +25,8 @@ interface ProjectIdProviderInterface
/**
* Get the project ID.
*
- * @param callable $httpHandler Callback which delivers psr7 request
+ * @param callable|null $httpHandler Callback which delivers psr7 request
* @return string|null
*/
- public function getProjectId(callable $httpHandler = null);
+ public function getProjectId(?callable $httpHandler = null);
}
diff --git a/lib/Google/vendor/google/auth/src/SignBlobInterface.php b/lib/Google/vendor/google/auth/src/SignBlobInterface.php
index 5f2c94414..b3c2b0505 100644
--- a/lib/Google/vendor/google/auth/src/SignBlobInterface.php
+++ b/lib/Google/vendor/google/auth/src/SignBlobInterface.php
@@ -36,9 +36,9 @@ public function signBlob($stringToSign, $forceOpenssl = false);
/**
* Returns the current Client Name.
*
- * @param callable $httpHandler callback which delivers psr7 request, if
+ * @param callable|null $httpHandler callback which delivers psr7 request, if
* one is required to obtain a client name.
* @return string
*/
- public function getClientName(callable $httpHandler = null);
+ public function getClientName(?callable $httpHandler = null);
}
diff --git a/lib/Google/vendor/google/auth/src/UpdateMetadataInterface.php b/lib/Google/vendor/google/auth/src/UpdateMetadataInterface.php
index 6d2e7d5d5..5cf5b42cc 100644
--- a/lib/Google/vendor/google/auth/src/UpdateMetadataInterface.php
+++ b/lib/Google/vendor/google/auth/src/UpdateMetadataInterface.php
@@ -30,12 +30,12 @@ interface UpdateMetadataInterface
*
* @param array $metadata metadata hashmap
* @param string $authUri optional auth uri
- * @param callable $httpHandler callback which delivers psr7 request
+ * @param callable|null $httpHandler callback which delivers psr7 request
* @return array updated metadata hashmap
*/
public function updateMetadata(
$metadata,
$authUri = null,
- callable $httpHandler = null
+ ?callable $httpHandler = null
);
}
diff --git a/lib/Google/vendor/google/auth/src/UpdateMetadataTrait.php b/lib/Google/vendor/google/auth/src/UpdateMetadataTrait.php
index 30d4060cf..486ec72a5 100644
--- a/lib/Google/vendor/google/auth/src/UpdateMetadataTrait.php
+++ b/lib/Google/vendor/google/auth/src/UpdateMetadataTrait.php
@@ -44,13 +44,13 @@ public function getUpdateMetadataFunc()
*
* @param array $metadata metadata hashmap
* @param string $authUri optional auth uri
- * @param callable $httpHandler callback which delivers psr7 request
+ * @param callable|null $httpHandler callback which delivers psr7 request
* @return array updated metadata hashmap
*/
public function updateMetadata(
$metadata,
$authUri = null,
- callable $httpHandler = null
+ ?callable $httpHandler = null
) {
$metadata_copy = $metadata;
diff --git a/lib/Google/vendor/google/cloud-core/README.md b/lib/Google/vendor/google/cloud-core/README.md
index 8c5e4b332..0f9dde29c 100644
--- a/lib/Google/vendor/google/cloud-core/README.md
+++ b/lib/Google/vendor/google/cloud-core/README.md
@@ -17,6 +17,11 @@ to the rest of the Google Cloud PHP components.
$ composer require google/cloud-core
```
+### Debugging
+
+Please see our [Debugging guide](https://github.com/googleapis/google-cloud-php/blob/main/DEBUG.md)
+for more information about the debugging tools.
+
### Version
This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in
diff --git a/lib/Google/vendor/google/cloud-core/VERSION b/lib/Google/vendor/google/cloud-core/VERSION
index 5b1ab2700..f6c9d766c 100644
--- a/lib/Google/vendor/google/cloud-core/VERSION
+++ b/lib/Google/vendor/google/cloud-core/VERSION
@@ -1 +1 @@
-1.59.1
+1.60.1
diff --git a/lib/Google/vendor/google/cloud-core/composer.json b/lib/Google/vendor/google/cloud-core/composer.json
index f84a2979e..5c526a903 100644
--- a/lib/Google/vendor/google/cloud-core/composer.json
+++ b/lib/Google/vendor/google/cloud-core/composer.json
@@ -12,13 +12,13 @@
"guzzlehttp/psr7": "^2.6",
"monolog/monolog": "^2.9|^3.0",
"psr/http-message": "^1.0|^2.0",
- "google/gax": "^1.34.0"
+ "google/gax": "^1.36.0"
},
"require-dev": {
"phpunit/phpunit": "^9.0",
"phpspec/prophecy-phpunit": "^2.0",
"squizlabs/php_codesniffer": "2.*",
- "phpdocumentor/reflection": "^5.3.3",
+ "phpdocumentor/reflection": "^5.3.3||^6.0",
"phpdocumentor/reflection-docblock": "^5.3",
"erusev/parsedown": "^1.6",
"opis/closure": "^3",
diff --git a/lib/Google/vendor/google/cloud-core/snippet-bootstrap.php b/lib/Google/vendor/google/cloud-core/snippet-bootstrap.php
index 156f1a322..39897661f 100644
--- a/lib/Google/vendor/google/cloud-core/snippet-bootstrap.php
+++ b/lib/Google/vendor/google/cloud-core/snippet-bootstrap.php
@@ -1,7 +1,7 @@
token;
}
@@ -81,7 +81,7 @@ public function getLastReceivedToken()
public function updateMetadata(
$metadata,
$authUri = null,
- callable $httpHandler = null
+ ?callable $httpHandler = null
) {
return $metadata;
}
diff --git a/lib/Google/vendor/google/cloud-core/src/ApiHelperTrait.php b/lib/Google/vendor/google/cloud-core/src/ApiHelperTrait.php
index d9900ea22..245b7e962 100644
--- a/lib/Google/vendor/google/cloud-core/src/ApiHelperTrait.php
+++ b/lib/Google/vendor/google/cloud-core/src/ApiHelperTrait.php
@@ -20,7 +20,6 @@
use Google\ApiCore\ArrayTrait;
use Google\ApiCore\Options\CallOptions;
use Google\Protobuf\NullValue;
-use Google\Cloud\Core\Duration;
/**
* @internal
@@ -176,7 +175,7 @@ private function formatTimestampFromApi(array $timestamp)
*/
private function formatTimestampForApi($value)
{
- list ($dt, $nanos) = $this->parseTimeString($value);
+ list($dt, $nanos) = $this->parseTimeString($value);
return [
'seconds' => (int) $dt->format('U'),
@@ -239,11 +238,11 @@ protected function constructGapic($gapicName, array $config)
*
* @return array The modified array
*/
- private function convertDataToProtos(array $input, array $map) : array
+ private function convertDataToProtos(array $input, array $map): array
{
foreach ($map as $key => $className) {
if (isset($input[$key])) {
- $input[$key] = $this->serializer->decodeMessage(new $className, $input[$key]);
+ $input[$key] = $this->serializer->decodeMessage(new $className(), $input[$key]);
}
}
@@ -256,7 +255,7 @@ private function convertDataToProtos(array $input, array $map) : array
* We strictly treat the parameters allowed by `CallOptions` in GAX as the optional params
* and everything else that is passed is passed to the Proto message constructor.
*/
- private function splitOptionalArgs(array $input, array $extraAllowedKeys = []) : array
+ private function splitOptionalArgs(array $input, array $extraAllowedKeys = []): array
{
$callOptionFields = array_keys((new CallOptions([]))->toArray());
$keys = array_merge($callOptionFields, $extraAllowedKeys);
diff --git a/lib/Google/vendor/google/cloud-core/src/Batch/BatchRunner.php b/lib/Google/vendor/google/cloud-core/src/Batch/BatchRunner.php
index b2b55983e..0ee47ca57 100644
--- a/lib/Google/vendor/google/cloud-core/src/Batch/BatchRunner.php
+++ b/lib/Google/vendor/google/cloud-core/src/Batch/BatchRunner.php
@@ -57,8 +57,8 @@ class BatchRunner
* to use. **Defaults to** null. This is only for testing purpose.
*/
public function __construct(
- ConfigStorageInterface $configStorage = null,
- ProcessItemInterface $processor = null
+ ?ConfigStorageInterface $configStorage = null,
+ ?ProcessItemInterface $processor = null
) {
if ($configStorage === null || $processor === null) {
if ($this->isSysvIPCLoaded() && $this->isDaemonRunning()) {
diff --git a/lib/Google/vendor/google/cloud-core/src/Batch/BatchTrait.php b/lib/Google/vendor/google/cloud-core/src/Batch/BatchTrait.php
index 3ac284cf1..591410e62 100644
--- a/lib/Google/vendor/google/cloud-core/src/Batch/BatchTrait.php
+++ b/lib/Google/vendor/google/cloud-core/src/Batch/BatchTrait.php
@@ -17,8 +17,6 @@
namespace Google\Cloud\Core\Batch;
-use Opis\Closure\SerializableClosure;
-
/**
* A trait to assist in the registering and processing of batch jobs.
*
diff --git a/lib/Google/vendor/google/cloud-core/src/Batch/InterruptTrait.php b/lib/Google/vendor/google/cloud-core/src/Batch/InterruptTrait.php
index dae64456f..88ef74be6 100644
--- a/lib/Google/vendor/google/cloud-core/src/Batch/InterruptTrait.php
+++ b/lib/Google/vendor/google/cloud-core/src/Batch/InterruptTrait.php
@@ -32,10 +32,10 @@ trait InterruptTrait
private function setupSignalHandlers()
{
// setup signal handlers
- pcntl_signal(SIGTERM, [$this, "sigHandler"]);
- pcntl_signal(SIGINT, [$this, "sigHandler"]);
- pcntl_signal(SIGHUP, [$this, "sigHandler"]);
- pcntl_signal(SIGALRM, [$this, "sigHandler"]);
+ pcntl_signal(SIGTERM, [$this, 'sigHandler']);
+ pcntl_signal(SIGINT, [$this, 'sigHandler']);
+ pcntl_signal(SIGHUP, [$this, 'sigHandler']);
+ pcntl_signal(SIGALRM, [$this, 'sigHandler']);
}
/**
diff --git a/lib/Google/vendor/google/cloud-core/src/Batch/Retry.php b/lib/Google/vendor/google/cloud-core/src/Batch/Retry.php
index 483c7eb3d..8f66863ec 100644
--- a/lib/Google/vendor/google/cloud-core/src/Batch/Retry.php
+++ b/lib/Google/vendor/google/cloud-core/src/Batch/Retry.php
@@ -37,7 +37,7 @@ class Retry
*
* @param BatchRunner $runner [optional] **Defaults to** a new BatchRunner.
*/
- public function __construct(BatchRunner $runner = null)
+ public function __construct(?BatchRunner $runner = null)
{
$this->runner = $runner ?: new BatchRunner();
$this->initFailureFile();
diff --git a/lib/Google/vendor/google/cloud-core/src/ClientTrait.php b/lib/Google/vendor/google/cloud-core/src/ClientTrait.php
index 5df03e152..2bd86cc1c 100644
--- a/lib/Google/vendor/google/cloud-core/src/ClientTrait.php
+++ b/lib/Google/vendor/google/cloud-core/src/ClientTrait.php
@@ -17,8 +17,8 @@
namespace Google\Cloud\Core;
-use Google\Auth\CredentialsLoader;
use Google\Auth\Credentials\GCECredentials;
+use Google\Auth\CredentialsLoader;
use Google\Cloud\Core\Compute\Metadata;
use Google\Cloud\Core\Exception\GoogleException;
@@ -256,7 +256,7 @@ protected function onGce($httpHandler)
*/
protected function getMetaData()
{
- return new Metadata;
+ return new Metadata();
}
/**
diff --git a/lib/Google/vendor/google/cloud-core/src/Compute/Metadata.php b/lib/Google/vendor/google/cloud-core/src/Compute/Metadata.php
index 0f34adb5e..15a5eea02 100644
--- a/lib/Google/vendor/google/cloud-core/src/Compute/Metadata.php
+++ b/lib/Google/vendor/google/cloud-core/src/Compute/Metadata.php
@@ -59,7 +59,7 @@ class Metadata
/**
* @param ReaderInterface $reader [optional] A metadata reader implementation.
*/
- public function __construct(ReaderInterface $reader = null)
+ public function __construct(?ReaderInterface $reader = null)
{
$this->reader = $reader ?: new HttpHandlerReader();
}
@@ -142,7 +142,7 @@ public function getNumericProjectId()
*/
public function getProjectMetadata($key)
{
- $path = 'project/attributes/'.$key;
+ $path = 'project/attributes/' . $key;
return $this->get($path);
}
@@ -159,7 +159,7 @@ public function getProjectMetadata($key)
*/
public function getInstanceMetadata($key)
{
- $path = 'instance/attributes/'.$key;
+ $path = 'instance/attributes/' . $key;
return $this->get($path);
}
}
diff --git a/lib/Google/vendor/google/cloud-core/src/Compute/Metadata/Readers/HttpHandlerReader.php b/lib/Google/vendor/google/cloud-core/src/Compute/Metadata/Readers/HttpHandlerReader.php
index d1d7b1530..a057b138c 100644
--- a/lib/Google/vendor/google/cloud-core/src/Compute/Metadata/Readers/HttpHandlerReader.php
+++ b/lib/Google/vendor/google/cloud-core/src/Compute/Metadata/Readers/HttpHandlerReader.php
@@ -36,7 +36,7 @@ class HttpHandlerReader implements ReaderInterface
* @param callable $httpHandler [optional] An HTTP Handler capable of
* accepting PSR7 requests and returning PSR7 responses.
*/
- public function __construct(callable $httpHandler = null)
+ public function __construct(?callable $httpHandler = null)
{
$this->httpHandler = $httpHandler
?: HttpHandlerFactory::build(HttpClientCache::getHttpClient());
diff --git a/lib/Google/vendor/google/cloud-core/src/DetectProjectIdTrait.php b/lib/Google/vendor/google/cloud-core/src/DetectProjectIdTrait.php
index 8cd853076..f0ce26db9 100644
--- a/lib/Google/vendor/google/cloud-core/src/DetectProjectIdTrait.php
+++ b/lib/Google/vendor/google/cloud-core/src/DetectProjectIdTrait.php
@@ -71,7 +71,7 @@ private function detectProjectId(array $config)
if ($config['credentials']
&& $config['credentials'] instanceof ProjectIdProviderInterface
&& $projectId = $config['credentials']->getProjectId()) {
- return $projectId;
+ return $projectId;
}
if (getenv('GOOGLE_CLOUD_PROJECT')) {
diff --git a/lib/Google/vendor/google/cloud-core/src/Exception/ServiceException.php b/lib/Google/vendor/google/cloud-core/src/Exception/ServiceException.php
index b601eb677..0db353d6f 100644
--- a/lib/Google/vendor/google/cloud-core/src/Exception/ServiceException.php
+++ b/lib/Google/vendor/google/cloud-core/src/Exception/ServiceException.php
@@ -65,7 +65,7 @@ class ServiceException extends GoogleException
public function __construct(
$message = null,
$code = 0,
- Exception $serviceException = null,
+ ?Exception $serviceException = null,
array $metadata = []
) {
$this->serviceException = $serviceException;
diff --git a/lib/Google/vendor/google/cloud-core/src/ExponentialBackoff.php b/lib/Google/vendor/google/cloud-core/src/ExponentialBackoff.php
index e5a041311..58eea5ee7 100644
--- a/lib/Google/vendor/google/cloud-core/src/ExponentialBackoff.php
+++ b/lib/Google/vendor/google/cloud-core/src/ExponentialBackoff.php
@@ -64,8 +64,8 @@ class ExponentialBackoff
*/
public function __construct(
$retries = null,
- callable $retryFunction = null,
- callable $retryListener = null
+ ?callable $retryFunction = null,
+ ?callable $retryListener = null
) {
$this->retries = $retries !== null ? (int) $retries : 3;
$this->retryFunction = $retryFunction;
diff --git a/lib/Google/vendor/google/cloud-core/src/GrpcRequestWrapper.php b/lib/Google/vendor/google/cloud-core/src/GrpcRequestWrapper.php
index 9f8d3b50b..7bcfa7601 100644
--- a/lib/Google/vendor/google/cloud-core/src/GrpcRequestWrapper.php
+++ b/lib/Google/vendor/google/cloud-core/src/GrpcRequestWrapper.php
@@ -17,10 +17,9 @@
namespace Google\Cloud\Core;
-use Google\Auth\HttpHandler\HttpHandlerFactory;
-use Google\Cloud\Core\Exception;
use Google\ApiCore\ApiException;
use Google\ApiCore\Serializer;
+use Google\Auth\HttpHandler\HttpHandlerFactory;
use Google\Rpc\Code;
/**
@@ -77,7 +76,7 @@ public function __construct(array $config = [])
$config += [
'authHttpHandler' => null,
- 'serializer' => new Serializer,
+ 'serializer' => new Serializer(),
'grpcOptions' => []
];
diff --git a/lib/Google/vendor/google/cloud-core/src/GrpcTrait.php b/lib/Google/vendor/google/cloud-core/src/GrpcTrait.php
index bab9d6d32..fac9527d7 100644
--- a/lib/Google/vendor/google/cloud-core/src/GrpcTrait.php
+++ b/lib/Google/vendor/google/cloud-core/src/GrpcTrait.php
@@ -17,13 +17,11 @@
namespace Google\Cloud\Core;
-use Google\Auth\GetUniverseDomainInterface;
use Google\ApiCore\CredentialsWrapper;
+use Google\Auth\GetUniverseDomainInterface;
use Google\Cloud\Core\Exception\NotFoundException;
use Google\Cloud\Core\Exception\ServiceException;
-use Google\Cloud\Core\GrpcRequestWrapper;
use Google\Protobuf\NullValue;
-use Google\Cloud\Core\Duration;
/**
* Provides shared functionality for gRPC service implementations.
@@ -98,8 +96,8 @@ public function send(callable $request, array $args, $whitelisted = false)
*/
private function getGaxConfig(
$version,
- callable $authHttpHandler = null,
- string $universeDomain = null
+ ?callable $authHttpHandler = null,
+ ?string $universeDomain = null
) {
$config = [
'libName' => 'gccl',
@@ -278,7 +276,7 @@ private function formatTimestampFromApi(array $timestamp)
*/
private function formatTimestampForApi($value)
{
- list ($dt, $nanos) = $this->parseTimeString($value);
+ list($dt, $nanos) = $this->parseTimeString($value);
return [
'seconds' => (int) $dt->format('U'),
diff --git a/lib/Google/vendor/google/cloud-core/src/Iam/IamManager.php b/lib/Google/vendor/google/cloud-core/src/Iam/IamManager.php
index a9e373fe7..7e1670a6e 100644
--- a/lib/Google/vendor/google/cloud-core/src/Iam/IamManager.php
+++ b/lib/Google/vendor/google/cloud-core/src/Iam/IamManager.php
@@ -19,11 +19,10 @@
use Google\ApiCore\Serializer;
use Google\Cloud\Core\ArrayTrait;
-use Google\Cloud\Core\Iam\PolicyBuilder;
-use Google\Cloud\Iam\V1\Policy;
use Google\Cloud\Core\RequestHandler;
use Google\Cloud\Iam\V1\GetIamPolicyRequest;
use Google\Cloud\Iam\V1\GetPolicyOptions;
+use Google\Cloud\Iam\V1\Policy;
use Google\Cloud\Iam\V1\SetIamPolicyRequest;
use Google\Cloud\Iam\V1\TestIamPermissionsRequest;
use InvalidArgumentException;
@@ -152,7 +151,7 @@ public function setPolicy($policy, array $options = [])
}
$policy = $this->serializer->decodeMessage(
- new Policy,
+ new Policy(),
$policy
);
diff --git a/lib/Google/vendor/google/cloud-core/src/Iam/PolicyBuilder.php b/lib/Google/vendor/google/cloud-core/src/Iam/PolicyBuilder.php
index d22962e7c..3de89eb19 100644
--- a/lib/Google/vendor/google/cloud-core/src/Iam/PolicyBuilder.php
+++ b/lib/Google/vendor/google/cloud-core/src/Iam/PolicyBuilder.php
@@ -17,8 +17,8 @@
namespace Google\Cloud\Core\Iam;
-use InvalidArgumentException;
use BadMethodCallException;
+use InvalidArgumentException;
/**
* Helper class for creating valid IAM policies
@@ -284,7 +284,7 @@ public function result()
private function validatePolicyVersion()
{
if (isset($this->version) && $this->version > 1) {
- throw new BadMethodCallException("Helper methods cannot be " .
+ throw new BadMethodCallException('Helper methods cannot be ' .
"invoked on policies with version {$this->version}.");
}
@@ -299,8 +299,8 @@ private function validateConditions()
foreach ($this->bindings as $binding) {
if (isset($binding['condition'])) {
- throw new BadMethodCallException("Helper methods cannot " .
- "be invoked on policies containing conditions.");
+ throw new BadMethodCallException('Helper methods cannot ' .
+ 'be invoked on policies containing conditions.');
}
}
}
diff --git a/lib/Google/vendor/google/cloud-core/src/Logger/FormatterTrait.php b/lib/Google/vendor/google/cloud-core/src/Logger/FormatterTrait.php
index 095228ed2..329a507e5 100644
--- a/lib/Google/vendor/google/cloud-core/src/Logger/FormatterTrait.php
+++ b/lib/Google/vendor/google/cloud-core/src/Logger/FormatterTrait.php
@@ -36,12 +36,12 @@ protected function formatPayload($record, $message)
}
list($usec, $sec) = explode(' ', microtime());
- $usec = (int)(((float)$usec)*1000000000);
- $sec = (int)$sec;
+ $usec = (int) (((float) $usec) * 1000000000);
+ $sec = (int) $sec;
$payload = [
'message' => $message,
- 'timestamp'=> ['seconds' => $sec, 'nanos' => $usec],
+ 'timestamp' => ['seconds' => $sec, 'nanos' => $usec],
'thread' => '',
'severity' => $record['level_name'],
];
diff --git a/lib/Google/vendor/google/cloud-core/src/LongRunning/LROTrait.php b/lib/Google/vendor/google/cloud-core/src/LongRunning/LROTrait.php
index 477d5f3ea..ac9a04893 100644
--- a/lib/Google/vendor/google/cloud-core/src/LongRunning/LROTrait.php
+++ b/lib/Google/vendor/google/cloud-core/src/LongRunning/LROTrait.php
@@ -19,7 +19,6 @@
use Google\Cloud\Core\Iterator\ItemIterator;
use Google\Cloud\Core\Iterator\PageIterator;
-use Google\Cloud\Core\LongRunning\LongRunningConnectionInterface;
/**
* Provide Long Running Operation support to Google Cloud PHP Clients.
@@ -109,7 +108,7 @@ public function longRunningOperations(array $options = [])
$resultLimit = $this->pluck('resultLimit', $options, false) ?: 0;
- $options['name'] = $this->lroResource .'/operations';
+ $options['name'] = $this->lroResource . '/operations';
return new ItemIterator(
new PageIterator(
diff --git a/lib/Google/vendor/google/cloud-core/src/LongRunning/OperationResponseTrait.php b/lib/Google/vendor/google/cloud-core/src/LongRunning/OperationResponseTrait.php
index 2c5cad0b6..90e133936 100644
--- a/lib/Google/vendor/google/cloud-core/src/LongRunning/OperationResponseTrait.php
+++ b/lib/Google/vendor/google/cloud-core/src/LongRunning/OperationResponseTrait.php
@@ -20,7 +20,6 @@
use Google\ApiCore\OperationResponse;
use Google\ApiCore\Serializer;
use Google\GAX\OperationResponse as GaxOperationResponse;
-use Google\GAX\Serializer as GaxSerialzer;
/**
* Serializes and deserializes ApiCore LRO Response objects.
diff --git a/lib/Google/vendor/google/cloud-core/src/PhpArray.php b/lib/Google/vendor/google/cloud-core/src/PhpArray.php
index f456e70da..efd722657 100644
--- a/lib/Google/vendor/google/cloud-core/src/PhpArray.php
+++ b/lib/Google/vendor/google/cloud-core/src/PhpArray.php
@@ -18,10 +18,10 @@
namespace Google\Cloud\Core;
use DrSlump\Protobuf;
-use google\protobuf\Value;
use google\protobuf\ListValue;
use google\protobuf\NullValue;
use google\protobuf\Struct;
+use google\protobuf\Value;
/**
* Extend the Protobuf-PHP array codec to allow messages to match the format
@@ -86,7 +86,7 @@ protected function encodeMessage(Protobuf\Message $message)
if ($field->isRepeated()) {
// Make sure the value is an array of values
- $v = is_array($v) ? $v : array($v);
+ $v = is_array($v) ? $v : [$v];
$arr = [];
foreach ($v as $k => $vv) {
@@ -145,7 +145,7 @@ protected function decodeMessage(Protobuf\Message $message, $data)
if ($field->isRepeated()) {
// Make sure the value is an array of values
- $v = is_array($v) && is_int(key($v)) ? $v : array($v);
+ $v = is_array($v) && is_int(key($v)) ? $v : [$v];
foreach ($v as $k => $vv) {
$v[$k] = $this->filterValue($vv, $field);
}
diff --git a/lib/Google/vendor/google/cloud-core/src/RequestHandler.php b/lib/Google/vendor/google/cloud-core/src/RequestHandler.php
index 6e11b4d61..f650b942b 100644
--- a/lib/Google/vendor/google/cloud-core/src/RequestHandler.php
+++ b/lib/Google/vendor/google/cloud-core/src/RequestHandler.php
@@ -17,15 +17,12 @@
namespace Google\Cloud\Core;
-use Google\ApiCore\Serializer;
-use Google\Cloud\Core\ArrayTrait;
-use Google\Cloud\Core\Exception\NotFoundException;
-use Google\Cloud\Core\Exception\ServiceException;
-use Google\Cloud\Core\TimeTrait;
-use Google\Cloud\Core\WhitelistTrait;
use \Google\Protobuf\Internal\Message;
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
+use Google\ApiCore\Serializer;
+use Google\Cloud\Core\Exception\NotFoundException;
+use Google\Cloud\Core\Exception\ServiceException;
/**
* @internal
@@ -76,7 +73,7 @@ public function __construct(
);
}
//@codeCoverageIgnoreEnd
-
+
// Initialize the client classes and store them in memory
$this->clients = [];
foreach ($clientClasses as $className) {
diff --git a/lib/Google/vendor/google/cloud-core/src/RequestProcessorTrait.php b/lib/Google/vendor/google/cloud-core/src/RequestProcessorTrait.php
index 72440cd91..0f7c28afe 100644
--- a/lib/Google/vendor/google/cloud-core/src/RequestProcessorTrait.php
+++ b/lib/Google/vendor/google/cloud-core/src/RequestProcessorTrait.php
@@ -17,14 +17,14 @@
namespace Google\Cloud\Core;
-use Google\ApiCore\ServerStream;
-use Google\Rpc\Code;
+use \Google\Protobuf\Internal\Message;
+use Google\ApiCore\OperationResponse;
use Google\ApiCore\PagedListResponse;
+use Google\ApiCore\ServerStream;
use Google\Cloud\Core\Exception\ServiceException;
-use Google\ApiCore\OperationResponse;
-use \Google\Protobuf\Internal\Message;
-use Google\Rpc\RetryInfo;
use Google\Rpc\BadRequest;
+use Google\Rpc\Code;
+use Google\Rpc\RetryInfo;
/**
* @internal
@@ -140,7 +140,7 @@ private function convertToGoogleException(\Exception $ex): ServiceException
if (!isset($this->metadataTypes[$type])) {
continue;
}
- $metadataElement = new $this->metadataTypes[$type];
+ $metadataElement = new $this->metadataTypes[$type]();
$metadataElement->mergeFromString($binaryValue[0]);
$metadata[] = $this->serializer->encodeMessage($metadataElement);
}
diff --git a/lib/Google/vendor/google/cloud-core/src/RequestWrapper.php b/lib/Google/vendor/google/cloud-core/src/RequestWrapper.php
index eb8f76502..849d15f2b 100644
--- a/lib/Google/vendor/google/cloud-core/src/RequestWrapper.php
+++ b/lib/Google/vendor/google/cloud-core/src/RequestWrapper.php
@@ -24,15 +24,13 @@
use Google\Auth\HttpHandler\Guzzle6HttpHandler;
use Google\Auth\HttpHandler\HttpHandlerFactory;
use Google\Auth\UpdateMetadataInterface;
-use Google\Cloud\Core\Exception\ServiceException;
-use Google\Cloud\Core\RequestWrapperTrait;
use Google\Cloud\Core\Exception\GoogleException;
+use Google\Cloud\Core\Exception\ServiceException;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Promise\PromiseInterface;
use GuzzleHttp\Psr7\Utils;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
-use Psr\Http\Message\StreamInterface;
/**
* The RequestWrapper is responsible for delivering and signing requests.
@@ -370,7 +368,8 @@ private function addAuthHeaders(RequestInterface $request, FetchAuthTokenInterfa
return $backoff->execute(
function () use ($request, $fetcher) {
if (!$fetcher instanceof UpdateMetadataInterface ||
- ($fetcher instanceof FetchAuthTokenCache &&
+ (
+ $fetcher instanceof FetchAuthTokenCache &&
!$fetcher->getFetcher() instanceof UpdateMetadataInterface
)
) {
@@ -511,7 +510,7 @@ private function buildDefaultAsyncHandler()
/**
* Verify that the expected universe domain matches the universe domain from the credentials.
*/
- private function checkUniverseDomain(FetchAuthTokenInterface $credentialsFetcher = null)
+ private function checkUniverseDomain(?FetchAuthTokenInterface $credentialsFetcher = null)
{
if (false === $this->hasCheckedUniverse) {
if ($this->universeDomain === '') {
diff --git a/lib/Google/vendor/google/cloud-core/src/RestTrait.php b/lib/Google/vendor/google/cloud-core/src/RestTrait.php
index 70966a8a0..20b61cc00 100644
--- a/lib/Google/vendor/google/cloud-core/src/RestTrait.php
+++ b/lib/Google/vendor/google/cloud-core/src/RestTrait.php
@@ -122,7 +122,7 @@ public function send($resource, $method, array $options = [], $whitelisted = fal
* @param string $apiEndpointTemplate
* @return string
*/
- private function getApiEndpoint($default, array $config, string $apiEndpointTemplate = null)
+ private function getApiEndpoint($default, array $config, ?string $apiEndpointTemplate = null)
{
// If the $default parameter is provided, or the user has set an "apiEndoint" config option,
// fall back to the previous behavior.
diff --git a/lib/Google/vendor/google/cloud-core/src/Retry.php b/lib/Google/vendor/google/cloud-core/src/Retry.php
index 67b6000b4..6083b5857 100644
--- a/lib/Google/vendor/google/cloud-core/src/Retry.php
+++ b/lib/Google/vendor/google/cloud-core/src/Retry.php
@@ -54,7 +54,7 @@ class Retry
public function __construct(
$retries,
callable $delayFunction,
- callable $retryFunction = null
+ ?callable $retryFunction = null
) {
$this->retries = $retries !== null ? (int) $retries : 3;
$this->delayFunction = $delayFunction;
diff --git a/lib/Google/vendor/google/cloud-core/src/ServiceBuilder.php b/lib/Google/vendor/google/cloud-core/src/ServiceBuilder.php
index 9a5ac3f4f..a3824fa43 100644
--- a/lib/Google/vendor/google/cloud-core/src/ServiceBuilder.php
+++ b/lib/Google/vendor/google/cloud-core/src/ServiceBuilder.php
@@ -49,6 +49,8 @@
*
* Please note that unless otherwise noted the examples below take advantage of
* [Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials).
+ *
+ * @deprecated
*/
class ServiceBuilder
{
@@ -315,7 +317,6 @@ public function storage(array $config = [])
return $this->createClient(StorageClient::class, 'storage', $config);
}
-
/**
* Google Stackdriver Trace allows you to collect latency data from your applications
* and display it in the Google Cloud Platform Console. Find more information at
diff --git a/lib/Google/vendor/google/cloud-core/src/Testing/ArrayHasSameValuesToken.php b/lib/Google/vendor/google/cloud-core/src/Testing/ArrayHasSameValuesToken.php
index d6acbca9c..213dd6dde 100644
--- a/lib/Google/vendor/google/cloud-core/src/Testing/ArrayHasSameValuesToken.php
+++ b/lib/Google/vendor/google/cloud-core/src/Testing/ArrayHasSameValuesToken.php
@@ -25,7 +25,7 @@ class ArrayHasSameValuesToken implements TokenInterface
* @experimental
* @internal
*/
- public function __construct($value, StringUtil $util = null)
+ public function __construct($value, ?StringUtil $util = null)
{
$this->value = $value;
$this->util = $util ?: new StringUtil();
diff --git a/lib/Google/vendor/google/cloud-core/src/Testing/Reflection/ReflectionHandlerFactory.php b/lib/Google/vendor/google/cloud-core/src/Testing/Reflection/ReflectionHandlerFactory.php
index 6c4b7b427..7adc137e2 100644
--- a/lib/Google/vendor/google/cloud-core/src/Testing/Reflection/ReflectionHandlerFactory.php
+++ b/lib/Google/vendor/google/cloud-core/src/Testing/Reflection/ReflectionHandlerFactory.php
@@ -17,6 +17,8 @@
namespace Google\Cloud\Core\Testing\Reflection;
+use phpDocumentor\Reflection\Php\Factory\Argument;
+
/**
* Class for determining which verison of phpdocumentor/reflection is being used.
* @internal
@@ -28,6 +30,8 @@ class ReflectionHandlerFactory
*/
public static function create()
{
- return new ReflectionHandlerV5();
+ return class_exists(Argument::class)
+ ? new ReflectionHandlerV5()
+ : new ReflectionHandlerV6();
}
}
diff --git a/lib/Google/vendor/google/cloud-core/src/Testing/Reflection/ReflectionHandlerV5.php b/lib/Google/vendor/google/cloud-core/src/Testing/Reflection/ReflectionHandlerV5.php
index 9f61f3938..ea4e2b001 100644
--- a/lib/Google/vendor/google/cloud-core/src/Testing/Reflection/ReflectionHandlerV5.php
+++ b/lib/Google/vendor/google/cloud-core/src/Testing/Reflection/ReflectionHandlerV5.php
@@ -99,14 +99,33 @@ public function classes(array $files)
}
/**
- * @return ProjectFactory
+ * Split this into a separate method because ReflectionHandler V6 looks
+ * different
*/
- public function createProjectFactory()
+ protected function createParser()
{
- $parser = (new ParserFactory())->create(
+ return (new ParserFactory())->create(
ParserFactory::ONLY_PHP7,
new Lexer\Emulative(['phpVersion' => Lexer\Emulative::PHP_8_0])
);
+ }
+
+ /**
+ * Split this into a separate method because V6 does not support it
+ */
+ protected function getAdditionalStrategies()
+ {
+ return [
+ new Factory\Argument(new PrettyPrinter()) // @phpstan-ignore-line
+ ];
+ }
+
+ /**
+ * @return ProjectFactory
+ */
+ public function createProjectFactory()
+ {
+ $parser = $this->createParser();
$nodeTraverser = new NodeTraverser();
$nodeTraverser->addVisitor(new NameResolver());
$nodeTraverser->addVisitor(new ElementNameResolver());
@@ -119,7 +138,6 @@ public function createProjectFactory()
$strategies = new ProjectFactoryStrategies(
[
new Factory\Namespace_(),
- new Factory\Argument(new PrettyPrinter()),
new Factory\Class_($docblockFactory),
new Factory\Enum_($docblockFactory),
new Factory\EnumCase($docblockFactory, new PrettyPrinter()),
@@ -134,7 +152,7 @@ public function createProjectFactory()
new Factory\Trait_($docblockFactory),
new Factory\IfStatement(),
new TraitUse(),
- ]
+ ] + $this->getAdditionalStrategies()
);
$strategies->addStrategy(
diff --git a/lib/Google/vendor/google/cloud-core/src/Testing/Reflection/ReflectionHandlerV6.php b/lib/Google/vendor/google/cloud-core/src/Testing/Reflection/ReflectionHandlerV6.php
new file mode 100644
index 000000000..b04a9efe0
--- /dev/null
+++ b/lib/Google/vendor/google/cloud-core/src/Testing/Reflection/ReflectionHandlerV6.php
@@ -0,0 +1,46 @@
+createForVersion($phpVersion);
+ }
+
+ /**
+ * @see ReflectionHandlerV5
+ */
+ protected function getAdditionalStrategies()
+ {
+ return [];
+ }
+}
diff --git a/lib/Google/vendor/google/cloud-core/src/Testing/System/DeletionQueue.php b/lib/Google/vendor/google/cloud-core/src/Testing/System/DeletionQueue.php
index f29bda287..820d9f194 100644
--- a/lib/Google/vendor/google/cloud-core/src/Testing/System/DeletionQueue.php
+++ b/lib/Google/vendor/google/cloud-core/src/Testing/System/DeletionQueue.php
@@ -90,7 +90,7 @@ public function add($toDelete)
* @experimental
* @internal
*/
- public function process(callable $action = null)
+ public function process(?callable $action = null)
{
if ($action) {
$action($this->queue);
diff --git a/lib/Google/vendor/google/cloud-core/src/Testing/System/SystemTestCase.php b/lib/Google/vendor/google/cloud-core/src/Testing/System/SystemTestCase.php
index c0dc573a7..1b1e257c5 100644
--- a/lib/Google/vendor/google/cloud-core/src/Testing/System/SystemTestCase.php
+++ b/lib/Google/vendor/google/cloud-core/src/Testing/System/SystemTestCase.php
@@ -35,7 +35,7 @@
* @experimental
* @internal
*/
-class SystemTestCase extends TestCase
+abstract class SystemTestCase extends TestCase
{
protected static $deletionQueue;
diff --git a/lib/Google/vendor/google/cloud-core/src/Testing/TestHelpers.php b/lib/Google/vendor/google/cloud-core/src/Testing/TestHelpers.php
index e2050d635..0faf64bb1 100644
--- a/lib/Google/vendor/google/cloud-core/src/Testing/TestHelpers.php
+++ b/lib/Google/vendor/google/cloud-core/src/Testing/TestHelpers.php
@@ -23,6 +23,7 @@
use Google\Cloud\Core\Testing\Snippet\Coverage\Coverage;
use Google\Cloud\Core\Testing\Snippet\Coverage\Scanner;
use Google\Cloud\Core\Testing\Snippet\Parser\Parser;
+use Google\Cloud\Core\Testing\Snippet\Fixtures;
use Google\Cloud\Core\Testing\System\SystemTestCase;
/**
@@ -106,7 +107,7 @@ public function call($fn, array $args = []) { return call_user_func_array([$this
*/
public static function snippetBootstrap()
{
- putenv('GOOGLE_APPLICATION_CREDENTIALS='. \Google\Cloud\Core\Testing\Snippet\Fixtures::KEYFILE_STUB_FIXTURE());
+ putenv('GOOGLE_APPLICATION_CREDENTIALS='. Fixtures::KEYFILE_STUB_FIXTURE());
$parser = new Parser;
$scanner = new Scanner($parser, self::projectRoot(), [
@@ -190,6 +191,7 @@ public static function systemBootstrap()
// also set up the generated system tests
self::generatedSystemTestBootstrap();
$bootstraps = glob(self::projectRoot() .'/*tests/System/bootstrap.php');
+
foreach ($bootstraps as $bootstrap) {
require_once $bootstrap;
}
@@ -212,6 +214,9 @@ public static function generatedSystemTestBootstrap()
// For generated system tests, we need to set GOOGLE_APPLICATION_CREDENTIALS
// and PROJECT_ID to appropriate values
$keyFilePath = getenv('GOOGLE_CLOUD_PHP_TESTS_KEY_PATH');
+ if (empty($keyFilePath)) {
+ exit('GOOGLE_CLOUD_PHP_TESTS_KEY_PATH must be set to run system tests.');
+ }
putenv("GOOGLE_APPLICATION_CREDENTIALS=$keyFilePath");
$keyFileData = json_decode(file_get_contents($keyFilePath), true);
putenv('PROJECT_ID=' . $keyFileData['project_id']);
diff --git a/lib/Google/vendor/google/cloud-core/src/TimeTrait.php b/lib/Google/vendor/google/cloud-core/src/TimeTrait.php
index 773729b8b..6e6a650d2 100644
--- a/lib/Google/vendor/google/cloud-core/src/TimeTrait.php
+++ b/lib/Google/vendor/google/cloud-core/src/TimeTrait.php
@@ -38,7 +38,7 @@ private function parseTimeString($timestamp)
$subSeconds = $matches[1] ?? '0';
if (strlen($subSeconds) > 6) {
- $timestamp = str_replace('.'. $subSeconds, '.' . substr($subSeconds, 0, 6), $timestamp);
+ $timestamp = str_replace('.' . $subSeconds, '.' . substr($subSeconds, 0, 6), $timestamp);
}
$dt = new \DateTimeImmutable($timestamp);
diff --git a/lib/Google/vendor/google/cloud-core/src/TimestampTrait.php b/lib/Google/vendor/google/cloud-core/src/TimestampTrait.php
index 4ed589e2f..78ea1d355 100644
--- a/lib/Google/vendor/google/cloud-core/src/TimestampTrait.php
+++ b/lib/Google/vendor/google/cloud-core/src/TimestampTrait.php
@@ -18,8 +18,6 @@
namespace Google\Cloud\Core;
-use Google\Cloud\Core\Timestamp;
-
/**
* Helper methods to work on Google\Cloud\Core\Timestamp.
* @internal
diff --git a/lib/Google/vendor/google/cloud-core/src/Upload/ResumableUploader.php b/lib/Google/vendor/google/cloud-core/src/Upload/ResumableUploader.php
index 220a2a165..ecea6703f 100644
--- a/lib/Google/vendor/google/cloud-core/src/Upload/ResumableUploader.php
+++ b/lib/Google/vendor/google/cloud-core/src/Upload/ResumableUploader.php
@@ -19,7 +19,6 @@
use Google\Cloud\Core\Exception\GoogleException;
use Google\Cloud\Core\Exception\ServiceException;
-use Google\Cloud\Core\Exception\UploadException;
use Google\Cloud\Core\JsonTrait;
use Google\Cloud\Core\RequestWrapper;
use GuzzleHttp\Promise\PromiseInterface;
diff --git a/lib/Google/vendor/google/cloud-core/src/ValidateTrait.php b/lib/Google/vendor/google/cloud-core/src/ValidateTrait.php
index f1582702f..1e9f913c0 100644
--- a/lib/Google/vendor/google/cloud-core/src/ValidateTrait.php
+++ b/lib/Google/vendor/google/cloud-core/src/ValidateTrait.php
@@ -37,7 +37,7 @@ trait ValidateTrait
private function validateBatch(
array $input,
$type,
- callable $additionalCheck = null
+ ?callable $additionalCheck = null
) {
foreach ($input as $element) {
if (!($element instanceof $type)) {
diff --git a/lib/Google/vendor/google/cloud-core/src/ValueMapperTrait.php b/lib/Google/vendor/google/cloud-core/src/ValueMapperTrait.php
index ddb39b390..c9cd904bb 100644
--- a/lib/Google/vendor/google/cloud-core/src/ValueMapperTrait.php
+++ b/lib/Google/vendor/google/cloud-core/src/ValueMapperTrait.php
@@ -47,7 +47,7 @@ public function createTimestampWithNanos($timestamp, $returnType = Timestamp::cl
$dt = $this->createDateTimeFromSeconds($timestamp['seconds']);
$nanos = $timestamp['nanos'];
} else {
- list ($dt, $nanos) = $this->parseTimeString($timestamp);
+ list($dt, $nanos) = $this->parseTimeString($timestamp);
}
return new $returnType($dt, $nanos);
diff --git a/lib/Google/vendor/google/cloud-core/unit-bootstrap.php b/lib/Google/vendor/google/cloud-core/unit-bootstrap.php
index 864cd9436..001e59dd2 100644
--- a/lib/Google/vendor/google/cloud-core/unit-bootstrap.php
+++ b/lib/Google/vendor/google/cloud-core/unit-bootstrap.php
@@ -1,9 +1,9 @@
register(new MessageAwareArrayComparator());
diff --git a/lib/Google/vendor/google/cloud-storage/README.md b/lib/Google/vendor/google/cloud-storage/README.md
index 9837283d0..6c3afffe7 100644
--- a/lib/Google/vendor/google/cloud-storage/README.md
+++ b/lib/Google/vendor/google/cloud-storage/README.md
@@ -71,6 +71,11 @@ $storage->registerStreamWrapper();
$contents = file_get_contents('gs://my_bucket/file_backup.txt');
```
+### Debugging
+
+Please see our [Debugging guide](https://github.com/googleapis/google-cloud-php/blob/main/DEBUG.md)
+for more information about the debugging tools.
+
### Version
This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in
diff --git a/lib/Google/vendor/google/cloud-storage/VERSION b/lib/Google/vendor/google/cloud-storage/VERSION
index e640847f9..50aceaa7b 100644
--- a/lib/Google/vendor/google/cloud-storage/VERSION
+++ b/lib/Google/vendor/google/cloud-storage/VERSION
@@ -1 +1 @@
-1.42.1
+1.45.0
diff --git a/lib/Google/vendor/google/cloud-storage/composer.json b/lib/Google/vendor/google/cloud-storage/composer.json
index 4c9900893..d0000cd74 100644
--- a/lib/Google/vendor/google/cloud-storage/composer.json
+++ b/lib/Google/vendor/google/cloud-storage/composer.json
@@ -5,14 +5,14 @@
"minimum-stability": "stable",
"require": {
"php": "^8.0",
- "google/cloud-core": "^1.55",
+ "google/cloud-core": "^1.57",
"ramsey/uuid": "^4.2.3"
},
"require-dev": {
"phpunit/phpunit": "^9.0",
"phpspec/prophecy-phpunit": "^2.0",
"squizlabs/php_codesniffer": "2.*",
- "phpdocumentor/reflection": "^5.3.3",
+ "phpdocumentor/reflection": "^5.3.3||^6.0",
"phpdocumentor/reflection-docblock": "^5.3",
"erusev/parsedown": "^1.6",
"phpseclib/phpseclib": "^2.0||^3.0",
diff --git a/lib/Google/vendor/google/cloud-storage/src/Bucket.php b/lib/Google/vendor/google/cloud-storage/src/Bucket.php
index 5fcd08696..450c2aa47 100644
--- a/lib/Google/vendor/google/cloud-storage/src/Bucket.php
+++ b/lib/Google/vendor/google/cloud-storage/src/Bucket.php
@@ -30,7 +30,6 @@
use Google\Cloud\PubSub\Topic;
use Google\Cloud\Storage\Connection\ConnectionInterface;
use Google\Cloud\Storage\Connection\IamBucket;
-use Google\Cloud\Storage\SigningHelper;
use GuzzleHttp\Promise\PromiseInterface;
use GuzzleHttp\Psr7\MimeType;
use GuzzleHttp\Psr7\Utils;
@@ -592,6 +591,9 @@ public function getStreamableUploader($data, array $options = [])
* from the `encryptionKey` on your behalf if not provided, but
* for best performance it is recommended to pass in a cached
* version of the already calculated SHA.
+ * @type boolean $softDeleted If true, returns the metadata of the
+ * soft-deleted object. If true, generation must also be specified,
+ * and alt=media cannot be specified.
* }
* @return StorageObject
*/
@@ -627,6 +629,8 @@ public function object($name, array $options = [])
* @param array $options [optional] {
* Configuration Options.
*
+ * @type string $restoreToken Must be specified when getting a soft-deleted object from
+ * an HNS-enabled bucket that has a name and generation conflict with another object in the same bucket.
* @type string $ifGenerationMatch Makes the operation conditional on whether
* the object's current generation matches the given value.
* @type string $ifGenerationNotMatch Makes the operation conditional on whether
diff --git a/lib/Google/vendor/google/cloud-storage/src/Connection/Rest.php b/lib/Google/vendor/google/cloud-storage/src/Connection/Rest.php
index 3e9ba793b..2f89fe309 100644
--- a/lib/Google/vendor/google/cloud-storage/src/Connection/Rest.php
+++ b/lib/Google/vendor/google/cloud-storage/src/Connection/Rest.php
@@ -22,13 +22,11 @@
use Google\Cloud\Core\RequestWrapper;
use Google\Cloud\Core\RestTrait;
use Google\Cloud\Core\Retry;
-use Google\Cloud\Storage\Connection\RetryTrait;
use Google\Cloud\Core\Upload\AbstractUploader;
use Google\Cloud\Core\Upload\MultipartUploader;
use Google\Cloud\Core\Upload\ResumableUploader;
use Google\Cloud\Core\Upload\StreamableUploader;
use Google\Cloud\Core\UriTrait;
-use Google\Cloud\Storage\Connection\ConnectionInterface;
use Google\Cloud\Storage\StorageClient;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Psr7\MimeType;
diff --git a/lib/Google/vendor/google/cloud-storage/src/Connection/RetryTrait.php b/lib/Google/vendor/google/cloud-storage/src/Connection/RetryTrait.php
index 253a10b68..4899e7e46 100644
--- a/lib/Google/vendor/google/cloud-storage/src/Connection/RetryTrait.php
+++ b/lib/Google/vendor/google/cloud-storage/src/Connection/RetryTrait.php
@@ -69,6 +69,7 @@ trait RetryTrait
'objects.get',
'objects.list',
'serviceaccount.get',
+ 'signBlob.execute'
];
/**
@@ -134,7 +135,9 @@ private function getRestRetryFunction($resource, $method, array $args)
StorageClient::RETRY_IDEMPOTENT;
return function (
- \Exception $exception
+ \Exception $exception,
+ $currentAttempt = 0,
+ $maxRetries = null
) use (
$isOpIdempotent,
$preconditionNeeded,
@@ -146,7 +149,9 @@ private function getRestRetryFunction($resource, $method, array $args)
$isOpIdempotent,
$preconditionNeeded,
$preconditionSupplied,
- $retryStrategy
+ $retryStrategy,
+ $currentAttempt,
+ $maxRetries
);
};
}
@@ -187,7 +192,8 @@ private function isPreConditionSupplied($methodName, array $args)
* @param bool $isIdempotent
* @param bool $preconditionNeeded
* @param bool $preconditionSupplied
- * @param int $maxRetries
+ * @param int|null $maxRetries The maximum number of retries allowd.
+ * Null for no limit.
* @return bool
*/
private function retryDeciderFunction(
@@ -195,8 +201,15 @@ private function retryDeciderFunction(
$isIdempotent,
$preconditionNeeded,
$preconditionSupplied,
- $retryStrategy
+ $retryStrategy,
+ $currentAttempt = 0,
+ $maxRetries = null
) {
+ // If maxRetries is specified, ensure we don't exceed it
+ if ($maxRetries !== null && $currentAttempt >= $maxRetries) {
+ return false;
+ }
+
if ($retryStrategy == StorageClient::RETRY_NEVER) {
return false;
}
diff --git a/lib/Google/vendor/google/cloud-storage/src/Connection/ServiceDefinition/storage-v1.json b/lib/Google/vendor/google/cloud-storage/src/Connection/ServiceDefinition/storage-v1.json
index 76ce2ce9d..3a625cc96 100644
--- a/lib/Google/vendor/google/cloud-storage/src/Connection/ServiceDefinition/storage-v1.json
+++ b/lib/Google/vendor/google/cloud-storage/src/Connection/ServiceDefinition/storage-v1.json
@@ -202,5524 +202,5534 @@
"type": "string",
"description": "HTTP 1.1 Entity tag for the bucket."
},
- "hierarchicalNamespace": {
- "type": "object",
- "description": "The bucket's hierarchical namespace configuration.",
- "properties": {
- "enabled": {
- "type": "boolean",
- "description": "When set to true, hierarchical namespace is enabled for this bucket."
- }
- }
- },
- "iamConfiguration": {
- "type": "object",
- "description": "The bucket's IAM configuration.",
- "properties": {
- "bucketPolicyOnly": {
- "type": "object",
- "description": "The bucket's uniform bucket-level access configuration. The feature was formerly known as Bucket Policy Only. For backward compatibility, this field will be populated with identical information as the uniformBucketLevelAccess field. We recommend using the uniformBucketLevelAccess field to enable and disable the feature.",
- "properties": {
- "enabled": {
- "type": "boolean",
- "description": "If set, access is controlled only by bucket-level or above IAM policies."
- },
- "lockedTime": {
- "type": "string",
- "description": "The deadline for changing iamConfiguration.bucketPolicyOnly.enabled from true to false in RFC 3339 format. iamConfiguration.bucketPolicyOnly.enabled may be changed from true to false until the locked time, after which the field is immutable.",
- "format": "date-time"
- }
- }
- },
- "uniformBucketLevelAccess": {
- "type": "object",
- "description": "The bucket's uniform bucket-level access configuration.",
- "properties": {
- "enabled": {
- "type": "boolean",
- "description": "If set, access is controlled only by bucket-level or above IAM policies."
- },
- "lockedTime": {
- "type": "string",
- "description": "The deadline for changing iamConfiguration.uniformBucketLevelAccess.enabled from true to false in RFC 3339 format. iamConfiguration.uniformBucketLevelAccess.enabled may be changed from true to false until the locked time, after which the field is immutable.",
- "format": "date-time"
+ "hierarchicalNamespace": {
+ "type": "object",
+ "description": "The bucket's hierarchical namespace configuration.",
+ "properties": {
+ "enabled": {
+ "type": "boolean",
+ "description": "When set to true, hierarchical namespace is enabled for this bucket."
+ }
}
- }
- },
- "publicAccessPrevention": {
- "type": "string",
- "description": "The bucket's Public Access Prevention configuration. Currently, 'inherited' and 'enforced' are supported."
- }
- }
- },
- "id": {
- "type": "string",
- "description": "The ID of the bucket. For buckets, the id and name properties are the same."
- },
- "kind": {
- "type": "string",
- "description": "The kind of item this is. For buckets, this is always storage#bucket.",
- "default": "storage#bucket"
- },
- "labels": {
- "type": "object",
- "description": "User-provided labels, in key/value pairs.",
- "additionalProperties": {
- "type": "string",
- "description": "An individual label entry."
- }
- },
- "lifecycle": {
- "type": "object",
- "description": "The bucket's lifecycle configuration. See lifecycle management for more information.",
- "properties": {
- "rule": {
- "type": "array",
- "description": "A lifecycle management rule, which is made of an action to take and the condition(s) under which the action will be taken.",
- "items": {
+ },
+ "iamConfiguration": {
"type": "object",
+ "description": "The bucket's IAM configuration.",
"properties": {
- "action": {
+ "bucketPolicyOnly": {
"type": "object",
- "description": "The action to take.",
+ "description": "The bucket's uniform bucket-level access configuration. The feature was formerly known as Bucket Policy Only. For backward compatibility, this field will be populated with identical information as the uniformBucketLevelAccess field. We recommend using the uniformBucketLevelAccess field to enable and disable the feature.",
"properties": {
- "storageClass": {
- "type": "string",
- "description": "Target storage class. Required iff the type of the action is SetStorageClass."
+ "enabled": {
+ "type": "boolean",
+ "description": "If set, access is controlled only by bucket-level or above IAM policies."
},
- "type": {
+ "lockedTime": {
"type": "string",
- "description": "Type of the action. Currently, only Delete, SetStorageClass, and AbortIncompleteMultipartUpload are supported."
+ "description": "The deadline for changing iamConfiguration.bucketPolicyOnly.enabled from true to false in RFC 3339 format. iamConfiguration.bucketPolicyOnly.enabled may be changed from true to false until the locked time, after which the field is immutable.",
+ "format": "date-time"
}
}
},
- "condition": {
+ "uniformBucketLevelAccess": {
"type": "object",
- "description": "The condition(s) under which the action will be taken.",
+ "description": "The bucket's uniform bucket-level access configuration.",
"properties": {
- "age": {
- "type": "integer",
- "description": "Age of an object (in days). This condition is satisfied when an object reaches the specified age.",
- "format": "int32"
- },
- "createdBefore": {
- "type": "string",
- "description": "A date in RFC 3339 format with only the date part (for instance, \"2013-01-15\"). This condition is satisfied when an object is created before midnight of the specified date in UTC.",
- "format": "date"
- },
- "customTimeBefore": {
- "type": "string",
- "description": "A date in RFC 3339 format with only the date part (for instance, \"2013-01-15\"). This condition is satisfied when the custom time on an object is before this date in UTC.",
- "format": "date"
- },
- "daysSinceCustomTime": {
- "type": "integer",
- "description": "Number of days elapsed since the user-specified timestamp set on an object. The condition is satisfied if the days elapsed is at least this number. If no custom timestamp is specified on an object, the condition does not apply.",
- "format": "int32"
- },
- "daysSinceNoncurrentTime": {
- "type": "integer",
- "description": "Number of days elapsed since the noncurrent timestamp of an object. The condition is satisfied if the days elapsed is at least this number. This condition is relevant only for versioned objects. The value of the field must be a nonnegative integer. If it's zero, the object version will become eligible for Lifecycle action as soon as it becomes noncurrent.",
- "format": "int32"
- },
- "isLive": {
+ "enabled": {
"type": "boolean",
- "description": "Relevant only for versioned objects. If the value is true, this condition matches live objects; if the value is false, it matches archived objects."
+ "description": "If set, access is controlled only by bucket-level or above IAM policies."
},
- "matchesPattern": {
+ "lockedTime": {
"type": "string",
- "description": "A regular expression that satisfies the RE2 syntax. This condition is satisfied when the name of the object matches the RE2 pattern. Note: This feature is currently in the \"Early Access\" launch stage and is only available to a whitelisted set of users; that means that this feature may be changed in backward-incompatible ways and that it is not guaranteed to be released."
- },
- "matchesPrefix": {
- "type": "array",
- "description": "List of object name prefixes. This condition will be satisfied when at least one of the prefixes exactly matches the beginning of the object name.",
- "items": {
- "type": "string"
- }
- },
- "matchesSuffix": {
- "type": "array",
- "description": "List of object name suffixes. This condition will be satisfied when at least one of the suffixes exactly matches the end of the object name.",
- "items": {
- "type": "string"
- }
- },
- "matchesStorageClass": {
- "type": "array",
- "description": "Objects having any of the storage classes specified by this condition will be matched. Values include MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE, STANDARD, and DURABLE_REDUCED_AVAILABILITY.",
- "items": {
- "type": "string"
+ "description": "The deadline for changing iamConfiguration.uniformBucketLevelAccess.enabled from true to false in RFC 3339 format. iamConfiguration.uniformBucketLevelAccess.enabled may be changed from true to false until the locked time, after which the field is immutable.",
+ "format": "date-time"
+ }
+ }
+ },
+ "publicAccessPrevention": {
+ "type": "string",
+ "description": "The bucket's Public Access Prevention configuration. Currently, 'inherited' and 'enforced' are supported."
+ }
+ }
+ },
+ "id": {
+ "type": "string",
+ "description": "The ID of the bucket. For buckets, the id and name properties are the same."
+ },
+ "kind": {
+ "type": "string",
+ "description": "The kind of item this is. For buckets, this is always storage#bucket.",
+ "default": "storage#bucket"
+ },
+ "labels": {
+ "type": "object",
+ "description": "User-provided labels, in key/value pairs.",
+ "additionalProperties": {
+ "type": "string",
+ "description": "An individual label entry."
+ }
+ },
+ "lifecycle": {
+ "type": "object",
+ "description": "The bucket's lifecycle configuration. See lifecycle management for more information.",
+ "properties": {
+ "rule": {
+ "type": "array",
+ "description": "A lifecycle management rule, which is made of an action to take and the condition(s) under which the action will be taken.",
+ "items": {
+ "type": "object",
+ "properties": {
+ "action": {
+ "type": "object",
+ "description": "The action to take.",
+ "properties": {
+ "storageClass": {
+ "type": "string",
+ "description": "Target storage class. Required iff the type of the action is SetStorageClass."
+ },
+ "type": {
+ "type": "string",
+ "description": "Type of the action. Currently, only Delete, SetStorageClass, and AbortIncompleteMultipartUpload are supported."
+ }
+ }
+ },
+ "condition": {
+ "type": "object",
+ "description": "The condition(s) under which the action will be taken.",
+ "properties": {
+ "age": {
+ "type": "integer",
+ "description": "Age of an object (in days). This condition is satisfied when an object reaches the specified age.",
+ "format": "int32"
+ },
+ "createdBefore": {
+ "type": "string",
+ "description": "A date in RFC 3339 format with only the date part (for instance, \"2013-01-15\"). This condition is satisfied when an object is created before midnight of the specified date in UTC.",
+ "format": "date"
+ },
+ "customTimeBefore": {
+ "type": "string",
+ "description": "A date in RFC 3339 format with only the date part (for instance, \"2013-01-15\"). This condition is satisfied when the custom time on an object is before this date in UTC.",
+ "format": "date"
+ },
+ "daysSinceCustomTime": {
+ "type": "integer",
+ "description": "Number of days elapsed since the user-specified timestamp set on an object. The condition is satisfied if the days elapsed is at least this number. If no custom timestamp is specified on an object, the condition does not apply.",
+ "format": "int32"
+ },
+ "daysSinceNoncurrentTime": {
+ "type": "integer",
+ "description": "Number of days elapsed since the noncurrent timestamp of an object. The condition is satisfied if the days elapsed is at least this number. This condition is relevant only for versioned objects. The value of the field must be a nonnegative integer. If it's zero, the object version will become eligible for Lifecycle action as soon as it becomes noncurrent.",
+ "format": "int32"
+ },
+ "isLive": {
+ "type": "boolean",
+ "description": "Relevant only for versioned objects. If the value is true, this condition matches live objects; if the value is false, it matches archived objects."
+ },
+ "matchesPattern": {
+ "type": "string",
+ "description": "A regular expression that satisfies the RE2 syntax. This condition is satisfied when the name of the object matches the RE2 pattern. Note: This feature is currently in the \"Early Access\" launch stage and is only available to a whitelisted set of users; that means that this feature may be changed in backward-incompatible ways and that it is not guaranteed to be released."
+ },
+ "matchesPrefix": {
+ "type": "array",
+ "description": "List of object name prefixes. This condition will be satisfied when at least one of the prefixes exactly matches the beginning of the object name.",
+ "items": {
+ "type": "string"
+ }
+ },
+ "matchesSuffix": {
+ "type": "array",
+ "description": "List of object name suffixes. This condition will be satisfied when at least one of the suffixes exactly matches the end of the object name.",
+ "items": {
+ "type": "string"
+ }
+ },
+ "matchesStorageClass": {
+ "type": "array",
+ "description": "Objects having any of the storage classes specified by this condition will be matched. Values include MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE, STANDARD, and DURABLE_REDUCED_AVAILABILITY.",
+ "items": {
+ "type": "string"
+ }
+ },
+ "noncurrentTimeBefore": {
+ "type": "string",
+ "description": "A date in RFC 3339 format with only the date part (for instance, \"2013-01-15\"). This condition is satisfied when the noncurrent time on an object is before this date in UTC. This condition is relevant only for versioned objects.",
+ "format": "date"
+ },
+ "numNewerVersions": {
+ "type": "integer",
+ "description": "Relevant only for versioned objects. If the value is N, this condition is satisfied when there are at least N versions (including the live version) newer than this version of the object.",
+ "format": "int32"
+ }
+ }
}
- },
- "noncurrentTimeBefore": {
- "type": "string",
- "description": "A date in RFC 3339 format with only the date part (for instance, \"2013-01-15\"). This condition is satisfied when the noncurrent time on an object is before this date in UTC. This condition is relevant only for versioned objects.",
- "format": "date"
- },
- "numNewerVersions": {
- "type": "integer",
- "description": "Relevant only for versioned objects. If the value is N, this condition is satisfied when there are at least N versions (including the live version) newer than this version of the object.",
- "format": "int32"
}
}
}
}
- }
- }
- }
- },
- "autoclass": {
- "type": "object",
- "description": "The bucket's Autoclass configuration.",
- "properties": {
- "enabled": {
- "type": "boolean",
- "description": "Whether or not Autoclass is enabled on this bucket"
- },
- "toggleTime": {
- "type": "string",
- "description": "A date and time in RFC 3339 format representing the instant at which \"enabled\" was last toggled.",
- "format": "date-time"
- },
- "terminalStorageClass": {
- "type": "string",
- "description": "The storage class that objects in the bucket eventually transition to if they are not read for a certain length of time. Valid values are NEARLINE and ARCHIVE."
- },
- "terminalStorageClassUpdateTime": {
- "type": "string",
- "description": "A date and time in RFC 3339 format representing the time of the most recent update to \"terminalStorageClass\".",
- "format": "date-time"
- }
- }
- },
- "location": {
- "type": "string",
- "description": "The location of the bucket. Object data for objects in the bucket resides in physical storage within this region. Defaults to US. See the developer's guide for the authoritative list."
- },
- "locationType": {
- "type": "string",
- "description": "The type of the bucket location."
- },
- "logging": {
- "type": "object",
- "description": "The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs.",
- "properties": {
- "logBucket": {
- "type": "string",
- "description": "The destination bucket where the current bucket's logs should be placed."
- },
- "logObjectPrefix": {
- "type": "string",
- "description": "A prefix for log object names."
- }
- }
- },
- "metageneration": {
- "type": "string",
- "description": "The metadata generation of this bucket.",
- "format": "int64"
- },
- "name": {
- "type": "string",
- "description": "The name of the bucket.",
- "annotations": {
- "required": [
- "storage.buckets.insert"
- ]
- }
- },
- "owner": {
- "type": "object",
- "description": "The owner of the bucket. This is always the project team's owner group.",
- "properties": {
- "entity": {
- "type": "string",
- "description": "The entity, in the form project-owner-projectId."
- },
- "entityId": {
- "type": "string",
- "description": "The ID for the entity."
- }
- }
- },
- "projectNumber": {
- "type": "string",
- "description": "The project number of the project the bucket belongs to.",
- "format": "uint64"
- },
- "retentionPolicy": {
- "type": "object",
- "description": "The bucket's retention policy. The retention policy enforces a minimum retention time for all objects contained in the bucket, based on their creation time. Any attempt to overwrite or delete objects younger than the retention period will result in a PERMISSION_DENIED error. An unlocked retention policy can be modified or removed from the bucket via a storage.buckets.update operation. A locked retention policy cannot be removed or shortened in duration for the lifetime of the bucket. Attempting to remove or decrease period of a locked retention policy will result in a PERMISSION_DENIED error.",
- "properties": {
- "effectiveTime": {
- "type": "string",
- "description": "Server-determined value that indicates the time from which policy was enforced and effective. This value is in RFC 3339 format.",
- "format": "date-time"
- },
- "isLocked": {
- "type": "boolean",
- "description": "Once locked, an object retention policy cannot be modified."
- },
- "retentionPeriod": {
- "type": "string",
- "description": "The duration in seconds that objects need to be retained. Retention duration must be greater than zero and less than 100 years. Note that enforcement of retention periods less than a day is not guaranteed. Such periods should only be used for testing purposes.",
- "format": "int64"
- }
- }
- },
- "objectRetention": {
- "type": "object",
- "description": "The bucket's object retention config.",
- "properties": {
- "mode": {
- "type": "string",
- "description": "The bucket's object retention mode. Can be Enabled."
- }
- }
- },
- "rpo": {
- "type": "string",
- "description": "The Recovery Point Objective (RPO) of this bucket. Set to ASYNC_TURBO to turn on Turbo Replication on a bucket."
- },
- "selfLink": {
- "type": "string",
- "description": "The URI of this bucket."
- },
- "softDeletePolicy": {
- "type": "object",
- "description": "The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted.",
- "properties": {
- "retentionDurationSeconds": {
- "type": "string",
- "description": "The duration in seconds that soft-deleted objects in the bucket will be retained and cannot be permanently deleted.",
- "format": "int64"
- },
- "effectiveTime": {
- "type": "string",
- "description": "Server-determined value that indicates the time from which the policy, or one with a greater retention, was effective. This value is in RFC 3339 format.",
- "format": "date-time"
- }
- }
- },
- "storageClass": {
- "type": "string",
- "description": "The bucket's default storage class, used whenever no storageClass is specified for a newly-created object. This defines how objects in the bucket are stored and determines the SLA and the cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD, NEARLINE, COLDLINE, ARCHIVE, and DURABLE_REDUCED_AVAILABILITY. If this value is not specified when the bucket is created, it will default to STANDARD. For more information, see storage classes."
- },
- "timeCreated": {
- "type": "string",
- "description": "The creation time of the bucket in RFC 3339 format.",
- "format": "date-time"
- },
- "updated": {
- "type": "string",
- "description": "The modification time of the bucket in RFC 3339 format.",
- "format": "date-time"
- },
- "versioning": {
- "type": "object",
- "description": "The bucket's versioning configuration.",
- "properties": {
- "enabled": {
- "type": "boolean",
- "description": "While set to true, versioning is fully enabled for this bucket."
- }
- }
- },
- "website": {
- "type": "object",
- "description": "The bucket's website configuration, controlling how the service behaves when accessing bucket contents as a web site. See the Static Website Examples for more information.",
- "properties": {
- "mainPageSuffix": {
- "type": "string",
- "description": "If the requested object path is missing, the service will ensure the path has a trailing '/', append this suffix, and attempt to retrieve the resulting object. This allows the creation of index.html objects to represent directory pages."
- },
- "notFoundPage": {
- "type": "string",
- "description": "If the requested object path is missing, and any mainPageSuffix object is missing, if applicable, the service will return the named object from this bucket as the content for a 404 Not Found result."
- }
- }
- },
- "satisfiesPZS": {
- "type": "boolean",
- "description": "Reserved for future use."
- }
-}
-},
-"AnywhereCache": {
-"id": "AnywhereCache",
-"type": "object",
-"description": "An Anywhere Cache instance.",
-"properties": {
- "kind": {
- "type": "string",
- "description": "The kind of item this is. For Anywhere Cache, this is always storage#anywhereCache.",
- "default": "storage#anywhereCache"
- },
- "id": {
- "type": "string",
- "description": "The ID of the resource, including the project number, bucket name and anywhere cache ID."
- },
- "selfLink": {
- "type": "string",
- "description": "The link to this cache instance."
- },
- "bucket": {
- "type": "string",
- "description": "The name of the bucket containing this cache instance."
- },
- "anywhereCacheId": {
- "type": "string",
- "description": "The ID of the Anywhere cache instance."
- },
- "zone": {
- "type": "string",
- "description": "The zone in which the cache instance is running. For example, us-central1-a."
- },
- "state": {
- "type": "string",
- "description": "The current state of the cache instance."
- },
- "createTime": {
- "type": "string",
- "description": "The creation time of the cache instance in RFC 3339 format.",
- "format": "date-time"
- },
- "updateTime": {
- "type": "string",
- "description": "The modification time of the cache instance metadata in RFC 3339 format.",
- "format": "date-time"
- },
- "ttl": {
- "type": "string",
- "description": "The TTL of all cache entries in whole seconds. e.g., \"7200s\". ",
- "format": "google-duration"
- },
- "admissionPolicy": {
- "type": "string",
- "description": "The cache-level entry admission policy."
- },
- "pendingUpdate": {
- "type": "boolean",
- "description": "True if the cache instance has an active Update long-running operation."
- }
-}
-},
-"AnywhereCaches": {
-"id": "AnywhereCaches",
-"type": "object",
-"description": "A list of Anywhere Caches.",
-"properties": {
- "kind": {
- "type": "string",
- "description": "The kind of item this is. For lists of Anywhere Caches, this is always storage#anywhereCaches.",
- "default": "storage#anywhereCaches"
- },
- "nextPageToken": {
- "type": "string",
- "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results."
- },
- "items": {
- "type": "array",
- "description": "The list of items.",
- "items": {
- "$ref": "AnywhereCache"
- }
- }
-}
-},
-"BucketAccessControl": {
-"id": "BucketAccessControl",
-"type": "object",
-"description": "An access-control entry.",
-"properties": {
- "bucket": {
- "type": "string",
- "description": "The name of the bucket."
- },
- "domain": {
- "type": "string",
- "description": "The domain associated with the entity, if any."
- },
- "email": {
- "type": "string",
- "description": "The email address associated with the entity, if any."
- },
- "entity": {
- "type": "string",
- "description": "The entity holding the permission, in one of the following forms: \n- user-userId \n- user-email \n- group-groupId \n- group-email \n- domain-domain \n- project-team-projectId \n- allUsers \n- allAuthenticatedUsers Examples: \n- The user liz@example.com would be user-liz@example.com. \n- The group example@googlegroups.com would be group-example@googlegroups.com. \n- To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.",
- "annotations": {
- "required": [
- "storage.bucketAccessControls.insert"
- ]
- }
- },
- "entityId": {
- "type": "string",
- "description": "The ID for the entity, if any."
- },
- "etag": {
- "type": "string",
- "description": "HTTP 1.1 Entity tag for the access-control entry."
- },
- "id": {
- "type": "string",
- "description": "The ID of the access-control entry."
- },
- "kind": {
- "type": "string",
- "description": "The kind of item this is. For bucket access control entries, this is always storage#bucketAccessControl.",
- "default": "storage#bucketAccessControl"
- },
- "projectTeam": {
- "type": "object",
- "description": "The project team associated with the entity, if any.",
- "properties": {
- "projectNumber": {
- "type": "string",
- "description": "The project number."
- },
- "team": {
- "type": "string",
- "description": "The team."
- }
- }
- },
- "role": {
- "type": "string",
- "description": "The access permission for the entity.",
- "annotations": {
- "required": [
- "storage.bucketAccessControls.insert"
- ]
- }
- },
- "selfLink": {
- "type": "string",
- "description": "The link to this access-control entry."
- }
-}
-},
-"BucketAccessControls": {
-"id": "BucketAccessControls",
-"type": "object",
-"description": "An access-control list.",
-"properties": {
- "items": {
- "type": "array",
- "description": "The list of items.",
- "items": {
- "$ref": "BucketAccessControl"
- }
- },
- "kind": {
- "type": "string",
- "description": "The kind of item this is. For lists of bucket access control entries, this is always storage#bucketAccessControls.",
- "default": "storage#bucketAccessControls"
- }
-}
-},
-"Buckets": {
-"id": "Buckets",
-"type": "object",
-"description": "A list of buckets.",
-"properties": {
- "items": {
- "type": "array",
- "description": "The list of items.",
- "items": {
- "$ref": "Bucket"
- }
- },
- "kind": {
- "type": "string",
- "description": "The kind of item this is. For lists of buckets, this is always storage#buckets.",
- "default": "storage#buckets"
- },
- "nextPageToken": {
- "type": "string",
- "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results."
- }
-}
-},
-"Channel": {
-"id": "Channel",
-"type": "object",
-"description": "An notification channel used to watch for resource changes.",
-"properties": {
- "address": {
- "type": "string",
- "description": "The address where notifications are delivered for this channel."
- },
- "expiration": {
- "type": "string",
- "description": "Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.",
- "format": "int64"
- },
- "id": {
- "type": "string",
- "description": "A UUID or similar unique string that identifies this channel."
- },
- "kind": {
- "type": "string",
- "description": "Identifies this as a notification channel used to watch for changes to a resource, which is \"api#channel\".",
- "default": "api#channel"
- },
- "params": {
- "type": "object",
- "description": "Additional parameters controlling delivery channel behavior. Optional.",
- "additionalProperties": {
- "type": "string",
- "description": "Declares a new parameter by name."
- }
- },
- "payload": {
- "type": "boolean",
- "description": "A Boolean value to indicate whether payload is wanted. Optional."
- },
- "resourceId": {
- "type": "string",
- "description": "An opaque ID that identifies the resource being watched on this channel. Stable across different API versions."
- },
- "resourceUri": {
- "type": "string",
- "description": "A version-specific identifier for the watched resource."
- },
- "token": {
- "type": "string",
- "description": "An arbitrary string delivered to the target address with each notification delivered over this channel. Optional."
- },
- "type": {
- "type": "string",
- "description": "The type of delivery mechanism used for this channel."
- }
-}
-},
-"ComposeRequest": {
-"id": "ComposeRequest",
-"type": "object",
-"description": "A Compose request.",
-"properties": {
- "destination": {
- "$ref": "Object",
- "description": "Properties of the resulting object."
- },
- "kind": {
- "type": "string",
- "description": "The kind of item this is.",
- "default": "storage#composeRequest"
- },
- "sourceObjects": {
- "type": "array",
- "description": "The list of source objects that will be concatenated into a single object.",
- "items": {
- "type": "object",
- "properties": {
- "generation": {
+ },
+ "autoclass": {
+ "type": "object",
+ "description": "The bucket's Autoclass configuration.",
+ "properties": {
+ "enabled": {
+ "type": "boolean",
+ "description": "Whether or not Autoclass is enabled on this bucket"
+ },
+ "toggleTime": {
+ "type": "string",
+ "description": "A date and time in RFC 3339 format representing the instant at which \"enabled\" was last toggled.",
+ "format": "date-time"
+ },
+ "terminalStorageClass": {
+ "type": "string",
+ "description": "The storage class that objects in the bucket eventually transition to if they are not read for a certain length of time. Valid values are NEARLINE and ARCHIVE."
+ },
+ "terminalStorageClassUpdateTime": {
+ "type": "string",
+ "description": "A date and time in RFC 3339 format representing the time of the most recent update to \"terminalStorageClass\".",
+ "format": "date-time"
+ }
+ }
+ },
+ "location": {
+ "type": "string",
+ "description": "The location of the bucket. Object data for objects in the bucket resides in physical storage within this region. Defaults to US. See the developer's guide for the authoritative list."
+ },
+ "locationType": {
+ "type": "string",
+ "description": "The type of the bucket location."
+ },
+ "logging": {
+ "type": "object",
+ "description": "The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs.",
+ "properties": {
+ "logBucket": {
+ "type": "string",
+ "description": "The destination bucket where the current bucket's logs should be placed."
+ },
+ "logObjectPrefix": {
+ "type": "string",
+ "description": "A prefix for log object names."
+ }
+ }
+ },
+ "metageneration": {
"type": "string",
- "description": "The generation of this object to use as the source.",
+ "description": "The metadata generation of this bucket.",
"format": "int64"
},
"name": {
"type": "string",
- "description": "The source object's name. All source objects must reside in the same bucket.",
+ "description": "The name of the bucket.",
"annotations": {
"required": [
- "storage.objects.compose"
+ "storage.buckets.insert"
]
}
},
- "objectPreconditions": {
+ "owner": {
"type": "object",
- "description": "Conditions that must be met for this operation to execute.",
+ "description": "The owner of the bucket. This is always the project team's owner group.",
"properties": {
- "ifGenerationMatch": {
+ "entity": {
+ "type": "string",
+ "description": "The entity, in the form project-owner-projectId."
+ },
+ "entityId": {
+ "type": "string",
+ "description": "The ID for the entity."
+ }
+ }
+ },
+ "projectNumber": {
+ "type": "string",
+ "description": "The project number of the project the bucket belongs to.",
+ "format": "uint64"
+ },
+ "retentionPolicy": {
+ "type": "object",
+ "description": "The bucket's retention policy. The retention policy enforces a minimum retention time for all objects contained in the bucket, based on their creation time. Any attempt to overwrite or delete objects younger than the retention period will result in a PERMISSION_DENIED error. An unlocked retention policy can be modified or removed from the bucket via a storage.buckets.update operation. A locked retention policy cannot be removed or shortened in duration for the lifetime of the bucket. Attempting to remove or decrease period of a locked retention policy will result in a PERMISSION_DENIED error.",
+ "properties": {
+ "effectiveTime": {
+ "type": "string",
+ "description": "Server-determined value that indicates the time from which policy was enforced and effective. This value is in RFC 3339 format.",
+ "format": "date-time"
+ },
+ "isLocked": {
+ "type": "boolean",
+ "description": "Once locked, an object retention policy cannot be modified."
+ },
+ "retentionPeriod": {
"type": "string",
- "description": "Only perform the composition if the generation of the source object that would be used matches this value. If this value and a generation are both specified, they must be the same value or the call will fail.",
+ "description": "The duration in seconds that objects need to be retained. Retention duration must be greater than zero and less than 100 years. Note that enforcement of retention periods less than a day is not guaranteed. Such periods should only be used for testing purposes.",
"format": "int64"
}
}
- }
- }
- },
- "annotations": {
- "required": [
- "storage.objects.compose"
- ]
- }
- }
-}
-},
- "Folder": {
- "id": "Folder",
- "type": "object",
- "description": "A folder. Only available in buckets with hierarchical namespace enabled.",
- "properties": {
- "bucket": {
- "type": "string",
- "description": "The name of the bucket containing this folder."
- },
- "id": {
- "type": "string",
- "description": "The ID of the folder, including the bucket name, folder name."
- },
- "kind": {
- "type": "string",
- "description": "The kind of item this is. For folders, this is always storage#folder.",
- "default": "storage#folder"
- },
- "metageneration": {
- "type": "string",
- "description": "The version of the metadata for this folder. Used for preconditions and for detecting changes in metadata.",
- "format": "int64"
- },
- "name": {
- "type": "string",
- "description": "The name of the folder. Required if not specified by URL parameter."
- },
- "selfLink": {
- "type": "string",
- "description": "The link to this folder."
- },
- "createTime": {
- "type": "string",
- "description": "The creation time of the folder in RFC 3339 format.",
- "format": "date-time"
- },
- "updateTime": {
- "type": "string",
- "description": "The modification time of the folder metadata in RFC 3339 format.",
- "format": "date-time"
- },
- "pendingRenameInfo": {
- "type": "object",
- "description": "Only present if the folder is part of an ongoing rename folder operation. Contains information which can be used to query the operation status.",
- "properties": {
- "operationId": {
- "type": "string",
- "description": "The ID of the rename folder operation."
+ },
+ "objectRetention": {
+ "type": "object",
+ "description": "The bucket's object retention config.",
+ "properties": {
+ "mode": {
+ "type": "string",
+ "description": "The bucket's object retention mode. Can be Enabled."
+ }
}
- }
- }
- }
- },
- "Folders": {
- "id": "Folders",
- "type": "object",
- "description": "A list of folders.",
- "properties": {
- "items": {
- "type": "array",
- "description": "The list of items.",
- "items": {
- "$ref": "Folder"
- }
- },
- "kind": {
- "type": "string",
- "description": "The kind of item this is. For lists of folders, this is always storage#folders.",
- "default": "storage#folders"
- },
- "nextPageToken": {
- "type": "string",
- "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results."
- }
- }
- },
- "Expr": {
- "id": "Expr",
- "type": "object",
- "description": "Represents an expression text. Example: title: \"User account presence\" description: \"Determines whether the request has a user account\" expression: \"size(request.user) > 0\"",
- "properties": {
- "description": {
- "type": "string",
- "description": "An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI."
- },
- "expression": {
- "type": "string",
- "description": "Textual representation of an expression in Common Expression Language syntax. The application context of the containing message determines which well-known feature set of CEL is supported."
- },
- "location": {
- "type": "string",
- "description": "An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file."
- },
- "title": {
- "type": "string",
- "description": "An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression."
- }
- }
- },
- "GoogleLongrunningOperation": {
- "description": "This resource represents a long-running operation that is the result of a network API call.",
- "id": "GoogleLongrunningOperation",
- "properties": {
- "done": {
- "description": "If the value is \"false\", it means the operation is still in progress. If \"true\", the operation is completed, and either \"error\" or \"response\" is available.",
- "type": "boolean"
- },
- "error": {
- "$ref": "GoogleRpcStatus",
- "description": "The error result of the operation in case of failure or cancellation."
- },
- "metadata": {
- "additionalProperties": {
- "description": "Properties of the object. Contains field @type with type URL.",
- "type": "any"
},
- "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.",
- "type": "object"
- },
- "name": {
- "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the \"name\" should be a resource name ending with \"operations/{operationId}\".",
- "type": "string"
- },
- "response": {
- "additionalProperties": {
- "description": "Properties of the object. Contains field @type with type URL.",
- "type": "any"
+ "rpo": {
+ "type": "string",
+ "description": "The Recovery Point Objective (RPO) of this bucket. Set to ASYNC_TURBO to turn on Turbo Replication on a bucket."
},
- "description": "The normal response of the operation in case of success. If the original method returns no data on success, such as \"Delete\", the response is google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response should have the type \"XxxResponse\", where \"Xxx\" is the original method name. For example, if the original method name is \"TakeSnapshot()\", the inferred response type is \"TakeSnapshotResponse\".",
- "type": "object"
- }
- },
- "type": "object"
- },
- "GoogleLongrunningListOperationsResponse": {
- "description": "The response message for storage.buckets.operations.list.",
- "id": "GoogleLongrunningListOperationsResponse",
- "properties": {
- "nextPageToken": {
- "type": "string",
- "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results."
- },
- "operations": {
- "description": "A list of operations that matches the specified filter in the request.",
- "items": {
- "$ref": "GoogleLongrunningOperation"
+ "selfLink": {
+ "type": "string",
+ "description": "The URI of this bucket."
+ },
+ "softDeletePolicy": {
+ "type": "object",
+ "description": "The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted.",
+ "properties": {
+ "retentionDurationSeconds": {
+ "type": "string",
+ "description": "The duration in seconds that soft-deleted objects in the bucket will be retained and cannot be permanently deleted.",
+ "format": "int64"
+ },
+ "effectiveTime": {
+ "type": "string",
+ "description": "Server-determined value that indicates the time from which the policy, or one with a greater retention, was effective. This value is in RFC 3339 format.",
+ "format": "date-time"
+ }
+ }
+ },
+ "storageClass": {
+ "type": "string",
+ "description": "The bucket's default storage class, used whenever no storageClass is specified for a newly-created object. This defines how objects in the bucket are stored and determines the SLA and the cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD, NEARLINE, COLDLINE, ARCHIVE, and DURABLE_REDUCED_AVAILABILITY. If this value is not specified when the bucket is created, it will default to STANDARD. For more information, see storage classes."
+ },
+ "timeCreated": {
+ "type": "string",
+ "description": "The creation time of the bucket in RFC 3339 format.",
+ "format": "date-time"
+ },
+ "updated": {
+ "type": "string",
+ "description": "The modification time of the bucket in RFC 3339 format.",
+ "format": "date-time"
+ },
+ "versioning": {
+ "type": "object",
+ "description": "The bucket's versioning configuration.",
+ "properties": {
+ "enabled": {
+ "type": "boolean",
+ "description": "While set to true, versioning is fully enabled for this bucket."
+ }
+ }
+ },
+ "website": {
+ "type": "object",
+ "description": "The bucket's website configuration, controlling how the service behaves when accessing bucket contents as a web site. See the Static Website Examples for more information.",
+ "properties": {
+ "mainPageSuffix": {
+ "type": "string",
+ "description": "If the requested object path is missing, the service will ensure the path has a trailing '/', append this suffix, and attempt to retrieve the resulting object. This allows the creation of index.html objects to represent directory pages."
+ },
+ "notFoundPage": {
+ "type": "string",
+ "description": "If the requested object path is missing, and any mainPageSuffix object is missing, if applicable, the service will return the named object from this bucket as the content for a 404 Not Found result."
+ }
+ }
},
- "type": "array"
+ "satisfiesPZS": {
+ "type": "boolean",
+ "description": "Reserved for future use."
+ }
}
},
- "type": "object"
- },
- "GoogleRpcStatus": {
- "description": "The \"Status\" type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each \"Status\" message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).",
- "id": "GoogleRpcStatus",
- "properties": {
- "code": {
- "description": "The status code, which should be an enum value of google.rpc.Code.",
- "format": "int32",
- "type": "integer"
- },
- "details": {
- "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
- "items": {
- "additionalProperties": {
- "description": "Properties of the object. Contains field @type with type URL.",
- "type": "any"
- },
- "type": "object"
+ "AnywhereCache": {
+ "id": "AnywhereCache",
+ "type": "object",
+ "description": "An Anywhere Cache instance.",
+ "properties": {
+ "kind": {
+ "type": "string",
+ "description": "The kind of item this is. For Anywhere Cache, this is always storage#anywhereCache.",
+ "default": "storage#anywhereCache"
},
- "type": "array"
- },
- "message": {
- "description": "A developer-facing error message, which should be in English.",
- "type": "string"
+ "id": {
+ "type": "string",
+ "description": "The ID of the resource, including the project number, bucket name and anywhere cache ID."
+ },
+ "selfLink": {
+ "type": "string",
+ "description": "The link to this cache instance."
+ },
+ "bucket": {
+ "type": "string",
+ "description": "The name of the bucket containing this cache instance."
+ },
+ "anywhereCacheId": {
+ "type": "string",
+ "description": "The ID of the Anywhere cache instance."
+ },
+ "zone": {
+ "type": "string",
+ "description": "The zone in which the cache instance is running. For example, us-central1-a."
+ },
+ "state": {
+ "type": "string",
+ "description": "The current state of the cache instance."
+ },
+ "createTime": {
+ "type": "string",
+ "description": "The creation time of the cache instance in RFC 3339 format.",
+ "format": "date-time"
+ },
+ "updateTime": {
+ "type": "string",
+ "description": "The modification time of the cache instance metadata in RFC 3339 format.",
+ "format": "date-time"
+ },
+ "ttl": {
+ "type": "string",
+ "description": "The TTL of all cache entries in whole seconds. e.g., \"7200s\". ",
+ "format": "google-duration"
+ },
+ "admissionPolicy": {
+ "type": "string",
+ "description": "The cache-level entry admission policy."
+ },
+ "pendingUpdate": {
+ "type": "boolean",
+ "description": "True if the cache instance has an active Update long-running operation."
+ }
}
},
- "type": "object"
- },
- "HmacKey": {
- "id": "HmacKey",
- "type": "object",
- "description": "JSON template to produce a JSON-style HMAC Key resource for Create responses.",
- "properties": {
- "kind": {
- "type": "string",
- "description": "The kind of item this is. For HMAC keys, this is always storage#hmacKey.",
- "default": "storage#hmacKey"
- },
- "metadata": {
- "$ref": "HmacKeyMetadata",
- "description": "Key metadata."
- },
- "secret": {
- "type": "string",
- "description": "HMAC secret key material."
- }
- }
- },
- "HmacKeyMetadata": {
- "id": "HmacKeyMetadata",
- "type": "object",
- "description": "JSON template to produce a JSON-style HMAC Key metadata resource.",
- "properties": {
- "accessId": {
- "type": "string",
- "description": "The ID of the HMAC Key."
- },
- "etag": {
- "type": "string",
- "description": "HTTP 1.1 Entity tag for the HMAC key."
- },
- "id": {
- "type": "string",
- "description": "The ID of the HMAC key, including the Project ID and the Access ID."
- },
- "kind": {
- "type": "string",
- "description": "The kind of item this is. For HMAC Key metadata, this is always storage#hmacKeyMetadata.",
- "default": "storage#hmacKeyMetadata"
- },
- "projectId": {
- "type": "string",
- "description": "Project ID owning the service account to which the key authenticates."
- },
- "selfLink": {
- "type": "string",
- "description": "The link to this resource."
- },
- "serviceAccountEmail": {
- "type": "string",
- "description": "The email address of the key's associated service account."
- },
- "state": {
- "type": "string",
- "description": "The state of the key. Can be one of ACTIVE, INACTIVE, or DELETED."
- },
- "timeCreated": {
- "type": "string",
- "description": "The creation time of the HMAC key in RFC 3339 format.",
- "format": "date-time"
- },
- "updated": {
- "type": "string",
- "description": "The last modification time of the HMAC key metadata in RFC 3339 format.",
- "format": "date-time"
- }
- }
- },
- "HmacKeysMetadata": {
- "id": "HmacKeysMetadata",
- "type": "object",
- "description": "A list of hmacKeys.",
- "properties": {
- "items": {
- "type": "array",
- "description": "The list of items.",
+ "AnywhereCaches": {
+ "id": "AnywhereCaches",
+ "type": "object",
+ "description": "A list of Anywhere Caches.",
+ "properties": {
+ "kind": {
+ "type": "string",
+ "description": "The kind of item this is. For lists of Anywhere Caches, this is always storage#anywhereCaches.",
+ "default": "storage#anywhereCaches"
+ },
+ "nextPageToken": {
+ "type": "string",
+ "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results."
+ },
"items": {
- "$ref": "HmacKeyMetadata"
+ "type": "array",
+ "description": "The list of items.",
+ "items": {
+ "$ref": "AnywhereCache"
+ }
}
- },
- "kind": {
- "type": "string",
- "description": "The kind of item this is. For lists of hmacKeys, this is always storage#hmacKeysMetadata.",
- "default": "storage#hmacKeysMetadata"
- },
- "nextPageToken": {
- "type": "string",
- "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results."
}
- }
- },
- "ManagedFolder": {
- "id": "ManagedFolder",
- "type": "object",
- "description": "A managed folder.",
- "properties": {
- "bucket": {
- "type": "string",
- "description": "The name of the bucket containing this managed folder."
- },
- "id": {
- "type": "string",
- "description": "The ID of the managed folder, including the bucket name and managed folder name."
- },
- "kind": {
- "type": "string",
- "description": "The kind of item this is. For managed folders, this is always storage#managedFolder.",
- "default": "storage#managedFolder"
- },
- "metageneration": {
- "type": "string",
- "description": "The version of the metadata for this managed folder. Used for preconditions and for detecting changes in metadata.",
- "format": "int64"
- },
- "name": {
- "type": "string",
- "description": "The name of the managed folder. Required if not specified by URL parameter."
- },
- "selfLink": {
- "type": "string",
- "description": "The link to this managed folder."
- },
- "createTime": {
- "type": "string",
- "description": "The creation time of the managed folder in RFC 3339 format.",
- "format": "date-time"
- },
- "updateTime": {
- "type": "string",
- "description": "The last update time of the managed folder metadata in RFC 3339 format.",
- "format": "date-time"
- }
- }
- },
- "ManagedFolders": {
- "id": "ManagedFolders",
- "type": "object",
- "description": "A list of managed folders.",
- "properties": {
- "items": {
- "type": "array",
- "description": "The list of items.",
- "items": {
- "$ref": "ManagedFolder"
+ },
+ "BucketAccessControl": {
+ "id": "BucketAccessControl",
+ "type": "object",
+ "description": "An access-control entry.",
+ "properties": {
+ "bucket": {
+ "type": "string",
+ "description": "The name of the bucket."
+ },
+ "domain": {
+ "type": "string",
+ "description": "The domain associated with the entity, if any."
+ },
+ "email": {
+ "type": "string",
+ "description": "The email address associated with the entity, if any."
+ },
+ "entity": {
+ "type": "string",
+ "description": "The entity holding the permission, in one of the following forms: \n- user-userId \n- user-email \n- group-groupId \n- group-email \n- domain-domain \n- project-team-projectId \n- allUsers \n- allAuthenticatedUsers Examples: \n- The user liz@example.com would be user-liz@example.com. \n- The group example@googlegroups.com would be group-example@googlegroups.com. \n- To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.",
+ "annotations": {
+ "required": [
+ "storage.bucketAccessControls.insert"
+ ]
+ }
+ },
+ "entityId": {
+ "type": "string",
+ "description": "The ID for the entity, if any."
+ },
+ "etag": {
+ "type": "string",
+ "description": "HTTP 1.1 Entity tag for the access-control entry."
+ },
+ "id": {
+ "type": "string",
+ "description": "The ID of the access-control entry."
+ },
+ "kind": {
+ "type": "string",
+ "description": "The kind of item this is. For bucket access control entries, this is always storage#bucketAccessControl.",
+ "default": "storage#bucketAccessControl"
+ },
+ "projectTeam": {
+ "type": "object",
+ "description": "The project team associated with the entity, if any.",
+ "properties": {
+ "projectNumber": {
+ "type": "string",
+ "description": "The project number."
+ },
+ "team": {
+ "type": "string",
+ "description": "The team."
+ }
+ }
+ },
+ "role": {
+ "type": "string",
+ "description": "The access permission for the entity.",
+ "annotations": {
+ "required": [
+ "storage.bucketAccessControls.insert"
+ ]
+ }
+ },
+ "selfLink": {
+ "type": "string",
+ "description": "The link to this access-control entry."
}
- },
- "kind": {
- "type": "string",
- "description": "The kind of item this is. For lists of managed folders, this is always storage#managedFolders.",
- "default": "storage#managedFolders"
- },
- "nextPageToken": {
- "type": "string",
- "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results."
}
- }
- },
- "Notification": {
- "id": "Notification",
- "type": "object",
- "description": "A subscription to receive Google PubSub notifications.",
- "properties": {
- "custom_attributes": {
- "type": "object",
- "description": "An optional list of additional attributes to attach to each Cloud PubSub message published for this notification subscription.",
- "additionalProperties": {
- "type": "string"
- }
- },
- "etag": {
- "type": "string",
- "description": "HTTP 1.1 Entity tag for this subscription notification."
- },
- "event_types": {
- "type": "array",
- "description": "If present, only send notifications about listed event types. If empty, sent notifications for all event types.",
+ },
+ "BucketAccessControls": {
+ "id": "BucketAccessControls",
+ "type": "object",
+ "description": "An access-control list.",
+ "properties": {
"items": {
- "type": "string"
- }
- },
- "id": {
- "type": "string",
- "description": "The ID of the notification."
- },
- "kind": {
- "type": "string",
- "description": "The kind of item this is. For notifications, this is always storage#notification.",
- "default": "storage#notification"
- },
- "object_name_prefix": {
- "type": "string",
- "description": "If present, only apply this notification configuration to object names that begin with this prefix."
- },
- "payload_format": {
- "type": "string",
- "description": "The desired content of the Payload.",
- "default": "JSON_API_V1",
- "annotations": {
- "required": [
- "storage.notifications.insert"
- ]
- }
- },
- "selfLink": {
- "type": "string",
- "description": "The canonical URL of this notification."
- },
- "topic": {
- "type": "string",
- "description": "The Cloud PubSub topic to which this subscription publishes. Formatted as: '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'",
- "annotations": {
- "required": [
- "storage.notifications.insert"
- ]
+ "type": "array",
+ "description": "The list of items.",
+ "items": {
+ "$ref": "BucketAccessControl"
+ }
+ },
+ "kind": {
+ "type": "string",
+ "description": "The kind of item this is. For lists of bucket access control entries, this is always storage#bucketAccessControls.",
+ "default": "storage#bucketAccessControls"
}
}
- }
- },
- "Notifications": {
- "id": "Notifications",
- "type": "object",
- "description": "A list of notification subscriptions.",
- "properties": {
- "items": {
- "type": "array",
- "description": "The list of items.",
+ },
+ "Buckets": {
+ "id": "Buckets",
+ "type": "object",
+ "description": "A list of buckets.",
+ "properties": {
"items": {
- "$ref": "Notification"
+ "type": "array",
+ "description": "The list of items.",
+ "items": {
+ "$ref": "Bucket"
+ }
+ },
+ "kind": {
+ "type": "string",
+ "description": "The kind of item this is. For lists of buckets, this is always storage#buckets.",
+ "default": "storage#buckets"
+ },
+ "nextPageToken": {
+ "type": "string",
+ "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results."
}
- },
- "kind": {
- "type": "string",
- "description": "The kind of item this is. For lists of notifications, this is always storage#notifications.",
- "default": "storage#notifications"
}
- }
- },
- "Object": {
- "id": "Object",
- "type": "object",
- "description": "An object.",
- "properties": {
- "acl": {
- "type": "array",
- "description": "Access controls on the object.",
- "items": {
- "$ref": "ObjectAccessControl"
+ },
+ "Channel": {
+ "id": "Channel",
+ "type": "object",
+ "description": "An notification channel used to watch for resource changes.",
+ "properties": {
+ "address": {
+ "type": "string",
+ "description": "The address where notifications are delivered for this channel."
},
- "annotations": {
- "required": [
- "storage.objects.update"
- ]
- }
- },
- "bucket": {
- "type": "string",
- "description": "The name of the bucket containing this object."
- },
- "cacheControl": {
- "type": "string",
- "description": "Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600."
- },
- "componentCount": {
- "type": "integer",
- "description": "Number of underlying components that make up this object. Components are accumulated by compose operations.",
- "format": "int32"
- },
- "contentDisposition": {
- "type": "string",
- "description": "Content-Disposition of the object data."
- },
- "contentEncoding": {
- "type": "string",
- "description": "Content-Encoding of the object data."
- },
- "contentLanguage": {
- "type": "string",
- "description": "Content-Language of the object data."
- },
- "contentType": {
- "type": "string",
- "description": "Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream."
- },
- "crc32c": {
- "type": "string",
- "description": "CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see Hashes and ETags: Best Practices."
- },
- "customTime": {
- "type": "string",
- "description": "A timestamp in RFC 3339 format specified by the user for an object.",
- "format": "date-time"
- },
- "customerEncryption": {
- "type": "object",
- "description": "Metadata of customer-supplied encryption key, if the object is encrypted by such a key.",
- "properties": {
- "encryptionAlgorithm": {
- "type": "string",
- "description": "The encryption algorithm."
- },
- "keySha256": {
- "type": "string",
- "description": "SHA256 hash value of the encryption key."
- }
- }
- },
- "etag": {
- "type": "string",
- "description": "HTTP 1.1 Entity tag for the object."
- },
- "eventBasedHold": {
- "type": "boolean",
- "description": "Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold's release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false."
- },
- "generation": {
- "type": "string",
- "description": "The content generation of this object. Used for object versioning.",
- "format": "int64"
- },
- "id": {
- "type": "string",
- "description": "The ID of the object, including the bucket name, object name, and generation number."
- },
- "kind": {
- "type": "string",
- "description": "The kind of item this is. For objects, this is always storage#object.",
- "default": "storage#object"
- },
- "kmsKeyName": {
- "type": "string",
- "description": "Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request."
- },
- "md5Hash": {
- "type": "string",
- "description": "MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices."
- },
- "mediaLink": {
- "type": "string",
- "description": "Media download link."
- },
- "metadata": {
- "type": "object",
- "description": "User-provided metadata, in key/value pairs.",
- "additionalProperties": {
+ "expiration": {
"type": "string",
- "description": "An individual metadata entry."
- }
- },
- "metageneration": {
- "type": "string",
- "description": "The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.",
- "format": "int64"
- },
- "name": {
- "type": "string",
- "description": "The name of the object. Required if not specified by URL parameter."
- },
- "owner": {
- "type": "object",
- "description": "The owner of the object. This will always be the uploader of the object.",
- "properties": {
- "entity": {
- "type": "string",
- "description": "The entity, in the form user-userId."
- },
- "entityId": {
- "type": "string",
- "description": "The ID for the entity."
- }
- }
- },
- "retentionExpirationTime": {
- "type": "string",
- "description": "A server-determined value that specifies the earliest time that the object's retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).",
- "format": "date-time"
- },
- "retention": {
- "type": "object",
- "description": "A collection of object level retention parameters.",
- "properties": {
- "retainUntilTime": {
- "type": "string",
- "description": "A time in RFC 3339 format until which object retention protects this object.",
- "format": "date-time"
- },
- "mode": {
+ "description": "Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.",
+ "format": "int64"
+ },
+ "id": {
+ "type": "string",
+ "description": "A UUID or similar unique string that identifies this channel."
+ },
+ "kind": {
+ "type": "string",
+ "description": "Identifies this as a notification channel used to watch for changes to a resource, which is \"api#channel\".",
+ "default": "api#channel"
+ },
+ "params": {
+ "type": "object",
+ "description": "Additional parameters controlling delivery channel behavior. Optional.",
+ "additionalProperties": {
"type": "string",
- "description": "The bucket's object retention mode, can only be Unlocked or Locked."
+ "description": "Declares a new parameter by name."
}
+ },
+ "payload": {
+ "type": "boolean",
+ "description": "A Boolean value to indicate whether payload is wanted. Optional."
+ },
+ "resourceId": {
+ "type": "string",
+ "description": "An opaque ID that identifies the resource being watched on this channel. Stable across different API versions."
+ },
+ "resourceUri": {
+ "type": "string",
+ "description": "A version-specific identifier for the watched resource."
+ },
+ "token": {
+ "type": "string",
+ "description": "An arbitrary string delivered to the target address with each notification delivered over this channel. Optional."
+ },
+ "type": {
+ "type": "string",
+ "description": "The type of delivery mechanism used for this channel."
}
- },
- "selfLink": {
- "type": "string",
- "description": "The link to this object."
- },
- "size": {
- "type": "string",
- "description": "Content-Length of the data in bytes.",
- "format": "uint64"
- },
- "storageClass": {
- "type": "string",
- "description": "Storage class of the object."
- },
- "temporaryHold": {
- "type": "boolean",
- "description": "Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object."
- },
- "timeCreated": {
- "type": "string",
- "description": "The creation time of the object in RFC 3339 format.",
- "format": "date-time"
- },
- "timeDeleted": {
- "type": "string",
- "description": "The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.",
- "format": "date-time"
- },
- "softDeleteTime": {
- "type": "string",
- "description": "The time at which the object became soft-deleted in RFC 3339 format.",
- "format": "date-time"
- },
- "hardDeleteTime": {
- "type": "string",
- "description": "This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket.",
- "format": "date-time"
- },
- "timeStorageClassUpdated": {
- "type": "string",
- "description": "The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated.",
- "format": "date-time"
- },
- "updated": {
- "type": "string",
- "description": "The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.",
- "format": "date-time"
}
- }
- },
- "ObjectAccessControl": {
- "id": "ObjectAccessControl",
- "type": "object",
- "description": "An access-control entry.",
- "properties": {
- "bucket": {
- "type": "string",
- "description": "The name of the bucket."
- },
- "domain": {
- "type": "string",
- "description": "The domain associated with the entity, if any."
- },
- "email": {
- "type": "string",
- "description": "The email address associated with the entity, if any."
- },
- "entity": {
- "type": "string",
- "description": "The entity holding the permission, in one of the following forms: \n- user-userId \n- user-email \n- group-groupId \n- group-email \n- domain-domain \n- project-team-projectId \n- allUsers \n- allAuthenticatedUsers Examples: \n- The user liz@example.com would be user-liz@example.com. \n- The group example@googlegroups.com would be group-example@googlegroups.com. \n- To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.",
- "annotations": {
- "required": [
- "storage.defaultObjectAccessControls.insert",
- "storage.objectAccessControls.insert"
- ]
- }
- },
- "entityId": {
- "type": "string",
- "description": "The ID for the entity, if any."
- },
- "etag": {
- "type": "string",
- "description": "HTTP 1.1 Entity tag for the access-control entry."
- },
- "generation": {
- "type": "string",
- "description": "The content generation of the object, if applied to an object.",
- "format": "int64"
- },
- "id": {
- "type": "string",
- "description": "The ID of the access-control entry."
- },
- "kind": {
- "type": "string",
- "description": "The kind of item this is. For object access control entries, this is always storage#objectAccessControl.",
- "default": "storage#objectAccessControl"
- },
- "object": {
- "type": "string",
- "description": "The name of the object, if applied to an object."
- },
- "projectTeam": {
- "type": "object",
- "description": "The project team associated with the entity, if any.",
- "properties": {
- "projectNumber": {
- "type": "string",
- "description": "The project number."
+ },
+ "ComposeRequest": {
+ "id": "ComposeRequest",
+ "type": "object",
+ "description": "A Compose request.",
+ "properties": {
+ "destination": {
+ "$ref": "Object",
+ "description": "Properties of the resulting object."
+ },
+ "kind": {
+ "type": "string",
+ "description": "The kind of item this is.",
+ "default": "storage#composeRequest"
+ },
+ "sourceObjects": {
+ "type": "array",
+ "description": "The list of source objects that will be concatenated into a single object.",
+ "items": {
+ "type": "object",
+ "properties": {
+ "generation": {
+ "type": "string",
+ "description": "The generation of this object to use as the source.",
+ "format": "int64"
+ },
+ "name": {
+ "type": "string",
+ "description": "The source object's name. All source objects must reside in the same bucket.",
+ "annotations": {
+ "required": [
+ "storage.objects.compose"
+ ]
+ }
+ },
+ "objectPreconditions": {
+ "type": "object",
+ "description": "Conditions that must be met for this operation to execute.",
+ "properties": {
+ "ifGenerationMatch": {
+ "type": "string",
+ "description": "Only perform the composition if the generation of the source object that would be used matches this value. If this value and a generation are both specified, they must be the same value or the call will fail.",
+ "format": "int64"
+ }
+ }
+ }
+ }
},
- "team": {
- "type": "string",
- "description": "The team."
+ "annotations": {
+ "required": [
+ "storage.objects.compose"
+ ]
}
}
- },
- "role": {
- "type": "string",
- "description": "The access permission for the entity.",
- "annotations": {
- "required": [
- "storage.defaultObjectAccessControls.insert",
- "storage.objectAccessControls.insert"
- ]
+ }
+ },
+ "Folder": {
+ "id": "Folder",
+ "type": "object",
+ "description": "A folder. Only available in buckets with hierarchical namespace enabled.",
+ "properties": {
+ "bucket": {
+ "type": "string",
+ "description": "The name of the bucket containing this folder."
+ },
+ "id": {
+ "type": "string",
+ "description": "The ID of the folder, including the bucket name, folder name."
+ },
+ "kind": {
+ "type": "string",
+ "description": "The kind of item this is. For folders, this is always storage#folder.",
+ "default": "storage#folder"
+ },
+ "metageneration": {
+ "type": "string",
+ "description": "The version of the metadata for this folder. Used for preconditions and for detecting changes in metadata.",
+ "format": "int64"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the folder. Required if not specified by URL parameter."
+ },
+ "selfLink": {
+ "type": "string",
+ "description": "The link to this folder."
+ },
+ "createTime": {
+ "type": "string",
+ "description": "The creation time of the folder in RFC 3339 format.",
+ "format": "date-time"
+ },
+ "updateTime": {
+ "type": "string",
+ "description": "The modification time of the folder metadata in RFC 3339 format.",
+ "format": "date-time"
+ },
+ "pendingRenameInfo": {
+ "type": "object",
+ "description": "Only present if the folder is part of an ongoing rename folder operation. Contains information which can be used to query the operation status.",
+ "properties": {
+ "operationId": {
+ "type": "string",
+ "description": "The ID of the rename folder operation."
+ }
+ }
}
- },
- "selfLink": {
- "type": "string",
- "description": "The link to this access-control entry."
}
- }
- },
- "ObjectAccessControls": {
- "id": "ObjectAccessControls",
- "type": "object",
- "description": "An access-control list.",
- "properties": {
- "items": {
- "type": "array",
- "description": "The list of items.",
+ },
+ "Folders": {
+ "id": "Folders",
+ "type": "object",
+ "description": "A list of folders.",
+ "properties": {
"items": {
- "$ref": "ObjectAccessControl"
+ "type": "array",
+ "description": "The list of items.",
+ "items": {
+ "$ref": "Folder"
+ }
+ },
+ "kind": {
+ "type": "string",
+ "description": "The kind of item this is. For lists of folders, this is always storage#folders.",
+ "default": "storage#folders"
+ },
+ "nextPageToken": {
+ "type": "string",
+ "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results."
}
- },
- "kind": {
- "type": "string",
- "description": "The kind of item this is. For lists of object access control entries, this is always storage#objectAccessControls.",
- "default": "storage#objectAccessControls"
}
- }
- },
- "Objects": {
- "id": "Objects",
- "type": "object",
- "description": "A list of objects.",
- "properties": {
- "items": {
- "type": "array",
- "description": "The list of items.",
- "items": {
- "$ref": "Object"
+ },
+ "Expr": {
+ "id": "Expr",
+ "type": "object",
+ "description": "Represents an expression text. Example: title: \"User account presence\" description: \"Determines whether the request has a user account\" expression: \"size(request.user) > 0\"",
+ "properties": {
+ "description": {
+ "type": "string",
+ "description": "An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI."
+ },
+ "expression": {
+ "type": "string",
+ "description": "Textual representation of an expression in Common Expression Language syntax. The application context of the containing message determines which well-known feature set of CEL is supported."
+ },
+ "location": {
+ "type": "string",
+ "description": "An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file."
+ },
+ "title": {
+ "type": "string",
+ "description": "An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression."
+ }
+ }
+ },
+ "GoogleLongrunningOperation": {
+ "description": "This resource represents a long-running operation that is the result of a network API call.",
+ "id": "GoogleLongrunningOperation",
+ "properties": {
+ "done": {
+ "description": "If the value is \"false\", it means the operation is still in progress. If \"true\", the operation is completed, and either \"error\" or \"response\" is available.",
+ "type": "boolean"
+ },
+ "error": {
+ "$ref": "GoogleRpcStatus",
+ "description": "The error result of the operation in case of failure or cancellation."
+ },
+ "metadata": {
+ "additionalProperties": {
+ "description": "Properties of the object. Contains field @type with type URL.",
+ "type": "any"
+ },
+ "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.",
+ "type": "object"
+ },
+ "name": {
+ "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the \"name\" should be a resource name ending with \"operations/{operationId}\".",
+ "type": "string"
+ },
+ "response": {
+ "additionalProperties": {
+ "description": "Properties of the object. Contains field @type with type URL.",
+ "type": "any"
+ },
+ "description": "The normal response of the operation in case of success. If the original method returns no data on success, such as \"Delete\", the response is google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response should have the type \"XxxResponse\", where \"Xxx\" is the original method name. For example, if the original method name is \"TakeSnapshot()\", the inferred response type is \"TakeSnapshotResponse\".",
+ "type": "object"
}
},
- "kind": {
- "type": "string",
- "description": "The kind of item this is. For lists of objects, this is always storage#objects.",
- "default": "storage#objects"
- },
- "nextPageToken": {
- "type": "string",
- "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results."
+ "type": "object"
+ },
+ "GoogleLongrunningListOperationsResponse": {
+ "description": "The response message for storage.buckets.operations.list.",
+ "id": "GoogleLongrunningListOperationsResponse",
+ "properties": {
+ "nextPageToken": {
+ "type": "string",
+ "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results."
+ },
+ "operations": {
+ "description": "A list of operations that matches the specified filter in the request.",
+ "items": {
+ "$ref": "GoogleLongrunningOperation"
+ },
+ "type": "array"
+ }
},
- "prefixes": {
- "type": "array",
- "description": "The list of prefixes of objects matching-but-not-listed up to and including the requested delimiter.",
- "items": {
+ "type": "object"
+ },
+ "GoogleRpcStatus": {
+ "description": "The \"Status\" type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each \"Status\" message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).",
+ "id": "GoogleRpcStatus",
+ "properties": {
+ "code": {
+ "description": "The status code, which should be an enum value of google.rpc.Code.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "details": {
+ "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
+ "items": {
+ "additionalProperties": {
+ "description": "Properties of the object. Contains field @type with type URL.",
+ "type": "any"
+ },
+ "type": "object"
+ },
+ "type": "array"
+ },
+ "message": {
+ "description": "A developer-facing error message, which should be in English.",
"type": "string"
}
+ },
+ "type": "object"
+ },
+ "HmacKey": {
+ "id": "HmacKey",
+ "type": "object",
+ "description": "JSON template to produce a JSON-style HMAC Key resource for Create responses.",
+ "properties": {
+ "kind": {
+ "type": "string",
+ "description": "The kind of item this is. For HMAC keys, this is always storage#hmacKey.",
+ "default": "storage#hmacKey"
+ },
+ "metadata": {
+ "$ref": "HmacKeyMetadata",
+ "description": "Key metadata."
+ },
+ "secret": {
+ "type": "string",
+ "description": "HMAC secret key material."
+ }
}
- }
- },
- "Policy": {
- "id": "Policy",
- "type": "object",
- "description": "A bucket/object/managedFolder IAM policy.",
- "properties": {
- "bindings": {
- "type": "array",
- "description": "An association between a role, which comes with a set of permissions, and members who may assume that role.",
+ },
+ "HmacKeyMetadata": {
+ "id": "HmacKeyMetadata",
+ "type": "object",
+ "description": "JSON template to produce a JSON-style HMAC Key metadata resource.",
+ "properties": {
+ "accessId": {
+ "type": "string",
+ "description": "The ID of the HMAC Key."
+ },
+ "etag": {
+ "type": "string",
+ "description": "HTTP 1.1 Entity tag for the HMAC key."
+ },
+ "id": {
+ "type": "string",
+ "description": "The ID of the HMAC key, including the Project ID and the Access ID."
+ },
+ "kind": {
+ "type": "string",
+ "description": "The kind of item this is. For HMAC Key metadata, this is always storage#hmacKeyMetadata.",
+ "default": "storage#hmacKeyMetadata"
+ },
+ "projectId": {
+ "type": "string",
+ "description": "Project ID owning the service account to which the key authenticates."
+ },
+ "selfLink": {
+ "type": "string",
+ "description": "The link to this resource."
+ },
+ "serviceAccountEmail": {
+ "type": "string",
+ "description": "The email address of the key's associated service account."
+ },
+ "state": {
+ "type": "string",
+ "description": "The state of the key. Can be one of ACTIVE, INACTIVE, or DELETED."
+ },
+ "timeCreated": {
+ "type": "string",
+ "description": "The creation time of the HMAC key in RFC 3339 format.",
+ "format": "date-time"
+ },
+ "updated": {
+ "type": "string",
+ "description": "The last modification time of the HMAC key metadata in RFC 3339 format.",
+ "format": "date-time"
+ }
+ }
+ },
+ "HmacKeysMetadata": {
+ "id": "HmacKeysMetadata",
+ "type": "object",
+ "description": "A list of hmacKeys.",
+ "properties": {
"items": {
- "type": "object",
- "properties": {
- "condition": {
- "$ref": "Expr",
- "description": "The condition that is associated with this binding. NOTE: an unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently."
- },
- "members": {
- "type": "array",
- "description": "A collection of identifiers for members who may assume the provided role. Recognized identifiers are as follows: \n- allUsers \u2014 A special identifier that represents anyone on the internet; with or without a Google account. \n- allAuthenticatedUsers \u2014 A special identifier that represents anyone who is authenticated with a Google account or a service account. \n- user:emailid \u2014 An email address that represents a specific account. For example, user:alice@gmail.com or user:joe@example.com. \n- serviceAccount:emailid \u2014 An email address that represents a service account. For example, serviceAccount:my-other-app@appspot.gserviceaccount.com . \n- group:emailid \u2014 An email address that represents a Google group. For example, group:admins@example.com. \n- domain:domain \u2014 A Google Apps domain name that represents all the users of that domain. For example, domain:google.com or domain:example.com. \n- projectOwner:projectid \u2014 Owners of the given project. For example, projectOwner:my-example-project \n- projectEditor:projectid \u2014 Editors of the given project. For example, projectEditor:my-example-project \n- projectViewer:projectid \u2014 Viewers of the given project. For example, projectViewer:my-example-project",
- "items": {
- "type": "string"
- },
- "annotations": {
- "required": [
- "storage.buckets.setIamPolicy",
- "storage.objects.setIamPolicy",
- "storage.managedFolders.setIamPolicy"
- ]
- }
- },
- "role": {
- "type": "string",
- "description": "The role to which members belong. Two types of roles are supported: new IAM roles, which grant permissions that do not map directly to those provided by ACLs, and legacy IAM roles, which do map directly to ACL permissions. All roles are of the format roles/storage.specificRole.\nThe new IAM roles are: \n- roles/storage.admin \u2014 Full control of Google Cloud Storage resources. \n- roles/storage.objectViewer \u2014 Read-Only access to Google Cloud Storage objects. \n- roles/storage.objectCreator \u2014 Access to create objects in Google Cloud Storage. \n- roles/storage.objectAdmin \u2014 Full control of Google Cloud Storage objects. The legacy IAM roles are: \n- roles/storage.legacyObjectReader \u2014 Read-only access to objects without listing. Equivalent to an ACL entry on an object with the READER role. \n- roles/storage.legacyObjectOwner \u2014 Read/write access to existing objects without listing. Equivalent to an ACL entry on an object with the OWNER role. \n- roles/storage.legacyBucketReader \u2014 Read access to buckets with object listing. Equivalent to an ACL entry on a bucket with the READER role. \n- roles/storage.legacyBucketWriter \u2014 Read access to buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the WRITER role. \n- roles/storage.legacyBucketOwner \u2014 Read and write access to existing buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the OWNER role.",
- "annotations": {
- "required": [
- "storage.buckets.setIamPolicy",
- "storage.objects.setIamPolicy",
- "storage.managedFolders.setIamPolicy"
- ]
- }
- }
+ "type": "array",
+ "description": "The list of items.",
+ "items": {
+ "$ref": "HmacKeyMetadata"
}
},
- "annotations": {
- "required": [
- "storage.buckets.setIamPolicy",
- "storage.objects.setIamPolicy",
- "storage.managedFolders.setIamPolicy"
- ]
+ "kind": {
+ "type": "string",
+ "description": "The kind of item this is. For lists of hmacKeys, this is always storage#hmacKeysMetadata.",
+ "default": "storage#hmacKeysMetadata"
+ },
+ "nextPageToken": {
+ "type": "string",
+ "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results."
}
- },
- "etag": {
- "type": "string",
- "description": "HTTP 1.1 Entity tag for the policy.",
- "format": "byte"
- },
- "kind": {
- "type": "string",
- "description": "The kind of item this is. For policies, this is always storage#policy. This field is ignored on input.",
- "default": "storage#policy"
- },
- "resourceId": {
- "type": "string",
- "description": "The ID of the resource to which this policy belongs. Will be of the form projects/_/buckets/bucket for buckets, projects/_/buckets/bucket/objects/object for objects, and projects/_/buckets/bucket/managedFolders/managedFolder. A specific generation may be specified by appending #generationNumber to the end of the object name, e.g. projects/_/buckets/my-bucket/objects/data.txt#17. The current generation can be denoted with #0. This field is ignored on input."
- },
- "version": {
- "type": "integer",
- "description": "The IAM policy format version.",
- "format": "int32"
- }
- }
- },
- "RewriteResponse": {
- "id": "RewriteResponse",
- "type": "object",
- "description": "A rewrite response.",
- "properties": {
- "done": {
- "type": "boolean",
- "description": "true if the copy is finished; otherwise, false if the copy is in progress. This property is always present in the response."
- },
- "kind": {
- "type": "string",
- "description": "The kind of item this is.",
- "default": "storage#rewriteResponse"
- },
- "objectSize": {
- "type": "string",
- "description": "The total size of the object being copied in bytes. This property is always present in the response.",
- "format": "int64"
- },
- "resource": {
- "$ref": "Object",
- "description": "A resource containing the metadata for the copied-to object. This property is present in the response only when copying completes."
- },
- "rewriteToken": {
- "type": "string",
- "description": "A token to use in subsequent requests to continue copying data. This token is present in the response only when there is more data to copy."
- },
- "totalBytesRewritten": {
- "type": "string",
- "description": "The total bytes written so far, which can be used to provide a waiting user with a progress indicator. This property is always present in the response.",
- "format": "int64"
- }
- }
- },
- "ServiceAccount": {
- "id": "ServiceAccount",
- "type": "object",
- "description": "A subscription to receive Google PubSub notifications.",
- "properties": {
- "email_address": {
- "type": "string",
- "description": "The ID of the notification."
- },
- "kind": {
- "type": "string",
- "description": "The kind of item this is. For notifications, this is always storage#notification.",
- "default": "storage#serviceAccount"
}
- }
- },
- "TestIamPermissionsResponse": {
- "id": "TestIamPermissionsResponse",
- "type": "object",
- "description": "A storage.(buckets|objects|managedFolders).testIamPermissions response.",
- "properties": {
- "kind": {
- "type": "string",
- "description": "The kind of item this is.",
- "default": "storage#testIamPermissionsResponse"
- },
- "permissions": {
- "type": "array",
- "description": "The permissions held by the caller. Permissions are always of the format storage.resource.capability, where resource is one of buckets, objects, or managedFolders. The supported permissions are as follows: \n- storage.buckets.delete \u2014 Delete bucket. \n- storage.buckets.get \u2014 Read bucket metadata. \n- storage.buckets.getIamPolicy \u2014 Read bucket IAM policy. \n- storage.buckets.create \u2014 Create bucket. \n- storage.buckets.list \u2014 List buckets. \n- storage.buckets.setIamPolicy \u2014 Update bucket IAM policy. \n- storage.buckets.update \u2014 Update bucket metadata. \n- storage.objects.delete \u2014 Delete object. \n- storage.objects.get \u2014 Read object data and metadata. \n- storage.objects.getIamPolicy \u2014 Read object IAM policy. \n- storage.objects.create \u2014 Create object. \n- storage.objects.list \u2014 List objects. \n- storage.objects.setIamPolicy \u2014 Update object IAM policy. \n- storage.objects.update \u2014 Update object metadata. \n- storage.managedFolders.delete \u2014 Delete managed folder. \n- storage.managedFolders.get \u2014 Read managed folder metadata. \n- storage.managedFolders.getIamPolicy \u2014 Read managed folder IAM policy. \n- storage.managedFolders.create \u2014 Create managed folder. \n- storage.managedFolders.list \u2014 List managed folders. \n- storage.managedFolders.setIamPolicy \u2014 Update managed folder IAM policy.",
- "items": {
- "type": "string"
+ },
+ "ManagedFolder": {
+ "id": "ManagedFolder",
+ "type": "object",
+ "description": "A managed folder.",
+ "properties": {
+ "bucket": {
+ "type": "string",
+ "description": "The name of the bucket containing this managed folder."
+ },
+ "id": {
+ "type": "string",
+ "description": "The ID of the managed folder, including the bucket name and managed folder name."
+ },
+ "kind": {
+ "type": "string",
+ "description": "The kind of item this is. For managed folders, this is always storage#managedFolder.",
+ "default": "storage#managedFolder"
+ },
+ "metageneration": {
+ "type": "string",
+ "description": "The version of the metadata for this managed folder. Used for preconditions and for detecting changes in metadata.",
+ "format": "int64"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the managed folder. Required if not specified by URL parameter."
+ },
+ "selfLink": {
+ "type": "string",
+ "description": "The link to this managed folder."
+ },
+ "createTime": {
+ "type": "string",
+ "description": "The creation time of the managed folder in RFC 3339 format.",
+ "format": "date-time"
+ },
+ "updateTime": {
+ "type": "string",
+ "description": "The last update time of the managed folder metadata in RFC 3339 format.",
+ "format": "date-time"
}
}
- }
- },
- "BulkRestoreObjectsRequest": {
- "id": "BulkRestoreObjectsRequest",
- "type": "object",
- "description": "A bulk restore objects request.",
- "properties": {
- "allowOverwrite": {
- "type": "boolean",
- "description": "If false (default), the restore will not overwrite live objects with the same name at the destination. This means some deleted objects may be skipped. If true, live objects will be overwritten resulting in a noncurrent object (if versioning is enabled). If versioning is not enabled, overwriting the object will result in a soft-deleted object. In either case, if a noncurrent object already exists with the same name, a live version can be written without issue."
- },
- "softDeletedAfterTime": {
- "type": "string",
- "description": "Restores only the objects that were soft-deleted after this time.",
- "format": "date-time"
- },
- "softDeletedBeforeTime": {
- "type": "string",
- "description": "Restores only the objects that were soft-deleted before this time.",
- "format": "date-time"
- },
- "matchGlobs": {
- "type": "array",
- "description": "Restores only the objects matching any of the specified glob(s). If this parameter is not specified, all objects will be restored within the specified time range.",
+ },
+ "ManagedFolders": {
+ "id": "ManagedFolders",
+ "type": "object",
+ "description": "A list of managed folders.",
+ "properties": {
"items": {
- "type": "string"
+ "type": "array",
+ "description": "The list of items.",
+ "items": {
+ "$ref": "ManagedFolder"
+ }
+ },
+ "kind": {
+ "type": "string",
+ "description": "The kind of item this is. For lists of managed folders, this is always storage#managedFolders.",
+ "default": "storage#managedFolders"
+ },
+ "nextPageToken": {
+ "type": "string",
+ "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results."
}
- },
- "copySourceAcl": {
- "type": "boolean",
- "description": "If true, copies the source object's ACL; otherwise, uses the bucket's default object ACL. The default is false."
}
- }
- }
-},
-"resources": {
- "anywhereCaches": {
- "methods": {
- "insert": {
- "id": "storage.anywhereCaches.insert",
- "path": "b/{bucket}/anywhereCaches",
- "httpMethod": "POST",
- "description": "Creates an Anywhere Cache instance.",
- "parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the parent bucket.",
- "required": true,
- "location": "path"
- }
-},
-"parameterOrder": [
- "bucket"
-],
-"request": {
- "$ref": "AnywhereCache"
-},
-"response": {
- "$ref": "GoogleLongrunningOperation"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-},
-"update": {
-"id": "storage.anywhereCaches.update",
-"path": "b/{bucket}/anywhereCaches/{anywhereCacheId}",
-"httpMethod": "PATCH",
-"description": "Updates the config(ttl and admissionPolicy) of an Anywhere Cache instance.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the parent bucket.",
- "required": true,
- "location": "path"
- },
- "anywhereCacheId": {
- "type": "string",
- "description": "The ID of requested Anywhere Cache instance.",
- "required": true,
- "location": "path"
- }
-},
-"parameterOrder": [
- "bucket",
- "anywhereCacheId"
-],
-"request": {
- "$ref": "AnywhereCache"
-},
-"response": {
- "$ref": "GoogleLongrunningOperation"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-},
-"get": {
-"id": "storage.anywhereCaches.get",
-"path": "b/{bucket}/anywhereCaches/{anywhereCacheId}",
-"httpMethod": "GET",
-"description": "Returns the metadata of an Anywhere Cache instance.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the parent bucket.",
- "required": true,
- "location": "path"
- },
- "anywhereCacheId": {
- "type": "string",
- "description": "The ID of requested Anywhere Cache instance.",
- "required": true,
- "location": "path"
- }
-},
-"parameterOrder": [
- "bucket",
- "anywhereCacheId"
-],
-"response": {
- "$ref": "AnywhereCache"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-},
-"list": {
-"id": "storage.anywhereCaches.list",
- "path": "b/{bucket}/anywhereCaches",
- "httpMethod": "GET",
- "description": "Returns a list of Anywhere Cache instances of the bucket matching the criteria.",
- "parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the parent bucket.",
- "required": true,
- "location": "path"
- },
- "pageSize": {
- "type": "integer",
- "description": "Maximum number of items to return in a single page of responses. Maximum 1000.",
- "format": "int32",
- "minimum": "0",
- "location": "query"
- },
- "pageToken": {
- "type": "string",
- "description": "A previously-returned page token representing part of the larger set of results to view.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket"
-],
-"response": {
- "$ref": "AnywhereCaches"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-},
-"pause": {
-"id": "storage.anywhereCaches.pause",
-"path": "b/{bucket}/anywhereCaches/{anywhereCacheId}/pause",
-"httpMethod": "POST",
-"description": "Pauses an Anywhere Cache instance.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the parent bucket.",
- "required": true,
- "location": "path"
- },
- "anywhereCacheId": {
- "type": "string",
- "description": "The ID of requested Anywhere Cache instance.",
- "required": true,
- "location": "path"
- }
-},
-"parameterOrder": [
- "bucket",
- "anywhereCacheId"
-],
-"response": {
- "$ref": "AnywhereCache"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-},
-"resume": {
-"id": "storage.anywhereCaches.resume",
-"path": "b/{bucket}/anywhereCaches/{anywhereCacheId}/resume",
-"httpMethod": "POST",
-"description": "Resumes a paused or disabled Anywhere Cache instance.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the parent bucket.",
- "required": true,
- "location": "path"
- },
- "anywhereCacheId": {
- "type": "string",
- "description": "The ID of requested Anywhere Cache instance.",
- "required": true,
- "location": "path"
- }
-},
-"parameterOrder": [
- "bucket",
- "anywhereCacheId"
-],
-"response": {
- "$ref": "AnywhereCache"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-},
-"disable": {
-"id": "storage.anywhereCaches.disable",
-"path": "b/{bucket}/anywhereCaches/{anywhereCacheId}/disable",
-"httpMethod": "POST",
-"description": "Disables an Anywhere Cache instance.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the parent bucket.",
- "required": true,
- "location": "path"
- },
- "anywhereCacheId": {
- "type": "string",
- "description": "The ID of requested Anywhere Cache instance.",
- "required": true,
- "location": "path"
- }
-},
-"parameterOrder": [
- "bucket",
- "anywhereCacheId"
-],
-"response": {
- "$ref": "AnywhereCache"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-}
-}
-},
-"bucketAccessControls": {
-"methods": {
-"delete": {
-"id": "storage.bucketAccessControls.delete",
-"path": "b/{bucket}/acl/{entity}",
-"httpMethod": "DELETE",
-"description": "Permanently deletes the ACL entry for the specified entity on the specified bucket.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of a bucket.",
- "required": true,
- "location": "path"
- },
- "entity": {
- "type": "string",
- "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "entity"
-],
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
-]
-},
-"get": {
-"id": "storage.bucketAccessControls.get",
-"path": "b/{bucket}/acl/{entity}",
-"httpMethod": "GET",
-"description": "Returns the ACL entry for the specified entity on the specified bucket.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of a bucket.",
- "required": true,
- "location": "path"
- },
- "entity": {
- "type": "string",
- "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "entity"
-],
-"response": {
- "$ref": "BucketAccessControl"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
-]
-},
-"insert": {
-"id": "storage.bucketAccessControls.insert",
-"path": "b/{bucket}/acl",
-"httpMethod": "POST",
-"description": "Creates a new ACL entry on the specified bucket.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of a bucket.",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket"
-],
-"request": {
- "$ref": "BucketAccessControl"
-},
-"response": {
- "$ref": "BucketAccessControl"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
-]
-},
-"list": {
-"id": "storage.bucketAccessControls.list",
-"path": "b/{bucket}/acl",
-"httpMethod": "GET",
-"description": "Retrieves ACL entries on the specified bucket.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of a bucket.",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket"
-],
-"response": {
- "$ref": "BucketAccessControls"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
-]
-},
-"patch": {
-"id": "storage.bucketAccessControls.patch",
-"path": "b/{bucket}/acl/{entity}",
-"httpMethod": "PATCH",
-"description": "Patches an ACL entry on the specified bucket.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of a bucket.",
- "required": true,
- "location": "path"
- },
- "entity": {
- "type": "string",
- "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "entity"
-],
-"request": {
- "$ref": "BucketAccessControl"
-},
-"response": {
- "$ref": "BucketAccessControl"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
-]
-},
-"update": {
-"id": "storage.bucketAccessControls.update",
-"path": "b/{bucket}/acl/{entity}",
-"httpMethod": "PUT",
-"description": "Updates an ACL entry on the specified bucket.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of a bucket.",
- "required": true,
- "location": "path"
- },
- "entity": {
- "type": "string",
- "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "entity"
-],
-"request": {
- "$ref": "BucketAccessControl"
-},
-"response": {
- "$ref": "BucketAccessControl"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
-]
-}
-}
-},
-"buckets": {
-"methods": {
-"delete": {
-"id": "storage.buckets.delete",
-"path": "b/{bucket}",
-"httpMethod": "DELETE",
-"description": "Permanently deletes an empty bucket.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of a bucket.",
- "required": true,
- "location": "path"
- },
- "ifMetagenerationMatch": {
- "type": "string",
- "description": "If set, only deletes the bucket if its metageneration matches this value.",
- "format": "int64",
- "location": "query"
- },
- "ifMetagenerationNotMatch": {
- "type": "string",
- "description": "If set, only deletes the bucket if its metageneration does not match this value.",
- "format": "int64",
- "location": "query"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket"
-],
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-},
-"get": {
-"id": "storage.buckets.get",
-"path": "b/{bucket}",
-"httpMethod": "GET",
-"description": "Returns metadata for the specified bucket.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of a bucket.",
- "required": true,
- "location": "path"
- },
- "ifMetagenerationMatch": {
- "type": "string",
- "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
- "format": "int64",
- "location": "query"
- },
- "ifMetagenerationNotMatch": {
- "type": "string",
- "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query"
- },
- "projection": {
- "type": "string",
- "description": "Set of properties to return. Defaults to noAcl.",
- "enum": [
- "full",
- "noAcl"
- ],
- "enumDescriptions": [
- "Include all properties.",
- "Omit owner, acl and defaultObjectAcl properties."
- ],
- "location": "query"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket"
-],
-"response": {
- "$ref": "Bucket"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-},
-"getIamPolicy": {
-"id": "storage.buckets.getIamPolicy",
-"path": "b/{bucket}/iam",
-"httpMethod": "GET",
-"description": "Returns an IAM policy for the specified bucket.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of a bucket.",
- "required": true,
- "location": "path"
- },
- "optionsRequestedPolicyVersion": {
- "type": "integer",
- "description": "The IAM policy format version to be returned. If the optionsRequestedPolicyVersion is for an older version that doesn't support part of the requested IAM policy, the request fails.",
- "format": "int32",
- "minimum": "1",
- "location": "query"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket"
-],
-"response": {
- "$ref": "Policy"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
-]
-},
-"insert": {
-"id": "storage.buckets.insert",
-"path": "b",
-"httpMethod": "POST",
-"description": "Creates a new bucket.",
-"parameters": {
- "predefinedAcl": {
- "type": "string",
- "description": "Apply a predefined set of access controls to this bucket.",
- "enum": [
- "authenticatedRead",
- "private",
- "projectPrivate",
- "publicRead",
- "publicReadWrite"
- ],
- "enumDescriptions": [
- "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
- "Project team owners get OWNER access.",
- "Project team members get access according to their roles.",
- "Project team owners get OWNER access, and allUsers get READER access.",
- "Project team owners get OWNER access, and allUsers get WRITER access."
- ],
- "location": "query"
- },
- "predefinedDefaultObjectAcl": {
- "type": "string",
- "description": "Apply a predefined set of default object access controls to this bucket.",
- "enum": [
- "authenticatedRead",
- "bucketOwnerFullControl",
- "bucketOwnerRead",
- "private",
- "projectPrivate",
- "publicRead"
- ],
- "enumDescriptions": [
- "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
- "Object owner gets OWNER access, and project team owners get OWNER access.",
- "Object owner gets OWNER access, and project team owners get READER access.",
- "Object owner gets OWNER access.",
- "Object owner gets OWNER access, and project team members get access according to their roles.",
- "Object owner gets OWNER access, and allUsers get READER access."
- ],
- "location": "query"
- },
- "project": {
- "type": "string",
- "description": "A valid API project identifier.",
- "required": true,
- "location": "query"
- },
- "projection": {
- "type": "string",
- "description": "Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.",
- "enum": [
- "full",
- "noAcl"
- ],
- "enumDescriptions": [
- "Include all properties.",
- "Omit owner, acl and defaultObjectAcl properties."
- ],
- "location": "query"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request.",
- "location": "query"
- },
- "enableObjectRetention": {
- "type": "boolean",
- "description": "When set to true, object retention is enabled for this bucket.",
- "default": "false",
- "location": "query"
- }
-},
-"parameterOrder": [
- "project"
-],
-"request": {
- "$ref": "Bucket"
-},
-"response": {
- "$ref": "Bucket"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-},
-"list": {
-"id": "storage.buckets.list",
-"path": "b",
-"httpMethod": "GET",
-"description": "Retrieves a list of buckets for a given project.",
-"parameters": {
- "maxResults": {
- "type": "integer",
- "description": "Maximum number of buckets to return in a single response. The service will use this parameter or 1,000 items, whichever is smaller.",
- "default": "1000",
- "format": "uint32",
- "minimum": "0",
- "location": "query"
- },
- "pageToken": {
- "type": "string",
- "description": "A previously-returned page token representing part of the larger set of results to view.",
- "location": "query"
- },
- "prefix": {
- "type": "string",
- "description": "Filter results to buckets whose names begin with this prefix.",
- "location": "query"
- },
- "project": {
- "type": "string",
- "description": "A valid API project identifier.",
- "required": true,
- "location": "query"
- },
- "projection": {
- "type": "string",
- "description": "Set of properties to return. Defaults to noAcl.",
- "enum": [
- "full",
- "noAcl"
- ],
- "enumDescriptions": [
- "Include all properties.",
- "Omit owner, acl and defaultObjectAcl properties."
- ],
- "location": "query"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "project"
-],
-"response": {
- "$ref": "Buckets"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-},
-"lockRetentionPolicy": {
-"id": "storage.buckets.lockRetentionPolicy",
-"path": "b/{bucket}/lockRetentionPolicy",
-"httpMethod": "POST",
-"description": "Locks retention policy on a bucket.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of a bucket.",
- "required": true,
- "location": "path"
- },
- "ifMetagenerationMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether bucket's current metageneration matches the given value.",
- "required": true,
- "format": "int64",
- "location": "query"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "ifMetagenerationMatch"
-],
-"response": {
- "$ref": "Bucket"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-},
-"patch": {
-"id": "storage.buckets.patch",
-"path": "b/{bucket}",
-"httpMethod": "PATCH",
-"description": "Patches a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of a bucket.",
- "required": true,
- "location": "path"
- },
- "ifMetagenerationMatch": {
- "type": "string",
- "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
- "format": "int64",
- "location": "query"
- },
- "ifMetagenerationNotMatch": {
- "type": "string",
- "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query"
- },
- "predefinedAcl": {
- "type": "string",
- "description": "Apply a predefined set of access controls to this bucket.",
- "enum": [
- "authenticatedRead",
- "private",
- "projectPrivate",
- "publicRead",
- "publicReadWrite"
- ],
- "enumDescriptions": [
- "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
- "Project team owners get OWNER access.",
- "Project team members get access according to their roles.",
- "Project team owners get OWNER access, and allUsers get READER access.",
- "Project team owners get OWNER access, and allUsers get WRITER access."
- ],
- "location": "query"
- },
- "predefinedDefaultObjectAcl": {
- "type": "string",
- "description": "Apply a predefined set of default object access controls to this bucket.",
- "enum": [
- "authenticatedRead",
- "bucketOwnerFullControl",
- "bucketOwnerRead",
- "private",
- "projectPrivate",
- "publicRead"
- ],
- "enumDescriptions": [
- "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
- "Object owner gets OWNER access, and project team owners get OWNER access.",
- "Object owner gets OWNER access, and project team owners get READER access.",
- "Object owner gets OWNER access.",
- "Object owner gets OWNER access, and project team members get access according to their roles.",
- "Object owner gets OWNER access, and allUsers get READER access."
- ],
- "location": "query"
- },
- "projection": {
- "type": "string",
- "description": "Set of properties to return. Defaults to full.",
- "enum": [
- "full",
- "noAcl"
- ],
- "enumDescriptions": [
- "Include all properties.",
- "Omit owner, acl and defaultObjectAcl properties."
- ],
- "location": "query"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket"
-],
-"request": {
- "$ref": "Bucket"
-},
-"response": {
- "$ref": "Bucket"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
-]
-},
-"setIamPolicy": {
-"id": "storage.buckets.setIamPolicy",
-"path": "b/{bucket}/iam",
-"httpMethod": "PUT",
-"description": "Updates an IAM policy for the specified bucket.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of a bucket.",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket"
-],
-"request": {
- "$ref": "Policy"
-},
-"response": {
- "$ref": "Policy"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
-]
-},
-"testIamPermissions": {
-"id": "storage.buckets.testIamPermissions",
-"path": "b/{bucket}/iam/testPermissions",
-"httpMethod": "GET",
-"description": "Tests a set of permissions on the given bucket to see which, if any, are held by the caller.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of a bucket.",
- "required": true,
- "location": "path"
- },
- "permissions": {
- "type": "string",
- "description": "Permissions to test.",
- "required": true,
- "repeated": true,
- "location": "query"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "permissions"
-],
-"response": {
- "$ref": "TestIamPermissionsResponse"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-},
-"update": {
-"id": "storage.buckets.update",
-"path": "b/{bucket}",
-"httpMethod": "PUT",
-"description": "Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of a bucket.",
- "required": true,
- "location": "path"
- },
- "ifMetagenerationMatch": {
- "type": "string",
- "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
- "format": "int64",
- "location": "query"
- },
- "ifMetagenerationNotMatch": {
- "type": "string",
- "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query"
- },
- "predefinedAcl": {
- "type": "string",
- "description": "Apply a predefined set of access controls to this bucket.",
- "enum": [
- "authenticatedRead",
- "private",
- "projectPrivate",
- "publicRead",
- "publicReadWrite"
- ],
- "enumDescriptions": [
- "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
- "Project team owners get OWNER access.",
- "Project team members get access according to their roles.",
- "Project team owners get OWNER access, and allUsers get READER access.",
- "Project team owners get OWNER access, and allUsers get WRITER access."
- ],
- "location": "query"
- },
- "predefinedDefaultObjectAcl": {
- "type": "string",
- "description": "Apply a predefined set of default object access controls to this bucket.",
- "enum": [
- "authenticatedRead",
- "bucketOwnerFullControl",
- "bucketOwnerRead",
- "private",
- "projectPrivate",
- "publicRead"
- ],
- "enumDescriptions": [
- "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
- "Object owner gets OWNER access, and project team owners get OWNER access.",
- "Object owner gets OWNER access, and project team owners get READER access.",
- "Object owner gets OWNER access.",
- "Object owner gets OWNER access, and project team members get access according to their roles.",
- "Object owner gets OWNER access, and allUsers get READER access."
- ],
- "location": "query"
- },
- "projection": {
- "type": "string",
- "description": "Set of properties to return. Defaults to full.",
- "enum": [
- "full",
- "noAcl"
- ],
- "enumDescriptions": [
- "Include all properties.",
- "Omit owner, acl and defaultObjectAcl properties."
- ],
- "location": "query"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket"
-],
-"request": {
- "$ref": "Bucket"
-},
-"response": {
- "$ref": "Bucket"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
-]
-}
-}
-},
-"operations": {
-"methods": {
-"cancel": {
-"description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed.",
-"path": "b/{bucket}/operations/{operationId}/cancel",
-"httpMethod": "POST",
-"id": "storage.buckets.operations.cancel",
-"parameterOrder": [
- "bucket",
- "operationId"
-],
-"parameters": {
- "bucket": {
- "description": "The parent bucket of the operation resource.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "operationId": {
- "description": "The ID of the operation resource.",
- "location": "path",
- "required": true,
- "type": "string"
- }
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-},
-"get": {
-"description": "Gets the latest state of a long-running operation.",
-"path": "b/{bucket}/operations/{operationId}",
-"httpMethod": "GET",
-"id": "storage.buckets.operations.get",
-"parameterOrder": [
- "bucket",
- "operationId"
-],
-"parameters": {
- "bucket": {
- "description": "The parent bucket of the operation resource.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "operationId": {
- "description": "The ID of the operation resource.",
- "location": "path",
- "required": true,
- "type": "string"
- }
-},
-"response": {
- "$ref": "GoogleLongrunningOperation"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-},
-"list": {
-"description": "Lists operations that match the specified filter in the request.",
-"path": "b/{bucket}/operations",
-"httpMethod": "GET",
-"id": "storage.buckets.operations.list",
-"parameterOrder": [
- "bucket"
-],
-"parameters": {
- "filter": {
- "description": "A filter to narrow down results to a preferred subset. The filtering language is documented in more detail in [AIP-160](https://google.aip.dev/160).",
- "location": "query",
- "type": "string"
- },
- "bucket": {
- "description": "Name of the bucket in which to look for operations.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "pageSize": {
- "description": "Maximum number of items to return in a single page of responses. Fewer total results may be returned than requested. The service uses this parameter or 100 items, whichever is smaller.",
- "minimum": "0",
- "format": "int32",
- "location": "query",
- "type": "integer"
- },
- "pageToken": {
- "description": "A previously-returned page token representing part of the larger set of results to view.",
- "location": "query",
- "type": "string"
- }
-},
-"response": {
- "$ref": "GoogleLongrunningListOperationsResponse"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-}
-}
-},
-"channels": {
-"methods": {
-"stop": {
-"id": "storage.channels.stop",
-"path": "channels/stop",
-"httpMethod": "POST",
-"description": "Stop watching resources through this channel",
-"request": {
- "$ref": "Channel",
- "parameterName": "resource"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-}
-}
-},
-"defaultObjectAccessControls": {
-"methods": {
-"delete": {
-"id": "storage.defaultObjectAccessControls.delete",
-"path": "b/{bucket}/defaultObjectAcl/{entity}",
-"httpMethod": "DELETE",
-"description": "Permanently deletes the default object ACL entry for the specified entity on the specified bucket.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of a bucket.",
- "required": true,
- "location": "path"
- },
- "entity": {
- "type": "string",
- "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "entity"
-],
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
-]
-},
-"get": {
-"id": "storage.defaultObjectAccessControls.get",
-"path": "b/{bucket}/defaultObjectAcl/{entity}",
-"httpMethod": "GET",
-"description": "Returns the default object ACL entry for the specified entity on the specified bucket.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of a bucket.",
- "required": true,
- "location": "path"
- },
- "entity": {
- "type": "string",
- "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "entity"
-],
-"response": {
- "$ref": "ObjectAccessControl"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
-]
-},
-"insert": {
-"id": "storage.defaultObjectAccessControls.insert",
-"path": "b/{bucket}/defaultObjectAcl",
-"httpMethod": "POST",
-"description": "Creates a new default object ACL entry on the specified bucket.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of a bucket.",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket"
-],
-"request": {
- "$ref": "ObjectAccessControl"
-},
-"response": {
- "$ref": "ObjectAccessControl"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
-]
-},
-"list": {
-"id": "storage.defaultObjectAccessControls.list",
-"path": "b/{bucket}/defaultObjectAcl",
-"httpMethod": "GET",
-"description": "Retrieves default object ACL entries on the specified bucket.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of a bucket.",
- "required": true,
- "location": "path"
- },
- "ifMetagenerationMatch": {
- "type": "string",
- "description": "If present, only return default ACL listing if the bucket's current metageneration matches this value.",
- "format": "int64",
- "location": "query"
- },
- "ifMetagenerationNotMatch": {
- "type": "string",
- "description": "If present, only return default ACL listing if the bucket's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket"
-],
-"response": {
- "$ref": "ObjectAccessControls"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
-]
-},
-"patch": {
-"id": "storage.defaultObjectAccessControls.patch",
-"path": "b/{bucket}/defaultObjectAcl/{entity}",
-"httpMethod": "PATCH",
-"description": "Patches a default object ACL entry on the specified bucket.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of a bucket.",
- "required": true,
- "location": "path"
- },
- "entity": {
- "type": "string",
- "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "entity"
-],
-"request": {
- "$ref": "ObjectAccessControl"
-},
-"response": {
- "$ref": "ObjectAccessControl"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
-]
-},
-"update": {
-"id": "storage.defaultObjectAccessControls.update",
-"path": "b/{bucket}/defaultObjectAcl/{entity}",
-"httpMethod": "PUT",
-"description": "Updates a default object ACL entry on the specified bucket.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of a bucket.",
- "required": true,
- "location": "path"
- },
- "entity": {
- "type": "string",
- "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "entity"
-],
-"request": {
- "$ref": "ObjectAccessControl"
-},
-"response": {
- "$ref": "ObjectAccessControl"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
-]
-}
-}
-},
- "folders": {
- "methods": {
- "delete": {
- "id": "storage.folders.delete",
- "path": "b/{bucket}/folders/{folder}",
- "httpMethod": "DELETE",
- "description": "Permanently deletes a folder. Only applicable to buckets with hierarchical namespace enabled.",
- "parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the bucket in which the folder resides.",
- "required": true,
- "location": "path"
- },
- "folder": {
- "type": "string",
- "description": "Name of a folder.",
- "required": true,
- "location": "path"
- },
- "ifMetagenerationMatch": {
- "type": "string",
- "description": "If set, only deletes the folder if its metageneration matches this value.",
- "format": "int64",
- "location": "query"
- },
- "ifMetagenerationNotMatch": {
- "type": "string",
- "description": "If set, only deletes the folder if its metageneration does not match this value.",
- "format": "int64",
- "location": "query"
+ },
+ "Notification": {
+ "id": "Notification",
+ "type": "object",
+ "description": "A subscription to receive Google PubSub notifications.",
+ "properties": {
+ "custom_attributes": {
+ "type": "object",
+ "description": "An optional list of additional attributes to attach to each Cloud PubSub message published for this notification subscription.",
+ "additionalProperties": {
+ "type": "string"
}
},
- "parameterOrder": [
- "bucket",
- "folder"
- ],
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- },
- "get": {
- "id": "storage.folders.get",
- "path": "b/{bucket}/folders/{folder}",
- "httpMethod": "GET",
- "description": "Returns metadata for the specified folder. Only applicable to buckets with hierarchical namespace enabled.",
- "parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the bucket in which the folder resides.",
- "required": true,
- "location": "path"
- },
- "folder": {
- "type": "string",
- "description": "Name of a folder.",
- "required": true,
- "location": "path"
- },
- "ifMetagenerationMatch": {
- "type": "string",
- "description": "Makes the return of the folder metadata conditional on whether the folder's current metageneration matches the given value.",
- "format": "int64",
- "location": "query"
- },
- "ifMetagenerationNotMatch": {
- "type": "string",
- "description": "Makes the return of the folder metadata conditional on whether the folder's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query"
+ "etag": {
+ "type": "string",
+ "description": "HTTP 1.1 Entity tag for this subscription notification."
+ },
+ "event_types": {
+ "type": "array",
+ "description": "If present, only send notifications about listed event types. If empty, sent notifications for all event types.",
+ "items": {
+ "type": "string"
}
},
- "parameterOrder": [
- "bucket",
- "folder"
- ],
- "response": {
- "$ref": "Folder"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- },
- "insert": {
- "id": "storage.folders.insert",
- "path": "b/{bucket}/folders",
- "httpMethod": "POST",
- "description": "Creates a new folder. Only applicable to buckets with hierarchical namespace enabled.",
- "parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the bucket in which the folder resides.",
- "required": true,
- "location": "path"
- },
- "recursive": {
- "type": "boolean",
- "description": "If true, any parent folder which doesn\u2019t exist will be created automatically.",
- "location": "query"
+ "id": {
+ "type": "string",
+ "description": "The ID of the notification."
+ },
+ "kind": {
+ "type": "string",
+ "description": "The kind of item this is. For notifications, this is always storage#notification.",
+ "default": "storage#notification"
+ },
+ "object_name_prefix": {
+ "type": "string",
+ "description": "If present, only apply this notification configuration to object names that begin with this prefix."
+ },
+ "payload_format": {
+ "type": "string",
+ "description": "The desired content of the Payload.",
+ "default": "JSON_API_V1",
+ "annotations": {
+ "required": [
+ "storage.notifications.insert"
+ ]
}
},
- "parameterOrder": [
- "bucket"
- ],
- "request": {
- "$ref": "Folder"
+ "selfLink": {
+ "type": "string",
+ "description": "The canonical URL of this notification."
},
- "response": {
- "$ref": "Folder"
+ "topic": {
+ "type": "string",
+ "description": "The Cloud PubSub topic to which this subscription publishes. Formatted as: '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'",
+ "annotations": {
+ "required": [
+ "storage.notifications.insert"
+ ]
+ }
+ }
+ }
+ },
+ "Notifications": {
+ "id": "Notifications",
+ "type": "object",
+ "description": "A list of notification subscriptions.",
+ "properties": {
+ "items": {
+ "type": "array",
+ "description": "The list of items.",
+ "items": {
+ "$ref": "Notification"
+ }
},
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- },
- "list": {
- "id": "storage.folders.list",
- "path": "b/{bucket}/folders",
- "httpMethod": "GET",
- "description": "Retrieves a list of folders matching the criteria. Only applicable to buckets with hierarchical namespace enabled.",
- "parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the bucket in which to look for folders.",
- "required": true,
- "location": "path"
- },
- "delimiter": {
- "type": "string",
- "description": "Returns results in a directory-like mode. The only supported value is '/'. If set, items will only contain folders that either exactly match the prefix, or are one level below the prefix.",
- "location": "query"
- },
- "endOffset": {
- "type": "string",
- "description": "Filter results to folders whose names are lexicographically before endOffset. If startOffset is also set, the folders listed will have names between startOffset (inclusive) and endOffset (exclusive).",
- "location": "query"
- },
- "pageSize": {
- "type": "integer",
- "description": "Maximum number of items to return in a single page of responses.",
- "format": "int32",
- "minimum": "0",
- "location": "query"
- },
- "pageToken": {
- "type": "string",
- "description": "A previously-returned page token representing part of the larger set of results to view.",
- "location": "query"
- },
- "prefix": {
- "type": "string",
- "description": "Filter results to folders whose paths begin with this prefix. If set, the value must either be an empty string or end with a '/'.",
- "location": "query"
+ "kind": {
+ "type": "string",
+ "description": "The kind of item this is. For lists of notifications, this is always storage#notifications.",
+ "default": "storage#notifications"
+ }
+ }
+ },
+ "Object": {
+ "id": "Object",
+ "type": "object",
+ "description": "An object.",
+ "properties": {
+ "acl": {
+ "type": "array",
+ "description": "Access controls on the object.",
+ "items": {
+ "$ref": "ObjectAccessControl"
},
- "startOffset": {
- "type": "string",
- "description": "Filter results to folders whose names are lexicographically equal to or after startOffset. If endOffset is also set, the folders listed will have names between startOffset (inclusive) and endOffset (exclusive).",
- "location": "query"
+ "annotations": {
+ "required": [
+ "storage.objects.update"
+ ]
}
},
- "parameterOrder": [
- "bucket"
- ],
- "response": {
- "$ref": "Folders"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- },
- "rename": {
- "id": "storage.folders.rename",
- "path": "b/{bucket}/folders/{sourceFolder}/renameTo/folders/{destinationFolder}",
- "httpMethod": "POST",
- "description": "Renames a source folder to a destination folder. Only applicable to buckets with hierarchical namespace enabled.",
- "parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the bucket in which the folders are in.",
- "required": true,
- "location": "path"
- },
- "destinationFolder": {
- "type": "string",
- "description": "Name of the destination folder.",
- "required": true,
- "location": "path"
- },
- "ifSourceMetagenerationMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.",
- "format": "int64",
- "location": "query"
- },
- "ifSourceMetagenerationNotMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query"
- },
- "sourceFolder": {
- "type": "string",
- "description": "Name of the source folder.",
- "required": true,
- "location": "path"
+ "bucket": {
+ "type": "string",
+ "description": "The name of the bucket containing this object."
+ },
+ "cacheControl": {
+ "type": "string",
+ "description": "Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600."
+ },
+ "componentCount": {
+ "type": "integer",
+ "description": "Number of underlying components that make up this object. Components are accumulated by compose operations.",
+ "format": "int32"
+ },
+ "contentDisposition": {
+ "type": "string",
+ "description": "Content-Disposition of the object data."
+ },
+ "contentEncoding": {
+ "type": "string",
+ "description": "Content-Encoding of the object data."
+ },
+ "contentLanguage": {
+ "type": "string",
+ "description": "Content-Language of the object data."
+ },
+ "contentType": {
+ "type": "string",
+ "description": "Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream."
+ },
+ "crc32c": {
+ "type": "string",
+ "description": "CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see Hashes and ETags: Best Practices."
+ },
+ "customTime": {
+ "type": "string",
+ "description": "A timestamp in RFC 3339 format specified by the user for an object.",
+ "format": "date-time"
+ },
+ "customerEncryption": {
+ "type": "object",
+ "description": "Metadata of customer-supplied encryption key, if the object is encrypted by such a key.",
+ "properties": {
+ "encryptionAlgorithm": {
+ "type": "string",
+ "description": "The encryption algorithm."
+ },
+ "keySha256": {
+ "type": "string",
+ "description": "SHA256 hash value of the encryption key."
+ }
}
},
- "parameterOrder": [
- "bucket",
- "sourceFolder",
- "destinationFolder"
- ],
- "response": {
- "$ref": "GoogleLongrunningOperation"
+ "etag": {
+ "type": "string",
+ "description": "HTTP 1.1 Entity tag for the object."
},
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- }
- }
- },
- "managedFolders": {
- "methods": {
- "delete": {
- "id": "storage.managedFolders.delete",
- "path": "b/{bucket}/managedFolders/{managedFolder}",
- "httpMethod": "DELETE",
- "description": "Permanently deletes a managed folder.",
- "parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the bucket containing the managed folder.",
- "required": true,
- "location": "path"
- },
- "managedFolder": {
- "type": "string",
- "description": "The managed folder name/path.",
- "required": true,
- "location": "path"
- },
- "ifMetagenerationMatch": {
- "type": "string",
- "description": "If set, only deletes the managed folder if its metageneration matches this value.",
- "format": "int64",
- "location": "query"
- },
- "ifMetagenerationNotMatch": {
+ "eventBasedHold": {
+ "type": "boolean",
+ "description": "Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold's release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false."
+ },
+ "generation": {
+ "type": "string",
+ "description": "The content generation of this object. Used for object versioning.",
+ "format": "int64"
+ },
+ "id": {
+ "type": "string",
+ "description": "The ID of the object, including the bucket name, object name, and generation number."
+ },
+ "kind": {
+ "type": "string",
+ "description": "The kind of item this is. For objects, this is always storage#object.",
+ "default": "storage#object"
+ },
+ "kmsKeyName": {
+ "type": "string",
+ "description": "Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request."
+ },
+ "md5Hash": {
+ "type": "string",
+ "description": "MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices."
+ },
+ "mediaLink": {
+ "type": "string",
+ "description": "Media download link."
+ },
+ "metadata": {
+ "type": "object",
+ "description": "User-provided metadata, in key/value pairs.",
+ "additionalProperties": {
"type": "string",
- "description": "If set, only deletes the managed folder if its metageneration does not match this value.",
- "format": "int64",
- "location": "query"
- },
- "allowNonEmpty": {
- "type": "boolean",
- "description": "Allows the deletion of a managed folder even if it is not empty. A managed folder is empty if there are no objects or managed folders that it applies to. Callers must have storage.managedFolders.setIamPolicy permission.",
- "location": "query"
- }
- },
- "parameterOrder": [
- "bucket",
- "managedFolder"
- ],
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
-},
-"get": {
- "id": "storage.managedFolders.get",
- "path": "b/{bucket}/managedFolders/{managedFolder}",
- "httpMethod": "GET",
- "description": "Returns metadata of the specified managed folder.",
- "parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the bucket containing the managed folder.",
- "required": true,
- "location": "path"
- },
- "managedFolder": {
- "type": "string",
- "description": "The managed folder name/path.",
- "required": true,
- "location": "path"
- },
- "ifMetagenerationMatch": {
- "type": "string",
- "description": "Makes the return of the managed folder metadata conditional on whether the managed folder's current metageneration matches the given value.",
- "format": "int64",
- "location": "query"
- },
- "ifMetagenerationNotMatch": {
- "type": "string",
- "description": "Makes the return of the managed folder metadata conditional on whether the managed folder's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query"
- }
- },
- "parameterOrder": [
- "bucket",
- "managedFolder"
- ],
- "response": {
- "$ref": "ManagedFolder"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
-},
-"getIamPolicy": {
- "id": "storage.managedFolders.getIamPolicy",
- "path": "b/{bucket}/managedFolders/{managedFolder}/iam",
- "httpMethod": "GET",
- "description": "Returns an IAM policy for the specified managed folder.",
- "parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the bucket containing the managed folder.",
- "required": true,
- "location": "path"
- },
- "optionsRequestedPolicyVersion": {
- "type": "integer",
- "description": "The IAM policy format version to be returned. If the optionsRequestedPolicyVersion is for an older version that doesn't support part of the requested IAM policy, the request fails.",
- "format": "int32",
- "minimum": "1",
- "location": "query"
- },
- "managedFolder": {
- "type": "string",
- "description": "The managed folder name/path.",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
- },
- "parameterOrder": [
- "bucket",
- "managedFolder"
- ],
- "response": {
- "$ref": "Policy"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
-},
-"insert": {
- "id": "storage.managedFolders.insert",
- "path": "b/{bucket}/managedFolders",
- "httpMethod": "POST",
- "description": "Creates a new managed folder.",
- "parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the bucket containing the managed folder.",
- "required": true,
- "location": "path"
- }
- },
- "parameterOrder": [
- "bucket"
- ],
- "request": {
- "$ref": "ManagedFolder"
- },
- "response": {
- "$ref": "ManagedFolder"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
-},
-"list": {
- "id": "storage.managedFolders.list",
- "path": "b/{bucket}/managedFolders",
- "httpMethod": "GET",
- "description": "Lists managed folders in the given bucket.",
- "parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the bucket containing the managed folder.",
- "required": true,
- "location": "path"
+ "description": "An individual metadata entry."
+ }
+ },
+ "metageneration": {
+ "type": "string",
+ "description": "The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.",
+ "format": "int64"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the object. Required if not specified by URL parameter."
+ },
+ "owner": {
+ "type": "object",
+ "description": "The owner of the object. This will always be the uploader of the object.",
+ "properties": {
+ "entity": {
+ "type": "string",
+ "description": "The entity, in the form user-userId."
+ },
+ "entityId": {
+ "type": "string",
+ "description": "The ID for the entity."
+ }
+ }
+ },
+ "retentionExpirationTime": {
+ "type": "string",
+ "description": "A server-determined value that specifies the earliest time that the object's retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).",
+ "format": "date-time"
+ },
+ "retention": {
+ "type": "object",
+ "description": "A collection of object level retention parameters.",
+ "properties": {
+ "retainUntilTime": {
+ "type": "string",
+ "description": "A time in RFC 3339 format until which object retention protects this object.",
+ "format": "date-time"
+ },
+ "mode": {
+ "type": "string",
+ "description": "The bucket's object retention mode, can only be Unlocked or Locked."
+ }
+ }
+ },
+ "selfLink": {
+ "type": "string",
+ "description": "The link to this object."
+ },
+ "size": {
+ "type": "string",
+ "description": "Content-Length of the data in bytes.",
+ "format": "uint64"
+ },
+ "storageClass": {
+ "type": "string",
+ "description": "Storage class of the object."
+ },
+ "temporaryHold": {
+ "type": "boolean",
+ "description": "Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object."
+ },
+ "timeCreated": {
+ "type": "string",
+ "description": "The creation time of the object in RFC 3339 format.",
+ "format": "date-time"
+ },
+ "timeDeleted": {
+ "type": "string",
+ "description": "The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.",
+ "format": "date-time"
+ },
+ "softDeleteTime": {
+ "type": "string",
+ "description": "The time at which the object became soft-deleted in RFC 3339 format.",
+ "format": "date-time"
+ },
+ "hardDeleteTime": {
+ "type": "string",
+ "description": "This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket.",
+ "format": "date-time"
+ },
+ "timeStorageClassUpdated": {
+ "type": "string",
+ "description": "The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated.",
+ "format": "date-time"
+ },
+ "updated": {
+ "type": "string",
+ "description": "The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.",
+ "format": "date-time"
+ }
+ }
},
- "pageSize": {
- "type": "integer",
- "description": "Maximum number of items to return in a single page of responses.",
- "format": "int32",
- "minimum": "0",
- "location": "query"
- },
- "pageToken": {
- "type": "string",
- "description": "A previously-returned page token representing part of the larger set of results to view.",
- "location": "query"
- },
- "prefix": {
- "type": "string",
- "description": "The managed folder name/path prefix to filter the output list of results.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket"
-],
-"response": {
- "$ref": "ManagedFolders"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-},
-"setIamPolicy": {
-"id": "storage.managedFolders.setIamPolicy",
-"path": "b/{bucket}/managedFolders/{managedFolder}/iam",
-"httpMethod": "PUT",
-"description": "Updates an IAM policy for the specified managed folder.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the bucket containing the managed folder.",
- "required": true,
- "location": "path"
- },
- "managedFolder": {
- "type": "string",
- "description": "The managed folder name/path.",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "managedFolder"
-],
-"request": {
- "$ref": "Policy"
-},
-"response": {
- "$ref": "Policy"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
-]
-},
-"testIamPermissions": {
-"id": "storage.managedFolders.testIamPermissions",
-"path": "b/{bucket}/managedFolders/{managedFolder}/iam/testPermissions",
-"httpMethod": "GET",
-"description": "Tests a set of permissions on the given managed folder to see which, if any, are held by the caller.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the bucket containing the managed folder.",
- "required": true,
- "location": "path"
- },
- "managedFolder": {
- "type": "string",
- "description": "The managed folder name/path.",
- "required": true,
- "location": "path"
- },
- "permissions": {
- "type": "string",
- "description": "Permissions to test.",
- "required": true,
- "repeated": true,
- "location": "query"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "managedFolder",
- "permissions"
-],
-"response": {
- "$ref": "TestIamPermissionsResponse"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-}
-}
-},
-"notifications": {
-"methods": {
-"delete": {
-"id": "storage.notifications.delete",
-"path": "b/{bucket}/notificationConfigs/{notification}",
-"httpMethod": "DELETE",
-"description": "Permanently deletes a notification subscription.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "The parent bucket of the notification.",
- "required": true,
- "location": "path"
- },
- "notification": {
- "type": "string",
- "description": "ID of the notification to delete.",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "notification"
-],
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-},
-"get": {
-"id": "storage.notifications.get",
-"path": "b/{bucket}/notificationConfigs/{notification}",
-"httpMethod": "GET",
-"description": "View a notification configuration.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "The parent bucket of the notification.",
- "required": true,
- "location": "path"
- },
- "notification": {
- "type": "string",
- "description": "Notification ID",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "notification"
-],
-"response": {
- "$ref": "Notification"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-},
-"insert": {
-"id": "storage.notifications.insert",
-"path": "b/{bucket}/notificationConfigs",
-"httpMethod": "POST",
-"description": "Creates a notification subscription for a given bucket.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "The parent bucket of the notification.",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket"
-],
-"request": {
- "$ref": "Notification"
-},
-"response": {
- "$ref": "Notification"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-},
-"list": {
-"id": "storage.notifications.list",
-"path": "b/{bucket}/notificationConfigs",
-"httpMethod": "GET",
-"description": "Retrieves a list of notification subscriptions for a given bucket.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of a Google Cloud Storage bucket.",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket"
-],
-"response": {
- "$ref": "Notifications"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-}
-}
-},
-"objectAccessControls": {
-"methods": {
-"delete": {
-"id": "storage.objectAccessControls.delete",
-"path": "b/{bucket}/o/{object}/acl/{entity}",
-"httpMethod": "DELETE",
-"description": "Permanently deletes the ACL entry for the specified entity on the specified object.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of a bucket.",
- "required": true,
- "location": "path"
- },
- "entity": {
- "type": "string",
- "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- "required": true,
- "location": "path"
- },
- "generation": {
- "type": "string",
- "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query"
- },
- "object": {
- "type": "string",
- "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "object",
- "entity"
-],
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
-]
-},
-"get": {
-"id": "storage.objectAccessControls.get",
-"path": "b/{bucket}/o/{object}/acl/{entity}",
-"httpMethod": "GET",
-"description": "Returns the ACL entry for the specified entity on the specified object.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of a bucket.",
- "required": true,
- "location": "path"
- },
- "entity": {
- "type": "string",
- "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- "required": true,
- "location": "path"
- },
- "generation": {
- "type": "string",
- "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query"
- },
- "object": {
- "type": "string",
- "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "object",
- "entity"
-],
-"response": {
- "$ref": "ObjectAccessControl"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
-]
-},
-"insert": {
-"id": "storage.objectAccessControls.insert",
-"path": "b/{bucket}/o/{object}/acl",
-"httpMethod": "POST",
-"description": "Creates a new ACL entry on the specified object.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of a bucket.",
- "required": true,
- "location": "path"
- },
- "generation": {
- "type": "string",
- "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query"
- },
- "object": {
- "type": "string",
- "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "object"
-],
-"request": {
- "$ref": "ObjectAccessControl"
-},
-"response": {
- "$ref": "ObjectAccessControl"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
-]
-},
-"list": {
-"id": "storage.objectAccessControls.list",
-"path": "b/{bucket}/o/{object}/acl",
-"httpMethod": "GET",
-"description": "Retrieves ACL entries on the specified object.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of a bucket.",
- "required": true,
- "location": "path"
- },
- "generation": {
- "type": "string",
- "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query"
- },
- "object": {
- "type": "string",
- "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "object"
-],
-"response": {
- "$ref": "ObjectAccessControls"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
-]
-},
-"patch": {
-"id": "storage.objectAccessControls.patch",
-"path": "b/{bucket}/o/{object}/acl/{entity}",
-"httpMethod": "PATCH",
-"description": "Patches an ACL entry on the specified object.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of a bucket.",
- "required": true,
- "location": "path"
- },
- "entity": {
- "type": "string",
- "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- "required": true,
- "location": "path"
- },
- "generation": {
- "type": "string",
- "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query"
- },
- "object": {
- "type": "string",
- "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "object",
- "entity"
-],
-"request": {
- "$ref": "ObjectAccessControl"
-},
-"response": {
- "$ref": "ObjectAccessControl"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
-]
-},
-"update": {
-"id": "storage.objectAccessControls.update",
-"path": "b/{bucket}/o/{object}/acl/{entity}",
-"httpMethod": "PUT",
-"description": "Updates an ACL entry on the specified object.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of a bucket.",
- "required": true,
- "location": "path"
- },
- "entity": {
- "type": "string",
- "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- "required": true,
- "location": "path"
- },
- "generation": {
- "type": "string",
- "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query"
- },
- "object": {
- "type": "string",
- "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "object",
- "entity"
-],
-"request": {
- "$ref": "ObjectAccessControl"
-},
-"response": {
- "$ref": "ObjectAccessControl"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
-]
-}
-}
-},
-"objects": {
-"methods": {
-"compose": {
-"id": "storage.objects.compose",
-"path": "b/{destinationBucket}/o/{destinationObject}/compose",
-"httpMethod": "POST",
-"description": "Concatenates a list of existing objects into a new object in the same bucket.",
-"parameters": {
- "destinationBucket": {
- "type": "string",
- "description": "Name of the bucket containing the source objects. The destination object is stored in this bucket.",
- "required": true,
- "location": "path"
+ "ObjectAccessControl": {
+ "id": "ObjectAccessControl",
+ "type": "object",
+ "description": "An access-control entry.",
+ "properties": {
+ "bucket": {
+ "type": "string",
+ "description": "The name of the bucket."
+ },
+ "domain": {
+ "type": "string",
+ "description": "The domain associated with the entity, if any."
+ },
+ "email": {
+ "type": "string",
+ "description": "The email address associated with the entity, if any."
+ },
+ "entity": {
+ "type": "string",
+ "description": "The entity holding the permission, in one of the following forms: \n- user-userId \n- user-email \n- group-groupId \n- group-email \n- domain-domain \n- project-team-projectId \n- allUsers \n- allAuthenticatedUsers Examples: \n- The user liz@example.com would be user-liz@example.com. \n- The group example@googlegroups.com would be group-example@googlegroups.com. \n- To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.",
+ "annotations": {
+ "required": [
+ "storage.defaultObjectAccessControls.insert",
+ "storage.objectAccessControls.insert"
+ ]
+ }
+ },
+ "entityId": {
+ "type": "string",
+ "description": "The ID for the entity, if any."
+ },
+ "etag": {
+ "type": "string",
+ "description": "HTTP 1.1 Entity tag for the access-control entry."
+ },
+ "generation": {
+ "type": "string",
+ "description": "The content generation of the object, if applied to an object.",
+ "format": "int64"
+ },
+ "id": {
+ "type": "string",
+ "description": "The ID of the access-control entry."
+ },
+ "kind": {
+ "type": "string",
+ "description": "The kind of item this is. For object access control entries, this is always storage#objectAccessControl.",
+ "default": "storage#objectAccessControl"
+ },
+ "object": {
+ "type": "string",
+ "description": "The name of the object, if applied to an object."
+ },
+ "projectTeam": {
+ "type": "object",
+ "description": "The project team associated with the entity, if any.",
+ "properties": {
+ "projectNumber": {
+ "type": "string",
+ "description": "The project number."
+ },
+ "team": {
+ "type": "string",
+ "description": "The team."
+ }
+ }
+ },
+ "role": {
+ "type": "string",
+ "description": "The access permission for the entity.",
+ "annotations": {
+ "required": [
+ "storage.defaultObjectAccessControls.insert",
+ "storage.objectAccessControls.insert"
+ ]
+ }
+ },
+ "selfLink": {
+ "type": "string",
+ "description": "The link to this access-control entry."
+ }
+ }
+ },
+ "ObjectAccessControls": {
+ "id": "ObjectAccessControls",
+ "type": "object",
+ "description": "An access-control list.",
+ "properties": {
+ "items": {
+ "type": "array",
+ "description": "The list of items.",
+ "items": {
+ "$ref": "ObjectAccessControl"
+ }
+ },
+ "kind": {
+ "type": "string",
+ "description": "The kind of item this is. For lists of object access control entries, this is always storage#objectAccessControls.",
+ "default": "storage#objectAccessControls"
+ }
+ }
+ },
+ "Objects": {
+ "id": "Objects",
+ "type": "object",
+ "description": "A list of objects.",
+ "properties": {
+ "items": {
+ "type": "array",
+ "description": "The list of items.",
+ "items": {
+ "$ref": "Object"
+ }
+ },
+ "kind": {
+ "type": "string",
+ "description": "The kind of item this is. For lists of objects, this is always storage#objects.",
+ "default": "storage#objects"
+ },
+ "nextPageToken": {
+ "type": "string",
+ "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results."
+ },
+ "prefixes": {
+ "type": "array",
+ "description": "The list of prefixes of objects matching-but-not-listed up to and including the requested delimiter.",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "Policy": {
+ "id": "Policy",
+ "type": "object",
+ "description": "A bucket/object/managedFolder IAM policy.",
+ "properties": {
+ "bindings": {
+ "type": "array",
+ "description": "An association between a role, which comes with a set of permissions, and members who may assume that role.",
+ "items": {
+ "type": "object",
+ "properties": {
+ "condition": {
+ "$ref": "Expr",
+ "description": "The condition that is associated with this binding. NOTE: an unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently."
+ },
+ "members": {
+ "type": "array",
+ "description": "A collection of identifiers for members who may assume the provided role. Recognized identifiers are as follows: \n- allUsers \u2014 A special identifier that represents anyone on the internet; with or without a Google account. \n- allAuthenticatedUsers \u2014 A special identifier that represents anyone who is authenticated with a Google account or a service account. \n- user:emailid \u2014 An email address that represents a specific account. For example, user:alice@gmail.com or user:joe@example.com. \n- serviceAccount:emailid \u2014 An email address that represents a service account. For example, serviceAccount:my-other-app@appspot.gserviceaccount.com . \n- group:emailid \u2014 An email address that represents a Google group. For example, group:admins@example.com. \n- domain:domain \u2014 A Google Apps domain name that represents all the users of that domain. For example, domain:google.com or domain:example.com. \n- projectOwner:projectid \u2014 Owners of the given project. For example, projectOwner:my-example-project \n- projectEditor:projectid \u2014 Editors of the given project. For example, projectEditor:my-example-project \n- projectViewer:projectid \u2014 Viewers of the given project. For example, projectViewer:my-example-project",
+ "items": {
+ "type": "string"
+ },
+ "annotations": {
+ "required": [
+ "storage.buckets.setIamPolicy",
+ "storage.objects.setIamPolicy",
+ "storage.managedFolders.setIamPolicy"
+ ]
+ }
+ },
+ "role": {
+ "type": "string",
+ "description": "The role to which members belong. Two types of roles are supported: new IAM roles, which grant permissions that do not map directly to those provided by ACLs, and legacy IAM roles, which do map directly to ACL permissions. All roles are of the format roles/storage.specificRole.\nThe new IAM roles are: \n- roles/storage.admin \u2014 Full control of Google Cloud Storage resources. \n- roles/storage.objectViewer \u2014 Read-Only access to Google Cloud Storage objects. \n- roles/storage.objectCreator \u2014 Access to create objects in Google Cloud Storage. \n- roles/storage.objectAdmin \u2014 Full control of Google Cloud Storage objects. The legacy IAM roles are: \n- roles/storage.legacyObjectReader \u2014 Read-only access to objects without listing. Equivalent to an ACL entry on an object with the READER role. \n- roles/storage.legacyObjectOwner \u2014 Read/write access to existing objects without listing. Equivalent to an ACL entry on an object with the OWNER role. \n- roles/storage.legacyBucketReader \u2014 Read access to buckets with object listing. Equivalent to an ACL entry on a bucket with the READER role. \n- roles/storage.legacyBucketWriter \u2014 Read access to buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the WRITER role. \n- roles/storage.legacyBucketOwner \u2014 Read and write access to existing buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the OWNER role.",
+ "annotations": {
+ "required": [
+ "storage.buckets.setIamPolicy",
+ "storage.objects.setIamPolicy",
+ "storage.managedFolders.setIamPolicy"
+ ]
+ }
+ }
+ }
+ },
+ "annotations": {
+ "required": [
+ "storage.buckets.setIamPolicy",
+ "storage.objects.setIamPolicy",
+ "storage.managedFolders.setIamPolicy"
+ ]
+ }
+ },
+ "etag": {
+ "type": "string",
+ "description": "HTTP 1.1 Entity tag for the policy.",
+ "format": "byte"
+ },
+ "kind": {
+ "type": "string",
+ "description": "The kind of item this is. For policies, this is always storage#policy. This field is ignored on input.",
+ "default": "storage#policy"
+ },
+ "resourceId": {
+ "type": "string",
+ "description": "The ID of the resource to which this policy belongs. Will be of the form projects/_/buckets/bucket for buckets, projects/_/buckets/bucket/objects/object for objects, and projects/_/buckets/bucket/managedFolders/managedFolder. A specific generation may be specified by appending #generationNumber to the end of the object name, e.g. projects/_/buckets/my-bucket/objects/data.txt#17. The current generation can be denoted with #0. This field is ignored on input."
+ },
+ "version": {
+ "type": "integer",
+ "description": "The IAM policy format version.",
+ "format": "int32"
+ }
+ }
+ },
+ "RewriteResponse": {
+ "id": "RewriteResponse",
+ "type": "object",
+ "description": "A rewrite response.",
+ "properties": {
+ "done": {
+ "type": "boolean",
+ "description": "true if the copy is finished; otherwise, false if the copy is in progress. This property is always present in the response."
+ },
+ "kind": {
+ "type": "string",
+ "description": "The kind of item this is.",
+ "default": "storage#rewriteResponse"
+ },
+ "objectSize": {
+ "type": "string",
+ "description": "The total size of the object being copied in bytes. This property is always present in the response.",
+ "format": "int64"
+ },
+ "resource": {
+ "$ref": "Object",
+ "description": "A resource containing the metadata for the copied-to object. This property is present in the response only when copying completes."
+ },
+ "rewriteToken": {
+ "type": "string",
+ "description": "A token to use in subsequent requests to continue copying data. This token is present in the response only when there is more data to copy."
+ },
+ "totalBytesRewritten": {
+ "type": "string",
+ "description": "The total bytes written so far, which can be used to provide a waiting user with a progress indicator. This property is always present in the response.",
+ "format": "int64"
+ }
+ }
+ },
+ "ServiceAccount": {
+ "id": "ServiceAccount",
+ "type": "object",
+ "description": "A subscription to receive Google PubSub notifications.",
+ "properties": {
+ "email_address": {
+ "type": "string",
+ "description": "The ID of the notification."
+ },
+ "kind": {
+ "type": "string",
+ "description": "The kind of item this is. For notifications, this is always storage#notification.",
+ "default": "storage#serviceAccount"
+ }
+ }
+ },
+ "TestIamPermissionsResponse": {
+ "id": "TestIamPermissionsResponse",
+ "type": "object",
+ "description": "A storage.(buckets|objects|managedFolders).testIamPermissions response.",
+ "properties": {
+ "kind": {
+ "type": "string",
+ "description": "The kind of item this is.",
+ "default": "storage#testIamPermissionsResponse"
+ },
+ "permissions": {
+ "type": "array",
+ "description": "The permissions held by the caller. Permissions are always of the format storage.resource.capability, where resource is one of buckets, objects, or managedFolders. The supported permissions are as follows: \n- storage.buckets.delete \u2014 Delete bucket. \n- storage.buckets.get \u2014 Read bucket metadata. \n- storage.buckets.getIamPolicy \u2014 Read bucket IAM policy. \n- storage.buckets.create \u2014 Create bucket. \n- storage.buckets.list \u2014 List buckets. \n- storage.buckets.setIamPolicy \u2014 Update bucket IAM policy. \n- storage.buckets.update \u2014 Update bucket metadata. \n- storage.objects.delete \u2014 Delete object. \n- storage.objects.get \u2014 Read object data and metadata. \n- storage.objects.getIamPolicy \u2014 Read object IAM policy. \n- storage.objects.create \u2014 Create object. \n- storage.objects.list \u2014 List objects. \n- storage.objects.setIamPolicy \u2014 Update object IAM policy. \n- storage.objects.update \u2014 Update object metadata. \n- storage.managedFolders.delete \u2014 Delete managed folder. \n- storage.managedFolders.get \u2014 Read managed folder metadata. \n- storage.managedFolders.getIamPolicy \u2014 Read managed folder IAM policy. \n- storage.managedFolders.create \u2014 Create managed folder. \n- storage.managedFolders.list \u2014 List managed folders. \n- storage.managedFolders.setIamPolicy \u2014 Update managed folder IAM policy.",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "BulkRestoreObjectsRequest": {
+ "id": "BulkRestoreObjectsRequest",
+ "type": "object",
+ "description": "A bulk restore objects request.",
+ "properties": {
+ "allowOverwrite": {
+ "type": "boolean",
+ "description": "If false (default), the restore will not overwrite live objects with the same name at the destination. This means some deleted objects may be skipped. If true, live objects will be overwritten resulting in a noncurrent object (if versioning is enabled). If versioning is not enabled, overwriting the object will result in a soft-deleted object. In either case, if a noncurrent object already exists with the same name, a live version can be written without issue."
+ },
+ "softDeletedAfterTime": {
+ "type": "string",
+ "description": "Restores only the objects that were soft-deleted after this time.",
+ "format": "date-time"
+ },
+ "softDeletedBeforeTime": {
+ "type": "string",
+ "description": "Restores only the objects that were soft-deleted before this time.",
+ "format": "date-time"
+ },
+ "matchGlobs": {
+ "type": "array",
+ "description": "Restores only the objects matching any of the specified glob(s). If this parameter is not specified, all objects will be restored within the specified time range.",
+ "items": {
+ "type": "string"
+ }
+ },
+ "copySourceAcl": {
+ "type": "boolean",
+ "description": "If true, copies the source object's ACL; otherwise, uses the bucket's default object ACL. The default is false."
+ }
+ }
+ }
},
- "destinationObject": {
- "type": "string",
- "description": "Name of the new object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
- "required": true,
- "location": "path"
- },
- "destinationPredefinedAcl": {
- "type": "string",
- "description": "Apply a predefined set of access controls to the destination object.",
- "enum": [
- "authenticatedRead",
- "bucketOwnerFullControl",
- "bucketOwnerRead",
- "private",
- "projectPrivate",
- "publicRead"
- ],
- "enumDescriptions": [
- "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
- "Object owner gets OWNER access, and project team owners get OWNER access.",
- "Object owner gets OWNER access, and project team owners get READER access.",
- "Object owner gets OWNER access.",
- "Object owner gets OWNER access, and project team members get access according to their roles.",
- "Object owner gets OWNER access, and allUsers get READER access."
- ],
- "location": "query"
- },
- "ifGenerationMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
- "format": "int64",
- "location": "query"
- },
- "ifMetagenerationMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
- "format": "int64",
- "location": "query"
- },
- "kmsKeyName": {
- "type": "string",
- "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.",
- "location": "query"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "destinationBucket",
- "destinationObject"
-],
-"request": {
- "$ref": "ComposeRequest"
-},
-"response": {
- "$ref": "Object"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-},
-"copy": {
-"id": "storage.objects.copy",
-"path": "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}",
-"httpMethod": "POST",
-"description": "Copies a source object to a destination object. Optionally overrides metadata.",
-"parameters": {
- "destinationBucket": {
- "type": "string",
- "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
- "required": true,
- "location": "path"
- },
- "destinationKmsKeyName": {
- "type": "string",
- "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.",
- "location": "query"
- },
- "destinationObject": {
- "type": "string",
- "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.",
- "required": true,
- "location": "path"
- },
- "destinationPredefinedAcl": {
- "type": "string",
- "description": "Apply a predefined set of access controls to the destination object.",
- "enum": [
- "authenticatedRead",
- "bucketOwnerFullControl",
- "bucketOwnerRead",
- "private",
- "projectPrivate",
- "publicRead"
- ],
- "enumDescriptions": [
- "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
- "Object owner gets OWNER access, and project team owners get OWNER access.",
- "Object owner gets OWNER access, and project team owners get READER access.",
- "Object owner gets OWNER access.",
- "Object owner gets OWNER access, and project team members get access according to their roles.",
- "Object owner gets OWNER access, and allUsers get READER access."
- ],
- "location": "query"
- },
- "ifGenerationMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the destination object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
- "format": "int64",
- "location": "query"
- },
- "ifGenerationNotMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the destination object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
- "format": "int64",
- "location": "query"
- },
- "ifMetagenerationMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.",
- "format": "int64",
- "location": "query"
- },
- "ifMetagenerationNotMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query"
- },
- "ifSourceGenerationMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the source object's current generation matches the given value.",
- "format": "int64",
- "location": "query"
- },
- "ifSourceGenerationNotMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.",
- "format": "int64",
- "location": "query"
- },
- "ifSourceMetagenerationMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.",
- "format": "int64",
- "location": "query"
- },
- "ifSourceMetagenerationNotMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query"
- },
- "projection": {
- "type": "string",
- "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
- "enum": [
- "full",
- "noAcl"
- ],
- "enumDescriptions": [
- "Include all properties.",
- "Omit the owner, acl property."
- ],
- "location": "query"
- },
- "sourceBucket": {
- "type": "string",
- "description": "Name of the bucket in which to find the source object.",
- "required": true,
- "location": "path"
- },
- "sourceGeneration": {
- "type": "string",
- "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query"
- },
- "sourceObject": {
- "type": "string",
- "description": "Name of the source object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "sourceBucket",
- "sourceObject",
- "destinationBucket",
- "destinationObject"
-],
-"request": {
- "$ref": "Object"
-},
-"response": {
- "$ref": "Object"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-},
-"delete": {
-"id": "storage.objects.delete",
-"path": "b/{bucket}/o/{object}",
-"httpMethod": "DELETE",
-"description": "Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the bucket in which the object resides.",
- "required": true,
- "location": "path"
- },
- "generation": {
- "type": "string",
- "description": "If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query"
- },
- "ifGenerationMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
- "format": "int64",
- "location": "query"
- },
- "ifGenerationNotMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
- "format": "int64",
- "location": "query"
- },
- "ifMetagenerationMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
- "format": "int64",
- "location": "query"
- },
- "ifMetagenerationNotMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query"
- },
- "object": {
- "type": "string",
- "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "object"
-],
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-},
-"get": {
-"id": "storage.objects.get",
-"path": "b/{bucket}/o/{object}",
-"httpMethod": "GET",
-"description": "Retrieves an object or its metadata.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the bucket in which the object resides.",
- "required": true,
- "location": "path"
- },
- "generation": {
- "type": "string",
- "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query"
- },
- "ifGenerationMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
- "format": "int64",
- "location": "query"
- },
- "ifGenerationNotMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
- "format": "int64",
- "location": "query"
- },
- "ifMetagenerationMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
- "format": "int64",
- "location": "query"
- },
- "ifMetagenerationNotMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query"
- },
- "object": {
- "type": "string",
- "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
- "required": true,
- "location": "path"
- },
- "projection": {
- "type": "string",
- "description": "Set of properties to return. Defaults to noAcl.",
- "enum": [
- "full",
- "noAcl"
- ],
- "enumDescriptions": [
- "Include all properties.",
- "Omit the owner, acl property."
- ],
- "location": "query"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- },
- "softDeleted": {
- "type": "boolean",
- "description": "If true, only soft-deleted object versions will be listed. The default is false. For more information, see Soft Delete.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "object"
-],
-"response": {
- "$ref": "Object"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
-],
-"supportsMediaDownload": true,
-"useMediaDownloadService": true
-},
-"getIamPolicy": {
-"id": "storage.objects.getIamPolicy",
-"path": "b/{bucket}/o/{object}/iam",
-"httpMethod": "GET",
-"description": "Returns an IAM policy for the specified object.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the bucket in which the object resides.",
- "required": true,
- "location": "path"
- },
- "generation": {
- "type": "string",
- "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query"
- },
- "object": {
- "type": "string",
- "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "object"
-],
-"response": {
- "$ref": "Policy"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-},
-"insert": {
-"id": "storage.objects.insert",
-"path": "b/{bucket}/o",
-"httpMethod": "POST",
-"description": "Stores a new object and metadata.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.",
- "required": true,
- "location": "path"
- },
- "contentEncoding": {
- "type": "string",
- "description": "If set, sets the contentEncoding property of the final object to this value. Setting this parameter is equivalent to setting the contentEncoding metadata property. This can be useful when uploading an object with uploadType=media to indicate the encoding of the content being uploaded.",
- "location": "query"
- },
- "ifGenerationMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
- "format": "int64",
- "location": "query"
- },
- "ifGenerationNotMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
- "format": "int64",
- "location": "query"
- },
- "ifMetagenerationMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
- "format": "int64",
- "location": "query"
- },
- "ifMetagenerationNotMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query"
- },
- "kmsKeyName": {
- "type": "string",
- "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.",
- "location": "query"
- },
- "name": {
- "type": "string",
- "description": "Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
- "location": "query"
- },
- "predefinedAcl": {
- "type": "string",
- "description": "Apply a predefined set of access controls to this object.",
- "enum": [
- "authenticatedRead",
- "bucketOwnerFullControl",
- "bucketOwnerRead",
- "private",
- "projectPrivate",
- "publicRead"
- ],
- "enumDescriptions": [
- "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
- "Object owner gets OWNER access, and project team owners get OWNER access.",
- "Object owner gets OWNER access, and project team owners get READER access.",
- "Object owner gets OWNER access.",
- "Object owner gets OWNER access, and project team members get access according to their roles.",
- "Object owner gets OWNER access, and allUsers get READER access."
- ],
- "location": "query"
- },
- "projection": {
- "type": "string",
- "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
- "enum": [
- "full",
- "noAcl"
- ],
- "enumDescriptions": [
- "Include all properties.",
- "Omit the owner, acl property."
- ],
- "location": "query"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket"
-],
-"request": {
- "$ref": "Object"
-},
-"response": {
- "$ref": "Object"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
-],
-"supportsMediaUpload": true,
-"mediaUpload": {
- "accept": [
- "*/*"
- ],
- "protocols": {
- "simple": {
- "multipart": true,
- "path": "/upload/storage/v1/b/{bucket}/o"
+ "resources": {
+ "anywhereCaches": {
+ "methods": {
+ "insert": {
+ "id": "storage.anywhereCaches.insert",
+ "path": "b/{bucket}/anywhereCaches",
+ "httpMethod": "POST",
+ "description": "Creates an Anywhere Cache instance.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the parent bucket.",
+ "required": true,
+ "location": "path"
+ }
+ },
+ "parameterOrder": [
+ "bucket"
+ ],
+ "request": {
+ "$ref": "AnywhereCache"
+ },
+ "response": {
+ "$ref": "GoogleLongrunningOperation"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "update": {
+ "id": "storage.anywhereCaches.update",
+ "path": "b/{bucket}/anywhereCaches/{anywhereCacheId}",
+ "httpMethod": "PATCH",
+ "description": "Updates the config(ttl and admissionPolicy) of an Anywhere Cache instance.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the parent bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "anywhereCacheId": {
+ "type": "string",
+ "description": "The ID of requested Anywhere Cache instance.",
+ "required": true,
+ "location": "path"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "anywhereCacheId"
+ ],
+ "request": {
+ "$ref": "AnywhereCache"
+ },
+ "response": {
+ "$ref": "GoogleLongrunningOperation"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "get": {
+ "id": "storage.anywhereCaches.get",
+ "path": "b/{bucket}/anywhereCaches/{anywhereCacheId}",
+ "httpMethod": "GET",
+ "description": "Returns the metadata of an Anywhere Cache instance.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the parent bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "anywhereCacheId": {
+ "type": "string",
+ "description": "The ID of requested Anywhere Cache instance.",
+ "required": true,
+ "location": "path"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "anywhereCacheId"
+ ],
+ "response": {
+ "$ref": "AnywhereCache"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/cloud-platform.read-only",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_only",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "list": {
+ "id": "storage.anywhereCaches.list",
+ "path": "b/{bucket}/anywhereCaches",
+ "httpMethod": "GET",
+ "description": "Returns a list of Anywhere Cache instances of the bucket matching the criteria.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the parent bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "pageSize": {
+ "type": "integer",
+ "description": "Maximum number of items to return in a single page of responses. Maximum 1000.",
+ "format": "int32",
+ "minimum": "0",
+ "location": "query"
+ },
+ "pageToken": {
+ "type": "string",
+ "description": "A previously-returned page token representing part of the larger set of results to view.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket"
+ ],
+ "response": {
+ "$ref": "AnywhereCaches"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/cloud-platform.read-only",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_only",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "pause": {
+ "id": "storage.anywhereCaches.pause",
+ "path": "b/{bucket}/anywhereCaches/{anywhereCacheId}/pause",
+ "httpMethod": "POST",
+ "description": "Pauses an Anywhere Cache instance.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the parent bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "anywhereCacheId": {
+ "type": "string",
+ "description": "The ID of requested Anywhere Cache instance.",
+ "required": true,
+ "location": "path"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "anywhereCacheId"
+ ],
+ "response": {
+ "$ref": "AnywhereCache"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "resume": {
+ "id": "storage.anywhereCaches.resume",
+ "path": "b/{bucket}/anywhereCaches/{anywhereCacheId}/resume",
+ "httpMethod": "POST",
+ "description": "Resumes a paused or disabled Anywhere Cache instance.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the parent bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "anywhereCacheId": {
+ "type": "string",
+ "description": "The ID of requested Anywhere Cache instance.",
+ "required": true,
+ "location": "path"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "anywhereCacheId"
+ ],
+ "response": {
+ "$ref": "AnywhereCache"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "disable": {
+ "id": "storage.anywhereCaches.disable",
+ "path": "b/{bucket}/anywhereCaches/{anywhereCacheId}/disable",
+ "httpMethod": "POST",
+ "description": "Disables an Anywhere Cache instance.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the parent bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "anywhereCacheId": {
+ "type": "string",
+ "description": "The ID of requested Anywhere Cache instance.",
+ "required": true,
+ "location": "path"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "anywhereCacheId"
+ ],
+ "response": {
+ "$ref": "AnywhereCache"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ }
+ }
+ },
+ "bucketAccessControls": {
+ "methods": {
+ "delete": {
+ "id": "storage.bucketAccessControls.delete",
+ "path": "b/{bucket}/acl/{entity}",
+ "httpMethod": "DELETE",
+ "description": "Permanently deletes the ACL entry for the specified entity on the specified bucket.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of a bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "entity": {
+ "type": "string",
+ "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "entity"
+ ],
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
+ },
+ "get": {
+ "id": "storage.bucketAccessControls.get",
+ "path": "b/{bucket}/acl/{entity}",
+ "httpMethod": "GET",
+ "description": "Returns the ACL entry for the specified entity on the specified bucket.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of a bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "entity": {
+ "type": "string",
+ "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "entity"
+ ],
+ "response": {
+ "$ref": "BucketAccessControl"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
+ },
+ "insert": {
+ "id": "storage.bucketAccessControls.insert",
+ "path": "b/{bucket}/acl",
+ "httpMethod": "POST",
+ "description": "Creates a new ACL entry on the specified bucket.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of a bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket"
+ ],
+ "request": {
+ "$ref": "BucketAccessControl"
+ },
+ "response": {
+ "$ref": "BucketAccessControl"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
+ },
+ "list": {
+ "id": "storage.bucketAccessControls.list",
+ "path": "b/{bucket}/acl",
+ "httpMethod": "GET",
+ "description": "Retrieves ACL entries on the specified bucket.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of a bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket"
+ ],
+ "response": {
+ "$ref": "BucketAccessControls"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
+ },
+ "patch": {
+ "id": "storage.bucketAccessControls.patch",
+ "path": "b/{bucket}/acl/{entity}",
+ "httpMethod": "PATCH",
+ "description": "Patches an ACL entry on the specified bucket.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of a bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "entity": {
+ "type": "string",
+ "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "entity"
+ ],
+ "request": {
+ "$ref": "BucketAccessControl"
+ },
+ "response": {
+ "$ref": "BucketAccessControl"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
+ },
+ "update": {
+ "id": "storage.bucketAccessControls.update",
+ "path": "b/{bucket}/acl/{entity}",
+ "httpMethod": "PUT",
+ "description": "Updates an ACL entry on the specified bucket.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of a bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "entity": {
+ "type": "string",
+ "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "entity"
+ ],
+ "request": {
+ "$ref": "BucketAccessControl"
+ },
+ "response": {
+ "$ref": "BucketAccessControl"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
+ }
+ }
+ },
+ "buckets": {
+ "methods": {
+ "delete": {
+ "id": "storage.buckets.delete",
+ "path": "b/{bucket}",
+ "httpMethod": "DELETE",
+ "description": "Permanently deletes an empty bucket.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of a bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "ifMetagenerationMatch": {
+ "type": "string",
+ "description": "If set, only deletes the bucket if its metageneration matches this value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifMetagenerationNotMatch": {
+ "type": "string",
+ "description": "If set, only deletes the bucket if its metageneration does not match this value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket"
+ ],
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "get": {
+ "id": "storage.buckets.get",
+ "path": "b/{bucket}",
+ "httpMethod": "GET",
+ "description": "Returns metadata for the specified bucket.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of a bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "ifMetagenerationMatch": {
+ "type": "string",
+ "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifMetagenerationNotMatch": {
+ "type": "string",
+ "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "projection": {
+ "type": "string",
+ "description": "Set of properties to return. Defaults to noAcl.",
+ "enum": [
+ "full",
+ "noAcl"
+ ],
+ "enumDescriptions": [
+ "Include all properties.",
+ "Omit owner, acl and defaultObjectAcl properties."
+ ],
+ "location": "query"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket"
+ ],
+ "response": {
+ "$ref": "Bucket"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/cloud-platform.read-only",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_only",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "getIamPolicy": {
+ "id": "storage.buckets.getIamPolicy",
+ "path": "b/{bucket}/iam",
+ "httpMethod": "GET",
+ "description": "Returns an IAM policy for the specified bucket.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of a bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "optionsRequestedPolicyVersion": {
+ "type": "integer",
+ "description": "The IAM policy format version to be returned. If the optionsRequestedPolicyVersion is for an older version that doesn't support part of the requested IAM policy, the request fails.",
+ "format": "int32",
+ "minimum": "1",
+ "location": "query"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket"
+ ],
+ "response": {
+ "$ref": "Policy"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
+ },
+ "insert": {
+ "id": "storage.buckets.insert",
+ "path": "b",
+ "httpMethod": "POST",
+ "description": "Creates a new bucket.",
+ "parameters": {
+ "predefinedAcl": {
+ "type": "string",
+ "description": "Apply a predefined set of access controls to this bucket.",
+ "enum": [
+ "authenticatedRead",
+ "private",
+ "projectPrivate",
+ "publicRead",
+ "publicReadWrite"
+ ],
+ "enumDescriptions": [
+ "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
+ "Project team owners get OWNER access.",
+ "Project team members get access according to their roles.",
+ "Project team owners get OWNER access, and allUsers get READER access.",
+ "Project team owners get OWNER access, and allUsers get WRITER access."
+ ],
+ "location": "query"
+ },
+ "predefinedDefaultObjectAcl": {
+ "type": "string",
+ "description": "Apply a predefined set of default object access controls to this bucket.",
+ "enum": [
+ "authenticatedRead",
+ "bucketOwnerFullControl",
+ "bucketOwnerRead",
+ "private",
+ "projectPrivate",
+ "publicRead"
+ ],
+ "enumDescriptions": [
+ "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
+ "Object owner gets OWNER access, and project team owners get OWNER access.",
+ "Object owner gets OWNER access, and project team owners get READER access.",
+ "Object owner gets OWNER access.",
+ "Object owner gets OWNER access, and project team members get access according to their roles.",
+ "Object owner gets OWNER access, and allUsers get READER access."
+ ],
+ "location": "query"
+ },
+ "project": {
+ "type": "string",
+ "description": "A valid API project identifier.",
+ "required": true,
+ "location": "query"
+ },
+ "projection": {
+ "type": "string",
+ "description": "Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.",
+ "enum": [
+ "full",
+ "noAcl"
+ ],
+ "enumDescriptions": [
+ "Include all properties.",
+ "Omit owner, acl and defaultObjectAcl properties."
+ ],
+ "location": "query"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request.",
+ "location": "query"
+ },
+ "enableObjectRetention": {
+ "type": "boolean",
+ "description": "When set to true, object retention is enabled for this bucket.",
+ "default": "false",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "project"
+ ],
+ "request": {
+ "$ref": "Bucket"
+ },
+ "response": {
+ "$ref": "Bucket"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "list": {
+ "id": "storage.buckets.list",
+ "path": "b",
+ "httpMethod": "GET",
+ "description": "Retrieves a list of buckets for a given project.",
+ "parameters": {
+ "maxResults": {
+ "type": "integer",
+ "description": "Maximum number of buckets to return in a single response. The service will use this parameter or 1,000 items, whichever is smaller.",
+ "default": "1000",
+ "format": "uint32",
+ "minimum": "0",
+ "location": "query"
+ },
+ "pageToken": {
+ "type": "string",
+ "description": "A previously-returned page token representing part of the larger set of results to view.",
+ "location": "query"
+ },
+ "prefix": {
+ "type": "string",
+ "description": "Filter results to buckets whose names begin with this prefix.",
+ "location": "query"
+ },
+ "project": {
+ "type": "string",
+ "description": "A valid API project identifier.",
+ "required": true,
+ "location": "query"
+ },
+ "projection": {
+ "type": "string",
+ "description": "Set of properties to return. Defaults to noAcl.",
+ "enum": [
+ "full",
+ "noAcl"
+ ],
+ "enumDescriptions": [
+ "Include all properties.",
+ "Omit owner, acl and defaultObjectAcl properties."
+ ],
+ "location": "query"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "project"
+ ],
+ "response": {
+ "$ref": "Buckets"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/cloud-platform.read-only",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_only",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "lockRetentionPolicy": {
+ "id": "storage.buckets.lockRetentionPolicy",
+ "path": "b/{bucket}/lockRetentionPolicy",
+ "httpMethod": "POST",
+ "description": "Locks retention policy on a bucket.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of a bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "ifMetagenerationMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether bucket's current metageneration matches the given value.",
+ "required": true,
+ "format": "int64",
+ "location": "query"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "ifMetagenerationMatch"
+ ],
+ "response": {
+ "$ref": "Bucket"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "patch": {
+ "id": "storage.buckets.patch",
+ "path": "b/{bucket}",
+ "httpMethod": "PATCH",
+ "description": "Patches a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of a bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "ifMetagenerationMatch": {
+ "type": "string",
+ "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifMetagenerationNotMatch": {
+ "type": "string",
+ "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "predefinedAcl": {
+ "type": "string",
+ "description": "Apply a predefined set of access controls to this bucket.",
+ "enum": [
+ "authenticatedRead",
+ "private",
+ "projectPrivate",
+ "publicRead",
+ "publicReadWrite"
+ ],
+ "enumDescriptions": [
+ "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
+ "Project team owners get OWNER access.",
+ "Project team members get access according to their roles.",
+ "Project team owners get OWNER access, and allUsers get READER access.",
+ "Project team owners get OWNER access, and allUsers get WRITER access."
+ ],
+ "location": "query"
+ },
+ "predefinedDefaultObjectAcl": {
+ "type": "string",
+ "description": "Apply a predefined set of default object access controls to this bucket.",
+ "enum": [
+ "authenticatedRead",
+ "bucketOwnerFullControl",
+ "bucketOwnerRead",
+ "private",
+ "projectPrivate",
+ "publicRead"
+ ],
+ "enumDescriptions": [
+ "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
+ "Object owner gets OWNER access, and project team owners get OWNER access.",
+ "Object owner gets OWNER access, and project team owners get READER access.",
+ "Object owner gets OWNER access.",
+ "Object owner gets OWNER access, and project team members get access according to their roles.",
+ "Object owner gets OWNER access, and allUsers get READER access."
+ ],
+ "location": "query"
+ },
+ "projection": {
+ "type": "string",
+ "description": "Set of properties to return. Defaults to full.",
+ "enum": [
+ "full",
+ "noAcl"
+ ],
+ "enumDescriptions": [
+ "Include all properties.",
+ "Omit owner, acl and defaultObjectAcl properties."
+ ],
+ "location": "query"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket"
+ ],
+ "request": {
+ "$ref": "Bucket"
+ },
+ "response": {
+ "$ref": "Bucket"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
+ },
+ "setIamPolicy": {
+ "id": "storage.buckets.setIamPolicy",
+ "path": "b/{bucket}/iam",
+ "httpMethod": "PUT",
+ "description": "Updates an IAM policy for the specified bucket.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of a bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket"
+ ],
+ "request": {
+ "$ref": "Policy"
+ },
+ "response": {
+ "$ref": "Policy"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
+ },
+ "testIamPermissions": {
+ "id": "storage.buckets.testIamPermissions",
+ "path": "b/{bucket}/iam/testPermissions",
+ "httpMethod": "GET",
+ "description": "Tests a set of permissions on the given bucket to see which, if any, are held by the caller.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of a bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "permissions": {
+ "type": "string",
+ "description": "Permissions to test.",
+ "required": true,
+ "repeated": true,
+ "location": "query"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "permissions"
+ ],
+ "response": {
+ "$ref": "TestIamPermissionsResponse"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/cloud-platform.read-only",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_only",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "update": {
+ "id": "storage.buckets.update",
+ "path": "b/{bucket}",
+ "httpMethod": "PUT",
+ "description": "Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of a bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "ifMetagenerationMatch": {
+ "type": "string",
+ "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifMetagenerationNotMatch": {
+ "type": "string",
+ "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "predefinedAcl": {
+ "type": "string",
+ "description": "Apply a predefined set of access controls to this bucket.",
+ "enum": [
+ "authenticatedRead",
+ "private",
+ "projectPrivate",
+ "publicRead",
+ "publicReadWrite"
+ ],
+ "enumDescriptions": [
+ "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
+ "Project team owners get OWNER access.",
+ "Project team members get access according to their roles.",
+ "Project team owners get OWNER access, and allUsers get READER access.",
+ "Project team owners get OWNER access, and allUsers get WRITER access."
+ ],
+ "location": "query"
+ },
+ "predefinedDefaultObjectAcl": {
+ "type": "string",
+ "description": "Apply a predefined set of default object access controls to this bucket.",
+ "enum": [
+ "authenticatedRead",
+ "bucketOwnerFullControl",
+ "bucketOwnerRead",
+ "private",
+ "projectPrivate",
+ "publicRead"
+ ],
+ "enumDescriptions": [
+ "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
+ "Object owner gets OWNER access, and project team owners get OWNER access.",
+ "Object owner gets OWNER access, and project team owners get READER access.",
+ "Object owner gets OWNER access.",
+ "Object owner gets OWNER access, and project team members get access according to their roles.",
+ "Object owner gets OWNER access, and allUsers get READER access."
+ ],
+ "location": "query"
+ },
+ "projection": {
+ "type": "string",
+ "description": "Set of properties to return. Defaults to full.",
+ "enum": [
+ "full",
+ "noAcl"
+ ],
+ "enumDescriptions": [
+ "Include all properties.",
+ "Omit owner, acl and defaultObjectAcl properties."
+ ],
+ "location": "query"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket"
+ ],
+ "request": {
+ "$ref": "Bucket"
+ },
+ "response": {
+ "$ref": "Bucket"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
+ }
+ }
+ },
+ "operations": {
+ "methods": {
+ "cancel": {
+ "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed.",
+ "path": "b/{bucket}/operations/{operationId}/cancel",
+ "httpMethod": "POST",
+ "id": "storage.buckets.operations.cancel",
+ "parameterOrder": [
+ "bucket",
+ "operationId"
+ ],
+ "parameters": {
+ "bucket": {
+ "description": "The parent bucket of the operation resource.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ },
+ "operationId": {
+ "description": "The ID of the operation resource.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "get": {
+ "description": "Gets the latest state of a long-running operation.",
+ "path": "b/{bucket}/operations/{operationId}",
+ "httpMethod": "GET",
+ "id": "storage.buckets.operations.get",
+ "parameterOrder": [
+ "bucket",
+ "operationId"
+ ],
+ "parameters": {
+ "bucket": {
+ "description": "The parent bucket of the operation resource.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ },
+ "operationId": {
+ "description": "The ID of the operation resource.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "response": {
+ "$ref": "GoogleLongrunningOperation"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/cloud-platform.read-only",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_only",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "list": {
+ "description": "Lists operations that match the specified filter in the request.",
+ "path": "b/{bucket}/operations",
+ "httpMethod": "GET",
+ "id": "storage.buckets.operations.list",
+ "parameterOrder": [
+ "bucket"
+ ],
+ "parameters": {
+ "filter": {
+ "description": "A filter to narrow down results to a preferred subset. The filtering language is documented in more detail in [AIP-160](https://google.aip.dev/160).",
+ "location": "query",
+ "type": "string"
+ },
+ "bucket": {
+ "description": "Name of the bucket in which to look for operations.",
+ "location": "path",
+ "required": true,
+ "type": "string"
+ },
+ "pageSize": {
+ "description": "Maximum number of items to return in a single page of responses. Fewer total results may be returned than requested. The service uses this parameter or 100 items, whichever is smaller.",
+ "minimum": "0",
+ "format": "int32",
+ "location": "query",
+ "type": "integer"
+ },
+ "pageToken": {
+ "description": "A previously-returned page token representing part of the larger set of results to view.",
+ "location": "query",
+ "type": "string"
+ }
+ },
+ "response": {
+ "$ref": "GoogleLongrunningListOperationsResponse"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/cloud-platform.read-only",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_only",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ }
+ }
+ },
+ "channels": {
+ "methods": {
+ "stop": {
+ "id": "storage.channels.stop",
+ "path": "channels/stop",
+ "httpMethod": "POST",
+ "description": "Stop watching resources through this channel",
+ "request": {
+ "$ref": "Channel",
+ "parameterName": "resource"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/cloud-platform.read-only",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_only",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ }
+ }
+ },
+ "defaultObjectAccessControls": {
+ "methods": {
+ "delete": {
+ "id": "storage.defaultObjectAccessControls.delete",
+ "path": "b/{bucket}/defaultObjectAcl/{entity}",
+ "httpMethod": "DELETE",
+ "description": "Permanently deletes the default object ACL entry for the specified entity on the specified bucket.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of a bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "entity": {
+ "type": "string",
+ "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "entity"
+ ],
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
+ },
+ "get": {
+ "id": "storage.defaultObjectAccessControls.get",
+ "path": "b/{bucket}/defaultObjectAcl/{entity}",
+ "httpMethod": "GET",
+ "description": "Returns the default object ACL entry for the specified entity on the specified bucket.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of a bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "entity": {
+ "type": "string",
+ "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "entity"
+ ],
+ "response": {
+ "$ref": "ObjectAccessControl"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
+ },
+ "insert": {
+ "id": "storage.defaultObjectAccessControls.insert",
+ "path": "b/{bucket}/defaultObjectAcl",
+ "httpMethod": "POST",
+ "description": "Creates a new default object ACL entry on the specified bucket.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of a bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket"
+ ],
+ "request": {
+ "$ref": "ObjectAccessControl"
+ },
+ "response": {
+ "$ref": "ObjectAccessControl"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
+ },
+ "list": {
+ "id": "storage.defaultObjectAccessControls.list",
+ "path": "b/{bucket}/defaultObjectAcl",
+ "httpMethod": "GET",
+ "description": "Retrieves default object ACL entries on the specified bucket.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of a bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "ifMetagenerationMatch": {
+ "type": "string",
+ "description": "If present, only return default ACL listing if the bucket's current metageneration matches this value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifMetagenerationNotMatch": {
+ "type": "string",
+ "description": "If present, only return default ACL listing if the bucket's current metageneration does not match the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket"
+ ],
+ "response": {
+ "$ref": "ObjectAccessControls"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
+ },
+ "patch": {
+ "id": "storage.defaultObjectAccessControls.patch",
+ "path": "b/{bucket}/defaultObjectAcl/{entity}",
+ "httpMethod": "PATCH",
+ "description": "Patches a default object ACL entry on the specified bucket.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of a bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "entity": {
+ "type": "string",
+ "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "entity"
+ ],
+ "request": {
+ "$ref": "ObjectAccessControl"
+ },
+ "response": {
+ "$ref": "ObjectAccessControl"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
+ },
+ "update": {
+ "id": "storage.defaultObjectAccessControls.update",
+ "path": "b/{bucket}/defaultObjectAcl/{entity}",
+ "httpMethod": "PUT",
+ "description": "Updates a default object ACL entry on the specified bucket.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of a bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "entity": {
+ "type": "string",
+ "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "entity"
+ ],
+ "request": {
+ "$ref": "ObjectAccessControl"
+ },
+ "response": {
+ "$ref": "ObjectAccessControl"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
+ }
+ }
+ },
+ "folders": {
+ "methods": {
+ "delete": {
+ "id": "storage.folders.delete",
+ "path": "b/{bucket}/folders/{folder}",
+ "httpMethod": "DELETE",
+ "description": "Permanently deletes a folder. Only applicable to buckets with hierarchical namespace enabled.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the bucket in which the folder resides.",
+ "required": true,
+ "location": "path"
+ },
+ "folder": {
+ "type": "string",
+ "description": "Name of a folder.",
+ "required": true,
+ "location": "path"
+ },
+ "ifMetagenerationMatch": {
+ "type": "string",
+ "description": "If set, only deletes the folder if its metageneration matches this value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifMetagenerationNotMatch": {
+ "type": "string",
+ "description": "If set, only deletes the folder if its metageneration does not match this value.",
+ "format": "int64",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "folder"
+ ],
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "get": {
+ "id": "storage.folders.get",
+ "path": "b/{bucket}/folders/{folder}",
+ "httpMethod": "GET",
+ "description": "Returns metadata for the specified folder. Only applicable to buckets with hierarchical namespace enabled.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the bucket in which the folder resides.",
+ "required": true,
+ "location": "path"
+ },
+ "folder": {
+ "type": "string",
+ "description": "Name of a folder.",
+ "required": true,
+ "location": "path"
+ },
+ "ifMetagenerationMatch": {
+ "type": "string",
+ "description": "Makes the return of the folder metadata conditional on whether the folder's current metageneration matches the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifMetagenerationNotMatch": {
+ "type": "string",
+ "description": "Makes the return of the folder metadata conditional on whether the folder's current metageneration does not match the given value.",
+ "format": "int64",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "folder"
+ ],
+ "response": {
+ "$ref": "Folder"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/cloud-platform.read-only",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_only",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "insert": {
+ "id": "storage.folders.insert",
+ "path": "b/{bucket}/folders",
+ "httpMethod": "POST",
+ "description": "Creates a new folder. Only applicable to buckets with hierarchical namespace enabled.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the bucket in which the folder resides.",
+ "required": true,
+ "location": "path"
+ },
+ "recursive": {
+ "type": "boolean",
+ "description": "If true, any parent folder which doesn\u2019t exist will be created automatically.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket"
+ ],
+ "request": {
+ "$ref": "Folder"
+ },
+ "response": {
+ "$ref": "Folder"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "list": {
+ "id": "storage.folders.list",
+ "path": "b/{bucket}/folders",
+ "httpMethod": "GET",
+ "description": "Retrieves a list of folders matching the criteria. Only applicable to buckets with hierarchical namespace enabled.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the bucket in which to look for folders.",
+ "required": true,
+ "location": "path"
+ },
+ "delimiter": {
+ "type": "string",
+ "description": "Returns results in a directory-like mode. The only supported value is '/'. If set, items will only contain folders that either exactly match the prefix, or are one level below the prefix.",
+ "location": "query"
+ },
+ "endOffset": {
+ "type": "string",
+ "description": "Filter results to folders whose names are lexicographically before endOffset. If startOffset is also set, the folders listed will have names between startOffset (inclusive) and endOffset (exclusive).",
+ "location": "query"
+ },
+ "pageSize": {
+ "type": "integer",
+ "description": "Maximum number of items to return in a single page of responses.",
+ "format": "int32",
+ "minimum": "0",
+ "location": "query"
+ },
+ "pageToken": {
+ "type": "string",
+ "description": "A previously-returned page token representing part of the larger set of results to view.",
+ "location": "query"
+ },
+ "prefix": {
+ "type": "string",
+ "description": "Filter results to folders whose paths begin with this prefix. If set, the value must either be an empty string or end with a '/'.",
+ "location": "query"
+ },
+ "startOffset": {
+ "type": "string",
+ "description": "Filter results to folders whose names are lexicographically equal to or after startOffset. If endOffset is also set, the folders listed will have names between startOffset (inclusive) and endOffset (exclusive).",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket"
+ ],
+ "response": {
+ "$ref": "Folders"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/cloud-platform.read-only",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_only",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "rename": {
+ "id": "storage.folders.rename",
+ "path": "b/{bucket}/folders/{sourceFolder}/renameTo/folders/{destinationFolder}",
+ "httpMethod": "POST",
+ "description": "Renames a source folder to a destination folder. Only applicable to buckets with hierarchical namespace enabled.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the bucket in which the folders are in.",
+ "required": true,
+ "location": "path"
+ },
+ "destinationFolder": {
+ "type": "string",
+ "description": "Name of the destination folder.",
+ "required": true,
+ "location": "path"
+ },
+ "ifSourceMetagenerationMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifSourceMetagenerationNotMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "sourceFolder": {
+ "type": "string",
+ "description": "Name of the source folder.",
+ "required": true,
+ "location": "path"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "sourceFolder",
+ "destinationFolder"
+ ],
+ "response": {
+ "$ref": "GoogleLongrunningOperation"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ }
+ }
},
- "resumable": {
- "multipart": true,
- "path": "/resumable/upload/storage/v1/b/{bucket}/o"
- }
- }
-}
-},
-"list": {
-"id": "storage.objects.list",
-"path": "b/{bucket}/o",
-"httpMethod": "GET",
-"description": "Retrieves a list of objects matching the criteria.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the bucket in which to look for objects.",
- "required": true,
- "location": "path"
- },
- "delimiter": {
- "type": "string",
- "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.",
- "location": "query"
- },
- "endOffset": {
- "type": "string",
- "description": "Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).",
- "location": "query"
- },
- "includeTrailingDelimiter": {
- "type": "boolean",
- "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.",
- "location": "query"
- },
- "maxResults": {
- "type": "integer",
- "description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.",
- "default": "1000",
- "format": "uint32",
- "minimum": "0",
- "location": "query"
- },
- "pageToken": {
- "type": "string",
- "description": "A previously-returned page token representing part of the larger set of results to view.",
- "location": "query"
- },
- "prefix": {
- "type": "string",
- "description": "Filter results to objects whose names begin with this prefix.",
- "location": "query"
- },
- "projection": {
- "type": "string",
- "description": "Set of properties to return. Defaults to noAcl.",
- "enum": [
- "full",
- "noAcl"
- ],
- "enumDescriptions": [
- "Include all properties.",
- "Omit the owner, acl property."
- ],
- "location": "query"
- },
- "startOffset": {
- "type": "string",
- "description": "Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).",
- "location": "query"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- },
- "versions": {
- "type": "boolean",
- "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.",
- "location": "query"
- },
- "matchGlob": {
- "type": "string",
- "description": "Filter results to objects and prefixes that match this glob pattern.",
- "location": "query"
- },
- "softDeleted": {
- "type": "boolean",
- "description": "If true, only soft-deleted object versions will be listed. The default is false. For more information, see Soft Delete.",
- "location": "query"
- },
- "includeFoldersAsPrefixes": {
- "type": "boolean",
- "description": "Only applicable if delimiter is set to '/'. If true, will also include folders and managed folders (besides objects) in the returned prefixes.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket"
-],
-"response": {
- "$ref": "Objects"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
-],
-"supportsSubscription": true
-},
-"patch": {
-"id": "storage.objects.patch",
-"path": "b/{bucket}/o/{object}",
-"httpMethod": "PATCH",
-"description": "Patches an object's metadata.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the bucket in which the object resides.",
- "required": true,
- "location": "path"
- },
- "generation": {
- "type": "string",
- "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query"
- },
- "ifGenerationMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
- "format": "int64",
- "location": "query"
- },
- "ifGenerationNotMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
- "format": "int64",
- "location": "query"
- },
- "ifMetagenerationMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
- "format": "int64",
- "location": "query"
- },
- "ifMetagenerationNotMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query"
- },
- "overrideUnlockedRetention": {
- "type": "boolean",
- "description": "Must be true to remove the retention configuration, reduce its unlocked retention period, or change its mode from unlocked to locked.",
- "location": "query"
- },
- "object": {
- "type": "string",
- "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
- "required": true,
- "location": "path"
- },
- "predefinedAcl": {
- "type": "string",
- "description": "Apply a predefined set of access controls to this object.",
- "enum": [
- "authenticatedRead",
- "bucketOwnerFullControl",
- "bucketOwnerRead",
- "private",
- "projectPrivate",
- "publicRead"
- ],
- "enumDescriptions": [
- "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
- "Object owner gets OWNER access, and project team owners get OWNER access.",
- "Object owner gets OWNER access, and project team owners get READER access.",
- "Object owner gets OWNER access.",
- "Object owner gets OWNER access, and project team members get access according to their roles.",
- "Object owner gets OWNER access, and allUsers get READER access."
- ],
- "location": "query"
- },
- "projection": {
- "type": "string",
- "description": "Set of properties to return. Defaults to full.",
- "enum": [
- "full",
- "noAcl"
- ],
- "enumDescriptions": [
- "Include all properties.",
- "Omit the owner, acl property."
- ],
- "location": "query"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request, for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "object"
-],
-"request": {
- "$ref": "Object"
-},
-"response": {
- "$ref": "Object"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
-]
-},
-"rewrite": {
-"id": "storage.objects.rewrite",
-"path": "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}",
-"httpMethod": "POST",
-"description": "Rewrites a source object to a destination object. Optionally overrides metadata.",
-"parameters": {
- "destinationBucket": {
- "type": "string",
- "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.",
- "required": true,
- "location": "path"
- },
- "destinationKmsKeyName": {
- "type": "string",
- "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.",
- "location": "query"
- },
- "destinationObject": {
- "type": "string",
- "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
- "required": true,
- "location": "path"
- },
- "destinationPredefinedAcl": {
- "type": "string",
- "description": "Apply a predefined set of access controls to the destination object.",
- "enum": [
- "authenticatedRead",
- "bucketOwnerFullControl",
- "bucketOwnerRead",
- "private",
- "projectPrivate",
- "publicRead"
- ],
- "enumDescriptions": [
- "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
- "Object owner gets OWNER access, and project team owners get OWNER access.",
- "Object owner gets OWNER access, and project team owners get READER access.",
- "Object owner gets OWNER access.",
- "Object owner gets OWNER access, and project team members get access according to their roles.",
- "Object owner gets OWNER access, and allUsers get READER access."
- ],
- "location": "query"
- },
- "ifGenerationMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
- "format": "int64",
- "location": "query"
- },
- "ifGenerationNotMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
- "format": "int64",
- "location": "query"
- },
- "ifMetagenerationMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.",
- "format": "int64",
- "location": "query"
- },
- "ifMetagenerationNotMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query"
- },
- "ifSourceGenerationMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the source object's current generation matches the given value.",
- "format": "int64",
- "location": "query"
- },
- "ifSourceGenerationNotMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.",
- "format": "int64",
- "location": "query"
- },
- "ifSourceMetagenerationMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.",
- "format": "int64",
- "location": "query"
- },
- "ifSourceMetagenerationNotMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query"
- },
- "maxBytesRewrittenPerCall": {
- "type": "string",
- "description": "The maximum number of bytes that will be rewritten per rewrite request. Most callers shouldn't need to specify this parameter - it is primarily in place to support testing. If specified the value must be an integral multiple of 1 MiB (1048576). Also, this only applies to requests where the source and destination span locations and/or storage classes. Finally, this value must not change across rewrite calls else you'll get an error that the rewriteToken is invalid.",
- "format": "int64",
- "location": "query"
- },
- "projection": {
- "type": "string",
- "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
- "enum": [
- "full",
- "noAcl"
- ],
- "enumDescriptions": [
- "Include all properties.",
- "Omit the owner, acl property."
- ],
- "location": "query"
- },
- "rewriteToken": {
- "type": "string",
- "description": "Include this field (from the previous rewrite response) on each rewrite request after the first one, until the rewrite response 'done' flag is true. Calls that provide a rewriteToken can omit all other request fields, but if included those fields must match the values provided in the first rewrite request.",
- "location": "query"
- },
- "sourceBucket": {
- "type": "string",
- "description": "Name of the bucket in which to find the source object.",
- "required": true,
- "location": "path"
- },
- "sourceGeneration": {
- "type": "string",
- "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query"
- },
- "sourceObject": {
- "type": "string",
- "description": "Name of the source object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "sourceBucket",
- "sourceObject",
- "destinationBucket",
- "destinationObject"
-],
-"request": {
- "$ref": "Object"
-},
-"response": {
- "$ref": "RewriteResponse"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-},
-"setIamPolicy": {
-"id": "storage.objects.setIamPolicy",
-"path": "b/{bucket}/o/{object}/iam",
-"httpMethod": "PUT",
-"description": "Updates an IAM policy for the specified object.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the bucket in which the object resides.",
- "required": true,
- "location": "path"
- },
- "generation": {
- "type": "string",
- "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query"
- },
- "object": {
- "type": "string",
- "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
- "required": true,
- "location": "path"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "object"
-],
-"request": {
- "$ref": "Policy"
-},
-"response": {
- "$ref": "Policy"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-},
-"testIamPermissions": {
-"id": "storage.objects.testIamPermissions",
-"path": "b/{bucket}/o/{object}/iam/testPermissions",
-"httpMethod": "GET",
-"description": "Tests a set of permissions on the given object to see which, if any, are held by the caller.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the bucket in which the object resides.",
- "required": true,
- "location": "path"
- },
- "generation": {
- "type": "string",
- "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query"
- },
- "object": {
- "type": "string",
- "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
- "required": true,
- "location": "path"
- },
- "permissions": {
- "type": "string",
- "description": "Permissions to test.",
- "required": true,
- "repeated": true,
- "location": "query"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "object",
- "permissions"
-],
-"response": {
- "$ref": "TestIamPermissionsResponse"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
-]
-},
-"update": {
-"id": "storage.objects.update",
-"path": "b/{bucket}/o/{object}",
-"httpMethod": "PUT",
-"description": "Updates an object's metadata.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the bucket in which the object resides.",
- "required": true,
- "location": "path"
- },
- "generation": {
- "type": "string",
- "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query"
- },
- "ifGenerationMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
- "format": "int64",
- "location": "query"
- },
- "ifGenerationNotMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
- "format": "int64",
- "location": "query"
- },
- "ifMetagenerationMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
- "format": "int64",
- "location": "query"
- },
- "ifMetagenerationNotMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query"
- },
- "overrideUnlockedRetention": {
- "type": "boolean",
- "description": "Must be true to remove the retention configuration, reduce its unlocked retention period, or change its mode from unlocked to locked.",
- "location": "query"
- },
- "object": {
- "type": "string",
- "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
- "required": true,
- "location": "path"
- },
- "predefinedAcl": {
- "type": "string",
- "description": "Apply a predefined set of access controls to this object.",
- "enum": [
- "authenticatedRead",
- "bucketOwnerFullControl",
- "bucketOwnerRead",
- "private",
- "projectPrivate",
- "publicRead"
- ],
- "enumDescriptions": [
- "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
- "Object owner gets OWNER access, and project team owners get OWNER access.",
- "Object owner gets OWNER access, and project team owners get READER access.",
- "Object owner gets OWNER access.",
- "Object owner gets OWNER access, and project team members get access according to their roles.",
- "Object owner gets OWNER access, and allUsers get READER access."
- ],
- "location": "query"
- },
- "projection": {
- "type": "string",
- "description": "Set of properties to return. Defaults to full.",
- "enum": [
- "full",
- "noAcl"
- ],
- "enumDescriptions": [
- "Include all properties.",
- "Omit the owner, acl property."
- ],
- "location": "query"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "object"
-],
-"request": {
- "$ref": "Object"
-},
-"response": {
- "$ref": "Object"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
-]
-},
-"watchAll": {
-"id": "storage.objects.watchAll",
-"path": "b/{bucket}/o/watch",
-"httpMethod": "POST",
-"description": "Watch for changes on all objects in a bucket.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the bucket in which to look for objects.",
- "required": true,
- "location": "path"
- },
- "delimiter": {
- "type": "string",
- "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.",
- "location": "query"
- },
- "endOffset": {
- "type": "string",
- "description": "Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).",
- "location": "query"
- },
- "includeTrailingDelimiter": {
- "type": "boolean",
- "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.",
- "location": "query"
- },
- "maxResults": {
- "type": "integer",
- "description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.",
- "default": "1000",
- "format": "uint32",
- "minimum": "0",
- "location": "query"
- },
- "pageToken": {
- "type": "string",
- "description": "A previously-returned page token representing part of the larger set of results to view.",
- "location": "query"
- },
- "prefix": {
- "type": "string",
- "description": "Filter results to objects whose names begin with this prefix.",
- "location": "query"
- },
- "projection": {
- "type": "string",
- "description": "Set of properties to return. Defaults to noAcl.",
- "enum": [
- "full",
- "noAcl"
- ],
- "enumDescriptions": [
- "Include all properties.",
- "Omit the owner, acl property."
- ],
- "location": "query"
- },
- "startOffset": {
- "type": "string",
- "description": "Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).",
- "location": "query"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- },
- "versions": {
- "type": "boolean",
- "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket"
-],
-"request": {
- "$ref": "Channel",
- "parameterName": "resource"
-},
-"response": {
- "$ref": "Channel"
-},
-"scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
-],
-"supportsSubscription": true
-},
-"restore": {
-"id": "storage.objects.restore",
-"path": "b/{bucket}/o/{object}/restore",
-"httpMethod": "POST",
-"description": "Restores a soft-deleted object.",
-"parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the bucket in which the object resides.",
- "required": true,
- "location": "path"
- },
- "generation": {
- "type": "string",
- "description": "Selects a specific revision of this object.",
- "required": true,
- "format": "int64",
- "location": "query"
- },
- "object": {
- "type": "string",
- "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- "required": true,
- "location": "path"
- },
- "ifGenerationMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the object's one live generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
- "format": "int64",
- "location": "query"
- },
- "ifGenerationNotMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether none of the object's live generations match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
- "format": "int64",
- "location": "query"
- },
- "ifMetagenerationMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether the object's one live metageneration matches the given value.",
- "format": "int64",
- "location": "query"
- },
- "ifMetagenerationNotMatch": {
- "type": "string",
- "description": "Makes the operation conditional on whether none of the object's live metagenerations match the given value.",
- "format": "int64",
- "location": "query"
- },
- "copySourceAcl": {
- "type": "boolean",
- "description": "If true, copies the source object's ACL; otherwise, uses the bucket's default object ACL. The default is false.",
- "location": "query"
- },
- "projection": {
- "type": "string",
- "description": "Set of properties to return. Defaults to full.",
- "enum": [
- "full",
- "noAcl"
- ],
- "enumDescriptions": [
- "Include all properties.",
- "Omit the owner, acl property."
- ],
- "location": "query"
- },
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query"
- }
-},
-"parameterOrder": [
- "bucket",
- "object",
- "generation"
- ],
- "response": {
- "$ref": "Object"
+ "managedFolders": {
+ "methods": {
+ "delete": {
+ "id": "storage.managedFolders.delete",
+ "path": "b/{bucket}/managedFolders/{managedFolder}",
+ "httpMethod": "DELETE",
+ "description": "Permanently deletes a managed folder.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the bucket containing the managed folder.",
+ "required": true,
+ "location": "path"
+ },
+ "managedFolder": {
+ "type": "string",
+ "description": "The managed folder name/path.",
+ "required": true,
+ "location": "path"
+ },
+ "ifMetagenerationMatch": {
+ "type": "string",
+ "description": "If set, only deletes the managed folder if its metageneration matches this value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifMetagenerationNotMatch": {
+ "type": "string",
+ "description": "If set, only deletes the managed folder if its metageneration does not match this value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "allowNonEmpty": {
+ "type": "boolean",
+ "description": "Allows the deletion of a managed folder even if it is not empty. A managed folder is empty if there are no objects or managed folders that it applies to. Callers must have storage.managedFolders.setIamPolicy permission.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "managedFolder"
+ ],
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "get": {
+ "id": "storage.managedFolders.get",
+ "path": "b/{bucket}/managedFolders/{managedFolder}",
+ "httpMethod": "GET",
+ "description": "Returns metadata of the specified managed folder.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the bucket containing the managed folder.",
+ "required": true,
+ "location": "path"
+ },
+ "managedFolder": {
+ "type": "string",
+ "description": "The managed folder name/path.",
+ "required": true,
+ "location": "path"
+ },
+ "ifMetagenerationMatch": {
+ "type": "string",
+ "description": "Makes the return of the managed folder metadata conditional on whether the managed folder's current metageneration matches the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifMetagenerationNotMatch": {
+ "type": "string",
+ "description": "Makes the return of the managed folder metadata conditional on whether the managed folder's current metageneration does not match the given value.",
+ "format": "int64",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "managedFolder"
+ ],
+ "response": {
+ "$ref": "ManagedFolder"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/cloud-platform.read-only",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_only",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "getIamPolicy": {
+ "id": "storage.managedFolders.getIamPolicy",
+ "path": "b/{bucket}/managedFolders/{managedFolder}/iam",
+ "httpMethod": "GET",
+ "description": "Returns an IAM policy for the specified managed folder.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the bucket containing the managed folder.",
+ "required": true,
+ "location": "path"
+ },
+ "optionsRequestedPolicyVersion": {
+ "type": "integer",
+ "description": "The IAM policy format version to be returned. If the optionsRequestedPolicyVersion is for an older version that doesn't support part of the requested IAM policy, the request fails.",
+ "format": "int32",
+ "minimum": "1",
+ "location": "query"
+ },
+ "managedFolder": {
+ "type": "string",
+ "description": "The managed folder name/path.",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "managedFolder"
+ ],
+ "response": {
+ "$ref": "Policy"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/cloud-platform.read-only",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_only",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "insert": {
+ "id": "storage.managedFolders.insert",
+ "path": "b/{bucket}/managedFolders",
+ "httpMethod": "POST",
+ "description": "Creates a new managed folder.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the bucket containing the managed folder.",
+ "required": true,
+ "location": "path"
+ }
+ },
+ "parameterOrder": [
+ "bucket"
+ ],
+ "request": {
+ "$ref": "ManagedFolder"
+ },
+ "response": {
+ "$ref": "ManagedFolder"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "list": {
+ "id": "storage.managedFolders.list",
+ "path": "b/{bucket}/managedFolders",
+ "httpMethod": "GET",
+ "description": "Lists managed folders in the given bucket.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the bucket containing the managed folder.",
+ "required": true,
+ "location": "path"
+ },
+ "pageSize": {
+ "type": "integer",
+ "description": "Maximum number of items to return in a single page of responses.",
+ "format": "int32",
+ "minimum": "0",
+ "location": "query"
+ },
+ "pageToken": {
+ "type": "string",
+ "description": "A previously-returned page token representing part of the larger set of results to view.",
+ "location": "query"
+ },
+ "prefix": {
+ "type": "string",
+ "description": "The managed folder name/path prefix to filter the output list of results.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket"
+ ],
+ "response": {
+ "$ref": "ManagedFolders"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/cloud-platform.read-only",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_only",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "setIamPolicy": {
+ "id": "storage.managedFolders.setIamPolicy",
+ "path": "b/{bucket}/managedFolders/{managedFolder}/iam",
+ "httpMethod": "PUT",
+ "description": "Updates an IAM policy for the specified managed folder.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the bucket containing the managed folder.",
+ "required": true,
+ "location": "path"
+ },
+ "managedFolder": {
+ "type": "string",
+ "description": "The managed folder name/path.",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "managedFolder"
+ ],
+ "request": {
+ "$ref": "Policy"
+ },
+ "response": {
+ "$ref": "Policy"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
+ },
+ "testIamPermissions": {
+ "id": "storage.managedFolders.testIamPermissions",
+ "path": "b/{bucket}/managedFolders/{managedFolder}/iam/testPermissions",
+ "httpMethod": "GET",
+ "description": "Tests a set of permissions on the given managed folder to see which, if any, are held by the caller.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the bucket containing the managed folder.",
+ "required": true,
+ "location": "path"
+ },
+ "managedFolder": {
+ "type": "string",
+ "description": "The managed folder name/path.",
+ "required": true,
+ "location": "path"
+ },
+ "permissions": {
+ "type": "string",
+ "description": "Permissions to test.",
+ "required": true,
+ "repeated": true,
+ "location": "query"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "managedFolder",
+ "permissions"
+ ],
+ "response": {
+ "$ref": "TestIamPermissionsResponse"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/cloud-platform.read-only",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_only",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ }
+ }
},
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
- ]
- },
- "bulkRestore": {
- "id": "storage.objects.bulkRestore",
- "path": "b/{bucket}/o/bulkRestore",
- "httpMethod": "POST",
- "description": "Initiates a long-running bulk restore operation on the specified bucket.",
- "parameters": {
- "bucket": {
- "type": "string",
- "description": "Name of the bucket in which the object resides.",
- "required": true,
- "location": "path"
+ "notifications": {
+ "methods": {
+ "delete": {
+ "id": "storage.notifications.delete",
+ "path": "b/{bucket}/notificationConfigs/{notification}",
+ "httpMethod": "DELETE",
+ "description": "Permanently deletes a notification subscription.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "The parent bucket of the notification.",
+ "required": true,
+ "location": "path"
+ },
+ "notification": {
+ "type": "string",
+ "description": "ID of the notification to delete.",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "notification"
+ ],
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "get": {
+ "id": "storage.notifications.get",
+ "path": "b/{bucket}/notificationConfigs/{notification}",
+ "httpMethod": "GET",
+ "description": "View a notification configuration.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "The parent bucket of the notification.",
+ "required": true,
+ "location": "path"
+ },
+ "notification": {
+ "type": "string",
+ "description": "Notification ID",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "notification"
+ ],
+ "response": {
+ "$ref": "Notification"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/cloud-platform.read-only",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_only",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "insert": {
+ "id": "storage.notifications.insert",
+ "path": "b/{bucket}/notificationConfigs",
+ "httpMethod": "POST",
+ "description": "Creates a notification subscription for a given bucket.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "The parent bucket of the notification.",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket"
+ ],
+ "request": {
+ "$ref": "Notification"
+ },
+ "response": {
+ "$ref": "Notification"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "list": {
+ "id": "storage.notifications.list",
+ "path": "b/{bucket}/notificationConfigs",
+ "httpMethod": "GET",
+ "description": "Retrieves a list of notification subscriptions for a given bucket.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of a Google Cloud Storage bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket"
+ ],
+ "response": {
+ "$ref": "Notifications"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/cloud-platform.read-only",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_only",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ }
+ }
+ },
+ "objectAccessControls": {
+ "methods": {
+ "delete": {
+ "id": "storage.objectAccessControls.delete",
+ "path": "b/{bucket}/o/{object}/acl/{entity}",
+ "httpMethod": "DELETE",
+ "description": "Permanently deletes the ACL entry for the specified entity on the specified object.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of a bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "entity": {
+ "type": "string",
+ "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
+ "required": true,
+ "location": "path"
+ },
+ "generation": {
+ "type": "string",
+ "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
+ "format": "int64",
+ "location": "query"
+ },
+ "object": {
+ "type": "string",
+ "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "object",
+ "entity"
+ ],
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
+ },
+ "get": {
+ "id": "storage.objectAccessControls.get",
+ "path": "b/{bucket}/o/{object}/acl/{entity}",
+ "httpMethod": "GET",
+ "description": "Returns the ACL entry for the specified entity on the specified object.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of a bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "entity": {
+ "type": "string",
+ "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
+ "required": true,
+ "location": "path"
+ },
+ "generation": {
+ "type": "string",
+ "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
+ "format": "int64",
+ "location": "query"
+ },
+ "object": {
+ "type": "string",
+ "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "object",
+ "entity"
+ ],
+ "response": {
+ "$ref": "ObjectAccessControl"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
+ },
+ "insert": {
+ "id": "storage.objectAccessControls.insert",
+ "path": "b/{bucket}/o/{object}/acl",
+ "httpMethod": "POST",
+ "description": "Creates a new ACL entry on the specified object.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of a bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "generation": {
+ "type": "string",
+ "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
+ "format": "int64",
+ "location": "query"
+ },
+ "object": {
+ "type": "string",
+ "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "object"
+ ],
+ "request": {
+ "$ref": "ObjectAccessControl"
+ },
+ "response": {
+ "$ref": "ObjectAccessControl"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
+ },
+ "list": {
+ "id": "storage.objectAccessControls.list",
+ "path": "b/{bucket}/o/{object}/acl",
+ "httpMethod": "GET",
+ "description": "Retrieves ACL entries on the specified object.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of a bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "generation": {
+ "type": "string",
+ "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
+ "format": "int64",
+ "location": "query"
+ },
+ "object": {
+ "type": "string",
+ "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "object"
+ ],
+ "response": {
+ "$ref": "ObjectAccessControls"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
+ },
+ "patch": {
+ "id": "storage.objectAccessControls.patch",
+ "path": "b/{bucket}/o/{object}/acl/{entity}",
+ "httpMethod": "PATCH",
+ "description": "Patches an ACL entry on the specified object.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of a bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "entity": {
+ "type": "string",
+ "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
+ "required": true,
+ "location": "path"
+ },
+ "generation": {
+ "type": "string",
+ "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
+ "format": "int64",
+ "location": "query"
+ },
+ "object": {
+ "type": "string",
+ "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "object",
+ "entity"
+ ],
+ "request": {
+ "$ref": "ObjectAccessControl"
+ },
+ "response": {
+ "$ref": "ObjectAccessControl"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
+ },
+ "update": {
+ "id": "storage.objectAccessControls.update",
+ "path": "b/{bucket}/o/{object}/acl/{entity}",
+ "httpMethod": "PUT",
+ "description": "Updates an ACL entry on the specified object.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of a bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "entity": {
+ "type": "string",
+ "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
+ "required": true,
+ "location": "path"
+ },
+ "generation": {
+ "type": "string",
+ "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
+ "format": "int64",
+ "location": "query"
+ },
+ "object": {
+ "type": "string",
+ "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "object",
+ "entity"
+ ],
+ "request": {
+ "$ref": "ObjectAccessControl"
+ },
+ "response": {
+ "$ref": "ObjectAccessControl"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
+ }
}
},
- "parameterOrder": [
- "bucket"
- ],
- "request": {
- "$ref": "BulkRestoreObjectsRequest"
- },
- "response": {
- "$ref": "GoogleLongrunningOperation"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- }
-}
-},
-"projects": {
-"resources": {
- "hmacKeys": {
- "methods": {
- "create": {
- "id": "storage.projects.hmacKeys.create",
- "path": "projects/{projectId}/hmacKeys",
- "httpMethod": "POST",
- "description": "Creates a new HMAC key for the specified service account.",
- "parameters": {
- "projectId": {
- "type": "string",
- "description": "Project ID owning the service account.",
- "required": true,
- "location": "path"
+ "objects": {
+ "methods": {
+ "compose": {
+ "id": "storage.objects.compose",
+ "path": "b/{destinationBucket}/o/{destinationObject}/compose",
+ "httpMethod": "POST",
+ "description": "Concatenates a list of existing objects into a new object in the same bucket.",
+ "parameters": {
+ "destinationBucket": {
+ "type": "string",
+ "description": "Name of the bucket containing the source objects. The destination object is stored in this bucket.",
+ "required": true,
+ "location": "path"
+ },
+ "destinationObject": {
+ "type": "string",
+ "description": "Name of the new object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
+ "required": true,
+ "location": "path"
+ },
+ "destinationPredefinedAcl": {
+ "type": "string",
+ "description": "Apply a predefined set of access controls to the destination object.",
+ "enum": [
+ "authenticatedRead",
+ "bucketOwnerFullControl",
+ "bucketOwnerRead",
+ "private",
+ "projectPrivate",
+ "publicRead"
+ ],
+ "enumDescriptions": [
+ "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
+ "Object owner gets OWNER access, and project team owners get OWNER access.",
+ "Object owner gets OWNER access, and project team owners get READER access.",
+ "Object owner gets OWNER access.",
+ "Object owner gets OWNER access, and project team members get access according to their roles.",
+ "Object owner gets OWNER access, and allUsers get READER access."
+ ],
+ "location": "query"
+ },
+ "ifGenerationMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifMetagenerationMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "kmsKeyName": {
+ "type": "string",
+ "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.",
+ "location": "query"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "destinationBucket",
+ "destinationObject"
+ ],
+ "request": {
+ "$ref": "ComposeRequest"
+ },
+ "response": {
+ "$ref": "Object"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "copy": {
+ "id": "storage.objects.copy",
+ "path": "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}",
+ "httpMethod": "POST",
+ "description": "Copies a source object to a destination object. Optionally overrides metadata.",
+ "parameters": {
+ "destinationBucket": {
+ "type": "string",
+ "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
+ "required": true,
+ "location": "path"
+ },
+ "destinationKmsKeyName": {
+ "type": "string",
+ "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.",
+ "location": "query"
+ },
+ "destinationObject": {
+ "type": "string",
+ "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.",
+ "required": true,
+ "location": "path"
+ },
+ "destinationPredefinedAcl": {
+ "type": "string",
+ "description": "Apply a predefined set of access controls to the destination object.",
+ "enum": [
+ "authenticatedRead",
+ "bucketOwnerFullControl",
+ "bucketOwnerRead",
+ "private",
+ "projectPrivate",
+ "publicRead"
+ ],
+ "enumDescriptions": [
+ "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
+ "Object owner gets OWNER access, and project team owners get OWNER access.",
+ "Object owner gets OWNER access, and project team owners get READER access.",
+ "Object owner gets OWNER access.",
+ "Object owner gets OWNER access, and project team members get access according to their roles.",
+ "Object owner gets OWNER access, and allUsers get READER access."
+ ],
+ "location": "query"
+ },
+ "ifGenerationMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the destination object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifGenerationNotMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the destination object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifMetagenerationMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifMetagenerationNotMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifSourceGenerationMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the source object's current generation matches the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifSourceGenerationNotMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifSourceMetagenerationMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifSourceMetagenerationNotMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "projection": {
+ "type": "string",
+ "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
+ "enum": [
+ "full",
+ "noAcl"
+ ],
+ "enumDescriptions": [
+ "Include all properties.",
+ "Omit the owner, acl property."
+ ],
+ "location": "query"
+ },
+ "sourceBucket": {
+ "type": "string",
+ "description": "Name of the bucket in which to find the source object.",
+ "required": true,
+ "location": "path"
+ },
+ "sourceGeneration": {
+ "type": "string",
+ "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).",
+ "format": "int64",
+ "location": "query"
+ },
+ "sourceObject": {
+ "type": "string",
+ "description": "Name of the source object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "sourceBucket",
+ "sourceObject",
+ "destinationBucket",
+ "destinationObject"
+ ],
+ "request": {
+ "$ref": "Object"
+ },
+ "response": {
+ "$ref": "Object"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "delete": {
+ "id": "storage.objects.delete",
+ "path": "b/{bucket}/o/{object}",
+ "httpMethod": "DELETE",
+ "description": "Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the bucket in which the object resides.",
+ "required": true,
+ "location": "path"
+ },
+ "generation": {
+ "type": "string",
+ "description": "If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default).",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifGenerationMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifGenerationNotMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifMetagenerationMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifMetagenerationNotMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "object": {
+ "type": "string",
+ "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "object"
+ ],
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "get": {
+ "id": "storage.objects.get",
+ "path": "b/{bucket}/o/{object}",
+ "httpMethod": "GET",
+ "description": "Retrieves an object or its metadata.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the bucket in which the object resides.",
+ "required": true,
+ "location": "path"
+ },
+ "generation": {
+ "type": "string",
+ "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifGenerationMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifGenerationNotMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifMetagenerationMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifMetagenerationNotMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "object": {
+ "type": "string",
+ "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
+ "required": true,
+ "location": "path"
+ },
+ "projection": {
+ "type": "string",
+ "description": "Set of properties to return. Defaults to noAcl.",
+ "enum": [
+ "full",
+ "noAcl"
+ ],
+ "enumDescriptions": [
+ "Include all properties.",
+ "Omit the owner, acl property."
+ ],
+ "location": "query"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ },
+ "softDeleted": {
+ "type": "boolean",
+ "description": "If true, only soft-deleted object versions will be listed. The default is false. For more information, see Soft Delete.",
+ "location": "query"
+ },
+ "restoreToken": {
+ "type": "string",
+ "description": "If you have enabled hierarchical namespace on your bucket and are working with soft-deleted objects, the restoreToken, a universally unique identifier (UUID), along with the object's name and generation value, uniquely identifies the object.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "object"
+ ],
+ "response": {
+ "$ref": "Object"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/cloud-platform.read-only",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_only",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ],
+ "supportsMediaDownload": true,
+ "useMediaDownloadService": true
+ },
+ "getIamPolicy": {
+ "id": "storage.objects.getIamPolicy",
+ "path": "b/{bucket}/o/{object}/iam",
+ "httpMethod": "GET",
+ "description": "Returns an IAM policy for the specified object.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the bucket in which the object resides.",
+ "required": true,
+ "location": "path"
+ },
+ "generation": {
+ "type": "string",
+ "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
+ "format": "int64",
+ "location": "query"
+ },
+ "object": {
+ "type": "string",
+ "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "object"
+ ],
+ "response": {
+ "$ref": "Policy"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/cloud-platform.read-only",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_only",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "insert": {
+ "id": "storage.objects.insert",
+ "path": "b/{bucket}/o",
+ "httpMethod": "POST",
+ "description": "Stores a new object and metadata.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.",
+ "required": true,
+ "location": "path"
+ },
+ "contentEncoding": {
+ "type": "string",
+ "description": "If set, sets the contentEncoding property of the final object to this value. Setting this parameter is equivalent to setting the contentEncoding metadata property. This can be useful when uploading an object with uploadType=media to indicate the encoding of the content being uploaded.",
+ "location": "query"
+ },
+ "ifGenerationMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifGenerationNotMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifMetagenerationMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifMetagenerationNotMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "kmsKeyName": {
+ "type": "string",
+ "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.",
+ "location": "query"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
+ "location": "query"
+ },
+ "predefinedAcl": {
+ "type": "string",
+ "description": "Apply a predefined set of access controls to this object.",
+ "enum": [
+ "authenticatedRead",
+ "bucketOwnerFullControl",
+ "bucketOwnerRead",
+ "private",
+ "projectPrivate",
+ "publicRead"
+ ],
+ "enumDescriptions": [
+ "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
+ "Object owner gets OWNER access, and project team owners get OWNER access.",
+ "Object owner gets OWNER access, and project team owners get READER access.",
+ "Object owner gets OWNER access.",
+ "Object owner gets OWNER access, and project team members get access according to their roles.",
+ "Object owner gets OWNER access, and allUsers get READER access."
+ ],
+ "location": "query"
+ },
+ "projection": {
+ "type": "string",
+ "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
+ "enum": [
+ "full",
+ "noAcl"
+ ],
+ "enumDescriptions": [
+ "Include all properties.",
+ "Omit the owner, acl property."
+ ],
+ "location": "query"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket"
+ ],
+ "request": {
+ "$ref": "Object"
+ },
+ "response": {
+ "$ref": "Object"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ],
+ "supportsMediaUpload": true,
+ "mediaUpload": {
+ "accept": [
+ "*/*"
+ ],
+ "protocols": {
+ "simple": {
+ "multipart": true,
+ "path": "/upload/storage/v1/b/{bucket}/o"
+ },
+ "resumable": {
+ "multipart": true,
+ "path": "/resumable/upload/storage/v1/b/{bucket}/o"
+ }
+ }
+ }
+ },
+ "list": {
+ "id": "storage.objects.list",
+ "path": "b/{bucket}/o",
+ "httpMethod": "GET",
+ "description": "Retrieves a list of objects matching the criteria.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the bucket in which to look for objects.",
+ "required": true,
+ "location": "path"
+ },
+ "delimiter": {
+ "type": "string",
+ "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.",
+ "location": "query"
+ },
+ "endOffset": {
+ "type": "string",
+ "description": "Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).",
+ "location": "query"
+ },
+ "includeTrailingDelimiter": {
+ "type": "boolean",
+ "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.",
+ "location": "query"
+ },
+ "maxResults": {
+ "type": "integer",
+ "description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.",
+ "default": "1000",
+ "format": "uint32",
+ "minimum": "0",
+ "location": "query"
+ },
+ "pageToken": {
+ "type": "string",
+ "description": "A previously-returned page token representing part of the larger set of results to view.",
+ "location": "query"
+ },
+ "prefix": {
+ "type": "string",
+ "description": "Filter results to objects whose names begin with this prefix.",
+ "location": "query"
+ },
+ "projection": {
+ "type": "string",
+ "description": "Set of properties to return. Defaults to noAcl.",
+ "enum": [
+ "full",
+ "noAcl"
+ ],
+ "enumDescriptions": [
+ "Include all properties.",
+ "Omit the owner, acl property."
+ ],
+ "location": "query"
+ },
+ "startOffset": {
+ "type": "string",
+ "description": "Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).",
+ "location": "query"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ },
+ "versions": {
+ "type": "boolean",
+ "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.",
+ "location": "query"
+ },
+ "matchGlob": {
+ "type": "string",
+ "description": "Filter results to objects and prefixes that match this glob pattern.",
+ "location": "query"
+ },
+ "softDeleted": {
+ "type": "boolean",
+ "description": "If true, only soft-deleted object versions will be listed. The default is false. For more information, see Soft Delete.",
+ "location": "query"
+ },
+ "includeFoldersAsPrefixes": {
+ "type": "boolean",
+ "description": "Only applicable if delimiter is set to '/'. If true, will also include folders and managed folders (besides objects) in the returned prefixes.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket"
+ ],
+ "response": {
+ "$ref": "Objects"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/cloud-platform.read-only",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_only",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ],
+ "supportsSubscription": true
+ },
+ "patch": {
+ "id": "storage.objects.patch",
+ "path": "b/{bucket}/o/{object}",
+ "httpMethod": "PATCH",
+ "description": "Patches an object's metadata.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the bucket in which the object resides.",
+ "required": true,
+ "location": "path"
+ },
+ "generation": {
+ "type": "string",
+ "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifGenerationMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifGenerationNotMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifMetagenerationMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifMetagenerationNotMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "overrideUnlockedRetention": {
+ "type": "boolean",
+ "description": "Must be true to remove the retention configuration, reduce its unlocked retention period, or change its mode from unlocked to locked.",
+ "location": "query"
+ },
+ "object": {
+ "type": "string",
+ "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
+ "required": true,
+ "location": "path"
+ },
+ "predefinedAcl": {
+ "type": "string",
+ "description": "Apply a predefined set of access controls to this object.",
+ "enum": [
+ "authenticatedRead",
+ "bucketOwnerFullControl",
+ "bucketOwnerRead",
+ "private",
+ "projectPrivate",
+ "publicRead"
+ ],
+ "enumDescriptions": [
+ "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
+ "Object owner gets OWNER access, and project team owners get OWNER access.",
+ "Object owner gets OWNER access, and project team owners get READER access.",
+ "Object owner gets OWNER access.",
+ "Object owner gets OWNER access, and project team members get access according to their roles.",
+ "Object owner gets OWNER access, and allUsers get READER access."
+ ],
+ "location": "query"
+ },
+ "projection": {
+ "type": "string",
+ "description": "Set of properties to return. Defaults to full.",
+ "enum": [
+ "full",
+ "noAcl"
+ ],
+ "enumDescriptions": [
+ "Include all properties.",
+ "Omit the owner, acl property."
+ ],
+ "location": "query"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request, for Requester Pays buckets.",
+ "location": "query"
+ }
},
- "serviceAccountEmail": {
- "type": "string",
- "description": "Email address of the service account.",
- "required": true,
- "location": "query"
+ "parameterOrder": [
+ "bucket",
+ "object"
+ ],
+ "request": {
+ "$ref": "Object"
},
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request.",
- "location": "query"
- }
- },
- "parameterOrder": [
- "projectId",
- "serviceAccountEmail"
- ],
- "response": {
- "$ref": "HmacKey"
+ "response": {
+ "$ref": "Object"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
},
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
- ]
- },
- "delete": {
- "id": "storage.projects.hmacKeys.delete",
- "path": "projects/{projectId}/hmacKeys/{accessId}",
- "httpMethod": "DELETE",
- "description": "Deletes an HMAC key.",
- "parameters": {
- "accessId": {
- "type": "string",
- "description": "Name of the HMAC key to be deleted.",
- "required": true,
- "location": "path"
+ "rewrite": {
+ "id": "storage.objects.rewrite",
+ "path": "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}",
+ "httpMethod": "POST",
+ "description": "Rewrites a source object to a destination object. Optionally overrides metadata.",
+ "parameters": {
+ "destinationBucket": {
+ "type": "string",
+ "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.",
+ "required": true,
+ "location": "path"
+ },
+ "destinationKmsKeyName": {
+ "type": "string",
+ "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.",
+ "location": "query"
+ },
+ "destinationObject": {
+ "type": "string",
+ "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
+ "required": true,
+ "location": "path"
+ },
+ "destinationPredefinedAcl": {
+ "type": "string",
+ "description": "Apply a predefined set of access controls to the destination object.",
+ "enum": [
+ "authenticatedRead",
+ "bucketOwnerFullControl",
+ "bucketOwnerRead",
+ "private",
+ "projectPrivate",
+ "publicRead"
+ ],
+ "enumDescriptions": [
+ "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
+ "Object owner gets OWNER access, and project team owners get OWNER access.",
+ "Object owner gets OWNER access, and project team owners get READER access.",
+ "Object owner gets OWNER access.",
+ "Object owner gets OWNER access, and project team members get access according to their roles.",
+ "Object owner gets OWNER access, and allUsers get READER access."
+ ],
+ "location": "query"
+ },
+ "ifGenerationMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifGenerationNotMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifMetagenerationMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifMetagenerationNotMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifSourceGenerationMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the source object's current generation matches the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifSourceGenerationNotMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifSourceMetagenerationMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifSourceMetagenerationNotMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "maxBytesRewrittenPerCall": {
+ "type": "string",
+ "description": "The maximum number of bytes that will be rewritten per rewrite request. Most callers shouldn't need to specify this parameter - it is primarily in place to support testing. If specified the value must be an integral multiple of 1 MiB (1048576). Also, this only applies to requests where the source and destination span locations and/or storage classes. Finally, this value must not change across rewrite calls else you'll get an error that the rewriteToken is invalid.",
+ "format": "int64",
+ "location": "query"
+ },
+ "projection": {
+ "type": "string",
+ "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
+ "enum": [
+ "full",
+ "noAcl"
+ ],
+ "enumDescriptions": [
+ "Include all properties.",
+ "Omit the owner, acl property."
+ ],
+ "location": "query"
+ },
+ "rewriteToken": {
+ "type": "string",
+ "description": "Include this field (from the previous rewrite response) on each rewrite request after the first one, until the rewrite response 'done' flag is true. Calls that provide a rewriteToken can omit all other request fields, but if included those fields must match the values provided in the first rewrite request.",
+ "location": "query"
+ },
+ "sourceBucket": {
+ "type": "string",
+ "description": "Name of the bucket in which to find the source object.",
+ "required": true,
+ "location": "path"
+ },
+ "sourceGeneration": {
+ "type": "string",
+ "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).",
+ "format": "int64",
+ "location": "query"
+ },
+ "sourceObject": {
+ "type": "string",
+ "description": "Name of the source object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
},
- "projectId": {
- "type": "string",
- "description": "Project ID owning the requested key",
- "required": true,
- "location": "path"
+ "parameterOrder": [
+ "sourceBucket",
+ "sourceObject",
+ "destinationBucket",
+ "destinationObject"
+ ],
+ "request": {
+ "$ref": "Object"
},
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request.",
- "location": "query"
- }
+ "response": {
+ "$ref": "RewriteResponse"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
},
- "parameterOrder": [
- "projectId",
- "accessId"
- ],
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- },
- "get": {
- "id": "storage.projects.hmacKeys.get",
- "path": "projects/{projectId}/hmacKeys/{accessId}",
- "httpMethod": "GET",
- "description": "Retrieves an HMAC key's metadata",
- "parameters": {
- "accessId": {
- "type": "string",
- "description": "Name of the HMAC key.",
- "required": true,
- "location": "path"
+ "setIamPolicy": {
+ "id": "storage.objects.setIamPolicy",
+ "path": "b/{bucket}/o/{object}/iam",
+ "httpMethod": "PUT",
+ "description": "Updates an IAM policy for the specified object.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the bucket in which the object resides.",
+ "required": true,
+ "location": "path"
+ },
+ "generation": {
+ "type": "string",
+ "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
+ "format": "int64",
+ "location": "query"
+ },
+ "object": {
+ "type": "string",
+ "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
},
- "projectId": {
- "type": "string",
- "description": "Project ID owning the service account of the requested key.",
- "required": true,
- "location": "path"
+ "parameterOrder": [
+ "bucket",
+ "object"
+ ],
+ "request": {
+ "$ref": "Policy"
},
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request.",
- "location": "query"
- }
+ "response": {
+ "$ref": "Policy"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
},
- "parameterOrder": [
- "projectId",
- "accessId"
- ],
- "response": {
- "$ref": "HmacKeyMetadata"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only"
- ]
- },
- "list": {
- "id": "storage.projects.hmacKeys.list",
- "path": "projects/{projectId}/hmacKeys",
- "httpMethod": "GET",
- "description": "Retrieves a list of HMAC keys matching the criteria.",
- "parameters": {
- "maxResults": {
- "type": "integer",
- "description": "Maximum number of items to return in a single page of responses. The service uses this parameter or 250 items, whichever is smaller. The max number of items per page will also be limited by the number of distinct service accounts in the response. If the number of service accounts in a single response is too high, the page will truncated and a next page token will be returned.",
- "default": "250",
- "format": "uint32",
- "minimum": "0",
- "location": "query"
- },
- "pageToken": {
- "type": "string",
- "description": "A previously-returned page token representing part of the larger set of results to view.",
- "location": "query"
+ "testIamPermissions": {
+ "id": "storage.objects.testIamPermissions",
+ "path": "b/{bucket}/o/{object}/iam/testPermissions",
+ "httpMethod": "GET",
+ "description": "Tests a set of permissions on the given object to see which, if any, are held by the caller.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the bucket in which the object resides.",
+ "required": true,
+ "location": "path"
+ },
+ "generation": {
+ "type": "string",
+ "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
+ "format": "int64",
+ "location": "query"
+ },
+ "object": {
+ "type": "string",
+ "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
+ "required": true,
+ "location": "path"
+ },
+ "permissions": {
+ "type": "string",
+ "description": "Permissions to test.",
+ "required": true,
+ "repeated": true,
+ "location": "query"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
},
- "projectId": {
- "type": "string",
- "description": "Name of the project in which to look for HMAC keys.",
- "required": true,
- "location": "path"
+ "parameterOrder": [
+ "bucket",
+ "object",
+ "permissions"
+ ],
+ "response": {
+ "$ref": "TestIamPermissionsResponse"
},
- "serviceAccountEmail": {
- "type": "string",
- "description": "If present, only keys for the given service account are returned.",
- "location": "query"
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/cloud-platform.read-only",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_only",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "update": {
+ "id": "storage.objects.update",
+ "path": "b/{bucket}/o/{object}",
+ "httpMethod": "PUT",
+ "description": "Updates an object's metadata.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the bucket in which the object resides.",
+ "required": true,
+ "location": "path"
+ },
+ "generation": {
+ "type": "string",
+ "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifGenerationMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifGenerationNotMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifMetagenerationMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifMetagenerationNotMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "overrideUnlockedRetention": {
+ "type": "boolean",
+ "description": "Must be true to remove the retention configuration, reduce its unlocked retention period, or change its mode from unlocked to locked.",
+ "location": "query"
+ },
+ "object": {
+ "type": "string",
+ "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).",
+ "required": true,
+ "location": "path"
+ },
+ "predefinedAcl": {
+ "type": "string",
+ "description": "Apply a predefined set of access controls to this object.",
+ "enum": [
+ "authenticatedRead",
+ "bucketOwnerFullControl",
+ "bucketOwnerRead",
+ "private",
+ "projectPrivate",
+ "publicRead"
+ ],
+ "enumDescriptions": [
+ "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
+ "Object owner gets OWNER access, and project team owners get OWNER access.",
+ "Object owner gets OWNER access, and project team owners get READER access.",
+ "Object owner gets OWNER access.",
+ "Object owner gets OWNER access, and project team members get access according to their roles.",
+ "Object owner gets OWNER access, and allUsers get READER access."
+ ],
+ "location": "query"
+ },
+ "projection": {
+ "type": "string",
+ "description": "Set of properties to return. Defaults to full.",
+ "enum": [
+ "full",
+ "noAcl"
+ ],
+ "enumDescriptions": [
+ "Include all properties.",
+ "Omit the owner, acl property."
+ ],
+ "location": "query"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ }
},
- "showDeletedKeys": {
- "type": "boolean",
- "description": "Whether or not to show keys in the DELETED state.",
- "location": "query"
+ "parameterOrder": [
+ "bucket",
+ "object"
+ ],
+ "request": {
+ "$ref": "Object"
},
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request.",
- "location": "query"
- }
+ "response": {
+ "$ref": "Object"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
},
- "parameterOrder": [
- "projectId"
- ],
- "response": {
- "$ref": "HmacKeysMetadata"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only"
- ]
- },
- "update": {
- "id": "storage.projects.hmacKeys.update",
- "path": "projects/{projectId}/hmacKeys/{accessId}",
- "httpMethod": "PUT",
- "description": "Updates the state of an HMAC key. See the HMAC Key resource descriptor for valid states.",
- "parameters": {
- "accessId": {
- "type": "string",
- "description": "Name of the HMAC key being updated.",
- "required": true,
- "location": "path"
+ "watchAll": {
+ "id": "storage.objects.watchAll",
+ "path": "b/{bucket}/o/watch",
+ "httpMethod": "POST",
+ "description": "Watch for changes on all objects in a bucket.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the bucket in which to look for objects.",
+ "required": true,
+ "location": "path"
+ },
+ "delimiter": {
+ "type": "string",
+ "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.",
+ "location": "query"
+ },
+ "endOffset": {
+ "type": "string",
+ "description": "Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).",
+ "location": "query"
+ },
+ "includeTrailingDelimiter": {
+ "type": "boolean",
+ "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.",
+ "location": "query"
+ },
+ "maxResults": {
+ "type": "integer",
+ "description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.",
+ "default": "1000",
+ "format": "uint32",
+ "minimum": "0",
+ "location": "query"
+ },
+ "pageToken": {
+ "type": "string",
+ "description": "A previously-returned page token representing part of the larger set of results to view.",
+ "location": "query"
+ },
+ "prefix": {
+ "type": "string",
+ "description": "Filter results to objects whose names begin with this prefix.",
+ "location": "query"
+ },
+ "projection": {
+ "type": "string",
+ "description": "Set of properties to return. Defaults to noAcl.",
+ "enum": [
+ "full",
+ "noAcl"
+ ],
+ "enumDescriptions": [
+ "Include all properties.",
+ "Omit the owner, acl property."
+ ],
+ "location": "query"
+ },
+ "startOffset": {
+ "type": "string",
+ "description": "Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).",
+ "location": "query"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ },
+ "versions": {
+ "type": "boolean",
+ "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.",
+ "location": "query"
+ }
},
- "projectId": {
- "type": "string",
- "description": "Project ID owning the service account of the updated key.",
- "required": true,
- "location": "path"
+ "parameterOrder": [
+ "bucket"
+ ],
+ "request": {
+ "$ref": "Channel",
+ "parameterName": "resource"
},
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request.",
- "location": "query"
- }
- },
- "parameterOrder": [
- "projectId",
- "accessId"
- ],
- "request": {
- "$ref": "HmacKeyMetadata"
+ "response": {
+ "$ref": "Channel"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/cloud-platform.read-only",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_only",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ],
+ "supportsSubscription": true
},
- "response": {
- "$ref": "HmacKeyMetadata"
+ "restore": {
+ "id": "storage.objects.restore",
+ "path": "b/{bucket}/o/{object}/restore",
+ "httpMethod": "POST",
+ "description": "Restores a soft-deleted object.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the bucket in which the object resides.",
+ "required": true,
+ "location": "path"
+ },
+ "generation": {
+ "type": "string",
+ "description": "Selects a specific revision of this object.",
+ "required": true,
+ "format": "int64",
+ "location": "query"
+ },
+ "object": {
+ "type": "string",
+ "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
+ "required": true,
+ "location": "path"
+ },
+ "ifGenerationMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the object's one live generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifGenerationNotMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether none of the object's live generations match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifMetagenerationMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether the object's one live metageneration matches the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "ifMetagenerationNotMatch": {
+ "type": "string",
+ "description": "Makes the operation conditional on whether none of the object's live metagenerations match the given value.",
+ "format": "int64",
+ "location": "query"
+ },
+ "copySourceAcl": {
+ "type": "boolean",
+ "description": "If true, copies the source object's ACL; otherwise, uses the bucket's default object ACL. The default is false.",
+ "location": "query"
+ },
+ "projection": {
+ "type": "string",
+ "description": "Set of properties to return. Defaults to full.",
+ "enum": [
+ "full",
+ "noAcl"
+ ],
+ "enumDescriptions": [
+ "Include all properties.",
+ "Omit the owner, acl property."
+ ],
+ "location": "query"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ "location": "query"
+ },
+ "restoreToken": {
+ "type": "string",
+ "description": "The restoreToken is required to restore a soft-deleted object only if its name and generation value do not uniquely identify it.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "bucket",
+ "object",
+ "generation"
+ ],
+ "response": {
+ "$ref": "Object"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
},
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
- ]
- }
- }
- },
- "serviceAccount": {
- "methods": {
- "get": {
- "id": "storage.projects.serviceAccount.get",
- "path": "projects/{projectId}/serviceAccount",
- "httpMethod": "GET",
- "description": "Get the email address of this project's Google Cloud Storage service account.",
- "parameters": {
- "projectId": {
- "type": "string",
- "description": "Project ID",
- "required": true,
- "location": "path"
+ "bulkRestore": {
+ "id": "storage.objects.bulkRestore",
+ "path": "b/{bucket}/o/bulkRestore",
+ "httpMethod": "POST",
+ "description": "Initiates a long-running bulk restore operation on the specified bucket.",
+ "parameters": {
+ "bucket": {
+ "type": "string",
+ "description": "Name of the bucket in which the object resides.",
+ "required": true,
+ "location": "path"
+ }
},
- "userProject": {
- "type": "string",
- "description": "The project to be billed for this request.",
- "location": "query"
+ "parameterOrder": [
+ "bucket"
+ ],
+ "request": {
+ "$ref": "BulkRestoreObjectsRequest"
+ },
+ "response": {
+ "$ref": "GoogleLongrunningOperation"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ }
+ }
+ },
+ "projects": {
+ "resources": {
+ "hmacKeys": {
+ "methods": {
+ "create": {
+ "id": "storage.projects.hmacKeys.create",
+ "path": "projects/{projectId}/hmacKeys",
+ "httpMethod": "POST",
+ "description": "Creates a new HMAC key for the specified service account.",
+ "parameters": {
+ "projectId": {
+ "type": "string",
+ "description": "Project ID owning the service account.",
+ "required": true,
+ "location": "path"
+ },
+ "serviceAccountEmail": {
+ "type": "string",
+ "description": "Email address of the service account.",
+ "required": true,
+ "location": "query"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "projectId",
+ "serviceAccountEmail"
+ ],
+ "response": {
+ "$ref": "HmacKey"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
+ },
+ "delete": {
+ "id": "storage.projects.hmacKeys.delete",
+ "path": "projects/{projectId}/hmacKeys/{accessId}",
+ "httpMethod": "DELETE",
+ "description": "Deletes an HMAC key.",
+ "parameters": {
+ "accessId": {
+ "type": "string",
+ "description": "Name of the HMAC key to be deleted.",
+ "required": true,
+ "location": "path"
+ },
+ "projectId": {
+ "type": "string",
+ "description": "Project ID owning the requested key",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "projectId",
+ "accessId"
+ ],
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ },
+ "get": {
+ "id": "storage.projects.hmacKeys.get",
+ "path": "projects/{projectId}/hmacKeys/{accessId}",
+ "httpMethod": "GET",
+ "description": "Retrieves an HMAC key's metadata",
+ "parameters": {
+ "accessId": {
+ "type": "string",
+ "description": "Name of the HMAC key.",
+ "required": true,
+ "location": "path"
+ },
+ "projectId": {
+ "type": "string",
+ "description": "Project ID owning the service account of the requested key.",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "projectId",
+ "accessId"
+ ],
+ "response": {
+ "$ref": "HmacKeyMetadata"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/cloud-platform.read-only",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_only"
+ ]
+ },
+ "list": {
+ "id": "storage.projects.hmacKeys.list",
+ "path": "projects/{projectId}/hmacKeys",
+ "httpMethod": "GET",
+ "description": "Retrieves a list of HMAC keys matching the criteria.",
+ "parameters": {
+ "maxResults": {
+ "type": "integer",
+ "description": "Maximum number of items to return in a single page of responses. The service uses this parameter or 250 items, whichever is smaller. The max number of items per page will also be limited by the number of distinct service accounts in the response. If the number of service accounts in a single response is too high, the page will truncated and a next page token will be returned.",
+ "default": "250",
+ "format": "uint32",
+ "minimum": "0",
+ "location": "query"
+ },
+ "pageToken": {
+ "type": "string",
+ "description": "A previously-returned page token representing part of the larger set of results to view.",
+ "location": "query"
+ },
+ "projectId": {
+ "type": "string",
+ "description": "Name of the project in which to look for HMAC keys.",
+ "required": true,
+ "location": "path"
+ },
+ "serviceAccountEmail": {
+ "type": "string",
+ "description": "If present, only keys for the given service account are returned.",
+ "location": "query"
+ },
+ "showDeletedKeys": {
+ "type": "boolean",
+ "description": "Whether or not to show keys in the DELETED state.",
+ "location": "query"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "projectId"
+ ],
+ "response": {
+ "$ref": "HmacKeysMetadata"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/cloud-platform.read-only",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_only"
+ ]
+ },
+ "update": {
+ "id": "storage.projects.hmacKeys.update",
+ "path": "projects/{projectId}/hmacKeys/{accessId}",
+ "httpMethod": "PUT",
+ "description": "Updates the state of an HMAC key. See the HMAC Key resource descriptor for valid states.",
+ "parameters": {
+ "accessId": {
+ "type": "string",
+ "description": "Name of the HMAC key being updated.",
+ "required": true,
+ "location": "path"
+ },
+ "projectId": {
+ "type": "string",
+ "description": "Project ID owning the service account of the updated key.",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "projectId",
+ "accessId"
+ ],
+ "request": {
+ "$ref": "HmacKeyMetadata"
+ },
+ "response": {
+ "$ref": "HmacKeyMetadata"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/devstorage.full_control"
+ ]
+ }
}
},
- "parameterOrder": [
- "projectId"
- ],
- "response": {
- "$ref": "ServiceAccount"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
+ "serviceAccount": {
+ "methods": {
+ "get": {
+ "id": "storage.projects.serviceAccount.get",
+ "path": "projects/{projectId}/serviceAccount",
+ "httpMethod": "GET",
+ "description": "Get the email address of this project's Google Cloud Storage service account.",
+ "parameters": {
+ "projectId": {
+ "type": "string",
+ "description": "Project ID",
+ "required": true,
+ "location": "path"
+ },
+ "userProject": {
+ "type": "string",
+ "description": "The project to be billed for this request.",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [
+ "projectId"
+ ],
+ "response": {
+ "$ref": "ServiceAccount"
+ },
+ "scopes": [
+ "https://www.googleapis.com/auth/cloud-platform",
+ "https://www.googleapis.com/auth/cloud-platform.read-only",
+ "https://www.googleapis.com/auth/devstorage.full_control",
+ "https://www.googleapis.com/auth/devstorage.read_only",
+ "https://www.googleapis.com/auth/devstorage.read_write"
+ ]
+ }
+ }
+ }
}
}
- }
-}
-}
-},
+ },
"revision": "20240501",
"etag": "\"3135313638313632393935373531333737363832\""
}
diff --git a/lib/Google/vendor/google/cloud-storage/src/EncryptionTrait.php b/lib/Google/vendor/google/cloud-storage/src/EncryptionTrait.php
index 43d66eb80..d57c371cb 100644
--- a/lib/Google/vendor/google/cloud-storage/src/EncryptionTrait.php
+++ b/lib/Google/vendor/google/cloud-storage/src/EncryptionTrait.php
@@ -133,7 +133,7 @@ protected function signString($privateKey, $data, $forceOpenssl = false)
$signature = $rsa->sign($data);
} elseif (class_exists(RSA2::class) && !$forceOpenssl) {
- $rsa = new RSA2;
+ $rsa = new RSA2();
$rsa->loadKey($privateKey);
$rsa->setSignatureMode(RSA2::SIGNATURE_PKCS1);
$rsa->setHash('sha256');
diff --git a/lib/Google/vendor/google/cloud-storage/src/ReadStream.php b/lib/Google/vendor/google/cloud-storage/src/ReadStream.php
index cfae74d8e..eddbacf89 100644
--- a/lib/Google/vendor/google/cloud-storage/src/ReadStream.php
+++ b/lib/Google/vendor/google/cloud-storage/src/ReadStream.php
@@ -61,7 +61,7 @@ public function getSize(): ?int
private function getSizeFromMetadata(): int
{
foreach ($this->stream->getMetadata('wrapper_data') as $value) {
- if (substr($value, 0, 15) == "Content-Length:") {
+ if (substr($value, 0, 15) == 'Content-Length:') {
return (int) substr($value, 16);
}
}
diff --git a/lib/Google/vendor/google/cloud-storage/src/SigningHelper.php b/lib/Google/vendor/google/cloud-storage/src/SigningHelper.php
index bf48ab81f..41acfbaf9 100644
--- a/lib/Google/vendor/google/cloud-storage/src/SigningHelper.php
+++ b/lib/Google/vendor/google/cloud-storage/src/SigningHelper.php
@@ -20,9 +20,11 @@
use Google\Auth\CredentialsLoader;
use Google\Auth\SignBlobInterface;
use Google\Cloud\Core\ArrayTrait;
+use Google\Cloud\Core\Exception\ServiceException;
use Google\Cloud\Core\JsonTrait;
use Google\Cloud\Core\Timestamp;
use Google\Cloud\Storage\Connection\ConnectionInterface;
+use Google\Cloud\Storage\Connection\RetryTrait;
/**
* Provides common methods for signing storage URLs.
@@ -33,6 +35,7 @@ class SigningHelper
{
use ArrayTrait;
use JsonTrait;
+ use RetryTrait;
const DEFAULT_URL_SIGNING_VERSION = 'v2';
const DEFAULT_DOWNLOAD_HOST = 'storage.googleapis.com';
@@ -40,6 +43,7 @@ class SigningHelper
const V4_ALGO_NAME = 'GOOG4-RSA-SHA256';
const V4_TIMESTAMP_FORMAT = 'Ymd\THis\Z';
const V4_DATESTAMP_FORMAT = 'Ymd';
+ const MAX_RETRIES = 5;
/**
* Create or fetch a SigningHelper instance.
@@ -50,7 +54,7 @@ public static function getHelper()
{
static $helper;
if (!$helper) {
- $helper = new static;
+ $helper = new static();
}
return $helper;
@@ -169,7 +173,7 @@ public function v2Sign(ConnectionInterface $connection, $expires, $resource, $ge
$signedHeaders = [];
foreach ($headers as $name => $value) {
- $signedHeaders[] = $name .':'. $value;
+ $signedHeaders[] = $name . ':' . $value;
}
// Push the headers onto the end of the signing string.
@@ -181,9 +185,10 @@ public function v2Sign(ConnectionInterface $connection, $expires, $resource, $ge
$stringToSign = $this->createV2CanonicalRequest($toSign);
- $signature = $credentials->signBlob($stringToSign, [
+ // Use exponential backOff
+ $signature = $this->retrySignBlob(fn () => $credentials->signBlob($stringToSign, [
'forceOpenssl' => $options['forceOpenssl']
- ]);
+ ]));
// Start with user-provided query params and add required parameters.
$params = $options['queryParams'];
@@ -337,9 +342,11 @@ public function v4Sign(ConnectionInterface $connection, $expires, $resource, $ge
$requestHash
]);
- $signature = bin2hex(base64_decode($credentials->signBlob($stringToSign, [
- 'forceOpenssl' => $options['forceOpenssl']
- ])));
+ $signature = bin2hex(base64_decode($this->retrySignBlob(
+ fn () => $credentials->signBlob($stringToSign, [
+ 'forceOpenssl' => $options['forceOpenssl']
+ ])
+ )));
// Construct the modified resource name. If a custom hostname is provided,
// this will remove the bucket name from the resource.
@@ -882,4 +889,33 @@ private function buildQueryString(array $input)
return implode('&', $q);
}
+
+ /**
+ * Retry logic for signBlob
+ *
+ * @param callable $signBlobFn A callable that perform the actual signBlob operation.
+ * @param string $resourceName The resource name for logging or retry strategy determination.
+ * @param array $args Arguments for the operations, include preconditions
+ * @return string The signature genarated by signBlob.
+ * @throws ServiceException If non-retryable error occur.
+ * @throws \RuntimeException If retries are exhausted.
+ */
+ private function retrySignBlob(callable $signBlobFn, string $resourceName = 'signBlob', array $args = [])
+ {
+ $attempt = 0;
+ // Generate a retry decider function using the RetryTrait logic.
+ $retryDecider = $this->getRestRetryFunction($resourceName, 'execute', $args);
+ while (true) {
+ ++$attempt;
+ try {
+ // Attempt the operation
+ return $signBlobFn();
+ } catch (\Exception $exception) {
+ if (!$retryDecider($exception, $attempt, self::MAX_RETRIES)) {
+ // Non-retryable error
+ throw $exception;
+ }
+ }
+ }
+ }
}
diff --git a/lib/Google/vendor/google/cloud-storage/src/StorageClient.php b/lib/Google/vendor/google/cloud-storage/src/StorageClient.php
index ce588ef54..b14e52c28 100644
--- a/lib/Google/vendor/google/cloud-storage/src/StorageClient.php
+++ b/lib/Google/vendor/google/cloud-storage/src/StorageClient.php
@@ -47,7 +47,7 @@ class StorageClient
use ArrayTrait;
use ClientTrait;
- const VERSION = '1.42.1';
+ const VERSION = '1.45.0';
const FULL_CONTROL_SCOPE = 'https://www.googleapis.com/auth/devstorage.full_control';
const READ_ONLY_SCOPE = 'https://www.googleapis.com/auth/devstorage.read_only';
diff --git a/lib/Google/vendor/google/cloud-storage/src/StreamWrapper.php b/lib/Google/vendor/google/cloud-storage/src/StreamWrapper.php
index 93d2eab0a..630ae47c5 100644
--- a/lib/Google/vendor/google/cloud-storage/src/StreamWrapper.php
+++ b/lib/Google/vendor/google/cloud-storage/src/StreamWrapper.php
@@ -19,7 +19,6 @@
use Google\Cloud\Core\Exception\NotFoundException;
use Google\Cloud\Core\Exception\ServiceException;
-use Google\Cloud\Storage\Bucket;
use GuzzleHttp\Psr7\CachingStream;
/**
@@ -232,7 +231,7 @@ public function stream_open($path, $mode, $flags, &$openedPath)
}
if (isset($options['flush'])) {
- $this->flushing = (bool)$options['flush'];
+ $this->flushing = (bool) $options['flush'];
unset($options['flush']);
}
@@ -312,7 +311,7 @@ public function stream_read($count)
public function stream_write($data)
{
$result = $this->stream->write($data);
- $this->dirty = $this->dirty || (bool)$result;
+ $this->dirty = $this->dirty || (bool) $result;
return $result;
}
@@ -458,7 +457,7 @@ public function dir_rewinddir()
// since the service call returns nested results and we only
// want to yield results directly within the requested directory,
// check if we've already yielded this value.
- if ($parts[0] === "" || in_array($parts[0], $yielded)) {
+ if ($parts[0] === '' || in_array($parts[0], $yielded)) {
continue;
}
@@ -751,11 +750,11 @@ private function urlStatFile()
}
// equivalent to 100666 and 100444 in octal
- $stats = array(
+ $stats = [
'mode' => $this->bucket->isWritable()
? self::FILE_WRITABLE_MODE
: self::FILE_READABLE_MODE
- );
+ ];
$this->statsFromFileInfo($info, $stats);
return $this->makeStatArray($stats);
}
diff --git a/lib/Google/vendor/google/cloud-storage/src/WriteStream.php b/lib/Google/vendor/google/cloud-storage/src/WriteStream.php
index ba5d07fbc..28e63ba58 100644
--- a/lib/Google/vendor/google/cloud-storage/src/WriteStream.php
+++ b/lib/Google/vendor/google/cloud-storage/src/WriteStream.php
@@ -18,8 +18,8 @@
namespace Google\Cloud\Storage;
use Google\Cloud\Core\Upload\AbstractUploader;
-use GuzzleHttp\Psr7\StreamDecoratorTrait;
use GuzzleHttp\Psr7\BufferStream;
+use GuzzleHttp\Psr7\StreamDecoratorTrait;
use Psr\Http\Message\StreamInterface;
/**
@@ -46,7 +46,7 @@ class WriteStream implements StreamInterface
* upload data
* }
*/
- public function __construct(AbstractUploader $uploader = null, $options = [])
+ public function __construct(?AbstractUploader $uploader = null, $options = [])
{
if ($uploader) {
$this->setUploader($uploader);
@@ -78,7 +78,7 @@ public function close(): void
public function write($data): int
{
if (!isset($this->uploader)) {
- throw new \RuntimeException("No uploader set.");
+ throw new \RuntimeException('No uploader set.');
}
// Ensure we have a resume uri here because we need to create the streaming
diff --git a/lib/Google/vendor/google/common-protos/CHANGELOG.md b/lib/Google/vendor/google/common-protos/CHANGELOG.md
index 7827d1f9a..f1d61e3a4 100644
--- a/lib/Google/vendor/google/common-protos/CHANGELOG.md
+++ b/lib/Google/vendor/google/common-protos/CHANGELOG.md
@@ -1,26 +1,5 @@
# Changelog
-## [4.7.0](https://github.com/googleapis/common-protos-php/compare/v4.6.0...v4.7.0) (2024-07-25)
-
-
-### Features
-
-* Add FieldInfo.referenced_types for generics ([246c334](https://github.com/googleapis/common-protos-php/commit/246c334480ce2f307fd1ed60f2712eda0d5da8b4))
-
-
-### Bug Fixes
-
-* Un-deprecate Endpoint.aliases field ([246c334](https://github.com/googleapis/common-protos-php/commit/246c334480ce2f307fd1ed60f2712eda0d5da8b4))
-
-## [4.6.0](https://github.com/googleapis/common-protos-php/compare/v4.5.0...v4.6.0) (2024-04-03)
-
-
-### Features
-
-* Add `api_version` extension to `ServiceOptions`, for collaborative versioning ([#82](https://github.com/googleapis/common-protos-php/issues/82)) ([2ff1de8](https://github.com/googleapis/common-protos-php/commit/2ff1de8c6ffa2b125f502516cbad1315264a9b7b))
-* Add `ErrorReason.LOCATION_POLICY_VIOLATED` enum value ([2ff1de8](https://github.com/googleapis/common-protos-php/commit/2ff1de8c6ffa2b125f502516cbad1315264a9b7b))
-* Add `Publishing.rest_reference_documentation_uri` to aid client library publication ([2ff1de8](https://github.com/googleapis/common-protos-php/commit/2ff1de8c6ffa2b125f502516cbad1315264a9b7b))
-
## [4.5.0](https://github.com/googleapis/common-protos-php/compare/v4.4.0...v4.5.0) (2023-11-29)
diff --git a/lib/Google/vendor/google/common-protos/README.md b/lib/Google/vendor/google/common-protos/README.md
index 29c350242..6dd98ef4e 100644
--- a/lib/Google/vendor/google/common-protos/README.md
+++ b/lib/Google/vendor/google/common-protos/README.md
@@ -1,16 +1,18 @@
## Common Protos PHP
-[](https://cloud.google.com/terms/launch-stages)
+[](https://packagist.org/packages/google/common-protos) [](https://packagist.org/packages/google/common-protos)
-
-
-- [Documentation](https://googleapis.github.io/common-protos-php)
+* [API documentation](https://cloud.google.com/php/docs/reference/common-protos/latest)
This repository is a home for the [protocol buffer][protobuf] types which are
common dependencies throughout the Google API ecosystem, generated for PHP.
The protobuf definitions for these generated PHP classes are provided by the
[Common Components AIP][common-components-aip] repository.
+**NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any
+support requests, bug reports, or development contributions should be directed to
+that project.
+
## Using these generated classes
These classes are made available under an Apache license (see `LICENSE`) and
@@ -20,14 +22,8 @@ considered stable and will not change in backwards-incompaible ways.
They are distributed as the [google/common-protos][packagist-common-protos]
composer package, available on [Packagist][packagist].
-In order to depend on these classes, add the following line to your
-composer.json file in the `requires` section:
-
-```
- "google/common-protos": "^2.0"
-```
-
-Or else use composer from the command line:
+In order to depend on these classes, use composer from the command line in order
+to add this package to your `composer.json` file in the `requires` section:
```bash
composer require google/common-protos
@@ -39,8 +35,7 @@ These classes are licensed using the Apache 2.0 software license, a
permissive, copyfree license. You are free to use them in your applications
provided the license terms are honored.
- [api-style]: https://cloud.google.com/apis/design/
- [protobuf]: https://developers.google.com/protocol-buffers/
- [common-components-aip]: https://google.aip.dev/213
- [packagist-common-protos]: https://packagist.org/packages/google/common-protos/
- [packagist]: https://packagist.org/
+[protobuf]: https://developers.google.com/protocol-buffers/
+[common-components-aip]: https://google.aip.dev/213
+[packagist-common-protos]: https://packagist.org/packages/google/common-protos/
+[packagist]: https://packagist.org/
diff --git a/lib/Google/vendor/google/common-protos/VERSION b/lib/Google/vendor/google/common-protos/VERSION
new file mode 100644
index 000000000..f99c6583c
--- /dev/null
+++ b/lib/Google/vendor/google/common-protos/VERSION
@@ -0,0 +1 @@
+4.8.3
diff --git a/lib/Google/vendor/google/common-protos/composer.json b/lib/Google/vendor/google/common-protos/composer.json
index f181977f6..a9a4384ad 100644
--- a/lib/Google/vendor/google/common-protos/composer.json
+++ b/lib/Google/vendor/google/common-protos/composer.json
@@ -2,7 +2,10 @@
"name": "google/common-protos",
"type": "library",
"description": "Google API Common Protos for PHP",
- "keywords": ["google"],
+ "version": "4.8.3",
+ "keywords": [
+ "google"
+ ],
"homepage": "https://github.com/googleapis/common-protos-php",
"license": "Apache-2.0",
"require": {
@@ -26,5 +29,13 @@
"GPBMetadata\\Google\\Rpc\\": "metadata/Rpc",
"GPBMetadata\\Google\\Type\\": "metadata/Type"
}
+ },
+ "extra": {
+ "component": {
+ "id": "common-protos",
+ "target": "googleapis/common-protos-php.git",
+ "path": "CommonProtos",
+ "entry": "README.md"
+ }
}
}
diff --git a/lib/Google/vendor/google/gax/.repo-metadata.json b/lib/Google/vendor/google/gax/.repo-metadata.json
new file mode 100644
index 000000000..2fe16da27
--- /dev/null
+++ b/lib/Google/vendor/google/gax/.repo-metadata.json
@@ -0,0 +1,7 @@
+{
+ "language": "php",
+ "distribution_name": "google/gax",
+ "release_level": "stable",
+ "client_documentation": "https://cloud.google.com/php/docs/reference/gax/latest",
+ "library_type": "CORE"
+}
diff --git a/lib/Google/vendor/google/gax/CHANGELOG.md b/lib/Google/vendor/google/gax/CHANGELOG.md
index 700724313..8a8db4ae6 100644
--- a/lib/Google/vendor/google/gax/CHANGELOG.md
+++ b/lib/Google/vendor/google/gax/CHANGELOG.md
@@ -1,5 +1,34 @@
# Changelog
+## [1.36.0](https://github.com/googleapis/gax-php/compare/v1.35.1...v1.36.0) (2024-12-11)
+
+
+### Features
+
+* Add logging to the supported transports ([#585](https://github.com/googleapis/gax-php/issues/585)) ([819a677](https://github.com/googleapis/gax-php/commit/819a677e0d89d75662b30a1dbdd45f6a610d9f0c))
+
+## [1.35.1](https://github.com/googleapis/gax-php/compare/v1.35.0...v1.35.1) (2024-12-04)
+
+
+### Bug Fixes
+
+* Ensure hasEmulator client option is passed to createTransport ([#594](https://github.com/googleapis/gax-php/issues/594)) ([13bbe8a](https://github.com/googleapis/gax-php/commit/13bbe8a2e6df2bfd6c5febba735113f1abcba201))
+* Remove implicit null, add php 8.4 ([#599](https://github.com/googleapis/gax-php/issues/599)) ([af0a0e7](https://github.com/googleapis/gax-php/commit/af0a0e708dfbea46de627965db0f63114fcfb67f))
+
+## [1.35.0](https://github.com/googleapis/gax-php/compare/v1.34.1...v1.35.0) (2024-11-06)
+
+
+### Features
+
+* Add `InsecureRequestBuilder` for emulator ([#582](https://github.com/googleapis/gax-php/issues/582)) ([cc1d047](https://github.com/googleapis/gax-php/commit/cc1d0472a1caf31bb3ecd98da1d6b8588f95b63a))
+* **docs:** Use doctum shared workflow for reference docs ([#578](https://github.com/googleapis/gax-php/issues/578)) ([021763f](https://github.com/googleapis/gax-php/commit/021763f255acaffda6ebe34a9d1a01c2bd187326))
+* Support for API Key client option ([#351](https://github.com/googleapis/gax-php/issues/351)) ([ab7f04f](https://github.com/googleapis/gax-php/commit/ab7f04fd8c9f7ed33a58155ae6b9e740f365ac2a))
+
+
+### Bug Fixes
+
+* **tests:** Skip docs tests from forks ([#591](https://github.com/googleapis/gax-php/issues/591)) ([35ae9f7](https://github.com/googleapis/gax-php/commit/35ae9f708d3ef937308d266e3a012296ce8606fc))
+
## [1.34.1](https://github.com/googleapis/gax-php/compare/v1.34.0...v1.34.1) (2024-08-13)
diff --git a/lib/Google/vendor/google/gax/README.md b/lib/Google/vendor/google/gax/README.md
index c5da66423..3d148a1ec 100644
--- a/lib/Google/vendor/google/gax/README.md
+++ b/lib/Google/vendor/google/gax/README.md
@@ -17,7 +17,7 @@ more convenient and idiomatic API surface to callers.
## PHP Versions
-gax-php currently requires PHP 5.6 or higher.
+gax-php currently requires PHP 8.0 or higher.
## Contributing
diff --git a/lib/Google/vendor/google/gax/VERSION b/lib/Google/vendor/google/gax/VERSION
index a95a46d9f..39fc130ef 100644
--- a/lib/Google/vendor/google/gax/VERSION
+++ b/lib/Google/vendor/google/gax/VERSION
@@ -1 +1 @@
-1.34.1
+1.36.0
diff --git a/lib/Google/vendor/google/gax/composer.json b/lib/Google/vendor/google/gax/composer.json
index 2806aeb22..06152f6ed 100644
--- a/lib/Google/vendor/google/gax/composer.json
+++ b/lib/Google/vendor/google/gax/composer.json
@@ -7,7 +7,7 @@
"license": "BSD-3-Clause",
"require": {
"php": "^8.0",
- "google/auth": "^1.34.0",
+ "google/auth": "^1.45",
"google/grpc-gcp": "^0.4",
"grpc/grpc": "^1.13",
"google/protobuf": "^v3.25.3||^4.26.1",
@@ -21,7 +21,7 @@
"phpunit/phpunit": "^9.6",
"squizlabs/php_codesniffer": "3.*",
"phpspec/prophecy-phpunit": "^2.1",
- "phpstan/phpstan": "^1.10"
+ "phpstan/phpstan": "^2.0"
},
"conflict": {
"ext-protobuf": "<3.7.0"
@@ -35,7 +35,7 @@
"autoload-dev": {
"psr-4": {
"Google\\ApiCore\\Dev\\": "dev/src",
- "Google\\ApiCore\\": "tests",
+ "Google\\ApiCore\\Tests\\": "tests",
"GPBMetadata\\Google\\": "metadata/Google"
}
},
diff --git a/lib/Google/vendor/google/gax/phpunit.xml.dist b/lib/Google/vendor/google/gax/phpunit.xml.dist
index 3112d3d95..825f7f706 100644
--- a/lib/Google/vendor/google/gax/phpunit.xml.dist
+++ b/lib/Google/vendor/google/gax/phpunit.xml.dist
@@ -1,7 +1,7 @@
-
+
@@ -10,7 +10,7 @@
- tests/Tests/Unit
+ tests/Unit
diff --git a/lib/Google/vendor/google/gax/src/AgentHeader.php b/lib/Google/vendor/google/gax/src/AgentHeader.php
index 9afd4969d..4fda2b0e9 100644
--- a/lib/Google/vendor/google/gax/src/AgentHeader.php
+++ b/lib/Google/vendor/google/gax/src/AgentHeader.php
@@ -101,9 +101,9 @@ public static function buildAgentHeader(array $headerInfo)
$metricsList = [];
foreach ($metricsHeaders as $key => $value) {
- $metricsList[] = $key . "/" . $value;
+ $metricsList[] = $key . '/' . $value;
}
- return [self::AGENT_HEADER_KEY => [implode(" ", $metricsList)]];
+ return [self::AGENT_HEADER_KEY => [implode(' ', $metricsList)]];
}
/**
diff --git a/lib/Google/vendor/google/gax/src/ApiException.php b/lib/Google/vendor/google/gax/src/ApiException.php
index 7385f8b43..b66fff873 100644
--- a/lib/Google/vendor/google/gax/src/ApiException.php
+++ b/lib/Google/vendor/google/gax/src/ApiException.php
@@ -35,7 +35,6 @@
use Google\Protobuf\Internal\RepeatedField;
use Google\Rpc\Status;
use GuzzleHttp\Exception\RequestException;
-use Google\ApiCore\Testing\MockStatus;
use stdClass;
/**
@@ -62,7 +61,7 @@ class ApiException extends Exception
public function __construct(
string $message,
int $code,
- string $status = null,
+ ?string $status = null,
array $optionalArgs = []
) {
$optionalArgs += [
@@ -163,8 +162,8 @@ public static function createFromStdClass(stdClass $status)
public static function createFromApiResponse(
$basicMessage,
$rpcCode,
- array $metadata = null,
- Exception $previous = null
+ ?array $metadata = null,
+ ?Exception $previous = null
) {
return self::create(
$basicMessage,
@@ -187,8 +186,8 @@ public static function createFromApiResponse(
public static function createFromRestApiResponse(
$basicMessage,
$rpcCode,
- array $metadata = null,
- Exception $previous = null
+ ?array $metadata = null,
+ ?Exception $previous = null
) {
return self::create(
$basicMessage,
@@ -244,7 +243,7 @@ private static function create(
int $rpcCode,
$metadata,
array $decodedMetadata,
- Exception $previous = null
+ ?Exception $previous = null
) {
$containsErrorInfo = self::containsErrorInfo($decodedMetadata);
$rpcStatus = ApiStatus::statusFromRpcCode($rpcCode);
diff --git a/lib/Google/vendor/google/gax/src/ApiKeyHeaderCredentials.php b/lib/Google/vendor/google/gax/src/ApiKeyHeaderCredentials.php
new file mode 100644
index 000000000..f4471d6e9
--- /dev/null
+++ b/lib/Google/vendor/google/gax/src/ApiKeyHeaderCredentials.php
@@ -0,0 +1,95 @@
+apiKey = $apiKey;
+ $this->quotaProject = $quotaProject;
+ }
+
+ /**
+ * @return string|null The quota project associated with the credentials.
+ */
+ public function getQuotaProject(): ?string
+ {
+ return $this->quotaProject;
+ }
+
+ /**
+ * @param string|null $unusedAudience audiences are not supported for API keys.
+ *
+ * @return callable|null Callable function that returns the API key header.
+ */
+ public function getAuthorizationHeaderCallback(?string $unusedAudience = null): ?callable
+ {
+ $apiKey = $this->apiKey;
+
+ // NOTE: changes to this function should be treated carefully and tested thoroughly. It will
+ // be passed into the gRPC c extension, and changes have the potential to trigger very
+ // difficult-to-diagnose segmentation faults.
+ return function () use ($apiKey) {
+ return ['x-goog-api-key' => [$apiKey]];
+ };
+ }
+
+ /**
+ * Verify that the expected universe domain matches the universe domain from the credentials.
+ *
+ * @throws ValidationException if the universe domain does not match.
+ */
+ public function checkUniverseDomain(): void
+ {
+ // This is a no-op, as API keys are not tied to a universe domain. As a result, the
+ // potential for leaking API keys to the GDU is higher, and it's recommended to specify
+ // the "universeDomain" option with the GAPIC client.
+ }
+}
diff --git a/lib/Google/vendor/google/gax/src/BidiStream.php b/lib/Google/vendor/google/gax/src/BidiStream.php
index 83490da18..e4d6718b2 100644
--- a/lib/Google/vendor/google/gax/src/BidiStream.php
+++ b/lib/Google/vendor/google/gax/src/BidiStream.php
@@ -31,32 +31,44 @@
*/
namespace Google\ApiCore;
+use Google\Auth\Logging\LoggingTrait;
+use Google\Auth\Logging\RpcLogEvent;
+use Google\Protobuf\Internal\Message;
use Google\Rpc\Code;
use Grpc\BidiStreamingCall;
+use Psr\Log\LoggerInterface;
/**
* BidiStream is the response object from a gRPC bidirectional streaming API call.
*/
class BidiStream
{
+ use LoggingTrait;
+
private $call;
private $isComplete = false;
private $writesClosed = false;
private $resourcesGetMethod = null;
private $pendingResources = [];
+ private null|LoggerInterface $logger = null;
/**
* BidiStream constructor.
*
* @param BidiStreamingCall $bidiStreamingCall The gRPC bidirectional streaming call object
* @param array $streamingDescriptor
+ * @param null|LoggerInterface $logger
*/
- public function __construct(BidiStreamingCall $bidiStreamingCall, array $streamingDescriptor = [])
- {
+ public function __construct(
+ BidiStreamingCall $bidiStreamingCall,
+ array $streamingDescriptor = [],
+ null|LoggerInterface $logger = null,
+ ) {
$this->call = $bidiStreamingCall;
if (array_key_exists('resourcesGetMethod', $streamingDescriptor)) {
$this->resourcesGetMethod = $streamingDescriptor['resourcesGetMethod'];
}
+ $this->logger = $logger;
}
/**
@@ -68,11 +80,23 @@ public function __construct(BidiStreamingCall $bidiStreamingCall, array $streami
public function write($request)
{
if ($this->isComplete) {
- throw new ValidationException("Cannot call write() after streaming call is complete.");
+ throw new ValidationException('Cannot call write() after streaming call is complete.');
}
if ($this->writesClosed) {
- throw new ValidationException("Cannot call write() after calling closeWrite().");
+ throw new ValidationException('Cannot call write() after calling closeWrite().');
}
+
+ if ($this->logger && $request instanceof Message) {
+ $logEvent = new RpcLogEvent();
+
+ $logEvent->headers = null;
+ $logEvent->payload = $request->serializeToJsonString();
+ $logEvent->processId = (int) getmypid();
+ $logEvent->requestId = crc32((string) spl_object_id($this) . getmypid());
+
+ $this->logRequest($logEvent);
+ }
+
$this->call->write($request);
}
@@ -99,7 +123,7 @@ public function closeWrite()
{
if ($this->isComplete) {
throw new ValidationException(
- "Cannot call closeWrite() after streaming call is complete."
+ 'Cannot call closeWrite() after streaming call is complete.'
);
}
if (!$this->writesClosed) {
@@ -119,7 +143,7 @@ public function closeWrite()
public function read()
{
if ($this->isComplete) {
- throw new ValidationException("Cannot call read() after streaming call is complete.");
+ throw new ValidationException('Cannot call read() after streaming call is complete.');
}
$resourcesGetMethod = $this->resourcesGetMethod;
if (!is_null($resourcesGetMethod)) {
@@ -144,6 +168,22 @@ public function read()
throw ApiException::createFromStdClass($status);
}
}
+
+ if ($this->logger) {
+ $responseEvent = new RpcLogEvent();
+
+ $responseEvent->headers = $this->call->getMetadata();
+ $responseEvent->status = $status->code ?? null;
+ $responseEvent->processId = (int) getmypid();
+ $responseEvent->requestId = crc32((string) spl_object_id($this) . getmypid());
+
+ if ($result instanceof Message) {
+ $responseEvent->payload = $result->serializeToJsonString();
+ }
+
+ $this->logResponse($responseEvent);
+ }
+
return $result;
}
diff --git a/lib/Google/vendor/google/gax/src/Call.php b/lib/Google/vendor/google/gax/src/Call.php
index b4c403579..53c5d32bb 100644
--- a/lib/Google/vendor/google/gax/src/Call.php
+++ b/lib/Google/vendor/google/gax/src/Call.php
@@ -61,7 +61,7 @@ class Call
*/
public function __construct(
string $method,
- string $decodeType = null,
+ ?string $decodeType = null,
$message = null,
$descriptor = [],
int $callType = Call::UNARY_CALL
diff --git a/lib/Google/vendor/google/gax/src/ClientOptionsTrait.php b/lib/Google/vendor/google/gax/src/ClientOptionsTrait.php
index 43deaef7c..62ea0ec36 100644
--- a/lib/Google/vendor/google/gax/src/ClientOptionsTrait.php
+++ b/lib/Google/vendor/google/gax/src/ClientOptionsTrait.php
@@ -32,11 +32,15 @@
namespace Google\ApiCore;
+use Google\Auth\ApplicationDefaultCredentials;
use Google\Auth\CredentialsLoader;
use Google\Auth\FetchAuthTokenInterface;
use Google\Auth\GetUniverseDomainInterface;
+use Google\Auth\HttpHandler\HttpHandlerFactory;
use Grpc\Gcp\ApiConfig;
use Grpc\Gcp\Config;
+use Psr\Log\LoggerInterface;
+use Psr\Log\LogLevel;
/**
* Common functions used to work with various clients.
@@ -98,6 +102,7 @@ private function buildClientOptions(array $options)
'apiEndpoint' => null,
'clientCertSource' => null,
'universeDomain' => null,
+ 'logger' => null,
];
$supportedTransports = $this->supportedTransports();
@@ -115,18 +120,51 @@ private function buildClientOptions(array $options)
// Keep track of the API Endpoint
$apiEndpoint = $options['apiEndpoint'] ?? null;
+ // Keep track of the original user supplied options for logging the configuration
+ $clientSuppliedOptions = $options;
+
// Merge defaults into $options starting from top level
// variables, then going into deeper nesting, so that
// we will not encounter missing keys
$options += $defaultOptions;
+
+ // If logger is explicitly set to false, logging is disabled
+ if (is_null($options['logger'])) {
+ $options['logger'] = ApplicationDefaultCredentials::getDefaultLogger();
+ }
+
+ if (
+ $options['logger'] !== null
+ && $options['logger'] !== false
+ && !$options['logger'] instanceof LoggerInterface
+ ) {
+ throw new ValidationException(
+ 'The "logger" option in the options array should be PSR-3 LoggerInterface compatible'
+ );
+ }
+
+ // Log the user supplied configuration.
+ $this->logConfiguration($options['logger'], $clientSuppliedOptions);
+
+ if (isset($options['logger'])) {
+ $options['credentialsConfig']['authHttpHandler'] = HttpHandlerFactory::build(
+ logger: $options['logger']
+ );
+ }
+
$options['credentialsConfig'] += $defaultOptions['credentialsConfig'];
$options['transportConfig'] += $defaultOptions['transportConfig']; // @phpstan-ignore-line
if (isset($options['transportConfig']['grpc'])) {
$options['transportConfig']['grpc'] += $defaultOptions['transportConfig']['grpc'];
$options['transportConfig']['grpc']['stubOpts'] += $defaultOptions['transportConfig']['grpc']['stubOpts'];
+ $options['transportConfig']['grpc']['logger'] = $options['logger'] ?? null;
}
if (isset($options['transportConfig']['rest'])) {
$options['transportConfig']['rest'] += $defaultOptions['transportConfig']['rest'];
+ $options['transportConfig']['rest']['logger'] = $options['logger'] ?? null;
+ }
+ if (isset($options['transportConfig']['grpc-fallback'])) {
+ $options['transportConfig']['grpc-fallback']['logger'] = $options['logger'] ?? null;
}
// These calls do not apply to "New Surface" clients.
@@ -261,20 +299,27 @@ private static function determineMtlsEndpoint(string $apiEndpoint)
private function createCredentialsWrapper($credentials, array $credentialsConfig, string $universeDomain)
{
if (is_null($credentials)) {
+ // If the user has explicitly set the apiKey option, use Api Key credentials
return CredentialsWrapper::build($credentialsConfig, $universeDomain);
- } elseif (is_string($credentials) || is_array($credentials)) {
+ }
+
+ if (is_string($credentials) || is_array($credentials)) {
return CredentialsWrapper::build(['keyFile' => $credentials] + $credentialsConfig, $universeDomain);
- } elseif ($credentials instanceof FetchAuthTokenInterface) {
+ }
+
+ if ($credentials instanceof FetchAuthTokenInterface) {
$authHttpHandler = $credentialsConfig['authHttpHandler'] ?? null;
return new CredentialsWrapper($credentials, $authHttpHandler, $universeDomain);
- } elseif ($credentials instanceof CredentialsWrapper) {
+ }
+
+ if ($credentials instanceof CredentialsWrapper) {
return $credentials;
- } else {
- throw new ValidationException(
- 'Unexpected value in $auth option, got: ' .
- print_r($credentials, true)
- );
}
+
+ throw new ValidationException(sprintf(
+ 'Unexpected value in $auth option, got: %s',
+ print_r($credentials, true)
+ ));
}
/**
@@ -310,4 +355,27 @@ private function isBackwardsCompatibilityMode(): bool
{
return false;
}
+
+ /**
+ * @param null|false|LoggerInterface $logger
+ * @param string $options
+ */
+ private function logConfiguration(null|false|LoggerInterface $logger, array $options): void
+ {
+ if (!$logger) {
+ return;
+ }
+
+ $configurationLog = [
+ 'timestamp' => date(DATE_RFC3339),
+ 'severity' => strtoupper(LogLevel::DEBUG),
+ 'processId' => getmypid(),
+ 'jsonPayload' => [
+ 'serviceName' => self::SERVICE_NAME, // @phpstan-ignore-line
+ 'clientConfiguration' => $options,
+ ]
+ ];
+
+ $logger->debug(json_encode($configurationLog));
+ }
}
diff --git a/lib/Google/vendor/google/gax/src/ClientStream.php b/lib/Google/vendor/google/gax/src/ClientStream.php
index cdaaaf0a8..6c249551c 100644
--- a/lib/Google/vendor/google/gax/src/ClientStream.php
+++ b/lib/Google/vendor/google/gax/src/ClientStream.php
@@ -31,27 +31,37 @@
*/
namespace Google\ApiCore;
+use Google\Auth\Logging\LoggingTrait;
+use Google\Auth\Logging\RpcLogEvent;
+use Google\Protobuf\Internal\Message;
use Google\Rpc\Code;
use Grpc\ClientStreamingCall;
+use Psr\Log\LoggerInterface;
/**
* ClientStream is the response object from a gRPC client streaming API call.
*/
class ClientStream
{
+ use LoggingTrait;
+
private $call;
+ private null|LoggerInterface $logger;
/**
* ClientStream constructor.
*
* @param ClientStreamingCall $clientStreamingCall The gRPC client streaming call object
* @param array $streamingDescriptor
+ * @param null|LoggerInterface $logger A PSR-3 compliant logger.
*/
- public function __construct( // @phpstan-ignore-line
+ public function __construct(// @phpstan-ignore-line
ClientStreamingCall $clientStreamingCall,
- array $streamingDescriptor = []
+ array $streamingDescriptor = [],
+ null|LoggerInterface $logger = null,
) {
$this->call = $clientStreamingCall;
+ $this->logger = $logger;
}
/**
@@ -61,6 +71,17 @@ public function __construct( // @phpstan-ignore-line
*/
public function write($request)
{
+ // In some cases, $request can be a string
+ if ($this->logger && $request instanceof Message) {
+ $requestEvent = new RpcLogEvent();
+
+ $requestEvent->payload = $request->serializeToJsonString();
+ $requestEvent->processId = (int) getmypid();
+ $requestEvent->requestId = crc32((string) spl_object_id($this) . getmypid());
+
+ $this->logRequest($requestEvent);
+ }
+
$this->call->write($request);
}
@@ -74,6 +95,21 @@ public function readResponse()
{
list($response, $status) = $this->call->wait();
if ($status->code == Code::OK) {
+ if ($this->logger) {
+ $responseEvent = new RpcLogEvent();
+
+ $responseEvent->headers = $status->metadata;
+ $responseEvent->status = $status->code;
+ $responseEvent->processId = (int) getmypid();
+ $responseEvent->requestId = crc32((string) spl_object_id($this) . getmypid());
+
+ if ($response instanceof Message) {
+ $response->serializeToJsonString();
+ }
+
+ $this->logResponse($responseEvent);
+ }
+
return $response;
} else {
throw ApiException::createFromStdClass($status);
diff --git a/lib/Google/vendor/google/gax/src/CredentialsWrapper.php b/lib/Google/vendor/google/gax/src/CredentialsWrapper.php
index 9ffef8435..d6e90892b 100644
--- a/lib/Google/vendor/google/gax/src/CredentialsWrapper.php
+++ b/lib/Google/vendor/google/gax/src/CredentialsWrapper.php
@@ -34,25 +34,22 @@
use DomainException;
use Exception;
use Google\Auth\ApplicationDefaultCredentials;
-use Google\Auth\ProjectIdProviderInterface;
use Google\Auth\Cache\MemoryCacheItemPool;
+use Google\Auth\Credentials\GCECredentials;
use Google\Auth\Credentials\ServiceAccountCredentials;
use Google\Auth\CredentialsLoader;
use Google\Auth\FetchAuthTokenCache;
use Google\Auth\FetchAuthTokenInterface;
use Google\Auth\GetQuotaProjectInterface;
use Google\Auth\GetUniverseDomainInterface;
-use Google\Auth\Credentials\GCECredentials;
-use Google\Auth\HttpHandler\Guzzle6HttpHandler;
-use Google\Auth\HttpHandler\Guzzle7HttpHandler;
-use Google\Auth\HttpHandler\HttpHandlerFactory;
+use Google\Auth\ProjectIdProviderInterface;
use Google\Auth\UpdateMetadataInterface;
use Psr\Cache\CacheItemPoolInterface;
/**
* The CredentialsWrapper object provides a wrapper around a FetchAuthTokenInterface.
*/
-class CredentialsWrapper implements ProjectIdProviderInterface
+class CredentialsWrapper implements HeaderCredentialsInterface, ProjectIdProviderInterface
{
use ValidationTrait;
@@ -78,7 +75,7 @@ class CredentialsWrapper implements ProjectIdProviderInterface
*/
public function __construct(
FetchAuthTokenInterface $credentialsFetcher,
- callable $authHttpHandler = null,
+ ?callable $authHttpHandler = null,
string $universeDomain = GetUniverseDomainInterface::DEFAULT_UNIVERSE_DOMAIN
) {
$this->credentialsFetcher = $credentialsFetcher;
@@ -195,7 +192,7 @@ public static function build(
/**
* @return string|null The quota project associated with the credentials.
*/
- public function getQuotaProject()
+ public function getQuotaProject(): ?string
{
if ($this->credentialsFetcher instanceof GetQuotaProjectInterface) {
return $this->credentialsFetcher->getQuotaProject();
@@ -203,7 +200,7 @@ public function getQuotaProject()
return null;
}
- public function getProjectId(callable $httpHandler = null): ?string
+ public function getProjectId(?callable $httpHandler = null): ?string
{
// Ensure that FetchAuthTokenCache does not throw an exception
if ($this->credentialsFetcher instanceof FetchAuthTokenCache
@@ -239,7 +236,7 @@ public function getBearerString()
* @param string $audience optional audience for self-signed JWTs.
* @return callable Callable function that returns an authorization header.
*/
- public function getAuthorizationHeaderCallback($audience = null)
+ public function getAuthorizationHeaderCallback($audience = null): ?callable
{
// NOTE: changes to this function should be treated carefully and tested thoroughly. It will
// be passed into the gRPC c extension, and changes have the potential to trigger very
@@ -271,8 +268,10 @@ public function getAuthorizationHeaderCallback($audience = null)
/**
* Verify that the expected universe domain matches the universe domain from the credentials.
+ *
+ * @throws ValidationException if the universe domain does not match.
*/
- public function checkUniverseDomain()
+ public function checkUniverseDomain(): void
{
if (false === $this->hasCheckedUniverse && $this->shouldCheckUniverseDomain()) {
$credentialsUniverse = $this->credentialsFetcher instanceof GetUniverseDomainInterface
@@ -318,12 +317,12 @@ private function shouldCheckUniverseDomain(): bool
* @throws ValidationException
*/
private static function buildApplicationDefaultCredentials(
- array $scopes = null,
- callable $authHttpHandler = null,
- array $authCacheOptions = null,
- CacheItemPoolInterface $authCache = null,
+ ?array $scopes = null,
+ ?callable $authHttpHandler = null,
+ ?array $authCacheOptions = null,
+ ?CacheItemPoolInterface $authCache = null,
$quotaProject = null,
- array $defaultScopes = null
+ ?array $defaultScopes = null
) {
try {
return ApplicationDefaultCredentials::getCredentials(
@@ -335,7 +334,7 @@ private static function buildApplicationDefaultCredentials(
$defaultScopes
);
} catch (DomainException $ex) {
- throw new ValidationException("Could not construct ApplicationDefaultCredentials", $ex->getCode(), $ex);
+ throw new ValidationException('Could not construct ApplicationDefaultCredentials', $ex->getCode(), $ex);
}
}
diff --git a/lib/Google/vendor/google/gax/src/FixedSizeCollection.php b/lib/Google/vendor/google/gax/src/FixedSizeCollection.php
index eecd74408..03ec835c1 100644
--- a/lib/Google/vendor/google/gax/src/FixedSizeCollection.php
+++ b/lib/Google/vendor/google/gax/src/FixedSizeCollection.php
@@ -62,7 +62,7 @@ public function __construct(Page $initialPage, int $collectionSize)
if ($collectionSize < $initialPage->getPageElementCount()) {
$ipc = $initialPage->getPageElementCount();
throw new InvalidArgumentException(
- "collectionSize must be greater than or equal to the number of " .
+ 'collectionSize must be greater than or equal to the number of ' .
"elements in initialPage. collectionSize: $collectionSize, " .
"initialPage size: $ipc"
);
@@ -178,8 +178,8 @@ private static function createPageArray(Page $initialPage, int $collectionSize)
$currentPage = $currentPage->getNextPage($remainingCount);
$rxElementCount = $currentPage->getPageElementCount();
if ($rxElementCount > $remainingCount) {
- throw new LengthException("API returned a number of elements " .
- "exceeding the specified page size limit. page size: " .
+ throw new LengthException('API returned a number of elements ' .
+ 'exceeding the specified page size limit. page size: ' .
"$remainingCount, elements received: $rxElementCount");
}
array_push($pageList, $currentPage);
diff --git a/lib/Google/vendor/google/gax/src/GapicClientTrait.php b/lib/Google/vendor/google/gax/src/GapicClientTrait.php
index 195b06f6d..3ebee5807 100644
--- a/lib/Google/vendor/google/gax/src/GapicClientTrait.php
+++ b/lib/Google/vendor/google/gax/src/GapicClientTrait.php
@@ -66,7 +66,7 @@ trait GapicClientTrait
use GrpcSupportTrait;
private ?TransportInterface $transport = null;
- private ?CredentialsWrapper $credentialsWrapper = null;
+ private ?HeaderCredentialsInterface $credentialsWrapper = null;
/** @var RetrySettings[] $retrySettings */
private array $retrySettings = [];
private string $serviceName = '';
@@ -238,6 +238,12 @@ private function setClientOptions(array $options)
'libName',
'libVersion',
]);
+
+ // "hasEmulator" is not a supported Client Option, but is used
+ // internally to determine if the client is running in emulator mode.
+ // Therefore, we need to remove it from the $options array before
+ // creating the ClientOptions.
+ $hasEmulator = $this->pluck('hasEmulator', $options, false) ?? false;
if ($this->isBackwardsCompatibilityMode()) {
if (is_string($options['clientConfig'])) {
// perform validation for V1 surfaces which is done in the
@@ -287,11 +293,24 @@ private function setClientOptions(array $options)
$descriptors = require($options['descriptorsConfigPath']);
$this->descriptors = $descriptors['interfaces'][$this->serviceName];
- $this->credentialsWrapper = $this->createCredentialsWrapper(
- $options['credentials'],
- $options['credentialsConfig'],
- $options['universeDomain']
- );
+ if (isset($options['apiKey'], $options['credentials'])) {
+ throw new ValidationException(
+ 'API Keys and Credentials are mutually exclusive authentication methods and cannot be used together.'
+ );
+ }
+ // Set the credentialsWrapper
+ if (isset($options['apiKey'])) {
+ $this->credentialsWrapper = new ApiKeyHeaderCredentials(
+ $options['apiKey'],
+ $options['credentialsConfig']['quotaProject'] ?? null
+ );
+ } else {
+ $this->credentialsWrapper = $this->createCredentialsWrapper(
+ $options['credentials'],
+ $options['credentialsConfig'],
+ $options['universeDomain']
+ );
+ }
$transport = $options['transport'] ?: self::defaultTransport();
$this->transport = $transport instanceof TransportInterface
@@ -300,7 +319,8 @@ private function setClientOptions(array $options)
$options['apiEndpoint'],
$transport,
$options['transportConfig'],
- $options['clientCertSource']
+ $options['clientCertSource'],
+ $hasEmulator
);
}
@@ -309,6 +329,7 @@ private function setClientOptions(array $options)
* @param string $transport
* @param TransportOptions|array $transportConfig
* @param callable $clientCertSource
+ * @param bool $hasEmulator
* @return TransportInterface
* @throws ValidationException
*/
@@ -316,7 +337,8 @@ private function createTransport(
string $apiEndpoint,
$transport,
$transportConfig,
- callable $clientCertSource = null
+ ?callable $clientCertSource = null,
+ bool $hasEmulator = false
) {
if (!is_string($transport)) {
throw new ValidationException(
@@ -359,6 +381,8 @@ private function createTransport(
);
}
$restConfigPath = $configForSpecifiedTransport['restClientConfigPath'];
+ $configForSpecifiedTransport['hasEmulator'] = $hasEmulator;
+
return RestTransport::build($apiEndpoint, $restConfigPath, $configForSpecifiedTransport);
default:
throw new ValidationException(
@@ -512,10 +536,10 @@ private function startAsyncCall(
*/
private function startApiCall(
string $methodName,
- Message $request = null,
+ ?Message $request = null,
array $optionalArgs = []
) {
- $methodDescriptors =$this->validateCallConfig($methodName);
+ $methodDescriptors = $this->validateCallConfig($methodName);
$callType = $methodDescriptors['callType'];
// Prepare request-based headers, merge with user-provided headers,
@@ -574,9 +598,9 @@ private function startCall(
string $methodName,
string $decodeType,
array $optionalArgs = [],
- Message $request = null,
+ ?Message $request = null,
int $callType = Call::UNARY_CALL,
- string $interfaceName = null
+ ?string $interfaceName = null
) {
$optionalArgs = $this->configureCallOptions($optionalArgs);
$callStack = $this->createCallStack(
@@ -622,9 +646,8 @@ private function startCall(
*/
private function createCallStack(array $callConstructionOptions)
{
- $quotaProject = $this->credentialsWrapper->getQuotaProject();
$fixedHeaders = $this->agentHeader;
- if ($quotaProject) {
+ if ($quotaProject = $this->credentialsWrapper->getQuotaProject()) {
$fixedHeaders += [
'X-Goog-User-Project' => [$quotaProject]
];
@@ -729,8 +752,8 @@ private function startOperationsCall(
array $optionalArgs,
Message $request,
$client,
- string $interfaceName = null,
- string $operationClass = null
+ ?string $interfaceName = null,
+ ?string $operationClass = null
) {
$optionalArgs = $this->configureCallOptions($optionalArgs);
$callStack = $this->createCallStack(
@@ -785,7 +808,7 @@ private function getPagedListResponse(
array $optionalArgs,
string $decodeType,
Message $request,
- string $interfaceName = null
+ ?string $interfaceName = null
) {
return $this->getPagedListResponseAsync(
$methodName,
@@ -810,7 +833,7 @@ private function getPagedListResponseAsync(
array $optionalArgs,
string $decodeType,
Message $request,
- string $interfaceName = null
+ ?string $interfaceName = null
) {
$optionalArgs = $this->configureCallOptions($optionalArgs);
$callStack = $this->createCallStack(
@@ -841,7 +864,7 @@ private function getPagedListResponseAsync(
*
* @return string
*/
- private function buildMethod(string $interfaceName = null, string $methodName = null)
+ private function buildMethod(?string $interfaceName = null, ?string $methodName = null)
{
return sprintf(
'%s/%s',
@@ -856,7 +879,7 @@ private function buildMethod(string $interfaceName = null, string $methodName =
*
* @return array
*/
- private function buildRequestParamsHeader(array $headerParams, Message $request = null)
+ private function buildRequestParamsHeader(array $headerParams, ?Message $request = null)
{
$headers = [];
diff --git a/lib/Google/vendor/google/gax/src/HeaderCredentialsInterface.php b/lib/Google/vendor/google/gax/src/HeaderCredentialsInterface.php
new file mode 100644
index 000000000..805f61e6b
--- /dev/null
+++ b/lib/Google/vendor/google/gax/src/HeaderCredentialsInterface.php
@@ -0,0 +1,48 @@
+baseUri,
+ $path
+ ));
+ if ($queryParams) {
+ $uri = $this->buildUriWithQuery(
+ $uri,
+ $queryParams
+ );
+ }
+ return $uri;
+ }
+}
diff --git a/lib/Google/vendor/google/gax/src/Middleware/CredentialsWrapperMiddleware.php b/lib/Google/vendor/google/gax/src/Middleware/CredentialsWrapperMiddleware.php
index 886d2eb3f..7d890980a 100644
--- a/lib/Google/vendor/google/gax/src/Middleware/CredentialsWrapperMiddleware.php
+++ b/lib/Google/vendor/google/gax/src/Middleware/CredentialsWrapperMiddleware.php
@@ -33,7 +33,7 @@
use Google\ApiCore\Call;
use Google\ApiCore\CredentialsWrapper;
-use GuzzleHttp\Promise\PromiseInterface;
+use Google\ApiCore\HeaderCredentialsInterface;
/**
* Middleware which adds a CredentialsWrapper object to the call options.
@@ -42,11 +42,13 @@ class CredentialsWrapperMiddleware implements MiddlewareInterface
{
/** @var callable */
private $nextHandler;
- private CredentialsWrapper $credentialsWrapper;
+
+ /** @var HeaderCredentialsInterface */
+ private HeaderCredentialsInterface $credentialsWrapper;
public function __construct(
callable $nextHandler,
- CredentialsWrapper $credentialsWrapper
+ HeaderCredentialsInterface $credentialsWrapper
) {
$this->nextHandler = $nextHandler;
$this->credentialsWrapper = $credentialsWrapper;
diff --git a/lib/Google/vendor/google/gax/src/Middleware/FixedHeaderMiddleware.php b/lib/Google/vendor/google/gax/src/Middleware/FixedHeaderMiddleware.php
index c8bb62d65..43fbb508f 100644
--- a/lib/Google/vendor/google/gax/src/Middleware/FixedHeaderMiddleware.php
+++ b/lib/Google/vendor/google/gax/src/Middleware/FixedHeaderMiddleware.php
@@ -33,7 +33,6 @@
namespace Google\ApiCore\Middleware;
use Google\ApiCore\Call;
-use GuzzleHttp\Promise\PromiseInterface;
/**
* Middleware to add fixed headers to an API call.
diff --git a/lib/Google/vendor/google/gax/src/Middleware/MiddlewareInterface.php b/lib/Google/vendor/google/gax/src/Middleware/MiddlewareInterface.php
index d3eb4f749..224006ffe 100644
--- a/lib/Google/vendor/google/gax/src/Middleware/MiddlewareInterface.php
+++ b/lib/Google/vendor/google/gax/src/Middleware/MiddlewareInterface.php
@@ -32,11 +32,11 @@
namespace Google\ApiCore\Middleware;
+use Google\ApiCore\BidiStream;
use Google\ApiCore\Call;
-use GuzzleHttp\Promise\PromiseInterface;
use Google\ApiCore\ClientStream;
use Google\ApiCore\ServerStream;
-use Google\ApiCore\BidiStream;
+use GuzzleHttp\Promise\PromiseInterface;
/**
* Middlewares must take a MiddlewareInterface as their first constructor
diff --git a/lib/Google/vendor/google/gax/src/Middleware/OperationsMiddleware.php b/lib/Google/vendor/google/gax/src/Middleware/OperationsMiddleware.php
index ae186ee46..2da3ed3cf 100644
--- a/lib/Google/vendor/google/gax/src/Middleware/OperationsMiddleware.php
+++ b/lib/Google/vendor/google/gax/src/Middleware/OperationsMiddleware.php
@@ -34,7 +34,6 @@
use Google\ApiCore\Call;
use Google\ApiCore\OperationResponse;
use Google\Protobuf\Internal\Message;
-use GuzzleHttp\Promise\PromiseInterface;
/**
* Middleware which wraps the response in an OperationResponse object.
diff --git a/lib/Google/vendor/google/gax/src/Middleware/OptionsFilterMiddleware.php b/lib/Google/vendor/google/gax/src/Middleware/OptionsFilterMiddleware.php
index f62a72122..bcc405292 100644
--- a/lib/Google/vendor/google/gax/src/Middleware/OptionsFilterMiddleware.php
+++ b/lib/Google/vendor/google/gax/src/Middleware/OptionsFilterMiddleware.php
@@ -33,7 +33,6 @@
use Google\ApiCore\ArrayTrait;
use Google\ApiCore\Call;
-use GuzzleHttp\Promise\PromiseInterface;
/**
* Middleware which filters the $options array.
diff --git a/lib/Google/vendor/google/gax/src/Middleware/PagedMiddleware.php b/lib/Google/vendor/google/gax/src/Middleware/PagedMiddleware.php
index 0337ba80b..e5187638f 100644
--- a/lib/Google/vendor/google/gax/src/Middleware/PagedMiddleware.php
+++ b/lib/Google/vendor/google/gax/src/Middleware/PagedMiddleware.php
@@ -36,7 +36,6 @@
use Google\ApiCore\PagedListResponse;
use Google\ApiCore\PageStreamingDescriptor;
use Google\Protobuf\Internal\Message;
-use GuzzleHttp\Promise\PromiseInterface;
/**
* Middleware which wraps the response in an PagedListResponses object.
diff --git a/lib/Google/vendor/google/gax/src/Middleware/RequestAutoPopulationMiddleware.php b/lib/Google/vendor/google/gax/src/Middleware/RequestAutoPopulationMiddleware.php
index 874057a99..4811664ea 100644
--- a/lib/Google/vendor/google/gax/src/Middleware/RequestAutoPopulationMiddleware.php
+++ b/lib/Google/vendor/google/gax/src/Middleware/RequestAutoPopulationMiddleware.php
@@ -87,7 +87,7 @@ public function __invoke(Call $call, array $options)
break;
default:
throw new \UnexpectedValueException(sprintf(
- "Value type %s::%s not supported for auto population of the field %s",
+ 'Value type %s::%s not supported for auto population of the field %s',
Format::class,
Format::name($valueType),
$fieldName
diff --git a/lib/Google/vendor/google/gax/src/Middleware/RetryMiddleware.php b/lib/Google/vendor/google/gax/src/Middleware/RetryMiddleware.php
index 4a791cd71..4e8f6e79d 100644
--- a/lib/Google/vendor/google/gax/src/Middleware/RetryMiddleware.php
+++ b/lib/Google/vendor/google/gax/src/Middleware/RetryMiddleware.php
@@ -84,6 +84,11 @@ public function __invoke(Call $call, array $options)
}
}
+ // Setting the retry attempt for logging
+ if ($this->retryAttempts > 0) {
+ $options['retryAttempt'] = $this->retryAttempts;
+ }
+
// Call the handler immediately if retry settings are disabled.
if (!$this->retrySettings->retriesEnabled()) {
return $nextHandler($call, $options);
diff --git a/lib/Google/vendor/google/gax/src/OperationResponse.php b/lib/Google/vendor/google/gax/src/OperationResponse.php
index 436d97834..198f165d8 100644
--- a/lib/Google/vendor/google/gax/src/OperationResponse.php
+++ b/lib/Google/vendor/google/gax/src/OperationResponse.php
@@ -32,12 +32,12 @@
namespace Google\ApiCore;
-use Google\LongRunning\Client\OperationsClient;
-use Google\LongRunning\OperationsClient as LegacyOperationsClient;
use Google\LongRunning\CancelOperationRequest;
+use Google\LongRunning\Client\OperationsClient;
use Google\LongRunning\DeleteOperationRequest;
use Google\LongRunning\GetOperationRequest;
use Google\LongRunning\Operation;
+use Google\LongRunning\OperationsClient as LegacyOperationsClient;
use Google\Protobuf\Any;
use Google\Protobuf\Internal\Message;
use Google\Rpc\Status;
@@ -272,7 +272,7 @@ public function pollUntilComplete(array $options = [])
public function reload()
{
if ($this->deleted) {
- throw new ValidationException("Cannot call reload() on a deleted operation");
+ throw new ValidationException('Cannot call reload() on a deleted operation');
}
$requestClass = $this->isNewSurfaceOperationsClient() ? $this->getOperationRequest : null;
diff --git a/lib/Google/vendor/google/gax/src/Options/CallOptions.php b/lib/Google/vendor/google/gax/src/Options/CallOptions.php
index f700fff53..2256f4389 100644
--- a/lib/Google/vendor/google/gax/src/Options/CallOptions.php
+++ b/lib/Google/vendor/google/gax/src/Options/CallOptions.php
@@ -35,14 +35,14 @@
use ArrayAccess;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\RetrySettings;
-use Google\ApiCore\TransportInterface;
/**
* The CallOptions class provides typing to the associative array of options
- * passed to transport RPC methods. See {@see TransportInterface::startUnaryCall()},
- * {@see TransportInterface::startBidiStreamingCall()},
- * {@see TransportInterface::startClientStreamingCall()}, and
- * {@see TransportInterface::startServerStreamingCall()}.
+ * passed to transport RPC methods. See
+ * {@see \Google\ApiCore\Transport\TransportInterface::startUnaryCall()},
+ * {@see \Google\ApiCore\Transport\TransportInterface::startBidiStreamingCall()},
+ * {@see \Google\ApiCore\Transport\TransportInterface::startClientStreamingCall()}, and
+ * {@see \Google\ApiCore\Transport\TransportInterface::startServerStreamingCall()}.
*/
class CallOptions implements ArrayAccess
{
diff --git a/lib/Google/vendor/google/gax/src/Options/ClientOptions.php b/lib/Google/vendor/google/gax/src/Options/ClientOptions.php
index cd67c925f..797749891 100644
--- a/lib/Google/vendor/google/gax/src/Options/ClientOptions.php
+++ b/lib/Google/vendor/google/gax/src/Options/ClientOptions.php
@@ -34,15 +34,17 @@
use ArrayAccess;
use Closure;
-use InvalidArgumentException;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\Transport\TransportInterface;
use Google\Auth\FetchAuthTokenInterface;
+use InvalidArgumentException;
+use Psr\Log\LoggerInterface;
/**
* The ClientOptions class adds typing to the associative array of options
* passed into each API client constructor. To use this class directly, pass
- * the result of {@see ClientOptions::toArray} to the client constructor:
+ * the result of {@see \Google\ApiCore\Options\ClientOptions::toArray()} to the
+ * client constructor:
*
* ```
* use Google\ApiCore\ClientOptions;
@@ -93,6 +95,10 @@ class ClientOptions implements ArrayAccess
private ?string $universeDomain;
+ private ?string $apiKey;
+
+ private null|false|LoggerInterface $logger;
+
/**
* @param array $options {
* @type string $apiEndpoint
@@ -151,6 +157,10 @@ class ClientOptions implements ArrayAccess
* A callable which returns the client cert as a string.
* @type string $universeDomain
* The default service domain for a given Cloud universe.
+ * @type string $apiKey
+ * The API key to be used for the client.
+ * @type null|false|LoggerInterface
+ * A PSR-3 compliant logger.
* }
*/
public function __construct(array $options)
@@ -180,6 +190,8 @@ private function fromArray(array $arr): void
$this->setGapicVersion($arr['gapicVersion'] ?? null);
$this->setClientCertSource($arr['clientCertSource'] ?? null);
$this->setUniverseDomain($arr['universeDomain'] ?? null);
+ $this->setApiKey($arr['apiKey'] ?? null);
+ $this->setLogger($arr['logger'] ?? null);
}
/**
@@ -314,4 +326,20 @@ public function setUniverseDomain(?string $universeDomain)
{
$this->universeDomain = $universeDomain;
}
+
+ /**
+ * @param string $apiKey
+ */
+ public function setApiKey(?string $apiKey)
+ {
+ $this->apiKey = $apiKey;
+ }
+
+ /**
+ * @param null|false|LoggerInterface $logger
+ */
+ public function setLogger(null|false|LoggerInterface $logger)
+ {
+ $this->logger = $logger;
+ }
}
diff --git a/lib/Google/vendor/google/gax/src/Options/OptionsTrait.php b/lib/Google/vendor/google/gax/src/Options/OptionsTrait.php
index 9c721f4ac..3f3392add 100644
--- a/lib/Google/vendor/google/gax/src/Options/OptionsTrait.php
+++ b/lib/Google/vendor/google/gax/src/Options/OptionsTrait.php
@@ -32,8 +32,8 @@
namespace Google\ApiCore\Options;
-use Google\ApiCore\ValidationException;
use BadMethodCallException;
+use Google\ApiCore\ValidationException;
/**
* Trait implemented by any class representing an associative array of PHP options.
diff --git a/lib/Google/vendor/google/gax/src/Options/TransportOptions.php b/lib/Google/vendor/google/gax/src/Options/TransportOptions.php
index 998d577d9..8a1f006d5 100644
--- a/lib/Google/vendor/google/gax/src/Options/TransportOptions.php
+++ b/lib/Google/vendor/google/gax/src/Options/TransportOptions.php
@@ -32,10 +32,10 @@
namespace Google\ApiCore\Options;
-use Google\ApiCore\Options\TransportOptions\GrpcTransportOptions;
+use ArrayAccess;
use Google\ApiCore\Options\TransportOptions\GrpcFallbackTransportOptions;
+use Google\ApiCore\Options\TransportOptions\GrpcTransportOptions;
use Google\ApiCore\Options\TransportOptions\RestTransportOptions;
-use ArrayAccess;
class TransportOptions implements ArrayAccess
{
diff --git a/lib/Google/vendor/google/gax/src/Options/TransportOptions/GrpcFallbackTransportOptions.php b/lib/Google/vendor/google/gax/src/Options/TransportOptions/GrpcFallbackTransportOptions.php
index 73ac2267c..285a9803d 100644
--- a/lib/Google/vendor/google/gax/src/Options/TransportOptions/GrpcFallbackTransportOptions.php
+++ b/lib/Google/vendor/google/gax/src/Options/TransportOptions/GrpcFallbackTransportOptions.php
@@ -35,6 +35,7 @@
use ArrayAccess;
use Closure;
use Google\ApiCore\Options\OptionsTrait;
+use Psr\Log\LoggerInterface;
/**
* The GrpcFallbackTransportOptions class provides typing to the associative array of options used
@@ -48,6 +49,8 @@ class GrpcFallbackTransportOptions implements ArrayAccess
private ?Closure $httpHandler;
+ private null|false|LoggerInterface $logger;
+
/**
* @param array $options {
* Config options used to construct the gRPC Fallback transport.
@@ -56,6 +59,8 @@ class GrpcFallbackTransportOptions implements ArrayAccess
* A callable which returns the client cert as a string.
* @type callable $httpHandler
* A handler used to deliver PSR-7 requests.
+ * @type null|false|LoggerInterface
+ * A PSR-3 logger interface instance.
* }
*/
public function __construct(array $options)
@@ -72,6 +77,7 @@ private function fromArray(array $arr): void
{
$this->setClientCertSource($arr['clientCertSource'] ?? null);
$this->setHttpHandler($arr['httpHandler'] ?? null);
+ $this->setLogger($arr['logger'] ?? null);
}
public function setHttpHandler(?callable $httpHandler)
@@ -92,4 +98,12 @@ public function setClientCertSource(?callable $clientCertSource)
}
$this->clientCertSource = $clientCertSource;
}
+
+ /**
+ * @param null|false|LoggerInterface $logger
+ */
+ public function setLogger(null|false|LoggerInterface $logger)
+ {
+ $this->logger = $logger;
+ }
}
diff --git a/lib/Google/vendor/google/gax/src/Options/TransportOptions/GrpcTransportOptions.php b/lib/Google/vendor/google/gax/src/Options/TransportOptions/GrpcTransportOptions.php
index bafab56e8..65fdda5fe 100644
--- a/lib/Google/vendor/google/gax/src/Options/TransportOptions/GrpcTransportOptions.php
+++ b/lib/Google/vendor/google/gax/src/Options/TransportOptions/GrpcTransportOptions.php
@@ -35,9 +35,10 @@
use ArrayAccess;
use Closure;
use Google\ApiCore\Options\OptionsTrait;
+use Google\ApiCore\Transport\Grpc\UnaryInterceptorInterface;
use Grpc\Channel;
use Grpc\Interceptor;
-use Google\ApiCore\Transport\Grpc\UnaryInterceptorInterface;
+use Psr\Log\LoggerInterface;
/**
* The GrpcTransportOptions class provides typing to the associative array of options used to
@@ -51,6 +52,8 @@ class GrpcTransportOptions implements ArrayAccess
private ?Channel $channel;
+ private null|false|LoggerInterface $logger;
+
/**
* @var Interceptor[]|UnaryInterceptorInterface[]
*/
@@ -74,6 +77,7 @@ class GrpcTransportOptions implements ArrayAccess
* `UnaryInterceptorInterface` implementations over to a class which
* extends {@see Grpc\Interceptor}.
* @type callable $clientCertSource A callable which returns the client cert as a string.
+ * @type null|false|LoggerInterface A PSR-3 Logger Interface.
* }
*/
public function __construct(array $options)
@@ -92,6 +96,7 @@ private function fromArray(array $arr): void
$this->setChannel($arr['channel'] ?? null);
$this->setInterceptors($arr['interceptors'] ?? []);
$this->setClientCertSource($arr['clientCertSource'] ?? null);
+ $this->setLogger($arr['logger'] ?? null);
}
/**
@@ -128,4 +133,12 @@ public function setClientCertSource(?callable $clientCertSource)
}
$this->clientCertSource = $clientCertSource;
}
+
+ /**
+ * @param null|false|LoggerInterface $logger
+ */
+ public function setLogger(null|false|LoggerInterface $logger)
+ {
+ $this->logger = $logger;
+ }
}
diff --git a/lib/Google/vendor/google/gax/src/Options/TransportOptions/RestTransportOptions.php b/lib/Google/vendor/google/gax/src/Options/TransportOptions/RestTransportOptions.php
index 4bb4b53f8..0f0fd3a92 100644
--- a/lib/Google/vendor/google/gax/src/Options/TransportOptions/RestTransportOptions.php
+++ b/lib/Google/vendor/google/gax/src/Options/TransportOptions/RestTransportOptions.php
@@ -35,6 +35,7 @@
use ArrayAccess;
use Closure;
use Google\ApiCore\Options\OptionsTrait;
+use Psr\Log\LoggerInterface;
/**
* The RestTransportOptions class provides typing to the associative array of options used to
@@ -50,6 +51,8 @@ class RestTransportOptions implements ArrayAccess
private ?string $restClientConfigPath;
+ private null|false|LoggerInterface $logger;
+
/**
* @param array $options {
* Config options used to construct the REST transport.
@@ -60,6 +63,8 @@ class RestTransportOptions implements ArrayAccess
* A callable which returns the client cert as a string.
* @type string $restClientConfigPath
* The path to the REST client config file.
+ * @typo null|false|LoggerInterface
+ * A PSR-3 compliant logger instance.
* }
*/
public function __construct(array $options)
@@ -77,6 +82,7 @@ private function fromArray(array $arr): void
$this->setHttpHandler($arr['httpHandler'] ?? null);
$this->setClientCertSource($arr['clientCertSource'] ?? null);
$this->setRestClientConfigPath($arr['restClientConfigPath'] ?? null);
+ $this->setLogger($arr['logger'] ?? null);
}
/**
@@ -108,4 +114,12 @@ public function setRestClientConfigPath(?string $restClientConfigPath)
{
$this->restClientConfigPath = $restClientConfigPath;
}
+
+ /**
+ * @param null|false|LoggerInterface $logger
+ */
+ public function setLogger(null|false|LoggerInterface $logger)
+ {
+ $this->logger = $logger;
+ }
}
diff --git a/lib/Google/vendor/google/gax/src/Page.php b/lib/Google/vendor/google/gax/src/Page.php
index fded0dcca..996cadf39 100644
--- a/lib/Google/vendor/google/gax/src/Page.php
+++ b/lib/Google/vendor/google/gax/src/Page.php
@@ -42,7 +42,7 @@
*/
class Page implements IteratorAggregate
{
- const FINAL_PAGE_TOKEN = "";
+ const FINAL_PAGE_TOKEN = '';
private $call;
private $callable;
@@ -110,7 +110,7 @@ public function getNextPageToken()
* @throws ApiException if the call to fetch the next page fails.
* @return Page
*/
- public function getNextPage(int $pageSize = null)
+ public function getNextPage(?int $pageSize = null)
{
if (!$this->hasNextPage()) {
throw new ValidationException(
@@ -243,9 +243,9 @@ public function expandToFixedSizeCollection($collectionSize)
{
if (!$this->pageStreamingDescriptor->requestHasPageSizeField()) {
throw new ValidationException(
- "FixedSizeCollection is not supported for this method, because " .
- "the method does not support an optional argument to set the " .
- "page size."
+ 'FixedSizeCollection is not supported for this method, because ' .
+ 'the method does not support an optional argument to set the ' .
+ 'page size.'
);
}
$request = $this->getRequestObject();
@@ -253,16 +253,16 @@ public function expandToFixedSizeCollection($collectionSize)
$pageSize = $request->$pageSizeGetMethod();
if (is_null($pageSize)) {
throw new ValidationException(
- "Error while expanding Page to FixedSizeCollection: No page size " .
- "parameter found. The page size parameter must be set in the API " .
- "optional arguments array, and must be less than the collectionSize " .
- "parameter, in order to create a FixedSizeCollection object."
+ 'Error while expanding Page to FixedSizeCollection: No page size ' .
+ 'parameter found. The page size parameter must be set in the API ' .
+ 'optional arguments array, and must be less than the collectionSize ' .
+ 'parameter, in order to create a FixedSizeCollection object.'
);
}
if ($pageSize > $collectionSize) {
throw new ValidationException(
- "Error while expanding Page to FixedSizeCollection: collectionSize " .
- "parameter is less than the page size optional argument specified in " .
+ 'Error while expanding Page to FixedSizeCollection: collectionSize ' .
+ 'parameter is less than the page size optional argument specified in ' .
"the API call. collectionSize: $collectionSize, page size: $pageSize"
);
}
diff --git a/lib/Google/vendor/google/gax/src/PathTemplate.php b/lib/Google/vendor/google/gax/src/PathTemplate.php
index b7cd5aa2e..4556acf07 100644
--- a/lib/Google/vendor/google/gax/src/PathTemplate.php
+++ b/lib/Google/vendor/google/gax/src/PathTemplate.php
@@ -54,7 +54,7 @@ class PathTemplate implements ResourceTemplateInterface
* @param string $path A path template string
* @throws ValidationException When $path cannot be parsed into a valid PathTemplate
*/
- public function __construct(string $path = null)
+ public function __construct(?string $path = null)
{
if (empty($path)) {
throw new ValidationException('Cannot construct PathTemplate from empty string');
diff --git a/lib/Google/vendor/google/gax/src/RequestBuilder.php b/lib/Google/vendor/google/gax/src/RequestBuilder.php
index c32f8fd97..b0d589dc4 100644
--- a/lib/Google/vendor/google/gax/src/RequestBuilder.php
+++ b/lib/Google/vendor/google/gax/src/RequestBuilder.php
@@ -50,7 +50,7 @@ class RequestBuilder
use UriTrait;
use ValidationTrait;
- private $baseUri;
+ protected $baseUri;
private $restConfig;
/**
@@ -111,7 +111,7 @@ public function build(string $path, Message $message, array $headers = [])
// Request enum fields will be encoded as numbers rather than strings (in the response).
if ($numericEnums) {
- $queryParams['$alt'] = "json;enum-encoding=int";
+ $queryParams['$alt'] = 'json;enum-encoding=int';
}
$uri = $this->buildUri($pathTemplate, $queryParams);
@@ -132,8 +132,8 @@ public function build(string $path, Message $message, array $headers = [])
}
throw new ValidationException("Could not map bindings for $path to any Uri template.\n" .
- "Bindings: " . print_r($bindings, true) .
- "UriTemplates: " . print_r($uriTemplates, true));
+ 'Bindings: ' . print_r($bindings, true) .
+ 'UriTemplates: ' . print_r($uriTemplates, true));
}
/**
@@ -233,8 +233,8 @@ private function buildBindings(array $placeholders, Message $message)
foreach ($placeholders as $placeholder => $metadata) {
$value = array_reduce(
$metadata['getters'],
- function (Message $result = null, $getter) {
- if ($result) {
+ function (?Message $result = null, $getter = null) {
+ if ($result && $getter) {
return $result->$getter();
}
},
@@ -270,7 +270,7 @@ private function tryRenderPathTemplate(string $uriTemplate, array $bindings)
* @param array $queryParams
* @return UriInterface
*/
- private function buildUri(string $path, array $queryParams)
+ protected function buildUri(string $path, array $queryParams)
{
$uri = Utils::uriFor(
sprintf(
diff --git a/lib/Google/vendor/google/gax/src/ResourceHelperTrait.php b/lib/Google/vendor/google/gax/src/ResourceHelperTrait.php
index 7eafa99be..7f168413b 100644
--- a/lib/Google/vendor/google/gax/src/ResourceHelperTrait.php
+++ b/lib/Google/vendor/google/gax/src/ResourceHelperTrait.php
@@ -32,8 +32,6 @@
namespace Google\ApiCore;
-use Google\ApiCore\ValidationException;
-
/**
* Provides functionality for loading a resource name template map from a descriptor config,
* retrieving a PathTemplate, and parsing values using registered templates.
@@ -84,7 +82,7 @@ private static function getPathTemplate(string $key)
return self::$templateMap[$key] ?? null;
}
- private static function parseFormattedName(string $formattedName, string $template = null): array
+ private static function parseFormattedName(string $formattedName, ?string $template = null): array
{
if (is_null(self::$templateMap)) {
self::registerPathTemplates();
diff --git a/lib/Google/vendor/google/gax/src/ResourceTemplate/AbsoluteResourceTemplate.php b/lib/Google/vendor/google/gax/src/ResourceTemplate/AbsoluteResourceTemplate.php
index 1373b027b..e6cb49231 100644
--- a/lib/Google/vendor/google/gax/src/ResourceTemplate/AbsoluteResourceTemplate.php
+++ b/lib/Google/vendor/google/gax/src/ResourceTemplate/AbsoluteResourceTemplate.php
@@ -82,7 +82,7 @@ public function __construct(string $path)
*/
public function __toString()
{
- return sprintf("/%s%s", $this->resourceTemplate, $this->renderVerb());
+ return sprintf('/%s%s', $this->resourceTemplate, $this->renderVerb());
}
/**
@@ -90,7 +90,7 @@ public function __toString()
*/
public function render(array $bindings)
{
- return sprintf("/%s%s", $this->resourceTemplate->render($bindings), $this->renderVerb());
+ return sprintf('/%s%s', $this->resourceTemplate->render($bindings), $this->renderVerb());
}
/**
@@ -112,7 +112,7 @@ public function matches(string $path)
public function match(string $path)
{
if (empty($path)) {
- throw $this->matchException($path, "path cannot be empty");
+ throw $this->matchException($path, 'path cannot be empty');
}
if ($path[0] !== '/') {
throw $this->matchException($path, "missing leading '/'");
diff --git a/lib/Google/vendor/google/gax/src/ResourceTemplate/Parser.php b/lib/Google/vendor/google/gax/src/ResourceTemplate/Parser.php
index 9431aecdd..2bc70ad33 100644
--- a/lib/Google/vendor/google/gax/src/ResourceTemplate/Parser.php
+++ b/lib/Google/vendor/google/gax/src/ResourceTemplate/Parser.php
@@ -48,10 +48,10 @@ class Parser
* @return array
* @throws ValidationException
*/
- public static function parseSegments(string $path = null)
+ public static function parseSegments(?string $path = null)
{
if (empty($path)) {
- throw new ValidationException("Cannot parse empty path");
+ throw new ValidationException('Cannot parse empty path');
}
$segments = [];
$index = 0;
@@ -172,7 +172,7 @@ private static function parseVariableSegment(string $segmentStringWithoutBraces,
if ($equalsIndex === false) {
// If the variable does not contain '=', we assume the pattern is '*' as per google.rpc.Http
$variableKey = $segmentStringWithoutBraces;
- $nestedResource = new RelativeResourceTemplate("*");
+ $nestedResource = new RelativeResourceTemplate('*');
} else {
$variableKey = substr($segmentStringWithoutBraces, 0, $equalsIndex);
$nestedResourceString = substr($segmentStringWithoutBraces, $equalsIndex + 1);
@@ -222,6 +222,6 @@ private static function parseError(string $path, int $index, string $reason)
*/
private static function isValidLiteral(string $literal)
{
- return preg_match("/^[0-9a-zA-Z\\.\\-~_]+$/", $literal) === 1;
+ return preg_match('/^[0-9a-zA-Z\\.\\-~_]+$/', $literal) === 1;
}
}
diff --git a/lib/Google/vendor/google/gax/src/ResourceTemplate/RelativeResourceTemplate.php b/lib/Google/vendor/google/gax/src/ResourceTemplate/RelativeResourceTemplate.php
index 6bc745103..941508807 100644
--- a/lib/Google/vendor/google/gax/src/ResourceTemplate/RelativeResourceTemplate.php
+++ b/lib/Google/vendor/google/gax/src/ResourceTemplate/RelativeResourceTemplate.php
@@ -124,7 +124,7 @@ public function render(array $bindings)
$segment->getSeparator()
);
} else {
- $valueString = is_null($value) ? "null" : "'$value'";
+ $valueString = is_null($value) ? 'null' : "'$value'";
throw $this->renderingException(
$bindings,
"expected binding '$key' to match segment '$segment', instead got $valueString"
@@ -198,7 +198,7 @@ public function match(string $path)
}
if ($segment->getSeparator() === '/') {
if ($pathPiecesIndex >= $slashPathPiecesCount) {
- throw $this->matchException($path, "segment and path length mismatch");
+ throw $this->matchException($path, 'segment and path length mismatch');
}
$pathPiece = substr($slashPathPieces[$pathPiecesIndex++], $startIndex);
$startIndex = 0;
@@ -229,7 +229,7 @@ public function match(string $path)
if ($pathPiecesCount < $flattenedKeySegmentTuplesCount) {
// Each segment in $flattenedKeyedSegments must consume at least one
// segment in $pathSegments, so matching must fail.
- throw $this->matchException($path, "path does not contain enough segments to be matched");
+ throw $this->matchException($path, 'path does not contain enough segments to be matched');
}
$doubleWildcardPieceCount = $pathPiecesCount - $flattenedKeySegmentTuplesCount + 1;
@@ -287,7 +287,7 @@ private function renderingException(array $bindings, string $reason)
* @param string|null $separator An optional string separator
* @return array[] A list of [string, Segment] tuples
*/
- private static function buildKeySegmentTuples(array $segments, string $separator = null)
+ private static function buildKeySegmentTuples(array $segments, ?string $separator = null)
{
$keySegmentTuples = [];
$positionalArgumentCounter = 0;
@@ -377,7 +377,7 @@ private static function countDoubleWildcards(array $segments)
*/
private static function renderSegments(array $segmentsToRender)
{
- $renderResult = "";
+ $renderResult = '';
for ($i = 0; $i < count($segmentsToRender); $i++) {
$segment = $segmentsToRender[$i];
$renderResult .= $segment;
diff --git a/lib/Google/vendor/google/gax/src/ResourceTemplate/Segment.php b/lib/Google/vendor/google/gax/src/ResourceTemplate/Segment.php
index b9ae4fbff..fb9dc6d43 100644
--- a/lib/Google/vendor/google/gax/src/ResourceTemplate/Segment.php
+++ b/lib/Google/vendor/google/gax/src/ResourceTemplate/Segment.php
@@ -65,9 +65,9 @@ class Segment
*/
public function __construct(
int $segmentType,
- string $value = null,
- string $key = null,
- RelativeResourceTemplate $template = null,
+ ?string $value = null,
+ ?string $key = null,
+ ?RelativeResourceTemplate $template = null,
string $separator = '/'
) {
$this->segmentType = $segmentType;
@@ -81,10 +81,10 @@ public function __construct(
$this->stringRepr = "{$this->value}";
break;
case Segment::WILDCARD_SEGMENT:
- $this->stringRepr = "*";
+ $this->stringRepr = '*';
break;
case Segment::DOUBLE_WILDCARD_SEGMENT:
- $this->stringRepr = "**";
+ $this->stringRepr = '**';
break;
case Segment::VARIABLE_SEGMENT:
$this->stringRepr = "{{$this->key}={$this->template}}";
@@ -178,7 +178,7 @@ public function getSeparator()
*/
private static function isValidBinding(string $binding)
{
- return preg_match("-^[^/]+$-", $binding) === 1;
+ return preg_match('-^[^/]+$-', $binding) === 1;
}
/**
@@ -190,6 +190,6 @@ private static function isValidBinding(string $binding)
*/
private static function isValidDoubleWildcardBinding(string $binding)
{
- return preg_match("-^.+$-", $binding) === 1;
+ return preg_match('-^.+$-', $binding) === 1;
}
}
diff --git a/lib/Google/vendor/google/gax/src/Serializer.php b/lib/Google/vendor/google/gax/src/Serializer.php
index 1c39ced47..8c1047ee1 100644
--- a/lib/Google/vendor/google/gax/src/Serializer.php
+++ b/lib/Google/vendor/google/gax/src/Serializer.php
@@ -123,7 +123,7 @@ public function encodeMessage($message)
return $this->encodeMessageImpl($message, $messageType);
} catch (\Exception $e) {
throw new ValidationException(
- "Error encoding message: " . $e->getMessage(),
+ 'Error encoding message: ' . $e->getMessage(),
$e->getCode(),
$e
);
@@ -147,7 +147,7 @@ public function decodeMessage($message, array $data)
return $this->decodeMessageImpl($message, $messageType, $data);
} catch (\Exception $e) {
throw new ValidationException(
- "Error decoding message: " . $e->getMessage(),
+ 'Error decoding message: ' . $e->getMessage(),
$e->getCode(),
$e
);
@@ -409,7 +409,7 @@ private function decodeMessageImpl(Message $message, Descriptor $messageType, ar
// Unknown field found
if (!isset($fieldsByName[$fieldName])) {
throw new RuntimeException(sprintf(
- "cannot handle unknown field %s on message %s",
+ 'cannot handle unknown field %s on message %s',
$fieldName,
$messageType->getFullName()
));
@@ -503,7 +503,7 @@ public static function toCamelCase(string $key)
private static function hasBinaryHeaderSuffix(string $key)
{
- return substr_compare($key, "-bin", strlen($key) - 4) === 0;
+ return substr_compare($key, '-bin', strlen($key) - 4) === 0;
}
private static function getPhpArraySerializer()
@@ -517,7 +517,7 @@ private static function getPhpArraySerializer()
public static function loadKnownMetadataTypes()
{
foreach (self::$metadataKnownTypes as $key => $class) {
- new $class;
+ new $class();
}
}
}
diff --git a/lib/Google/vendor/google/gax/src/ServerStream.php b/lib/Google/vendor/google/gax/src/ServerStream.php
index b9c632591..548b6b48c 100644
--- a/lib/Google/vendor/google/gax/src/ServerStream.php
+++ b/lib/Google/vendor/google/gax/src/ServerStream.php
@@ -31,28 +31,40 @@
*/
namespace Google\ApiCore;
+use Google\Auth\Logging\LoggingTrait;
+use Google\Auth\Logging\RpcLogEvent;
+use Google\Protobuf\Internal\Message;
use Google\Rpc\Code;
+use Psr\Log\LoggerInterface;
/**
* ServerStream is the response object from a server streaming API call.
*/
class ServerStream
{
+ use LoggingTrait;
+
private $call;
private $resourcesGetMethod;
+ private null|LoggerInterface $logger;
/**
* ServerStream constructor.
*
* @param ServerStreamingCallInterface $serverStreamingCall The server streaming call object
* @param array $streamingDescriptor
+ * @param null|LoggerInterface $logger A PSR-3 compliant logger.
*/
- public function __construct($serverStreamingCall, array $streamingDescriptor = [])
- {
+ public function __construct(
+ $serverStreamingCall,
+ array $streamingDescriptor = [],
+ null|LoggerInterface $logger = null
+ ) {
$this->call = $serverStreamingCall;
if (array_key_exists('resourcesGetMethod', $streamingDescriptor)) {
$this->resourcesGetMethod = $streamingDescriptor['resourcesGetMethod'];
}
+ $this->logger = $logger;
}
/**
@@ -65,14 +77,21 @@ public function __construct($serverStreamingCall, array $streamingDescriptor = [
public function readAll()
{
$resourcesGetMethod = $this->resourcesGetMethod;
- if (!is_null($resourcesGetMethod)) {
- foreach ($this->call->responses() as $response) {
+ foreach ($this->call->responses() as $response) {
+ if ($this->logger && $response instanceof Message) {
+ $responseEvent = new RpcLogEvent();
+ $responseEvent->payload = $response->serializeToJsonString();
+ $responseEvent->processId = (int) getmypid();
+ $responseEvent->requestId = crc32((string) spl_object_id($this) . getmypid());
+
+ $this->logResponse($responseEvent);
+ }
+
+ if (!is_null($resourcesGetMethod)) {
foreach ($response->$resourcesGetMethod() as $resource) {
yield $resource;
}
- }
- } else {
- foreach ($this->call->responses() as $response) {
+ } else {
yield $response;
}
}
@@ -80,6 +99,16 @@ public function readAll()
// Errors in the REST transport will be thrown from there and not reach
// this handling. Successful REST server-streams will have an OK status.
$status = $this->call->getStatus();
+
+ if ($this->logger) {
+ $statusEvent = new RpcLogEvent();
+ $statusEvent->status = $status->code;
+ $statusEvent->processId = (int) getmypid();
+ $statusEvent->requestId = crc32((string) spl_object_id($this) . getmypid());
+
+ $this->logResponse($statusEvent);
+ }
+
if ($status->code !== Code::OK) {
throw ApiException::createFromStdClass($status);
}
diff --git a/lib/Google/vendor/google/gax/src/Testing/MockBidiStreamingCall.php b/lib/Google/vendor/google/gax/src/Testing/MockBidiStreamingCall.php
index 7ac698015..815cef8fc 100644
--- a/lib/Google/vendor/google/gax/src/Testing/MockBidiStreamingCall.php
+++ b/lib/Google/vendor/google/gax/src/Testing/MockBidiStreamingCall.php
@@ -59,7 +59,7 @@ class MockBidiStreamingCall extends Grpc\BidiStreamingCall
* @param mixed|null $deserialize An optional deserialize method for the response object.
* @param stdClass|null $status An optional status object. If set to null, a status of OK is used.
*/
- public function __construct(array $responses, $deserialize = null, stdClass $status = null)
+ public function __construct(array $responses, $deserialize = null, ?stdClass $status = null)
{
$this->responses = $responses;
$this->deserialize = $deserialize;
@@ -91,8 +91,8 @@ public function read()
return null;
} else {
throw new ApiException(
- "No more responses to read, but closeWrite() not called - "
- . "this would be blocking",
+ 'No more responses to read, but closeWrite() not called - '
+ . 'this would be blocking',
Grpc\STATUS_INTERNAL,
null
);
@@ -107,14 +107,14 @@ public function getStatus()
{
if (count($this->responses) > 0) {
throw new ApiException(
- "Calls to getStatus() will block if all responses are not read",
+ 'Calls to getStatus() will block if all responses are not read',
Grpc\STATUS_INTERNAL,
null
);
}
if (!$this->writesDone) {
throw new ApiException(
- "Calls to getStatus() will block if closeWrite() not called",
+ 'Calls to getStatus() will block if closeWrite() not called',
Grpc\STATUS_INTERNAL,
null
);
@@ -132,7 +132,7 @@ public function write($request, array $options = [])
{
if ($this->writesDone) {
throw new ApiException(
- "Cannot call write() after writesDone()",
+ 'Cannot call write() after writesDone()',
Grpc\STATUS_INTERNAL,
null
);
diff --git a/lib/Google/vendor/google/gax/src/Testing/MockClientStreamingCall.php b/lib/Google/vendor/google/gax/src/Testing/MockClientStreamingCall.php
index 6bf35c685..ca28e3dbf 100644
--- a/lib/Google/vendor/google/gax/src/Testing/MockClientStreamingCall.php
+++ b/lib/Google/vendor/google/gax/src/Testing/MockClientStreamingCall.php
@@ -62,7 +62,7 @@ class MockClientStreamingCall extends Grpc\ClientStreamingCall
* @param callable|array|null $deserialize An optional deserialize method for the response object.
* @param stdClass|null $status An optional status object. If set to null, a status of OK is used.
*/
- public function __construct($response, $deserialize = null, stdClass $status = null)
+ public function __construct($response, $deserialize = null, ?stdClass $status = null)
{
$this->mockUnaryCall = new MockUnaryCall($response, $deserialize, $status);
}
@@ -86,7 +86,7 @@ public function wait()
public function write($request, array $options = [])
{
if ($this->waitCalled) {
- throw new ApiException("Cannot call write() after wait()", Code::INTERNAL, ApiStatus::INTERNAL);
+ throw new ApiException('Cannot call write() after wait()', Code::INTERNAL, ApiStatus::INTERNAL);
}
if (is_a($request, '\Google\Protobuf\Internal\Message')) {
/** @var Message $newRequest */
diff --git a/lib/Google/vendor/google/gax/src/Testing/MockRequest.php b/lib/Google/vendor/google/gax/src/Testing/MockRequest.php
index df4bd4045..f7a23a30e 100644
--- a/lib/Google/vendor/google/gax/src/Testing/MockRequest.php
+++ b/lib/Google/vendor/google/gax/src/Testing/MockRequest.php
@@ -33,7 +33,8 @@ class MockRequest extends \Google\Protobuf\Internal\Message
* @type int|string $page_size
* }
*/
- public function __construct($data = NULL) {
+ public function __construct($data = null)
+ {
Mocks::initOnce();
parent::__construct($data);
}
@@ -54,7 +55,7 @@ public function getPageToken()
*/
public function setPageToken($var)
{
- GPBUtil::checkString($var, True);
+ GPBUtil::checkString($var, true);
$this->page_token = $var;
return $this;
@@ -83,4 +84,3 @@ public function setPageSize($var)
}
}
-
diff --git a/lib/Google/vendor/google/gax/src/Testing/MockRequestBody.php b/lib/Google/vendor/google/gax/src/Testing/MockRequestBody.php
index c7b805c9f..08a823305 100644
--- a/lib/Google/vendor/google/gax/src/Testing/MockRequestBody.php
+++ b/lib/Google/vendor/google/gax/src/Testing/MockRequestBody.php
@@ -91,7 +91,8 @@ class MockRequestBody extends \Google\Protobuf\Internal\Message
* @type string $field_3
* }
*/
- public function __construct($data = NULL) {
+ public function __construct($data = null)
+ {
\GPBMetadata\ApiCore\Testing\Mocks::initOnce();
parent::__construct($data);
}
@@ -112,7 +113,7 @@ public function getName()
*/
public function setName($var)
{
- GPBUtil::checkString($var, True);
+ GPBUtil::checkString($var, true);
$this->name = $var;
return $this;
@@ -221,7 +222,7 @@ public function clearBytesValue()
*/
public function getBytesValueUnwrapped()
{
- return $this->readWrapperValue("bytes_value");
+ return $this->readWrapperValue('bytes_value');
}
/**
@@ -246,8 +247,9 @@ public function setBytesValue($var)
*/
public function setBytesValueUnwrapped($var)
{
- $this->writeWrapperValue("bytes_value", $var);
- return $this;}
+ $this->writeWrapperValue('bytes_value', $var);
+ return $this;
+ }
/**
* Generated from protobuf field .google.protobuf.Duration duration_value = 6;
@@ -340,7 +342,7 @@ public function clearInt64Value()
*/
public function getInt64ValueUnwrapped()
{
- return $this->readWrapperValue("int64_value");
+ return $this->readWrapperValue('int64_value');
}
/**
@@ -365,8 +367,9 @@ public function setInt64Value($var)
*/
public function setInt64ValueUnwrapped($var)
{
- $this->writeWrapperValue("int64_value", $var);
- return $this;}
+ $this->writeWrapperValue('int64_value', $var);
+ return $this;
+ }
/**
* Generated from protobuf field .google.protobuf.ListValue list_value = 9;
@@ -427,7 +430,7 @@ public function clearStringValue()
*/
public function getStringValueUnwrapped()
{
- return $this->readWrapperValue("string_value");
+ return $this->readWrapperValue('string_value');
}
/**
@@ -452,8 +455,9 @@ public function setStringValue($var)
*/
public function setStringValueUnwrapped($var)
{
- $this->writeWrapperValue("string_value", $var);
- return $this;}
+ $this->writeWrapperValue('string_value', $var);
+ return $this;
+ }
/**
* Generated from protobuf field .google.protobuf.Struct struct_value = 11;
@@ -572,7 +576,7 @@ public function hasField1()
*/
public function setField1($var)
{
- GPBUtil::checkString($var, True);
+ GPBUtil::checkString($var, true);
$this->writeOneof(14, $var);
return $this;
@@ -599,7 +603,7 @@ public function hasField2()
*/
public function setField2($var)
{
- GPBUtil::checkString($var, True);
+ GPBUtil::checkString($var, true);
$this->writeOneof(15, $var);
return $this;
@@ -626,7 +630,7 @@ public function hasField3()
*/
public function setField3($var)
{
- GPBUtil::checkString($var, True);
+ GPBUtil::checkString($var, true);
$this->writeOneof(16, $var);
return $this;
@@ -637,8 +641,7 @@ public function setField3($var)
*/
public function getOneofField()
{
- return $this->whichOneof("oneof_field");
+ return $this->whichOneof('oneof_field');
}
}
-
diff --git a/lib/Google/vendor/google/gax/src/Testing/MockResponse.php b/lib/Google/vendor/google/gax/src/Testing/MockResponse.php
index fa9c75570..cbe7ba659 100644
--- a/lib/Google/vendor/google/gax/src/Testing/MockResponse.php
+++ b/lib/Google/vendor/google/gax/src/Testing/MockResponse.php
@@ -47,7 +47,8 @@ class MockResponse extends \Google\Protobuf\Internal\Message
* @type array|\Google\Protobuf\Internal\MapField $resources_map
* }
*/
- public function __construct($data = NULL) {
+ public function __construct($data = null)
+ {
\GPBMetadata\ApiCore\Testing\Mocks::initOnce();
parent::__construct($data);
}
@@ -68,7 +69,7 @@ public function getName()
*/
public function setName($var)
{
- GPBUtil::checkString($var, True);
+ GPBUtil::checkString($var, true);
$this->name = $var;
return $this;
@@ -134,7 +135,7 @@ public function getNextPageToken()
*/
public function setNextPageToken($var)
{
- GPBUtil::checkString($var, True);
+ GPBUtil::checkString($var, true);
$this->next_page_token = $var;
return $this;
@@ -163,4 +164,3 @@ public function setResourcesMap($var)
}
}
-
diff --git a/lib/Google/vendor/google/gax/src/Testing/MockServerStreamingCall.php b/lib/Google/vendor/google/gax/src/Testing/MockServerStreamingCall.php
index dd6378bef..d0dcead5d 100644
--- a/lib/Google/vendor/google/gax/src/Testing/MockServerStreamingCall.php
+++ b/lib/Google/vendor/google/gax/src/Testing/MockServerStreamingCall.php
@@ -57,7 +57,7 @@ class MockServerStreamingCall extends \Grpc\ServerStreamingCall implements Serve
* @param callable|array|null $deserialize An optional deserialize method for the response object.
* @param stdClass|null $status An optional status object. If set to null, a status of OK is used.
*/
- public function __construct(array $responses, $deserialize = null, stdClass $status = null)
+ public function __construct(array $responses, $deserialize = null, ?stdClass $status = null)
{
$this->responses = $responses;
$this->deserialize = $deserialize;
@@ -88,7 +88,7 @@ public function getStatus()
{
if (count($this->responses) > 0) {
throw new ApiException(
- "Calls to getStatus() will block if all responses are not read",
+ 'Calls to getStatus() will block if all responses are not read',
Code::INTERNAL,
ApiStatus::INTERNAL
);
diff --git a/lib/Google/vendor/google/gax/src/Testing/MockStatus.php b/lib/Google/vendor/google/gax/src/Testing/MockStatus.php
index fb5ea340e..6f2906356 100644
--- a/lib/Google/vendor/google/gax/src/Testing/MockStatus.php
+++ b/lib/Google/vendor/google/gax/src/Testing/MockStatus.php
@@ -44,7 +44,7 @@ class MockStatus extends stdClass
public $code;
public $details;
public $metadata;
- public function __construct($code, string $details = null, array $metadata = [])
+ public function __construct($code, ?string $details = null, array $metadata = [])
{
$this->code = $code;
$this->details = $details;
diff --git a/lib/Google/vendor/google/gax/src/Testing/MockStubTrait.php b/lib/Google/vendor/google/gax/src/Testing/MockStubTrait.php
index 7d7e58ae0..db69910aa 100644
--- a/lib/Google/vendor/google/gax/src/Testing/MockStubTrait.php
+++ b/lib/Google/vendor/google/gax/src/Testing/MockStubTrait.php
@@ -33,8 +33,8 @@
namespace Google\ApiCore\Testing;
use Google\Protobuf\Internal\Message;
-use UnderflowException;
use stdClass;
+use UnderflowException;
/**
* The MockStubTrait is used by generated mock stub classes which extent \Grpc\BaseStub
@@ -52,7 +52,7 @@ trait MockStubTrait
private $callObjects = [];
private $deserialize;
- public function __construct(callable $deserialize = null)
+ public function __construct(?callable $deserialize = null)
{
$this->deserialize = $deserialize;
}
@@ -77,7 +77,7 @@ public function _simpleRequest(
) {
$this->receivedFuncCalls[] = new ReceivedRequest($method, $argument, $deserialize, $metadata, $options);
if (count($this->responses) < 1) {
- throw new UnderflowException("ran out of responses");
+ throw new UnderflowException('ran out of responses');
}
list($response, $status) = array_shift($this->responses);
$call = new MockUnaryCall($response, $deserialize, $status);
@@ -106,7 +106,7 @@ public function _clientStreamRequest(
) {
$this->receivedFuncCalls[] = new ReceivedRequest($method, null, $deserialize, $metadata, $options);
if (count($this->responses) < 1) {
- throw new UnderflowException("ran out of responses");
+ throw new UnderflowException('ran out of responses');
}
list($response, $status) = array_shift($this->responses);
$call = new MockClientStreamingCall($response, $deserialize, $status);
@@ -196,7 +196,7 @@ public static function stripStatusFromResponses($responses)
* @param \Google\Protobuf\Internal\Message $response
* @param stdClass $status
*/
- public function addResponse($response, stdClass $status = null)
+ public function addResponse($response, ?stdClass $status = null)
{
if (!$this->deserialize && $response) {
$this->deserialize = [get_class($response), 'decode'];
@@ -263,7 +263,7 @@ public function isExhausted()
* @param callable $deserialize
* @return static An instance of the current class type.
*/
- public static function create($responseObject, stdClass $status = null, callable $deserialize = null)
+ public static function create($responseObject, ?stdClass $status = null, ?callable $deserialize = null)
{
$stub = new static($deserialize); // @phpstan-ignore-line
$stub->addResponse($responseObject, $status);
@@ -277,7 +277,7 @@ public static function create($responseObject, stdClass $status = null, callable
* @param stdClass $finalStatus
* @return static An instance of the current class type.
*/
- public static function createWithResponseSequence(array $sequence, callable $deserialize = null, stdClass $finalStatus = null)
+ public static function createWithResponseSequence(array $sequence, ?callable $deserialize = null, ?stdClass $finalStatus = null)
{
$stub = new static($deserialize); // @phpstan-ignore-line
foreach ($sequence as $elem) {
diff --git a/lib/Google/vendor/google/gax/src/Testing/MockUnaryCall.php b/lib/Google/vendor/google/gax/src/Testing/MockUnaryCall.php
index 99afce996..431b041bf 100644
--- a/lib/Google/vendor/google/gax/src/Testing/MockUnaryCall.php
+++ b/lib/Google/vendor/google/gax/src/Testing/MockUnaryCall.php
@@ -32,8 +32,8 @@
namespace Google\ApiCore\Testing;
-use Google\Rpc\Code;
use Google\Protobuf\Internal\Message;
+use Google\Rpc\Code;
use stdClass;
/**
@@ -59,7 +59,7 @@ class MockUnaryCall extends \Grpc\UnaryCall
* @param callable|array|null $deserialize An optional deserialize method for the response object.
* @param stdClass|null $status An optional status object. If set to null, a status of OK is used.
*/
- public function __construct($response = null, $deserialize = null, stdClass $status = null)
+ public function __construct($response = null, $deserialize = null, ?stdClass $status = null)
{
$this->response = $response;
$this->deserialize = $deserialize;
diff --git a/lib/Google/vendor/google/gax/src/Testing/ProtobufGPBEmptyComparator.php b/lib/Google/vendor/google/gax/src/Testing/ProtobufGPBEmptyComparator.php
index 834a7f91a..b6871a8e4 100644
--- a/lib/Google/vendor/google/gax/src/Testing/ProtobufGPBEmptyComparator.php
+++ b/lib/Google/vendor/google/gax/src/Testing/ProtobufGPBEmptyComparator.php
@@ -36,7 +36,7 @@ class ProtobufGPBEmptyComparator extends Comparator
*/
public function accepts($expected, $actual)
{
- return $expected instanceof GPBEmpty && $actual instanceof GPBEmpty;
+ return $expected instanceof GPBEmpty && $actual instanceof GPBEmpty;
}
/**
@@ -54,7 +54,7 @@ public function accepts($expected, $actual)
* fails. Contains information about the
* specific errors that lead to the failure.
*/
- public function assertEquals($expected, $actual, $delta = 0, $canonicalize = FALSE, $ignoreCase = FALSE)
+ public function assertEquals($expected, $actual, $delta = 0, $canonicalize = false, $ignoreCase = false)
{
// No need to do anything here.
}
diff --git a/lib/Google/vendor/google/gax/src/Testing/ProtobufMessageComparator.php b/lib/Google/vendor/google/gax/src/Testing/ProtobufMessageComparator.php
index 472e941f2..55fb21367 100644
--- a/lib/Google/vendor/google/gax/src/Testing/ProtobufMessageComparator.php
+++ b/lib/Google/vendor/google/gax/src/Testing/ProtobufMessageComparator.php
@@ -63,7 +63,7 @@ public function accepts($expected, $actual)
* fails. Contains information about the
* specific errors that lead to the failure.
*/
- public function assertEquals($expected, $actual, $delta = 0, $canonicalize = FALSE, $ignoreCase = FALSE)
+ public function assertEquals($expected, $actual, $delta = 0, $canonicalize = false, $ignoreCase = false)
{
if ($expected->serializeToString() !== $actual->serializeToString()) {
throw new ComparisonFailure(
diff --git a/lib/Google/vendor/google/gax/src/Transport/GrpcFallbackTransport.php b/lib/Google/vendor/google/gax/src/Transport/GrpcFallbackTransport.php
index 1cd48376e..b248b052e 100644
--- a/lib/Google/vendor/google/gax/src/Transport/GrpcFallbackTransport.php
+++ b/lib/Google/vendor/google/gax/src/Transport/GrpcFallbackTransport.php
@@ -62,7 +62,7 @@ class GrpcFallbackTransport implements TransportInterface
*/
public function __construct(
string $baseUri,
- callable $httpHandler
+ callable $httpHandler,
) {
$this->baseUri = $baseUri;
$this->httpHandler = $httpHandler;
@@ -87,9 +87,10 @@ public static function build(string $apiEndpoint, array $config = [])
$config += [
'httpHandler' => null,
'clientCertSource' => null,
+ 'logger' => null,
];
list($baseUri, $port) = self::normalizeServiceAddress($apiEndpoint);
- $httpHandler = $config['httpHandler'] ?: self::buildHttpHandlerAsync();
+ $httpHandler = $config['httpHandler'] ?: self::buildHttpHandlerAsync(logger: $config['logger']);
$transport = new GrpcFallbackTransport("$baseUri:$port", $httpHandler);
if ($config['clientCertSource']) {
$transport->configureMtlsChannel($config['clientCertSource']);
@@ -103,6 +104,9 @@ public static function build(string $apiEndpoint, array $config = [])
public function startUnaryCall(Call $call, array $options)
{
$httpHandler = $this->httpHandler;
+
+ $options['requestId'] = crc32((string) spl_object_id($call) . getmypid());
+
return $httpHandler(
$this->buildRequest($call, $options),
$this->getCallOptions($options)
@@ -159,8 +163,8 @@ private function unpackResponse(Call $call, ResponseInterface $response)
{
$decodeType = $call->getDecodeType();
/** @var Message $responseMessage */
- $responseMessage = new $decodeType;
- $responseMessage->mergeFromString((string)$response->getBody());
+ $responseMessage = new $decodeType();
+ $responseMessage->mergeFromString((string) $response->getBody());
return $responseMessage;
}
@@ -176,6 +180,14 @@ private function getCallOptions(array $options)
$callOptions['timeout'] = $options['timeoutMillis'] / 1000;
}
+ if (isset($options['retryAttempt'])) {
+ $callOptions['retryAttempt'] = $options['retryAttempt'];
+ }
+
+ if (isset($options['requestId'])) {
+ $callOptions['requestId'] = $options['requestId'];
+ }
+
if ($this->clientCertSource) {
list($cert, $key) = self::loadClientCertSource($this->clientCertSource);
$callOptions['cert'] = $cert;
diff --git a/lib/Google/vendor/google/gax/src/Transport/GrpcTransport.php b/lib/Google/vendor/google/gax/src/Transport/GrpcTransport.php
index 3bc3328e8..ebcbc07b2 100644
--- a/lib/Google/vendor/google/gax/src/Transport/GrpcTransport.php
+++ b/lib/Google/vendor/google/gax/src/Transport/GrpcTransport.php
@@ -44,12 +44,15 @@
use Google\ApiCore\Transport\Grpc\UnaryInterceptorInterface;
use Google\ApiCore\ValidationException;
use Google\ApiCore\ValidationTrait;
+use Google\Auth\Logging\LoggingTrait;
+use Google\Auth\Logging\RpcLogEvent;
use Google\Rpc\Code;
use Grpc\BaseStub;
use Grpc\Channel;
use Grpc\ChannelCredentials;
use Grpc\Interceptor;
use GuzzleHttp\Promise\Promise;
+use Psr\Log\LoggerInterface;
/**
* A gRPC based transport implementation.
@@ -59,6 +62,9 @@ class GrpcTransport extends BaseStub implements TransportInterface
use ValidationTrait;
use GrpcSupportTrait;
use ServiceAddressTrait;
+ use LoggingTrait;
+
+ private null|LoggerInterface $logger;
/**
* @param string $hostname
@@ -75,10 +81,16 @@ class GrpcTransport extends BaseStub implements TransportInterface
* release. To prepare for this, please take the time to convert
* `UnaryInterceptorInterface` implementations over to a class which
* extends {@see Grpc\Interceptor}.
+ * @param null|false|LoggerInterface $logger A PSR-3 Compliant logger.
* @throws Exception
*/
- public function __construct(string $hostname, array $opts, Channel $channel = null, array $interceptors = [])
- {
+ public function __construct(
+ string $hostname,
+ array $opts,
+ ?Channel $channel = null,
+ array $interceptors = [],
+ null|false|LoggerInterface $logger = null
+ ) {
if ($interceptors) {
$channel = Interceptor::intercept(
$channel ?: new Channel($hostname, $opts),
@@ -87,6 +99,7 @@ public function __construct(string $hostname, array $opts, Channel $channel = nu
}
parent::__construct($hostname, $opts, $channel);
+ $this->logger = $logger;
}
/**
@@ -122,6 +135,7 @@ public static function build(string $apiEndpoint, array $config = [])
'channel' => null,
'interceptors' => [],
'clientCertSource' => null,
+ 'logger' => null,
];
list($addr, $port) = self::normalizeServiceAddress($apiEndpoint);
$host = "$addr:$port";
@@ -140,14 +154,17 @@ public static function build(string $apiEndpoint, array $config = [])
if (!is_null($channel) && !($channel instanceof Channel)) {
throw new ValidationException(
"Channel argument to GrpcTransport must be of type \Grpc\Channel, " .
- "instead got: " . print_r($channel, true)
+ 'instead got: ' . print_r($channel, true)
);
}
try {
- return new GrpcTransport($host, $stubOpts, $channel, $config['interceptors']);
+ if ($config['logger'] === false) {
+ $config['logger'] = null;
+ }
+ return new GrpcTransport($host, $stubOpts, $channel, $config['interceptors'], $config['logger']);
} catch (Exception $ex) {
throw new ValidationException(
- "Failed to build GrpcTransport: " . $ex->getMessage(),
+ 'Failed to build GrpcTransport: ' . $ex->getMessage(),
$ex->getCode(),
$ex
);
@@ -168,7 +185,8 @@ public function startBidiStreamingCall(Call $call, array $options)
isset($options['headers']) ? $options['headers'] : [],
$this->getCallOptions($options)
),
- $call->getDescriptor()
+ $call->getDescriptor(),
+ $this->logger
);
}
@@ -187,7 +205,8 @@ public function startClientStreamingCall(Call $call, array $options)
isset($options['headers']) ? $options['headers'] : [],
$this->getCallOptions($options)
),
- $call->getDescriptor()
+ $call->getDescriptor(),
+ $this->logger
);
}
@@ -212,10 +231,28 @@ public function startServerStreamingCall(Call $call, array $options)
isset($options['headers']) ? $options['headers'] : [],
$this->getCallOptions($options)
);
- return new ServerStream(
+
+ $serverStream = new ServerStream(
new ServerStreamingCallWrapper($stream),
- $call->getDescriptor()
+ $call->getDescriptor(),
+ $this->logger
);
+
+ if ($this->logger) {
+ $requestEvent = new RpcLogEvent();
+
+ $requestEvent->headers = $options['headers'];
+ $requestEvent->payload = $call->getMessage()->serializeToJsonString();
+ $requestEvent->retryAttempt = $options['retryAttempt'] ?? null;
+ $requestEvent->serviceName = $options['serviceName'] ?? null;
+ $requestEvent->rpcName = $call->getMethod();
+ $requestEvent->processId = (int) getmypid();
+ $requestEvent->requestId = crc32((string) spl_object_id($serverStream) . getmypid());
+
+ $this->logRequest($requestEvent);
+ }
+
+ return $serverStream;
}
/**
@@ -224,6 +261,8 @@ public function startServerStreamingCall(Call $call, array $options)
public function startUnaryCall(Call $call, array $options)
{
$this->verifyUniverseDomain($options);
+ $headers = $options['headers'] ?? [];
+ $requestEvent = null;
$unaryCall = $this->_simpleRequest(
'/' . $call->getMethod(),
@@ -233,11 +272,37 @@ public function startUnaryCall(Call $call, array $options)
$this->getCallOptions($options)
);
+ if ($this->logger) {
+ $requestEvent = new RpcLogEvent();
+
+ $requestEvent->headers = $headers;
+ $requestEvent->payload = $call->getMessage()->serializeToJsonString();
+ $requestEvent->retryAttempt = $options['retryAttempt'] ?? null;
+ $requestEvent->serviceName = $options['serviceName'] ?? null;
+ $requestEvent->rpcName = $call->getMethod();
+ $requestEvent->processId = (int) getmypid();
+ $requestEvent->requestId = crc32((string) spl_object_id($call) . getmypid());
+
+ $this->logRequest($requestEvent);
+ }
+
/** @var Promise $promise */
$promise = new Promise(
- function () use ($unaryCall, $options, &$promise) {
+ function () use ($unaryCall, $options, &$promise, $requestEvent) {
list($response, $status) = $unaryCall->wait();
+ if ($this->logger) {
+ $responseEvent = new RpcLogEvent($requestEvent->milliseconds);
+
+ $responseEvent->headers = $status->metadata;
+ $responseEvent->payload = ($response) ? $response->serializeToJsonString() : null;
+ $responseEvent->status = $status->code;
+ $responseEvent->processId = $requestEvent->processId;
+ $responseEvent->requestId = $requestEvent->requestId;
+
+ $this->logResponse($responseEvent);
+ }
+
if ($status->code == Code::OK) {
if (isset($options['metadataCallback'])) {
$metadataCallback = $options['metadataCallback'];
diff --git a/lib/Google/vendor/google/gax/src/Transport/HttpUnaryTransportTrait.php b/lib/Google/vendor/google/gax/src/Transport/HttpUnaryTransportTrait.php
index 1bcc686b5..38c4ca1f5 100644
--- a/lib/Google/vendor/google/gax/src/Transport/HttpUnaryTransportTrait.php
+++ b/lib/Google/vendor/google/gax/src/Transport/HttpUnaryTransportTrait.php
@@ -35,6 +35,7 @@
use Google\ApiCore\Call;
use Google\ApiCore\ValidationException;
use Google\Auth\HttpHandler\HttpHandlerFactory;
+use Psr\Log\LoggerInterface;
/**
* A trait for shared functionality between transports that support only unary RPCs using simple
@@ -126,12 +127,12 @@ private static function buildCommonHeaders(array $options)
* @return callable
* @throws ValidationException
*/
- private static function buildHttpHandlerAsync()
+ private static function buildHttpHandlerAsync(null|false|LoggerInterface $logger = null)
{
try {
- return [HttpHandlerFactory::build(), 'async'];
+ return [HttpHandlerFactory::build(logger: $logger), 'async'];
} catch (Exception $ex) {
- throw new ValidationException("Failed to build HttpHandler", $ex->getCode(), $ex);
+ throw new ValidationException('Failed to build HttpHandler', $ex->getCode(), $ex);
}
}
diff --git a/lib/Google/vendor/google/gax/src/Transport/Rest/JsonStreamDecoder.php b/lib/Google/vendor/google/gax/src/Transport/Rest/JsonStreamDecoder.php
index b173cf3a1..c01f21135 100644
--- a/lib/Google/vendor/google/gax/src/Transport/Rest/JsonStreamDecoder.php
+++ b/lib/Google/vendor/google/gax/src/Transport/Rest/JsonStreamDecoder.php
@@ -164,7 +164,7 @@ private function _decode()
if ($b === '}' && !$str) {
$level--;
if ($level === 1) {
- $end = $cursor+1;
+ $end = $cursor + 1;
}
}
// Track the closing of an array if not in a string value.
@@ -195,7 +195,7 @@ private function _decode()
// Dump the part of the chunk used for parsing the message
// and use the remaining for the next message.
- $remaining = $chunkLength-$length;
+ $remaining = $chunkLength - $length;
$chunk = substr($chunk, $end, $remaining);
// Reset all indices and exit chunk processing.
diff --git a/lib/Google/vendor/google/gax/src/Transport/RestTransport.php b/lib/Google/vendor/google/gax/src/Transport/RestTransport.php
index 294879807..296937fa4 100644
--- a/lib/Google/vendor/google/gax/src/Transport/RestTransport.php
+++ b/lib/Google/vendor/google/gax/src/Transport/RestTransport.php
@@ -31,9 +31,9 @@
*/
namespace Google\ApiCore\Transport;
-use BadMethodCallException;
use Google\ApiCore\ApiException;
use Google\ApiCore\Call;
+use Google\ApiCore\InsecureRequestBuilder;
use Google\ApiCore\RequestBuilder;
use Google\ApiCore\ServerStream;
use Google\ApiCore\ServiceAddressTrait;
@@ -84,6 +84,7 @@ public function __construct(
*
* @type callable $httpHandler A handler used to deliver PSR-7 requests.
* @type callable $clientCertSource A callable which returns the client cert as a string.
+ * @type bool $hasEmulator True if the emulator is enabled.
* }
* @return RestTransport
* @throws ValidationException
@@ -93,10 +94,14 @@ public static function build(string $apiEndpoint, string $restConfigPath, array
$config += [
'httpHandler' => null,
'clientCertSource' => null,
+ 'hasEmulator' => false,
+ 'logger' => null,
];
list($baseUri, $port) = self::normalizeServiceAddress($apiEndpoint);
- $requestBuilder = new RequestBuilder("$baseUri:$port", $restConfigPath);
- $httpHandler = $config['httpHandler'] ?: self::buildHttpHandlerAsync();
+ $requestBuilder = $config['hasEmulator']
+ ? new InsecureRequestBuilder("$baseUri:$port", $restConfigPath)
+ : new RequestBuilder("$baseUri:$port", $restConfigPath);
+ $httpHandler = $config['httpHandler'] ?: self::buildHttpHandlerAsync($config['logger']);
$transport = new RestTransport($requestBuilder, $httpHandler);
if ($config['clientCertSource']) {
$transport->configureMtlsChannel($config['clientCertSource']);
@@ -111,6 +116,9 @@ public function startUnaryCall(Call $call, array $options)
{
$headers = self::buildCommonHeaders($options);
+ // Add the $call object ID for logging
+ $options['requestId'] = crc32((string) spl_object_id($call) . getmypid());
+
// call the HTTP handler
$httpHandler = $this->httpHandler;
return $httpHandler(
@@ -124,7 +132,7 @@ public function startUnaryCall(Call $call, array $options)
function (ResponseInterface $response) use ($call, $options) {
$decodeType = $call->getDecodeType();
/** @var Message $return */
- $return = new $decodeType;
+ $return = new $decodeType();
$body = (string) $response->getBody();
// In some rare cases LRO response metadata may not be loaded
@@ -262,6 +270,14 @@ private function getCallOptions(array $options)
$callOptions['key'] = $key;
}
+ if (isset($options['retryAttempt'])) {
+ $callOptions['retryAttempt'] = $options['retryAttempt'];
+ }
+
+ if (isset($options['requestId'])) {
+ $callOptions['requestId'] = $options['requestId'];
+ }
+
return $callOptions;
}
}
diff --git a/lib/Google/vendor/google/gax/src/Version.php b/lib/Google/vendor/google/gax/src/Version.php
index 0d2f44928..f181dd874 100644
--- a/lib/Google/vendor/google/gax/src/Version.php
+++ b/lib/Google/vendor/google/gax/src/Version.php
@@ -64,7 +64,7 @@ public static function readVersionFile(string $file)
{
$versionString = file_exists($file)
? (string) file_get_contents($file)
- : "";
+ : '';
return trim($versionString);
}
diff --git a/lib/Google/vendor/google/longrunning/README.md b/lib/Google/vendor/google/longrunning/README.md
index 47c49d302..2b34d4f29 100644
--- a/lib/Google/vendor/google/longrunning/README.md
+++ b/lib/Google/vendor/google/longrunning/README.md
@@ -28,6 +28,11 @@ please see our [gRPC installation guide](https://cloud.google.com/php/grpc).
Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information
on authenticating your client. Once authenticated, you'll be ready to start making requests.
+### Debugging
+
+Please see our [Debugging guide](https://github.com/googleapis/google-cloud-php/blob/main/DEBUG.md)
+for more information about the debugging tools.
+
### Version
This component is considered beta. As such, it should be expected to be mostly
diff --git a/lib/Google/vendor/google/longrunning/VERSION b/lib/Google/vendor/google/longrunning/VERSION
index 17b2ccd9b..ef52a6480 100644
--- a/lib/Google/vendor/google/longrunning/VERSION
+++ b/lib/Google/vendor/google/longrunning/VERSION
@@ -1 +1 @@
-0.4.3
+0.4.6
diff --git a/lib/Google/vendor/google/longrunning/composer.json b/lib/Google/vendor/google/longrunning/composer.json
index ac162baf4..bec78c5d0 100644
--- a/lib/Google/vendor/google/longrunning/composer.json
+++ b/lib/Google/vendor/google/longrunning/composer.json
@@ -3,7 +3,7 @@
"description": "Google LongRunning Client for PHP",
"license": "Apache-2.0",
"minimum-stability": "stable",
- "version": "0.4.3",
+ "version": "0.4.6",
"autoload": {
"psr-4": {
"Google\\ApiCore\\LongRunning\\": "src/ApiCore/LongRunning",
@@ -20,7 +20,7 @@
}
},
"require-dev": {
- "google/gax": "^1.34.0",
+ "google/gax": "^1.36.0",
"phpunit/phpunit": "^9.0"
}
}
diff --git a/lib/Google/vendor/google/longrunning/metadata/Longrunning/Operations.php b/lib/Google/vendor/google/longrunning/metadata/Longrunning/Operations.php
index 2ed35d918..0dcf976e5 100644
Binary files a/lib/Google/vendor/google/longrunning/metadata/Longrunning/Operations.php and b/lib/Google/vendor/google/longrunning/metadata/Longrunning/Operations.php differ
diff --git a/lib/Google/vendor/google/longrunning/src/LongRunning/CancelOperationRequest.php b/lib/Google/vendor/google/longrunning/src/LongRunning/CancelOperationRequest.php
index d596e8a80..3bd2d1328 100644
--- a/lib/Google/vendor/google/longrunning/src/LongRunning/CancelOperationRequest.php
+++ b/lib/Google/vendor/google/longrunning/src/LongRunning/CancelOperationRequest.php
@@ -9,7 +9,8 @@
use Google\Protobuf\Internal\GPBUtil;
/**
- * The request message for [Operations.CancelOperation][google.longrunning.Operations.CancelOperation].
+ * The request message for
+ * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation].
*
* Generated from protobuf message google.longrunning.CancelOperationRequest
*/
diff --git a/lib/Google/vendor/google/longrunning/src/LongRunning/Client/OperationsClient.php b/lib/Google/vendor/google/longrunning/src/LongRunning/Client/OperationsClient.php
index d3697fc93..e275b18af 100644
--- a/lib/Google/vendor/google/longrunning/src/LongRunning/Client/OperationsClient.php
+++ b/lib/Google/vendor/google/longrunning/src/LongRunning/Client/OperationsClient.php
@@ -39,26 +39,27 @@
use Google\LongRunning\Operation;
use Google\LongRunning\WaitOperationRequest;
use GuzzleHttp\Promise\PromiseInterface;
+use Psr\Log\LoggerInterface;
/**
* Service Description: Manages long-running operations with an API service.
*
* When an API method normally takes long time to complete, it can be designed
- * to return [Operation][google.longrunning.Operation] to the client, and the client can use this
- * interface to receive the real response asynchronously by polling the
- * operation resource, or pass the operation resource to another API (such as
- * Google Cloud Pub/Sub API) to receive the response. Any API service that
- * returns long-running operations should implement the `Operations` interface
- * so developers can have a consistent client experience.
+ * to return [Operation][google.longrunning.Operation] to the client, and the
+ * client can use this interface to receive the real response asynchronously by
+ * polling the operation resource, or pass the operation resource to another API
+ * (such as Pub/Sub API) to receive the response. Any API service that returns
+ * long-running operations should implement the `Operations` interface so
+ * developers can have a consistent client experience.
*
* This class provides the ability to make remote calls to the backing service through method
* calls that map to API methods.
*
- * @method PromiseInterface cancelOperationAsync(CancelOperationRequest $request, array $optionalArgs = [])
- * @method PromiseInterface deleteOperationAsync(DeleteOperationRequest $request, array $optionalArgs = [])
- * @method PromiseInterface getOperationAsync(GetOperationRequest $request, array $optionalArgs = [])
- * @method PromiseInterface listOperationsAsync(ListOperationsRequest $request, array $optionalArgs = [])
- * @method PromiseInterface waitOperationAsync(WaitOperationRequest $request, array $optionalArgs = [])
+ * @method PromiseInterface cancelOperationAsync(CancelOperationRequest $request, array $optionalArgs = [])
+ * @method PromiseInterface deleteOperationAsync(DeleteOperationRequest $request, array $optionalArgs = [])
+ * @method PromiseInterface getOperationAsync(GetOperationRequest $request, array $optionalArgs = [])
+ * @method PromiseInterface listOperationsAsync(ListOperationsRequest $request, array $optionalArgs = [])
+ * @method PromiseInterface waitOperationAsync(WaitOperationRequest $request, array $optionalArgs = [])
*/
class OperationsClient
{
@@ -155,6 +156,9 @@ private static function getClientDefaults()
* @type callable $clientCertSource
* A callable which returns the client cert as a string. This can be used to
* provide a certificate and private key to the transport layer for mTLS.
+ * @type false|LoggerInterface $logger
+ * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
+ * 'GOOGLE_SDK_PHP_LOGGING' environment flag
* }
*
* @throws ValidationException
@@ -185,8 +189,9 @@ public function __call($method, $args)
* other methods to check whether the cancellation succeeded or whether the
* operation completed despite cancellation. On successful cancellation,
* the operation is not deleted; instead, it becomes an operation with
- * an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
- * corresponding to `Code.CANCELLED`.
+ * an [Operation.error][google.longrunning.Operation.error] value with a
+ * [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to
+ * `Code.CANCELLED`.
*
* The async variant is {@see OperationsClient::cancelOperationAsync()} .
*
@@ -268,14 +273,6 @@ public function getOperation(GetOperationRequest $request, array $callOptions =
* Lists operations that match the specified filter in the request. If the
* server doesn't support this method, it returns `UNIMPLEMENTED`.
*
- * NOTE: the `name` binding allows API services to override the binding
- * to use different resource name schemes, such as `users/*/operations`. To
- * override the binding, API services can add a binding such as
- * `"/v1/{name=users/*}/operations"` to their service configuration.
- * For backwards compatibility, the default name includes the operations
- * collection id, however overriding users must ensure the name binding
- * is the parent resource, without the operations collection id.
- *
* The async variant is {@see OperationsClient::listOperationsAsync()} .
*
* @example samples/OperationsClient/list_operations.php
diff --git a/lib/Google/vendor/google/longrunning/src/LongRunning/DeleteOperationRequest.php b/lib/Google/vendor/google/longrunning/src/LongRunning/DeleteOperationRequest.php
index 943a6498c..c79382a22 100644
--- a/lib/Google/vendor/google/longrunning/src/LongRunning/DeleteOperationRequest.php
+++ b/lib/Google/vendor/google/longrunning/src/LongRunning/DeleteOperationRequest.php
@@ -9,7 +9,8 @@
use Google\Protobuf\Internal\GPBUtil;
/**
- * The request message for [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation].
+ * The request message for
+ * [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation].
*
* Generated from protobuf message google.longrunning.DeleteOperationRequest
*/
diff --git a/lib/Google/vendor/google/longrunning/src/LongRunning/Gapic/OperationsGapicClient.php b/lib/Google/vendor/google/longrunning/src/LongRunning/Gapic/OperationsGapicClient.php
index c0de812ae..3c31a4fda 100644
--- a/lib/Google/vendor/google/longrunning/src/LongRunning/Gapic/OperationsGapicClient.php
+++ b/lib/Google/vendor/google/longrunning/src/LongRunning/Gapic/OperationsGapicClient.php
@@ -46,12 +46,12 @@
* Service Description: Manages long-running operations with an API service.
*
* When an API method normally takes long time to complete, it can be designed
- * to return [Operation][google.longrunning.Operation] to the client, and the client can use this
- * interface to receive the real response asynchronously by polling the
- * operation resource, or pass the operation resource to another API (such as
- * Google Cloud Pub/Sub API) to receive the response. Any API service that
- * returns long-running operations should implement the `Operations` interface
- * so developers can have a consistent client experience.
+ * to return [Operation][google.longrunning.Operation] to the client, and the
+ * client can use this interface to receive the real response asynchronously by
+ * polling the operation resource, or pass the operation resource to another API
+ * (such as Pub/Sub API) to receive the response. Any API service that returns
+ * long-running operations should implement the `Operations` interface so
+ * developers can have a consistent client experience.
*
* This class provides the ability to make remote calls to the backing service through method
* calls that map to API methods. Sample code to get started:
@@ -188,8 +188,9 @@ public function __construct(array $options = [])
* other methods to check whether the cancellation succeeded or whether the
* operation completed despite cancellation. On successful cancellation,
* the operation is not deleted; instead, it becomes an operation with
- * an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
- * corresponding to `Code.CANCELLED`.
+ * an [Operation.error][google.longrunning.Operation.error] value with a
+ * [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to
+ * `Code.CANCELLED`.
*
* Sample code:
* ```
@@ -337,14 +338,6 @@ public function getOperation($name, array $optionalArgs = [])
* Lists operations that match the specified filter in the request. If the
* server doesn't support this method, it returns `UNIMPLEMENTED`.
*
- * NOTE: the `name` binding allows API services to override the binding
- * to use different resource name schemes, such as `users/*/operations`. To
- * override the binding, API services can add a binding such as
- * `"/v1/{name=users/*}/operations"` to their service configuration.
- * For backwards compatibility, the default name includes the operations
- * collection id, however overriding users must ensure the name binding
- * is the parent resource, without the operations collection id.
- *
* Sample code:
* ```
* $operationsClient = new OperationsClient();
diff --git a/lib/Google/vendor/google/longrunning/src/LongRunning/GetOperationRequest.php b/lib/Google/vendor/google/longrunning/src/LongRunning/GetOperationRequest.php
index d89d75cc6..1fa48a5cf 100644
--- a/lib/Google/vendor/google/longrunning/src/LongRunning/GetOperationRequest.php
+++ b/lib/Google/vendor/google/longrunning/src/LongRunning/GetOperationRequest.php
@@ -9,7 +9,8 @@
use Google\Protobuf\Internal\GPBUtil;
/**
- * The request message for [Operations.GetOperation][google.longrunning.Operations.GetOperation].
+ * The request message for
+ * [Operations.GetOperation][google.longrunning.Operations.GetOperation].
*
* Generated from protobuf message google.longrunning.GetOperationRequest
*/
diff --git a/lib/Google/vendor/google/longrunning/src/LongRunning/ListOperationsRequest.php b/lib/Google/vendor/google/longrunning/src/LongRunning/ListOperationsRequest.php
index 3ad0bebe8..08049d248 100644
--- a/lib/Google/vendor/google/longrunning/src/LongRunning/ListOperationsRequest.php
+++ b/lib/Google/vendor/google/longrunning/src/LongRunning/ListOperationsRequest.php
@@ -9,7 +9,8 @@
use Google\Protobuf\Internal\GPBUtil;
/**
- * The request message for [Operations.ListOperations][google.longrunning.Operations.ListOperations].
+ * The request message for
+ * [Operations.ListOperations][google.longrunning.Operations.ListOperations].
*
* Generated from protobuf message google.longrunning.ListOperationsRequest
*/
diff --git a/lib/Google/vendor/google/longrunning/src/LongRunning/ListOperationsResponse.php b/lib/Google/vendor/google/longrunning/src/LongRunning/ListOperationsResponse.php
index 8da087dd2..4fd271861 100644
--- a/lib/Google/vendor/google/longrunning/src/LongRunning/ListOperationsResponse.php
+++ b/lib/Google/vendor/google/longrunning/src/LongRunning/ListOperationsResponse.php
@@ -9,7 +9,8 @@
use Google\Protobuf\Internal\GPBUtil;
/**
- * The response message for [Operations.ListOperations][google.longrunning.Operations.ListOperations].
+ * The response message for
+ * [Operations.ListOperations][google.longrunning.Operations.ListOperations].
*
* Generated from protobuf message google.longrunning.ListOperationsResponse
*/
diff --git a/lib/Google/vendor/google/longrunning/src/LongRunning/Operation.php b/lib/Google/vendor/google/longrunning/src/LongRunning/Operation.php
index 81f856c36..e8fec9e65 100644
--- a/lib/Google/vendor/google/longrunning/src/LongRunning/Operation.php
+++ b/lib/Google/vendor/google/longrunning/src/LongRunning/Operation.php
@@ -65,7 +65,7 @@ class Operation extends \Google\Protobuf\Internal\Message
* @type \Google\Rpc\Status $error
* The error result of the operation in case of failure or cancellation.
* @type \Google\Protobuf\Any $response
- * The normal response of the operation in case of success. If the original
+ * The normal, successful response of the operation. If the original
* method returns no data on success, such as `Delete`, the response is
* `google.protobuf.Empty`. If the original method is standard
* `Get`/`Create`/`Update`, the response should be the resource. For other
@@ -214,7 +214,7 @@ public function setError($var)
}
/**
- * The normal response of the operation in case of success. If the original
+ * The normal, successful response of the operation. If the original
* method returns no data on success, such as `Delete`, the response is
* `google.protobuf.Empty`. If the original method is standard
* `Get`/`Create`/`Update`, the response should be the resource. For other
@@ -237,7 +237,7 @@ public function hasResponse()
}
/**
- * The normal response of the operation in case of success. If the original
+ * The normal, successful response of the operation. If the original
* method returns no data on success, such as `Delete`, the response is
* `google.protobuf.Empty`. If the original method is standard
* `Get`/`Create`/`Update`, the response should be the resource. For other
diff --git a/lib/Google/vendor/google/longrunning/src/LongRunning/OperationInfo.php b/lib/Google/vendor/google/longrunning/src/LongRunning/OperationInfo.php
index 35ebb15b5..c6533199a 100644
--- a/lib/Google/vendor/google/longrunning/src/LongRunning/OperationInfo.php
+++ b/lib/Google/vendor/google/longrunning/src/LongRunning/OperationInfo.php
@@ -11,13 +11,12 @@
/**
* A message representing the message types used by a long-running operation.
* Example:
- * rpc LongRunningRecognize(LongRunningRecognizeRequest)
- * returns (google.longrunning.Operation) {
- * option (google.longrunning.operation_info) = {
- * response_type: "LongRunningRecognizeResponse"
- * metadata_type: "LongRunningRecognizeMetadata"
- * };
- * }
+ * rpc Export(ExportRequest) returns (google.longrunning.Operation) {
+ * option (google.longrunning.operation_info) = {
+ * response_type: "ExportResponse"
+ * metadata_type: "ExportMetadata"
+ * };
+ * }
*
* Generated from protobuf message google.longrunning.OperationInfo
*/
diff --git a/lib/Google/vendor/google/longrunning/src/LongRunning/WaitOperationRequest.php b/lib/Google/vendor/google/longrunning/src/LongRunning/WaitOperationRequest.php
index 7da6bc734..07914090b 100644
--- a/lib/Google/vendor/google/longrunning/src/LongRunning/WaitOperationRequest.php
+++ b/lib/Google/vendor/google/longrunning/src/LongRunning/WaitOperationRequest.php
@@ -9,7 +9,8 @@
use Google\Protobuf\Internal\GPBUtil;
/**
- * The request message for [Operations.WaitOperation][google.longrunning.Operations.WaitOperation].
+ * The request message for
+ * [Operations.WaitOperation][google.longrunning.Operations.WaitOperation].
*
* Generated from protobuf message google.longrunning.WaitOperationRequest
*/
diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/AnyBase.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/AnyBase.php
index 5e9ab5705..7ae4ce669 100644
--- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/AnyBase.php
+++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/AnyBase.php
@@ -29,14 +29,14 @@ public function unpack()
throw new \Exception(
"Type url needs to be type.googleapis.com/fully-qulified");
}
- $fully_qualifed_name =
+ $fully_qualified_name =
substr($this->type_url, $url_prifix_len);
// Create message according to fully qualified name.
$pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
- $desc = $pool->getDescriptorByProtoName($fully_qualifed_name);
+ $desc = $pool->getDescriptorByProtoName($fully_qualified_name);
if (is_null($desc)) {
- throw new \Exception("Class ".$fully_qualifed_name
+ throw new \Exception("Class ".$fully_qualified_name
." hasn't been added to descriptor pool");
}
$klass = $desc->getClass();
@@ -66,8 +66,8 @@ public function pack($msg)
// Set type url.
$pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
$desc = $pool->getDescriptorByClassName(get_class($msg));
- $fully_qualifed_name = $desc->getFullName();
- $this->type_url = GPBUtil::TYPE_URL_PREFIX . $fully_qualifed_name;
+ $fully_qualified_name = $desc->getFullName();
+ $this->type_url = GPBUtil::TYPE_URL_PREFIX . $fully_qualified_name;
}
/**
@@ -79,8 +79,8 @@ public function is($klass)
{
$pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
$desc = $pool->getDescriptorByClassName($klass);
- $fully_qualifed_name = $desc->getFullName();
- $type_url = GPBUtil::TYPE_URL_PREFIX . $fully_qualifed_name;
+ $fully_qualified_name = $desc->getFullName();
+ $type_url = GPBUtil::TYPE_URL_PREFIX . $fully_qualified_name;
return $this->type_url === $type_url;
}
}
diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions.php
index ea32e7f2a..6f1d54b7e 100644
--- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions.php
+++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/FieldOptions.php
@@ -28,7 +28,7 @@ class FieldOptions extends \Google\Protobuf\Internal\Message
* The packed option can be enabled for repeated primitive fields to enable
* a more efficient representation on the wire. Rather than repeatedly
* writing the tag and type for each element, the entire array is encoded as
- * a single length-delimited blob. In proto3, only explicit setting it to
+ * a single length-prefixed blob. In proto3, only explicit setting it to
* false will avoid using packed encoding.
*
* Generated from protobuf field optional bool packed = 2;
@@ -125,7 +125,7 @@ class FieldOptions extends \Google\Protobuf\Internal\Message
* The packed option can be enabled for repeated primitive fields to enable
* a more efficient representation on the wire. Rather than repeatedly
* writing the tag and type for each element, the entire array is encoded as
- * a single length-delimited blob. In proto3, only explicit setting it to
+ * a single length-prefixed blob. In proto3, only explicit setting it to
* false will avoid using packed encoding.
* @type int $jstype
* The jstype option determines the JavaScript type used for values of the
@@ -231,7 +231,7 @@ public function setCtype($var)
* The packed option can be enabled for repeated primitive fields to enable
* a more efficient representation on the wire. Rather than repeatedly
* writing the tag and type for each element, the entire array is encoded as
- * a single length-delimited blob. In proto3, only explicit setting it to
+ * a single length-prefixed blob. In proto3, only explicit setting it to
* false will avoid using packed encoding.
*
* Generated from protobuf field optional bool packed = 2;
diff --git a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php
index 21d9c980e..31e2f29d3 100644
--- a/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php
+++ b/lib/Google/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php
@@ -394,7 +394,8 @@ private static function parseFieldFromStreamNoTag($input, $field, &$value)
}
break;
case GPBType::STRING:
- // TODO: Add utf-8 check.
+ // We don't check UTF-8 here; that will be validated by the
+ // setter later.
if (!GPBWire::readString($input, $value)) {
throw new GPBDecodeException(
"Unexpected EOF inside string field.");
diff --git a/lib/Google/vendor/guzzlehttp/guzzle/CHANGELOG.md b/lib/Google/vendor/guzzlehttp/guzzle/CHANGELOG.md
index 13709d1b8..e0b621659 100644
--- a/lib/Google/vendor/guzzlehttp/guzzle/CHANGELOG.md
+++ b/lib/Google/vendor/guzzlehttp/guzzle/CHANGELOG.md
@@ -3,6 +3,37 @@
Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version.
+## 7.9.2 - 2024-07-24
+
+### Fixed
+
+- Adjusted handler selection to use cURL if its version is 7.21.2 or higher, rather than 7.34.0
+
+
+## 7.9.1 - 2024-07-19
+
+### Fixed
+
+- Fix TLS 1.3 check for HTTP/2 requests
+
+
+## 7.9.0 - 2024-07-18
+
+### Changed
+
+- Improve protocol version checks to provide feedback around unsupported protocols
+- Only select the cURL handler by default if 7.34.0 or higher is linked
+- Improved `CurlMultiHandler` to avoid busy wait if possible
+- Dropped support for EOL `guzzlehttp/psr7` v1
+- Improved URI user info redaction in errors
+
+## 7.8.2 - 2024-07-18
+
+### Added
+
+- Support for PHP 8.4
+
+
## 7.8.1 - 2023-12-03
### Changed
diff --git a/lib/Google/vendor/guzzlehttp/guzzle/README.md b/lib/Google/vendor/guzzlehttp/guzzle/README.md
index 6d78a9309..cdaebee3f 100644
--- a/lib/Google/vendor/guzzlehttp/guzzle/README.md
+++ b/lib/Google/vendor/guzzlehttp/guzzle/README.md
@@ -62,11 +62,11 @@ composer require guzzlehttp/guzzle
| Version | Status | Packagist | Namespace | Repo | Docs | PSR-7 | PHP Version |
|---------|---------------------|---------------------|--------------|---------------------|---------------------|-------|--------------|
-| 3.x | EOL | `guzzle/guzzle` | `Guzzle` | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No | >=5.3.3,<7.0 |
-| 4.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >=5.4,<7.0 |
-| 5.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >=5.4,<7.4 |
-| 6.x | Security fixes only | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >=5.5,<8.0 |
-| 7.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v7][guzzle-7-repo] | [v7][guzzle-7-docs] | Yes | >=7.2.5,<8.4 |
+| 3.x | EOL (2016-10-31) | `guzzle/guzzle` | `Guzzle` | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No | >=5.3.3,<7.0 |
+| 4.x | EOL (2016-10-31) | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >=5.4,<7.0 |
+| 5.x | EOL (2019-10-31) | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >=5.4,<7.4 |
+| 6.x | EOL (2023-10-31) | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >=5.5,<8.0 |
+| 7.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v7][guzzle-7-repo] | [v7][guzzle-7-docs] | Yes | >=7.2.5,<8.5 |
[guzzle-3-repo]: https://github.com/guzzle/guzzle3
[guzzle-4-repo]: https://github.com/guzzle/guzzle/tree/4.x
diff --git a/lib/Google/vendor/guzzlehttp/guzzle/composer.json b/lib/Google/vendor/guzzlehttp/guzzle/composer.json
index 69583d7cc..cbede149a 100644
--- a/lib/Google/vendor/guzzlehttp/guzzle/composer.json
+++ b/lib/Google/vendor/guzzlehttp/guzzle/composer.json
@@ -50,11 +50,39 @@
"homepage": "https://github.com/Tobion"
}
],
+ "repositories": [
+ {
+ "type": "package",
+ "package": {
+ "name": "guzzle/client-integration-tests",
+ "version": "v3.0.2",
+ "dist": {
+ "url": "https://codeload.github.com/guzzle/client-integration-tests/zip/2c025848417c1135031fdf9c728ee53d0a7ceaee",
+ "type": "zip"
+ },
+ "require": {
+ "php": "^7.2.5 || ^8.0",
+ "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.11",
+ "php-http/message": "^1.0 || ^2.0",
+ "guzzlehttp/psr7": "^1.7 || ^2.0",
+ "th3n3rd/cartesian-product": "^0.3"
+ },
+ "autoload": {
+ "psr-4": {
+ "Http\\Client\\Tests\\": "src/"
+ }
+ },
+ "bin": [
+ "bin/http_test_server"
+ ]
+ }
+ }
+ ],
"require": {
"php": "^7.2.5 || ^8.0",
"ext-json": "*",
- "guzzlehttp/promises": "^1.5.3 || ^2.0.1",
- "guzzlehttp/psr7": "^1.9.1 || ^2.5.1",
+ "guzzlehttp/promises": "^1.5.3 || ^2.0.3",
+ "guzzlehttp/psr7": "^2.7.0",
"psr/http-client": "^1.0",
"symfony/deprecation-contracts": "^2.2 || ^3.0"
},
@@ -64,9 +92,9 @@
"require-dev": {
"ext-curl": "*",
"bamarni/composer-bin-plugin": "^1.8.2",
- "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999",
+ "guzzle/client-integration-tests": "3.0.2",
"php-http/message-factory": "^1.1",
- "phpunit/phpunit": "^8.5.36 || ^9.6.15",
+ "phpunit/phpunit": "^8.5.39 || ^9.6.20",
"psr/log": "^1.1 || ^2.0 || ^3.0"
},
"suggest": {
diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/BodySummarizer.php b/lib/Google/vendor/guzzlehttp/guzzle/src/BodySummarizer.php
index 6eca94ef9..761506dd0 100644
--- a/lib/Google/vendor/guzzlehttp/guzzle/src/BodySummarizer.php
+++ b/lib/Google/vendor/guzzlehttp/guzzle/src/BodySummarizer.php
@@ -11,7 +11,7 @@ final class BodySummarizer implements BodySummarizerInterface
*/
private $truncateAt;
- public function __construct(int $truncateAt = null)
+ public function __construct(?int $truncateAt = null)
{
$this->truncateAt = $truncateAt;
}
@@ -22,7 +22,7 @@ public function __construct(int $truncateAt = null)
public function summarize(MessageInterface $message): ?string
{
return $this->truncateAt === null
- ? \GuzzleHttp\Psr7\Message::bodySummary($message)
- : \GuzzleHttp\Psr7\Message::bodySummary($message, $this->truncateAt);
+ ? Psr7\Message::bodySummary($message)
+ : Psr7\Message::bodySummary($message, $this->truncateAt);
}
}
diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/Client.php b/lib/Google/vendor/guzzlehttp/guzzle/src/Client.php
index bc6efc90f..c78919a4f 100644
--- a/lib/Google/vendor/guzzlehttp/guzzle/src/Client.php
+++ b/lib/Google/vendor/guzzlehttp/guzzle/src/Client.php
@@ -52,7 +52,7 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
*
* @param array $config Client configuration settings.
*
- * @see \GuzzleHttp\RequestOptions for a list of available request options.
+ * @see RequestOptions for a list of available request options.
*/
public function __construct(array $config = [])
{
@@ -202,7 +202,7 @@ public function request(string $method, $uri = '', array $options = []): Respons
*
* @deprecated Client::getConfig will be removed in guzzlehttp/guzzle:8.0.
*/
- public function getConfig(string $option = null)
+ public function getConfig(?string $option = null)
{
return $option === null
? $this->config
diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/ClientInterface.php b/lib/Google/vendor/guzzlehttp/guzzle/src/ClientInterface.php
index 1788e16ab..6aaee61af 100644
--- a/lib/Google/vendor/guzzlehttp/guzzle/src/ClientInterface.php
+++ b/lib/Google/vendor/guzzlehttp/guzzle/src/ClientInterface.php
@@ -80,5 +80,5 @@ public function requestAsync(string $method, $uri, array $options = []): Promise
*
* @deprecated ClientInterface::getConfig will be removed in guzzlehttp/guzzle:8.0.
*/
- public function getConfig(string $option = null);
+ public function getConfig(?string $option = null);
}
diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php b/lib/Google/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php
index c29b4b7e9..b616cf2ed 100644
--- a/lib/Google/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php
+++ b/lib/Google/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php
@@ -103,7 +103,7 @@ public function toArray(): array
}, $this->getIterator()->getArrayCopy());
}
- public function clear(string $domain = null, string $path = null, string $name = null): void
+ public function clear(?string $domain = null, ?string $path = null, ?string $name = null): void
{
if (!$domain) {
$this->cookies = [];
diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php b/lib/Google/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php
index 8c55cc6f7..93ada58d2 100644
--- a/lib/Google/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php
+++ b/lib/Google/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php
@@ -62,7 +62,7 @@ public function setCookie(SetCookie $cookie): bool;
* @param string|null $path Clears cookies matching a domain and path
* @param string|null $name Clears cookies matching a domain, path, and name
*/
- public function clear(string $domain = null, string $path = null, string $name = null): void;
+ public function clear(?string $domain = null, ?string $path = null, ?string $name = null): void;
/**
* Discard all sessions cookies.
diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php b/lib/Google/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php
index a80956c9d..ba67ad498 100644
--- a/lib/Google/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php
+++ b/lib/Google/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php
@@ -14,7 +14,7 @@ public function __construct(
string $message,
RequestInterface $request,
ResponseInterface $response,
- \Throwable $previous = null,
+ ?\Throwable $previous = null,
array $handlerContext = []
) {
parent::__construct($message, $request, $response, $previous, $handlerContext);
diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php b/lib/Google/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php
index e1a31519c..eab51ca17 100644
--- a/lib/Google/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php
+++ b/lib/Google/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php
@@ -25,7 +25,7 @@ class ConnectException extends TransferException implements NetworkExceptionInte
public function __construct(
string $message,
RequestInterface $request,
- \Throwable $previous = null,
+ ?\Throwable $previous = null,
array $handlerContext = []
) {
parent::__construct($message, 0, $previous);
diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php b/lib/Google/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php
index c2d0a9ccc..b42c88abf 100644
--- a/lib/Google/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php
+++ b/lib/Google/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php
@@ -7,7 +7,6 @@
use Psr\Http\Client\RequestExceptionInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
-use Psr\Http\Message\UriInterface;
/**
* HTTP Request exception
@@ -32,8 +31,8 @@ class RequestException extends TransferException implements RequestExceptionInte
public function __construct(
string $message,
RequestInterface $request,
- ResponseInterface $response = null,
- \Throwable $previous = null,
+ ?ResponseInterface $response = null,
+ ?\Throwable $previous = null,
array $handlerContext = []
) {
// Set the code of the exception if the response is set and not future.
@@ -63,10 +62,10 @@ public static function wrapException(RequestInterface $request, \Throwable $e):
*/
public static function create(
RequestInterface $request,
- ResponseInterface $response = null,
- \Throwable $previous = null,
+ ?ResponseInterface $response = null,
+ ?\Throwable $previous = null,
array $handlerContext = [],
- BodySummarizerInterface $bodySummarizer = null
+ ?BodySummarizerInterface $bodySummarizer = null
): self {
if (!$response) {
return new self(
@@ -90,8 +89,7 @@ public static function create(
$className = __CLASS__;
}
- $uri = $request->getUri();
- $uri = static::obfuscateUri($uri);
+ $uri = \GuzzleHttp\Psr7\Utils::redactUserInfo($request->getUri());
// Client Error: `GET /` resulted in a `404 Not Found` response:
// ... (truncated)
@@ -113,20 +111,6 @@ public static function create(
return new $className($message, $request, $response, $previous, $handlerContext);
}
- /**
- * Obfuscates URI if there is a username and a password present
- */
- private static function obfuscateUri(UriInterface $uri): UriInterface
- {
- $userInfo = $uri->getUserInfo();
-
- if (false !== ($pos = \strpos($userInfo, ':'))) {
- return $uri->withUserInfo(\substr($userInfo, 0, $pos), '***');
- }
-
- return $uri;
- }
-
/**
* Get the request that caused the exception
*/
diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php b/lib/Google/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php
index 16a942232..fe3613751 100644
--- a/lib/Google/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php
+++ b/lib/Google/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php
@@ -11,6 +11,7 @@
use GuzzleHttp\TransferStats;
use GuzzleHttp\Utils;
use Psr\Http\Message\RequestInterface;
+use Psr\Http\Message\UriInterface;
/**
* Creates curl resources from a request
@@ -46,6 +47,16 @@ public function __construct(int $maxHandles)
public function create(RequestInterface $request, array $options): EasyHandle
{
+ $protocolVersion = $request->getProtocolVersion();
+
+ if ('2' === $protocolVersion || '2.0' === $protocolVersion) {
+ if (!self::supportsHttp2()) {
+ throw new ConnectException('HTTP/2 is supported by the cURL handler, however libcurl is built without HTTP/2 support.', $request);
+ }
+ } elseif ('1.0' !== $protocolVersion && '1.1' !== $protocolVersion) {
+ throw new ConnectException(sprintf('HTTP/%s is not supported by the cURL handler.', $protocolVersion), $request);
+ }
+
if (isset($options['curl']['body_as_string'])) {
$options['_body_as_string'] = $options['curl']['body_as_string'];
unset($options['curl']['body_as_string']);
@@ -72,6 +83,42 @@ public function create(RequestInterface $request, array $options): EasyHandle
return $easy;
}
+ private static function supportsHttp2(): bool
+ {
+ static $supportsHttp2 = null;
+
+ if (null === $supportsHttp2) {
+ $supportsHttp2 = self::supportsTls12()
+ && defined('CURL_VERSION_HTTP2')
+ && (\CURL_VERSION_HTTP2 & \curl_version()['features']);
+ }
+
+ return $supportsHttp2;
+ }
+
+ private static function supportsTls12(): bool
+ {
+ static $supportsTls12 = null;
+
+ if (null === $supportsTls12) {
+ $supportsTls12 = \CURL_SSLVERSION_TLSv1_2 & \curl_version()['features'];
+ }
+
+ return $supportsTls12;
+ }
+
+ private static function supportsTls13(): bool
+ {
+ static $supportsTls13 = null;
+
+ if (null === $supportsTls13) {
+ $supportsTls13 = defined('CURL_SSLVERSION_TLSv1_3')
+ && (\CURL_SSLVERSION_TLSv1_3 & \curl_version()['features']);
+ }
+
+ return $supportsTls13;
+ }
+
public function release(EasyHandle $easy): void
{
$resource = $easy->handle;
@@ -147,7 +194,7 @@ private static function finishError(callable $handler, EasyHandle $easy, CurlFac
'error' => \curl_error($easy->handle),
'appconnect_time' => \curl_getinfo($easy->handle, \CURLINFO_APPCONNECT_TIME),
] + \curl_getinfo($easy->handle);
- $ctx[self::CURL_VERSION_STR] = \curl_version()['version'];
+ $ctx[self::CURL_VERSION_STR] = self::getCurlVersion();
$factory->release($easy);
// Retry when nothing is present or when curl failed to rewind.
@@ -158,6 +205,17 @@ private static function finishError(callable $handler, EasyHandle $easy, CurlFac
return self::createRejection($easy, $ctx);
}
+ private static function getCurlVersion(): string
+ {
+ static $curlVersion = null;
+
+ if (null === $curlVersion) {
+ $curlVersion = \curl_version()['version'];
+ }
+
+ return $curlVersion;
+ }
+
private static function createRejection(EasyHandle $easy, array $ctx): PromiseInterface
{
static $connectionErrors = [
@@ -194,15 +252,22 @@ private static function createRejection(EasyHandle $easy, array $ctx): PromiseIn
);
}
+ $uri = $easy->request->getUri();
+
+ $sanitizedError = self::sanitizeCurlError($ctx['error'] ?? '', $uri);
+
$message = \sprintf(
'cURL error %s: %s (%s)',
$ctx['errno'],
- $ctx['error'],
+ $sanitizedError,
'see https://curl.haxx.se/libcurl/c/libcurl-errors.html'
);
- $uriString = (string) $easy->request->getUri();
- if ($uriString !== '' && false === \strpos($ctx['error'], $uriString)) {
- $message .= \sprintf(' for %s', $uriString);
+
+ if ('' !== $sanitizedError) {
+ $redactedUriString = \GuzzleHttp\Psr7\Utils::redactUserInfo($uri)->__toString();
+ if ($redactedUriString !== '' && false === \strpos($sanitizedError, $redactedUriString)) {
+ $message .= \sprintf(' for %s', $redactedUriString);
+ }
}
// Create a connection exception if it was a specific error code.
@@ -213,6 +278,24 @@ private static function createRejection(EasyHandle $easy, array $ctx): PromiseIn
return P\Create::rejectionFor($error);
}
+ private static function sanitizeCurlError(string $error, UriInterface $uri): string
+ {
+ if ('' === $error) {
+ return $error;
+ }
+
+ $baseUri = $uri->withQuery('')->withFragment('');
+ $baseUriString = $baseUri->__toString();
+
+ if ('' === $baseUriString) {
+ return $error;
+ }
+
+ $redactedUriString = \GuzzleHttp\Psr7\Utils::redactUserInfo($baseUri)->__toString();
+
+ return str_replace($baseUriString, $redactedUriString, $error);
+ }
+
/**
* @return array
*/
@@ -232,10 +315,11 @@ private function getDefaultConf(EasyHandle $easy): array
}
$version = $easy->request->getProtocolVersion();
- if ($version == 1.1) {
- $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_1_1;
- } elseif ($version == 2.0) {
+
+ if ('2' === $version || '2.0' === $version) {
$conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_2_0;
+ } elseif ('1.1' === $version) {
+ $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_1_1;
} else {
$conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_1_0;
}
@@ -390,8 +474,10 @@ private function applyHandlerOptions(EasyHandle $easy, array &$conf): void
// The empty string enables all available decoders and implicitly
// sets a matching 'Accept-Encoding' header.
$conf[\CURLOPT_ENCODING] = '';
- // But as the user did not specify any acceptable encodings we need
- // to overwrite this implicit header with an empty one.
+ // But as the user did not specify any encoding preference,
+ // let's leave it up to server by preventing curl from sending
+ // the header, which will be interpreted as 'Accept-Encoding: *'.
+ // https://www.rfc-editor.org/rfc/rfc9110#field.accept-encoding
$conf[\CURLOPT_HTTPHEADER][] = 'Accept-Encoding:';
}
}
@@ -455,23 +541,35 @@ private function applyHandlerOptions(EasyHandle $easy, array &$conf): void
}
if (isset($options['crypto_method'])) {
- if (\STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT === $options['crypto_method']) {
- if (!defined('CURL_SSLVERSION_TLSv1_0')) {
- throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.0 not supported by your version of cURL');
+ $protocolVersion = $easy->request->getProtocolVersion();
+
+ // If HTTP/2, upgrade TLS 1.0 and 1.1 to 1.2
+ if ('2' === $protocolVersion || '2.0' === $protocolVersion) {
+ if (
+ \STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT === $options['crypto_method']
+ || \STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT === $options['crypto_method']
+ || \STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT === $options['crypto_method']
+ ) {
+ $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_2;
+ } elseif (defined('STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT') && \STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT === $options['crypto_method']) {
+ if (!self::supportsTls13()) {
+ throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.3 not supported by your version of cURL');
+ }
+ $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_3;
+ } else {
+ throw new \InvalidArgumentException('Invalid crypto_method request option: unknown version provided');
}
+ } elseif (\STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT === $options['crypto_method']) {
$conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_0;
} elseif (\STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT === $options['crypto_method']) {
- if (!defined('CURL_SSLVERSION_TLSv1_1')) {
- throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.1 not supported by your version of cURL');
- }
$conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_1;
} elseif (\STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT === $options['crypto_method']) {
- if (!defined('CURL_SSLVERSION_TLSv1_2')) {
+ if (!self::supportsTls12()) {
throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.2 not supported by your version of cURL');
}
$conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_2;
} elseif (defined('STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT') && \STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT === $options['crypto_method']) {
- if (!defined('CURL_SSLVERSION_TLSv1_3')) {
+ if (!self::supportsTls13()) {
throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.3 not supported by your version of cURL');
}
$conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_3;
diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php b/lib/Google/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php
index a64e1821a..73a6abe33 100644
--- a/lib/Google/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php
+++ b/lib/Google/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php
@@ -2,6 +2,7 @@
namespace GuzzleHttp\Handler;
+use Closure;
use GuzzleHttp\Promise as P;
use GuzzleHttp\Promise\Promise;
use GuzzleHttp\Promise\PromiseInterface;
@@ -159,6 +160,9 @@ public function tick(): void
}
}
+ // Run curl_multi_exec in the queue to enable other async tasks to run
+ P\Utils::queue()->add(Closure::fromCallable([$this, 'tickInQueue']));
+
// Step through the task queue which may add additional requests.
P\Utils::queue()->run();
@@ -169,11 +173,24 @@ public function tick(): void
}
while (\curl_multi_exec($this->_mh, $this->active) === \CURLM_CALL_MULTI_PERFORM) {
+ // Prevent busy looping for slow HTTP requests.
+ \curl_multi_select($this->_mh, $this->selectTimeout);
}
$this->processMessages();
}
+ /**
+ * Runs \curl_multi_exec() inside the event loop, to prevent busy looping
+ */
+ private function tickInQueue(): void
+ {
+ if (\curl_multi_exec($this->_mh, $this->active) === \CURLM_CALL_MULTI_PERFORM) {
+ \curl_multi_select($this->_mh, 0);
+ P\Utils::queue()->add(Closure::fromCallable([$this, 'tickInQueue']));
+ }
+ }
+
/**
* Runs until all outstanding connections have completed.
*/
diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php b/lib/Google/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php
index 77ffed521..3ecd5964d 100644
--- a/lib/Google/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php
+++ b/lib/Google/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php
@@ -52,21 +52,21 @@ class MockHandler implements \Countable
* @param callable|null $onFulfilled Callback to invoke when the return value is fulfilled.
* @param callable|null $onRejected Callback to invoke when the return value is rejected.
*/
- public static function createWithMiddleware(array $queue = null, callable $onFulfilled = null, callable $onRejected = null): HandlerStack
+ public static function createWithMiddleware(?array $queue = null, ?callable $onFulfilled = null, ?callable $onRejected = null): HandlerStack
{
return HandlerStack::create(new self($queue, $onFulfilled, $onRejected));
}
/**
* The passed in value must be an array of
- * {@see \Psr\Http\Message\ResponseInterface} objects, Exceptions,
+ * {@see ResponseInterface} objects, Exceptions,
* callables, or Promises.
*
* @param array|null $queue The parameters to be passed to the append function, as an indexed array.
* @param callable|null $onFulfilled Callback to invoke when the return value is fulfilled.
* @param callable|null $onRejected Callback to invoke when the return value is rejected.
*/
- public function __construct(array $queue = null, callable $onFulfilled = null, callable $onRejected = null)
+ public function __construct(?array $queue = null, ?callable $onFulfilled = null, ?callable $onRejected = null)
{
$this->onFulfilled = $onFulfilled;
$this->onRejected = $onRejected;
@@ -200,7 +200,7 @@ public function reset(): void
private function invokeStats(
RequestInterface $request,
array $options,
- ResponseInterface $response = null,
+ ?ResponseInterface $response = null,
$reason = null
): void {
if (isset($options['on_stats'])) {
diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php b/lib/Google/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
index 61632f564..1d89a8fbc 100644
--- a/lib/Google/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
+++ b/lib/Google/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
@@ -40,6 +40,12 @@ public function __invoke(RequestInterface $request, array $options): PromiseInte
\usleep($options['delay'] * 1000);
}
+ $protocolVersion = $request->getProtocolVersion();
+
+ if ('1.0' !== $protocolVersion && '1.1' !== $protocolVersion) {
+ throw new ConnectException(sprintf('HTTP/%s is not supported by the stream handler.', $protocolVersion), $request);
+ }
+
$startTime = isset($options['on_stats']) ? Utils::currentTime() : null;
try {
@@ -83,8 +89,8 @@ private function invokeStats(
array $options,
RequestInterface $request,
?float $startTime,
- ResponseInterface $response = null,
- \Throwable $error = null
+ ?ResponseInterface $response = null,
+ ?\Throwable $error = null
): void {
if (isset($options['on_stats'])) {
$stats = new TransferStats($request, $response, Utils::currentTime() - $startTime, $error, []);
@@ -273,7 +279,7 @@ private function createStream(RequestInterface $request, array $options)
// HTTP/1.1 streams using the PHP stream wrapper require a
// Connection: close header
- if ($request->getProtocolVersion() == '1.1'
+ if ($request->getProtocolVersion() === '1.1'
&& !$request->hasHeader('Connection')
) {
$request = $request->withHeader('Connection', 'close');
diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/HandlerStack.php b/lib/Google/vendor/guzzlehttp/guzzle/src/HandlerStack.php
index 6cb12f07a..03f9a18ff 100644
--- a/lib/Google/vendor/guzzlehttp/guzzle/src/HandlerStack.php
+++ b/lib/Google/vendor/guzzlehttp/guzzle/src/HandlerStack.php
@@ -44,7 +44,7 @@ class HandlerStack
* handler is provided, the best handler for your
* system will be utilized.
*/
- public static function create(callable $handler = null): self
+ public static function create(?callable $handler = null): self
{
$stack = new self($handler ?: Utils::chooseHandler());
$stack->push(Middleware::httpErrors(), 'http_errors');
@@ -58,7 +58,7 @@ public static function create(callable $handler = null): self
/**
* @param (callable(RequestInterface, array): PromiseInterface)|null $handler Underlying HTTP handler.
*/
- public function __construct(callable $handler = null)
+ public function __construct(?callable $handler = null)
{
$this->handler = $handler;
}
@@ -131,7 +131,7 @@ public function hasHandler(): bool
* @param callable(callable): callable $middleware Middleware function
* @param string $name Name to register for this middleware.
*/
- public function unshift(callable $middleware, string $name = null): void
+ public function unshift(callable $middleware, ?string $name = null): void
{
\array_unshift($this->stack, [$middleware, $name]);
$this->cached = null;
diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/MessageFormatter.php b/lib/Google/vendor/guzzlehttp/guzzle/src/MessageFormatter.php
index 04e9eb37a..9b77eee83 100644
--- a/lib/Google/vendor/guzzlehttp/guzzle/src/MessageFormatter.php
+++ b/lib/Google/vendor/guzzlehttp/guzzle/src/MessageFormatter.php
@@ -68,7 +68,7 @@ public function __construct(?string $template = self::CLF)
* @param ResponseInterface|null $response Response that was received
* @param \Throwable|null $error Exception that was received
*/
- public function format(RequestInterface $request, ResponseInterface $response = null, \Throwable $error = null): string
+ public function format(RequestInterface $request, ?ResponseInterface $response = null, ?\Throwable $error = null): string
{
$cache = [];
diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php b/lib/Google/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php
index 47934614a..a39ac248e 100644
--- a/lib/Google/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php
+++ b/lib/Google/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php
@@ -14,5 +14,5 @@ interface MessageFormatterInterface
* @param ResponseInterface|null $response Response that was received
* @param \Throwable|null $error Exception that was received
*/
- public function format(RequestInterface $request, ResponseInterface $response = null, \Throwable $error = null): string;
+ public function format(RequestInterface $request, ?ResponseInterface $response = null, ?\Throwable $error = null): string;
}
diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/Middleware.php b/lib/Google/vendor/guzzlehttp/guzzle/src/Middleware.php
index 7e3eb6b3a..6edbb3fe4 100644
--- a/lib/Google/vendor/guzzlehttp/guzzle/src/Middleware.php
+++ b/lib/Google/vendor/guzzlehttp/guzzle/src/Middleware.php
@@ -55,7 +55,7 @@ static function (ResponseInterface $response) use ($cookieJar, $request): Respon
*
* @return callable(callable): callable Returns a function that accepts the next handler.
*/
- public static function httpErrors(BodySummarizerInterface $bodySummarizer = null): callable
+ public static function httpErrors(?BodySummarizerInterface $bodySummarizer = null): callable
{
return static function (callable $handler) use ($bodySummarizer): callable {
return static function ($request, array $options) use ($handler, $bodySummarizer) {
@@ -132,7 +132,7 @@ static function ($reason) use ($request, &$container, $options) {
*
* @return callable Returns a function that accepts the next handler.
*/
- public static function tap(callable $before = null, callable $after = null): callable
+ public static function tap(?callable $before = null, ?callable $after = null): callable
{
return static function (callable $handler) use ($before, $after): callable {
return static function (RequestInterface $request, array $options) use ($handler, $before, $after) {
@@ -176,7 +176,7 @@ public static function redirect(): callable
*
* @return callable Returns a function that accepts the next handler.
*/
- public static function retry(callable $decider, callable $delay = null): callable
+ public static function retry(callable $decider, ?callable $delay = null): callable
{
return static function (callable $handler) use ($decider, $delay): RetryMiddleware {
return new RetryMiddleware($decider, $handler, $delay);
diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php b/lib/Google/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php
index 0a8de8128..7dde6c5f4 100644
--- a/lib/Google/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php
+++ b/lib/Google/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php
@@ -76,8 +76,8 @@ private function addExpectHeader(RequestInterface $request, array $options, arra
$expect = $options['expect'] ?? null;
- // Return if disabled or if you're not using HTTP/1.1 or HTTP/2.0
- if ($expect === false || $request->getProtocolVersion() < 1.1) {
+ // Return if disabled or using HTTP/1.0
+ if ($expect === false || $request->getProtocolVersion() === '1.0') {
return;
}
diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/RequestOptions.php b/lib/Google/vendor/guzzlehttp/guzzle/src/RequestOptions.php
index a38768c0c..84a3500e4 100644
--- a/lib/Google/vendor/guzzlehttp/guzzle/src/RequestOptions.php
+++ b/lib/Google/vendor/guzzlehttp/guzzle/src/RequestOptions.php
@@ -61,7 +61,7 @@ final class RequestOptions
* Specifies whether or not cookies are used in a request or what cookie
* jar to use or what cookies to send. This option only works if your
* handler has the `cookie` middleware. Valid values are `false` and
- * an instance of {@see \GuzzleHttp\Cookie\CookieJarInterface}.
+ * an instance of {@see Cookie\CookieJarInterface}.
*/
public const COOKIES = 'cookies';
diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/RetryMiddleware.php b/lib/Google/vendor/guzzlehttp/guzzle/src/RetryMiddleware.php
index 8f4d93ac4..65f49cb75 100644
--- a/lib/Google/vendor/guzzlehttp/guzzle/src/RetryMiddleware.php
+++ b/lib/Google/vendor/guzzlehttp/guzzle/src/RetryMiddleware.php
@@ -40,7 +40,7 @@ class RetryMiddleware
* and returns the number of
* milliseconds to delay.
*/
- public function __construct(callable $decider, callable $nextHandler, callable $delay = null)
+ public function __construct(callable $decider, callable $nextHandler, ?callable $delay = null)
{
$this->decider = $decider;
$this->nextHandler = $nextHandler;
@@ -110,7 +110,7 @@ private function onRejected(RequestInterface $req, array $options): callable
};
}
- private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null): PromiseInterface
+ private function doRetry(RequestInterface $request, array $options, ?ResponseInterface $response = null): PromiseInterface
{
$options['delay'] = ($this->delay)(++$options['retries'], $response, $request);
diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/TransferStats.php b/lib/Google/vendor/guzzlehttp/guzzle/src/TransferStats.php
index 2ce9e38f2..93fa334c8 100644
--- a/lib/Google/vendor/guzzlehttp/guzzle/src/TransferStats.php
+++ b/lib/Google/vendor/guzzlehttp/guzzle/src/TransferStats.php
@@ -46,8 +46,8 @@ final class TransferStats
*/
public function __construct(
RequestInterface $request,
- ResponseInterface $response = null,
- float $transferTime = null,
+ ?ResponseInterface $response = null,
+ ?float $transferTime = null,
$handlerErrorData = null,
array $handlerStats = []
) {
diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/Utils.php b/lib/Google/vendor/guzzlehttp/guzzle/src/Utils.php
index 93d6d39cd..df529270e 100644
--- a/lib/Google/vendor/guzzlehttp/guzzle/src/Utils.php
+++ b/lib/Google/vendor/guzzlehttp/guzzle/src/Utils.php
@@ -71,7 +71,7 @@ public static function debugResource($value = null)
return \STDOUT;
}
- return \GuzzleHttp\Psr7\Utils::tryFopen('php://output', 'w');
+ return Psr7\Utils::tryFopen('php://output', 'w');
}
/**
@@ -87,7 +87,7 @@ public static function chooseHandler(): callable
{
$handler = null;
- if (\defined('CURLOPT_CUSTOMREQUEST')) {
+ if (\defined('CURLOPT_CUSTOMREQUEST') && \function_exists('curl_version') && version_compare(curl_version()['version'], '7.21.2') >= 0) {
if (\function_exists('curl_multi_exec') && \function_exists('curl_exec')) {
$handler = Proxy::wrapSync(new CurlMultiHandler(), new CurlHandler());
} elseif (\function_exists('curl_exec')) {
diff --git a/lib/Google/vendor/guzzlehttp/promises/CHANGELOG.md b/lib/Google/vendor/guzzlehttp/promises/CHANGELOG.md
index c73afb903..c7c49a144 100644
--- a/lib/Google/vendor/guzzlehttp/promises/CHANGELOG.md
+++ b/lib/Google/vendor/guzzlehttp/promises/CHANGELOG.md
@@ -1,6 +1,20 @@
# CHANGELOG
+## 2.0.4 - 2024-10-17
+
+### Fixed
+
+- Once settled, don't allow further rejection of additional promises
+
+
+## 2.0.3 - 2024-07-18
+
+### Changed
+
+- PHP 8.4 support
+
+
## 2.0.2 - 2023-12-03
### Changed
diff --git a/lib/Google/vendor/guzzlehttp/promises/README.md b/lib/Google/vendor/guzzlehttp/promises/README.md
index a32d3d29c..d1c814fe7 100644
--- a/lib/Google/vendor/guzzlehttp/promises/README.md
+++ b/lib/Google/vendor/guzzlehttp/promises/README.md
@@ -38,10 +38,10 @@ composer require guzzlehttp/promises
## Version Guidance
-| Version | Status | PHP Version |
-|---------|------------------------|--------------|
-| 1.x | Bug and security fixes | >=5.5,<8.3 |
-| 2.x | Latest | >=7.2.5,<8.4 |
+| Version | Status | PHP Version |
+|---------|---------------------|--------------|
+| 1.x | Security fixes only | >=5.5,<8.3 |
+| 2.x | Latest | >=7.2.5,<8.5 |
## Quick Start
diff --git a/lib/Google/vendor/guzzlehttp/promises/composer.json b/lib/Google/vendor/guzzlehttp/promises/composer.json
index 6c5bdd662..f64ed7714 100644
--- a/lib/Google/vendor/guzzlehttp/promises/composer.json
+++ b/lib/Google/vendor/guzzlehttp/promises/composer.json
@@ -30,7 +30,7 @@
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
- "phpunit/phpunit": "^8.5.36 || ^9.6.15"
+ "phpunit/phpunit": "^8.5.39 || ^9.6.20"
},
"autoload": {
"psr-4": {
diff --git a/lib/Google/vendor/guzzlehttp/promises/src/Coroutine.php b/lib/Google/vendor/guzzlehttp/promises/src/Coroutine.php
index 0b5b9c0a4..0da022834 100644
--- a/lib/Google/vendor/guzzlehttp/promises/src/Coroutine.php
+++ b/lib/Google/vendor/guzzlehttp/promises/src/Coroutine.php
@@ -84,8 +84,8 @@ public static function of(callable $generatorFn): self
}
public function then(
- callable $onFulfilled = null,
- callable $onRejected = null
+ ?callable $onFulfilled = null,
+ ?callable $onRejected = null
): PromiseInterface {
return $this->result->then($onFulfilled, $onRejected);
}
diff --git a/lib/Google/vendor/guzzlehttp/promises/src/Each.php b/lib/Google/vendor/guzzlehttp/promises/src/Each.php
index c09d23c60..dd72c8310 100644
--- a/lib/Google/vendor/guzzlehttp/promises/src/Each.php
+++ b/lib/Google/vendor/guzzlehttp/promises/src/Each.php
@@ -23,8 +23,8 @@ final class Each
*/
public static function of(
$iterable,
- callable $onFulfilled = null,
- callable $onRejected = null
+ ?callable $onFulfilled = null,
+ ?callable $onRejected = null
): PromiseInterface {
return (new EachPromise($iterable, [
'fulfilled' => $onFulfilled,
@@ -46,8 +46,8 @@ public static function of(
public static function ofLimit(
$iterable,
$concurrency,
- callable $onFulfilled = null,
- callable $onRejected = null
+ ?callable $onFulfilled = null,
+ ?callable $onRejected = null
): PromiseInterface {
return (new EachPromise($iterable, [
'fulfilled' => $onFulfilled,
@@ -67,7 +67,7 @@ public static function ofLimit(
public static function ofLimitAll(
$iterable,
$concurrency,
- callable $onFulfilled = null
+ ?callable $onFulfilled = null
): PromiseInterface {
return self::ofLimit(
$iterable,
diff --git a/lib/Google/vendor/guzzlehttp/promises/src/FulfilledPromise.php b/lib/Google/vendor/guzzlehttp/promises/src/FulfilledPromise.php
index ab7129659..727ec315c 100644
--- a/lib/Google/vendor/guzzlehttp/promises/src/FulfilledPromise.php
+++ b/lib/Google/vendor/guzzlehttp/promises/src/FulfilledPromise.php
@@ -31,8 +31,8 @@ public function __construct($value)
}
public function then(
- callable $onFulfilled = null,
- callable $onRejected = null
+ ?callable $onFulfilled = null,
+ ?callable $onRejected = null
): PromiseInterface {
// Return itself if there is no onFulfilled function.
if (!$onFulfilled) {
diff --git a/lib/Google/vendor/guzzlehttp/promises/src/Promise.php b/lib/Google/vendor/guzzlehttp/promises/src/Promise.php
index 1b07bdc9a..c0c5be2c0 100644
--- a/lib/Google/vendor/guzzlehttp/promises/src/Promise.php
+++ b/lib/Google/vendor/guzzlehttp/promises/src/Promise.php
@@ -25,16 +25,16 @@ class Promise implements PromiseInterface
* @param callable $cancelFn Fn that when invoked cancels the promise.
*/
public function __construct(
- callable $waitFn = null,
- callable $cancelFn = null
+ ?callable $waitFn = null,
+ ?callable $cancelFn = null
) {
$this->waitFn = $waitFn;
$this->cancelFn = $cancelFn;
}
public function then(
- callable $onFulfilled = null,
- callable $onRejected = null
+ ?callable $onFulfilled = null,
+ ?callable $onRejected = null
): PromiseInterface {
if ($this->state === self::PENDING) {
$p = new Promise(null, [$this, 'cancel']);
diff --git a/lib/Google/vendor/guzzlehttp/promises/src/PromiseInterface.php b/lib/Google/vendor/guzzlehttp/promises/src/PromiseInterface.php
index 2824802bb..c11721e4d 100644
--- a/lib/Google/vendor/guzzlehttp/promises/src/PromiseInterface.php
+++ b/lib/Google/vendor/guzzlehttp/promises/src/PromiseInterface.php
@@ -27,8 +27,8 @@ interface PromiseInterface
* @param callable $onRejected Invoked when the promise is rejected.
*/
public function then(
- callable $onFulfilled = null,
- callable $onRejected = null
+ ?callable $onFulfilled = null,
+ ?callable $onRejected = null
): PromiseInterface;
/**
diff --git a/lib/Google/vendor/guzzlehttp/promises/src/RejectedPromise.php b/lib/Google/vendor/guzzlehttp/promises/src/RejectedPromise.php
index d947da1f5..1ebf0b2a6 100644
--- a/lib/Google/vendor/guzzlehttp/promises/src/RejectedPromise.php
+++ b/lib/Google/vendor/guzzlehttp/promises/src/RejectedPromise.php
@@ -31,8 +31,8 @@ public function __construct($reason)
}
public function then(
- callable $onFulfilled = null,
- callable $onRejected = null
+ ?callable $onFulfilled = null,
+ ?callable $onRejected = null
): PromiseInterface {
// If there's no onRejected callback then just return self.
if (!$onRejected) {
diff --git a/lib/Google/vendor/guzzlehttp/promises/src/RejectionException.php b/lib/Google/vendor/guzzlehttp/promises/src/RejectionException.php
index 72a81ba20..47dca8624 100644
--- a/lib/Google/vendor/guzzlehttp/promises/src/RejectionException.php
+++ b/lib/Google/vendor/guzzlehttp/promises/src/RejectionException.php
@@ -18,7 +18,7 @@ class RejectionException extends \RuntimeException
* @param mixed $reason Rejection reason.
* @param string|null $description Optional description.
*/
- public function __construct($reason, string $description = null)
+ public function __construct($reason, ?string $description = null)
{
$this->reason = $reason;
diff --git a/lib/Google/vendor/guzzlehttp/promises/src/Utils.php b/lib/Google/vendor/guzzlehttp/promises/src/Utils.php
index e1570d727..3193d2a12 100644
--- a/lib/Google/vendor/guzzlehttp/promises/src/Utils.php
+++ b/lib/Google/vendor/guzzlehttp/promises/src/Utils.php
@@ -21,7 +21,7 @@ final class Utils
*
* @param TaskQueueInterface|null $assign Optionally specify a new queue instance.
*/
- public static function queue(TaskQueueInterface $assign = null): TaskQueueInterface
+ public static function queue(?TaskQueueInterface $assign = null): TaskQueueInterface
{
static $queue;
@@ -144,7 +144,9 @@ function ($value, $idx) use (&$results): void {
$results[$idx] = $value;
},
function ($reason, $idx, Promise $aggregate): void {
- $aggregate->reject($reason);
+ if (Is::pending($aggregate)) {
+ $aggregate->reject($reason);
+ }
}
)->then(function () use (&$results) {
ksort($results);
diff --git a/lib/Google/vendor/guzzlehttp/psr7/CHANGELOG.md b/lib/Google/vendor/guzzlehttp/psr7/CHANGELOG.md
index fe3eda70a..75aabfb93 100644
--- a/lib/Google/vendor/guzzlehttp/psr7/CHANGELOG.md
+++ b/lib/Google/vendor/guzzlehttp/psr7/CHANGELOG.md
@@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## 2.7.0 - 2024-07-18
+
+### Added
+
+- Add `Utils::redactUserInfo()` method
+- Add ability to encode bools as ints in `Query::build`
+
+## 2.6.3 - 2024-07-18
+
+### Fixed
+
+- Make `StreamWrapper::stream_stat()` return `false` if inner stream's size is `null`
+
+### Changed
+
+- PHP 8.4 support
+
## 2.6.2 - 2023-12-03
### Fixed
diff --git a/lib/Google/vendor/guzzlehttp/psr7/README.md b/lib/Google/vendor/guzzlehttp/psr7/README.md
index 850fa9d70..2e9bb0b9b 100644
--- a/lib/Google/vendor/guzzlehttp/psr7/README.md
+++ b/lib/Google/vendor/guzzlehttp/psr7/README.md
@@ -24,8 +24,8 @@ composer require guzzlehttp/psr7
| Version | Status | PHP Version |
|---------|---------------------|--------------|
-| 1.x | Security fixes only | >=5.4,<8.1 |
-| 2.x | Latest | >=7.2.5,<8.4 |
+| 1.x | EOL (2024-06-30) | >=5.4,<8.2 |
+| 2.x | Latest | >=7.2.5,<8.5 |
## AppendStream
@@ -436,7 +436,7 @@ will be parsed into `['foo[a]' => '1', 'foo[b]' => '2'])`.
## `GuzzleHttp\Psr7\Query::build`
-`public static function build(array $params, int|false $encoding = PHP_QUERY_RFC3986): string`
+`public static function build(array $params, int|false $encoding = PHP_QUERY_RFC3986, bool $treatBoolsAsInts = true): string`
Build a query string from an array of key value pairs.
@@ -498,11 +498,18 @@ a message.
## `GuzzleHttp\Psr7\Utils::readLine`
-`public static function readLine(StreamInterface $stream, int $maxLength = null): string`
+`public static function readLine(StreamInterface $stream, ?int $maxLength = null): string`
Read a line from the stream up to the maximum allowed buffer length.
+## `GuzzleHttp\Psr7\Utils::redactUserInfo`
+
+`public static function redactUserInfo(UriInterface $uri): UriInterface`
+
+Redact the password in the user info part of a URI.
+
+
## `GuzzleHttp\Psr7\Utils::streamFor`
`public static function streamFor(resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource = '', array $options = []): StreamInterface`
@@ -674,7 +681,7 @@ termed a relative-path reference.
### `GuzzleHttp\Psr7\Uri::isSameDocumentReference`
-`public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null): bool`
+`public static function isSameDocumentReference(UriInterface $uri, ?UriInterface $base = null): bool`
Whether the URI is a same-document reference. A same-document reference refers to a URI that is, aside from its
fragment component, identical to the base URI. When no base URI is given, only an empty URI reference
diff --git a/lib/Google/vendor/guzzlehttp/psr7/composer.json b/lib/Google/vendor/guzzlehttp/psr7/composer.json
index 70293fc40..28d15f571 100644
--- a/lib/Google/vendor/guzzlehttp/psr7/composer.json
+++ b/lib/Google/vendor/guzzlehttp/psr7/composer.json
@@ -61,8 +61,8 @@
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
- "http-interop/http-factory-tests": "^0.9",
- "phpunit/phpunit": "^8.5.36 || ^9.6.15"
+ "http-interop/http-factory-tests": "0.9.0",
+ "phpunit/phpunit": "^8.5.39 || ^9.6.20"
},
"suggest": {
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/CachingStream.php b/lib/Google/vendor/guzzlehttp/psr7/src/CachingStream.php
index f34722cff..7e4554d5c 100644
--- a/lib/Google/vendor/guzzlehttp/psr7/src/CachingStream.php
+++ b/lib/Google/vendor/guzzlehttp/psr7/src/CachingStream.php
@@ -33,7 +33,7 @@ final class CachingStream implements StreamInterface
*/
public function __construct(
StreamInterface $stream,
- StreamInterface $target = null
+ ?StreamInterface $target = null
) {
$this->remoteStream = $stream;
$this->stream = $target ?: new Stream(Utils::tryFopen('php://temp', 'r+'));
diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/HttpFactory.php b/lib/Google/vendor/guzzlehttp/psr7/src/HttpFactory.php
index 73d17e337..3ef15103a 100644
--- a/lib/Google/vendor/guzzlehttp/psr7/src/HttpFactory.php
+++ b/lib/Google/vendor/guzzlehttp/psr7/src/HttpFactory.php
@@ -27,10 +27,10 @@ final class HttpFactory implements RequestFactoryInterface, ResponseFactoryInter
{
public function createUploadedFile(
StreamInterface $stream,
- int $size = null,
+ ?int $size = null,
int $error = \UPLOAD_ERR_OK,
- string $clientFilename = null,
- string $clientMediaType = null
+ ?string $clientFilename = null,
+ ?string $clientMediaType = null
): UploadedFileInterface {
if ($size === null) {
$size = $stream->getSize();
diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/MultipartStream.php b/lib/Google/vendor/guzzlehttp/psr7/src/MultipartStream.php
index d23fba8a3..43d718f65 100644
--- a/lib/Google/vendor/guzzlehttp/psr7/src/MultipartStream.php
+++ b/lib/Google/vendor/guzzlehttp/psr7/src/MultipartStream.php
@@ -32,7 +32,7 @@ final class MultipartStream implements StreamInterface
*
* @throws \InvalidArgumentException
*/
- public function __construct(array $elements = [], string $boundary = null)
+ public function __construct(array $elements = [], ?string $boundary = null)
{
$this->boundary = $boundary ?: bin2hex(random_bytes(20));
$this->stream = $this->createStream($elements);
diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/Query.php b/lib/Google/vendor/guzzlehttp/psr7/src/Query.php
index 8b9492797..ccf867a0b 100644
--- a/lib/Google/vendor/guzzlehttp/psr7/src/Query.php
+++ b/lib/Google/vendor/guzzlehttp/psr7/src/Query.php
@@ -63,12 +63,15 @@ public static function parse(string $str, $urlEncoding = true): array
* string. This function does not modify the provided keys when an array is
* encountered (like `http_build_query()` would).
*
- * @param array $params Query string parameters.
- * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986
- * to encode using RFC3986, or PHP_QUERY_RFC1738
- * to encode using RFC1738.
+ * @param array $params Query string parameters.
+ * @param int|false $encoding Set to false to not encode,
+ * PHP_QUERY_RFC3986 to encode using
+ * RFC3986, or PHP_QUERY_RFC1738 to
+ * encode using RFC1738.
+ * @param bool $treatBoolsAsInts Set to true to encode as 0/1, and
+ * false as false/true.
*/
- public static function build(array $params, $encoding = PHP_QUERY_RFC3986): string
+ public static function build(array $params, $encoding = PHP_QUERY_RFC3986, bool $treatBoolsAsInts = true): string
{
if (!$params) {
return '';
@@ -86,12 +89,14 @@ public static function build(array $params, $encoding = PHP_QUERY_RFC3986): stri
throw new \InvalidArgumentException('Invalid type');
}
+ $castBool = $treatBoolsAsInts ? static function ($v) { return (int) $v; } : static function ($v) { return $v ? 'true' : 'false'; };
+
$qs = '';
foreach ($params as $k => $v) {
$k = $encoder((string) $k);
if (!is_array($v)) {
$qs .= $k;
- $v = is_bool($v) ? (int) $v : $v;
+ $v = is_bool($v) ? $castBool($v) : $v;
if ($v !== null) {
$qs .= '='.$encoder((string) $v);
}
@@ -99,7 +104,7 @@ public static function build(array $params, $encoding = PHP_QUERY_RFC3986): stri
} else {
foreach ($v as $vv) {
$qs .= $k;
- $vv = is_bool($vv) ? (int) $vv : $vv;
+ $vv = is_bool($vv) ? $castBool($vv) : $vv;
if ($vv !== null) {
$qs .= '='.$encoder((string) $vv);
}
diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/Response.php b/lib/Google/vendor/guzzlehttp/psr7/src/Response.php
index 00f16e2d9..34e612fda 100644
--- a/lib/Google/vendor/guzzlehttp/psr7/src/Response.php
+++ b/lib/Google/vendor/guzzlehttp/psr7/src/Response.php
@@ -96,7 +96,7 @@ public function __construct(
array $headers = [],
$body = null,
string $version = '1.1',
- string $reason = null
+ ?string $reason = null
) {
$this->assertStatusCodeRange($status);
diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/StreamWrapper.php b/lib/Google/vendor/guzzlehttp/psr7/src/StreamWrapper.php
index ae8538814..77b04d747 100644
--- a/lib/Google/vendor/guzzlehttp/psr7/src/StreamWrapper.php
+++ b/lib/Google/vendor/guzzlehttp/psr7/src/StreamWrapper.php
@@ -69,7 +69,7 @@ public static function register(): void
}
}
- public function stream_open(string $path, string $mode, int $options, string &$opened_path = null): bool
+ public function stream_open(string $path, string $mode, int $options, ?string &$opened_path = null): bool
{
$options = stream_context_get_options($this->context);
@@ -136,10 +136,14 @@ public function stream_cast(int $cast_as)
* ctime: int,
* blksize: int,
* blocks: int
- * }
+ * }|false
*/
- public function stream_stat(): array
+ public function stream_stat()
{
+ if ($this->stream->getSize() === null) {
+ return false;
+ }
+
static $modeMap = [
'r' => 33060,
'rb' => 33060,
diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/UploadedFile.php b/lib/Google/vendor/guzzlehttp/psr7/src/UploadedFile.php
index b26719937..9c9ea49fb 100644
--- a/lib/Google/vendor/guzzlehttp/psr7/src/UploadedFile.php
+++ b/lib/Google/vendor/guzzlehttp/psr7/src/UploadedFile.php
@@ -64,8 +64,8 @@ public function __construct(
$streamOrFile,
?int $size,
int $errorStatus,
- string $clientFilename = null,
- string $clientMediaType = null
+ ?string $clientFilename = null,
+ ?string $clientMediaType = null
) {
$this->setError($errorStatus);
$this->size = $size;
diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/Uri.php b/lib/Google/vendor/guzzlehttp/psr7/src/Uri.php
index f1feee871..481dfca94 100644
--- a/lib/Google/vendor/guzzlehttp/psr7/src/Uri.php
+++ b/lib/Google/vendor/guzzlehttp/psr7/src/Uri.php
@@ -279,7 +279,7 @@ public static function isRelativePathReference(UriInterface $uri): bool
*
* @see https://datatracker.ietf.org/doc/html/rfc3986#section-4.4
*/
- public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null): bool
+ public static function isSameDocumentReference(UriInterface $uri, ?UriInterface $base = null): bool
{
if ($base !== null) {
$uri = UriResolver::resolve($base, $uri);
diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/Utils.php b/lib/Google/vendor/guzzlehttp/psr7/src/Utils.php
index bf5ea9dba..7682d2cdc 100644
--- a/lib/Google/vendor/guzzlehttp/psr7/src/Utils.php
+++ b/lib/Google/vendor/guzzlehttp/psr7/src/Utils.php
@@ -231,7 +231,7 @@ public static function modifyRequest(RequestInterface $request, array $changes):
* @param StreamInterface $stream Stream to read from
* @param int|null $maxLength Maximum buffer length
*/
- public static function readLine(StreamInterface $stream, int $maxLength = null): string
+ public static function readLine(StreamInterface $stream, ?int $maxLength = null): string
{
$buffer = '';
$size = 0;
@@ -250,6 +250,20 @@ public static function readLine(StreamInterface $stream, int $maxLength = null):
return $buffer;
}
+ /**
+ * Redact the password in the user info part of a URI.
+ */
+ public static function redactUserInfo(UriInterface $uri): UriInterface
+ {
+ $userInfo = $uri->getUserInfo();
+
+ if (false !== ($pos = \strpos($userInfo, ':'))) {
+ return $uri->withUserInfo(\substr($userInfo, 0, $pos), '***');
+ }
+
+ return $uri;
+ }
+
/**
* Create a new stream based on the input type.
*
diff --git a/lib/Google/vendor/monolog/monolog/CHANGELOG.md b/lib/Google/vendor/monolog/monolog/CHANGELOG.md
index a9a31e713..122d85cde 100644
--- a/lib/Google/vendor/monolog/monolog/CHANGELOG.md
+++ b/lib/Google/vendor/monolog/monolog/CHANGELOG.md
@@ -1,3 +1,11 @@
+### 2.10.0 (2024-11-12)
+
+ * Added `$fileOpenMode` to `StreamHandler` to define a custom fopen mode to open the log file (#1913)
+ * Fixed `StreamHandler` handling of write failures so that it now closes/reopens the stream and retries the write once before failing (#1882)
+ * Fixed `StreamHandler` error handler causing issues if a stream handler triggers an error (#1866)
+ * Fixed `JsonFormatter` handling of incomplete classes (#1834)
+ * Fixed `RotatingFileHandler` bug where rotation could sometimes not happen correctly (#1905)
+
### 2.9.3 (2024-04-12)
* Fixed PHP 8.4 deprecation warnings (#1874)
diff --git a/lib/Google/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php b/lib/Google/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php
index b737d82e3..753e6852c 100644
--- a/lib/Google/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php
+++ b/lib/Google/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php
@@ -192,6 +192,10 @@ protected function normalize($data, int $depth = 0)
return $data;
}
+ if (\get_class($data) === '__PHP_Incomplete_Class') {
+ return new \ArrayObject($data);
+ }
+
if (method_exists($data, '__toString')) {
return $data->__toString();
}
diff --git a/lib/Google/vendor/monolog/monolog/src/Monolog/Handler/ElasticsearchHandler.php b/lib/Google/vendor/monolog/monolog/src/Monolog/Handler/ElasticsearchHandler.php
index e88375c0e..264b380d7 100644
--- a/lib/Google/vendor/monolog/monolog/src/Monolog/Handler/ElasticsearchHandler.php
+++ b/lib/Google/vendor/monolog/monolog/src/Monolog/Handler/ElasticsearchHandler.php
@@ -187,6 +187,7 @@ protected function bulkSend(array $records): void
*/
protected function createExceptionFromResponses($responses): Throwable
{
+ // @phpstan-ignore offsetAccess.nonOffsetAccessible
foreach ($responses['items'] ?? [] as $item) {
if (isset($item['index']['error'])) {
return $this->createExceptionFromError($item['index']['error']);
diff --git a/lib/Google/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php b/lib/Google/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php
index 17745d221..2d0c1a72d 100644
--- a/lib/Google/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php
+++ b/lib/Google/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php
@@ -112,17 +112,22 @@ public function setFilenameFormat(string $filenameFormat, string $dateFormat): s
*/
protected function write(array $record): void
{
- // on the first record written, if the log is new, we should rotate (once per day)
+ // on the first record written, if the log is new, we rotate (once per day) after the log has been written so that the new file exists
if (null === $this->mustRotate) {
$this->mustRotate = null === $this->url || !file_exists($this->url);
}
+ // if the next rotation is expired, then we rotate immediately
if ($this->nextRotation <= $record['datetime']) {
$this->mustRotate = true;
- $this->close();
+ $this->close(); // triggers rotation
}
parent::write($record);
+
+ if ($this->mustRotate) {
+ $this->close(); // triggers rotation
+ }
}
/**
@@ -134,6 +139,8 @@ protected function rotate(): void
$this->url = $this->getTimedFilename();
$this->nextRotation = new \DateTimeImmutable('tomorrow');
+ $this->mustRotate = false;
+
// skip GC of old logs if files are unlimited
if (0 === $this->maxFiles) {
return;
@@ -166,8 +173,6 @@ protected function rotate(): void
restore_error_handler();
}
}
-
- $this->mustRotate = false;
}
protected function getTimedFilename(): string
diff --git a/lib/Google/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php b/lib/Google/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php
index 82c048e1c..218d43847 100644
--- a/lib/Google/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php
+++ b/lib/Google/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php
@@ -41,17 +41,22 @@ class StreamHandler extends AbstractProcessingHandler
protected $filePermission;
/** @var bool */
protected $useLocking;
+ /** @var string */
+ protected $fileOpenMode;
/** @var true|null */
private $dirCreated = null;
+ /** @var bool */
+ private $retrying = false;
/**
* @param resource|string $stream If a missing path can't be created, an UnexpectedValueException will be thrown on first write
* @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write)
* @param bool $useLocking Try to lock log file before doing any writes
+ * @param string $fileOpenMode The fopen() mode used when opening a file, if $stream is a file path
*
* @throws \InvalidArgumentException If stream is not a resource or string
*/
- public function __construct($stream, $level = Logger::DEBUG, bool $bubble = true, ?int $filePermission = null, bool $useLocking = false)
+ public function __construct($stream, $level = Logger::DEBUG, bool $bubble = true, ?int $filePermission = null, bool $useLocking = false, $fileOpenMode = 'a')
{
parent::__construct($level, $bubble);
@@ -78,6 +83,7 @@ public function __construct($stream, $level = Logger::DEBUG, bool $bubble = true
throw new \InvalidArgumentException('A stream must either be a resource or a string.');
}
+ $this->fileOpenMode = $fileOpenMode;
$this->filePermission = $filePermission;
$this->useLocking = $useLocking;
}
@@ -134,9 +140,11 @@ protected function write(array $record): void
}
$this->createDir($url);
$this->errorMessage = null;
- set_error_handler([$this, 'customErrorHandler']);
+ set_error_handler(function (...$args) {
+ return $this->customErrorHandler(...$args);
+ });
try {
- $stream = fopen($url, 'a');
+ $stream = fopen($url, $this->fileOpenMode);
if ($this->filePermission !== null) {
@chmod($url, $this->filePermission);
}
@@ -162,8 +170,30 @@ protected function write(array $record): void
flock($stream, LOCK_EX);
}
- $this->streamWrite($stream, $record);
+ $this->errorMessage = null;
+ set_error_handler(function (...$args) {
+ return $this->customErrorHandler(...$args);
+ });
+ try {
+ $this->streamWrite($stream, $record);
+ } finally {
+ restore_error_handler();
+ }
+ if ($this->errorMessage !== null) {
+ $error = $this->errorMessage;
+ // close the resource if possible to reopen it, and retry the failed write
+ if (!$this->retrying && $this->url !== null && $this->url !== 'php://memory') {
+ $this->retrying = true;
+ $this->close();
+ $this->write($record);
+
+ return;
+ }
+
+ throw new \UnexpectedValueException('Writing to the log file failed: '.$error . Utils::getRecordMessageForException($record));
+ }
+ $this->retrying = false;
if ($this->useLocking) {
flock($stream, LOCK_UN);
}
@@ -183,7 +213,7 @@ protected function streamWrite($stream, array $record): void
private function customErrorHandler(int $code, string $msg): bool
{
- $this->errorMessage = preg_replace('{^(fopen|mkdir)\(.*?\): }', '', $msg);
+ $this->errorMessage = preg_replace('{^(fopen|mkdir|fwrite)\(.*?\): }', '', $msg);
return true;
}
@@ -212,7 +242,9 @@ private function createDir(string $url): void
$dir = $this->getDirFromStream($url);
if (null !== $dir && !is_dir($dir)) {
$this->errorMessage = null;
- set_error_handler([$this, 'customErrorHandler']);
+ set_error_handler(function (...$args) {
+ return $this->customErrorHandler(...$args);
+ });
$status = mkdir($dir, 0777, true);
restore_error_handler();
if (false === $status && !is_dir($dir) && strpos((string) $this->errorMessage, 'File exists') === false) {
diff --git a/lib/Google/vendor/monolog/monolog/src/Monolog/Logger.php b/lib/Google/vendor/monolog/monolog/src/Monolog/Logger.php
index 3c588a707..bf65d3c53 100644
--- a/lib/Google/vendor/monolog/monolog/src/Monolog/Logger.php
+++ b/lib/Google/vendor/monolog/monolog/src/Monolog/Logger.php
@@ -169,7 +169,7 @@ class Logger implements LoggerInterface, ResettableInterface
private $logDepth = 0;
/**
- * @var \WeakMap<\Fiber, int>|null Keeps track of depth inside fibers to prevent infinite logging loops
+ * @var \WeakMap<\Fiber, int> Keeps track of depth inside fibers to prevent infinite logging loops
*/
private $fiberLogDepth;
@@ -197,7 +197,7 @@ public function __construct(string $name, array $handlers = [], array $processor
if (\PHP_VERSION_ID >= 80100) {
// Local variable for phpstan, see https://github.com/phpstan/phpstan/issues/6732#issuecomment-1111118412
- /** @var \WeakMap<\Fiber, int> $fiberLogDepth */
+ /** @var \WeakMap<\Fiber, int> $fiberLogDepth */
$fiberLogDepth = new \WeakMap();
$this->fiberLogDepth = $fiberLogDepth;
}
@@ -345,6 +345,7 @@ public function addRecord(int $level, string $message, array $context = [], ?Dat
if ($this->detectCycles) {
if (\PHP_VERSION_ID >= 80100 && $fiber = \Fiber::getCurrent()) {
+ // @phpstan-ignore offsetAssign.dimType
$this->fiberLogDepth[$fiber] = $this->fiberLogDepth[$fiber] ?? 0;
$logDepth = ++$this->fiberLogDepth[$fiber];
} else {
@@ -753,7 +754,7 @@ public function __unserialize(array $data): void
if (\PHP_VERSION_ID >= 80100) {
// Local variable for phpstan, see https://github.com/phpstan/phpstan/issues/6732#issuecomment-1111118412
- /** @var \WeakMap<\Fiber, int> $fiberLogDepth */
+ /** @var \WeakMap<\Fiber, int> $fiberLogDepth */
$fiberLogDepth = new \WeakMap();
$this->fiberLogDepth = $fiberLogDepth;
}
diff --git a/lib/Google/vendor/monolog/monolog/src/Monolog/Utils.php b/lib/Google/vendor/monolog/monolog/src/Monolog/Utils.php
index 360c42199..d4ff4c040 100644
--- a/lib/Google/vendor/monolog/monolog/src/Monolog/Utils.php
+++ b/lib/Google/vendor/monolog/monolog/src/Monolog/Utils.php
@@ -249,7 +249,7 @@ public static function expandIniShorthandBytes($val)
}
$val = (int) $match['val'];
- switch (strtolower($match['unit'] ?? '')) {
+ switch (strtolower($match['unit'])) {
case 'g':
$val *= 1024;
case 'm':
diff --git a/lib/Google/vendor/phpseclib/phpseclib/BACKERS.md b/lib/Google/vendor/phpseclib/phpseclib/BACKERS.md
index 946b8f5f0..cafcf60a2 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/BACKERS.md
+++ b/lib/Google/vendor/phpseclib/phpseclib/BACKERS.md
@@ -15,4 +15,5 @@ phpseclib ongoing development is made possible by [Tidelift](https://tidelift.co
- [cjhaas](https://github.com/cjhaas)
- [istiak-tridip](https://github.com/istiak-tridip)
- [Anna Filina](https://github.com/afilina)
-- [blakemckeeby](https://github.com/blakemckeeby)
\ No newline at end of file
+- [blakemckeeby](https://github.com/blakemckeeby)
+- [ssddanbrown](https://github.com/ssddanbrown)
\ No newline at end of file
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Common/Functions/Strings.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Common/Functions/Strings.php
index eac793a69..fa750ba28 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Common/Functions/Strings.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Common/Functions/Strings.php
@@ -473,7 +473,7 @@ public static function base64url_encode($data)
// return str_replace(['+', '/'], ['-', '_'], self::base64_encode($data));
return function_exists('sodium_bin2base64') ?
- sodium_bin2base64($data, SODIUM_BASE64_VARIANT_URLSAFE) :
+ sodium_bin2base64($data, SODIUM_BASE64_VARIANT_URLSAFE_NO_PADDING) :
Base64UrlSafe::encode($data);
}
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php
index 89b0a9b0f..3cb2b3055 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php
@@ -433,7 +433,7 @@ protected function setupKey()
$this->bctx['p'][$i ] = $l;
$this->bctx['p'][$i + 1] = $r;
}
- for ($i = 0; $i < 0x400; $i+= 0x100) {
+ for ($i = 0; $i < 0x400; $i += 0x100) {
for ($j = 0; $j < 256; $j += 2) {
list($l, $r) = array_values(unpack('N*', $data = $this->encryptBlock($data)));
$this->bctx['sb'][$i | $j] = $l;
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/AsymmetricKey.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/AsymmetricKey.php
index 09eb5b1b3..a380e43d7 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/AsymmetricKey.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/AsymmetricKey.php
@@ -30,14 +30,14 @@ abstract class AsymmetricKey
/**
* Precomputed Zero
*
- * @var \phpseclib3\Math\BigInteger
+ * @var BigInteger
*/
protected static $zero;
/**
* Precomputed One
*
- * @var \phpseclib3\Math\BigInteger
+ * @var BigInteger
*/
protected static $one;
@@ -51,14 +51,14 @@ abstract class AsymmetricKey
/**
* Hash function
*
- * @var \phpseclib3\Crypt\Hash
+ * @var Hash
*/
protected $hash;
/**
* HMAC function
*
- * @var \phpseclib3\Crypt\Hash
+ * @var Hash
*/
private $hmac;
@@ -130,7 +130,7 @@ protected static function initialize_static_variables()
*
* @param string $key
* @param string $password optional
- * @return \phpseclib3\Crypt\Common\PublicKey|\phpseclib3\Crypt\Common\PrivateKey
+ * @return PublicKey|PrivateKey
*/
public static function load($key, $password = false)
{
@@ -531,7 +531,7 @@ protected function computek($h1)
/**
* Integer to Octet String
*
- * @param \phpseclib3\Math\BigInteger $v
+ * @param BigInteger $v
* @return string
*/
private function int2octets($v)
@@ -551,7 +551,7 @@ private function int2octets($v)
* Bit String to Integer
*
* @param string $in
- * @return \phpseclib3\Math\BigInteger
+ * @return BigInteger
*/
protected function bits2int($in)
{
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Keys/PKCS8.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Keys/PKCS8.php
index 7aa554808..6c9a65006 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Keys/PKCS8.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Keys/PKCS8.php
@@ -83,6 +83,13 @@ abstract class PKCS8 extends PKCS
*/
private static $oidsLoaded = false;
+ /**
+ * Binary key flag
+ *
+ * @var bool
+ */
+ private static $binary = false;
+
/**
* Sets the default encryption algorithm
*
@@ -513,6 +520,18 @@ protected static function load($key, $password = '')
throw new \RuntimeException('Unable to parse using either OneAsymmetricKey or PublicKeyInfo ASN1 maps');
}
+ /**
+ * Toggle between binary (DER) and printable (PEM) keys
+ *
+ * Printable keys are what are generated by default.
+ *
+ * @param bool $enabled
+ */
+ public static function setBinaryOutput($enabled)
+ {
+ self::$binary = $enabled;
+ }
+
/**
* Wrap a private key appropriately
*
@@ -616,11 +635,19 @@ protected static function wrapPrivateKey($key, $attr, $params, $password, $oid =
$key = ASN1::encodeDER($key, Maps\EncryptedPrivateKeyInfo::MAP);
+ if (isset($options['binary']) ? $options['binary'] : self::$binary) {
+ return $key;
+ }
+
return "-----BEGIN ENCRYPTED PRIVATE KEY-----\r\n" .
chunk_split(Strings::base64_encode($key), 64) .
"-----END ENCRYPTED PRIVATE KEY-----";
}
+ if (isset($options['binary']) ? $options['binary'] : self::$binary) {
+ return $key;
+ }
+
return "-----BEGIN PRIVATE KEY-----\r\n" .
chunk_split(Strings::base64_encode($key), 64) .
"-----END PRIVATE KEY-----";
@@ -634,7 +661,7 @@ protected static function wrapPrivateKey($key, $attr, $params, $password, $oid =
* @param string $oid
* @return string
*/
- protected static function wrapPublicKey($key, $params, $oid = null)
+ protected static function wrapPublicKey($key, $params, $oid = null, array $options = [])
{
self::initialize_static_variables();
@@ -651,6 +678,10 @@ protected static function wrapPublicKey($key, $params, $oid = null)
$key = ASN1::encodeDER($key, Maps\PublicKeyInfo::MAP);
+ if (isset($options['binary']) ? $options['binary'] : self::$binary) {
+ return $key;
+ }
+
return "-----BEGIN PUBLIC KEY-----\r\n" .
chunk_split(Strings::base64_encode($key), 64) .
"-----END PUBLIC KEY-----";
@@ -697,7 +728,7 @@ public static function extractEncryptionAlgorithm($key)
$decoded = self::preParse($key);
- $r = ASN1::asn1map($decoded[0], ASN1\Maps\EncryptedPrivateKeyInfo::MAP);
+ $r = ASN1::asn1map($decoded[0], Maps\EncryptedPrivateKeyInfo::MAP);
if (!is_array($r)) {
throw new \RuntimeException('Unable to parse using EncryptedPrivateKeyInfo map');
}
@@ -707,7 +738,7 @@ public static function extractEncryptionAlgorithm($key)
if (!$decoded) {
throw new \RuntimeException('Unable to decode BER');
}
- $r['encryptionAlgorithm']['parameters'] = ASN1::asn1map($decoded[0], ASN1\Maps\PBES2params::MAP);
+ $r['encryptionAlgorithm']['parameters'] = ASN1::asn1map($decoded[0], Maps\PBES2params::MAP);
$kdf = &$r['encryptionAlgorithm']['parameters']['keyDerivationFunc'];
switch ($kdf['algorithm']) {
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Signature/Raw.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Signature/Raw.php
index ab8e7e460..42a65afa4 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Signature/Raw.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/Formats/Signature/Raw.php
@@ -49,8 +49,8 @@ public static function load($sig)
/**
* Returns a signature in the appropriate format
*
- * @param \phpseclib3\Math\BigInteger $r
- * @param \phpseclib3\Math\BigInteger $s
+ * @param BigInteger $r
+ * @param BigInteger $s
* @return string
*/
public static function save(BigInteger $r, BigInteger $s)
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/StreamCipher.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/StreamCipher.php
index 0e2d6f0c3..0d9690822 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/StreamCipher.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/StreamCipher.php
@@ -35,7 +35,7 @@ abstract class StreamCipher extends SymmetricKey
* Default Constructor.
*
* @see \phpseclib3\Crypt\Common\SymmetricKey::__construct()
- * @return \phpseclib3\Crypt\Common\StreamCipher
+ * @return StreamCipher
*/
public function __construct()
{
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/SymmetricKey.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/SymmetricKey.php
index 175508d41..35d7a7d7a 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/SymmetricKey.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/SymmetricKey.php
@@ -1079,7 +1079,7 @@ public function setPassword($password, $method = 'pbkdf2', ...$func_args)
*
* @see self::setPassword()
* @param int $n
- * @param \phpseclib3\Crypt\Hash $hashObj
+ * @param Hash $hashObj
* @param string $i
* @param string $d
* @param int $count
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DH.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DH.php
index e1deaf086..b2301986f 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DH.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DH.php
@@ -49,7 +49,7 @@ abstract class DH extends AsymmetricKey
/**
* DH prime
*
- * @var \phpseclib3\Math\BigInteger
+ * @var BigInteger
*/
protected $prime;
@@ -58,14 +58,14 @@ abstract class DH extends AsymmetricKey
*
* Prime divisor of p-1
*
- * @var \phpseclib3\Math\BigInteger
+ * @var BigInteger
*/
protected $base;
/**
* Public Key
*
- * @var \phpseclib3\Math\BigInteger
+ * @var BigInteger
*/
protected $publicKey;
@@ -243,7 +243,7 @@ public static function createParameters(...$args)
*
* @param Parameters $params
* @param int $length optional
- * @return DH\PrivateKey
+ * @return PrivateKey
*/
public static function createKey(Parameters $params, $length = 0)
{
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DH/Formats/Keys/PKCS8.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DH/Formats/Keys/PKCS8.php
index c330a3c76..3b83a4290 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DH/Formats/Keys/PKCS8.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DH/Formats/Keys/PKCS8.php
@@ -89,10 +89,10 @@ public static function load($key, $password = '')
/**
* Convert a private key to the appropriate format.
*
- * @param \phpseclib3\Math\BigInteger $prime
- * @param \phpseclib3\Math\BigInteger $base
- * @param \phpseclib3\Math\BigInteger $privateKey
- * @param \phpseclib3\Math\BigInteger $publicKey
+ * @param BigInteger $prime
+ * @param BigInteger $base
+ * @param BigInteger $privateKey
+ * @param BigInteger $publicKey
* @param string $password optional
* @param array $options optional
* @return string
@@ -112,9 +112,9 @@ public static function savePrivateKey(BigInteger $prime, BigInteger $base, BigIn
/**
* Convert a public key to the appropriate format
*
- * @param \phpseclib3\Math\BigInteger $prime
- * @param \phpseclib3\Math\BigInteger $base
- * @param \phpseclib3\Math\BigInteger $publicKey
+ * @param BigInteger $prime
+ * @param BigInteger $base
+ * @param BigInteger $publicKey
* @param array $options optional
* @return string
*/
@@ -127,6 +127,6 @@ public static function savePublicKey(BigInteger $prime, BigInteger $base, BigInt
$params = ASN1::encodeDER($params, Maps\DHParameter::MAP);
$params = new ASN1\Element($params);
$key = ASN1::encodeDER($publicKey, ['type' => ASN1::TYPE_INTEGER]);
- return self::wrapPublicKey($key, $params);
+ return self::wrapPublicKey($key, $params, null, $options);
}
}
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DH/PrivateKey.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DH/PrivateKey.php
index 737781f87..e2407e35e 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DH/PrivateKey.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DH/PrivateKey.php
@@ -40,7 +40,7 @@ final class PrivateKey extends DH
/**
* Returns the public key
*
- * @return DH\PublicKey
+ * @return PublicKey
*/
public function getPublicKey()
{
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA.php
index 0123c66c5..92c777d6a 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA.php
@@ -53,7 +53,7 @@ abstract class DSA extends AsymmetricKey
/**
* DSA Prime P
*
- * @var \phpseclib3\Math\BigInteger
+ * @var BigInteger
*/
protected $p;
@@ -62,21 +62,21 @@ abstract class DSA extends AsymmetricKey
*
* Prime divisor of p-1
*
- * @var \phpseclib3\Math\BigInteger
+ * @var BigInteger
*/
protected $q;
/**
* DSA Group Generator G
*
- * @var \phpseclib3\Math\BigInteger
+ * @var BigInteger
*/
protected $g;
/**
* DSA public key value y
*
- * @var \phpseclib3\Math\BigInteger
+ * @var BigInteger
*/
protected $y;
@@ -99,7 +99,7 @@ abstract class DSA extends AsymmetricKey
*
* @param int $L
* @param int $N
- * @return \phpseclib3\Crypt\DSA|bool
+ * @return DSA|bool
*/
public static function createParameters($L = 2048, $N = 224)
{
@@ -179,7 +179,7 @@ public static function createParameters($L = 2048, $N = 224)
* Returns the private key, from which the publickey can be extracted
*
* @param int[] ...$args
- * @return DSA\PrivateKey
+ * @return PrivateKey
*/
public static function createKey(...$args)
{
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/OpenSSH.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/OpenSSH.php
index cc204fa94..bc41fcf5e 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/OpenSSH.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/OpenSSH.php
@@ -65,10 +65,10 @@ public static function load($key, $password = '')
/**
* Convert a public key to the appropriate format
*
- * @param \phpseclib3\Math\BigInteger $p
- * @param \phpseclib3\Math\BigInteger $q
- * @param \phpseclib3\Math\BigInteger $g
- * @param \phpseclib3\Math\BigInteger $y
+ * @param BigInteger $p
+ * @param BigInteger $q
+ * @param BigInteger $g
+ * @param BigInteger $y
* @param array $options optional
* @return string
*/
@@ -99,11 +99,11 @@ public static function savePublicKey(BigInteger $p, BigInteger $q, BigInteger $g
/**
* Convert a private key to the appropriate format.
*
- * @param \phpseclib3\Math\BigInteger $p
- * @param \phpseclib3\Math\BigInteger $q
- * @param \phpseclib3\Math\BigInteger $g
- * @param \phpseclib3\Math\BigInteger $y
- * @param \phpseclib3\Math\BigInteger $x
+ * @param BigInteger $p
+ * @param BigInteger $q
+ * @param BigInteger $g
+ * @param BigInteger $y
+ * @param BigInteger $x
* @param string $password optional
* @param array $options optional
* @return string
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/PKCS1.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/PKCS1.php
index 52a049928..800cfb38c 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/PKCS1.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/PKCS1.php
@@ -77,9 +77,9 @@ public static function load($key, $password = '')
/**
* Convert DSA parameters to the appropriate format
*
- * @param \phpseclib3\Math\BigInteger $p
- * @param \phpseclib3\Math\BigInteger $q
- * @param \phpseclib3\Math\BigInteger $g
+ * @param BigInteger $p
+ * @param BigInteger $q
+ * @param BigInteger $g
* @return string
*/
public static function saveParameters(BigInteger $p, BigInteger $q, BigInteger $g)
@@ -100,11 +100,11 @@ public static function saveParameters(BigInteger $p, BigInteger $q, BigInteger $
/**
* Convert a private key to the appropriate format.
*
- * @param \phpseclib3\Math\BigInteger $p
- * @param \phpseclib3\Math\BigInteger $q
- * @param \phpseclib3\Math\BigInteger $g
- * @param \phpseclib3\Math\BigInteger $y
- * @param \phpseclib3\Math\BigInteger $x
+ * @param BigInteger $p
+ * @param BigInteger $q
+ * @param BigInteger $g
+ * @param BigInteger $y
+ * @param BigInteger $x
* @param string $password optional
* @param array $options optional
* @return string
@@ -128,10 +128,10 @@ public static function savePrivateKey(BigInteger $p, BigInteger $q, BigInteger $
/**
* Convert a public key to the appropriate format
*
- * @param \phpseclib3\Math\BigInteger $p
- * @param \phpseclib3\Math\BigInteger $q
- * @param \phpseclib3\Math\BigInteger $g
- * @param \phpseclib3\Math\BigInteger $y
+ * @param BigInteger $p
+ * @param BigInteger $q
+ * @param BigInteger $g
+ * @param BigInteger $y
* @return string
*/
public static function savePublicKey(BigInteger $p, BigInteger $q, BigInteger $g, BigInteger $y)
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/PKCS8.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/PKCS8.php
index 004881e8c..359ed09ea 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/PKCS8.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/PKCS8.php
@@ -99,11 +99,11 @@ public static function load($key, $password = '')
/**
* Convert a private key to the appropriate format.
*
- * @param \phpseclib3\Math\BigInteger $p
- * @param \phpseclib3\Math\BigInteger $q
- * @param \phpseclib3\Math\BigInteger $g
- * @param \phpseclib3\Math\BigInteger $y
- * @param \phpseclib3\Math\BigInteger $x
+ * @param BigInteger $p
+ * @param BigInteger $q
+ * @param BigInteger $g
+ * @param BigInteger $y
+ * @param BigInteger $x
* @param string $password optional
* @param array $options optional
* @return string
@@ -124,10 +124,10 @@ public static function savePrivateKey(BigInteger $p, BigInteger $q, BigInteger $
/**
* Convert a public key to the appropriate format
*
- * @param \phpseclib3\Math\BigInteger $p
- * @param \phpseclib3\Math\BigInteger $q
- * @param \phpseclib3\Math\BigInteger $g
- * @param \phpseclib3\Math\BigInteger $y
+ * @param BigInteger $p
+ * @param BigInteger $q
+ * @param BigInteger $g
+ * @param BigInteger $y
* @param array $options optional
* @return string
*/
@@ -141,6 +141,6 @@ public static function savePublicKey(BigInteger $p, BigInteger $q, BigInteger $g
$params = ASN1::encodeDER($params, Maps\DSAParams::MAP);
$params = new ASN1\Element($params);
$key = ASN1::encodeDER($y, Maps\DSAPublicKey::MAP);
- return self::wrapPublicKey($key, $params);
+ return self::wrapPublicKey($key, $params, null, $options);
}
}
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/PuTTY.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/PuTTY.php
index 177bfdd4f..f6177f462 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/PuTTY.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/PuTTY.php
@@ -68,11 +68,11 @@ public static function load($key, $password = '')
/**
* Convert a private key to the appropriate format.
*
- * @param \phpseclib3\Math\BigInteger $p
- * @param \phpseclib3\Math\BigInteger $q
- * @param \phpseclib3\Math\BigInteger $g
- * @param \phpseclib3\Math\BigInteger $y
- * @param \phpseclib3\Math\BigInteger $x
+ * @param BigInteger $p
+ * @param BigInteger $q
+ * @param BigInteger $g
+ * @param BigInteger $y
+ * @param BigInteger $x
* @param string $password optional
* @param array $options optional
* @return string
@@ -92,10 +92,10 @@ public static function savePrivateKey(BigInteger $p, BigInteger $q, BigInteger $
/**
* Convert a public key to the appropriate format
*
- * @param \phpseclib3\Math\BigInteger $p
- * @param \phpseclib3\Math\BigInteger $q
- * @param \phpseclib3\Math\BigInteger $g
- * @param \phpseclib3\Math\BigInteger $y
+ * @param BigInteger $p
+ * @param BigInteger $q
+ * @param BigInteger $g
+ * @param BigInteger $y
* @return string
*/
public static function savePublicKey(BigInteger $p, BigInteger $q, BigInteger $g, BigInteger $y)
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/Raw.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/Raw.php
index 201aa6f95..8e2ef01f1 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/Raw.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/Raw.php
@@ -56,11 +56,11 @@ public static function load($key, $password = '')
/**
* Convert a private key to the appropriate format.
*
- * @param \phpseclib3\Math\BigInteger $p
- * @param \phpseclib3\Math\BigInteger $q
- * @param \phpseclib3\Math\BigInteger $g
- * @param \phpseclib3\Math\BigInteger $y
- * @param \phpseclib3\Math\BigInteger $x
+ * @param BigInteger $p
+ * @param BigInteger $q
+ * @param BigInteger $g
+ * @param BigInteger $y
+ * @param BigInteger $x
* @param string $password optional
* @return string
*/
@@ -72,10 +72,10 @@ public static function savePrivateKey(BigInteger $p, BigInteger $q, BigInteger $
/**
* Convert a public key to the appropriate format
*
- * @param \phpseclib3\Math\BigInteger $p
- * @param \phpseclib3\Math\BigInteger $q
- * @param \phpseclib3\Math\BigInteger $g
- * @param \phpseclib3\Math\BigInteger $y
+ * @param BigInteger $p
+ * @param BigInteger $q
+ * @param BigInteger $g
+ * @param BigInteger $y
* @return string
*/
public static function savePublicKey(BigInteger $p, BigInteger $q, BigInteger $g, BigInteger $y)
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/XML.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/XML.php
index fc3636771..f77cbf20d 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/XML.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Keys/XML.php
@@ -114,10 +114,10 @@ public static function load($key, $password = '')
*
* See https://www.w3.org/TR/xmldsig-core/#sec-DSAKeyValue
*
- * @param \phpseclib3\Math\BigInteger $p
- * @param \phpseclib3\Math\BigInteger $q
- * @param \phpseclib3\Math\BigInteger $g
- * @param \phpseclib3\Math\BigInteger $y
+ * @param BigInteger $p
+ * @param BigInteger $q
+ * @param BigInteger $g
+ * @param BigInteger $y
* @return string
*/
public static function savePublicKey(BigInteger $p, BigInteger $q, BigInteger $g, BigInteger $y)
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Signature/ASN1.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Signature/ASN1.php
index df52beed4..f80060286 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Signature/ASN1.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Signature/ASN1.php
@@ -51,8 +51,8 @@ public static function load($sig)
/**
* Returns a signature in the appropriate format
*
- * @param \phpseclib3\Math\BigInteger $r
- * @param \phpseclib3\Math\BigInteger $s
+ * @param BigInteger $r
+ * @param BigInteger $s
* @return string
*/
public static function save(BigInteger $r, BigInteger $s)
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Signature/SSH2.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Signature/SSH2.php
index dbfceabba..88807b5b8 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Signature/SSH2.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/Formats/Signature/SSH2.php
@@ -55,8 +55,8 @@ public static function load($sig)
/**
* Returns a signature in the appropriate format
*
- * @param \phpseclib3\Math\BigInteger $r
- * @param \phpseclib3\Math\BigInteger $s
+ * @param BigInteger $r
+ * @param BigInteger $s
* @return string
*/
public static function save(BigInteger $r, BigInteger $s)
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/PrivateKey.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/PrivateKey.php
index 74d3e69e3..87cd77a7a 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/PrivateKey.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA/PrivateKey.php
@@ -28,7 +28,7 @@ final class PrivateKey extends DSA implements Common\PrivateKey
/**
* DSA secret exponent x
*
- * @var \phpseclib3\Math\BigInteger
+ * @var BigInteger
*/
protected $x;
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC.php
index 10b38254a..dc82dd049 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC.php
@@ -70,7 +70,7 @@ abstract class EC extends AsymmetricKey
/**
* Curve
*
- * @var \phpseclib3\Crypt\EC\BaseCurves\Base
+ * @var EC\BaseCurves\Base
*/
protected $curve;
@@ -100,7 +100,7 @@ abstract class EC extends AsymmetricKey
*
* Used for deterministic ECDSA
*
- * @var \phpseclib3\Math\BigInteger
+ * @var BigInteger
*/
protected $q;
@@ -112,7 +112,7 @@ abstract class EC extends AsymmetricKey
* public key. But the x is different depending on which side of the equal sign
* you're on. It's less ambiguous if you do dA * base point = (x, y)-coordinate.
*
- * @var \phpseclib3\Math\BigInteger
+ * @var BigInteger
*/
protected $x;
@@ -134,7 +134,7 @@ abstract class EC extends AsymmetricKey
* Create public / private key pair.
*
* @param string $curve
- * @return \phpseclib3\Crypt\EC\PrivateKey
+ * @return PrivateKey
*/
public static function createKey($curve)
{
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Base.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Base.php
index dbc914be6..d76562d0d 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Base.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Base.php
@@ -32,7 +32,7 @@ abstract class Base
/**
* Finite Field Integer factory
*
- * @var \phpseclib3\Math\FiniteField\Integer
+ * @var FiniteField\Integer
*/
protected $factory;
@@ -47,7 +47,7 @@ public function randomInteger()
}
/**
- * Converts a BigInteger to a \phpseclib3\Math\FiniteField\Integer integer
+ * Converts a BigInteger to a FiniteField\Integer integer
*
* @return object
*/
@@ -147,7 +147,7 @@ public function setOrder(BigInteger $order)
/**
* Returns the Order
*
- * @return \phpseclib3\Math\BigInteger
+ * @return BigInteger
*/
public function getOrder()
{
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Binary.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Binary.php
index 4fc6c70c0..66da11da7 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Binary.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Binary.php
@@ -35,7 +35,7 @@ class Binary extends Base
/**
* Binary Field Integer factory
*
- * @var \phpseclib3\Math\BinaryField
+ * @var BinaryField
*/
protected $factory;
@@ -305,7 +305,7 @@ public function verifyPoint(array $p)
/**
* Returns the modulo
*
- * @return \phpseclib3\Math\BigInteger
+ * @return BigInteger
*/
public function getModulo()
{
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Montgomery.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Montgomery.php
index e3fa50b33..b792e161d 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Montgomery.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Montgomery.php
@@ -39,7 +39,7 @@ class Montgomery extends Base
/**
* Prime Field Integer factory
*
- * @var \phpseclib3\Math\PrimeField
+ * @var PrimeField
*/
protected $factory;
@@ -219,7 +219,7 @@ private function doubleAndAddPoint(array $p, array $q, PrimeInteger $x1)
public function multiplyPoint(array $p, BigInteger $d)
{
$p1 = [$this->one, $this->zero];
- $alreadyInternal = isset($x[1]);
+ $alreadyInternal = isset($p[1]);
$p2 = $this->convertToInternal($p);
$x = $p[0];
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Prime.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Prime.php
index 6250dfb0f..620040170 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Prime.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Prime.php
@@ -483,7 +483,7 @@ public function verifyPoint(array $p)
/**
* Returns the modulo
*
- * @return \phpseclib3\Math\BigInteger
+ * @return BigInteger
*/
public function getModulo()
{
@@ -493,7 +493,7 @@ public function getModulo()
/**
* Returns the a coefficient
*
- * @return \phpseclib3\Math\PrimeField\Integer
+ * @return PrimeInteger
*/
public function getA()
{
@@ -503,7 +503,7 @@ public function getA()
/**
* Returns the a coefficient
*
- * @return \phpseclib3\Math\PrimeField\Integer
+ * @return PrimeInteger
*/
public function getB()
{
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/TwistedEdwards.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/TwistedEdwards.php
index 2521a4c0e..004406acf 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/TwistedEdwards.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/TwistedEdwards.php
@@ -133,7 +133,7 @@ public function setBasePoint($x, $y)
/**
* Returns the a coefficient
*
- * @return \phpseclib3\Math\PrimeField\Integer
+ * @return PrimeInteger
*/
public function getA()
{
@@ -143,7 +143,7 @@ public function getA()
/**
* Returns the a coefficient
*
- * @return \phpseclib3\Math\PrimeField\Integer
+ * @return PrimeInteger
*/
public function getD()
{
@@ -171,7 +171,7 @@ public function getBasePoint()
/**
* Returns the affine point
*
- * @return \phpseclib3\Math\PrimeField\Integer[]
+ * @return PrimeField\Integer[]
*/
public function convertToAffine(array $p)
{
@@ -189,7 +189,7 @@ public function convertToAffine(array $p)
/**
* Returns the modulo
*
- * @return \phpseclib3\Math\BigInteger
+ * @return BigInteger
*/
public function getModulo()
{
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/Common.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/Common.php
index 63402b4a8..743c07c3e 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/Common.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/Common.php
@@ -183,7 +183,7 @@ private static function initialize_static_variables()
* If the key contains an implicit curve phpseclib needs the curve
* to be explicitly provided
*
- * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve
+ * @param BaseCurve $curve
*/
public static function setImplicitCurve(BaseCurve $curve)
{
@@ -195,7 +195,7 @@ public static function setImplicitCurve(BaseCurve $curve)
* on the curve parameters
*
* @param array $params
- * @return \phpseclib3\Crypt\EC\BaseCurves\Base|false
+ * @return BaseCurve|false
*/
protected static function loadCurveByParam(array $params)
{
@@ -269,7 +269,7 @@ protected static function loadCurveByParam(array $params)
* Supports both compressed and uncompressed points
*
* @param string $str
- * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve
+ * @param BaseCurve $curve
* @return object[]
*/
public static function extractPoint($str, BaseCurve $curve)
@@ -335,7 +335,7 @@ public static function extractPoint($str, BaseCurve $curve)
* Encode Parameters
*
* @todo Maybe at some point this could be moved to __toString() for each of the curves?
- * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve
+ * @param BaseCurve $curve
* @param bool $returnArray optional
* @param array $options optional
* @return string|false
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/JWK.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/JWK.php
index fd18a9815..5bc5184f7 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/JWK.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/JWK.php
@@ -130,7 +130,7 @@ private static function getAlias(BaseCurve $curve)
/**
* Return the array superstructure for an EC public key
*
- * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve
+ * @param BaseCurve $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @return array
*/
@@ -155,7 +155,7 @@ private static function savePublicKeyHelper(BaseCurve $curve, array $publicKey)
/**
* Convert an EC public key to the appropriate format
*
- * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve
+ * @param BaseCurve $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @param array $options optional
* @return string
@@ -170,8 +170,8 @@ public static function savePublicKey(BaseCurve $curve, array $publicKey, array $
/**
* Convert a private key to the appropriate format.
*
- * @param \phpseclib3\Math\BigInteger $privateKey
- * @param \phpseclib3\Crypt\EC\Curves\Ed25519 $curve
+ * @param BigInteger $privateKey
+ * @param Ed25519 $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @param string $secret optional
* @param string $password optional
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPrivate.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPrivate.php
index 5741b05ad..aa64f79ab 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPrivate.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPrivate.php
@@ -71,7 +71,7 @@ public static function load($key, $password = '')
/**
* Convert an EC public key to the appropriate format
*
- * @param \phpseclib3\Crypt\EC\BaseCurves\Montgomery $curve
+ * @param MontgomeryCurve $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @return string
*/
@@ -83,8 +83,8 @@ public static function savePublicKey(MontgomeryCurve $curve, array $publicKey)
/**
* Convert a private key to the appropriate format.
*
- * @param \phpseclib3\Math\BigInteger $privateKey
- * @param \phpseclib3\Crypt\EC\BaseCurves\Montgomery $curve
+ * @param BigInteger $privateKey
+ * @param MontgomeryCurve $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @param string $secret optional
* @param string $password optional
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPublic.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPublic.php
index d1ad48a5b..257c26e87 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPublic.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPublic.php
@@ -60,7 +60,7 @@ public static function load($key, $password = '')
/**
* Convert an EC public key to the appropriate format
*
- * @param \phpseclib3\Crypt\EC\BaseCurves\Montgomery $curve
+ * @param MontgomeryCurve $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @return string
*/
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/OpenSSH.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/OpenSSH.php
index 2cd3e19d0..0ef116044 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/OpenSSH.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/OpenSSH.php
@@ -134,7 +134,7 @@ private static function getAlias(BaseCurve $curve)
/**
* Convert an EC public key to the appropriate format
*
- * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve
+ * @param BaseCurve $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @param array $options optional
* @return string
@@ -171,8 +171,8 @@ public static function savePublicKey(BaseCurve $curve, array $publicKey, array $
/**
* Convert a private key to the appropriate format.
*
- * @param \phpseclib3\Math\BigInteger $privateKey
- * @param \phpseclib3\Crypt\EC\Curves\Ed25519 $curve
+ * @param BigInteger $privateKey
+ * @param Ed25519 $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @param string $secret optional
* @param string $password optional
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PKCS1.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PKCS1.php
index 9f4b33003..756ffb957 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PKCS1.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PKCS1.php
@@ -162,8 +162,8 @@ public static function saveParameters(BaseCurve $curve, array $options = [])
/**
* Convert a private key to the appropriate format.
*
- * @param \phpseclib3\Math\BigInteger $privateKey
- * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve
+ * @param BigInteger $privateKey
+ * @param BaseCurve $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @param string $secret optional
* @param string $password optional
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PKCS8.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PKCS8.php
index e5012e5d3..9fc84054e 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PKCS8.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PKCS8.php
@@ -161,7 +161,7 @@ private static function loadEdDSA(array $key)
/**
* Convert an EC public key to the appropriate format
*
- * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve
+ * @param BaseCurve $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @param array $options optional
* @return string
@@ -178,7 +178,8 @@ public static function savePublicKey(BaseCurve $curve, array $publicKey, array $
return self::wrapPublicKey(
$curve->encodePoint($publicKey),
null,
- $curve instanceof Ed25519 ? 'id-Ed25519' : 'id-Ed448'
+ $curve instanceof Ed25519 ? 'id-Ed25519' : 'id-Ed448',
+ $options
);
}
@@ -186,14 +187,14 @@ public static function savePublicKey(BaseCurve $curve, array $publicKey, array $
$key = "\4" . $publicKey[0]->toBytes() . $publicKey[1]->toBytes();
- return self::wrapPublicKey($key, $params, 'id-ecPublicKey');
+ return self::wrapPublicKey($key, $params, 'id-ecPublicKey', $options);
}
/**
* Convert a private key to the appropriate format.
*
- * @param \phpseclib3\Math\BigInteger $privateKey
- * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve
+ * @param BigInteger $privateKey
+ * @param BaseCurve $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @param string $secret optional
* @param string $password optional
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PuTTY.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PuTTY.php
index 866c883fb..7e1e9170f 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PuTTY.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/PuTTY.php
@@ -84,8 +84,8 @@ public static function load($key, $password = '')
/**
* Convert a private key to the appropriate format.
*
- * @param \phpseclib3\Math\BigInteger $privateKey
- * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve
+ * @param BigInteger $privateKey
+ * @param BaseCurve $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @param string $secret optional
* @param string $password optional
@@ -121,7 +121,7 @@ public static function savePrivateKey(BigInteger $privateKey, BaseCurve $curve,
/**
* Convert an EC public key to the appropriate format
*
- * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve
+ * @param BaseCurve $curve
* @param \phpseclib3\Math\Common\FiniteField[] $publicKey
* @return string
*/
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/XML.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/XML.php
index 27d9218fb..b0cb12650 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/XML.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/XML.php
@@ -171,7 +171,7 @@ private static function decodeValue($value)
* Extract points from an XML document
*
* @param \DOMXPath $xpath
- * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve
+ * @param BaseCurve $curve
* @return object[]
*/
private static function extractPointRFC4050(\DOMXPath $xpath, BaseCurve $curve)
@@ -199,7 +199,7 @@ private static function extractPointRFC4050(\DOMXPath $xpath, BaseCurve $curve)
* on the curve parameters
*
* @param \DomXPath $xpath
- * @return \phpseclib3\Crypt\EC\BaseCurves\Base|false
+ * @return BaseCurve|false
*/
private static function loadCurveByParam(\DOMXPath $xpath)
{
@@ -279,7 +279,7 @@ private static function loadCurveByParam(\DOMXPath $xpath)
* on the curve parameters
*
* @param \DomXPath $xpath
- * @return \phpseclib3\Crypt\EC\BaseCurves\Base|false
+ * @return BaseCurve|false
*/
private static function loadCurveByParamRFC4050(\DOMXPath $xpath)
{
@@ -366,7 +366,7 @@ public static function disableRFC4050Syntax()
/**
* Convert a public key to the appropriate format
*
- * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve
+ * @param BaseCurve $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @param array $options optional
* @return string
@@ -407,7 +407,7 @@ public static function savePublicKey(BaseCurve $curve, array $publicKey, array $
/**
* Encode Parameters
*
- * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve
+ * @param BaseCurve $curve
* @param string $pre
* @param array $options optional
* @return string|false
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/libsodium.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/libsodium.php
index 2be6ba59b..cce37bab4 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/libsodium.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/libsodium.php
@@ -81,7 +81,7 @@ public static function load($key, $password = '')
/**
* Convert an EC public key to the appropriate format
*
- * @param \phpseclib3\Crypt\EC\Curves\Ed25519 $curve
+ * @param Ed25519 $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @return string
*/
@@ -93,8 +93,8 @@ public static function savePublicKey(Ed25519 $curve, array $publicKey)
/**
* Convert a private key to the appropriate format.
*
- * @param \phpseclib3\Math\BigInteger $privateKey
- * @param \phpseclib3\Crypt\EC\Curves\Ed25519 $curve
+ * @param BigInteger $privateKey
+ * @param Ed25519 $curve
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
* @param string $secret optional
* @param string $password optional
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/ASN1.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/ASN1.php
index d2a80a14f..385028b3a 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/ASN1.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/ASN1.php
@@ -51,8 +51,8 @@ public static function load($sig)
/**
* Returns a signature in the appropriate format
*
- * @param \phpseclib3\Math\BigInteger $r
- * @param \phpseclib3\Math\BigInteger $s
+ * @param BigInteger $r
+ * @param BigInteger $s
* @return string
*/
public static function save(BigInteger $r, BigInteger $s)
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/IEEE.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/IEEE.php
index 69139da45..c5e622a12 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/IEEE.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/IEEE.php
@@ -52,15 +52,17 @@ public static function load($sig)
/**
* Returns a signature in the appropriate format
*
- * @param \phpseclib3\Math\BigInteger $r
- * @param \phpseclib3\Math\BigInteger $s
+ * @param BigInteger $r
+ * @param BigInteger $s
+ * @param string $curve
+ * @param int $length
* @return string
*/
- public static function save(BigInteger $r, BigInteger $s)
+ public static function save(BigInteger $r, BigInteger $s, $curve, $length)
{
$r = $r->toBytes();
$s = $s->toBytes();
- $len = max(strlen($r), strlen($s));
- return str_pad($r, $len, "\0", STR_PAD_LEFT) . str_pad($s, $len, "\0", STR_PAD_LEFT);
+ $length = (int) ceil($length / 8);
+ return str_pad($r, $length, "\0", STR_PAD_LEFT) . str_pad($s, $length, "\0", STR_PAD_LEFT);
}
}
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/SSH2.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/SSH2.php
index e06444212..698c8e4ce 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/SSH2.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/SSH2.php
@@ -66,8 +66,8 @@ public static function load($sig)
/**
* Returns a signature in the appropriate format
*
- * @param \phpseclib3\Math\BigInteger $r
- * @param \phpseclib3\Math\BigInteger $s
+ * @param BigInteger $r
+ * @param BigInteger $s
* @param string $curve
* @return string
*/
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/PrivateKey.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/PrivateKey.php
index 598869614..91253b8fd 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/PrivateKey.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/PrivateKey.php
@@ -159,7 +159,7 @@ public function sign($message)
extract(ASN1Signature::load($signature));
- return $shortFormat == 'SSH2' ? $format::save($r, $s, $this->getCurve()) : $format::save($r, $s);
+ return $this->formatSignature($r, $s);
}
}
@@ -208,7 +208,7 @@ public function sign($message)
list(, $s) = $temp->divide($this->q);
*/
- return $shortFormat == 'SSH2' ? $format::save($r, $s, $this->getCurve()) : $format::save($r, $s);
+ return $this->formatSignature($r, $s);
}
/**
@@ -253,4 +253,28 @@ public function getPublicKey()
}
return $key;
}
+
+ /**
+ * Returns a signature in the appropriate format
+ *
+ * @return string
+ */
+ private function formatSignature(BigInteger $r, BigInteger $s)
+ {
+ $format = $this->sigFormat;
+
+ $temp = new \ReflectionMethod($format, 'save');
+ $paramCount = $temp->getNumberOfRequiredParameters();
+
+ // @codingStandardsIgnoreStart
+ switch ($paramCount) {
+ case 2: return $format::save($r, $s);
+ case 3: return $format::save($r, $s, $this->getCurve());
+ case 4: return $format::save($r, $s, $this->getCurve(), $this->getLength());
+ }
+ // @codingStandardsIgnoreEnd
+
+ // presumably the only way you could get to this is if you were using a custom plugin
+ throw new UnsupportedOperationException("$format::save() has $paramCount parameters - the only valid parameter counts are 2 or 3");
+ }
}
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Hash.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Hash.php
index 0e02544eb..09e48f960 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Hash.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Hash.php
@@ -128,7 +128,7 @@ class Hash
/**
* Outer XOR (Internal HMAC)
*
- * Used only for sha512/*
+ * Used only for sha512
*
* @see self::hash()
* @var string
@@ -138,7 +138,7 @@ class Hash
/**
* Inner XOR (Internal HMAC)
*
- * Used only for sha512/*
+ * Used only for sha512
*
* @see self::hash()
* @var string
@@ -159,7 +159,7 @@ class Hash
* umac cipher object
*
* @see self::hash()
- * @var \phpseclib3\Crypt\AES
+ * @var AES
*/
private $c;
@@ -285,12 +285,16 @@ public function getHash()
*/
public function setHash($hash)
{
+ $oldHash = $this->hashParam;
$this->hashParam = $hash = strtolower($hash);
switch ($hash) {
case 'umac-32':
case 'umac-64':
case 'umac-96':
case 'umac-128':
+ if ($oldHash != $this->hashParam) {
+ $this->recomputeAESKey = true;
+ }
$this->blockSize = 128;
$this->length = abs(substr($hash, -3)) >> 3;
$this->algo = 'umac';
@@ -418,13 +422,17 @@ public function setHash($hash)
'0F6D2B697BD44DA8', '77E36F7304C48942', '3F9D85A86A1D36C8', '1112E6AD91D692A1'
];
for ($i = 0; $i < 8; $i++) {
- $initial[$i] = new BigInteger($initial[$i], 16);
- $initial[$i]->setPrecision(64);
+ if (PHP_INT_SIZE == 8) {
+ list(, $initial[$i]) = unpack('J', pack('H*', $initial[$i]));
+ } else {
+ $initial[$i] = new BigInteger($initial[$i], 16);
+ $initial[$i]->setPrecision(64);
+ }
}
$this->parameters = compact('initial');
- $hash = ['phpseclib3\Crypt\Hash', 'sha512'];
+ $hash = ['phpseclib3\Crypt\Hash', PHP_INT_SIZE == 8 ? 'sha512_64' : 'sha512'];
}
}
@@ -564,11 +572,14 @@ private static function L1Hash($k, $m)
// For each chunk, except the last: endian-adjust, NH hash
// and add bit-length. Use results to build Y.
//
- $length = new BigInteger(1024 * 8);
+ $length = 1024 * 8;
$y = '';
+
for ($i = 0; $i < count($m) - 1; $i++) {
$m[$i] = pack('N*', ...unpack('V*', $m[$i])); // ENDIAN-SWAP
- $y .= static::nh($k, $m[$i], $length);
+ $y .= PHP_INT_SIZE == 8 ?
+ static::nh64($k, $m[$i], $length) :
+ static::nh32($k, $m[$i], $length);
}
//
@@ -581,70 +592,256 @@ private static function L1Hash($k, $m)
$m[$i] = str_pad(isset($m[$i]) ? $m[$i] : '', $pad, "\0"); // zeropad
$m[$i] = pack('N*', ...unpack('V*', $m[$i])); // ENDIAN-SWAP
- $y .= static::nh($k, $m[$i], new BigInteger($length * 8));
+ $y .= PHP_INT_SIZE == 8 ?
+ static::nh64($k, $m[$i], $length * 8) :
+ static::nh32($k, $m[$i], $length * 8);
return $y;
}
/**
- * NH Algorithm
+ * 32-bit safe 64-bit Multiply with 2x 32-bit ints
+ *
+ * @param int $x
+ * @param int $y
+ * @return string $x * $y
+ */
+ private static function mul32_64($x, $y)
+ {
+ // see mul64() for a more detailed explanation of how this works
+
+ $x1 = ($x >> 16) & 0xFFFF;
+ $x0 = $x & 0xFFFF;
+
+ $y1 = ($y >> 16) & 0xFFFF;
+ $y0 = $y & 0xFFFF;
+
+ // the following 3x lines will possibly yield floats
+ $z2 = $x1 * $y1;
+ $z0 = $x0 * $y0;
+ $z1 = $x1 * $y0 + $x0 * $y1;
+
+ $a = intval(fmod($z0, 65536));
+ $b = intval($z0 / 65536) + intval(fmod($z1, 65536));
+ $c = intval($z1 / 65536) + intval(fmod($z2, 65536)) + intval($b / 65536);
+ $b = intval(fmod($b, 65536));
+ $d = intval($z2 / 65536) + intval($c / 65536);
+ $c = intval(fmod($c, 65536));
+ $d = intval(fmod($d, 65536));
+
+ return pack('n4', $d, $c, $b, $a);
+ }
+
+ /**
+ * 32-bit safe 64-bit Addition with 2x 64-bit strings
+ *
+ * @param int $x
+ * @param int $y
+ * @return int $x * $y
+ */
+ private static function add32_64($x, $y)
+ {
+ list(, $x1, $x2, $x3, $x4) = unpack('n4', $x);
+ list(, $y1, $y2, $y3, $y4) = unpack('n4', $y);
+ $a = $x4 + $y4;
+ $b = $x3 + $y3 + ($a >> 16);
+ $c = $x2 + $y2 + ($b >> 16);
+ $d = $x1 + $y1 + ($c >> 16);
+ return pack('n4', $d, $c, $b, $a);
+ }
+
+ /**
+ * 32-bit safe 32-bit Addition with 2x 32-bit strings
+ *
+ * @param int $x
+ * @param int $y
+ * @return int $x * $y
+ */
+ private static function add32($x, $y)
+ {
+ // see add64() for a more detailed explanation of how this works
+
+ $x1 = $x & 0xFFFF;
+ $x2 = ($x >> 16) & 0xFFFF;
+ $y1 = $y & 0xFFFF;
+ $y2 = ($y >> 16) & 0xFFFF;
+
+ $a = $x1 + $y1;
+ $b = ($x2 + $y2 + ($a >> 16)) << 16;
+ $a &= 0xFFFF;
+
+ return $a | $b;
+ }
+
+ /**
+ * NH Algorithm / 32-bit safe
*
* @param string $k string of length 1024 bytes.
* @param string $m string with length divisible by 32 bytes.
* @return string string of length 8 bytes.
*/
- private static function nh($k, $m, $length)
+ private static function nh32($k, $m, $length)
{
- $toUInt32 = function ($x) {
- $x = new BigInteger($x, 256);
- $x->setPrecision(32);
- return $x;
- };
-
//
// Break M and K into 4-byte chunks
//
- //$t = strlen($m) >> 2;
- $m = str_split($m, 4);
+ $k = unpack('N*', $k);
+ $m = unpack('N*', $m);
$t = count($m);
- $k = str_split($k, 4);
- $k = array_pad(array_slice($k, 0, $t), $t, 0);
- $m = array_map($toUInt32, $m);
- $k = array_map($toUInt32, $k);
+ //
+ // Perform NH hash on the chunks, pairing words for multiplication
+ // which are 4 apart to accommodate vector-parallelism.
+ //
+ $i = 1;
+ $y = "\0\0\0\0\0\0\0\0";
+ while ($i <= $t) {
+ $temp = self::add32($m[$i], $k[$i]);
+ $temp2 = self::add32($m[$i + 4], $k[$i + 4]);
+ $y = self::add32_64($y, self::mul32_64($temp, $temp2));
+
+ $temp = self::add32($m[$i + 1], $k[$i + 1]);
+ $temp2 = self::add32($m[$i + 5], $k[$i + 5]);
+ $y = self::add32_64($y, self::mul32_64($temp, $temp2));
+
+ $temp = self::add32($m[$i + 2], $k[$i + 2]);
+ $temp2 = self::add32($m[$i + 6], $k[$i + 6]);
+ $y = self::add32_64($y, self::mul32_64($temp, $temp2));
+
+ $temp = self::add32($m[$i + 3], $k[$i + 3]);
+ $temp2 = self::add32($m[$i + 7], $k[$i + 7]);
+ $y = self::add32_64($y, self::mul32_64($temp, $temp2));
+
+ $i += 8;
+ }
+
+ return self::add32_64($y, pack('N2', 0, $length));
+ }
+
+ /**
+ * 64-bit Multiply with 2x 32-bit ints
+ *
+ * @param int $x
+ * @param int $y
+ * @return int $x * $y
+ */
+ private static function mul64($x, $y)
+ {
+ // since PHP doesn't implement unsigned integers we'll implement them with signed integers
+ // to do this we'll use karatsuba multiplication
+
+ $x1 = $x >> 16;
+ $x0 = $x & 0xFFFF;
+
+ $y1 = $y >> 16;
+ $y0 = $y & 0xFFFF;
+
+ $z2 = $x1 * $y1; // up to 32 bits long
+ $z0 = $x0 * $y0; // up to 32 bits long
+ $z1 = $x1 * $y0 + $x0 * $y1; // up to 33 bit long
+ // normally karatsuba multiplication calculates $z1 thusly:
+ //$z1 = ($x1 + $x0) * ($y0 + $y1) - $z2 - $z0;
+ // the idea being to eliminate one extra multiplication. for arbitrary precision math that makes sense
+ // but not for this purpose
+
+ // at this point karatsuba would normally return this:
+ //return ($z2 << 64) + ($z1 << 32) + $z0;
+ // the problem is that the output could be out of range for signed 64-bit ints,
+ // which would cause PHP to switch to floats, which would risk losing the lower few bits
+ // as such we'll OR 4x 16-bit blocks together like so:
+ /*
+ ........ | ........ | ........ | ........
+ upper $z2 | lower $z2 | lower $z1 | lower $z0
+ | +upper $z1 | +upper $z0 |
+ + $carry | + $carry | |
+ */
+ // technically upper $z1 is 17 bit - not 16 - but the most significant digit of that will
+ // just get added to $carry
+
+ $a = $z0 & 0xFFFF;
+ $b = ($z0 >> 16) + ($z1 & 0xFFFF);
+ $c = ($z1 >> 16) + ($z2 & 0xFFFF) + ($b >> 16);
+ $b = ($b & 0xFFFF) << 16;
+ $d = ($z2 >> 16) + ($c >> 16);
+ $c = ($c & 0xFFFF) << 32;
+ $d = ($d & 0xFFFF) << 48;
+
+ return $a | $b | $c | $d;
+ }
+
+ /**
+ * 64-bit Addition with 2x 64-bit ints
+ *
+ * @param int $x
+ * @param int $y
+ * @return int $x + $y
+ */
+ private static function add64($x, $y)
+ {
+ // doing $x + $y risks returning a result that's out of range for signed 64-bit ints
+ // in that event PHP would convert the result to a float and precision would be lost
+ // so we'll just add 2x 32-bit ints together like so:
+ /*
+ ........ | ........
+ upper $x | lower $x
+ +upper $y |+lower $y
+ + $carry |
+ */
+ $x1 = $x & 0xFFFFFFFF;
+ $x2 = ($x >> 32) & 0xFFFFFFFF;
+ $y1 = $y & 0xFFFFFFFF;
+ $y2 = ($y >> 32) & 0xFFFFFFFF;
+
+ $a = $x1 + $y1;
+ $b = ($x2 + $y2 + ($a >> 32)) << 32;
+ $a &= 0xFFFFFFFF;
+
+ return $a | $b;
+ }
+
+ /**
+ * NH Algorithm / 64-bit safe
+ *
+ * @param string $k string of length 1024 bytes.
+ * @param string $m string with length divisible by 32 bytes.
+ * @return string string of length 8 bytes.
+ */
+ private static function nh64($k, $m, $length)
+ {
+ //
+ // Break M and K into 4-byte chunks
+ //
+ $k = unpack('N*', $k);
+ $m = unpack('N*', $m);
+ $t = count($m);
//
// Perform NH hash on the chunks, pairing words for multiplication
// which are 4 apart to accommodate vector-parallelism.
//
- $y = new BigInteger();
- $y->setPrecision(64);
- $i = 0;
- while ($i < $t) {
- $temp = $m[$i]->add($k[$i]);
- $temp->setPrecision(64);
- $temp = $temp->multiply($m[$i + 4]->add($k[$i + 4]));
- $y = $y->add($temp);
-
- $temp = $m[$i + 1]->add($k[$i + 1]);
- $temp->setPrecision(64);
- $temp = $temp->multiply($m[$i + 5]->add($k[$i + 5]));
- $y = $y->add($temp);
-
- $temp = $m[$i + 2]->add($k[$i + 2]);
- $temp->setPrecision(64);
- $temp = $temp->multiply($m[$i + 6]->add($k[$i + 6]));
- $y = $y->add($temp);
-
- $temp = $m[$i + 3]->add($k[$i + 3]);
- $temp->setPrecision(64);
- $temp = $temp->multiply($m[$i + 7]->add($k[$i + 7]));
- $y = $y->add($temp);
+ $i = 1;
+ $y = 0;
+ while ($i <= $t) {
+ $temp = ($m[$i] + $k[$i]) & 0xFFFFFFFF;
+ $temp2 = ($m[$i + 4] + $k[$i + 4]) & 0xFFFFFFFF;
+ $y = self::add64($y, self::mul64($temp, $temp2));
+
+ $temp = ($m[$i + 1] + $k[$i + 1]) & 0xFFFFFFFF;
+ $temp2 = ($m[$i + 5] + $k[$i + 5]) & 0xFFFFFFFF;
+ $y = self::add64($y, self::mul64($temp, $temp2));
+
+ $temp = ($m[$i + 2] + $k[$i + 2]) & 0xFFFFFFFF;
+ $temp2 = ($m[$i + 6] + $k[$i + 6]) & 0xFFFFFFFF;
+ $y = self::add64($y, self::mul64($temp, $temp2));
+
+ $temp = ($m[$i + 3] + $k[$i + 3]) & 0xFFFFFFFF;
+ $temp2 = ($m[$i + 7] + $k[$i + 7]) & 0xFFFFFFFF;
+ $y = self::add64($y, self::mul64($temp, $temp2));
$i += 8;
}
- return $y->add($length)->toBytes();
+ return pack('J', self::add64($y, $length));
}
/**
@@ -1125,9 +1322,10 @@ private static function rotateLeft32($x, $shift)
list($lo, $hi) = $x;
}
+ $mask = -1 ^ (-1 << $shift);
return [
- ($hi << $shift) | (($lo >> (32 - $shift)) & (1 << $shift) - 1),
- ($lo << $shift) | (($hi >> (32 - $shift)) & (1 << $shift) - 1)
+ ($hi << $shift) | (($lo >> (32 - $shift)) & $mask),
+ ($lo << $shift) | (($hi >> (32 - $shift)) & $mask)
];
}
@@ -1277,14 +1475,27 @@ private static function processSHA3Block64(&$s)
}
/**
- * Rotate 64-bit int
+ * Left rotate 64-bit int
*
* @param int $x
* @param int $shift
*/
private static function rotateLeft64($x, $shift)
{
- return ($x << $shift) | (($x >> (64 - $shift)) & ((1 << $shift) - 1));
+ $mask = -1 ^ (-1 << $shift);
+ return ($x << $shift) | (($x >> (64 - $shift)) & $mask);
+ }
+
+ /**
+ * Right rotate 64-bit int
+ *
+ * @param int $x
+ * @param int $shift
+ */
+ private static function rotateRight64($x, $shift)
+ {
+ $mask = -1 ^ (-1 << (64 - $shift));
+ return (($x >> $shift) & $mask) | ($x << (64 - $shift));
}
/**
@@ -1445,6 +1656,140 @@ private static function sha512($m, $hash)
return $temp;
}
+ /**
+ * Pure-PHP implementation of SHA512
+ *
+ * @param string $m
+ * @param array $hash
+ * @return string
+ */
+ private static function sha512_64($m, $hash)
+ {
+ static $k;
+
+ if (!isset($k)) {
+ // Initialize table of round constants
+ // (first 64 bits of the fractional parts of the cube roots of the first 80 primes 2..409)
+ $k = [
+ '428a2f98d728ae22', '7137449123ef65cd', 'b5c0fbcfec4d3b2f', 'e9b5dba58189dbbc',
+ '3956c25bf348b538', '59f111f1b605d019', '923f82a4af194f9b', 'ab1c5ed5da6d8118',
+ 'd807aa98a3030242', '12835b0145706fbe', '243185be4ee4b28c', '550c7dc3d5ffb4e2',
+ '72be5d74f27b896f', '80deb1fe3b1696b1', '9bdc06a725c71235', 'c19bf174cf692694',
+ 'e49b69c19ef14ad2', 'efbe4786384f25e3', '0fc19dc68b8cd5b5', '240ca1cc77ac9c65',
+ '2de92c6f592b0275', '4a7484aa6ea6e483', '5cb0a9dcbd41fbd4', '76f988da831153b5',
+ '983e5152ee66dfab', 'a831c66d2db43210', 'b00327c898fb213f', 'bf597fc7beef0ee4',
+ 'c6e00bf33da88fc2', 'd5a79147930aa725', '06ca6351e003826f', '142929670a0e6e70',
+ '27b70a8546d22ffc', '2e1b21385c26c926', '4d2c6dfc5ac42aed', '53380d139d95b3df',
+ '650a73548baf63de', '766a0abb3c77b2a8', '81c2c92e47edaee6', '92722c851482353b',
+ 'a2bfe8a14cf10364', 'a81a664bbc423001', 'c24b8b70d0f89791', 'c76c51a30654be30',
+ 'd192e819d6ef5218', 'd69906245565a910', 'f40e35855771202a', '106aa07032bbd1b8',
+ '19a4c116b8d2d0c8', '1e376c085141ab53', '2748774cdf8eeb99', '34b0bcb5e19b48a8',
+ '391c0cb3c5c95a63', '4ed8aa4ae3418acb', '5b9cca4f7763e373', '682e6ff3d6b2b8a3',
+ '748f82ee5defb2fc', '78a5636f43172f60', '84c87814a1f0ab72', '8cc702081a6439ec',
+ '90befffa23631e28', 'a4506cebde82bde9', 'bef9a3f7b2c67915', 'c67178f2e372532b',
+ 'ca273eceea26619c', 'd186b8c721c0c207', 'eada7dd6cde0eb1e', 'f57d4f7fee6ed178',
+ '06f067aa72176fba', '0a637dc5a2c898a6', '113f9804bef90dae', '1b710b35131c471b',
+ '28db77f523047d84', '32caab7b40c72493', '3c9ebe0a15c9bebc', '431d67c49c100d4c',
+ '4cc5d4becb3e42b6', '597f299cfc657e2a', '5fcb6fab3ad6faec', '6c44198c4a475817'
+ ];
+
+ for ($i = 0; $i < 80; $i++) {
+ list(, $k[$i]) = unpack('J', pack('H*', $k[$i]));
+ }
+ }
+
+ // Pre-processing
+ $length = strlen($m);
+ // to round to nearest 112 mod 128, we'll add 128 - (length + (128 - 112)) % 128
+ $m .= str_repeat(chr(0), 128 - (($length + 16) & 0x7F));
+ $m[$length] = chr(0x80);
+ // we don't support hashing strings 512MB long
+ $m .= pack('N4', 0, 0, 0, $length << 3);
+
+ // Process the message in successive 1024-bit chunks
+ $chunks = str_split($m, 128);
+ foreach ($chunks as $chunk) {
+ $w = [];
+ for ($i = 0; $i < 16; $i++) {
+ list(, $w[]) = unpack('J', Strings::shift($chunk, 8));
+ }
+
+ // Extend the sixteen 32-bit words into eighty 32-bit words
+ for ($i = 16; $i < 80; $i++) {
+ $temp = [
+ self::rotateRight64($w[$i - 15], 1),
+ self::rotateRight64($w[$i - 15], 8),
+ ($w[$i - 15] >> 7) & 0x01FFFFFFFFFFFFFF,
+ ];
+ $s0 = $temp[0] ^ $temp[1] ^ $temp[2];
+ $temp = [
+ self::rotateRight64($w[$i - 2], 19),
+ self::rotateRight64($w[$i - 2], 61),
+ ($w[$i - 2] >> 6) & 0x03FFFFFFFFFFFFFF,
+ ];
+ $s1 = $temp[0] ^ $temp[1] ^ $temp[2];
+
+ $w[$i] = $w[$i - 16];
+ $w[$i] = self::add64($w[$i], $s0);
+ $w[$i] = self::add64($w[$i], $w[$i - 7]);
+ $w[$i] = self::add64($w[$i], $s1);
+ }
+
+ // Initialize hash value for this chunk
+ list($a, $b, $c, $d, $e, $f, $g, $h) = $hash;
+
+ // Main loop
+ for ($i = 0; $i < 80; $i++) {
+ $temp = [
+ self::rotateRight64($a, 28),
+ self::rotateRight64($a, 34),
+ self::rotateRight64($a, 39),
+ ];
+ $s0 = $temp[0] ^ $temp[1] ^ $temp[2];
+ $temp = [$a & $b, $a & $c, $b & $c];
+ $maj = $temp[0] ^ $temp[1] ^ $temp[2];
+ $t2 = self::add64($s0, $maj);
+
+ $temp = [
+ self::rotateRight64($e, 14),
+ self::rotateRight64($e, 18),
+ self::rotateRight64($e, 41),
+ ];
+ $s1 = $temp[0] ^ $temp[1] ^ $temp[2];
+ $ch = ($e & $f) ^ ($g & ~$e);
+ $t1 = self::add64($h, $s1);
+ $t1 = self::add64($t1, $ch);
+ $t1 = self::add64($t1, $k[$i]);
+ $t1 = self::add64($t1, $w[$i]);
+
+ $h = $g;
+ $g = $f;
+ $f = $e;
+ $e = self::add64($d, $t1);
+ $d = $c;
+ $c = $b;
+ $b = $a;
+ $a = self::add64($t1, $t2);
+ }
+
+ // Add this chunk's hash to result so far
+ $hash = [
+ self::add64($hash[0], $a),
+ self::add64($hash[1], $b),
+ self::add64($hash[2], $c),
+ self::add64($hash[3], $d),
+ self::add64($hash[4], $e),
+ self::add64($hash[5], $f),
+ self::add64($hash[6], $g),
+ self::add64($hash[7], $h),
+ ];
+ }
+
+ // Produce the final hash value (big-endian)
+ // (\phpseclib3\Crypt\Hash::hash() trims the output for hashes but not for HMACs. as such, we trim the output here)
+ return pack('J*', ...$hash);
+ }
+
/**
* __toString() magic method
*/
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php
index 19dcfea3f..9cbe6bfc7 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php
@@ -10,7 +10,7 @@
* getPublicKey();
*
* $plaintext = 'terrafrost';
@@ -26,7 +26,7 @@
* getPublicKey();
*
* $plaintext = 'terrafrost';
@@ -180,7 +180,7 @@ abstract class RSA extends AsymmetricKey
/**
* Hash function for the Mask Generation Function
*
- * @var \phpseclib3\Crypt\Hash
+ * @var Hash
*/
protected $mgfHash;
@@ -194,21 +194,21 @@ abstract class RSA extends AsymmetricKey
/**
* Modulus (ie. n)
*
- * @var \phpseclib3\Math\BigInteger
+ * @var Math\BigInteger
*/
protected $modulus;
/**
* Modulus length
*
- * @var \phpseclib3\Math\BigInteger
+ * @var Math\BigInteger
*/
protected $k;
/**
* Exponent (ie. e or d)
*
- * @var \phpseclib3\Math\BigInteger
+ * @var Math\BigInteger
*/
protected $exponent;
@@ -252,7 +252,7 @@ abstract class RSA extends AsymmetricKey
/**
* Public Exponent
*
- * @var \phpseclib3\Math\BigInteger
+ * @var Math\BigInteger
*/
protected $publicExponent;
@@ -297,7 +297,7 @@ public static function setOpenSSLConfigPath($val)
*
* The public key can be extracted from the private key
*
- * @return RSA\PrivateKey
+ * @return PrivateKey
* @param int $bits
*/
public static function createKey($bits = 2048)
@@ -510,7 +510,7 @@ protected function __construct()
*
* See {@link http://tools.ietf.org/html/rfc3447#section-4.1 RFC3447#section-4.1}.
*
- * @param bool|\phpseclib3\Math\BigInteger $x
+ * @param bool|Math\BigInteger $x
* @param int $xLen
* @return bool|string
*/
@@ -532,7 +532,7 @@ protected function i2osp($x, $xLen)
* See {@link http://tools.ietf.org/html/rfc3447#section-4.2 RFC3447#section-4.2}.
*
* @param string $x
- * @return \phpseclib3\Math\BigInteger
+ * @return Math\BigInteger
*/
protected function os2ip($x)
{
@@ -703,7 +703,7 @@ public function withHash($hash)
{
$new = clone $this;
- // \phpseclib3\Crypt\Hash supports algorithms that PKCS#1 doesn't support. md5-96 and sha1-96, for example.
+ // Crypt\Hash supports algorithms that PKCS#1 doesn't support. md5-96 and sha1-96, for example.
switch (strtolower($hash)) {
case 'md2':
case 'md5':
@@ -738,7 +738,7 @@ public function withMGFHash($hash)
{
$new = clone $this;
- // \phpseclib3\Crypt\Hash supports algorithms that PKCS#1 doesn't support. md5-96 and sha1-96, for example.
+ // Crypt\Hash supports algorithms that PKCS#1 doesn't support. md5-96 and sha1-96, for example.
switch (strtolower($hash)) {
case 'md2':
case 'md5':
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/JWK.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/JWK.php
index 87f543de9..6dcf1cb03 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/JWK.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/JWK.php
@@ -90,9 +90,9 @@ public static function load($key, $password = '')
/**
* Convert a private key to the appropriate format.
*
- * @param \phpseclib3\Math\BigInteger $n
- * @param \phpseclib3\Math\BigInteger $e
- * @param \phpseclib3\Math\BigInteger $d
+ * @param BigInteger $n
+ * @param BigInteger $e
+ * @param BigInteger $d
* @param array $primes
* @param array $exponents
* @param array $coefficients
@@ -124,8 +124,8 @@ public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $
/**
* Convert a public key to the appropriate format
*
- * @param \phpseclib3\Math\BigInteger $n
- * @param \phpseclib3\Math\BigInteger $e
+ * @param BigInteger $n
+ * @param BigInteger $e
* @param array $options optional
* @return string
*/
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/MSBLOB.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/MSBLOB.php
index e9a0c4f3c..b60e48ea5 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/MSBLOB.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/MSBLOB.php
@@ -174,9 +174,9 @@ public static function load($key, $password = '')
/**
* Convert a private key to the appropriate format.
*
- * @param \phpseclib3\Math\BigInteger $n
- * @param \phpseclib3\Math\BigInteger $e
- * @param \phpseclib3\Math\BigInteger $d
+ * @param BigInteger $n
+ * @param BigInteger $e
+ * @param BigInteger $d
* @param array $primes
* @param array $exponents
* @param array $coefficients
@@ -211,8 +211,8 @@ public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $
/**
* Convert a public key to the appropriate format
*
- * @param \phpseclib3\Math\BigInteger $n
- * @param \phpseclib3\Math\BigInteger $e
+ * @param BigInteger $n
+ * @param BigInteger $e
* @return string
*/
public static function savePublicKey(BigInteger $n, BigInteger $e)
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/OpenSSH.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/OpenSSH.php
index 2367810a7..ca74ea481 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/OpenSSH.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/OpenSSH.php
@@ -90,8 +90,8 @@ public static function load($key, $password = '')
/**
* Convert a public key to the appropriate format
*
- * @param \phpseclib3\Math\BigInteger $n
- * @param \phpseclib3\Math\BigInteger $e
+ * @param BigInteger $n
+ * @param BigInteger $e
* @param array $options optional
* @return string
*/
@@ -112,9 +112,9 @@ public static function savePublicKey(BigInteger $n, BigInteger $e, array $option
/**
* Convert a private key to the appropriate format.
*
- * @param \phpseclib3\Math\BigInteger $n
- * @param \phpseclib3\Math\BigInteger $e
- * @param \phpseclib3\Math\BigInteger $d
+ * @param BigInteger $n
+ * @param BigInteger $e
+ * @param BigInteger $d
* @param array $primes
* @param array $exponents
* @param array $coefficients
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PKCS1.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PKCS1.php
index 276c6024f..76335567f 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PKCS1.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PKCS1.php
@@ -102,9 +102,9 @@ public static function load($key, $password = '')
/**
* Convert a private key to the appropriate format.
*
- * @param \phpseclib3\Math\BigInteger $n
- * @param \phpseclib3\Math\BigInteger $e
- * @param \phpseclib3\Math\BigInteger $d
+ * @param BigInteger $n
+ * @param BigInteger $e
+ * @param BigInteger $d
* @param array $primes
* @param array $exponents
* @param array $coefficients
@@ -142,8 +142,8 @@ public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $
/**
* Convert a public key to the appropriate format
*
- * @param \phpseclib3\Math\BigInteger $n
- * @param \phpseclib3\Math\BigInteger $e
+ * @param BigInteger $n
+ * @param BigInteger $e
* @return string
*/
public static function savePublicKey(BigInteger $n, BigInteger $e)
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PKCS8.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PKCS8.php
index 1eaac6ef8..30f63ff97 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PKCS8.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PKCS8.php
@@ -88,9 +88,9 @@ public static function load($key, $password = '')
/**
* Convert a private key to the appropriate format.
*
- * @param \phpseclib3\Math\BigInteger $n
- * @param \phpseclib3\Math\BigInteger $e
- * @param \phpseclib3\Math\BigInteger $d
+ * @param BigInteger $n
+ * @param BigInteger $e
+ * @param BigInteger $d
* @param array $primes
* @param array $exponents
* @param array $coefficients
@@ -108,8 +108,8 @@ public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $
/**
* Convert a public key to the appropriate format
*
- * @param \phpseclib3\Math\BigInteger $n
- * @param \phpseclib3\Math\BigInteger $e
+ * @param BigInteger $n
+ * @param BigInteger $e
* @param array $options optional
* @return string
*/
@@ -117,6 +117,6 @@ public static function savePublicKey(BigInteger $n, BigInteger $e, array $option
{
$key = PKCS1::savePublicKey($n, $e);
$key = ASN1::extractBER($key);
- return self::wrapPublicKey($key, null);
+ return self::wrapPublicKey($key, null, null, $options);
}
}
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PSS.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PSS.php
index ed75b9b7a..bf51bcf76 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PSS.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PSS.php
@@ -154,9 +154,9 @@ public static function load($key, $password = '')
/**
* Convert a private key to the appropriate format.
*
- * @param \phpseclib3\Math\BigInteger $n
- * @param \phpseclib3\Math\BigInteger $e
- * @param \phpseclib3\Math\BigInteger $d
+ * @param BigInteger $n
+ * @param BigInteger $e
+ * @param BigInteger $d
* @param array $primes
* @param array $exponents
* @param array $coefficients
@@ -177,8 +177,8 @@ public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $
/**
* Convert a public key to the appropriate format
*
- * @param \phpseclib3\Math\BigInteger $n
- * @param \phpseclib3\Math\BigInteger $e
+ * @param BigInteger $n
+ * @param BigInteger $e
* @param array $options optional
* @return string
*/
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PuTTY.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PuTTY.php
index fe35717bb..293903cef 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PuTTY.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PuTTY.php
@@ -85,9 +85,9 @@ public static function load($key, $password = '')
/**
* Convert a private key to the appropriate format.
*
- * @param \phpseclib3\Math\BigInteger $n
- * @param \phpseclib3\Math\BigInteger $e
- * @param \phpseclib3\Math\BigInteger $d
+ * @param BigInteger $n
+ * @param BigInteger $e
+ * @param BigInteger $d
* @param array $primes
* @param array $exponents
* @param array $coefficients
@@ -110,8 +110,8 @@ public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $
/**
* Convert a public key to the appropriate format
*
- * @param \phpseclib3\Math\BigInteger $n
- * @param \phpseclib3\Math\BigInteger $e
+ * @param BigInteger $n
+ * @param BigInteger $e
* @return string
*/
public static function savePublicKey(BigInteger $n, BigInteger $e)
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/Raw.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/Raw.php
index db7287840..55c7ccd7a 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/Raw.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/Raw.php
@@ -138,9 +138,9 @@ public static function load($key, $password = '')
/**
* Convert a private key to the appropriate format.
*
- * @param \phpseclib3\Math\BigInteger $n
- * @param \phpseclib3\Math\BigInteger $e
- * @param \phpseclib3\Math\BigInteger $d
+ * @param BigInteger $n
+ * @param BigInteger $e
+ * @param BigInteger $d
* @param array $primes
* @param array $exponents
* @param array $coefficients
@@ -173,8 +173,8 @@ public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $
/**
* Convert a public key to the appropriate format
*
- * @param \phpseclib3\Math\BigInteger $n
- * @param \phpseclib3\Math\BigInteger $e
+ * @param BigInteger $n
+ * @param BigInteger $e
* @return array
*/
public static function savePublicKey(BigInteger $n, BigInteger $e)
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/XML.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/XML.php
index 280048cc0..d569dea6d 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/XML.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/XML.php
@@ -123,9 +123,9 @@ public static function load($key, $password = '')
/**
* Convert a private key to the appropriate format.
*
- * @param \phpseclib3\Math\BigInteger $n
- * @param \phpseclib3\Math\BigInteger $e
- * @param \phpseclib3\Math\BigInteger $d
+ * @param BigInteger $n
+ * @param BigInteger $e
+ * @param BigInteger $d
* @param array $primes
* @param array $exponents
* @param array $coefficients
@@ -157,8 +157,8 @@ public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $
/**
* Convert a public key to the appropriate format
*
- * @param \phpseclib3\Math\BigInteger $n
- * @param \phpseclib3\Math\BigInteger $e
+ * @param BigInteger $n
+ * @param BigInteger $e
* @return string
*/
public static function savePublicKey(BigInteger $n, BigInteger $e)
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/PrivateKey.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/PrivateKey.php
index 37dd09a45..8c828b316 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/PrivateKey.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/PrivateKey.php
@@ -51,7 +51,7 @@ final class PrivateKey extends RSA implements Common\PrivateKey
/**
* Private Exponent
*
- * @var \phpseclib3\Math\BigInteger
+ * @var BigInteger
*/
protected $privateExponent;
@@ -60,7 +60,7 @@ final class PrivateKey extends RSA implements Common\PrivateKey
*
* See {@link http://tools.ietf.org/html/rfc3447#section-5.1.2 RFC3447#section-5.1.2}.
*
- * @return bool|\phpseclib3\Math\BigInteger
+ * @return bool|BigInteger
*/
private function rsadp(BigInteger $c)
{
@@ -75,7 +75,7 @@ private function rsadp(BigInteger $c)
*
* See {@link http://tools.ietf.org/html/rfc3447#section-5.2.1 RFC3447#section-5.2.1}.
*
- * @return bool|\phpseclib3\Math\BigInteger
+ * @return bool|BigInteger
*/
private function rsasp1(BigInteger $m)
{
@@ -88,8 +88,8 @@ private function rsasp1(BigInteger $m)
/**
* Exponentiate
*
- * @param \phpseclib3\Math\BigInteger $x
- * @return \phpseclib3\Math\BigInteger
+ * @param BigInteger $x
+ * @return BigInteger
*/
protected function exponentiate(BigInteger $x)
{
@@ -169,10 +169,10 @@ protected function exponentiate(BigInteger $x)
* Protects against timing attacks by employing RSA Blinding.
* Returns $x->modPow($this->exponents[$i], $this->primes[$i])
*
- * @param \phpseclib3\Math\BigInteger $x
- * @param \phpseclib3\Math\BigInteger $r
+ * @param BigInteger $x
+ * @param BigInteger $r
* @param int $i
- * @return \phpseclib3\Math\BigInteger
+ * @return BigInteger
*/
private function blind(BigInteger $x, BigInteger $r, $i)
{
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/PublicKey.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/PublicKey.php
index 58939a9f6..ff80ae79c 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/PublicKey.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/PublicKey.php
@@ -35,8 +35,8 @@ final class PublicKey extends RSA implements Common\PublicKey
/**
* Exponentiate
*
- * @param \phpseclib3\Math\BigInteger $x
- * @return \phpseclib3\Math\BigInteger
+ * @param BigInteger $x
+ * @return BigInteger
*/
private function exponentiate(BigInteger $x)
{
@@ -48,8 +48,8 @@ private function exponentiate(BigInteger $x)
*
* See {@link http://tools.ietf.org/html/rfc3447#section-5.2.2 RFC3447#section-5.2.2}.
*
- * @param \phpseclib3\Math\BigInteger $s
- * @return bool|\phpseclib3\Math\BigInteger
+ * @param BigInteger $s
+ * @return bool|BigInteger
*/
private function rsavp1($s)
{
@@ -405,8 +405,8 @@ private function rsaes_oaep_encrypt($m)
*
* See {@link http://tools.ietf.org/html/rfc3447#section-5.1.1 RFC3447#section-5.1.1}.
*
- * @param \phpseclib3\Math\BigInteger $m
- * @return bool|\phpseclib3\Math\BigInteger
+ * @param BigInteger $m
+ * @return bool|BigInteger
*/
private function rsaep($m)
{
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Salsa20.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Salsa20.php
index 0a35f478d..785e7aa2d 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Salsa20.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Salsa20.php
@@ -326,7 +326,7 @@ private function crypt($text, $mode)
foreach ($blocks as &$block) {
$block ^= static::salsa20($this->p1 . pack('V', $i++) . $this->p2);
}
-
+ unset($block);
return implode('', $blocks);
}
@@ -366,6 +366,7 @@ private function crypt($text, $mode)
foreach ($blocks as &$block) {
$block ^= static::salsa20($this->p1 . pack('V', $buffer['counter']++) . $this->p2);
}
+ unset($block);
}
$encrypted = implode('', $blocks);
$temp = static::salsa20($this->p1 . pack('V', $buffer['counter']++) . $this->p2);
@@ -388,6 +389,7 @@ private function crypt($text, $mode)
foreach ($blocks as &$block) {
$block ^= static::salsa20($this->p1 . pack('V', $buffer['counter']++) . $this->p2);
}
+ unset($block);
$ciphertext .= implode('', $blocks);
}
}
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Exception/TimeoutException.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Exception/TimeoutException.php
new file mode 100644
index 000000000..8701f8d76
--- /dev/null
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Exception/TimeoutException.php
@@ -0,0 +1,10 @@
+ [
'version' => [
'type' => ASN1::TYPE_INTEGER,
- 'mapping' => ['v1', 'v2', 'v3'],
+ 'mapping' => ['v1', 'v2'],
'optional' => true,
- 'default' => 'v2'
+ 'default' => 'v1'
],
'signature' => AlgorithmIdentifier::MAP,
'issuer' => Name::MAP,
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/File/X509.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/File/X509.php
index 5e2f073f4..00504f15d 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/File/X509.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/File/X509.php
@@ -272,7 +272,7 @@ class X509
/**
* Default Constructor.
*
- * @return \phpseclib3\File\X509
+ * @return X509
*/
public function __construct()
{
@@ -519,11 +519,6 @@ public function saveX509(array $cert, $format = self::FORMAT_PEM)
);
}
- if ($algorithm == 'rsaEncryption') {
- $cert['signatureAlgorithm']['parameters'] = null;
- $cert['tbsCertificate']['signature']['parameters'] = null;
- }
-
$filters = [];
$type_utf8_string = ['type' => ASN1::TYPE_UTF8_STRING];
$filters['tbsCertificate']['signature']['parameters'] = $type_utf8_string;
@@ -1390,7 +1385,7 @@ private function validateSignatureCountable($caonly, $count)
* @param string $signatureAlgorithm
* @param string $signature
* @param string $signatureSubject
- * @throws \phpseclib3\Exception\UnsupportedAlgorithmException if the algorithm is unsupported
+ * @throws UnsupportedAlgorithmException if the algorithm is unsupported
* @return bool
*/
private function validateSignatureHelper($publicKeyAlgorithm, $publicKey, $signatureAlgorithm, $signature, $signatureSubject)
@@ -1710,7 +1705,7 @@ public function removeDNProp($propName)
* @param bool $withType optional
* @return mixed
*/
- public function getDNProp($propName, array $dn = null, $withType = false)
+ public function getDNProp($propName, $dn = null, $withType = false)
{
if (!isset($dn)) {
$dn = $this->dn;
@@ -1815,7 +1810,7 @@ public function setDN($dn, $merge = false, $type = 'utf8String')
* @param array $dn optional
* @return array|bool|string
*/
- public function getDN($format = self::DN_ARRAY, array $dn = null)
+ public function getDN($format = self::DN_ARRAY, $dn = null)
{
if (!isset($dn)) {
$dn = isset($this->currentCert['tbsCertList']) ? $this->currentCert['tbsCertList']['issuer'] : $this->dn;
@@ -2755,7 +2750,8 @@ public function signCSR()
[
'version' => 'v1',
'subject' => $this->dn,
- 'subjectPKInfo' => $publicKey
+ 'subjectPKInfo' => $publicKey,
+ 'attributes' => []
],
'signatureAlgorithm' => $signatureAlgorithm,
'signature' => false // this is going to be overwritten later
@@ -2904,11 +2900,11 @@ public function signCRL(X509 $issuer, X509 $crl)
$version = isset($tbsCertList['version']) ? $tbsCertList['version'] : 0;
if (!$version) {
if (!empty($tbsCertList['crlExtensions'])) {
- $version = 1; // v2.
+ $version = 'v2'; // v2.
} elseif (!empty($tbsCertList['revokedCertificates'])) {
foreach ($tbsCertList['revokedCertificates'] as $cert) {
if (!empty($cert['crlEntryExtensions'])) {
- $version = 1; // v2.
+ $version = 'v2'; // v2.
}
}
}
@@ -2972,7 +2968,7 @@ public function signCRL(X509 $issuer, X509 $crl)
* Identify signature algorithm from key settings
*
* @param PrivateKey $key
- * @throws \phpseclib3\Exception\UnsupportedAlgorithmException if the algorithm is unsupported
+ * @throws UnsupportedAlgorithmException if the algorithm is unsupported
* @return array
*/
private static function identifySignatureAlgorithm(PrivateKey $key)
@@ -2993,7 +2989,10 @@ private static function identifySignatureAlgorithm(PrivateKey $key)
case 'sha256':
case 'sha384':
case 'sha512':
- return ['algorithm' => $key->getHash() . 'WithRSAEncryption'];
+ return [
+ 'algorithm' => $key->getHash() . 'WithRSAEncryption',
+ 'parameters' => null
+ ];
}
throw new UnsupportedAlgorithmException('The only supported hash algorithms for RSA are: md2, md5, sha1, sha224, sha256, sha384, sha512');
}
@@ -3163,7 +3162,7 @@ private function &subArrayUnchecked(array &$root, $path, $create = false)
* @param bool $create optional
* @return array|false
*/
- private function &subArray(array &$root = null, $path, $create = false)
+ private function &subArray(&$root, $path, $create = false)
{
$false = false;
@@ -3198,7 +3197,7 @@ private function &subArray(array &$root = null, $path, $create = false)
* @param bool $create optional
* @return array|false
*/
- private function &extensions(array &$root = null, $path = null, $create = false)
+ private function &extensions(&$root, $path = null, $create = false)
{
if (!isset($root)) {
$root = $this->currentCert;
@@ -3285,7 +3284,7 @@ private function removeExtensionHelper($id, $path = null)
* @param string $path optional
* @return mixed
*/
- private function getExtensionHelper($id, array $cert = null, $path = null)
+ private function getExtensionHelper($id, $cert = null, $path = null)
{
$extensions = $this->extensions($cert, $path);
@@ -3309,7 +3308,7 @@ private function getExtensionHelper($id, array $cert = null, $path = null)
* @param string $path optional
* @return array
*/
- private function getExtensionsHelper(array $cert = null, $path = null)
+ private function getExtensionsHelper($cert = null, $path = null)
{
$exts = $this->extensions($cert, $path);
$extensions = [];
@@ -3379,7 +3378,7 @@ public function removeExtension($id)
* @param string $path
* @return mixed
*/
- public function getExtension($id, array $cert = null, $path = null)
+ public function getExtension($id, $cert = null, $path = null)
{
return $this->getExtensionHelper($id, $cert, $path);
}
@@ -3391,7 +3390,7 @@ public function getExtension($id, array $cert = null, $path = null)
* @param string $path optional
* @return array
*/
- public function getExtensions(array $cert = null, $path = null)
+ public function getExtensions($cert = null, $path = null)
{
return $this->getExtensionsHelper($cert, $path);
}
@@ -3467,7 +3466,7 @@ public function removeAttribute($id, $disposition = self::ATTR_ALL)
* @param array $csr optional
* @return mixed
*/
- public function getAttribute($id, $disposition = self::ATTR_ALL, array $csr = null)
+ public function getAttribute($id, $disposition = self::ATTR_ALL, $csr = null)
{
if (empty($csr)) {
$csr = $this->currentCert;
@@ -3500,13 +3499,35 @@ public function getAttribute($id, $disposition = self::ATTR_ALL, array $csr = nu
return false;
}
+ /**
+ * Get all requested CSR extensions
+ *
+ * Returns the list of extensions if there are any and false if not
+ *
+ * @param array $csr optional
+ * @return mixed
+ */
+ public function getRequestedCertificateExtensions($csr = null)
+ {
+ if (empty($csr)) {
+ $csr = $this->currentCert;
+ }
+
+ $requestedExtensions = $this->getAttribute('pkcs-9-at-extensionRequest');
+ if ($requestedExtensions === false) {
+ return false;
+ }
+
+ return $this->getAttribute('pkcs-9-at-extensionRequest')[0];
+ }
+
/**
* Returns a list of all CSR attributes in use
*
* @param array $csr optional
* @return array
*/
- public function getAttributes(array $csr = null)
+ public function getAttributes($csr = null)
{
if (empty($csr)) {
$csr = $this->currentCert;
@@ -3853,7 +3874,7 @@ public function getRevoked($serial)
* @param array $crl optional
* @return array|bool
*/
- public function listRevoked(array $crl = null)
+ public function listRevoked($crl = null)
{
if (!isset($crl)) {
$crl = $this->currentCert;
@@ -3902,7 +3923,7 @@ public function removeRevokedCertificateExtension($serial, $id)
* @param array $crl optional
* @return mixed
*/
- public function getRevokedCertificateExtension($serial, $id, array $crl = null)
+ public function getRevokedCertificateExtension($serial, $id, $crl = null)
{
if (!isset($crl)) {
$crl = $this->currentCert;
@@ -3924,7 +3945,7 @@ public function getRevokedCertificateExtension($serial, $id, array $crl = null)
* @param array $crl optional
* @return array|bool
*/
- public function getRevokedCertificateExtensions($serial, array $crl = null)
+ public function getRevokedCertificateExtensions($serial, $crl = null)
{
if (!isset($crl)) {
$crl = $this->currentCert;
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger.php
index 67d4788f9..2a9cc0b43 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger.php
@@ -162,7 +162,7 @@ private static function initialize_static_variables()
* If the second parameter - $base - is negative, then it will be assumed that the number's are encoded using
* two's compliment. The sole exception to this is -10, which is treated the same as 10 is.
*
- * @param string|int|BigInteger\Engines\Engine $x Base-10 number or base-$base number if $base set.
+ * @param string|int|Engine $x Base-10 number or base-$base number if $base set.
* @param int $base
*/
public function __construct($x = 0, $base = 10)
@@ -171,7 +171,7 @@ public function __construct($x = 0, $base = 10)
if ($x instanceof self::$mainEngine) {
$this->value = clone $x;
- } elseif ($x instanceof BigInteger\Engines\Engine) {
+ } elseif ($x instanceof Engine) {
$this->value = new static("$x");
$this->value->setPrecision($x->getPrecision());
} else {
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/BCMath.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/BCMath.php
index 7c5ca9fb3..e3a49906b 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/BCMath.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/BCMath.php
@@ -336,7 +336,7 @@ public function bitwise_and(BCMath $x)
*/
public function bitwise_or(BCMath $x)
{
- return $this->bitwiseXorHelper($x);
+ return $this->bitwiseOrHelper($x);
}
/**
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/Barrett.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/Barrett.php
index ec1d5caa7..9e01bf005 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/Barrett.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/Barrett.php
@@ -66,7 +66,7 @@ protected static function reduce($n, $m)
$m_length = strlen($m);
- if (strlen($n) >= 2 * $m_length) {
+ if (strlen($n) > 2 * $m_length) {
return bcmod($n, $m);
}
@@ -75,6 +75,13 @@ protected static function reduce($n, $m)
return self::regularBarrett($n, $m);
}
// n = 2 * m.length
+ $correctionNeeded = false;
+ if ($m_length & 1) {
+ $correctionNeeded = true;
+ $n .= '0';
+ $m .= '0';
+ $m_length++;
+ }
if (($key = array_search($m, $cache[self::VARIABLE])) === false) {
$key = count($cache[self::VARIABLE]);
@@ -131,7 +138,7 @@ protected static function reduce($n, $m)
$result = bcsub($result, $m);
}
- return $result;
+ return $correctionNeeded ? substr($result, 0, -1) : $result;
}
/**
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Barrett.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Barrett.php
index 849374193..886896618 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Barrett.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Barrett.php
@@ -56,7 +56,7 @@ protected static function reduce(array $n, array $m, $class)
$m_length = count($m);
// if (self::compareHelper($n, $static::square($m)) >= 0) {
- if (count($n) >= 2 * $m_length) {
+ if (count($n) > 2 * $m_length) {
$lhs = new $class();
$rhs = new $class();
$lhs->value = $n;
@@ -70,6 +70,13 @@ protected static function reduce(array $n, array $m, $class)
return self::regularBarrett($n, $m, $class);
}
// n = 2 * m.length
+ $correctionNeeded = false;
+ if ($m_length & 1) {
+ $correctionNeeded = true;
+ array_unshift($n, 0);
+ array_unshift($m, 0);
+ $m_length++;
+ }
if (($key = array_search($m, $cache[self::VARIABLE])) === false) {
$key = count($cache[self::VARIABLE]);
@@ -109,6 +116,10 @@ protected static function reduce(array $n, array $m, $class)
$temp = array_slice($n[self::VALUE], $m_length - 1);
// if even: ((m.length >> 1) + 2) + (m.length >> 1) == m.length + 2
// if odd: ((m.length >> 1) + 2) + (m.length >> 1) == (m.length - 1) + 2 == m.length + 1
+ // note that these are upper bounds. let's say m.length is 2. then you'd be multiplying a
+ // 3 digit number by a 1 digit number. if you're doing 999 * 9 (in base 10) the result will
+ // be a 4 digit number. but if you're multiplying 111 * 1 then the result will be a 3 digit
+ // number.
$temp = $class::multiplyHelper($temp, false, $u, false);
// if even: (m.length + 2) - ((m.length >> 1) + 1) = m.length - (m.length >> 1) + 1
// if odd: (m.length + 1) - ((m.length >> 1) + 1) = m.length - (m.length >> 1)
@@ -116,17 +127,19 @@ protected static function reduce(array $n, array $m, $class)
// if even: (m.length - (m.length >> 1) + 1) + m.length = 2 * m.length - (m.length >> 1) + 1
// if odd: (m.length - (m.length >> 1)) + m.length = 2 * m.length - (m.length >> 1)
$temp = $class::multiplyHelper($temp, false, $m, false);
-
- // at this point, if m had an odd number of digits, we'd be subtracting a 2 * m.length - (m.length >> 1) digit
- // number from a m.length + (m.length >> 1) + 1 digit number. ie. there'd be an extra digit and the while loop
+ // at this point, if m had an odd number of digits, we'd (probably) be subtracting a 2 * m.length - (m.length >> 1)
+ // digit number from a m.length + (m.length >> 1) + 1 digit number. ie. there'd be an extra digit and the while loop
// following this comment would loop a lot (hence our calling _regularBarrett() in that situation).
-
$result = $class::subtractHelper($n[self::VALUE], false, $temp[self::VALUE], false);
while (self::compareHelper($result[self::VALUE], $result[self::SIGN], $m, false) >= 0) {
$result = $class::subtractHelper($result[self::VALUE], $result[self::SIGN], $m, false);
}
+ if ($correctionNeeded) {
+ array_shift($result[self::VALUE]);
+ }
+
return $result[self::VALUE];
}
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Reductions/EvalBarrett.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Reductions/EvalBarrett.php
index 2cf69f2e8..01df0b611 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Reductions/EvalBarrett.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Reductions/EvalBarrett.php
@@ -74,6 +74,14 @@ protected static function generateCustomReduction(PHP $m, $class)
return $func;
}
+ $correctionNeeded = false;
+ if ($m_length & 1) {
+ $correctionNeeded = true;
+ $m = clone $m;
+ array_unshift($m->value, 0);
+ $m_length++;
+ }
+
$lhs = new $class();
$lhs_value = &$lhs->value;
@@ -99,8 +107,12 @@ protected static function generateCustomReduction(PHP $m, $class)
$cutoff = count($m) + (count($m) >> 1);
- $code = '
- if (count($n) >= ' . (2 * count($m)) . ') {
+ $code = $correctionNeeded ?
+ 'array_unshift($n, 0);' :
+ '';
+
+ $code .= '
+ if (count($n) > ' . (2 * count($m)) . ') {
$lhs = new ' . $class . '();
$rhs = new ' . $class . '();
$lhs->value = $n;
@@ -141,6 +153,10 @@ protected static function generateCustomReduction(PHP $m, $class)
$code .= self::generateInlineCompare($m, 'temp', $subcode);
+ if ($correctionNeeded) {
+ $code .= 'array_shift($temp);';
+ }
+
$code .= 'return $temp;';
eval('$func = function ($n) { ' . $code . '};');
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/PrimeField/Integer.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/PrimeField/Integer.php
index 1bd7aaf0f..15eb99c7d 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/PrimeField/Integer.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/PrimeField/Integer.php
@@ -62,8 +62,9 @@ class Integer extends Base
* Default constructor
*
* @param int $instanceID
+ * @param BigInteger $num
*/
- public function __construct($instanceID, BigInteger $num = null)
+ public function __construct($instanceID, $num = null)
{
$this->instanceID = $instanceID;
if (!isset($num)) {
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php
index 5731170e8..47dac48f9 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php
@@ -391,7 +391,8 @@ public function __construct($host, $port = 22, $timeout = 10)
104 => 'NET_SFTP_NAME',
105 => 'NET_SFTP_ATTRS',
- 200 => 'NET_SFTP_EXTENDED'
+ 200 => 'NET_SFTP_EXTENDED',
+ 201 => 'NET_SFTP_EXTENDED_REPLY'
];
self::$status_codes = [
0 => 'NET_SFTP_STATUS_OK',
@@ -2101,7 +2102,7 @@ public function rmdir($dir)
* @param callable|null $progressCallback
* @throws \UnexpectedValueException on receipt of unexpected packets
* @throws \BadFunctionCallException if you're uploading via a callback and the callback function is invalid
- * @throws \phpseclib3\Exception\FileNotFoundException if you're uploading via a file and the file doesn't exist
+ * @throws FileNotFoundException if you're uploading via a file and the file doesn't exist
* @return bool
*/
public function put($remote_file, $data, $mode = self::SOURCE_STRING, $start = -1, $local_start = -1, $progressCallback = null)
@@ -3042,6 +3043,8 @@ private function parseTime($key, $flags, &$response)
*/
protected function parseAttributes(&$response)
{
+ $attr = [];
+
if ($this->version >= 4) {
list($flags, $attr['type']) = Strings::unpackSSH2('NC', $response);
} else {
@@ -3269,6 +3272,7 @@ private function send_sftp_packet($type, $data, $request_id = 1)
// in SSH2.php the timeout is cumulative per function call. eg. exec() will
// timeout after 10s. but for SFTP.php it's cumulative per packet
$this->curTimeout = $this->timeout;
+ $this->is_timeout = false;
$packet = $this->use_request_id ?
pack('NCNa*', strlen($data) + 5, $type, $request_id, $data) :
@@ -3331,6 +3335,7 @@ private function get_sftp_packet($request_id = null)
// in SSH2.php the timeout is cumulative per function call. eg. exec() will
// timeout after 10s. but for SFTP.php it's cumulative per packet
$this->curTimeout = $this->timeout;
+ $this->is_timeout = false;
$start = microtime(true);
@@ -3494,6 +3499,24 @@ public function getSupportedVersions()
return $temp;
}
+ /**
+ * Get supported SFTP extensions
+ *
+ * @return array
+ */
+ public function getSupportedExtensions()
+ {
+ if (!($this->bitmap & SSH2::MASK_LOGIN)) {
+ return false;
+ }
+
+ if (!$this->partial_init) {
+ $this->partial_init_sftp_connection();
+ }
+
+ return $this->extensions;
+ }
+
/**
* Get supported SFTP versions
*
@@ -3551,4 +3574,124 @@ public function disableDatePreservation()
{
$this->preserveTime = false;
}
+
+ /**
+ * POSIX Rename
+ *
+ * Where rename() fails "if there already exists a file with the name specified by newpath"
+ * (draft-ietf-secsh-filexfer-02#section-6.5), posix_rename() overwrites the existing file in an atomic fashion.
+ * ie. "there is no observable instant in time where the name does not refer to either the old or the new file"
+ * (draft-ietf-secsh-filexfer-13#page-39).
+ *
+ * @param string $oldname
+ * @param string $newname
+ * @return bool
+ */
+ public function posix_rename($oldname, $newname)
+ {
+ if (!$this->precheck()) {
+ return false;
+ }
+
+ $oldname = $this->realpath($oldname);
+ $newname = $this->realpath($newname);
+ if ($oldname === false || $newname === false) {
+ return false;
+ }
+
+ if ($this->version >= 5) {
+ $packet = Strings::packSSH2('ssN', $oldname, $newname, 2); // 2 = SSH_FXP_RENAME_ATOMIC
+ $this->send_sftp_packet(NET_SFTP_RENAME, $packet);
+ } elseif (isset($this->extensions['posix-rename@openssh.com']) && $this->extensions['posix-rename@openssh.com'] === '1') {
+ $packet = Strings::packSSH2('sss', 'posix-rename@openssh.com', $oldname, $newname);
+ $this->send_sftp_packet(NET_SFTP_EXTENDED, $packet);
+ } else {
+ throw new \RuntimeException(
+ "Extension 'posix-rename@openssh.com' is not supported by the server. " .
+ "Call getSupportedVersions() to see a list of supported extension"
+ );
+ }
+
+ $response = $this->get_sftp_packet();
+ if ($this->packet_type != NET_SFTP_STATUS) {
+ throw new \UnexpectedValueException('Expected NET_SFTP_STATUS. '
+ . 'Got packet type: ' . $this->packet_type);
+ }
+
+ // if $status isn't SSH_FX_OK it's probably SSH_FX_NO_SUCH_FILE or SSH_FX_PERMISSION_DENIED
+ list($status) = Strings::unpackSSH2('N', $response);
+ if ($status != NET_SFTP_STATUS_OK) {
+ $this->logError($response, $status);
+ return false;
+ }
+
+ // don't move the stat cache entry over since this operation could very well change the
+ // atime and mtime attributes
+ //$this->update_stat_cache($newname, $this->query_stat_cache($oldname));
+ $this->remove_from_stat_cache($oldname);
+ $this->remove_from_stat_cache($newname);
+
+ return true;
+ }
+
+ /**
+ * Returns general information about a file system.
+ *
+ * The function statvfs() returns information about a mounted filesystem.
+ * @see https://man7.org/linux/man-pages/man3/statvfs.3.html
+ *
+ * @param string $path
+ * @return false|array{bsize: int, frsize: int, blocks: int, bfree: int, bavail: int, files: int, ffree: int, favail: int, fsid: int, flag: int, namemax: int}
+ */
+ public function statvfs($path)
+ {
+ if (!$this->precheck()) {
+ return false;
+ }
+
+ if (!isset($this->extensions['statvfs@openssh.com']) || $this->extensions['statvfs@openssh.com'] !== '2') {
+ throw new \RuntimeException(
+ "Extension 'statvfs@openssh.com' is not supported by the server. " .
+ "Call getSupportedVersions() to see a list of supported extension"
+ );
+ }
+
+ $realpath = $this->realpath($path);
+ if ($realpath === false) {
+ return false;
+ }
+
+ $packet = Strings::packSSH2('ss', 'statvfs@openssh.com', $realpath);
+ $this->send_sftp_packet(NET_SFTP_EXTENDED, $packet);
+
+ $response = $this->get_sftp_packet();
+ if ($this->packet_type !== NET_SFTP_EXTENDED_REPLY) {
+ throw new \UnexpectedValueException(
+ 'Expected SSH_FXP_EXTENDED_REPLY. '
+ . 'Got packet type: ' . $this->packet_type
+ );
+ }
+
+ /**
+ * These requests return a SSH_FXP_STATUS reply on failure. On success they
+ * return the following SSH_FXP_EXTENDED_REPLY reply:
+ *
+ * uint32 id
+ * uint64 f_bsize file system block size
+ * uint64 f_frsize fundamental fs block size
+ * uint64 f_blocks number of blocks (unit f_frsize)
+ * uint64 f_bfree free blocks in file system
+ * uint64 f_bavail free blocks for non-root
+ * uint64 f_files total file inodes
+ * uint64 f_ffree free file inodes
+ * uint64 f_favail free file inodes for to non-root
+ * uint64 f_fsid file system id
+ * uint64 f_flag bit mask of f_flag values
+ * uint64 f_namemax maximum filename length
+ */
+ return array_combine(
+ ['bsize', 'frsize', 'blocks', 'bfree', 'bavail', 'files', 'ffree', 'favail', 'fsid', 'flag', 'namemax'],
+ Strings::unpackSSH2('QQQQQQQQQQQ', $response)
+ );
+ }
}
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php
index 49774629d..ac44eaacd 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php
@@ -66,6 +66,7 @@
use phpseclib3\Exception\InsufficientSetupException;
use phpseclib3\Exception\InvalidPacketLengthException;
use phpseclib3\Exception\NoSupportedAlgorithmsException;
+use phpseclib3\Exception\TimeoutException;
use phpseclib3\Exception\UnableToConnectException;
use phpseclib3\Exception\UnsupportedAlgorithmException;
use phpseclib3\Exception\UnsupportedCurveException;
@@ -103,7 +104,7 @@ class SSH2
const MASK_LOGIN_REQ = 0x00000004;
const MASK_LOGIN = 0x00000008;
const MASK_SHELL = 0x00000010;
- const MASK_WINDOW_ADJUST = 0x00000020;
+ const MASK_DISCONNECT = 0x00000020;
/*
* Channel constants
@@ -150,6 +151,10 @@ class SSH2
* Outputs the message numbers real-time
*/
const LOG_SIMPLE_REALTIME = 5;
+ /*
+ * Dumps the message numbers real-time
+ */
+ const LOG_REALTIME_SIMPLE = 5;
/**
* Make sure that the log never gets larger than this
*
@@ -626,7 +631,7 @@ class SSH2
protected $server_channels = [];
/**
- * Channel Buffers
+ * Channel Read Buffers
*
* If a client requests a packet from one channel but receives two packets from another those packets should
* be placed in a buffer
@@ -637,6 +642,17 @@ class SSH2
*/
private $channel_buffers = [];
+ /**
+ * Channel Write Buffers
+ *
+ * If a client sends a packet and receives a timeout error mid-transmission, buffer the data written so it
+ * can be de-duplicated upon resuming write
+ *
+ * @see self::send_channel_packet()
+ * @var array
+ */
+ private $channel_buffers_write = [];
+
/**
* Channel Status
*
@@ -825,11 +841,11 @@ class SSH2
private $quiet_mode = false;
/**
- * Time of first network activity
+ * Time of last read/write network activity
*
* @var float
*/
- private $last_packet;
+ private $last_packet = null;
/**
* Exit status returned from ssh if any
@@ -887,7 +903,7 @@ class SSH2
* @see self::isTimeout()
* @var bool
*/
- private $is_timeout = false;
+ protected $is_timeout = false;
/**
* Log Boundary
@@ -1104,14 +1120,55 @@ class SSH2
private $errorOnMultipleChannels;
/**
- * Terrapin Countermeasure
+ * Bytes Transferred Since Last Key Exchange
*
- * "During initial KEX, terminate the connection if any unexpected or out-of-sequence packet is received"
- * -- https://github.com/openssh/openssh-portable/commit/1edb00c58f8a6875fad6a497aa2bacf37f9e6cd5
+ * Includes outbound and inbound totals
+ *
+ * @var int
+ */
+ private $bytesTransferredSinceLastKEX = 0;
+
+ /**
+ * After how many transferred byte should phpseclib initiate a key re-exchange?
*
* @var int
*/
- private $extra_packets;
+ private $doKeyReexchangeAfterXBytes = 1024 * 1024 * 1024;
+
+ /**
+ * Has a key re-exchange been initialized?
+ *
+ * @var bool
+ * @access private
+ */
+ private $keyExchangeInProgress = false;
+
+ /**
+ * KEX Buffer
+ *
+ * If we're in the middle of a key exchange we want to buffer any additional packets we get until
+ * the key exchange is over
+ *
+ * @see self::_get_binary_packet()
+ * @see self::_key_exchange()
+ * @see self::exec()
+ * @var array
+ * @access private
+ */
+ private $kex_buffer = [];
+
+ /**
+ * Strict KEX Flag
+ *
+ * If kex-strict-s-v00@openssh.com is present in the first KEX packet it need not
+ * be present in subsequent packet
+ *
+ * @see self::_key_exchange()
+ * @see self::exec()
+ * @var array
+ * @access private
+ */
+ private $strict_kex_flag = false;
/**
* Default Constructor.
@@ -1337,8 +1394,6 @@ private function connect()
$this->curTimeout = $this->timeout;
- $this->last_packet = microtime(true);
-
if (!is_resource($this->fsock)) {
$start = microtime(true);
// with stream_select a timeout of 0 means that no timeout takes place;
@@ -1357,12 +1412,21 @@ private function connect()
throw new \RuntimeException('Connection timed out whilst attempting to open socket connection');
}
}
+
+ if (defined('NET_SSH2_LOGGING')) {
+ $this->append_log('(fsockopen took ' . round($elapsed, 4) . 's)', '');
+ }
}
$this->identifier = $this->generate_identifier();
if ($this->send_id_string_first) {
+ $start = microtime(true);
fputs($this->fsock, $this->identifier . "\r\n");
+ $elapsed = round(microtime(true) - $start, 4);
+ if (defined('NET_SSH2_LOGGING')) {
+ $this->append_log("-> (network: $elapsed)", $this->identifier . "\r\n");
+ }
}
/* According to the SSH2 specs,
@@ -1373,6 +1437,7 @@ private function connect()
in ISO-10646 UTF-8 [RFC3629] (language is not specified). Clients
MUST be able to process such lines." */
$data = '';
+ $totalElapsed = 0;
while (!feof($this->fsock) && !preg_match('#(.*)^(SSH-(\d\.\d+).*)#ms', $data, $matches)) {
$line = '';
while (true) {
@@ -1389,28 +1454,21 @@ private function connect()
throw new \RuntimeException('Connection timed out whilst receiving server identification string');
}
$elapsed = microtime(true) - $start;
+ $totalElapsed += $elapsed;
$this->curTimeout -= $elapsed;
}
$temp = stream_get_line($this->fsock, 255, "\n");
if ($temp === false) {
- throw new \RuntimeException('Error reading from socket');
+ throw new \RuntimeException('Error reading SSH identification string; are you sure you\'re connecting to an SSH server?');
}
+
+ $line .= $temp;
if (strlen($temp) == 255) {
continue;
}
- $line .= "$temp\n";
-
- // quoting RFC4253, "Implementers who wish to maintain
- // compatibility with older, undocumented versions of this protocol may
- // want to process the identification string without expecting the
- // presence of the carriage return character for reasons described in
- // Section 5 of this document."
-
- //if (substr($line, -2) == "\r\n") {
- // break;
- //}
+ $line .= "\n";
break;
}
@@ -1418,19 +1476,18 @@ private function connect()
$data .= $line;
}
+ if (defined('NET_SSH2_LOGGING')) {
+ $this->append_log('<- (network: ' . round($totalElapsed, 4) . ')', $line);
+ }
+
if (feof($this->fsock)) {
$this->bitmap = 0;
- throw new ConnectionClosedException('Connection closed by server');
+ throw new ConnectionClosedException('Connection closed by server; are you sure you\'re connected to an SSH server?');
}
$extra = $matches[1];
- if (defined('NET_SSH2_LOGGING')) {
- $this->append_log('<-', $matches[0]);
- $this->append_log('->', $this->identifier . "\r\n");
- }
-
- $this->server_identifier = trim($temp, "\r\n");
+ $this->server_identifier = trim($data, "\r\n");
if (strlen($extra)) {
$this->errors[] = $data;
}
@@ -1453,17 +1510,18 @@ private function connect()
$this->errorOnMultipleChannels = $match;
if (!$this->send_id_string_first) {
+ $start = microtime(true);
fputs($this->fsock, $this->identifier . "\r\n");
+ $elapsed = round(microtime(true) - $start, 4);
+ if (defined('NET_SSH2_LOGGING')) {
+ $this->append_log("-> (network: $elapsed)", $this->identifier . "\r\n");
+ }
}
- if (!$this->send_kex_first) {
- $response = $this->get_binary_packet();
-
- if (is_bool($response) || !strlen($response) || ord($response[0]) != NET_SSH2_MSG_KEXINIT) {
- $this->bitmap = 0;
- throw new \UnexpectedValueException('Expected SSH_MSG_KEXINIT');
- }
+ $this->last_packet = microtime(true);
+ if (!$this->send_kex_first) {
+ $response = $this->get_binary_packet_or_close(NET_SSH2_MSG_KEXINIT);
$this->key_exchange($response);
}
@@ -1518,12 +1576,17 @@ private function generate_identifier()
* @param string|bool $kexinit_payload_server optional
* @throws \UnexpectedValueException on receipt of unexpected packets
* @throws \RuntimeException on other errors
- * @throws \phpseclib3\Exception\NoSupportedAlgorithmsException when none of the algorithms phpseclib has loaded are compatible
+ * @throws NoSupportedAlgorithmsException when none of the algorithms phpseclib has loaded are compatible
*/
private function key_exchange($kexinit_payload_server = false)
{
+ $this->bytesTransferredSinceLastKEX = 0;
+
$preferred = $this->preferred;
- $send_kex = true;
+ // for the initial key exchange $send_kex is true (no key re-exchange has been started)
+ // for phpseclib initiated key exchanges $send_kex is false
+ $send_kex = !$this->keyExchangeInProgress;
+ $this->keyExchangeInProgress = true;
$kex_algorithms = isset($preferred['kex']) ?
$preferred['kex'] :
@@ -1603,19 +1666,19 @@ private function key_exchange($kexinit_payload_server = false)
0 // reserved for future extension
);
- if ($kexinit_payload_server === false) {
+ if ($kexinit_payload_server === false && $send_kex) {
$this->send_binary_packet($kexinit_payload_client);
- $this->extra_packets = 0;
- $kexinit_payload_server = $this->get_binary_packet();
+ while (true) {
+ $kexinit_payload_server = $this->get_binary_packet();
+ switch (ord($kexinit_payload_server[0])) {
+ case NET_SSH2_MSG_KEXINIT:
+ break 2;
+ case NET_SSH2_MSG_DISCONNECT:
+ return $this->handleDisconnect($kexinit_payload_server);
+ }
- if (
- is_bool($kexinit_payload_server)
- || !strlen($kexinit_payload_server)
- || ord($kexinit_payload_server[0]) != NET_SSH2_MSG_KEXINIT
- ) {
- $this->disconnect_helper(NET_SSH2_DISCONNECT_PROTOCOL_ERROR);
- throw new \UnexpectedValueException('Expected SSH_MSG_KEXINIT');
+ $this->kex_buffer[] = $kexinit_payload_server;
}
$send_kex = false;
@@ -1639,8 +1702,13 @@ private function key_exchange($kexinit_payload_server = false)
$first_kex_packet_follows
) = Strings::unpackSSH2('L10C', $response);
if (in_array('kex-strict-s-v00@openssh.com', $this->kex_algorithms)) {
- if ($this->session_id === false && $this->extra_packets) {
- throw new \UnexpectedValueException('Possible Terrapin Attack detected');
+ if ($this->session_id === false) {
+ // [kex-strict-s-v00@openssh.com is] only valid in the initial SSH2_MSG_KEXINIT and MUST be ignored
+ // if [it is] present in subsequent SSH2_MSG_KEXINIT packets
+ $this->strict_kex_flag = true;
+ if (count($this->kex_buffer)) {
+ throw new \UnexpectedValueException('Possible Terrapin Attack detected');
+ }
}
}
@@ -1761,13 +1829,8 @@ private function key_exchange($kexinit_payload_server = false)
$this->send_binary_packet($packet);
$this->updateLogHistory('UNKNOWN (34)', 'NET_SSH2_MSG_KEXDH_GEX_REQUEST');
- $response = $this->get_binary_packet();
-
+ $response = $this->get_binary_packet_or_close(NET_SSH2_MSG_KEXDH_GEX_GROUP);
list($type, $primeBytes, $gBytes) = Strings::unpackSSH2('Css', $response);
- if ($type != NET_SSH2_MSG_KEXDH_GEX_GROUP) {
- $this->disconnect_helper(NET_SSH2_DISCONNECT_PROTOCOL_ERROR);
- throw new \UnexpectedValueException('Expected SSH_MSG_KEX_DH_GEX_GROUP');
- }
$this->updateLogHistory('NET_SSH2_MSG_KEXDH_REPLY', 'NET_SSH2_MSG_KEXDH_GEX_GROUP');
$prime = new BigInteger($primeBytes, -256);
$g = new BigInteger($gBytes, -256);
@@ -1806,7 +1869,7 @@ private function key_exchange($kexinit_payload_server = false)
$this->updateLogHistory('UNKNOWN (32)', 'NET_SSH2_MSG_KEXDH_GEX_INIT');
}
- $response = $this->get_binary_packet();
+ $response = $this->get_binary_packet_or_close(constant($serverKexReplyMessage));
list(
$type,
@@ -1815,10 +1878,6 @@ private function key_exchange($kexinit_payload_server = false)
$this->signature
) = Strings::unpackSSH2('Csss', $response);
- if ($type != constant($serverKexReplyMessage)) {
- $this->disconnect_helper(NET_SSH2_DISCONNECT_PROTOCOL_ERROR);
- throw new \UnexpectedValueException("Expected $serverKexReplyMessage");
- }
switch ($serverKexReplyMessage) {
case 'NET_SSH2_MSG_KEX_ECDH_REPLY':
$this->updateLogHistory('NET_SSH2_MSG_KEXDH_REPLY', 'NET_SSH2_MSG_KEX_ECDH_REPLY');
@@ -1885,21 +1944,11 @@ private function key_exchange($kexinit_payload_server = false)
$packet = pack('C', NET_SSH2_MSG_NEWKEYS);
$this->send_binary_packet($packet);
+ $this->get_binary_packet_or_close(NET_SSH2_MSG_NEWKEYS);
- $response = $this->get_binary_packet();
-
- if ($response === false) {
- $this->disconnect_helper(NET_SSH2_DISCONNECT_CONNECTION_LOST);
- throw new ConnectionClosedException('Connection closed by server');
- }
-
- list($type) = Strings::unpackSSH2('C', $response);
- if ($type != NET_SSH2_MSG_NEWKEYS) {
- $this->disconnect_helper(NET_SSH2_DISCONNECT_PROTOCOL_ERROR);
- throw new \UnexpectedValueException('Expected SSH_MSG_NEWKEYS');
- }
+ $this->keyExchangeInProgress = false;
- if (in_array('kex-strict-s-v00@openssh.com', $this->kex_algorithms)) {
+ if ($this->strict_kex_flag) {
$this->get_seq_no = $this->send_seq_no = 0;
}
@@ -2349,7 +2398,7 @@ private function login_helper($username, $password = null)
$this->send_binary_packet($packet);
try {
- $response = $this->get_binary_packet();
+ $response = $this->get_binary_packet_or_close(NET_SSH2_MSG_SERVICE_ACCEPT);
} catch (InvalidPacketLengthException $e) {
// the first opportunity to encounter the "bad key size" error
if (!$this->bad_key_size_fix && $this->decryptName != null && self::bad_algorithm_candidate($this->decryptName)) {
@@ -2360,15 +2409,12 @@ private function login_helper($username, $password = null)
return $this->reconnect();
}
throw $e;
- } catch (\Exception $e) {
- $this->disconnect_helper(NET_SSH2_DISCONNECT_CONNECTION_LOST);
- throw $e;
}
list($type) = Strings::unpackSSH2('C', $response);
list($service) = Strings::unpackSSH2('s', $response);
- if ($type != NET_SSH2_MSG_SERVICE_ACCEPT || $service != 'ssh-userauth') {
+ if ($service != 'ssh-userauth') {
$this->disconnect_helper(NET_SSH2_DISCONNECT_PROTOCOL_ERROR);
throw new \UnexpectedValueException('Expected SSH_MSG_SERVICE_ACCEPT');
}
@@ -2406,7 +2452,7 @@ private function login_helper($username, $password = null)
$this->send_binary_packet($packet);
- $response = $this->get_binary_packet();
+ $response = $this->get_binary_packet_or_close();
list($type) = Strings::unpackSSH2('C', $response);
switch ($type) {
@@ -2449,10 +2495,7 @@ private function login_helper($username, $password = null)
$this->send_binary_packet($packet, $logged);
- $response = $this->get_binary_packet();
- if ($response === false) {
- return false;
- }
+ $response = $this->get_binary_packet_or_close();
list($type) = Strings::unpackSSH2('C', $response);
switch ($type) {
case NET_SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ: // in theory, the password can be changed
@@ -2520,7 +2563,7 @@ private function keyboard_interactive_process(...$responses)
if (strlen($this->last_interactive_response)) {
$response = $this->last_interactive_response;
} else {
- $orig = $response = $this->get_binary_packet();
+ $orig = $response = $this->get_binary_packet_or_close();
}
list($type) = Strings::unpackSSH2('C', $response);
@@ -2608,7 +2651,7 @@ private function keyboard_interactive_process(...$responses)
* Login with an ssh-agent provided key
*
* @param string $username
- * @param \phpseclib3\System\SSH\Agent $agent
+ * @param Agent $agent
* @return bool
*/
private function ssh_agent_login($username, Agent $agent)
@@ -2633,7 +2676,7 @@ private function ssh_agent_login($username, Agent $agent)
* by sending dummy SSH_MSG_IGNORE messages.}
*
* @param string $username
- * @param \phpseclib3\Crypt\Common\PrivateKey $privatekey
+ * @param PrivateKey $privatekey
* @return bool
* @throws \RuntimeException on connection error
*/
@@ -2710,7 +2753,11 @@ private function privatekey_login($username, PrivateKey $privatekey)
$packet = $part1 . chr(0) . $part2;
$this->send_binary_packet($packet);
- $response = $this->get_binary_packet();
+ $response = $this->get_binary_packet_or_close(
+ NET_SSH2_MSG_USERAUTH_SUCCESS,
+ NET_SSH2_MSG_USERAUTH_FAILURE,
+ NET_SSH2_MSG_USERAUTH_PK_OK
+ );
list($type) = Strings::unpackSSH2('C', $response);
switch ($type) {
@@ -2731,9 +2778,6 @@ private function privatekey_login($username, PrivateKey $privatekey)
case NET_SSH2_MSG_USERAUTH_SUCCESS:
$this->bitmap |= self::MASK_LOGIN;
return true;
- default:
- $this->disconnect_helper(NET_SSH2_DISCONNECT_BY_APPLICATION);
- throw new ConnectionClosedException('Unexpected response to publickey authentication pt 1');
}
$packet = $part1 . chr(1) . $part2;
@@ -2746,7 +2790,10 @@ private function privatekey_login($username, PrivateKey $privatekey)
$this->send_binary_packet($packet);
- $response = $this->get_binary_packet();
+ $response = $this->get_binary_packet_or_close(
+ NET_SSH2_MSG_USERAUTH_SUCCESS,
+ NET_SSH2_MSG_USERAUTH_FAILURE
+ );
list($type) = Strings::unpackSSH2('C', $response);
switch ($type) {
@@ -2759,9 +2806,6 @@ private function privatekey_login($username, PrivateKey $privatekey)
$this->bitmap |= self::MASK_LOGIN;
return true;
}
-
- $this->disconnect_helper(NET_SSH2_DISCONNECT_BY_APPLICATION);
- throw new ConnectionClosedException('Unexpected response to publickey authentication pt 2');
}
/**
@@ -2778,7 +2822,7 @@ public function getTimeout()
* Set Timeout
*
* $ssh->exec('ping 127.0.0.1'); on a Linux host will never return and will run indefinitely. setTimeout() makes it so it'll timeout.
- * Setting $timeout to false or 0 will mean there is no timeout.
+ * Setting $timeout to false or 0 will revert to the default socket timeout.
*
* @param mixed $timeout
*/
@@ -2815,11 +2859,12 @@ public function getStdError()
* In all likelihood, this is not a feature you want to be taking advantage of.
*
* @param string $command
+ * @param callable $callback
* @return string|bool
* @psalm-return ($callback is callable ? bool : string|bool)
* @throws \RuntimeException on connection error
*/
- public function exec($command, callable $callback = null)
+ public function exec($command, $callback = null)
{
$this->curTimeout = $this->timeout;
$this->is_timeout = false;
@@ -3198,6 +3243,7 @@ public function read($expect = '', $mode = self::READ_SIMPLE, $channel = null)
* @return void
* @throws \RuntimeException on connection error
* @throws InsufficientSetupException on unexpected channel status, possibly due to closure
+ * @throws TimeoutException if the write could not be completed within the requested self::setTimeout()
*/
public function write($cmd, $channel = null)
{
@@ -3217,6 +3263,8 @@ public function write($cmd, $channel = null)
}
}
+ $this->curTimeout = $this->timeout;
+ $this->is_timeout = false;
$this->send_channel_packet($channel, $cmd);
}
@@ -3485,14 +3533,16 @@ protected function reset_connection()
$this->get_seq_no = $this->send_seq_no = 0;
$this->channel_status = [];
$this->channel_id_last_interactive = 0;
+ $this->channel_buffers = [];
+ $this->channel_buffers_write = [];
}
/**
- * @return int[] second and microsecond stream timeout options based on user-requested timeout and keep-alive, 0 by default
+ * @return int[] second and microsecond stream timeout options based on user-requested timeout and keep-alive, or the default socket timeout by default, which mirrors PHP socket streams.
*/
private function get_stream_timeout()
{
- $sec = 0;
+ $sec = ini_get('default_socket_timeout');
$usec = 0;
if ($this->curTimeout > 0) {
$sec = (int) floor($this->curTimeout);
@@ -3500,30 +3550,60 @@ private function get_stream_timeout()
}
if ($this->keepAlive > 0) {
$elapsed = microtime(true) - $this->last_packet;
- if ($elapsed < $this->curTimeout) {
- $sec = (int) floor($elapsed);
- $usec = (int) (1000000 * ($elapsed - $sec));
+ $timeout = max($this->keepAlive - $elapsed, 0);
+ if (!$this->curTimeout || $timeout < $this->curTimeout) {
+ $sec = (int) floor($timeout);
+ $usec = (int) (1000000 * ($timeout - $sec));
}
}
return [$sec, $usec];
}
+ /**
+ * Retrieves the next packet with added timeout and type handling
+ *
+ * @param string $message_types Message types to enforce in response, closing if not met
+ * @return string
+ * @throws ConnectionClosedException If an error has occurred preventing read of the next packet
+ */
+ private function get_binary_packet_or_close(...$message_types)
+ {
+ try {
+ $packet = $this->get_binary_packet();
+ if (count($message_types) > 0 && !in_array(ord($packet[0]), $message_types)) {
+ $this->disconnect_helper(NET_SSH2_DISCONNECT_PROTOCOL_ERROR);
+ throw new ConnectionClosedException('Bad message type. Expected: #'
+ . implode(', #', $message_types) . '. Got: #' . ord($packet[0]));
+ }
+ return $packet;
+ } catch (TimeoutException $e) {
+ $this->disconnect_helper(NET_SSH2_DISCONNECT_BY_APPLICATION);
+ throw new ConnectionClosedException('Connection closed due to timeout');
+ }
+ }
+
/**
* Gets Binary Packets
*
* See '6. Binary Packet Protocol' of rfc4253 for more info.
*
* @see self::_send_binary_packet()
- * @return bool|string
+ * @return string
+ * @throws TimeoutException If user requested timeout was reached while waiting for next packet
+ * @throws ConnectionClosedException If an error has occurred preventing read of the next packet
*/
private function get_binary_packet()
{
if (!is_resource($this->fsock)) {
throw new \InvalidArgumentException('fsock is not a resource.');
}
+ if (!$this->keyExchangeInProgress && count($this->kex_buffer)) {
+ return $this->filter(array_shift($this->kex_buffer));
+ }
if ($this->binary_packet_buffer == null) {
// buffer the packet to permit continued reads across timeouts
$this->binary_packet_buffer = (object) [
+ 'read_time' => 0, // the time to read the packet from the socket
'raw' => '', // the raw payload read from the socket
'plain' => '', // the packet in plain text, excluding packet_length header
'packet_length' => null, // the packet_length value pulled from the payload
@@ -3539,7 +3619,7 @@ private function get_binary_packet()
}
if ($this->curTimeout < 0) {
$this->is_timeout = true;
- return true;
+ throw new TimeoutException('Timed out waiting for server');
}
$this->send_keep_alive();
@@ -3548,6 +3628,7 @@ private function get_binary_packet()
$start = microtime(true);
$raw = stream_get_contents($this->fsock, $packet->size - strlen($packet->raw));
$elapsed = microtime(true) - $start;
+ $packet->read_time += $elapsed;
if ($this->curTimeout > 0) {
$this->curTimeout -= $elapsed;
}
@@ -3645,6 +3726,11 @@ private function get_binary_packet()
if ($padding_length > 0) {
Strings::pop($payload, $padding_length);
}
+
+ if (!$this->keyExchangeInProgress) {
+ $this->bytesTransferredSinceLastKEX += $packet->packet_length + $padding_length + 5;
+ }
+
if (empty($payload)) {
$this->disconnect_helper(NET_SSH2_DISCONNECT_PROTOCOL_ERROR);
throw new ConnectionClosedException('Plaintext is too short');
@@ -3663,18 +3749,18 @@ private function get_binary_packet()
$cmf = ord($payload[0]);
$cm = $cmf & 0x0F;
if ($cm != 8) { // deflate
- user_error("Only CM = 8 ('deflate') is supported ($cm)");
+ throw new UnsupportedAlgorithmException("Only CM = 8 ('deflate') is supported ($cm)");
}
$cinfo = ($cmf & 0xF0) >> 4;
if ($cinfo > 7) {
- user_error("CINFO above 7 is not allowed ($cinfo)");
+ throw new \RuntimeException("CINFO above 7 is not allowed ($cinfo)");
}
$windowSize = 1 << ($cinfo + 8);
$flg = ord($payload[1]);
//$fcheck = $flg && 0x0F;
if ((($cmf << 8) | $flg) % 31) {
- user_error('fcheck failed');
+ throw new \RuntimeException('fcheck failed');
}
$fdict = boolval($flg & 0x20);
$flevel = ($flg & 0xC0) >> 6;
@@ -3693,12 +3779,17 @@ private function get_binary_packet()
$current = microtime(true);
$message_number = isset(self::$message_numbers[ord($payload[0])]) ? self::$message_numbers[ord($payload[0])] : 'UNKNOWN (' . ord($payload[0]) . ')';
$message_number = '<- ' . $message_number .
- ' (since last: ' . round($current - $this->last_packet, 4) . ', network: ' . round($elapsed, 4) . 's)';
+ ' (since last: ' . round($current - $this->last_packet, 4) . ', network: ' . round($packet->read_time, 4) . 's)';
$this->append_log($message_number, $payload);
- $this->last_packet = $current;
+ }
+ $this->last_packet = microtime(true);
+
+ if ($this->bytesTransferredSinceLastKEX > $this->doKeyReexchangeAfterXBytes) {
+ $this->key_exchange();
}
- return $this->filter($payload);
+ // don't filter if we're in the middle of a key exchange (since _filter might send out packets)
+ return $this->keyExchangeInProgress ? $payload : $this->filter($payload);
}
/**
@@ -3763,6 +3854,25 @@ private function get_binary_packet_size(&$packet)
$packet->packet_length = $packet_length;
}
+ /**
+ * Handle Disconnect
+ *
+ * Because some binary packets need to be ignored...
+ *
+ * @see self::filter()
+ * @see self::key_exchange()
+ * @return boolean
+ * @access private
+ */
+ private function handleDisconnect($payload)
+ {
+ Strings::shift($payload, 1);
+ list($reason_code, $message) = Strings::unpackSSH2('Ns', $payload);
+ $this->errors[] = 'SSH_MSG_DISCONNECT: ' . self::$disconnect_reasons[$reason_code] . "\r\n$message";
+ $this->disconnect_helper(NET_SSH2_DISCONNECT_CONNECTION_LOST);
+ throw new ConnectionClosedException('Connection closed by server');
+ }
+
/**
* Filter Binary Packets
*
@@ -3770,36 +3880,30 @@ private function get_binary_packet_size(&$packet)
*
* @see self::_get_binary_packet()
* @param string $payload
- * @return string|bool
+ * @return string
*/
private function filter($payload)
{
switch (ord($payload[0])) {
case NET_SSH2_MSG_DISCONNECT:
- Strings::shift($payload, 1);
- list($reason_code, $message) = Strings::unpackSSH2('Ns', $payload);
- $this->errors[] = 'SSH_MSG_DISCONNECT: ' . self::$disconnect_reasons[$reason_code] . "\r\n$message";
- $this->bitmap = 0;
- return false;
+ return $this->handleDisconnect($payload);
case NET_SSH2_MSG_IGNORE:
- $this->extra_packets++;
$payload = $this->get_binary_packet();
break;
case NET_SSH2_MSG_DEBUG:
- $this->extra_packets++;
Strings::shift($payload, 2); // second byte is "always_display"
list($message) = Strings::unpackSSH2('s', $payload);
$this->errors[] = "SSH_MSG_DEBUG: $message";
$payload = $this->get_binary_packet();
break;
case NET_SSH2_MSG_UNIMPLEMENTED:
- return false;
+ break; // return payload
case NET_SSH2_MSG_KEXINIT:
- // this is here for key re-exchanges after the initial key exchange
+ // this is here for server initiated key re-exchanges after the initial key exchange
if ($this->session_id !== false) {
if (!$this->key_exchange($payload)) {
- $this->bitmap = 0;
- return false;
+ $this->disconnect_helper(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED);
+ throw new ConnectionClosedException('Key exchange failed');
}
$payload = $this->get_binary_packet();
}
@@ -3817,7 +3921,7 @@ private function filter($payload)
}
// see http://tools.ietf.org/html/rfc4252#section-5.4; only called when the encryption has been activated and when we haven't already logged in
- if (($this->bitmap & self::MASK_CONNECTED) && !$this->isAuthenticated() && !is_bool($payload) && ord($payload[0]) == NET_SSH2_MSG_USERAUTH_BANNER) {
+ if (($this->bitmap & self::MASK_CONNECTED) && !$this->isAuthenticated() && ord($payload[0]) == NET_SSH2_MSG_USERAUTH_BANNER) {
Strings::shift($payload, 1);
list($this->banner_message) = Strings::unpackSSH2('s', $payload);
$payload = $this->get_binary_packet();
@@ -3825,10 +3929,6 @@ private function filter($payload)
// only called when we've already logged in
if (($this->bitmap & self::MASK_CONNECTED) && $this->isAuthenticated()) {
- if (is_bool($payload)) {
- return $payload;
- }
-
switch (ord($payload[0])) {
case NET_SSH2_MSG_CHANNEL_REQUEST:
if (strlen($payload) == 31) {
@@ -3845,13 +3945,7 @@ private function filter($payload)
Strings::shift($payload, 1);
list($request_name) = Strings::unpackSSH2('s', $payload);
$this->errors[] = "SSH_MSG_GLOBAL_REQUEST: $request_name";
-
- try {
- $this->send_binary_packet(pack('C', NET_SSH2_MSG_REQUEST_FAILURE));
- } catch (\RuntimeException $e) {
- return $this->disconnect_helper(NET_SSH2_DISCONNECT_BY_APPLICATION);
- }
-
+ $this->send_binary_packet(pack('C', NET_SSH2_MSG_REQUEST_FAILURE));
$payload = $this->get_binary_packet();
break;
case NET_SSH2_MSG_CHANNEL_OPEN: // see http://tools.ietf.org/html/rfc4254#section-5.1
@@ -3897,23 +3991,11 @@ private function filter($payload)
'', // description
'' // language tag
);
-
- try {
- $this->send_binary_packet($packet);
- } catch (\RuntimeException $e) {
- return $this->disconnect_helper(NET_SSH2_DISCONNECT_BY_APPLICATION);
- }
+ $this->send_binary_packet($packet);
}
$payload = $this->get_binary_packet();
break;
- case NET_SSH2_MSG_CHANNEL_WINDOW_ADJUST:
- Strings::shift($payload, 1);
- list($channel, $window_size) = Strings::unpackSSH2('NN', $payload);
-
- $this->window_size_client_to_server[$channel] += $window_size;
-
- $payload = ($this->bitmap & self::MASK_WINDOW_ADJUST) ? true : $this->get_binary_packet();
}
}
@@ -3994,6 +4076,7 @@ public function isPTYEnabled()
*
* - the server closes the channel
* - if the connection times out
+ * - if a window adjust packet is received on the given negated client channel
* - if the channel status is CHANNEL_OPEN and the response was CHANNEL_OPEN_CONFIRMATION
* - if the channel status is CHANNEL_REQUEST and the response was CHANNEL_SUCCESS
* - if the channel status is CHANNEL_CLOSE and the response was CHANNEL_CLOSE
@@ -4002,7 +4085,10 @@ public function isPTYEnabled()
*
* - if the channel status is CHANNEL_REQUEST and the response was CHANNEL_FAILURE
*
- * @param int $client_channel
+ * @param int $client_channel Specifies the channel to return data for, and data received
+ * on other channels is buffered. The respective negative value of a channel is
+ * also supported for the case that the caller is awaiting adjustment of the data
+ * window, and where data received on that respective channel is also buffered.
* @param bool $skip_extended
* @return mixed
* @throws \RuntimeException on connection error
@@ -4027,21 +4113,15 @@ protected function get_channel_packet($client_channel, $skip_extended = false)
}
while (true) {
- $response = $this->get_binary_packet();
- if ($response === true && $this->is_timeout) {
- if ($client_channel == self::CHANNEL_EXEC && !$this->request_pty) {
- $this->close_channel($client_channel);
- }
+ try {
+ $response = $this->get_binary_packet();
+ } catch (TimeoutException $e) {
return true;
}
- if ($response === false) {
- $this->disconnect_helper(NET_SSH2_DISCONNECT_CONNECTION_LOST);
- throw new ConnectionClosedException('Connection closed by server');
- }
- if ($client_channel == -1 && $response === true) {
- return true;
+ list($type) = Strings::unpackSSH2('C', $response);
+ if (strlen($response) >= 4) {
+ list($channel) = Strings::unpackSSH2('N', $response);
}
- list($type, $channel) = Strings::unpackSSH2('CN', $response);
// will not be setup yet on incoming channel open request
if (isset($channel) && isset($this->channel_status[$channel]) && isset($this->window_size_server_to_client[$channel])) {
@@ -4057,6 +4137,14 @@ protected function get_channel_packet($client_channel, $skip_extended = false)
}
switch ($type) {
+ case NET_SSH2_MSG_CHANNEL_WINDOW_ADJUST:
+ list($window_size) = Strings::unpackSSH2('N', $response);
+ $this->window_size_client_to_server[$channel] += $window_size;
+ if ($channel == -$client_channel) {
+ return true;
+ }
+
+ continue 2;
case NET_SSH2_MSG_CHANNEL_EXTENDED_DATA:
/*
if ($client_channel == self::CHANNEL_EXEC) {
@@ -4231,7 +4319,7 @@ protected function get_channel_packet($client_channel, $skip_extended = false)
protected function send_binary_packet($data, $logged = null)
{
if (!is_resource($this->fsock) || feof($this->fsock)) {
- $this->bitmap = 0;
+ $this->disconnect_helper(NET_SSH2_DISCONNECT_CONNECTION_LOST);
throw new ConnectionClosedException('Connection closed prematurely');
}
@@ -4345,6 +4433,10 @@ protected function send_binary_packet($data, $logged = null)
$packet .= $this->encrypt && $this->encrypt->usesNonce() ? $this->encrypt->getTag() : $hmac;
+ if (!$this->keyExchangeInProgress) {
+ $this->bytesTransferredSinceLastKEX += strlen($packet);
+ }
+
$start = microtime(true);
$sent = @fputs($this->fsock, $packet);
$stop = microtime(true);
@@ -4355,16 +4447,20 @@ protected function send_binary_packet($data, $logged = null)
$message_number = '-> ' . $message_number .
' (since last: ' . round($current - $this->last_packet, 4) . ', network: ' . round($stop - $start, 4) . 's)';
$this->append_log($message_number, $logged);
- $this->last_packet = $current;
}
+ $this->last_packet = microtime(true);
if (strlen($packet) != $sent) {
- $this->bitmap = 0;
+ $this->disconnect_helper(NET_SSH2_DISCONNECT_BY_APPLICATION);
$message = $sent === false ?
'Unable to write ' . strlen($packet) . ' bytes' :
"Only $sent of " . strlen($packet) . " bytes were sent";
throw new \RuntimeException($message);
}
+
+ if ($this->bytesTransferredSinceLastKEX > $this->doKeyReexchangeAfterXBytes) {
+ $this->key_exchange();
+ }
}
/**
@@ -4487,6 +4583,10 @@ protected function append_log_helper($constant, $message_number, $message, array
$realtime_log_wrap = true;
}
fputs($realtime_log_file, $entry);
+ break;
+ case self::LOG_REALTIME_SIMPLE:
+ echo $message_number;
+ echo PHP_SAPI == 'cli' ? "\r\n" : '
';
}
}
@@ -4501,12 +4601,24 @@ protected function append_log_helper($constant, $message_number, $message, array
*/
protected function send_channel_packet($client_channel, $data)
{
+ if (
+ isset($this->channel_buffers_write[$client_channel])
+ && strpos($data, $this->channel_buffers_write[$client_channel]) === 0
+ ) {
+ // if buffer holds identical initial data content, resume send from the unmatched data portion
+ $data = substr($data, strlen($this->channel_buffers_write[$client_channel]));
+ } else {
+ $this->channel_buffers_write[$client_channel] = '';
+ }
while (strlen($data)) {
if (!$this->window_size_client_to_server[$client_channel]) {
- $this->bitmap ^= self::MASK_WINDOW_ADJUST;
// using an invalid channel will let the buffers be built up for the valid channels
- $this->get_channel_packet(-1);
- $this->bitmap ^= self::MASK_WINDOW_ADJUST;
+ $this->get_channel_packet(-$client_channel);
+ if ($this->isTimeout()) {
+ throw new TimeoutException('Timed out waiting for server');
+ } elseif (!$this->window_size_client_to_server[$client_channel]) {
+ throw new \RuntimeException('Data window was not adjusted');
+ }
}
/* The maximum amount of data allowed is determined by the maximum
@@ -4527,7 +4639,9 @@ protected function send_channel_packet($client_channel, $data)
);
$this->window_size_client_to_server[$client_channel] -= strlen($temp);
$this->send_binary_packet($packet);
+ $this->channel_buffers_write[$client_channel] .= $temp;
}
+ unset($this->channel_buffers_write[$client_channel]);
}
/**
@@ -4593,7 +4707,12 @@ private function close_channel_bitmap($client_channel)
*/
protected function disconnect_helper($reason)
{
- if ($this->bitmap & self::MASK_CONNECTED) {
+ if ($this->bitmap & self::MASK_DISCONNECT) {
+ // Disregard subsequent disconnect requests
+ return false;
+ }
+ $this->bitmap |= self::MASK_DISCONNECT;
+ if ($this->isConnected()) {
$data = Strings::packSSH2('CNss', NET_SSH2_MSG_DISCONNECT, $reason, '', '');
try {
$this->send_binary_packet($data);
@@ -4664,9 +4783,12 @@ protected function format_log(array $message_log, array $message_number_log)
{
$output = '';
for ($i = 0; $i < count($message_log); $i++) {
- $output .= $message_number_log[$i] . "\r\n";
+ $output .= $message_number_log[$i];
$current_log = $message_log[$i];
$j = 0;
+ if (strlen($current_log)) {
+ $output .= "\r\n";
+ }
do {
if (strlen($current_log)) {
$output .= str_pad(dechex($j), 7, '0', STR_PAD_LEFT) . '0 ';
@@ -4977,22 +5099,24 @@ public static function getSupportedMACAlgorithms()
return [
'hmac-sha2-256-etm@openssh.com',
'hmac-sha2-512-etm@openssh.com',
- 'umac-64-etm@openssh.com',
- 'umac-128-etm@openssh.com',
'hmac-sha1-etm@openssh.com',
// from :
'hmac-sha2-256',// RECOMMENDED HMAC-SHA256 (digest length = key length = 32)
'hmac-sha2-512',// OPTIONAL HMAC-SHA512 (digest length = key length = 64)
- // from :
- 'umac-64@openssh.com',
- 'umac-128@openssh.com',
-
'hmac-sha1-96', // RECOMMENDED first 96 bits of HMAC-SHA1 (digest length = 12, key length = 20)
'hmac-sha1', // REQUIRED HMAC-SHA1 (digest length = key length = 20)
'hmac-md5-96', // OPTIONAL first 96 bits of HMAC-MD5 (digest length = 12, key length = 16)
'hmac-md5', // OPTIONAL HMAC-MD5 (digest length = key length = 16)
+
+ 'umac-64-etm@openssh.com',
+ 'umac-128-etm@openssh.com',
+
+ // from :
+ 'umac-64@openssh.com',
+ 'umac-128@openssh.com',
+
//'none' // OPTIONAL no MAC; NOT RECOMMENDED
];
}
@@ -5071,6 +5195,31 @@ public function setTerminal($term)
*/
public function setPreferredAlgorithms(array $methods)
{
+ $keys = ['client_to_server', 'server_to_client'];
+
+ if (isset($methods['kex']) && is_string($methods['kex'])) {
+ $methods['kex'] = explode(',', $methods['kex']);
+ }
+
+ if (isset($methods['hostkey']) && is_string($methods['hostkey'])) {
+ $methods['hostkey'] = explode(',', $methods['hostkey']);
+ }
+
+ foreach ($keys as $key) {
+ if (isset($methods[$key])) {
+ $a = &$methods[$key];
+ if (isset($a['crypt']) && is_string($a['crypt'])) {
+ $a['crypt'] = explode(',', $a['crypt']);
+ }
+ if (isset($a['comp']) && is_string($a['comp'])) {
+ $a['comp'] = explode(',', $a['comp']);
+ }
+ if (isset($a['mac']) && is_string($a['mac'])) {
+ $a['mac'] = explode(',', $a['mac']);
+ }
+ }
+ }
+
$preferred = $methods;
if (isset($preferred['kex'])) {
@@ -5087,7 +5236,6 @@ public function setPreferredAlgorithms(array $methods)
);
}
- $keys = ['client_to_server', 'server_to_client'];
foreach ($keys as $key) {
if (isset($preferred[$key])) {
$a = &$preferred[$key];
@@ -5168,7 +5316,7 @@ public function getBannerMessage()
*
* @return string|false
* @throws \RuntimeException on badly formatted keys
- * @throws \phpseclib3\Exception\NoSupportedAlgorithmsException when the key isn't in a supported format
+ * @throws NoSupportedAlgorithmsException when the key isn't in a supported format
*/
public function getServerPublicHostKey()
{
@@ -5416,4 +5564,14 @@ public function disableSmartMFA()
{
$this->smartMFA = false;
}
+
+ /**
+ * How many bytes until the next key re-exchange?
+ *
+ * @param int $bytes
+ */
+ public function bytesUntilKeyReexchange($bytes)
+ {
+ $this->doKeyReexchangeAfterXBytes = $bytes;
+ }
}
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php
index 26ca32275..376d77bfe 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php
@@ -33,6 +33,7 @@
namespace phpseclib3\System\SSH;
use phpseclib3\Common\Functions\Strings;
+use phpseclib3\Crypt\Common\PublicKey;
use phpseclib3\Crypt\PublicKeyLoader;
use phpseclib3\Crypt\RSA;
use phpseclib3\Exception\BadConfigurationException;
@@ -110,8 +111,8 @@ class Agent
/**
* Default Constructor
*
- * @return \phpseclib3\System\SSH\Agent
- * @throws \phpseclib3\Exception\BadConfigurationException if SSH_AUTH_SOCK cannot be found
+ * @return Agent
+ * @throws BadConfigurationException if SSH_AUTH_SOCK cannot be found
* @throws \RuntimeException on connection errors
*/
public function __construct($address = null)
@@ -192,7 +193,8 @@ public function requestIdentities()
if (isset($key)) {
$identity = (new Identity($this->fsock))
->withPublicKey($key)
- ->withPublicKeyBlob($key_blob);
+ ->withPublicKeyBlob($key_blob)
+ ->withComment($comment);
$identities[] = $identity;
unset($key);
}
@@ -201,6 +203,24 @@ public function requestIdentities()
return $identities;
}
+ /**
+ * Returns the SSH Agent identity matching a given public key or null if no identity is found
+ *
+ * @return ?Identity
+ */
+ public function findIdentityByPublicKey(PublicKey $key)
+ {
+ $identities = $this->requestIdentities();
+ $key = (string) $key;
+ foreach ($identities as $identity) {
+ if (((string) $identity->getPublicKey()) == $key) {
+ return $identity;
+ }
+ }
+
+ return null;
+ }
+
/**
* Signal that agent forwarding should
* be requested when a channel is opened
@@ -217,7 +237,7 @@ public function startSSHForwarding()
/**
* Request agent forwarding of remote server
*
- * @param \phpseclib3\Net\SSH2 $ssh
+ * @param SSH2 $ssh
* @return bool
*/
private function request_forwarding(SSH2 $ssh)
@@ -238,7 +258,7 @@ private function request_forwarding(SSH2 $ssh)
* open to give the SSH Agent an opportunity
* to take further action. i.e. request agent forwarding
*
- * @param \phpseclib3\Net\SSH2 $ssh
+ * @param SSH2 $ssh
*/
public function registerChannelOpen(SSH2 $ssh)
{
diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent/Identity.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent/Identity.php
index 653e8ea5d..06a4bafd1 100644
--- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent/Identity.php
+++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent/Identity.php
@@ -79,6 +79,13 @@ class Identity implements PrivateKey
*/
private $flags = 0;
+ /**
+ * Comment
+ *
+ * @var null|string
+ */
+ private $comment;
+
/**
* Curve Aliases
*
@@ -106,7 +113,7 @@ public function __construct($fsock)
*
* Called by \phpseclib3\System\SSH\Agent::requestIdentities()
*
- * @param \phpseclib3\Crypt\Common\PublicKey $key
+ * @param PublicKey $key
*/
public function withPublicKey(PublicKey $key)
{
@@ -141,10 +148,9 @@ public function withPublicKeyBlob($key_blob)
*
* Wrapper for $this->key->getPublicKey()
*
- * @param string $type optional
* @return mixed
*/
- public function getPublicKey($type = 'PKCS8')
+ public function getPublicKey()
{
return $this->key;
}
@@ -261,7 +267,7 @@ public function getCurve()
* @param string $message
* @return string
* @throws \RuntimeException on connection errors
- * @throws \phpseclib3\Exception\UnsupportedAlgorithmException if the algorithm is unsupported
+ * @throws UnsupportedAlgorithmException if the algorithm is unsupported
*/
public function sign($message)
{
@@ -317,4 +323,24 @@ public function withPassword($password = false)
{
throw new \RuntimeException('ssh-agent does not provide a mechanism to get the private key');
}
+
+ /**
+ * Sets the comment
+ */
+ public function withComment($comment = null)
+ {
+ $new = clone $this;
+ $new->comment = $comment;
+ return $new;
+ }
+
+ /**
+ * Returns the comment
+ *
+ * @return null|string
+ */
+ public function getComment()
+ {
+ return $this->comment;
+ }
}
diff --git a/lib/Google/vendor/psr/log/Psr/Log/AbstractLogger.php b/lib/Google/vendor/psr/log/Psr/Log/AbstractLogger.php
deleted file mode 100644
index e02f9daf3..000000000
--- a/lib/Google/vendor/psr/log/Psr/Log/AbstractLogger.php
+++ /dev/null
@@ -1,128 +0,0 @@
-log(LogLevel::EMERGENCY, $message, $context);
- }
-
- /**
- * Action must be taken immediately.
- *
- * Example: Entire website down, database unavailable, etc. This should
- * trigger the SMS alerts and wake you up.
- *
- * @param string $message
- * @param mixed[] $context
- *
- * @return void
- */
- public function alert($message, array $context = array())
- {
- $this->log(LogLevel::ALERT, $message, $context);
- }
-
- /**
- * Critical conditions.
- *
- * Example: Application component unavailable, unexpected exception.
- *
- * @param string $message
- * @param mixed[] $context
- *
- * @return void
- */
- public function critical($message, array $context = array())
- {
- $this->log(LogLevel::CRITICAL, $message, $context);
- }
-
- /**
- * Runtime errors that do not require immediate action but should typically
- * be logged and monitored.
- *
- * @param string $message
- * @param mixed[] $context
- *
- * @return void
- */
- public function error($message, array $context = array())
- {
- $this->log(LogLevel::ERROR, $message, $context);
- }
-
- /**
- * Exceptional occurrences that are not errors.
- *
- * Example: Use of deprecated APIs, poor use of an API, undesirable things
- * that are not necessarily wrong.
- *
- * @param string $message
- * @param mixed[] $context
- *
- * @return void
- */
- public function warning($message, array $context = array())
- {
- $this->log(LogLevel::WARNING, $message, $context);
- }
-
- /**
- * Normal but significant events.
- *
- * @param string $message
- * @param mixed[] $context
- *
- * @return void
- */
- public function notice($message, array $context = array())
- {
- $this->log(LogLevel::NOTICE, $message, $context);
- }
-
- /**
- * Interesting events.
- *
- * Example: User logs in, SQL logs.
- *
- * @param string $message
- * @param mixed[] $context
- *
- * @return void
- */
- public function info($message, array $context = array())
- {
- $this->log(LogLevel::INFO, $message, $context);
- }
-
- /**
- * Detailed debug information.
- *
- * @param string $message
- * @param mixed[] $context
- *
- * @return void
- */
- public function debug($message, array $context = array())
- {
- $this->log(LogLevel::DEBUG, $message, $context);
- }
-}
diff --git a/lib/Google/vendor/psr/log/Psr/Log/Test/DummyTest.php b/lib/Google/vendor/psr/log/Psr/Log/Test/DummyTest.php
deleted file mode 100644
index 9638c1101..000000000
--- a/lib/Google/vendor/psr/log/Psr/Log/Test/DummyTest.php
+++ /dev/null
@@ -1,18 +0,0 @@
- ".
- *
- * Example ->error('Foo') would yield "error Foo".
- *
- * @return string[]
- */
- abstract public function getLogs();
-
- public function testImplements()
- {
- $this->assertInstanceOf('Psr\Log\LoggerInterface', $this->getLogger());
- }
-
- /**
- * @dataProvider provideLevelsAndMessages
- */
- public function testLogsAtAllLevels($level, $message)
- {
- $logger = $this->getLogger();
- $logger->{$level}($message, array('user' => 'Bob'));
- $logger->log($level, $message, array('user' => 'Bob'));
-
- $expected = array(
- $level.' message of level '.$level.' with context: Bob',
- $level.' message of level '.$level.' with context: Bob',
- );
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function provideLevelsAndMessages()
- {
- return array(
- LogLevel::EMERGENCY => array(LogLevel::EMERGENCY, 'message of level emergency with context: {user}'),
- LogLevel::ALERT => array(LogLevel::ALERT, 'message of level alert with context: {user}'),
- LogLevel::CRITICAL => array(LogLevel::CRITICAL, 'message of level critical with context: {user}'),
- LogLevel::ERROR => array(LogLevel::ERROR, 'message of level error with context: {user}'),
- LogLevel::WARNING => array(LogLevel::WARNING, 'message of level warning with context: {user}'),
- LogLevel::NOTICE => array(LogLevel::NOTICE, 'message of level notice with context: {user}'),
- LogLevel::INFO => array(LogLevel::INFO, 'message of level info with context: {user}'),
- LogLevel::DEBUG => array(LogLevel::DEBUG, 'message of level debug with context: {user}'),
- );
- }
-
- /**
- * @expectedException \Psr\Log\InvalidArgumentException
- */
- public function testThrowsOnInvalidLevel()
- {
- $logger = $this->getLogger();
- $logger->log('invalid level', 'Foo');
- }
-
- public function testContextReplacement()
- {
- $logger = $this->getLogger();
- $logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar'));
-
- $expected = array('info {Message {nothing} Bob Bar a}');
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function testObjectCastToString()
- {
- if (method_exists($this, 'createPartialMock')) {
- $dummy = $this->createPartialMock('Psr\Log\Test\DummyTest', array('__toString'));
- } else {
- $dummy = $this->getMock('Psr\Log\Test\DummyTest', array('__toString'));
- }
- $dummy->expects($this->once())
- ->method('__toString')
- ->will($this->returnValue('DUMMY'));
-
- $this->getLogger()->warning($dummy);
-
- $expected = array('warning DUMMY');
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function testContextCanContainAnything()
- {
- $closed = fopen('php://memory', 'r');
- fclose($closed);
-
- $context = array(
- 'bool' => true,
- 'null' => null,
- 'string' => 'Foo',
- 'int' => 0,
- 'float' => 0.5,
- 'nested' => array('with object' => new DummyTest),
- 'object' => new \DateTime,
- 'resource' => fopen('php://memory', 'r'),
- 'closed' => $closed,
- );
-
- $this->getLogger()->warning('Crazy context data', $context);
-
- $expected = array('warning Crazy context data');
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function testContextExceptionKeyCanBeExceptionOrOtherValues()
- {
- $logger = $this->getLogger();
- $logger->warning('Random message', array('exception' => 'oops'));
- $logger->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail')));
-
- $expected = array(
- 'warning Random message',
- 'critical Uncaught Exception!'
- );
- $this->assertEquals($expected, $this->getLogs());
- }
-}
diff --git a/lib/Google/vendor/psr/log/Psr/Log/Test/TestLogger.php b/lib/Google/vendor/psr/log/Psr/Log/Test/TestLogger.php
deleted file mode 100644
index 1be323049..000000000
--- a/lib/Google/vendor/psr/log/Psr/Log/Test/TestLogger.php
+++ /dev/null
@@ -1,147 +0,0 @@
- $level,
- 'message' => $message,
- 'context' => $context,
- ];
-
- $this->recordsByLevel[$record['level']][] = $record;
- $this->records[] = $record;
- }
-
- public function hasRecords($level)
- {
- return isset($this->recordsByLevel[$level]);
- }
-
- public function hasRecord($record, $level)
- {
- if (is_string($record)) {
- $record = ['message' => $record];
- }
- return $this->hasRecordThatPasses(function ($rec) use ($record) {
- if ($rec['message'] !== $record['message']) {
- return false;
- }
- if (isset($record['context']) && $rec['context'] !== $record['context']) {
- return false;
- }
- return true;
- }, $level);
- }
-
- public function hasRecordThatContains($message, $level)
- {
- return $this->hasRecordThatPasses(function ($rec) use ($message) {
- return strpos($rec['message'], $message) !== false;
- }, $level);
- }
-
- public function hasRecordThatMatches($regex, $level)
- {
- return $this->hasRecordThatPasses(function ($rec) use ($regex) {
- return preg_match($regex, $rec['message']) > 0;
- }, $level);
- }
-
- public function hasRecordThatPasses(callable $predicate, $level)
- {
- if (!isset($this->recordsByLevel[$level])) {
- return false;
- }
- foreach ($this->recordsByLevel[$level] as $i => $rec) {
- if (call_user_func($predicate, $rec, $i)) {
- return true;
- }
- }
- return false;
- }
-
- public function __call($method, $args)
- {
- if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) {
- $genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3];
- $level = strtolower($matches[2]);
- if (method_exists($this, $genericMethod)) {
- $args[] = $level;
- return call_user_func_array([$this, $genericMethod], $args);
- }
- }
- throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()');
- }
-
- public function reset()
- {
- $this->records = [];
- $this->recordsByLevel = [];
- }
-}
diff --git a/lib/Google/vendor/psr/log/composer.json b/lib/Google/vendor/psr/log/composer.json
index ca0569537..879fc6f53 100644
--- a/lib/Google/vendor/psr/log/composer.json
+++ b/lib/Google/vendor/psr/log/composer.json
@@ -11,16 +11,16 @@
}
],
"require": {
- "php": ">=5.3.0"
+ "php": ">=8.0.0"
},
"autoload": {
"psr-4": {
- "Psr\\Log\\": "Psr/Log/"
+ "Psr\\Log\\": "src"
}
},
"extra": {
"branch-alias": {
- "dev-master": "1.1.x-dev"
+ "dev-master": "3.x-dev"
}
}
}
diff --git a/lib/Google/vendor/psr/log/src/AbstractLogger.php b/lib/Google/vendor/psr/log/src/AbstractLogger.php
new file mode 100644
index 000000000..d60a091af
--- /dev/null
+++ b/lib/Google/vendor/psr/log/src/AbstractLogger.php
@@ -0,0 +1,15 @@
+logger = $logger;
}
diff --git a/lib/Google/vendor/psr/log/Psr/Log/LoggerInterface.php b/lib/Google/vendor/psr/log/src/LoggerInterface.php
similarity index 63%
rename from lib/Google/vendor/psr/log/Psr/Log/LoggerInterface.php
rename to lib/Google/vendor/psr/log/src/LoggerInterface.php
index 2206cfde4..cb4cf648b 100644
--- a/lib/Google/vendor/psr/log/Psr/Log/LoggerInterface.php
+++ b/lib/Google/vendor/psr/log/src/LoggerInterface.php
@@ -22,12 +22,9 @@ interface LoggerInterface
/**
* System is unusable.
*
- * @param string $message
* @param mixed[] $context
- *
- * @return void
*/
- public function emergency($message, array $context = array());
+ public function emergency(string|\Stringable $message, array $context = []): void;
/**
* Action must be taken immediately.
@@ -35,35 +32,26 @@ public function emergency($message, array $context = array());
* Example: Entire website down, database unavailable, etc. This should
* trigger the SMS alerts and wake you up.
*
- * @param string $message
* @param mixed[] $context
- *
- * @return void
*/
- public function alert($message, array $context = array());
+ public function alert(string|\Stringable $message, array $context = []): void;
/**
* Critical conditions.
*
* Example: Application component unavailable, unexpected exception.
*
- * @param string $message
* @param mixed[] $context
- *
- * @return void
*/
- public function critical($message, array $context = array());
+ public function critical(string|\Stringable $message, array $context = []): void;
/**
* Runtime errors that do not require immediate action but should typically
* be logged and monitored.
*
- * @param string $message
* @param mixed[] $context
- *
- * @return void
*/
- public function error($message, array $context = array());
+ public function error(string|\Stringable $message, array $context = []): void;
/**
* Exceptional occurrences that are not errors.
@@ -71,55 +59,40 @@ public function error($message, array $context = array());
* Example: Use of deprecated APIs, poor use of an API, undesirable things
* that are not necessarily wrong.
*
- * @param string $message
* @param mixed[] $context
- *
- * @return void
*/
- public function warning($message, array $context = array());
+ public function warning(string|\Stringable $message, array $context = []): void;
/**
* Normal but significant events.
*
- * @param string $message
* @param mixed[] $context
- *
- * @return void
*/
- public function notice($message, array $context = array());
+ public function notice(string|\Stringable $message, array $context = []): void;
/**
* Interesting events.
*
* Example: User logs in, SQL logs.
*
- * @param string $message
* @param mixed[] $context
- *
- * @return void
*/
- public function info($message, array $context = array());
+ public function info(string|\Stringable $message, array $context = []): void;
/**
* Detailed debug information.
*
- * @param string $message
* @param mixed[] $context
- *
- * @return void
*/
- public function debug($message, array $context = array());
+ public function debug(string|\Stringable $message, array $context = []): void;
/**
* Logs with an arbitrary level.
*
- * @param mixed $level
- * @param string $message
+ * @param mixed $level
* @param mixed[] $context
*
- * @return void
- *
* @throws \Psr\Log\InvalidArgumentException
*/
- public function log($level, $message, array $context = array());
+ public function log($level, string|\Stringable $message, array $context = []): void;
}
diff --git a/lib/Google/vendor/psr/log/Psr/Log/LoggerTrait.php b/lib/Google/vendor/psr/log/src/LoggerTrait.php
similarity index 57%
rename from lib/Google/vendor/psr/log/Psr/Log/LoggerTrait.php
rename to lib/Google/vendor/psr/log/src/LoggerTrait.php
index e392fef0a..a5d9980b6 100644
--- a/lib/Google/vendor/psr/log/Psr/Log/LoggerTrait.php
+++ b/lib/Google/vendor/psr/log/src/LoggerTrait.php
@@ -14,13 +14,8 @@ trait LoggerTrait
{
/**
* System is unusable.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
*/
- public function emergency($message, array $context = array())
+ public function emergency(string|\Stringable $message, array $context = []): void
{
$this->log(LogLevel::EMERGENCY, $message, $context);
}
@@ -30,13 +25,8 @@ public function emergency($message, array $context = array())
*
* Example: Entire website down, database unavailable, etc. This should
* trigger the SMS alerts and wake you up.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
*/
- public function alert($message, array $context = array())
+ public function alert(string|\Stringable $message, array $context = []): void
{
$this->log(LogLevel::ALERT, $message, $context);
}
@@ -45,13 +35,8 @@ public function alert($message, array $context = array())
* Critical conditions.
*
* Example: Application component unavailable, unexpected exception.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
*/
- public function critical($message, array $context = array())
+ public function critical(string|\Stringable $message, array $context = []): void
{
$this->log(LogLevel::CRITICAL, $message, $context);
}
@@ -59,13 +44,8 @@ public function critical($message, array $context = array())
/**
* Runtime errors that do not require immediate action but should typically
* be logged and monitored.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
*/
- public function error($message, array $context = array())
+ public function error(string|\Stringable $message, array $context = []): void
{
$this->log(LogLevel::ERROR, $message, $context);
}
@@ -75,26 +55,16 @@ public function error($message, array $context = array())
*
* Example: Use of deprecated APIs, poor use of an API, undesirable things
* that are not necessarily wrong.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
*/
- public function warning($message, array $context = array())
+ public function warning(string|\Stringable $message, array $context = []): void
{
$this->log(LogLevel::WARNING, $message, $context);
}
/**
* Normal but significant events.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
*/
- public function notice($message, array $context = array())
+ public function notice(string|\Stringable $message, array $context = []): void
{
$this->log(LogLevel::NOTICE, $message, $context);
}
@@ -103,26 +73,16 @@ public function notice($message, array $context = array())
* Interesting events.
*
* Example: User logs in, SQL logs.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
*/
- public function info($message, array $context = array())
+ public function info(string|\Stringable $message, array $context = []): void
{
$this->log(LogLevel::INFO, $message, $context);
}
/**
* Detailed debug information.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
*/
- public function debug($message, array $context = array())
+ public function debug(string|\Stringable $message, array $context = []): void
{
$this->log(LogLevel::DEBUG, $message, $context);
}
@@ -130,13 +90,9 @@ public function debug($message, array $context = array())
/**
* Logs with an arbitrary level.
*
- * @param mixed $level
- * @param string $message
- * @param array $context
- *
- * @return void
+ * @param mixed $level
*
* @throws \Psr\Log\InvalidArgumentException
*/
- abstract public function log($level, $message, array $context = array());
+ abstract public function log($level, string|\Stringable $message, array $context = []): void;
}
diff --git a/lib/Google/vendor/psr/log/Psr/Log/NullLogger.php b/lib/Google/vendor/psr/log/src/NullLogger.php
similarity index 74%
rename from lib/Google/vendor/psr/log/Psr/Log/NullLogger.php
rename to lib/Google/vendor/psr/log/src/NullLogger.php
index c8f7293b1..de0561e2a 100644
--- a/lib/Google/vendor/psr/log/Psr/Log/NullLogger.php
+++ b/lib/Google/vendor/psr/log/src/NullLogger.php
@@ -15,15 +15,11 @@ class NullLogger extends AbstractLogger
/**
* Logs with an arbitrary level.
*
- * @param mixed $level
- * @param string $message
- * @param array $context
- *
- * @return void
+ * @param mixed[] $context
*
* @throws \Psr\Log\InvalidArgumentException
*/
- public function log($level, $message, array $context = array())
+ public function log($level, string|\Stringable $message, array $context = []): void
{
// noop
}
diff --git a/lib/Google/vendor/symfony/polyfill-php81/composer.json b/lib/Google/vendor/symfony/polyfill-php81/composer.json
index 381af79ac..28b6408ea 100644
--- a/lib/Google/vendor/symfony/polyfill-php81/composer.json
+++ b/lib/Google/vendor/symfony/polyfill-php81/composer.json
@@ -16,7 +16,7 @@
}
],
"require": {
- "php": ">=7.1"
+ "php": ">=7.2"
},
"autoload": {
"psr-4": { "Symfony\\Polyfill\\Php81\\": "" },
diff --git a/lib/classes/class-gs-client.php b/lib/classes/class-gs-client.php
index 3426fa924..e025ed4e5 100644
--- a/lib/classes/class-gs-client.php
+++ b/lib/classes/class-gs-client.php
@@ -189,10 +189,11 @@ public function add_media($args = array()) {
'mimeType' => 'image/jpeg',
'metadata' => array(),
'is_webp' => '',
+ 'skipLocalCheck' => false,
));
/* Be sure file exists. */
- if (!file_exists($args['absolutePath'])) {
+ if (!$args['skipLocalCheck'] && !file_exists($args['absolutePath'])) {
return new \WP_Error('sm_error', __('Unable to locate file on disk', ud_get_stateless_media()->domain));
}
diff --git a/lib/classes/class-module.php b/lib/classes/class-module.php
index 8f5cb9a1c..8d7653247 100644
--- a/lib/classes/class-module.php
+++ b/lib/classes/class-module.php
@@ -40,11 +40,6 @@ public function __construct() {
*/
new LearnDash();
- /**
- * Support for Polylang Pro
- */
- new Polylang();
-
/**
* Support for ShortPixel
*/
diff --git a/lib/classes/class-sync-non-media.php b/lib/classes/class-sync-non-media.php
index 3c61ba845..5f4490554 100644
--- a/lib/classes/class-sync-non-media.php
+++ b/lib/classes/class-sync-non-media.php
@@ -75,7 +75,7 @@ public function add_file($media, $status = self::STATUS_QUEUED) {
* 2 (int): Force to overwrite on GCS
* @param array $args
* @return bool|void $media: Media object returned from client->add_media() method.
- * @throws: Exception File not found@throws: Exception File not found
+ * @throws: Exception File not found
*/
public function sync_file($name, $absolutePath, $forced = false, $args = array()) {
$sm_mode = ud_get_stateless_media()->get('sm.mode');
diff --git a/lib/classes/class-utility.php b/lib/classes/class-utility.php
index 8a33be7f4..d4f0d23e3 100644
--- a/lib/classes/class-utility.php
+++ b/lib/classes/class-utility.php
@@ -130,17 +130,13 @@ public static function getCacheControl($attachment_id = null, $metadata = array(
$_mime_type = get_post_mime_type($attachment_id);
- // Treat images as public.
- if (strpos($_mime_type, 'image/') !== false) {
- return apply_filters('sm:item:cacheControl', ud_get_stateless_media()->get_default_cache_control(), array('attachment_id' => $attachment_id, 'mime_type' => null, 'metadata' => $metadata, 'data' => $data));
- }
-
- // Treat images as public.
+ // Treat SQL as non-public.
if (strpos($_mime_type, 'sql') !== false) {
return apply_filters('sm:item:cacheControl', 'private, no-cache, no-store', array('attachment_id' => $attachment_id, 'mime_type' => null, 'metadata' => $metadata, 'data' => $data));
}
- return apply_filters('sm:item:cacheControl', 'public, max-age=30, no-store, must-revalidate', array('attachment_id' => $attachment_id, 'mime_type' => null, 'metadata' => $metadata, 'data' => $data));
+ // Treat all other files as public.
+ return apply_filters('sm:item:cacheControl', ud_get_stateless_media()->get_default_cache_control(), array('attachment_id' => $attachment_id, 'mime_type' => null, 'metadata' => $metadata, 'data' => $data));
}
/**
diff --git a/lib/classes/compatibility/polylang-pro.php b/lib/classes/compatibility/polylang-pro.php
deleted file mode 100644
index 7907d3092..000000000
--- a/lib/classes/compatibility/polylang-pro.php
+++ /dev/null
@@ -1,169 +0,0 @@
-get_stateless_meta($attachment_id);
-
- if ( !empty($cloud_meta) ) {
- // Need to update cloud meta for both original attachment
- update_post_meta($attachment_id, 'sm_cloud', wp_slash($cloud_meta));
- // Update duplicated attachment meta
- update_post_meta($tr_id, 'sm_cloud', wp_slash($cloud_meta));
- }
-
- // Duplicate WP Stateless data for the new attachment and sizes
- $data = $this->get_stateless_data($attachment_id);
-
- if ( !empty($data) ) {
- try {
- foreach ( [$attachment_id, $tr_id] as $id ) {
- do_action('wp_stateless_set_file', $id, $data['file']);
-
- $sizes = $data['sizes'] ?? [];
-
- foreach ($sizes as $name => $size) {
- do_action('wp_stateless_set_file_size', $id, $name, $size);
- }
-
- $meta = $data['meta'] ?? [];
-
- foreach ($meta as $key => $value) {
- do_action('wp_stateless_set_file_meta', $id, $key, $value);
- }
- }
- } catch (\Throwable $e) {
- error_log( $e->getMessage() );
- }
- }
-
- return $metadata;
- }, 10, 4);
- }
- }
- }
-}
diff --git a/lib/cli/class-sm-cli-command.php b/lib/cli/class-sm-cli-command.php
index 5b9f63ccf..9ab5891d4 100644
--- a/lib/cli/class-sm-cli-command.php
+++ b/lib/cli/class-sm-cli-command.php
@@ -322,6 +322,60 @@ public function migrate($args, $assoc_args) {
}
}
+ /**
+ * Sets cacheControl meta for all files on Google Cloud Storage to the default value from WP-Stateless settings.
+ *
+ * ## OPTIONS
+ *
+ * --url
+ * : Blog URL if multisite installation.
+ *
+ * ## EXAMPLES
+ *
+ * wp stateless reset_cache_control
+ * : Sync cache control for all files on Google Cloud Storage.
+ *
+ * @synopsis [--url=]
+ * @param $args
+ * @param $assoc_args
+ */
+ public function reset_cache_control($args, $assoc_args) {
+ $sm_mode = ud_get_stateless_media()->get('sm.mode');
+ if ( ud_get_stateless_media()->is_mode('stateless') ) {
+ WP_CLI::error('Sync cache control is not supported in Stateless mode');
+ }
+
+ global $wpdb;
+
+ $gs_client = ud_get_stateless_media()->get_client();
+ $cache_control = ud_get_stateless_media()->get_default_cache_control();
+ $cache_control = apply_filters('sm:item:cacheControl', ud_get_stateless_media()->get_default_cache_control() );
+
+ $table_name = ud_stateless_db()->files;
+ $names = $wpdb->get_col("
+ SELECT name
+ FROM {$table_name}
+ WHERE post_id IS NOT NULL
+ ");
+
+ foreach ($names as $name) {
+ if ( !$gs_client->media_exists($name) ) {
+ continue;
+ }
+
+ $args = [
+ 'skipLocalCheck' => true,
+ 'force' => false,
+ 'cacheControl' => $cache_control,
+ 'name' => $name,
+ ];
+
+ $gs_client->add_media($args);
+
+ WP_CLI::line("Processed file: '{$name}'");
+ }
+ }
+
/**
* Run all pending migrations
*
diff --git a/readme.txt b/readme.txt
index e491947b6..edfeab028 100644
--- a/readme.txt
+++ b/readme.txt
@@ -6,7 +6,7 @@ License: GPLv2 or later
Requires PHP: 8.0
Requires at least: 5.0
Tested up to: 6.6.2
-Stable tag: 4.1.2
+Stable tag: 4.1.3-RC1
Upload and serve your WordPress media files from Google Cloud Storage.
@@ -134,6 +134,13 @@ Before upgrading to WP-Stateless 3.2.0, please, make sure you use PHP 7.2 or abo
Before upgrading to WP-Stateless 3.0, please, make sure you tested it on your development environment.
== Changelog ==
+= 4.1.3-RC1 =
+* COMPATIBILITY - PolyLang Compatibility replaced with [WP-Stateless – Polylang Pro Addon](https://wordpress.org/plugins/wp-stateless-polylang-pro-addon/).
+* ENHANCEMENT - updated `firebase/php-jwt` library from from 6.10.1 to 6.10.2.
+* ENHANCEMENT - updated `wpmetabox/meta-box` library from from 5.10.1 to 5.10.2.
+* ENHANCEMENT - Updated Client library for Google APIs from 2.17.0 to 2.18.2.
+* FIX - apply `Cache Control` setting to all files (previously applied only to images).
+
= 4.1.2 =
* ENHANCEMENT - added `REST API Endpoint` setting, which useful when WordPress dashboard and frontend website utilize different domain names.
* ENHANCEMENT - extended `Status Info` with the information to help diagnose REST API or AJAX issues.
diff --git a/static/data/addons.php b/static/data/addons.php
index 50864e346..a5e1d6fca 100644
--- a/static/data/addons.php
+++ b/static/data/addons.php
@@ -24,7 +24,7 @@
'buddyboss' => [
'title' => 'BuddyBoss Platform',
'plugin_files' => ['buddyboss-platform/bp-loader.php'],
- 'addon_file' => 'wp-stateless-buddyboss-addon/wp-stateless-buddyboss-addon.php',
+ 'addon_file' => 'wp-stateless-buddyboss-platform-addon/wp-stateless-buddyboss-addon.php',
'icon' => 'https://www.buddyboss.com/wp-content/uploads/2022/04/bb-logo-1.png',
'repo' => 'udx/wp-stateless-buddyboss-addon',
'wp' => 'https://wordpress.org/plugins/wp-stateless-buddyboss-platform-addon/',
@@ -35,8 +35,8 @@
'elementor' => [
'title' => 'Elementor Website Builder',
'plugin_files' => ['elementor/elementor.php'],
- 'addon_file' => 'wp-stateless-elementor-addon/wp-stateless-elementor-addon.php',
- 'icon' => 'https://ps.w.org/elementor/assets/icon.svg',
+ 'addon_file' => 'wp-stateless-elementor-website-builder-addon/wp-stateless-elementor-addon.php',
+ 'icon' => 'https://ps.w.org/elementor/assets/icon-128x128.gif',
'repo' => 'udx/wp-stateless-elementor-website-builder-addon',
'wp' => 'https://wordpress.org/plugins/wp-stateless-elementor-website-builder-addon/',
'hubspot_id' => '151481399819',
@@ -147,4 +147,14 @@
'hubspot_id' => '151478250924',
],
+ 'polylang' => [
+ 'title' => 'PolyLang Pro',
+ 'plugin_files' => ['polylang-pro/polylang.php'],
+ 'addon_file' => 'wp-stateless-polylang-pro-addon/wp-stateless-polylang-pro-addon.php',
+ 'icon' => 'https://ps.w.org/buddypress/assets/icon.svg',
+ 'repo' => 'udx/wp-stateless-polylang-pro-addon',
+ 'wp' => 'https://wordpress.org/plugins/wp-stateless-polylang-pro-addon/',
+ 'hubspot_id' => '151478250876',
+ ],
+
];
diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php
index 36a229ea4..e5103e860 100644
--- a/vendor/composer/autoload_classmap.php
+++ b/vendor/composer/autoload_classmap.php
@@ -53,7 +53,6 @@
'wpCloud\\StatelessMedia\\Logger' => $baseDir . '/lib/classes/class-logger.php',
'wpCloud\\StatelessMedia\\Migrator' => $baseDir . '/lib/classes/class-migrator.php',
'wpCloud\\StatelessMedia\\Module' => $baseDir . '/lib/classes/class-module.php',
- 'wpCloud\\StatelessMedia\\Polylang' => $baseDir . '/lib/classes/compatibility/polylang-pro.php',
'wpCloud\\StatelessMedia\\Settings' => $baseDir . '/lib/classes/class-settings.php',
'wpCloud\\StatelessMedia\\ShortPixel' => $baseDir . '/lib/classes/compatibility/shortpixel.php',
'wpCloud\\StatelessMedia\\SimpleLocalAvatars' => $baseDir . '/lib/classes/compatibility/simple-local-avatars.php',
diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php
index 24d5e4744..03ad779a6 100644
--- a/vendor/composer/autoload_static.php
+++ b/vendor/composer/autoload_static.php
@@ -94,7 +94,6 @@ class ComposerStaticInitc59d002476a452800baaf79c430753cb
'wpCloud\\StatelessMedia\\Logger' => __DIR__ . '/../..' . '/lib/classes/class-logger.php',
'wpCloud\\StatelessMedia\\Migrator' => __DIR__ . '/../..' . '/lib/classes/class-migrator.php',
'wpCloud\\StatelessMedia\\Module' => __DIR__ . '/../..' . '/lib/classes/class-module.php',
- 'wpCloud\\StatelessMedia\\Polylang' => __DIR__ . '/../..' . '/lib/classes/compatibility/polylang-pro.php',
'wpCloud\\StatelessMedia\\Settings' => __DIR__ . '/../..' . '/lib/classes/class-settings.php',
'wpCloud\\StatelessMedia\\ShortPixel' => __DIR__ . '/../..' . '/lib/classes/compatibility/shortpixel.php',
'wpCloud\\StatelessMedia\\SimpleLocalAvatars' => __DIR__ . '/../..' . '/lib/classes/compatibility/simple-local-avatars.php',
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index 30493e29a..bf6f22bcb 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -197,17 +197,17 @@
},
{
"name": "firebase/php-jwt",
- "version": "v6.10.1",
- "version_normalized": "6.10.1.0",
+ "version": "v6.10.2",
+ "version_normalized": "6.10.2.0",
"source": {
"type": "git",
"url": "https://github.com/firebase/php-jwt.git",
- "reference": "500501c2ce893c824c801da135d02661199f60c5"
+ "reference": "30c19ed0f3264cb660ea496895cfb6ef7ee3653b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/firebase/php-jwt/zipball/500501c2ce893c824c801da135d02661199f60c5",
- "reference": "500501c2ce893c824c801da135d02661199f60c5",
+ "url": "https://api.github.com/repos/firebase/php-jwt/zipball/30c19ed0f3264cb660ea496895cfb6ef7ee3653b",
+ "reference": "30c19ed0f3264cb660ea496895cfb6ef7ee3653b",
"shasum": ""
},
"require": {
@@ -225,7 +225,7 @@
"ext-sodium": "Support EdDSA (Ed25519) signatures",
"paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present"
},
- "time": "2024-05-18T18:05:11+00:00",
+ "time": "2024-11-24T11:22:49+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -257,7 +257,7 @@
],
"support": {
"issues": "https://github.com/firebase/php-jwt/issues",
- "source": "https://github.com/firebase/php-jwt/tree/v6.10.1"
+ "source": "https://github.com/firebase/php-jwt/tree/v6.10.2"
},
"install-path": "../firebase/php-jwt"
},
@@ -345,23 +345,23 @@
},
{
"name": "wpmetabox/meta-box",
- "version": "5.10.1",
- "version_normalized": "5.10.1.0",
+ "version": "5.10.2",
+ "version_normalized": "5.10.2.0",
"source": {
"type": "git",
"url": "https://github.com/wpmetabox/meta-box.git",
- "reference": "6f571c95c2928703509f60de09be9c3d6df8ce0a"
+ "reference": "c28a96abe84cff63e3cec0e6c9d525602212c998"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/wpmetabox/meta-box/zipball/6f571c95c2928703509f60de09be9c3d6df8ce0a",
- "reference": "6f571c95c2928703509f60de09be9c3d6df8ce0a",
+ "url": "https://api.github.com/repos/wpmetabox/meta-box/zipball/c28a96abe84cff63e3cec0e6c9d525602212c998",
+ "reference": "c28a96abe84cff63e3cec0e6c9d525602212c998",
"shasum": ""
},
"require-dev": {
"phpunit/phpunit": "^11.3"
},
- "time": "2024-09-07T03:49:09+00:00",
+ "time": "2024-09-26T09:55:59+00:00",
"type": "wordpress-plugin",
"installation-source": "dist",
"autoload": {
@@ -394,7 +394,7 @@
],
"support": {
"issues": "https://github.com/wpmetabox/meta-box/issues",
- "source": "https://github.com/wpmetabox/meta-box/tree/5.10.1"
+ "source": "https://github.com/wpmetabox/meta-box/tree/5.10.2"
},
"install-path": "../wpmetabox/meta-box"
}
diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php
index 3d68e4eeb..ad178f889 100644
--- a/vendor/composer/installed.php
+++ b/vendor/composer/installed.php
@@ -3,7 +3,7 @@
'name' => 'wpcloud/wp-stateless',
'pretty_version' => 'dev-latest',
'version' => 'dev-latest',
- 'reference' => '569840f24fbf6a2bd955d80a2786f7f30b45ad00',
+ 'reference' => '54228ff36c4c90767fc38fa85e7e941c83daa950',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -29,9 +29,9 @@
'dev_requirement' => false,
),
'firebase/php-jwt' => array(
- 'pretty_version' => 'v6.10.1',
- 'version' => '6.10.1.0',
- 'reference' => '500501c2ce893c824c801da135d02661199f60c5',
+ 'pretty_version' => 'v6.10.2',
+ 'version' => '6.10.2.0',
+ 'reference' => '30c19ed0f3264cb660ea496895cfb6ef7ee3653b',
'type' => 'library',
'install_path' => __DIR__ . '/../firebase/php-jwt',
'aliases' => array(),
@@ -58,16 +58,16 @@
'wpcloud/wp-stateless' => array(
'pretty_version' => 'dev-latest',
'version' => 'dev-latest',
- 'reference' => '569840f24fbf6a2bd955d80a2786f7f30b45ad00',
+ 'reference' => '54228ff36c4c90767fc38fa85e7e941c83daa950',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev_requirement' => false,
),
'wpmetabox/meta-box' => array(
- 'pretty_version' => '5.10.1',
- 'version' => '5.10.1.0',
- 'reference' => '6f571c95c2928703509f60de09be9c3d6df8ce0a',
+ 'pretty_version' => '5.10.2',
+ 'version' => '5.10.2.0',
+ 'reference' => 'c28a96abe84cff63e3cec0e6c9d525602212c998',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../wpmetabox/meta-box',
'aliases' => array(),
diff --git a/vendor/firebase/php-jwt/CHANGELOG.md b/vendor/firebase/php-jwt/CHANGELOG.md
index 2662b0502..5feeb5a67 100644
--- a/vendor/firebase/php-jwt/CHANGELOG.md
+++ b/vendor/firebase/php-jwt/CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog
+## [6.10.2](https://github.com/firebase/php-jwt/compare/v6.10.1...v6.10.2) (2024-11-24)
+
+
+### Bug Fixes
+
+* Mitigate PHP8.4 deprecation warnings ([#570](https://github.com/firebase/php-jwt/issues/570)) ([76808fa](https://github.com/firebase/php-jwt/commit/76808fa227f3811aa5cdb3bf81233714b799a5b5))
+* support php 8.4 ([#583](https://github.com/firebase/php-jwt/issues/583)) ([e3d68b0](https://github.com/firebase/php-jwt/commit/e3d68b044421339443c74199edd020e03fb1887e))
+
## [6.10.1](https://github.com/firebase/php-jwt/compare/v6.10.0...v6.10.1) (2024-05-18)
diff --git a/vendor/firebase/php-jwt/src/CachedKeySet.php b/vendor/firebase/php-jwt/src/CachedKeySet.php
index 65bab74f2..8e8e8d68c 100644
--- a/vendor/firebase/php-jwt/src/CachedKeySet.php
+++ b/vendor/firebase/php-jwt/src/CachedKeySet.php
@@ -80,9 +80,9 @@ public function __construct(
ClientInterface $httpClient,
RequestFactoryInterface $httpFactory,
CacheItemPoolInterface $cache,
- int $expiresAfter = null,
+ ?int $expiresAfter = null,
bool $rateLimit = false,
- string $defaultAlg = null
+ ?string $defaultAlg = null
) {
$this->jwksUri = $jwksUri;
$this->httpClient = $httpClient;
@@ -180,7 +180,7 @@ private function keyIdExists(string $keyId): bool
$jwksResponse = $this->httpClient->sendRequest($request);
if ($jwksResponse->getStatusCode() !== 200) {
throw new UnexpectedValueException(
- sprintf('HTTP Error: %d %s for URI "%s"',
+ \sprintf('HTTP Error: %d %s for URI "%s"',
$jwksResponse->getStatusCode(),
$jwksResponse->getReasonPhrase(),
$this->jwksUri,
diff --git a/vendor/firebase/php-jwt/src/JWK.php b/vendor/firebase/php-jwt/src/JWK.php
index 63fb2484b..6efc2fe38 100644
--- a/vendor/firebase/php-jwt/src/JWK.php
+++ b/vendor/firebase/php-jwt/src/JWK.php
@@ -52,7 +52,7 @@ class JWK
*
* @uses parseKey
*/
- public static function parseKeySet(array $jwks, string $defaultAlg = null): array
+ public static function parseKeySet(array $jwks, ?string $defaultAlg = null): array
{
$keys = [];
@@ -93,7 +93,7 @@ public static function parseKeySet(array $jwks, string $defaultAlg = null): arra
*
* @uses createPemFromModulusAndExponent
*/
- public static function parseKey(array $jwk, string $defaultAlg = null): ?Key
+ public static function parseKey(array $jwk, ?string $defaultAlg = null): ?Key
{
if (empty($jwk)) {
throw new InvalidArgumentException('JWK must not be empty');
@@ -212,7 +212,7 @@ private static function createPemFromCrvAndXYCoordinates(string $crv, string $x,
)
);
- return sprintf(
+ return \sprintf(
"-----BEGIN PUBLIC KEY-----\n%s\n-----END PUBLIC KEY-----\n",
wordwrap(base64_encode($pem), 64, "\n", true)
);
diff --git a/vendor/firebase/php-jwt/src/JWT.php b/vendor/firebase/php-jwt/src/JWT.php
index e9d756398..dd9292a43 100644
--- a/vendor/firebase/php-jwt/src/JWT.php
+++ b/vendor/firebase/php-jwt/src/JWT.php
@@ -96,7 +96,7 @@ class JWT
public static function decode(
string $jwt,
$keyOrKeyArray,
- stdClass &$headers = null
+ ?stdClass &$headers = null
): stdClass {
// Validate JWT
$timestamp = \is_null(static::$timestamp) ? \time() : static::$timestamp;
@@ -200,11 +200,11 @@ public static function encode(
array $payload,
$key,
string $alg,
- string $keyId = null,
- array $head = null
+ ?string $keyId = null,
+ ?array $head = null
): string {
$header = ['typ' => 'JWT'];
- if (isset($head) && \is_array($head)) {
+ if (isset($head)) {
$header = \array_merge($header, $head);
}
$header['alg'] = $alg;
@@ -387,12 +387,7 @@ public static function jsonDecode(string $input)
*/
public static function jsonEncode(array $input): string
{
- if (PHP_VERSION_ID >= 50400) {
- $json = \json_encode($input, \JSON_UNESCAPED_SLASHES);
- } else {
- // PHP 5.3 only
- $json = \json_encode($input);
- }
+ $json = \json_encode($input, \JSON_UNESCAPED_SLASHES);
if ($errno = \json_last_error()) {
self::handleJsonError($errno);
} elseif ($json === 'null') {
diff --git a/vendor/wpmetabox/meta-box/css/input-list.css b/vendor/wpmetabox/meta-box/css/input-list.css
index 73cf26d83..787d795bc 100644
--- a/vendor/wpmetabox/meta-box/css/input-list.css
+++ b/vendor/wpmetabox/meta-box/css/input-list.css
@@ -4,6 +4,9 @@
.rwmb-input-list {
line-height: 1.8;
}
+.rwmb-input-list.hidden {
+ display: none;
+}
.rwmb-input-list .rwmb-input-list {
margin-left: 20px;
}
diff --git a/vendor/wpmetabox/meta-box/inc/clone.php b/vendor/wpmetabox/meta-box/inc/clone.php
index 842098745..c19e21804 100644
--- a/vendor/wpmetabox/meta-box/inc/clone.php
+++ b/vendor/wpmetabox/meta-box/inc/clone.php
@@ -6,17 +6,27 @@ class RWMB_Clone {
public static function html( array $meta, array $field ) : string {
$field_html = '';
+ $count = count( $meta );
foreach ( $meta as $index => $sub_meta ) {
$sub_field = $field;
$sub_field['field_name'] = $field['field_name'] . "[{$index}]";
- if ( $index > 0 ) {
+
+ if ( $index === 0 && $count > 1 ) {
+ $sub_field['attributes']['id'] = $field['id'] . "_rwmb_template";
+ }
+
+ if ( $index === 1 ) {
+ $sub_field['attributes']['id'] = $field['id'];
+ }
+
+ if ( $index > 1 ) {
if ( isset( $sub_field['address_field'] ) ) {
$sub_field['address_field'] = $field['address_field'] . "_{$index}";
}
$sub_field['id'] = $field['id'] . "_{$index}";
if ( ! empty( $sub_field['attributes']['id'] ) ) {
- $sub_field['attributes']['id'] = $sub_field['attributes']['id'] . "_{$index}";
+ $sub_field['attributes']['id'] .= "_{$index}";
}
}
@@ -67,17 +77,6 @@ public static function value( $new, $old, $object_id, array $field ) {
$new = [];
}
- $request = rwmb_request();
- $cleanup = $request->post( 'rwmb_cleanup', [] ); // Array of field ids
-
- // Remove the first item of $new because it's the template.
- // Also, check the count of $new because some fields may create another input (e.g., file).
- if ( in_array( $field['id'], $cleanup ) ) {
- if ( isset( $new[0] ) ) {
- array_shift( $new );
- }
- }
-
if ( in_array( $field['type'], [ 'file', 'image' ], true ) ) {
$new = RWMB_File_Field::clone_value( $new, $old, $object_id, $field );
} else {
diff --git a/vendor/wpmetabox/meta-box/inc/field.php b/vendor/wpmetabox/meta-box/inc/field.php
index dc5770ca6..67d1eff3f 100644
--- a/vendor/wpmetabox/meta-box/inc/field.php
+++ b/vendor/wpmetabox/meta-box/inc/field.php
@@ -37,19 +37,15 @@ public static function show( array $field, bool $saved, $post_id = 0 ) {
$field_html = self::filter( 'html', $field_html, $field, $meta );
}
- $cleanup = '';
-
- if ( $field['clone'] ) {
- $cleanup = '';
- }
-
$end = static::end_html( $field );
$end = self::filter( 'end_html', $end, $field, $meta );
- $html = self::filter( 'wrapper_html', $begin . $field_html . $cleanup . $end, $field, $meta );
+ $html = self::filter( 'wrapper_html', $begin . $field_html . $end, $field, $meta );
// Display label and input in DIV and allow user-defined classes to be appended.
$classes = "rwmb-field rwmb-{$field['type']}-wrapper " . $field['class'];
- if ( ! empty( $field['required'] ) ) {
+ $required = $field['required'] || ! empty( $field['attributes']['required'] );
+
+ if ( $required ) {
$classes .= ' required';
}
diff --git a/vendor/wpmetabox/meta-box/inc/fields/fieldset-text.php b/vendor/wpmetabox/meta-box/inc/fields/fieldset-text.php
index d339e7dd2..c9f9220b7 100644
--- a/vendor/wpmetabox/meta-box/inc/fields/fieldset-text.php
+++ b/vendor/wpmetabox/meta-box/inc/fields/fieldset-text.php
@@ -27,7 +27,7 @@ public static function html( $meta, $field ) {
}
foreach ( $field['options'] as $key => $label ) {
- $value = isset( $meta[ $key ] ) ? $meta[ $key ] : '';
+ $value = $meta[ $key ] ?? '';
$field['attributes']['name'] = $field['field_name'] . "[{$key}]";
$html[] = sprintf( $tpl, $label, parent::html( $value, $field ) );
}
diff --git a/vendor/wpmetabox/meta-box/inc/fields/taxonomy.php b/vendor/wpmetabox/meta-box/inc/fields/taxonomy.php
index 382c0397a..5ae06442e 100644
--- a/vendor/wpmetabox/meta-box/inc/fields/taxonomy.php
+++ b/vendor/wpmetabox/meta-box/inc/fields/taxonomy.php
@@ -308,6 +308,20 @@ protected static function remove_default_meta_box( array $field ) {
if ( empty( $field['remove_default'] ) || ! function_exists( 'remove_meta_box' ) ) {
return;
}
+
+ // Only run in admin.
+ if ( ! is_admin() ) {
+ return;
+ }
+
+ // Do nothing if in Ajax or Rest API.
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
+ return;
+ }
+ if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
+ return;
+ }
+
foreach ( $field['taxonomy'] as $taxonomy ) {
$id = is_taxonomy_hierarchical( $taxonomy ) ? "{$taxonomy}div" : "tagsdiv-{$taxonomy}";
remove_meta_box( $id, null, 'side' );
diff --git a/vendor/wpmetabox/meta-box/inc/loader.php b/vendor/wpmetabox/meta-box/inc/loader.php
index 85634c589..a1a092edc 100644
--- a/vendor/wpmetabox/meta-box/inc/loader.php
+++ b/vendor/wpmetabox/meta-box/inc/loader.php
@@ -7,7 +7,7 @@
class RWMB_Loader {
protected function constants() {
// Script version, used to add version for scripts and styles.
- define( 'RWMB_VER', '5.10.1' );
+ define( 'RWMB_VER', '5.10.2' );
list( $path, $url ) = self::get_path( dirname( __DIR__ ) );
diff --git a/vendor/wpmetabox/meta-box/inc/meta-box.php b/vendor/wpmetabox/meta-box/inc/meta-box.php
index bb2411431..09f99b59e 100644
--- a/vendor/wpmetabox/meta-box/inc/meta-box.php
+++ b/vendor/wpmetabox/meta-box/inc/meta-box.php
@@ -218,6 +218,7 @@ public function show() {
RWMB_Field::call( 'show', $field, $saved, $this->object_id );
}
+ $this->render_cleanup();
// Allow users to add custom code after meta box content.
// 1st action applies to all meta boxes.
// 2nd action applies to only current meta box.
@@ -228,6 +229,30 @@ public function show() {
echo '';
}
+ protected function get_cleanup_fields( $fields, $prefix = '' ) {
+ $names = [];
+
+ foreach ( $fields as $field ) {
+ $field_id = $prefix . $field['id'];
+ if ( ! empty( $field['fields'] ) ) {
+ $suffix = $field[ 'clone' ] ? '.*.' : '.';
+ $names = array_merge( $names, $this->get_cleanup_fields( $field['fields'], $field_id . $suffix ) );
+ }
+
+ if ( $field['clone'] ) {
+ $names[] = $field_id;
+ }
+ }
+
+ return $names;
+ }
+
+ protected function render_cleanup() {
+ $names = $this->get_cleanup_fields( $this->fields );
+
+ echo '';
+ }
+
/**
* Save data from meta box
*
diff --git a/vendor/wpmetabox/meta-box/inc/request.php b/vendor/wpmetabox/meta-box/inc/request.php
index 37b19ed18..f8bdd691f 100644
--- a/vendor/wpmetabox/meta-box/inc/request.php
+++ b/vendor/wpmetabox/meta-box/inc/request.php
@@ -1,4 +1,5 @@
@@ -15,6 +16,9 @@ public function __construct() {
$this->get_data = $_GET;
// @codingStandardsIgnoreLine
$this->post_data = $_POST;
+
+ // Cleanup data
+ $this->post_data = $this->cleanup( $this->post_data );
}
public function set_get_data( array $data ) {
@@ -33,6 +37,29 @@ public function post( string $name, $default = null ) {
return $this->post_data[ $name ] ?? $default;
}
+ public function cleanup( array $data ) {
+ $cleanups = $data['rwmb_cleanup'] ?? []; // Array of field ids
+ if ( empty( $cleanups ) || ! is_array( $cleanups ) ) {
+ return $data;
+ }
+
+ // Decode the JSON string for each cleanup item
+ foreach ( $cleanups as $cleanup ) {
+ $cleanup = json_decode( stripslashes( $cleanup ) );
+
+ if ( ! is_array( $cleanup ) ) {
+ continue;
+ }
+
+ foreach ( $cleanup as $field_id ) {
+ // Remove the field from the data
+ Arr::remove_first( $data, $field_id );
+ }
+ }
+
+ return $data;
+ }
+
/**
* Filter a GET parameter.
*
diff --git a/vendor/wpmetabox/meta-box/inc/walkers/select-tree.php b/vendor/wpmetabox/meta-box/inc/walkers/select-tree.php
index c12c690db..6a8037dd2 100644
--- a/vendor/wpmetabox/meta-box/inc/walkers/select-tree.php
+++ b/vendor/wpmetabox/meta-box/inc/walkers/select-tree.php
@@ -59,10 +59,20 @@ public function walk( $options ) {
* @return string
*/
public function display_level( $options, $parent_id = 0, $active = false ) {
+ static $output_required = false;
+
$field = $this->field;
$walker = new RWMB_Walker_Select( $field, $this->meta );
$attributes = RWMB_Field::call( 'get_attributes', $field, $this->meta );
+ if ( $output_required ) {
+ unset( $attributes[ 'required' ] );
+ }
+
+ if ( ! empty( $attributes['required'] ) ) {
+ $output_required = true;
+ }
+
$children = $options[ $parent_id ];
$output = sprintf(
'