mirror of
https://github.com/LDAPAccountManager/lam.git
synced 2025-10-03 17:59:21 +02:00
#441 SMS sending
This commit is contained in:
parent
484ccff114
commit
5bcc5537d4
475 changed files with 60308 additions and 33 deletions
|
@ -920,12 +920,154 @@ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||||
DAMAGES.
|
DAMAGES.
|
||||||
|
|
||||||
|
|
||||||
|
H:
|
||||||
|
Apache License 2.0
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
## 1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1
|
||||||
|
through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the
|
||||||
|
License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled
|
||||||
|
by, or are under common control with that entity. For the purposes of this definition, "control" means
|
||||||
|
(i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract
|
||||||
|
or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial
|
||||||
|
ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications, including but not limited to software
|
||||||
|
source code, documentation source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form,
|
||||||
|
including but not limited to compiled object code, generated documentation, and conversions to other media
|
||||||
|
types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License,
|
||||||
|
as indicated by a copyright notice that is included in or attached to the work (an example is provided in the
|
||||||
|
Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from)
|
||||||
|
the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent,
|
||||||
|
as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not
|
||||||
|
include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work
|
||||||
|
and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including the original version of the Work and any
|
||||||
|
modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to
|
||||||
|
Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to
|
||||||
|
submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of
|
||||||
|
electronic, verbal, or written communication sent to the Licensor or its representatives, including but not
|
||||||
|
limited to communication on electronic mailing lists, source code control systems, and issue tracking systems
|
||||||
|
that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise designated in writing by the copyright
|
||||||
|
owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been
|
||||||
|
received by Licensor and subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
## 2. Grant of Copyright License.
|
||||||
|
|
||||||
|
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare
|
||||||
|
Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such
|
||||||
|
Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
## 3. Grant of Patent License.
|
||||||
|
|
||||||
|
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent
|
||||||
|
license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such
|
||||||
|
license applies only to those patent claims licensable by such Contributor that are necessarily infringed by
|
||||||
|
their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such
|
||||||
|
Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim
|
||||||
|
or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work
|
||||||
|
constitutes direct or contributory patent infringement, then any patent licenses granted to You under this
|
||||||
|
License for that Work shall terminate as of the date such litigation is filed.
|
||||||
|
|
||||||
|
## 4. Redistribution.
|
||||||
|
|
||||||
|
You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You meet the following conditions:
|
||||||
|
|
||||||
|
1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
2. You must cause any modified files to carry prominent notices stating that You changed the files; and
|
||||||
|
|
||||||
|
3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent,
|
||||||
|
trademark, and attribution notices from the Source form of the Work, excluding those notices that do
|
||||||
|
not pertain to any part of the Derivative Works; and
|
||||||
|
|
||||||
|
4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that
|
||||||
|
You distribute must include a readable copy of the attribution notices contained within such NOTICE
|
||||||
|
file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed as part of the Derivative Works; within
|
||||||
|
the Source form or documentation, if provided along with the Derivative Works; or, within a display
|
||||||
|
generated by the Derivative Works, if and wherever such third-party notices normally appear. The
|
||||||
|
contents of the NOTICE file are for informational purposes only and do not modify the License. You may
|
||||||
|
add Your own attribution notices within Derivative Works that You distribute, alongside or as an
|
||||||
|
addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be
|
||||||
|
construed as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and may provide additional or different license
|
||||||
|
terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative
|
||||||
|
Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the
|
||||||
|
conditions stated in this License.
|
||||||
|
|
||||||
|
## 5. Submission of Contributions.
|
||||||
|
|
||||||
|
Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by
|
||||||
|
You to the Licensor shall be under the terms and conditions of this License, without any additional terms or
|
||||||
|
conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate
|
||||||
|
license agreement you may have executed with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
## 6. Trademarks.
|
||||||
|
|
||||||
|
This License does not grant permission to use the trade names, trademarks, service marks, or product names of
|
||||||
|
the Licensor, except as required for reasonable and customary use in describing the origin of the Work and
|
||||||
|
reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
## 7. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor
|
||||||
|
provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||||
|
or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,
|
||||||
|
MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of
|
||||||
|
permissions under this License.
|
||||||
|
|
||||||
|
## 8. Limitation of Liability.
|
||||||
|
|
||||||
|
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless
|
||||||
|
required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any
|
||||||
|
Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential
|
||||||
|
damages of any character arising as a result of this License or out of the use or inability to use the Work
|
||||||
|
(including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or
|
||||||
|
any and all other commercial damages or losses), even if such Contributor has been advised of the possibility
|
||||||
|
of such damages.
|
||||||
|
|
||||||
|
## 9. Accepting Warranty or Additional Liability.
|
||||||
|
|
||||||
|
While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for,
|
||||||
|
acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole
|
||||||
|
responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold
|
||||||
|
each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
|
||||||
Programs and licenses with other licenses and/or authors than the
|
Programs and licenses with other licenses and/or authors than the
|
||||||
main license and authors:
|
main license and authors:
|
||||||
|
|
||||||
graphics/webauthn.svg E 2017 Duo Security, Inc. https://github.com/duo-labs/webauthn.io
|
graphics/webauthn.svg E 2017 Duo Security, Inc. https://github.com/duo-labs/webauthn.io
|
||||||
|
lib/3rdParty/composer/aws H Amazon Web Services https://github.com/aws/aws-sdk-php, https://github.com/awslabs/aws-crt-php
|
||||||
lib/3rdParty/composer/brick B Benjamin Morel https://github.com/brick/math
|
lib/3rdParty/composer/brick B Benjamin Morel https://github.com/brick/math
|
||||||
lib/3rdParty/composer/carbonphp B 2023 Carbon https://github.com/CarbonPHP/carbon-doctrine-types
|
lib/3rdParty/composer/carbonphp B 2023 Carbon https://github.com/CarbonPHP/carbon-doctrine-types
|
||||||
lib/3rdParty/composer/christian-riesen B Christian Riesen https://github.com/ChristianRiesen/base32
|
lib/3rdParty/composer/christian-riesen B Christian Riesen https://github.com/ChristianRiesen/base32
|
||||||
|
@ -939,6 +1081,7 @@ lib/3rdParty/composer/http-interop B 2016 Wo
|
||||||
lib/3rdParty/composer/illuminate B Taylor Otwell https://github.com/illuminate
|
lib/3rdParty/composer/illuminate B Taylor Otwell https://github.com/illuminate
|
||||||
lib/3rdParty/composer/lcobucci B 2017 Luís Cobucci https://github.com/lcobucci/clock
|
lib/3rdParty/composer/lcobucci B 2017 Luís Cobucci https://github.com/lcobucci/clock
|
||||||
lib/3rdParty/composer/monolog B 2011 Jordi Boggiano https://github.com/Seldaek/monolog
|
lib/3rdParty/composer/monolog B 2011 Jordi Boggiano https://github.com/Seldaek/monolog
|
||||||
|
lib/3rdParty/composer/mtdowling B 2014 Michael Dowling https://github.com/jmespath/jmespath.php
|
||||||
lib/3rdParty/composer/nesbot B Brian Nesbitt https://github.com/CarbonPHP/carbon
|
lib/3rdParty/composer/nesbot B Brian Nesbitt https://github.com/CarbonPHP/carbon
|
||||||
lib/3rdParty/composer/paragonie B 2015 Paragon Initiative Enterprises https://github.com/paragonie
|
lib/3rdParty/composer/paragonie B 2015 Paragon Initiative Enterprises https://github.com/paragonie
|
||||||
lib/3rdParty/composer/php-http B 2015 PHP HTTP Team https://github.com/php-http/discovery
|
lib/3rdParty/composer/php-http B 2015 PHP HTTP Team https://github.com/php-http/discovery
|
||||||
|
|
|
@ -10,14 +10,14 @@
|
||||||
"php-http/discovery": false
|
"php-http/discovery": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"require" : {
|
"require": {
|
||||||
"web-auth/webauthn-lib" : "^4",
|
"web-auth/webauthn-lib": "^4",
|
||||||
"web-auth/cose-lib": "^v4",
|
"web-auth/cose-lib": "^v4",
|
||||||
"symfony/psr-http-message-bridge" : "^6",
|
"symfony/psr-http-message-bridge": "^6",
|
||||||
"symfony/http-foundation" : "^6.0",
|
"symfony/http-foundation": "^6.0",
|
||||||
"symfony/http-client": "^6",
|
"symfony/http-client": "^6",
|
||||||
"http-interop/http-factory-guzzle": "^1.2",
|
"http-interop/http-factory-guzzle": "^1.2",
|
||||||
"webklex/php-imap" : "^6",
|
"webklex/php-imap": "^6",
|
||||||
"phpmailer/phpmailer": "~6.5",
|
"phpmailer/phpmailer": "~6.5",
|
||||||
"guzzlehttp/psr7": "^2",
|
"guzzlehttp/psr7": "^2",
|
||||||
"paragonie/random_compat": "^2.0",
|
"paragonie/random_compat": "^2.0",
|
||||||
|
@ -28,6 +28,16 @@
|
||||||
"spomky-labs/aes-key-wrap": "^7",
|
"spomky-labs/aes-key-wrap": "^7",
|
||||||
|
|
||||||
"monolog/monolog": "^3",
|
"monolog/monolog": "^3",
|
||||||
"duosecurity/duo_universal_php": "^1.0"
|
"duosecurity/duo_universal_php": "^1.0",
|
||||||
|
|
||||||
|
"aws/aws-sdk-php": "^3"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"pre-autoload-dump": "Aws\\Script\\Composer\\Composer::removeUnusedServices"
|
||||||
|
},
|
||||||
|
"extra": {
|
||||||
|
"aws/aws-sdk-php": [
|
||||||
|
"Sns"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
428
lam/composer.lock
generated
428
lam/composer.lock
generated
|
@ -4,8 +4,159 @@
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "731f2d535003f437bc5c7c38c5e0f2da",
|
"content-hash": "9166ee0bdb3989fa31d8ea289c37a4b9",
|
||||||
"packages": [
|
"packages": [
|
||||||
|
{
|
||||||
|
"name": "aws/aws-crt-php",
|
||||||
|
"version": "v1.2.7",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/awslabs/aws-crt-php.git",
|
||||||
|
"reference": "d71d9906c7bb63a28295447ba12e74723bd3730e"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/awslabs/aws-crt-php/zipball/d71d9906c7bb63a28295447ba12e74723bd3730e",
|
||||||
|
"reference": "d71d9906c7bb63a28295447ba12e74723bd3730e",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.5"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "^4.8.35||^5.6.3||^9.5",
|
||||||
|
"yoast/phpunit-polyfills": "^1.0"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-awscrt": "Make sure you install awscrt native extension to use any of the functionality."
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"classmap": [
|
||||||
|
"src/"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"Apache-2.0"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "AWS SDK Common Runtime Team",
|
||||||
|
"email": "aws-sdk-common-runtime@amazon.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "AWS Common Runtime for PHP",
|
||||||
|
"homepage": "https://github.com/awslabs/aws-crt-php",
|
||||||
|
"keywords": [
|
||||||
|
"amazon",
|
||||||
|
"aws",
|
||||||
|
"crt",
|
||||||
|
"sdk"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/awslabs/aws-crt-php/issues",
|
||||||
|
"source": "https://github.com/awslabs/aws-crt-php/tree/v1.2.7"
|
||||||
|
},
|
||||||
|
"time": "2024-10-18T22:15:13+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "aws/aws-sdk-php",
|
||||||
|
"version": "3.346.2",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/aws/aws-sdk-php.git",
|
||||||
|
"reference": "d1403b5a39af7ab7af4fc538deb33013c19c8d33"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/d1403b5a39af7ab7af4fc538deb33013c19c8d33",
|
||||||
|
"reference": "d1403b5a39af7ab7af4fc538deb33013c19c8d33",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"aws/aws-crt-php": "^1.2.3",
|
||||||
|
"ext-json": "*",
|
||||||
|
"ext-pcre": "*",
|
||||||
|
"ext-simplexml": "*",
|
||||||
|
"guzzlehttp/guzzle": "^7.4.5",
|
||||||
|
"guzzlehttp/promises": "^2.0",
|
||||||
|
"guzzlehttp/psr7": "^2.4.5",
|
||||||
|
"mtdowling/jmespath.php": "^2.8.0",
|
||||||
|
"php": ">=8.1",
|
||||||
|
"psr/http-message": "^2.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"andrewsville/php-token-reflection": "^1.4",
|
||||||
|
"aws/aws-php-sns-message-validator": "~1.0",
|
||||||
|
"behat/behat": "~3.0",
|
||||||
|
"composer/composer": "^2.7.8",
|
||||||
|
"dms/phpunit-arraysubset-asserts": "^0.4.0",
|
||||||
|
"doctrine/cache": "~1.4",
|
||||||
|
"ext-dom": "*",
|
||||||
|
"ext-openssl": "*",
|
||||||
|
"ext-pcntl": "*",
|
||||||
|
"ext-sockets": "*",
|
||||||
|
"phpunit/phpunit": "^5.6.3 || ^8.5 || ^9.5",
|
||||||
|
"psr/cache": "^2.0 || ^3.0",
|
||||||
|
"psr/simple-cache": "^2.0 || ^3.0",
|
||||||
|
"sebastian/comparator": "^1.2.3 || ^4.0 || ^5.0",
|
||||||
|
"symfony/filesystem": "^v6.4.0 || ^v7.1.0",
|
||||||
|
"yoast/phpunit-polyfills": "^2.0"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"aws/aws-php-sns-message-validator": "To validate incoming SNS notifications",
|
||||||
|
"doctrine/cache": "To use the DoctrineCacheAdapter",
|
||||||
|
"ext-curl": "To send requests using cURL",
|
||||||
|
"ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages",
|
||||||
|
"ext-sockets": "To use client-side monitoring"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "3.0-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"files": [
|
||||||
|
"src/functions.php"
|
||||||
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"Aws\\": "src/"
|
||||||
|
},
|
||||||
|
"exclude-from-classmap": [
|
||||||
|
"src/data/"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"Apache-2.0"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Amazon Web Services",
|
||||||
|
"homepage": "http://aws.amazon.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "AWS SDK for PHP - Use Amazon Web Services in your PHP project",
|
||||||
|
"homepage": "http://aws.amazon.com/sdkforphp",
|
||||||
|
"keywords": [
|
||||||
|
"amazon",
|
||||||
|
"aws",
|
||||||
|
"cloud",
|
||||||
|
"dynamodb",
|
||||||
|
"ec2",
|
||||||
|
"glacier",
|
||||||
|
"s3",
|
||||||
|
"sdk"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"forum": "https://github.com/aws/aws-sdk-php/discussions",
|
||||||
|
"issues": "https://github.com/aws/aws-sdk-php/issues",
|
||||||
|
"source": "https://github.com/aws/aws-sdk-php/tree/3.346.2"
|
||||||
|
},
|
||||||
|
"time": "2025-06-20T18:10:21+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "brick/math",
|
"name": "brick/math",
|
||||||
"version": "0.12.3",
|
"version": "0.12.3",
|
||||||
|
@ -605,6 +756,215 @@
|
||||||
},
|
},
|
||||||
"time": "2025-04-09T20:32:01+00:00"
|
"time": "2025-04-09T20:32:01+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "guzzlehttp/guzzle",
|
||||||
|
"version": "7.9.3",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/guzzle/guzzle.git",
|
||||||
|
"reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/7b2f29fe81dc4da0ca0ea7d42107a0845946ea77",
|
||||||
|
"reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"ext-json": "*",
|
||||||
|
"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"
|
||||||
|
},
|
||||||
|
"provide": {
|
||||||
|
"psr/http-client-implementation": "1.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"bamarni/composer-bin-plugin": "^1.8.2",
|
||||||
|
"ext-curl": "*",
|
||||||
|
"guzzle/client-integration-tests": "3.0.2",
|
||||||
|
"php-http/message-factory": "^1.1",
|
||||||
|
"phpunit/phpunit": "^8.5.39 || ^9.6.20",
|
||||||
|
"psr/log": "^1.1 || ^2.0 || ^3.0"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-curl": "Required for CURL handler support",
|
||||||
|
"ext-intl": "Required for Internationalized Domain Name (IDN) support",
|
||||||
|
"psr/log": "Required for using the Log middleware"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"bamarni-bin": {
|
||||||
|
"bin-links": true,
|
||||||
|
"forward-command": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"files": [
|
||||||
|
"src/functions_include.php"
|
||||||
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"GuzzleHttp\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Graham Campbell",
|
||||||
|
"email": "hello@gjcampbell.co.uk",
|
||||||
|
"homepage": "https://github.com/GrahamCampbell"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Michael Dowling",
|
||||||
|
"email": "mtdowling@gmail.com",
|
||||||
|
"homepage": "https://github.com/mtdowling"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Jeremy Lindblom",
|
||||||
|
"email": "jeremeamia@gmail.com",
|
||||||
|
"homepage": "https://github.com/jeremeamia"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "George Mponos",
|
||||||
|
"email": "gmponos@gmail.com",
|
||||||
|
"homepage": "https://github.com/gmponos"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Tobias Nyholm",
|
||||||
|
"email": "tobias.nyholm@gmail.com",
|
||||||
|
"homepage": "https://github.com/Nyholm"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Márk Sági-Kazár",
|
||||||
|
"email": "mark.sagikazar@gmail.com",
|
||||||
|
"homepage": "https://github.com/sagikazarmark"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Tobias Schultze",
|
||||||
|
"email": "webmaster@tubo-world.de",
|
||||||
|
"homepage": "https://github.com/Tobion"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Guzzle is a PHP HTTP client library",
|
||||||
|
"keywords": [
|
||||||
|
"client",
|
||||||
|
"curl",
|
||||||
|
"framework",
|
||||||
|
"http",
|
||||||
|
"http client",
|
||||||
|
"psr-18",
|
||||||
|
"psr-7",
|
||||||
|
"rest",
|
||||||
|
"web service"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/guzzle/guzzle/issues",
|
||||||
|
"source": "https://github.com/guzzle/guzzle/tree/7.9.3"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://github.com/GrahamCampbell",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/Nyholm",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2025-03-27T13:37:11+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "guzzlehttp/promises",
|
||||||
|
"version": "2.2.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/guzzle/promises.git",
|
||||||
|
"reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/guzzle/promises/zipball/7c69f28996b0a6920945dd20b3857e499d9ca96c",
|
||||||
|
"reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": "^7.2.5 || ^8.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"bamarni/composer-bin-plugin": "^1.8.2",
|
||||||
|
"phpunit/phpunit": "^8.5.39 || ^9.6.20"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"bamarni-bin": {
|
||||||
|
"bin-links": true,
|
||||||
|
"forward-command": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"GuzzleHttp\\Promise\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Graham Campbell",
|
||||||
|
"email": "hello@gjcampbell.co.uk",
|
||||||
|
"homepage": "https://github.com/GrahamCampbell"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Michael Dowling",
|
||||||
|
"email": "mtdowling@gmail.com",
|
||||||
|
"homepage": "https://github.com/mtdowling"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Tobias Nyholm",
|
||||||
|
"email": "tobias.nyholm@gmail.com",
|
||||||
|
"homepage": "https://github.com/Nyholm"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Tobias Schultze",
|
||||||
|
"email": "webmaster@tubo-world.de",
|
||||||
|
"homepage": "https://github.com/Tobion"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Guzzle promises library",
|
||||||
|
"keywords": [
|
||||||
|
"promise"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/guzzle/promises/issues",
|
||||||
|
"source": "https://github.com/guzzle/promises/tree/2.2.0"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://github.com/GrahamCampbell",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/Nyholm",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2025-03-27T13:27:01+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "guzzlehttp/psr7",
|
"name": "guzzlehttp/psr7",
|
||||||
"version": "2.7.1",
|
"version": "2.7.1",
|
||||||
|
@ -1101,6 +1461,72 @@
|
||||||
],
|
],
|
||||||
"time": "2025-03-24T10:02:05+00:00"
|
"time": "2025-03-24T10:02:05+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "mtdowling/jmespath.php",
|
||||||
|
"version": "2.8.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/jmespath/jmespath.php.git",
|
||||||
|
"reference": "a2a865e05d5f420b50cc2f85bb78d565db12a6bc"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/a2a865e05d5f420b50cc2f85bb78d565db12a6bc",
|
||||||
|
"reference": "a2a865e05d5f420b50cc2f85bb78d565db12a6bc",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": "^7.2.5 || ^8.0",
|
||||||
|
"symfony/polyfill-mbstring": "^1.17"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"composer/xdebug-handler": "^3.0.3",
|
||||||
|
"phpunit/phpunit": "^8.5.33"
|
||||||
|
},
|
||||||
|
"bin": [
|
||||||
|
"bin/jp.php"
|
||||||
|
],
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "2.8-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"files": [
|
||||||
|
"src/JmesPath.php"
|
||||||
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"JmesPath\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Graham Campbell",
|
||||||
|
"email": "hello@gjcampbell.co.uk",
|
||||||
|
"homepage": "https://github.com/GrahamCampbell"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Michael Dowling",
|
||||||
|
"email": "mtdowling@gmail.com",
|
||||||
|
"homepage": "https://github.com/mtdowling"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Declaratively specify how to extract elements from a JSON document",
|
||||||
|
"keywords": [
|
||||||
|
"json",
|
||||||
|
"jsonpath"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/jmespath/jmespath.php/issues",
|
||||||
|
"source": "https://github.com/jmespath/jmespath.php/tree/2.8.0"
|
||||||
|
},
|
||||||
|
"time": "2024-09-04T18:46:31+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "nesbot/carbon",
|
"name": "nesbot/carbon",
|
||||||
"version": "3.9.1",
|
"version": "3.9.1",
|
||||||
|
|
143
lam/copyright
143
lam/copyright
|
@ -920,12 +920,154 @@ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||||
DAMAGES.
|
DAMAGES.
|
||||||
|
|
||||||
|
|
||||||
|
H:
|
||||||
|
Apache License 2.0
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
## 1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1
|
||||||
|
through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the
|
||||||
|
License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled
|
||||||
|
by, or are under common control with that entity. For the purposes of this definition, "control" means
|
||||||
|
(i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract
|
||||||
|
or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial
|
||||||
|
ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications, including but not limited to software
|
||||||
|
source code, documentation source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form,
|
||||||
|
including but not limited to compiled object code, generated documentation, and conversions to other media
|
||||||
|
types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License,
|
||||||
|
as indicated by a copyright notice that is included in or attached to the work (an example is provided in the
|
||||||
|
Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from)
|
||||||
|
the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent,
|
||||||
|
as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not
|
||||||
|
include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work
|
||||||
|
and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including the original version of the Work and any
|
||||||
|
modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to
|
||||||
|
Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to
|
||||||
|
submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of
|
||||||
|
electronic, verbal, or written communication sent to the Licensor or its representatives, including but not
|
||||||
|
limited to communication on electronic mailing lists, source code control systems, and issue tracking systems
|
||||||
|
that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise designated in writing by the copyright
|
||||||
|
owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been
|
||||||
|
received by Licensor and subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
## 2. Grant of Copyright License.
|
||||||
|
|
||||||
|
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare
|
||||||
|
Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such
|
||||||
|
Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
## 3. Grant of Patent License.
|
||||||
|
|
||||||
|
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent
|
||||||
|
license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such
|
||||||
|
license applies only to those patent claims licensable by such Contributor that are necessarily infringed by
|
||||||
|
their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such
|
||||||
|
Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim
|
||||||
|
or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work
|
||||||
|
constitutes direct or contributory patent infringement, then any patent licenses granted to You under this
|
||||||
|
License for that Work shall terminate as of the date such litigation is filed.
|
||||||
|
|
||||||
|
## 4. Redistribution.
|
||||||
|
|
||||||
|
You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You meet the following conditions:
|
||||||
|
|
||||||
|
1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
2. You must cause any modified files to carry prominent notices stating that You changed the files; and
|
||||||
|
|
||||||
|
3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent,
|
||||||
|
trademark, and attribution notices from the Source form of the Work, excluding those notices that do
|
||||||
|
not pertain to any part of the Derivative Works; and
|
||||||
|
|
||||||
|
4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that
|
||||||
|
You distribute must include a readable copy of the attribution notices contained within such NOTICE
|
||||||
|
file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed as part of the Derivative Works; within
|
||||||
|
the Source form or documentation, if provided along with the Derivative Works; or, within a display
|
||||||
|
generated by the Derivative Works, if and wherever such third-party notices normally appear. The
|
||||||
|
contents of the NOTICE file are for informational purposes only and do not modify the License. You may
|
||||||
|
add Your own attribution notices within Derivative Works that You distribute, alongside or as an
|
||||||
|
addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be
|
||||||
|
construed as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and may provide additional or different license
|
||||||
|
terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative
|
||||||
|
Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the
|
||||||
|
conditions stated in this License.
|
||||||
|
|
||||||
|
## 5. Submission of Contributions.
|
||||||
|
|
||||||
|
Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by
|
||||||
|
You to the Licensor shall be under the terms and conditions of this License, without any additional terms or
|
||||||
|
conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate
|
||||||
|
license agreement you may have executed with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
## 6. Trademarks.
|
||||||
|
|
||||||
|
This License does not grant permission to use the trade names, trademarks, service marks, or product names of
|
||||||
|
the Licensor, except as required for reasonable and customary use in describing the origin of the Work and
|
||||||
|
reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
## 7. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor
|
||||||
|
provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||||
|
or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,
|
||||||
|
MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of
|
||||||
|
permissions under this License.
|
||||||
|
|
||||||
|
## 8. Limitation of Liability.
|
||||||
|
|
||||||
|
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless
|
||||||
|
required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any
|
||||||
|
Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential
|
||||||
|
damages of any character arising as a result of this License or out of the use or inability to use the Work
|
||||||
|
(including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or
|
||||||
|
any and all other commercial damages or losses), even if such Contributor has been advised of the possibility
|
||||||
|
of such damages.
|
||||||
|
|
||||||
|
## 9. Accepting Warranty or Additional Liability.
|
||||||
|
|
||||||
|
While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for,
|
||||||
|
acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole
|
||||||
|
responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold
|
||||||
|
each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
|
||||||
Programs and licenses with other licenses and/or authors than the
|
Programs and licenses with other licenses and/or authors than the
|
||||||
main license and authors:
|
main license and authors:
|
||||||
|
|
||||||
graphics/webauthn.svg E 2017 Duo Security, Inc. https://github.com/duo-labs/webauthn.io
|
graphics/webauthn.svg E 2017 Duo Security, Inc. https://github.com/duo-labs/webauthn.io
|
||||||
|
lib/3rdParty/composer/aws H Amazon Web Services https://github.com/aws/aws-sdk-php, https://github.com/awslabs/aws-crt-php
|
||||||
lib/3rdParty/composer/brick B Benjamin Morel https://github.com/brick/math
|
lib/3rdParty/composer/brick B Benjamin Morel https://github.com/brick/math
|
||||||
lib/3rdParty/composer/carbonphp B 2023 Carbon https://github.com/CarbonPHP/carbon-doctrine-types
|
lib/3rdParty/composer/carbonphp B 2023 Carbon https://github.com/CarbonPHP/carbon-doctrine-types
|
||||||
lib/3rdParty/composer/christian-riesen B Christian Riesen https://github.com/ChristianRiesen/base32
|
lib/3rdParty/composer/christian-riesen B Christian Riesen https://github.com/ChristianRiesen/base32
|
||||||
|
@ -939,6 +1081,7 @@ lib/3rdParty/composer/http-interop B 2016 Wo
|
||||||
lib/3rdParty/composer/illuminate B Taylor Otwell https://github.com/illuminate
|
lib/3rdParty/composer/illuminate B Taylor Otwell https://github.com/illuminate
|
||||||
lib/3rdParty/composer/lcobucci B 2017 Luís Cobucci https://github.com/lcobucci/clock
|
lib/3rdParty/composer/lcobucci B 2017 Luís Cobucci https://github.com/lcobucci/clock
|
||||||
lib/3rdParty/composer/monolog B 2011 Jordi Boggiano https://github.com/Seldaek/monolog
|
lib/3rdParty/composer/monolog B 2011 Jordi Boggiano https://github.com/Seldaek/monolog
|
||||||
|
lib/3rdParty/composer/mtdowling B 2014 Michael Dowling https://github.com/jmespath/jmespath.php
|
||||||
lib/3rdParty/composer/nesbot B Brian Nesbitt https://github.com/CarbonPHP/carbon
|
lib/3rdParty/composer/nesbot B Brian Nesbitt https://github.com/CarbonPHP/carbon
|
||||||
lib/3rdParty/composer/paragonie B 2015 Paragon Initiative Enterprises https://github.com/paragonie
|
lib/3rdParty/composer/paragonie B 2015 Paragon Initiative Enterprises https://github.com/paragonie
|
||||||
lib/3rdParty/composer/php-http B 2015 PHP HTTP Team https://github.com/php-http/discovery
|
lib/3rdParty/composer/php-http B 2015 PHP HTTP Team https://github.com/php-http/discovery
|
||||||
|
|
|
@ -326,6 +326,24 @@
|
||||||
</listitem>
|
</listitem>
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
|
|
||||||
|
<para><ulink url="https://aws.amazon.com/sns/"><emphasis role="bold">AWS
|
||||||
|
SNS</emphasis></ulink></para>
|
||||||
|
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem>
|
||||||
|
<para>Region: this is your AWS region (e.g. eu-central-1)</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>Account id: please enter the access key id of your IMS user
|
||||||
|
that is allowed to send SMS</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>Token: this is the secret value of your access key</para>
|
||||||
|
</listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
|
||||||
<para><emphasis role="bold"><ulink
|
<para><emphasis role="bold"><ulink
|
||||||
url="https://gatewayapi.com/">GatewayAPI</ulink></emphasis></para>
|
url="https://gatewayapi.com/">GatewayAPI</ulink></emphasis></para>
|
||||||
|
|
||||||
|
|
|
@ -376,6 +376,9 @@ $helpArray = [
|
||||||
"299b" => ["Headline" => _("From"),
|
"299b" => ["Headline" => _("From"),
|
||||||
"Text" => _("Please enter the phone number or messaging service ID that acts as the source of the message.")
|
"Text" => _("Please enter the phone number or messaging service ID that acts as the source of the message.")
|
||||||
],
|
],
|
||||||
|
"299c" => ["Headline" => _("Region"),
|
||||||
|
"Text" => _("Please enter the region ID for the SMS service.")
|
||||||
|
],
|
||||||
// 300 - 399
|
// 300 - 399
|
||||||
// profile/PDF editor, file upload
|
// profile/PDF editor, file upload
|
||||||
"301" => ["Headline" => _("RDN identifier"),
|
"301" => ["Headline" => _("RDN identifier"),
|
||||||
|
|
4
lam/lib/3rdParty/composer/aws/aws-crt-php/CODE_OF_CONDUCT.md
vendored
Normal file
4
lam/lib/3rdParty/composer/aws/aws-crt-php/CODE_OF_CONDUCT.md
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
## Code of Conduct
|
||||||
|
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
|
||||||
|
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
|
||||||
|
opensource-codeofconduct@amazon.com with any additional questions or comments.
|
175
lam/lib/3rdParty/composer/aws/aws-crt-php/LICENSE
vendored
Normal file
175
lam/lib/3rdParty/composer/aws/aws-crt-php/LICENSE
vendored
Normal file
|
@ -0,0 +1,175 @@
|
||||||
|
|
||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
1
lam/lib/3rdParty/composer/aws/aws-crt-php/NOTICE
vendored
Normal file
1
lam/lib/3rdParty/composer/aws/aws-crt-php/NOTICE
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
117
lam/lib/3rdParty/composer/aws/aws-crt-php/README.md
vendored
Normal file
117
lam/lib/3rdParty/composer/aws/aws-crt-php/README.md
vendored
Normal file
|
@ -0,0 +1,117 @@
|
||||||
|
# AWS Common Runtime PHP bindings
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
* PHP 5.5+ on UNIX platforms, 7.2+ on Windows
|
||||||
|
* CMake 3.x
|
||||||
|
* GCC 4.4+, clang 3.8+ on UNIX, Visual Studio build tools on Windows
|
||||||
|
* Tests require [Composer](https://getcomposer.org)
|
||||||
|
|
||||||
|
## Installing with Composer and PECL
|
||||||
|
|
||||||
|
The package has two different package published to [composer](https://packagist.org/packages/aws/aws-crt-php) and [PECL](https://pecl.php.net/package/awscrt).
|
||||||
|
|
||||||
|
On UNIX, you can get the package from package manager or build from source:
|
||||||
|
|
||||||
|
```
|
||||||
|
pecl install awscrt
|
||||||
|
composer require aws/aws-crt-php
|
||||||
|
```
|
||||||
|
|
||||||
|
On Windows, you need to build from source as instruction written below for the native extension `php_awscrt.dll` . And, follow https://www.php.net/manual/en/install.pecl.windows.php#install.pecl.windows.loading to load extension. After that:
|
||||||
|
|
||||||
|
```
|
||||||
|
composer require aws/aws-crt-php
|
||||||
|
```
|
||||||
|
|
||||||
|
## Building from Github source
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ git clone --recursive https://github.com/awslabs/aws-crt-php.git
|
||||||
|
$ cd aws-crt-php
|
||||||
|
$ phpize
|
||||||
|
$ ./configure
|
||||||
|
$ make
|
||||||
|
$ ./dev-scripts/run_tests.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
## Building on Windows
|
||||||
|
|
||||||
|
### Requirements for Windows
|
||||||
|
|
||||||
|
* Ensure you have the [windows PHP SDK](https://github.com/microsoft/php-sdk-binary-tools) (this example assumes installation of the SDK to C:\php-sdk and that you've checked out the PHP source to php-src within the build directory) and it works well on your machine.
|
||||||
|
|
||||||
|
* Ensure you have "Development package (SDK to develop PHP extensions)" and PHP available from your system path. You can download them from https://windows.php.net/download/. You can check if they are available by running `phpize -v` and `php -v`
|
||||||
|
|
||||||
|
### Instructions
|
||||||
|
|
||||||
|
From Command Prompt (not powershell). The instruction is based on Visual Studio 2019 on 64bit Windows.
|
||||||
|
|
||||||
|
```bat
|
||||||
|
> git clone --recursive https://github.com/awslabs/aws-crt-php.git
|
||||||
|
> git clone https://github.com/microsoft/php-sdk-binary-tools.git C:\php-sdk
|
||||||
|
> C:\php-sdk\phpsdk-vs16-x64.bat
|
||||||
|
|
||||||
|
C:\php-sdk\
|
||||||
|
$ cd <your-path-to-aws-crt-php>
|
||||||
|
|
||||||
|
<your-path-to-aws-crt-php>\
|
||||||
|
$ phpize
|
||||||
|
|
||||||
|
# --with-prefix only required when your php runtime in system path is different than the runtime you wish to use.
|
||||||
|
<your-path-to-aws-crt-php>\
|
||||||
|
$ configure --enable-awscrt=shared --with-prefix=<your-path-to-php-prefix>
|
||||||
|
|
||||||
|
<your-path-to-aws-crt-php>\
|
||||||
|
$ nmake
|
||||||
|
|
||||||
|
<your-path-to-aws-crt-php>\
|
||||||
|
$ nmake generate-php-ini
|
||||||
|
|
||||||
|
# check .\php-win.ini, it now has the full path to php_awscrt.dll that you can manually load to your php runtime, or you can run the following command to run tests and load the required native extension for awscrt.
|
||||||
|
<your-path-to-aws-crt-php>\
|
||||||
|
$ .\dev-scripts\run_tests.bat <your-path-to-php-binary>
|
||||||
|
```
|
||||||
|
|
||||||
|
Note: for VS2017, Cmake will default to build for Win32, refer to [here](https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2015%202017.html). If you are building for x64 php, you can set environment variable as follow to let cmake pick x64 compiler.
|
||||||
|
|
||||||
|
```bat
|
||||||
|
set CMAKE_GENERATOR=Visual Studio 15 2017
|
||||||
|
set CMAKE_GENERATOR_PLATFORM=x64
|
||||||
|
```
|
||||||
|
|
||||||
|
## Debugging
|
||||||
|
|
||||||
|
Using [PHPBrew](https://github.com/phpbrew/phpbrew) to build/manage multiple versions of PHP is helpful.
|
||||||
|
|
||||||
|
Note: You must use a debug build of PHP to debug native extensions.
|
||||||
|
See the [PHP Internals Book](https://www.phpinternalsbook.com/php7/build_system/building_php.html) for more info
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# PHP 8 example
|
||||||
|
$ phpbrew install --stdout -j 8 8.0 +default -- CFLAGS=-Wno-error --disable-cgi --enable-debug
|
||||||
|
# PHP 5.5 example
|
||||||
|
$ phpbrew install --stdout -j 8 5.5 +default -openssl -mbstring -- CFLAGS="-w -Wno-error" --enable-debug --with-zlib=/usr/local/opt/zlib
|
||||||
|
$ phpbrew switch php-8.0.6 # or whatever version is current, it'll be at the end of the build output
|
||||||
|
$ phpize
|
||||||
|
$ ./configure
|
||||||
|
$ make CMAKE_BUILD_TYPE=Debug
|
||||||
|
```
|
||||||
|
|
||||||
|
Ensure that the php you launch from your debugger is the result of `which php` , not just
|
||||||
|
the system default php.
|
||||||
|
|
||||||
|
## Security
|
||||||
|
|
||||||
|
See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
|
||||||
|
|
||||||
|
## Known OpenSSL related issue (Unix only)
|
||||||
|
|
||||||
|
* When your php loads a different version of openssl than your system openssl version, awscrt may fail to load or weirdly crash. You can find the openssl version php linked via: `php -i | grep 'OpenSSL'`, and awscrt linked from the build log, which will be `Found OpenSSL: * (found version *)`
|
||||||
|
|
||||||
|
The easiest workaround to those issue is to build from source and get aws-lc for awscrt to depend on instead.
|
||||||
|
TO do that, same instructions as [here](#building-from-github-source), but use `USE_OPENSSL=OFF make` instead of `make`
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
This project is licensed under the Apache-2.0 License.
|
35
lam/lib/3rdParty/composer/aws/aws-crt-php/composer.json
vendored
Normal file
35
lam/lib/3rdParty/composer/aws/aws-crt-php/composer.json
vendored
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
"name": "aws/aws-crt-php",
|
||||||
|
"homepage": "https://github.com/awslabs/aws-crt-php",
|
||||||
|
"description": "AWS Common Runtime for PHP",
|
||||||
|
"keywords": ["aws","amazon","sdk","crt"],
|
||||||
|
"type": "library",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "AWS SDK Common Runtime Team",
|
||||||
|
"email": "aws-sdk-common-runtime@amazon.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"minimum-stability": "alpha",
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.5"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit":"^4.8.35||^5.6.3||^9.5",
|
||||||
|
"yoast/phpunit-polyfills": "^1.0"
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"classmap": [
|
||||||
|
"src/"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-awscrt": "Make sure you install awscrt native extension to use any of the functionality."
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "./dev-scripts/run_tests.sh",
|
||||||
|
"test-extension": "@test",
|
||||||
|
"test-win": ".\\dev-scripts\\run_tests.bat"
|
||||||
|
},
|
||||||
|
"license": "Apache-2.0"
|
||||||
|
}
|
46
lam/lib/3rdParty/composer/aws/aws-crt-php/format-check.py
vendored
Executable file
46
lam/lib/3rdParty/composer/aws/aws-crt-php/format-check.py
vendored
Executable file
|
@ -0,0 +1,46 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
import argparse
|
||||||
|
import os
|
||||||
|
from pathlib import Path
|
||||||
|
import re
|
||||||
|
from subprocess import list2cmdline, run
|
||||||
|
from tempfile import NamedTemporaryFile
|
||||||
|
|
||||||
|
CLANG_FORMAT_VERSION = '18.1.6'
|
||||||
|
|
||||||
|
INCLUDE_REGEX = re.compile(r'^ext/.*\.(c|h|inl)$')
|
||||||
|
EXCLUDE_REGEX = re.compile(r'^$')
|
||||||
|
|
||||||
|
arg_parser = argparse.ArgumentParser(description="Check with clang-format")
|
||||||
|
arg_parser.add_argument('-i', '--inplace-edit', action='store_true',
|
||||||
|
help="Edit files inplace")
|
||||||
|
args = arg_parser.parse_args()
|
||||||
|
|
||||||
|
os.chdir(Path(__file__).parent)
|
||||||
|
|
||||||
|
# create file containing list of all files to format
|
||||||
|
filepaths_file = NamedTemporaryFile(delete=False)
|
||||||
|
for dirpath, dirnames, filenames in os.walk('.'):
|
||||||
|
for filename in filenames:
|
||||||
|
# our regexes expect filepath to use forward slash
|
||||||
|
filepath = Path(dirpath, filename).as_posix()
|
||||||
|
if not INCLUDE_REGEX.match(filepath):
|
||||||
|
continue
|
||||||
|
if EXCLUDE_REGEX.match(filepath):
|
||||||
|
continue
|
||||||
|
|
||||||
|
filepaths_file.write(f"{filepath}\n".encode())
|
||||||
|
filepaths_file.close()
|
||||||
|
|
||||||
|
# use pipx to run clang-format from PyPI
|
||||||
|
# this is a simple way to run the same clang-format version regardless of OS
|
||||||
|
cmd = ['pipx', 'run', f'clang-format=={CLANG_FORMAT_VERSION}',
|
||||||
|
f'--files={filepaths_file.name}']
|
||||||
|
if args.inplace_edit:
|
||||||
|
cmd += ['-i']
|
||||||
|
else:
|
||||||
|
cmd += ['--Werror', '--dry-run']
|
||||||
|
|
||||||
|
print(f"{Path.cwd()}$ {list2cmdline(cmd)}")
|
||||||
|
if run(cmd).returncode:
|
||||||
|
exit(1)
|
69
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Auth/AwsCredentials.php
vendored
Normal file
69
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Auth/AwsCredentials.php
vendored
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
* SPDX-License-Identifier: Apache-2.0.
|
||||||
|
*/
|
||||||
|
namespace AWS\CRT\Auth;
|
||||||
|
|
||||||
|
use AWS\CRT\NativeResource as NativeResource;
|
||||||
|
use AWS\CRT\Options as Options;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a set of AWS credentials
|
||||||
|
*
|
||||||
|
* @param array options:
|
||||||
|
* - string access_key_id - AWS Access Key Id
|
||||||
|
* - string secret_access_key - AWS Secret Access Key
|
||||||
|
* - string session_token - Optional STS session token
|
||||||
|
* - int expiration_timepoint_seconds - Optional time to expire these credentials
|
||||||
|
*/
|
||||||
|
final class AwsCredentials extends NativeResource {
|
||||||
|
|
||||||
|
static function defaults() {
|
||||||
|
return [
|
||||||
|
'access_key_id' => '',
|
||||||
|
'secret_access_key' => '',
|
||||||
|
'session_token' => '',
|
||||||
|
'expiration_timepoint_seconds' => 0,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
private $access_key_id;
|
||||||
|
private $secret_access_key;
|
||||||
|
private $session_token;
|
||||||
|
private $expiration_timepoint_seconds = 0;
|
||||||
|
|
||||||
|
public function __get($name) {
|
||||||
|
return $this->$name;
|
||||||
|
}
|
||||||
|
|
||||||
|
function __construct(array $options = []) {
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
|
$options = new Options($options, self::defaults());
|
||||||
|
$this->access_key_id = $options->access_key_id->asString();
|
||||||
|
$this->secret_access_key = $options->secret_access_key->asString();
|
||||||
|
$this->session_token = $options->session_token ? $options->session_token->asString() : null;
|
||||||
|
$this->expiration_timepoint_seconds = $options->expiration_timepoint_seconds->asInt();
|
||||||
|
|
||||||
|
if (strlen($this->access_key_id) == 0) {
|
||||||
|
throw new \InvalidArgumentException("access_key_id must be provided");
|
||||||
|
}
|
||||||
|
if (strlen($this->secret_access_key) == 0) {
|
||||||
|
throw new \InvalidArgumentException("secret_access_key must be provided");
|
||||||
|
}
|
||||||
|
|
||||||
|
$creds_options = self::$crt->aws_credentials_options_new();
|
||||||
|
self::$crt->aws_credentials_options_set_access_key_id($creds_options, $this->access_key_id);
|
||||||
|
self::$crt->aws_credentials_options_set_secret_access_key($creds_options, $this->secret_access_key);
|
||||||
|
self::$crt->aws_credentials_options_set_session_token($creds_options, $this->session_token);
|
||||||
|
self::$crt->aws_credentials_options_set_expiration_timepoint_seconds($creds_options, $this->expiration_timepoint_seconds);
|
||||||
|
$this->acquire(self::$crt->aws_credentials_new($creds_options));
|
||||||
|
self::$crt->aws_credentials_options_release($creds_options);
|
||||||
|
}
|
||||||
|
|
||||||
|
function __destruct() {
|
||||||
|
self::$crt->aws_credentials_release($this->release());
|
||||||
|
parent::__destruct();
|
||||||
|
}
|
||||||
|
}
|
23
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Auth/CredentialsProvider.php
vendored
Normal file
23
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Auth/CredentialsProvider.php
vendored
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
* SPDX-License-Identifier: Apache-2.0.
|
||||||
|
*/
|
||||||
|
namespace AWS\CRT\Auth;
|
||||||
|
|
||||||
|
use AWS\CRT\NativeResource as NativeResource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base class for credentials providers
|
||||||
|
*/
|
||||||
|
abstract class CredentialsProvider extends NativeResource {
|
||||||
|
|
||||||
|
function __construct(array $options = []) {
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
function __destruct() {
|
||||||
|
self::$crt->credentials_provider_release($this->release());
|
||||||
|
parent::__destruct();
|
||||||
|
}
|
||||||
|
}
|
43
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Auth/Signable.php
vendored
Normal file
43
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Auth/Signable.php
vendored
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
* SPDX-License-Identifier: Apache-2.0.
|
||||||
|
*/
|
||||||
|
namespace AWS\CRT\Auth;
|
||||||
|
|
||||||
|
use AWS\CRT\IO\InputStream;
|
||||||
|
use AWS\CRT\NativeResource as NativeResource;
|
||||||
|
|
||||||
|
class Signable extends NativeResource {
|
||||||
|
|
||||||
|
public static function fromHttpRequest($http_message) {
|
||||||
|
return new Signable(function() use ($http_message) {
|
||||||
|
return self::$crt->signable_new_from_http_request($http_message->native);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function fromChunk($chunk_stream, $previous_signature="") {
|
||||||
|
if (!($chunk_stream instanceof InputStream)) {
|
||||||
|
$chunk_stream = new InputStream($chunk_stream);
|
||||||
|
}
|
||||||
|
return new Signable(function() use($chunk_stream, $previous_signature) {
|
||||||
|
return self::$crt->signable_new_from_chunk($chunk_stream->native, $previous_signature);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function fromCanonicalRequest($canonical_request) {
|
||||||
|
return new Signable(function() use($canonical_request) {
|
||||||
|
return self::$crt->signable_new_from_canonical_request($canonical_request);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function __construct($ctor) {
|
||||||
|
parent::__construct();
|
||||||
|
$this->acquire($ctor());
|
||||||
|
}
|
||||||
|
|
||||||
|
function __destruct() {
|
||||||
|
self::$crt->signable_release($this->release());
|
||||||
|
parent::__destruct();
|
||||||
|
}
|
||||||
|
}
|
15
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Auth/SignatureType.php
vendored
Normal file
15
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Auth/SignatureType.php
vendored
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
* SPDX-License-Identifier: Apache-2.0.
|
||||||
|
*/
|
||||||
|
namespace AWS\CRT\Auth;
|
||||||
|
|
||||||
|
class SignatureType {
|
||||||
|
const HTTP_REQUEST_HEADERS = 0;
|
||||||
|
const HTTP_REQUEST_QUERY_PARAMS = 1;
|
||||||
|
const HTTP_REQUEST_CHUNK = 2;
|
||||||
|
const HTTP_REQUEST_EVENT = 3;
|
||||||
|
const CANONICAL_REQUEST_HEADERS = 4;
|
||||||
|
const CANONICAL_REQUEST_QUERY_PARAMS = 5;
|
||||||
|
}
|
11
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Auth/SignedBodyHeaderType.php
vendored
Normal file
11
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Auth/SignedBodyHeaderType.php
vendored
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
* SPDX-License-Identifier: Apache-2.0.
|
||||||
|
*/
|
||||||
|
namespace AWS\CRT\Auth;
|
||||||
|
|
||||||
|
class SignedBodyHeaderType {
|
||||||
|
const NONE = 0;
|
||||||
|
const X_AMZ_CONTENT_SHA256 = 1;
|
||||||
|
}
|
22
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Auth/Signing.php
vendored
Normal file
22
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Auth/Signing.php
vendored
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
* SPDX-License-Identifier: Apache-2.0.
|
||||||
|
*/
|
||||||
|
namespace AWS\CRT\Auth;
|
||||||
|
|
||||||
|
use AWS\CRT\NativeResource;
|
||||||
|
|
||||||
|
abstract class Signing extends NativeResource {
|
||||||
|
static function signRequestAws($signable, $signing_config, $on_complete) {
|
||||||
|
return self::$crt->sign_request_aws($signable->native, $signing_config->native,
|
||||||
|
function($result, $error_code) use ($on_complete) {
|
||||||
|
$signing_result = SigningResult::fromNative($result);
|
||||||
|
$on_complete($signing_result, $error_code);
|
||||||
|
}, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
static function testVerifySigV4ASigning($signable, $signing_config, $expected_canonical_request, $signature, $ecc_key_pub_x, $ecc_key_pub_y) {
|
||||||
|
return self::$crt->test_verify_sigv4a_signing($signable, $signing_config, $expected_canonical_request, $signature, $ecc_key_pub_x, $ecc_key_pub_y);
|
||||||
|
}
|
||||||
|
}
|
11
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Auth/SigningAlgorithm.php
vendored
Normal file
11
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Auth/SigningAlgorithm.php
vendored
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
* SPDX-License-Identifier: Apache-2.0.
|
||||||
|
*/
|
||||||
|
namespace AWS\CRT\Auth;
|
||||||
|
|
||||||
|
class SigningAlgorithm {
|
||||||
|
const SIGv4 = 0;
|
||||||
|
const SIGv4_ASYMMETRIC = 1;
|
||||||
|
}
|
75
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Auth/SigningConfigAWS.php
vendored
Normal file
75
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Auth/SigningConfigAWS.php
vendored
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
* SPDX-License-Identifier: Apache-2.0.
|
||||||
|
*/
|
||||||
|
namespace AWS\CRT\Auth;
|
||||||
|
|
||||||
|
use AWS\CRT\NativeResource as NativeResource;
|
||||||
|
use AWS\CRT\Options as Options;
|
||||||
|
|
||||||
|
class SigningConfigAWS extends NativeResource {
|
||||||
|
|
||||||
|
public static function defaults() {
|
||||||
|
return [
|
||||||
|
'algorithm' => SigningAlgorithm::SIGv4,
|
||||||
|
'signature_type' => SignatureType::HTTP_REQUEST_HEADERS,
|
||||||
|
'credentials_provider' => null,
|
||||||
|
'region' => null,
|
||||||
|
'service' => null,
|
||||||
|
'use_double_uri_encode' => false,
|
||||||
|
'should_normalize_uri_path' => false,
|
||||||
|
'omit_session_token' => false,
|
||||||
|
'signed_body_value' => null,
|
||||||
|
'signed_body_header_type' => SignedBodyHeaderType::NONE,
|
||||||
|
'expiration_in_seconds' => 0,
|
||||||
|
'date' => time(),
|
||||||
|
'should_sign_header' => null,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
private $options;
|
||||||
|
|
||||||
|
public function __construct(array $options = []) {
|
||||||
|
parent::__construct();
|
||||||
|
$this->options = $options = new Options($options, self::defaults());
|
||||||
|
$sc = $this->acquire(self::$crt->signing_config_aws_new());
|
||||||
|
self::$crt->signing_config_aws_set_algorithm($sc, $options->algorithm->asInt());
|
||||||
|
self::$crt->signing_config_aws_set_signature_type($sc, $options->signature_type->asInt());
|
||||||
|
if ($credentials_provider = $options->credentials_provider->asObject()) {
|
||||||
|
self::$crt->signing_config_aws_set_credentials_provider(
|
||||||
|
$sc,
|
||||||
|
$credentials_provider->native);
|
||||||
|
}
|
||||||
|
self::$crt->signing_config_aws_set_region(
|
||||||
|
$sc, $options->region->asString());
|
||||||
|
self::$crt->signing_config_aws_set_service(
|
||||||
|
$sc, $options->service->asString());
|
||||||
|
self::$crt->signing_config_aws_set_use_double_uri_encode(
|
||||||
|
$sc, $options->use_double_uri_encode->asBool());
|
||||||
|
self::$crt->signing_config_aws_set_should_normalize_uri_path(
|
||||||
|
$sc, $options->should_normalize_uri_path->asBool());
|
||||||
|
self::$crt->signing_config_aws_set_omit_session_token(
|
||||||
|
$sc, $options->omit_session_token->asBool());
|
||||||
|
self::$crt->signing_config_aws_set_signed_body_value(
|
||||||
|
$sc, $options->signed_body_value->asString());
|
||||||
|
self::$crt->signing_config_aws_set_signed_body_header_type(
|
||||||
|
$sc, $options->signed_body_header_type->asInt());
|
||||||
|
self::$crt->signing_config_aws_set_expiration_in_seconds(
|
||||||
|
$sc, $options->expiration_in_seconds->asInt());
|
||||||
|
self::$crt->signing_config_aws_set_date($sc, $options->date->asInt());
|
||||||
|
if ($should_sign_header = $options->should_sign_header->asCallable()) {
|
||||||
|
self::$crt->signing_config_aws_set_should_sign_header_fn($sc, $should_sign_header);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function __destruct()
|
||||||
|
{
|
||||||
|
self::$crt->signing_config_aws_release($this->release());
|
||||||
|
parent::__destruct();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __get($name) {
|
||||||
|
return $this->options->get($name);
|
||||||
|
}
|
||||||
|
}
|
33
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Auth/SigningResult.php
vendored
Normal file
33
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Auth/SigningResult.php
vendored
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
* SPDX-License-Identifier: Apache-2.0.
|
||||||
|
*/
|
||||||
|
namespace AWS\CRT\Auth;
|
||||||
|
|
||||||
|
use AWS\CRT\NativeResource;
|
||||||
|
use AWS\CRT\HTTP\Request;
|
||||||
|
|
||||||
|
class SigningResult extends NativeResource {
|
||||||
|
protected function __construct($native) {
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
|
$this->acquire($native);
|
||||||
|
}
|
||||||
|
|
||||||
|
function __destruct() {
|
||||||
|
// No destruction necessary, SigningResults are transient, just release
|
||||||
|
$this->release();
|
||||||
|
parent::__destruct();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function fromNative($ptr) {
|
||||||
|
return new SigningResult($ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function applyToHttpRequest(&$http_request) {
|
||||||
|
self::$crt->signing_result_apply_to_http_request($this->native, $http_request->native);
|
||||||
|
// Update http_request from native
|
||||||
|
$http_request = Request::unmarshall($http_request->toBlob());
|
||||||
|
}
|
||||||
|
}
|
35
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Auth/StaticCredentialsProvider.php
vendored
Normal file
35
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Auth/StaticCredentialsProvider.php
vendored
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
* SPDX-License-Identifier: Apache-2.0.
|
||||||
|
*/
|
||||||
|
namespace AWS\CRT\Auth;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides a static set of AWS credentials
|
||||||
|
*
|
||||||
|
* @param array options:
|
||||||
|
* - string access_key_id - AWS Access Key Id
|
||||||
|
* - string secret_access_key - AWS Secret Access Key
|
||||||
|
* - string session_token - Optional STS session token
|
||||||
|
*/
|
||||||
|
final class StaticCredentialsProvider extends CredentialsProvider {
|
||||||
|
|
||||||
|
private $credentials;
|
||||||
|
|
||||||
|
public function __get($name) {
|
||||||
|
return $this->$name;
|
||||||
|
}
|
||||||
|
|
||||||
|
function __construct(array $options = []) {
|
||||||
|
parent::__construct();
|
||||||
|
$this->credentials = new AwsCredentials($options);
|
||||||
|
|
||||||
|
$provider_options = self::$crt->credentials_provider_static_options_new();
|
||||||
|
self::$crt->credentials_provider_static_options_set_access_key_id($provider_options, $this->credentials->access_key_id);
|
||||||
|
self::$crt->credentials_provider_static_options_set_secret_access_key($provider_options, $this->credentials->secret_access_key);
|
||||||
|
self::$crt->credentials_provider_static_options_set_session_token($provider_options, $this->credentials->session_token);
|
||||||
|
$this->acquire(self::$crt->credentials_provider_static_new($provider_options));
|
||||||
|
self::$crt->credentials_provider_static_options_release($provider_options);
|
||||||
|
}
|
||||||
|
}
|
358
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/CRT.php
vendored
Normal file
358
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/CRT.php
vendored
Normal file
|
@ -0,0 +1,358 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
* SPDX-License-Identifier: Apache-2.0.
|
||||||
|
*/
|
||||||
|
namespace AWS\CRT;
|
||||||
|
|
||||||
|
use AWS\CRT\Internal\Extension;
|
||||||
|
|
||||||
|
use \RuntimeException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wrapper for the interface to the CRT. There only ever needs to be one of these, but
|
||||||
|
* additional instances won't cost anything other than their memory.
|
||||||
|
* Creating an instance of any NativeResource will activate the CRT binding. User code
|
||||||
|
* should only need to create one of these if they are only accessing CRT:: static functions.
|
||||||
|
*/
|
||||||
|
final class CRT {
|
||||||
|
|
||||||
|
private static $impl = null;
|
||||||
|
private static $refcount = 0;
|
||||||
|
|
||||||
|
function __construct() {
|
||||||
|
if (is_null(self::$impl)) {
|
||||||
|
try {
|
||||||
|
self::$impl = new Extension();
|
||||||
|
} catch (RuntimeException $rex) {
|
||||||
|
throw new RuntimeException("Unable to initialize AWS CRT via awscrt extension: \n$rex", -1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
++self::$refcount;
|
||||||
|
}
|
||||||
|
|
||||||
|
function __destruct() {
|
||||||
|
if (--self::$refcount == 0) {
|
||||||
|
self::$impl = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool whether or not the CRT is currently loaded
|
||||||
|
*/
|
||||||
|
public static function isLoaded() {
|
||||||
|
return !is_null(self::$impl);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool whether or not the CRT is available via one of the possible backends
|
||||||
|
*/
|
||||||
|
public static function isAvailable() {
|
||||||
|
try {
|
||||||
|
new CRT();
|
||||||
|
return true;
|
||||||
|
} catch (RuntimeException $ex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return integer last error code reported within the CRT
|
||||||
|
*/
|
||||||
|
public static function last_error() {
|
||||||
|
return self::$impl->aws_crt_last_error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param integer $error Error code from the CRT, usually delivered via callback or {@see last_error}
|
||||||
|
* @return string Human-readable description of the provided error code
|
||||||
|
*/
|
||||||
|
public static function error_str($error) {
|
||||||
|
return self::$impl->aws_crt_error_str((int) $error);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param integer $error Error code from the CRT, usually delivered via callback or {@see last_error}
|
||||||
|
* @return string Name/enum identifier for the provided error code
|
||||||
|
*/
|
||||||
|
public static function error_name($error) {
|
||||||
|
return self::$impl->aws_crt_error_name((int) $error);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function log_to_stdout() {
|
||||||
|
return self::$impl->aws_crt_log_to_stdout();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function log_to_stderr() {
|
||||||
|
return self::$impl->aws_crt_log_to_stderr();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function log_to_file($filename) {
|
||||||
|
return self::$impl->aws_crt_log_to_file($filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function log_to_stream($stream) {
|
||||||
|
return self::$impl->aws_crt_log_to_stream($stream);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function log_set_level($level) {
|
||||||
|
return self::$impl->aws_crt_log_set_level($level);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function log_stop() {
|
||||||
|
return self::$impl->aws_crt_log_stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function log_message($level, $message) {
|
||||||
|
return self::$impl->aws_crt_log_message($level, $message);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return object Pointer to native event_loop_group_options
|
||||||
|
*/
|
||||||
|
function event_loop_group_options_new() {
|
||||||
|
return self::$impl->aws_crt_event_loop_group_options_new();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param object $elg_options Pointer to native event_loop_group_options
|
||||||
|
*/
|
||||||
|
function event_loop_group_options_release($elg_options) {
|
||||||
|
self::$impl->aws_crt_event_loop_group_options_release($elg_options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param object $elg_options Pointer to native event_loop_group_options
|
||||||
|
* @param integer $max_threads Maximum number of threads to allow the event loop group to use, default: 0/1 per CPU core
|
||||||
|
*/
|
||||||
|
function event_loop_group_options_set_max_threads($elg_options, $max_threads) {
|
||||||
|
self::$impl->aws_crt_event_loop_group_options_set_max_threads($elg_options, (int)$max_threads);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param object Pointer to event_loop_group_options, {@see event_loop_group_options_new}
|
||||||
|
* @return object Pointer to the new event loop group
|
||||||
|
*/
|
||||||
|
function event_loop_group_new($options) {
|
||||||
|
return self::$impl->aws_crt_event_loop_group_new($options);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param object $elg Pointer to the event loop group to release
|
||||||
|
*/
|
||||||
|
function event_loop_group_release($elg) {
|
||||||
|
self::$impl->aws_crt_event_loop_group_release($elg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* return object Pointer to native AWS credentials options
|
||||||
|
*/
|
||||||
|
function aws_credentials_options_new() {
|
||||||
|
return self::$impl->aws_crt_credentials_options_new();
|
||||||
|
}
|
||||||
|
|
||||||
|
function aws_credentials_options_release($options) {
|
||||||
|
self::$impl->aws_crt_credentials_options_release($options);
|
||||||
|
}
|
||||||
|
|
||||||
|
function aws_credentials_options_set_access_key_id($options, $access_key_id) {
|
||||||
|
self::$impl->aws_crt_credentials_options_set_access_key_id($options, $access_key_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
function aws_credentials_options_set_secret_access_key($options, $secret_access_key) {
|
||||||
|
self::$impl->aws_crt_credentials_options_set_secret_access_key($options, $secret_access_key);
|
||||||
|
}
|
||||||
|
|
||||||
|
function aws_credentials_options_set_session_token($options, $session_token) {
|
||||||
|
self::$impl->aws_crt_credentials_options_set_session_token($options, $session_token);
|
||||||
|
}
|
||||||
|
|
||||||
|
function aws_credentials_options_set_expiration_timepoint_seconds($options, $expiration_timepoint_seconds) {
|
||||||
|
self::$impl->aws_crt_credentials_options_set_expiration_timepoint_seconds($options, $expiration_timepoint_seconds);
|
||||||
|
}
|
||||||
|
|
||||||
|
function aws_credentials_new($options) {
|
||||||
|
return self::$impl->aws_crt_credentials_new($options);
|
||||||
|
}
|
||||||
|
|
||||||
|
function aws_credentials_release($credentials) {
|
||||||
|
self::$impl->aws_crt_credentials_release($credentials);
|
||||||
|
}
|
||||||
|
|
||||||
|
function credentials_provider_release($provider) {
|
||||||
|
self::$impl->aws_crt_credentials_provider_release($provider);
|
||||||
|
}
|
||||||
|
|
||||||
|
function credentials_provider_static_options_new() {
|
||||||
|
return self::$impl->aws_crt_credentials_provider_static_options_new();
|
||||||
|
}
|
||||||
|
|
||||||
|
function credentials_provider_static_options_release($options) {
|
||||||
|
self::$impl->aws_crt_credentials_provider_static_options_release($options);
|
||||||
|
}
|
||||||
|
|
||||||
|
function credentials_provider_static_options_set_access_key_id($options, $access_key_id) {
|
||||||
|
self::$impl->aws_crt_credentials_provider_static_options_set_access_key_id($options, $access_key_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
function credentials_provider_static_options_set_secret_access_key($options, $secret_access_key) {
|
||||||
|
self::$impl->aws_crt_credentials_provider_static_options_set_secret_access_key($options, $secret_access_key);
|
||||||
|
}
|
||||||
|
|
||||||
|
function credentials_provider_static_options_set_session_token($options, $session_token) {
|
||||||
|
self::$impl->aws_crt_credentials_provider_static_options_set_session_token($options, $session_token);
|
||||||
|
}
|
||||||
|
|
||||||
|
function credentials_provider_static_new($options) {
|
||||||
|
return self::$impl->aws_crt_credentials_provider_static_new($options);
|
||||||
|
}
|
||||||
|
|
||||||
|
function input_stream_options_new() {
|
||||||
|
return self::$impl->aws_crt_input_stream_options_new();
|
||||||
|
}
|
||||||
|
|
||||||
|
function input_stream_options_release($options) {
|
||||||
|
self::$impl->aws_crt_input_stream_options_release($options);
|
||||||
|
}
|
||||||
|
|
||||||
|
function input_stream_options_set_user_data($options, $user_data) {
|
||||||
|
self::$impl->aws_crt_input_stream_options_set_user_data($options, $user_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
function input_stream_new($options) {
|
||||||
|
return self::$impl->aws_crt_input_stream_new($options);
|
||||||
|
}
|
||||||
|
|
||||||
|
function input_stream_release($stream) {
|
||||||
|
self::$impl->aws_crt_input_stream_release($stream);
|
||||||
|
}
|
||||||
|
|
||||||
|
function input_stream_seek($stream, $offset, $basis) {
|
||||||
|
return self::$impl->aws_crt_input_stream_seek($stream, $offset, $basis);
|
||||||
|
}
|
||||||
|
|
||||||
|
function input_stream_read($stream, $length) {
|
||||||
|
return self::$impl->aws_crt_input_stream_read($stream, $length);
|
||||||
|
}
|
||||||
|
|
||||||
|
function input_stream_eof($stream) {
|
||||||
|
return self::$impl->aws_crt_input_stream_eof($stream);
|
||||||
|
}
|
||||||
|
|
||||||
|
function input_stream_get_length($stream) {
|
||||||
|
return self::$impl->aws_crt_input_stream_get_length($stream);
|
||||||
|
}
|
||||||
|
|
||||||
|
function http_message_new_from_blob($blob) {
|
||||||
|
return self::$impl->aws_crt_http_message_new_from_blob($blob);
|
||||||
|
}
|
||||||
|
|
||||||
|
function http_message_to_blob($message) {
|
||||||
|
return self::$impl->aws_crt_http_message_to_blob($message);
|
||||||
|
}
|
||||||
|
|
||||||
|
function http_message_release($message) {
|
||||||
|
self::$impl->aws_crt_http_message_release($message);
|
||||||
|
}
|
||||||
|
|
||||||
|
function signing_config_aws_new() {
|
||||||
|
return self::$impl->aws_crt_signing_config_aws_new();
|
||||||
|
}
|
||||||
|
|
||||||
|
function signing_config_aws_release($signing_config) {
|
||||||
|
return self::$impl->aws_crt_signing_config_aws_release($signing_config);
|
||||||
|
}
|
||||||
|
|
||||||
|
function signing_config_aws_set_algorithm($signing_config, $algorithm) {
|
||||||
|
self::$impl->aws_crt_signing_config_aws_set_algorithm($signing_config, (int)$algorithm);
|
||||||
|
}
|
||||||
|
|
||||||
|
function signing_config_aws_set_signature_type($signing_config, $signature_type) {
|
||||||
|
self::$impl->aws_crt_signing_config_aws_set_signature_type($signing_config, (int)$signature_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
function signing_config_aws_set_credentials_provider($signing_config, $credentials_provider) {
|
||||||
|
self::$impl->aws_crt_signing_config_aws_set_credentials_provider($signing_config, $credentials_provider);
|
||||||
|
}
|
||||||
|
|
||||||
|
function signing_config_aws_set_region($signing_config, $region) {
|
||||||
|
self::$impl->aws_crt_signing_config_aws_set_region($signing_config, $region);
|
||||||
|
}
|
||||||
|
|
||||||
|
function signing_config_aws_set_service($signing_config, $service) {
|
||||||
|
self::$impl->aws_crt_signing_config_aws_set_service($signing_config, $service);
|
||||||
|
}
|
||||||
|
|
||||||
|
function signing_config_aws_set_use_double_uri_encode($signing_config, $use_double_uri_encode) {
|
||||||
|
self::$impl->aws_crt_signing_config_aws_set_use_double_uri_encode($signing_config, $use_double_uri_encode);
|
||||||
|
}
|
||||||
|
|
||||||
|
function signing_config_aws_set_should_normalize_uri_path($signing_config, $should_normalize_uri_path) {
|
||||||
|
self::$impl->aws_crt_signing_config_aws_set_should_normalize_uri_path($signing_config, $should_normalize_uri_path);
|
||||||
|
}
|
||||||
|
|
||||||
|
function signing_config_aws_set_omit_session_token($signing_config, $omit_session_token) {
|
||||||
|
self::$impl->aws_crt_signing_config_aws_set_omit_session_token($signing_config, $omit_session_token);
|
||||||
|
}
|
||||||
|
|
||||||
|
function signing_config_aws_set_signed_body_value($signing_config, $signed_body_value) {
|
||||||
|
self::$impl->aws_crt_signing_config_aws_set_signed_body_value($signing_config, $signed_body_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
function signing_config_aws_set_signed_body_header_type($signing_config, $signed_body_header_type) {
|
||||||
|
self::$impl->aws_crt_signing_config_aws_set_signed_body_header_type($signing_config, $signed_body_header_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
function signing_config_aws_set_expiration_in_seconds($signing_config, $expiration_in_seconds) {
|
||||||
|
self::$impl->aws_crt_signing_config_aws_set_expiration_in_seconds($signing_config, $expiration_in_seconds);
|
||||||
|
}
|
||||||
|
|
||||||
|
function signing_config_aws_set_date($signing_config, $timestamp) {
|
||||||
|
self::$impl->aws_crt_signing_config_aws_set_date($signing_config, $timestamp);
|
||||||
|
}
|
||||||
|
|
||||||
|
function signing_config_aws_set_should_sign_header_fn($signing_config, $should_sign_header_fn) {
|
||||||
|
self::$impl->aws_crt_signing_config_aws_set_should_sign_header_fn($signing_config, $should_sign_header_fn);
|
||||||
|
}
|
||||||
|
|
||||||
|
function signable_new_from_http_request($http_message) {
|
||||||
|
return self::$impl->aws_crt_signable_new_from_http_request($http_message);
|
||||||
|
}
|
||||||
|
|
||||||
|
function signable_new_from_chunk($chunk_stream, $previous_signature) {
|
||||||
|
return self::$impl->aws_crt_signable_new_from_chunk($chunk_stream, $previous_signature);
|
||||||
|
}
|
||||||
|
|
||||||
|
function signable_new_from_canonical_request($canonical_request) {
|
||||||
|
return self::$impl->aws_crt_signable_new_from_canonical_request($canonical_request);
|
||||||
|
}
|
||||||
|
|
||||||
|
function signable_release($signable) {
|
||||||
|
self::$impl->aws_crt_signable_release($signable);
|
||||||
|
}
|
||||||
|
|
||||||
|
function signing_result_release($signing_result) {
|
||||||
|
self::$impl->aws_crt_signing_result_release($signing_result);
|
||||||
|
}
|
||||||
|
|
||||||
|
function signing_result_apply_to_http_request($signing_result, $http_message) {
|
||||||
|
return self::$impl->aws_crt_signing_result_apply_to_http_request(
|
||||||
|
$signing_result, $http_message);
|
||||||
|
}
|
||||||
|
|
||||||
|
function sign_request_aws($signable, $signing_config, $on_complete, $user_data) {
|
||||||
|
return self::$impl->aws_crt_sign_request_aws($signable, $signing_config, $on_complete, $user_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
function test_verify_sigv4a_signing($signable, $signing_config, $expected_canonical_request, $signature, $ecc_key_pub_x, $ecc_key_pub_y) {
|
||||||
|
return self::$impl->aws_crt_test_verify_sigv4a_signing($signable, $signing_config, $expected_canonical_request, $signature, $ecc_key_pub_x, $ecc_key_pub_y);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function crc32($input, $previous = 0) {
|
||||||
|
return self::$impl->aws_crt_crc32($input, $previous);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function crc32c($input, $previous = 0) {
|
||||||
|
return self::$impl->aws_crt_crc32c($input, $previous);
|
||||||
|
}
|
||||||
|
}
|
50
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/HTTP/Headers.php
vendored
Normal file
50
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/HTTP/Headers.php
vendored
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
* SPDX-License-Identifier: Apache-2.0.
|
||||||
|
*/
|
||||||
|
namespace AWS\CRT\HTTP;
|
||||||
|
|
||||||
|
use AWS\CRT\Internal\Encoding;
|
||||||
|
|
||||||
|
final class Headers {
|
||||||
|
private $headers;
|
||||||
|
|
||||||
|
public function __construct($headers = []) {
|
||||||
|
$this->headers = $headers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function marshall($headers) {
|
||||||
|
$buf = "";
|
||||||
|
foreach ($headers->headers as $header => $value) {
|
||||||
|
$buf .= Encoding::encodeString($header);
|
||||||
|
$buf .= Encoding::encodeString($value);
|
||||||
|
}
|
||||||
|
return $buf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function unmarshall($buf) {
|
||||||
|
$strings = Encoding::readStrings($buf);
|
||||||
|
$headers = [];
|
||||||
|
for ($idx = 0; $idx < count($strings);) {
|
||||||
|
$headers[$strings[$idx++]] = $strings[$idx++];
|
||||||
|
}
|
||||||
|
return new Headers($headers);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function count() {
|
||||||
|
return count($this->headers);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get($header) {
|
||||||
|
return isset($this->headers[$header]) ? $this->headers[$header] : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set($header, $value) {
|
||||||
|
$this->headers[$header] = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function toArray() {
|
||||||
|
return $this->headers;
|
||||||
|
}
|
||||||
|
}
|
95
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/HTTP/Message.php
vendored
Normal file
95
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/HTTP/Message.php
vendored
Normal file
|
@ -0,0 +1,95 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
* SPDX-License-Identifier: Apache-2.0.
|
||||||
|
*/
|
||||||
|
namespace AWS\CRT\HTTP;
|
||||||
|
|
||||||
|
use AWS\CRT\NativeResource;
|
||||||
|
use AWS\CRT\Internal\Encoding;
|
||||||
|
|
||||||
|
abstract class Message extends NativeResource {
|
||||||
|
private $method;
|
||||||
|
private $path;
|
||||||
|
private $query;
|
||||||
|
private $headers;
|
||||||
|
|
||||||
|
public function __construct($method, $path, $query = [], $headers = []) {
|
||||||
|
parent::__construct();
|
||||||
|
$this->method = $method;
|
||||||
|
$this->path = $path;
|
||||||
|
$this->query = $query;
|
||||||
|
$this->headers = new Headers($headers);
|
||||||
|
$this->acquire(self::$crt->http_message_new_from_blob(self::marshall($this)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __destruct() {
|
||||||
|
self::$crt->http_message_release($this->release());
|
||||||
|
parent::__destruct();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function toBlob() {
|
||||||
|
return self::$crt->http_message_to_blob($this->native);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static function marshall($msg) {
|
||||||
|
$buf = "";
|
||||||
|
$buf .= Encoding::encodeString($msg->method);
|
||||||
|
$buf .= Encoding::encodeString($msg->pathAndQuery());
|
||||||
|
$buf .= Headers::marshall($msg->headers);
|
||||||
|
return $buf;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static function _unmarshall($buf, $class=Message::class) {
|
||||||
|
$method = Encoding::readString($buf);
|
||||||
|
$path_and_query = Encoding::readString($buf);
|
||||||
|
$parts = explode("?", $path_and_query, 2);
|
||||||
|
$path = isset($parts[0]) ? $parts[0] : "";
|
||||||
|
$query = isset($parts[1]) ? $parts[1] : "";
|
||||||
|
$headers = Headers::unmarshall($buf);
|
||||||
|
|
||||||
|
// Turn query params back into a dictionary
|
||||||
|
if (strlen($query)) {
|
||||||
|
$query = rawurldecode($query);
|
||||||
|
$query = explode("&", $query);
|
||||||
|
$query = array_reduce($query, function($params, $pair) {
|
||||||
|
list($param, $value) = explode("=", $pair, 2);
|
||||||
|
$params[$param] = $value;
|
||||||
|
return $params;
|
||||||
|
}, []);
|
||||||
|
} else {
|
||||||
|
$query = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
return new $class($method, $path, $query, $headers->toArray());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function pathAndQuery() {
|
||||||
|
$path = $this->path;
|
||||||
|
$queries = [];
|
||||||
|
foreach ($this->query as $param => $value) {
|
||||||
|
$queries []= urlencode($param) . "=" . urlencode($value);
|
||||||
|
}
|
||||||
|
$query = implode("&", $queries);
|
||||||
|
if (strlen($query)) {
|
||||||
|
$path = implode("?", [$path, $query]);
|
||||||
|
}
|
||||||
|
return $path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function method() {
|
||||||
|
return $this->method;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function path() {
|
||||||
|
return $this->path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function query() {
|
||||||
|
return $this->query;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function headers() {
|
||||||
|
return $this->headers;
|
||||||
|
}
|
||||||
|
}
|
32
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/HTTP/Request.php
vendored
Normal file
32
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/HTTP/Request.php
vendored
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
* SPDX-License-Identifier: Apache-2.0.
|
||||||
|
*/
|
||||||
|
namespace AWS\CRT\HTTP;
|
||||||
|
|
||||||
|
use AWS\CRT\IO\InputStream;
|
||||||
|
|
||||||
|
class Request extends Message {
|
||||||
|
private $body_stream = null;
|
||||||
|
|
||||||
|
public function __construct($method, $path, $query = [], $headers = [], $body_stream = null) {
|
||||||
|
parent::__construct($method, $path, $query, $headers);
|
||||||
|
if (!is_null($body_stream) && !($body_stream instanceof InputStream)) {
|
||||||
|
throw new \InvalidArgumentException('body_stream must be an instance of ' . InputStream::class);
|
||||||
|
}
|
||||||
|
$this->body_stream = $body_stream;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function marshall($request) {
|
||||||
|
return parent::marshall($request);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function unmarshall($buf) {
|
||||||
|
return parent::_unmarshall($buf, Request::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function body_stream() {
|
||||||
|
return $this->body_stream;
|
||||||
|
}
|
||||||
|
}
|
27
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/HTTP/Response.php
vendored
Normal file
27
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/HTTP/Response.php
vendored
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
* SPDX-License-Identifier: Apache-2.0.
|
||||||
|
*/
|
||||||
|
namespace AWS\CRT\HTTP;
|
||||||
|
|
||||||
|
class Response extends Message {
|
||||||
|
private $status_code;
|
||||||
|
|
||||||
|
public function __construct($method, $path, $query, $headers, $status_code) {
|
||||||
|
parent::__construct($method, $path, $query, $headers);
|
||||||
|
$this->status_code = $status_code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function marshall($response) {
|
||||||
|
return parent::marshall($response);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function unmarshall($buf) {
|
||||||
|
return parent::_unmarshall($buf, Response::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function status_code() {
|
||||||
|
return $this->status_code;
|
||||||
|
}
|
||||||
|
}
|
39
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/IO/EventLoopGroup.php
vendored
Normal file
39
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/IO/EventLoopGroup.php
vendored
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
* SPDX-License-Identifier: Apache-2.0.
|
||||||
|
*/
|
||||||
|
namespace AWS\CRT\IO;
|
||||||
|
|
||||||
|
use AWS\CRT\NativeResource as NativeResource;
|
||||||
|
use AWS\CRT\Options as Options;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents 1 or more event loops (1 per thread) for doing I/O and background tasks.
|
||||||
|
* Typically, every application has one EventLoopGroup.
|
||||||
|
*
|
||||||
|
* @param array options:
|
||||||
|
* - int num_threads - Number of worker threads in the EventLoopGroup. Defaults to 0/1 per logical core.
|
||||||
|
*/
|
||||||
|
final class EventLoopGroup extends NativeResource {
|
||||||
|
|
||||||
|
static function defaults() {
|
||||||
|
return [
|
||||||
|
'max_threads' => 0,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
function __construct(array $options = []) {
|
||||||
|
parent::__construct();
|
||||||
|
$options = new Options($options, self::defaults());
|
||||||
|
$elg_options = self::$crt->event_loop_group_options_new();
|
||||||
|
self::$crt->event_loop_group_options_set_max_threads($elg_options, $options->getInt('max_threads'));
|
||||||
|
$this->acquire(self::$crt->event_loop_group_new($elg_options));
|
||||||
|
self::$crt->event_loop_group_options_release($elg_options);
|
||||||
|
}
|
||||||
|
|
||||||
|
function __destruct() {
|
||||||
|
self::$crt->event_loop_group_release($this->release());
|
||||||
|
parent::__destruct();
|
||||||
|
}
|
||||||
|
}
|
50
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/IO/InputStream.php
vendored
Normal file
50
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/IO/InputStream.php
vendored
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
* SPDX-License-Identifier: Apache-2.0.
|
||||||
|
*/
|
||||||
|
namespace AWS\CRT\IO;
|
||||||
|
|
||||||
|
use AWS\CRT\NativeResource as NativeResource;
|
||||||
|
|
||||||
|
final class InputStream extends NativeResource {
|
||||||
|
private $stream = null;
|
||||||
|
|
||||||
|
const SEEK_BEGIN = 0;
|
||||||
|
const SEEK_END = 2;
|
||||||
|
|
||||||
|
public function __construct($stream) {
|
||||||
|
parent::__construct();
|
||||||
|
$this->stream = $stream;
|
||||||
|
$options = self::$crt->input_stream_options_new();
|
||||||
|
// The stream implementation in native just converts the PHP stream into
|
||||||
|
// a native php_stream* and executes operations entirely in native
|
||||||
|
self::$crt->input_stream_options_set_user_data($options, $stream);
|
||||||
|
$this->acquire(self::$crt->input_stream_new($options));
|
||||||
|
self::$crt->input_stream_options_release($options);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __destruct() {
|
||||||
|
$this->release();
|
||||||
|
parent::__destruct();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function eof() {
|
||||||
|
return self::$crt->input_stream_eof($this->native);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function length() {
|
||||||
|
return self::$crt->input_stream_get_length($this->native);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function read($length = 0) {
|
||||||
|
if ($length == 0) {
|
||||||
|
$length = $this->length();
|
||||||
|
}
|
||||||
|
return self::$crt->input_stream_read($this->native, $length);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function seek($offset, $basis) {
|
||||||
|
return self::$crt->input_stream_seek($this->native, $offset, $basis);
|
||||||
|
}
|
||||||
|
}
|
37
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Internal/Encoding.php
vendored
Normal file
37
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Internal/Encoding.php
vendored
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
* SPDX-License-Identifier: Apache-2.0.
|
||||||
|
*/
|
||||||
|
namespace AWS\CRT\Internal;
|
||||||
|
|
||||||
|
final class Encoding {
|
||||||
|
public static function readString(&$buffer) {
|
||||||
|
list($len, $str) = self::decodeString($buffer);
|
||||||
|
// Advance by sizeof(length) + strlen(str)
|
||||||
|
$buffer = substr($buffer, 4 + $len);
|
||||||
|
return $str;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function readStrings($buffer) {
|
||||||
|
$strings = [];
|
||||||
|
while (strlen($buffer)) {
|
||||||
|
$strings []= self::readString($buffer);
|
||||||
|
}
|
||||||
|
return $strings;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function decodeString($buffer) {
|
||||||
|
$len = unpack("N", $buffer)[1];
|
||||||
|
$buffer = substr($buffer, 4);
|
||||||
|
$str = unpack("a{$len}", $buffer)[1];
|
||||||
|
return [$len, $str];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function encodeString($str) {
|
||||||
|
if (is_array($str)) {
|
||||||
|
$str = $str[0];
|
||||||
|
}
|
||||||
|
return pack("Na*", strlen($str), $str);
|
||||||
|
}
|
||||||
|
}
|
29
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Internal/Extension.php
vendored
Normal file
29
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Internal/Extension.php
vendored
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
* SPDX-License-Identifier: Apache-2.0.
|
||||||
|
*/
|
||||||
|
namespace AWS\CRT\Internal;
|
||||||
|
|
||||||
|
use \RuntimeException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
* Forwards calls on to awscrt PHP extension functions
|
||||||
|
*/
|
||||||
|
final class Extension {
|
||||||
|
function __construct() {
|
||||||
|
if (!extension_loaded('awscrt')) {
|
||||||
|
throw new RuntimeException('awscrt extension is not loaded');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Forwards any call made on this object to the extension function of the
|
||||||
|
* same name with the supplied arguments. Argument type hinting and checking
|
||||||
|
* occurs at the CRT wrapper.
|
||||||
|
*/
|
||||||
|
function __call($name, $args) {
|
||||||
|
return call_user_func_array($name, $args);
|
||||||
|
}
|
||||||
|
}
|
47
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Log.php
vendored
Normal file
47
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Log.php
vendored
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
* SPDX-License-Identifier: Apache-2.0.
|
||||||
|
*/
|
||||||
|
namespace AWS\CRT;
|
||||||
|
use AWS\CRT\CRT;
|
||||||
|
|
||||||
|
final class Log {
|
||||||
|
const NONE = 0;
|
||||||
|
const FATAL = 1;
|
||||||
|
const ERROR = 2;
|
||||||
|
const WARN = 3;
|
||||||
|
const INFO = 4;
|
||||||
|
const DEBUG = 5;
|
||||||
|
const TRACE = 6;
|
||||||
|
|
||||||
|
public static function toStdout() {
|
||||||
|
CRT::log_to_stdout();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function toStderr() {
|
||||||
|
CRT::log_to_stderr();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function toFile($filename) {
|
||||||
|
CRT::log_to_file($filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function toStream($stream) {
|
||||||
|
assert(get_resource_type($stream) == "stream");
|
||||||
|
CRT::log_to_stream($stream);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function stop() {
|
||||||
|
CRT::log_stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function setLogLevel($level) {
|
||||||
|
assert($level >= self::NONE && $level <= self::TRACE);
|
||||||
|
CRT::log_set_level($level);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function log($level, $message) {
|
||||||
|
CRT::log_message($level, $message);
|
||||||
|
}
|
||||||
|
}
|
42
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/NativeResource.php
vendored
Normal file
42
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/NativeResource.php
vendored
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
* SPDX-License-Identifier: Apache-2.0.
|
||||||
|
*/
|
||||||
|
namespace AWS\CRT;
|
||||||
|
|
||||||
|
use AWS\CRT\CRT as CRT;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base class for all native resources, tracks all outstanding resources
|
||||||
|
* and provides basic leak checking
|
||||||
|
*/
|
||||||
|
abstract class NativeResource {
|
||||||
|
protected static $crt = null;
|
||||||
|
protected static $resources = [];
|
||||||
|
protected $native = null;
|
||||||
|
|
||||||
|
protected function __construct() {
|
||||||
|
if (is_null(self::$crt)) {
|
||||||
|
self::$crt = new CRT();
|
||||||
|
}
|
||||||
|
|
||||||
|
self::$resources[spl_object_hash($this)] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function acquire($handle) {
|
||||||
|
return $this->native = $handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function release() {
|
||||||
|
$native = $this->native;
|
||||||
|
$this->native = null;
|
||||||
|
return $native;
|
||||||
|
}
|
||||||
|
|
||||||
|
function __destruct() {
|
||||||
|
// Should have been destroyed and released by derived resource
|
||||||
|
assert($this->native == null);
|
||||||
|
unset(self::$resources[spl_object_hash($this)]);
|
||||||
|
}
|
||||||
|
}
|
77
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Options.php
vendored
Normal file
77
lam/lib/3rdParty/composer/aws/aws-crt-php/src/AWS/CRT/Options.php
vendored
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
* SPDX-License-Identifier: Apache-2.0.
|
||||||
|
*/
|
||||||
|
namespace AWS\CRT;
|
||||||
|
|
||||||
|
final class OptionValue {
|
||||||
|
private $value;
|
||||||
|
function __construct($value) {
|
||||||
|
$this->value = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function asObject() {
|
||||||
|
return $this->value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function asMixed() {
|
||||||
|
return $this->value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function asInt() {
|
||||||
|
return empty($this->value) ? 0 : (int)$this->value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function asBool() {
|
||||||
|
return boolval($this->value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function asString() {
|
||||||
|
return !empty($this->value) ? strval($this->value) : "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public function asArray() {
|
||||||
|
return is_array($this->value) ? $this->value : (!empty($this->value) ? [$this->value] : []);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function asCallable() {
|
||||||
|
return is_callable($this->value) ? $this->value : null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
final class Options {
|
||||||
|
private $options;
|
||||||
|
|
||||||
|
public function __construct($opts = [], $defaults = []) {
|
||||||
|
$this->options = array_replace($defaults, empty($opts) ? [] : $opts);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __get($name) {
|
||||||
|
return $this->get($name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function asArray() {
|
||||||
|
return $this->options;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function toArray() {
|
||||||
|
return array_merge_recursive([], $this->options);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get($name) {
|
||||||
|
return new OptionValue($this->options[$name]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getInt($name) {
|
||||||
|
return $this->get($name)->asInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getString($name) {
|
||||||
|
return $this->get($name)->asString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBool($name) {
|
||||||
|
return $this->get($name)->asBool();
|
||||||
|
}
|
||||||
|
}
|
4
lam/lib/3rdParty/composer/aws/aws-sdk-php/CODE_OF_CONDUCT.md
vendored
Normal file
4
lam/lib/3rdParty/composer/aws/aws-sdk-php/CODE_OF_CONDUCT.md
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
## Code of Conduct
|
||||||
|
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
|
||||||
|
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
|
||||||
|
opensource-codeofconduct@amazon.com with any additional questions or comments.
|
4
lam/lib/3rdParty/composer/aws/aws-sdk-php/CRT_INSTRUCTIONS.md
vendored
Normal file
4
lam/lib/3rdParty/composer/aws/aws-sdk-php/CRT_INSTRUCTIONS.md
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
## Building and enabling the Common Run Time
|
||||||
|
|
||||||
|
1. **Follow instructions on crt repo** – Clone and build the repo as shown [here][https://github.com/awslabs/aws-crt-php].
|
||||||
|
1. **Enable the CRT** – add the following line to your php.ini file `extension=path/to/aws-crt-php/modules/awscrt.so`
|
141
lam/lib/3rdParty/composer/aws/aws-sdk-php/LICENSE
vendored
Normal file
141
lam/lib/3rdParty/composer/aws/aws-sdk-php/LICENSE
vendored
Normal file
|
@ -0,0 +1,141 @@
|
||||||
|
# Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
## 1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1
|
||||||
|
through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the
|
||||||
|
License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled
|
||||||
|
by, or are under common control with that entity. For the purposes of this definition, "control" means
|
||||||
|
(i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract
|
||||||
|
or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial
|
||||||
|
ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications, including but not limited to software
|
||||||
|
source code, documentation source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form,
|
||||||
|
including but not limited to compiled object code, generated documentation, and conversions to other media
|
||||||
|
types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License,
|
||||||
|
as indicated by a copyright notice that is included in or attached to the work (an example is provided in the
|
||||||
|
Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from)
|
||||||
|
the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent,
|
||||||
|
as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not
|
||||||
|
include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work
|
||||||
|
and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including the original version of the Work and any
|
||||||
|
modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to
|
||||||
|
Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to
|
||||||
|
submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of
|
||||||
|
electronic, verbal, or written communication sent to the Licensor or its representatives, including but not
|
||||||
|
limited to communication on electronic mailing lists, source code control systems, and issue tracking systems
|
||||||
|
that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise designated in writing by the copyright
|
||||||
|
owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been
|
||||||
|
received by Licensor and subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
## 2. Grant of Copyright License.
|
||||||
|
|
||||||
|
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare
|
||||||
|
Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such
|
||||||
|
Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
## 3. Grant of Patent License.
|
||||||
|
|
||||||
|
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent
|
||||||
|
license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such
|
||||||
|
license applies only to those patent claims licensable by such Contributor that are necessarily infringed by
|
||||||
|
their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such
|
||||||
|
Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim
|
||||||
|
or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work
|
||||||
|
constitutes direct or contributory patent infringement, then any patent licenses granted to You under this
|
||||||
|
License for that Work shall terminate as of the date such litigation is filed.
|
||||||
|
|
||||||
|
## 4. Redistribution.
|
||||||
|
|
||||||
|
You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You meet the following conditions:
|
||||||
|
|
||||||
|
1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
2. You must cause any modified files to carry prominent notices stating that You changed the files; and
|
||||||
|
|
||||||
|
3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent,
|
||||||
|
trademark, and attribution notices from the Source form of the Work, excluding those notices that do
|
||||||
|
not pertain to any part of the Derivative Works; and
|
||||||
|
|
||||||
|
4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that
|
||||||
|
You distribute must include a readable copy of the attribution notices contained within such NOTICE
|
||||||
|
file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed as part of the Derivative Works; within
|
||||||
|
the Source form or documentation, if provided along with the Derivative Works; or, within a display
|
||||||
|
generated by the Derivative Works, if and wherever such third-party notices normally appear. The
|
||||||
|
contents of the NOTICE file are for informational purposes only and do not modify the License. You may
|
||||||
|
add Your own attribution notices within Derivative Works that You distribute, alongside or as an
|
||||||
|
addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be
|
||||||
|
construed as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and may provide additional or different license
|
||||||
|
terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative
|
||||||
|
Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the
|
||||||
|
conditions stated in this License.
|
||||||
|
|
||||||
|
## 5. Submission of Contributions.
|
||||||
|
|
||||||
|
Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by
|
||||||
|
You to the Licensor shall be under the terms and conditions of this License, without any additional terms or
|
||||||
|
conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate
|
||||||
|
license agreement you may have executed with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
## 6. Trademarks.
|
||||||
|
|
||||||
|
This License does not grant permission to use the trade names, trademarks, service marks, or product names of
|
||||||
|
the Licensor, except as required for reasonable and customary use in describing the origin of the Work and
|
||||||
|
reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
## 7. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor
|
||||||
|
provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||||
|
or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,
|
||||||
|
MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of
|
||||||
|
permissions under this License.
|
||||||
|
|
||||||
|
## 8. Limitation of Liability.
|
||||||
|
|
||||||
|
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless
|
||||||
|
required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any
|
||||||
|
Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential
|
||||||
|
damages of any character arising as a result of this License or out of the use or inability to use the Work
|
||||||
|
(including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or
|
||||||
|
any and all other commercial damages or losses), even if such Contributor has been advised of the possibility
|
||||||
|
of such damages.
|
||||||
|
|
||||||
|
## 9. Accepting Warranty or Additional Liability.
|
||||||
|
|
||||||
|
While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for,
|
||||||
|
acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole
|
||||||
|
responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold
|
||||||
|
each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
17
lam/lib/3rdParty/composer/aws/aws-sdk-php/NOTICE
vendored
Normal file
17
lam/lib/3rdParty/composer/aws/aws-sdk-php/NOTICE
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
# AWS SDK for PHP
|
||||||
|
|
||||||
|
<http://aws.amazon.com/php>
|
||||||
|
|
||||||
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License").
|
||||||
|
You may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
84
lam/lib/3rdParty/composer/aws/aws-sdk-php/THIRD-PARTY-LICENSES
vendored
Normal file
84
lam/lib/3rdParty/composer/aws/aws-sdk-php/THIRD-PARTY-LICENSES
vendored
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
The AWS SDK for PHP includes the following third-party software/licensing:
|
||||||
|
|
||||||
|
|
||||||
|
** Guzzle - https://github.com/guzzle/guzzle
|
||||||
|
|
||||||
|
Copyright (c) 2014 Michael Dowling, https://github.com/mtdowling
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
----------------
|
||||||
|
|
||||||
|
** jmespath.php - https://github.com/mtdowling/jmespath.php
|
||||||
|
|
||||||
|
Copyright (c) 2014 Michael Dowling, https://github.com/mtdowling
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
----------------
|
||||||
|
|
||||||
|
** phpunit-mock-objects -- https://github.com/sebastianbergmann/phpunit-mock-objects
|
||||||
|
|
||||||
|
Copyright (c) 2002-2018, Sebastian Bergmann <sebastian@phpunit.de>.
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions
|
||||||
|
are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in
|
||||||
|
the documentation and/or other materials provided with the
|
||||||
|
distribution.
|
||||||
|
|
||||||
|
* Neither the name of Sebastian Bergmann nor the names of his
|
||||||
|
contributors may be used to endorse or promote products derived
|
||||||
|
from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
POSSIBILITY OF SUCH DAMAGE.
|
73
lam/lib/3rdParty/composer/aws/aws-sdk-php/composer.json
vendored
Normal file
73
lam/lib/3rdParty/composer/aws/aws-sdk-php/composer.json
vendored
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
{
|
||||||
|
"name": "aws/aws-sdk-php",
|
||||||
|
"homepage": "http://aws.amazon.com/sdkforphp",
|
||||||
|
"description": "AWS SDK for PHP - Use Amazon Web Services in your PHP project",
|
||||||
|
"keywords": ["aws","amazon","sdk","s3","ec2","dynamodb","cloud","glacier"],
|
||||||
|
"type": "library",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Amazon Web Services",
|
||||||
|
"homepage": "http://aws.amazon.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"forum": "https://github.com/aws/aws-sdk-php/discussions",
|
||||||
|
"issues": "https://github.com/aws/aws-sdk-php/issues"
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=8.1",
|
||||||
|
"guzzlehttp/guzzle": "^7.4.5",
|
||||||
|
"guzzlehttp/psr7": "^2.4.5",
|
||||||
|
"guzzlehttp/promises": "^2.0",
|
||||||
|
"mtdowling/jmespath.php": "^2.8.0",
|
||||||
|
"ext-pcre": "*",
|
||||||
|
"ext-json": "*",
|
||||||
|
"ext-simplexml": "*",
|
||||||
|
"aws/aws-crt-php": "^1.2.3",
|
||||||
|
"psr/http-message": "^2.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"composer/composer" : "^2.7.8",
|
||||||
|
"ext-openssl": "*",
|
||||||
|
"ext-dom": "*",
|
||||||
|
"ext-pcntl": "*",
|
||||||
|
"ext-sockets": "*",
|
||||||
|
"phpunit/phpunit": "^5.6.3 || ^8.5 || ^9.5",
|
||||||
|
"behat/behat": "~3.0",
|
||||||
|
"doctrine/cache": "~1.4",
|
||||||
|
"aws/aws-php-sns-message-validator": "~1.0",
|
||||||
|
"andrewsville/php-token-reflection": "^1.4",
|
||||||
|
"psr/cache": "^2.0 || ^3.0",
|
||||||
|
"psr/simple-cache": "^2.0 || ^3.0",
|
||||||
|
"sebastian/comparator": "^1.2.3 || ^4.0 || ^5.0",
|
||||||
|
"symfony/filesystem": "^v6.4.0 || ^v7.1.0",
|
||||||
|
"yoast/phpunit-polyfills": "^2.0",
|
||||||
|
"dms/phpunit-arraysubset-asserts": "^0.4.0"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages",
|
||||||
|
"ext-curl": "To send requests using cURL",
|
||||||
|
"ext-sockets": "To use client-side monitoring",
|
||||||
|
"doctrine/cache": "To use the DoctrineCacheAdapter",
|
||||||
|
"aws/aws-php-sns-message-validator": "To validate incoming SNS notifications"
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Aws\\": "src/"
|
||||||
|
},
|
||||||
|
"files": ["src/functions.php"],
|
||||||
|
"exclude-from-classmap": ["src/data/"]
|
||||||
|
},
|
||||||
|
"autoload-dev": {
|
||||||
|
"psr-4": {
|
||||||
|
"Aws\\Test\\": "tests/"
|
||||||
|
},
|
||||||
|
"classmap": ["build/"]
|
||||||
|
},
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "3.0-dev"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
157
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/AbstractConfigurationProvider.php
vendored
Normal file
157
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/AbstractConfigurationProvider.php
vendored
Normal file
|
@ -0,0 +1,157 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws;
|
||||||
|
|
||||||
|
use GuzzleHttp\Promise;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A configuration provider is a function that returns a promise that is
|
||||||
|
* fulfilled with a configuration object. This class provides base functionality
|
||||||
|
* usable by specific configuration provider implementations
|
||||||
|
*/
|
||||||
|
abstract class AbstractConfigurationProvider
|
||||||
|
{
|
||||||
|
const ENV_PROFILE = 'AWS_PROFILE';
|
||||||
|
const ENV_CONFIG_FILE = 'AWS_CONFIG_FILE';
|
||||||
|
|
||||||
|
public static $cacheKey;
|
||||||
|
|
||||||
|
protected static $interfaceClass;
|
||||||
|
protected static $exceptionClass;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wraps a config provider and saves provided configuration in an
|
||||||
|
* instance of Aws\CacheInterface. Forwards calls when no config found
|
||||||
|
* in cache and updates cache with the results.
|
||||||
|
*
|
||||||
|
* @param callable $provider Configuration provider function to wrap
|
||||||
|
* @param CacheInterface $cache Cache to store configuration
|
||||||
|
* @param string|null $cacheKey (optional) Cache key to use
|
||||||
|
*
|
||||||
|
* @return callable
|
||||||
|
*/
|
||||||
|
public static function cache(
|
||||||
|
callable $provider,
|
||||||
|
CacheInterface $cache,
|
||||||
|
$cacheKey = null
|
||||||
|
) {
|
||||||
|
$cacheKey = $cacheKey ?: static::$cacheKey;
|
||||||
|
|
||||||
|
return function () use ($provider, $cache, $cacheKey) {
|
||||||
|
$found = $cache->get($cacheKey);
|
||||||
|
if ($found instanceof static::$interfaceClass) {
|
||||||
|
return Promise\Create::promiseFor($found);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $provider()
|
||||||
|
->then(function ($config) use (
|
||||||
|
$cache,
|
||||||
|
$cacheKey
|
||||||
|
) {
|
||||||
|
$cache->set($cacheKey, $config);
|
||||||
|
return $config;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an aggregate configuration provider that invokes the provided
|
||||||
|
* variadic providers one after the other until a provider returns
|
||||||
|
* configuration.
|
||||||
|
*
|
||||||
|
* @return callable
|
||||||
|
*/
|
||||||
|
public static function chain()
|
||||||
|
{
|
||||||
|
$links = func_get_args();
|
||||||
|
if (empty($links)) {
|
||||||
|
throw new \InvalidArgumentException('No providers in chain');
|
||||||
|
}
|
||||||
|
|
||||||
|
return function () use ($links) {
|
||||||
|
/** @var callable $parent */
|
||||||
|
$parent = array_shift($links);
|
||||||
|
$promise = $parent();
|
||||||
|
while ($next = array_shift($links)) {
|
||||||
|
$promise = $promise->otherwise($next);
|
||||||
|
}
|
||||||
|
return $promise;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the environment's HOME directory if available.
|
||||||
|
*
|
||||||
|
* @return null|string
|
||||||
|
*/
|
||||||
|
protected static function getHomeDir()
|
||||||
|
{
|
||||||
|
// On Linux/Unix-like systems, use the HOME environment variable
|
||||||
|
if ($homeDir = getenv('HOME')) {
|
||||||
|
return $homeDir;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the HOMEDRIVE and HOMEPATH values for Windows hosts
|
||||||
|
$homeDrive = getenv('HOMEDRIVE');
|
||||||
|
$homePath = getenv('HOMEPATH');
|
||||||
|
|
||||||
|
return ($homeDrive && $homePath) ? $homeDrive . $homePath : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets default config file location from environment, falling back to aws
|
||||||
|
* default location
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
protected static function getDefaultConfigFilename()
|
||||||
|
{
|
||||||
|
if ($filename = getenv(self::ENV_CONFIG_FILE)) {
|
||||||
|
return $filename;
|
||||||
|
}
|
||||||
|
return self::getHomeDir() . '/.aws/config';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wraps a config provider and caches previously provided configuration.
|
||||||
|
*
|
||||||
|
* @param callable $provider Config provider function to wrap.
|
||||||
|
*
|
||||||
|
* @return callable
|
||||||
|
*/
|
||||||
|
public static function memoize(callable $provider)
|
||||||
|
{
|
||||||
|
return function () use ($provider) {
|
||||||
|
static $result;
|
||||||
|
static $isConstant;
|
||||||
|
|
||||||
|
// Constant config will be returned constantly.
|
||||||
|
if ($isConstant) {
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create the initial promise that will be used as the cached value
|
||||||
|
if (null === $result) {
|
||||||
|
$result = $provider();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return config and set flag that provider is already set
|
||||||
|
return $result
|
||||||
|
->then(function ($config) use (&$isConstant) {
|
||||||
|
$isConstant = true;
|
||||||
|
return $config;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reject promise with standardized exception.
|
||||||
|
*
|
||||||
|
* @param $msg
|
||||||
|
* @return Promise\RejectedPromise
|
||||||
|
*/
|
||||||
|
protected static function reject($msg)
|
||||||
|
{
|
||||||
|
$exceptionClass = static::$exceptionClass;
|
||||||
|
return new Promise\RejectedPromise(new $exceptionClass($msg));
|
||||||
|
}
|
||||||
|
}
|
89
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/AbstractModel.php
vendored
Normal file
89
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/AbstractModel.php
vendored
Normal file
|
@ -0,0 +1,89 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base class that is used by most API shapes
|
||||||
|
*/
|
||||||
|
abstract class AbstractModel implements \ArrayAccess
|
||||||
|
{
|
||||||
|
/** @var array */
|
||||||
|
protected $definition;
|
||||||
|
|
||||||
|
/** @var ShapeMap */
|
||||||
|
protected $shapeMap;
|
||||||
|
|
||||||
|
/** @var array */
|
||||||
|
protected $contextParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array $definition Service description
|
||||||
|
* @param ShapeMap $shapeMap Shapemap used for creating shapes
|
||||||
|
*/
|
||||||
|
public function __construct(array $definition, ShapeMap $shapeMap)
|
||||||
|
{
|
||||||
|
$this->definition = $definition;
|
||||||
|
$this->shapeMap = $shapeMap;
|
||||||
|
if (isset($definition['contextParam'])) {
|
||||||
|
$this->contextParam = $definition['contextParam'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function toArray()
|
||||||
|
{
|
||||||
|
return $this->definition;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return mixed|null
|
||||||
|
*/
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
|
public function offsetGet($offset)
|
||||||
|
{
|
||||||
|
return isset($this->definition[$offset])
|
||||||
|
? $this->definition[$offset] : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
|
public function offsetSet($offset, $value)
|
||||||
|
{
|
||||||
|
$this->definition[$offset] = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
|
public function offsetExists($offset)
|
||||||
|
{
|
||||||
|
return isset($this->definition[$offset]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
|
public function offsetUnset($offset)
|
||||||
|
{
|
||||||
|
unset($this->definition[$offset]);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function shapeAt($key)
|
||||||
|
{
|
||||||
|
if (!isset($this->definition[$key])) {
|
||||||
|
throw new \InvalidArgumentException('Expected shape definition at '
|
||||||
|
. $key);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->shapeFor($this->definition[$key]);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function shapeFor(array $definition)
|
||||||
|
{
|
||||||
|
return isset($definition['shape'])
|
||||||
|
? $this->shapeMap->resolve($definition)
|
||||||
|
: Shape::create($definition, $this->shapeMap);
|
||||||
|
}
|
||||||
|
}
|
244
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/ApiProvider.php
vendored
Normal file
244
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/ApiProvider.php
vendored
Normal file
|
@ -0,0 +1,244 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api;
|
||||||
|
|
||||||
|
use Aws\Exception\UnresolvedApiException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API providers.
|
||||||
|
*
|
||||||
|
* An API provider is a function that accepts a type, service, and version and
|
||||||
|
* returns an array of API data on success or NULL if no API data can be created
|
||||||
|
* for the provided arguments.
|
||||||
|
*
|
||||||
|
* You can wrap your calls to an API provider with the
|
||||||
|
* {@see ApiProvider::resolve} method to ensure that API data is created. If the
|
||||||
|
* API data is not created, then the resolve() method will throw a
|
||||||
|
* {@see Aws\Exception\UnresolvedApiException}.
|
||||||
|
*
|
||||||
|
* use Aws\Api\ApiProvider;
|
||||||
|
* $provider = ApiProvider::defaultProvider();
|
||||||
|
* // Returns an array or NULL.
|
||||||
|
* $data = $provider('api', 's3', '2006-03-01');
|
||||||
|
* // Returns an array or throws.
|
||||||
|
* $data = ApiProvider::resolve($provider, 'api', 'elasticfood', '2020-01-01');
|
||||||
|
*
|
||||||
|
* You can compose multiple providers into a single provider using
|
||||||
|
* {@see Aws\or_chain}. This method accepts providers as arguments and
|
||||||
|
* returns a new function that will invoke each provider until a non-null value
|
||||||
|
* is returned.
|
||||||
|
*
|
||||||
|
* $a = ApiProvider::filesystem(sys_get_temp_dir() . '/aws-beta-models');
|
||||||
|
* $b = ApiProvider::manifest();
|
||||||
|
*
|
||||||
|
* $c = \Aws\or_chain($a, $b);
|
||||||
|
* $data = $c('api', 'betaservice', '2015-08-08'); // $a handles this.
|
||||||
|
* $data = $c('api', 's3', '2006-03-01'); // $b handles this.
|
||||||
|
* $data = $c('api', 'invalid', '2014-12-15'); // Neither handles this.
|
||||||
|
*/
|
||||||
|
class ApiProvider
|
||||||
|
{
|
||||||
|
/** @var array A map of public API type names to their file suffix. */
|
||||||
|
private static $typeMap = [
|
||||||
|
'api' => 'api-2',
|
||||||
|
'paginator' => 'paginators-1',
|
||||||
|
'waiter' => 'waiters-2',
|
||||||
|
'docs' => 'docs-2',
|
||||||
|
];
|
||||||
|
|
||||||
|
/** @var array API manifest */
|
||||||
|
private $manifest;
|
||||||
|
|
||||||
|
/** @var string The directory containing service models. */
|
||||||
|
private $modelsDir;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resolves an API provider and ensures a non-null return value.
|
||||||
|
*
|
||||||
|
* @param callable $provider Provider function to invoke.
|
||||||
|
* @param string $type Type of data ('api', 'waiter', 'paginator').
|
||||||
|
* @param string $service Service name.
|
||||||
|
* @param string $version API version.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
* @throws UnresolvedApiException
|
||||||
|
*/
|
||||||
|
public static function resolve(callable $provider, $type, $service, $version)
|
||||||
|
{
|
||||||
|
// Execute the provider and return the result, if there is one.
|
||||||
|
$result = $provider($type, $service, $version);
|
||||||
|
if (is_array($result)) {
|
||||||
|
if (!isset($result['metadata']['serviceIdentifier'])) {
|
||||||
|
$result['metadata']['serviceIdentifier'] = $service;
|
||||||
|
}
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Throw an exception with a message depending on the inputs.
|
||||||
|
if (!isset(self::$typeMap[$type])) {
|
||||||
|
$msg = "The type must be one of: " . implode(', ', self::$typeMap);
|
||||||
|
} elseif ($service) {
|
||||||
|
$msg = "The {$service} service does not have version: {$version}.";
|
||||||
|
} else {
|
||||||
|
$msg = "You must specify a service name to retrieve its API data.";
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new UnresolvedApiException($msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default SDK API provider.
|
||||||
|
*
|
||||||
|
* This provider loads pre-built manifest data from the `data` directory.
|
||||||
|
*
|
||||||
|
* @return self
|
||||||
|
*/
|
||||||
|
public static function defaultProvider()
|
||||||
|
{
|
||||||
|
return new self(__DIR__ . '/../data', \Aws\manifest());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads API data after resolving the version to the latest, compatible,
|
||||||
|
* available version based on the provided manifest data.
|
||||||
|
*
|
||||||
|
* Manifest data is essentially an associative array of service names to
|
||||||
|
* associative arrays of API version aliases.
|
||||||
|
*
|
||||||
|
* [
|
||||||
|
* ...
|
||||||
|
* 'ec2' => [
|
||||||
|
* 'latest' => '2014-10-01',
|
||||||
|
* '2014-10-01' => '2014-10-01',
|
||||||
|
* '2014-09-01' => '2014-10-01',
|
||||||
|
* '2014-06-15' => '2014-10-01',
|
||||||
|
* ...
|
||||||
|
* ],
|
||||||
|
* 'ecs' => [...],
|
||||||
|
* 'elasticache' => [...],
|
||||||
|
* ...
|
||||||
|
* ]
|
||||||
|
*
|
||||||
|
* @param string $dir Directory containing service models.
|
||||||
|
* @param array $manifest The API version manifest data.
|
||||||
|
*
|
||||||
|
* @return self
|
||||||
|
*/
|
||||||
|
public static function manifest($dir, array $manifest)
|
||||||
|
{
|
||||||
|
return new self($dir, $manifest);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads API data from the specified directory.
|
||||||
|
*
|
||||||
|
* If "latest" is specified as the version, this provider must glob the
|
||||||
|
* directory to find which is the latest available version.
|
||||||
|
*
|
||||||
|
* @param string $dir Directory containing service models.
|
||||||
|
*
|
||||||
|
* @return self
|
||||||
|
* @throws \InvalidArgumentException if the provided `$dir` is invalid.
|
||||||
|
*/
|
||||||
|
public static function filesystem($dir)
|
||||||
|
{
|
||||||
|
return new self($dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves a list of valid versions for the specified service.
|
||||||
|
*
|
||||||
|
* @param string $service Service name
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getVersions($service)
|
||||||
|
{
|
||||||
|
if (!isset($this->manifest)) {
|
||||||
|
$this->buildVersionsList($service);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($this->manifest[$service]['versions'])) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
return array_values(array_unique($this->manifest[$service]['versions']));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the provider.
|
||||||
|
*
|
||||||
|
* @param string $type Type of data ('api', 'waiter', 'paginator').
|
||||||
|
* @param string $service Service name.
|
||||||
|
* @param string $version API version.
|
||||||
|
*
|
||||||
|
* @return array|null
|
||||||
|
*/
|
||||||
|
public function __invoke($type, $service, $version)
|
||||||
|
{
|
||||||
|
// Resolve the type or return null.
|
||||||
|
if (isset(self::$typeMap[$type])) {
|
||||||
|
$type = self::$typeMap[$type];
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Resolve the version or return null.
|
||||||
|
if (!isset($this->manifest)) {
|
||||||
|
$this->buildVersionsList($service);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($this->manifest[$service]['versions'][$version])) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$version = $this->manifest[$service]['versions'][$version];
|
||||||
|
$path = "{$this->modelsDir}/{$service}/{$version}/{$type}.json";
|
||||||
|
|
||||||
|
try {
|
||||||
|
return \Aws\load_compiled_json($path);
|
||||||
|
} catch (\InvalidArgumentException $e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $modelsDir Directory containing service models.
|
||||||
|
* @param array $manifest The API version manifest data.
|
||||||
|
*/
|
||||||
|
private function __construct($modelsDir, ?array $manifest = null)
|
||||||
|
{
|
||||||
|
$this->manifest = $manifest;
|
||||||
|
$this->modelsDir = rtrim($modelsDir, '/');
|
||||||
|
if (!is_dir($this->modelsDir)) {
|
||||||
|
throw new \InvalidArgumentException(
|
||||||
|
"The specified models directory, {$modelsDir}, was not found."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the versions list for the specified service by globbing the dir.
|
||||||
|
*/
|
||||||
|
private function buildVersionsList($service)
|
||||||
|
{
|
||||||
|
$dir = "{$this->modelsDir}/{$service}/";
|
||||||
|
|
||||||
|
if (!is_dir($dir)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get versions, remove . and .., and sort in descending order.
|
||||||
|
$results = array_diff(scandir($dir, SCANDIR_SORT_DESCENDING), ['..', '.']);
|
||||||
|
|
||||||
|
if (!$results) {
|
||||||
|
$this->manifest[$service] = ['versions' => []];
|
||||||
|
} else {
|
||||||
|
$this->manifest[$service] = [
|
||||||
|
'versions' => [
|
||||||
|
'latest' => $results[0]
|
||||||
|
]
|
||||||
|
];
|
||||||
|
$this->manifest[$service]['versions'] += array_combine($results, $results);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
134
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/DateTimeResult.php
vendored
Normal file
134
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/DateTimeResult.php
vendored
Normal file
|
@ -0,0 +1,134 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Aws\Api;
|
||||||
|
|
||||||
|
use Aws\Api\Parser\Exception\ParserException;
|
||||||
|
use DateTime;
|
||||||
|
use DateTimeZone;
|
||||||
|
use Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DateTime overrides that make DateTime work more seamlessly as a string,
|
||||||
|
* with JSON documents, and with JMESPath.
|
||||||
|
*/
|
||||||
|
class DateTimeResult extends \DateTime implements \JsonSerializable
|
||||||
|
{
|
||||||
|
private const ISO8601_NANOSECOND_REGEX = '/^(.*\.\d{6})(\d{1,3})(Z|[+-]\d{2}:\d{2})?$/';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new DateTimeResult from a unix timestamp.
|
||||||
|
* The Unix epoch (or Unix time or POSIX time or Unix
|
||||||
|
* timestamp) is the number of seconds that have elapsed since
|
||||||
|
* January 1, 1970 (midnight UTC/GMT).
|
||||||
|
*
|
||||||
|
* @return DateTimeResult
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static function fromEpoch($unixTimestamp)
|
||||||
|
{
|
||||||
|
if (!is_numeric($unixTimestamp)) {
|
||||||
|
throw new ParserException('Invalid timestamp value passed to DateTimeResult::fromEpoch');
|
||||||
|
}
|
||||||
|
|
||||||
|
// PHP 5.5 does not support sub-second precision
|
||||||
|
if (\PHP_VERSION_ID < 56000) {
|
||||||
|
return new self(gmdate('c', $unixTimestamp));
|
||||||
|
}
|
||||||
|
|
||||||
|
$decimalSeparator = isset(localeconv()['decimal_point']) ? localeconv()['decimal_point'] : ".";
|
||||||
|
$formatString = "U" . $decimalSeparator . "u";
|
||||||
|
$dateTime = DateTime::createFromFormat(
|
||||||
|
$formatString,
|
||||||
|
sprintf('%0.6f', $unixTimestamp),
|
||||||
|
new DateTimeZone('UTC')
|
||||||
|
);
|
||||||
|
|
||||||
|
if (false === $dateTime) {
|
||||||
|
throw new ParserException('Invalid timestamp value passed to DateTimeResult::fromEpoch');
|
||||||
|
}
|
||||||
|
|
||||||
|
return new self(
|
||||||
|
$dateTime->format('Y-m-d H:i:s.u'),
|
||||||
|
new DateTimeZone('UTC')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return DateTimeResult
|
||||||
|
*/
|
||||||
|
public static function fromISO8601($iso8601Timestamp)
|
||||||
|
{
|
||||||
|
if (is_numeric($iso8601Timestamp) || !is_string($iso8601Timestamp)) {
|
||||||
|
throw new ParserException('Invalid timestamp value passed to DateTimeResult::fromISO8601');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prior to 8.0.10, nanosecond precision is not supported
|
||||||
|
// Reduces to microsecond precision if nanosecond precision is detected
|
||||||
|
if (PHP_VERSION_ID < 80010
|
||||||
|
&& preg_match(self::ISO8601_NANOSECOND_REGEX, $iso8601Timestamp, $matches)
|
||||||
|
) {
|
||||||
|
$iso8601Timestamp = $matches[1] . ($matches[3] ?? '');
|
||||||
|
}
|
||||||
|
|
||||||
|
return new DateTimeResult($iso8601Timestamp);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new DateTimeResult from an unknown timestamp.
|
||||||
|
*
|
||||||
|
* @return DateTimeResult
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static function fromTimestamp($timestamp, $expectedFormat = null)
|
||||||
|
{
|
||||||
|
if (empty($timestamp)) {
|
||||||
|
return self::fromEpoch(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(is_string($timestamp) || is_numeric($timestamp))) {
|
||||||
|
throw new ParserException('Invalid timestamp value passed to DateTimeResult::fromTimestamp');
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
if ($expectedFormat == 'iso8601') {
|
||||||
|
try {
|
||||||
|
return self::fromISO8601($timestamp);
|
||||||
|
} catch (Exception $exception) {
|
||||||
|
return self::fromEpoch($timestamp);
|
||||||
|
}
|
||||||
|
} else if ($expectedFormat == 'unixTimestamp') {
|
||||||
|
try {
|
||||||
|
return self::fromEpoch($timestamp);
|
||||||
|
} catch (Exception $exception) {
|
||||||
|
return self::fromISO8601($timestamp);
|
||||||
|
}
|
||||||
|
} else if (\Aws\is_valid_epoch($timestamp)) {
|
||||||
|
return self::fromEpoch($timestamp);
|
||||||
|
}
|
||||||
|
return self::fromISO8601($timestamp);
|
||||||
|
} catch (Exception $exception) {
|
||||||
|
throw new ParserException('Invalid timestamp value passed to DateTimeResult::fromTimestamp');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serialize the DateTimeResult as an ISO 8601 date string.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function __toString()
|
||||||
|
{
|
||||||
|
return $this->format('c');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serialize the date as an ISO 8601 date when serializing as JSON.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
|
public function jsonSerialize()
|
||||||
|
{
|
||||||
|
return (string) $this;
|
||||||
|
}
|
||||||
|
}
|
139
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/DocModel.php
vendored
Normal file
139
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/DocModel.php
vendored
Normal file
|
@ -0,0 +1,139 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Encapsulates the documentation strings for a given service-version and
|
||||||
|
* provides methods for extracting the desired parts related to a service,
|
||||||
|
* operation, error, or shape (i.e., parameter).
|
||||||
|
*/
|
||||||
|
class DocModel
|
||||||
|
{
|
||||||
|
/** @var array */
|
||||||
|
private $docs;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array $docs
|
||||||
|
*
|
||||||
|
* @throws \RuntimeException
|
||||||
|
*/
|
||||||
|
public function __construct(array $docs)
|
||||||
|
{
|
||||||
|
if (!extension_loaded('tidy')) {
|
||||||
|
throw new \RuntimeException('The "tidy" PHP extension is required.');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->docs = $docs;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert the doc model to an array.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function toArray()
|
||||||
|
{
|
||||||
|
return $this->docs;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves documentation about the service.
|
||||||
|
*
|
||||||
|
* @return null|string
|
||||||
|
*/
|
||||||
|
public function getServiceDocs()
|
||||||
|
{
|
||||||
|
return isset($this->docs['service']) ? $this->docs['service'] : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves documentation about an operation.
|
||||||
|
*
|
||||||
|
* @param string $operation Name of the operation
|
||||||
|
*
|
||||||
|
* @return null|string
|
||||||
|
*/
|
||||||
|
public function getOperationDocs($operation)
|
||||||
|
{
|
||||||
|
return isset($this->docs['operations'][$operation])
|
||||||
|
? $this->docs['operations'][$operation]
|
||||||
|
: null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves documentation about an error.
|
||||||
|
*
|
||||||
|
* @param string $error Name of the error
|
||||||
|
*
|
||||||
|
* @return null|string
|
||||||
|
*/
|
||||||
|
public function getErrorDocs($error)
|
||||||
|
{
|
||||||
|
return isset($this->docs['shapes'][$error]['base'])
|
||||||
|
? $this->docs['shapes'][$error]['base']
|
||||||
|
: null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves documentation about a shape, specific to the context.
|
||||||
|
*
|
||||||
|
* @param string $shapeName Name of the shape.
|
||||||
|
* @param string $parentName Name of the parent/context shape.
|
||||||
|
* @param string $ref Name used by the context to reference the shape.
|
||||||
|
*
|
||||||
|
* @return null|string
|
||||||
|
*/
|
||||||
|
public function getShapeDocs($shapeName, $parentName, $ref)
|
||||||
|
{
|
||||||
|
if (!isset($this->docs['shapes'][$shapeName])) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = '';
|
||||||
|
$d = $this->docs['shapes'][$shapeName];
|
||||||
|
if (isset($d['refs']["{$parentName}\${$ref}"])) {
|
||||||
|
$result = $d['refs']["{$parentName}\${$ref}"];
|
||||||
|
} elseif (isset($d['base'])) {
|
||||||
|
$result = $d['base'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($d['append'])) {
|
||||||
|
if (!isset($d['excludeAppend'])
|
||||||
|
|| !in_array($parentName, $d['excludeAppend'])
|
||||||
|
) {
|
||||||
|
$result .= $d['append'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($d['appendOnly'])
|
||||||
|
&& in_array($parentName, $d['appendOnly']['shapes'])
|
||||||
|
) {
|
||||||
|
$result .= $d['appendOnly']['message'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->clean($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private function clean($content)
|
||||||
|
{
|
||||||
|
if (!$content) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$tidy = new \tidy();
|
||||||
|
$tidy->parseString($content, [
|
||||||
|
'indent' => true,
|
||||||
|
'doctype' => 'omit',
|
||||||
|
'output-html' => true,
|
||||||
|
'show-body-only' => true,
|
||||||
|
'drop-empty-paras' => true,
|
||||||
|
'clean' => true,
|
||||||
|
'drop-proprietary-attributes' => true,
|
||||||
|
'hide-comments' => true,
|
||||||
|
'logical-emphasis' => true
|
||||||
|
]);
|
||||||
|
$tidy->cleanRepair();
|
||||||
|
|
||||||
|
return (string) $content;
|
||||||
|
}
|
||||||
|
}
|
95
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/ErrorParser/AbstractErrorParser.php
vendored
Normal file
95
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/ErrorParser/AbstractErrorParser.php
vendored
Normal file
|
@ -0,0 +1,95 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api\ErrorParser;
|
||||||
|
|
||||||
|
use Aws\Api\Parser\MetadataParserTrait;
|
||||||
|
use Aws\Api\Parser\PayloadParserTrait;
|
||||||
|
use Aws\Api\Service;
|
||||||
|
use Aws\Api\StructureShape;
|
||||||
|
use Aws\CommandInterface;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
|
abstract class AbstractErrorParser
|
||||||
|
{
|
||||||
|
use MetadataParserTrait;
|
||||||
|
use PayloadParserTrait;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Service
|
||||||
|
*/
|
||||||
|
protected $api;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Service $api
|
||||||
|
*/
|
||||||
|
public function __construct(?Service $api = null)
|
||||||
|
{
|
||||||
|
$this->api = $api;
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract protected function payload(
|
||||||
|
ResponseInterface $response,
|
||||||
|
StructureShape $member
|
||||||
|
);
|
||||||
|
|
||||||
|
protected function extractPayload(
|
||||||
|
StructureShape $member,
|
||||||
|
ResponseInterface $response
|
||||||
|
) {
|
||||||
|
if ($member instanceof StructureShape) {
|
||||||
|
// Structure members parse top-level data into a specific key.
|
||||||
|
return $this->payload($response, $member);
|
||||||
|
} else {
|
||||||
|
// Streaming data is just the stream from the response body.
|
||||||
|
return $response->getBody();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function populateShape(
|
||||||
|
array &$data,
|
||||||
|
ResponseInterface $response,
|
||||||
|
?CommandInterface $command = null
|
||||||
|
) {
|
||||||
|
$data['body'] = [];
|
||||||
|
|
||||||
|
if (!empty($command) && !empty($this->api)) {
|
||||||
|
|
||||||
|
// If modeled error code is indicated, check for known error shape
|
||||||
|
if (!empty($data['code'])) {
|
||||||
|
|
||||||
|
$errors = $this->api->getOperation($command->getName())->getErrors();
|
||||||
|
foreach ($errors as $key => $error) {
|
||||||
|
|
||||||
|
// If error code matches a known error shape, populate the body
|
||||||
|
if ($data['code'] == $error['name']
|
||||||
|
&& $error instanceof StructureShape
|
||||||
|
) {
|
||||||
|
$modeledError = $error;
|
||||||
|
$data['body'] = $this->extractPayload(
|
||||||
|
$modeledError,
|
||||||
|
$response
|
||||||
|
);
|
||||||
|
$data['error_shape'] = $modeledError;
|
||||||
|
|
||||||
|
foreach ($error->getMembers() as $name => $member) {
|
||||||
|
switch ($member['location']) {
|
||||||
|
case 'header':
|
||||||
|
$this->extractHeader($name, $member, $response, $data['body']);
|
||||||
|
break;
|
||||||
|
case 'headers':
|
||||||
|
$this->extractHeaders($name, $member, $response, $data['body']);
|
||||||
|
break;
|
||||||
|
case 'statusCode':
|
||||||
|
$this->extractStatus($name, $response, $data['body']);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
}
|
52
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/ErrorParser/JsonParserTrait.php
vendored
Normal file
52
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/ErrorParser/JsonParserTrait.php
vendored
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api\ErrorParser;
|
||||||
|
|
||||||
|
use Aws\Api\Parser\PayloadParserTrait;
|
||||||
|
use Aws\Api\StructureShape;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides basic JSON error parsing functionality.
|
||||||
|
*/
|
||||||
|
trait JsonParserTrait
|
||||||
|
{
|
||||||
|
use PayloadParserTrait;
|
||||||
|
|
||||||
|
private function genericHandler(ResponseInterface $response)
|
||||||
|
{
|
||||||
|
$code = (string) $response->getStatusCode();
|
||||||
|
if ($this->api
|
||||||
|
&& !is_null($this->api->getMetadata('awsQueryCompatible'))
|
||||||
|
&& $response->getHeaderLine('x-amzn-query-error')
|
||||||
|
) {
|
||||||
|
$queryError = $response->getHeaderLine('x-amzn-query-error');
|
||||||
|
$parts = explode(';', $queryError);
|
||||||
|
if (isset($parts) && count($parts) == 2 && $parts[0] && $parts[1]) {
|
||||||
|
$error_code = $parts[0];
|
||||||
|
$error_type = $parts[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!isset($error_type)) {
|
||||||
|
$error_type = $code[0] == '4' ? 'client' : 'server';
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
'request_id' => (string) $response->getHeaderLine('x-amzn-requestid'),
|
||||||
|
'code' => isset($error_code) ? $error_code : null,
|
||||||
|
'message' => null,
|
||||||
|
'type' => $error_type,
|
||||||
|
'parsed' => $this->parseJson($response->getBody(), $response)
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function payload(
|
||||||
|
ResponseInterface $response,
|
||||||
|
StructureShape $member
|
||||||
|
) {
|
||||||
|
$jsonBody = $this->parseJson($response->getBody(), $response);
|
||||||
|
|
||||||
|
if ($jsonBody) {
|
||||||
|
return $this->parser->parse($member, $jsonBody);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
49
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/ErrorParser/JsonRpcErrorParser.php
vendored
Normal file
49
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/ErrorParser/JsonRpcErrorParser.php
vendored
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api\ErrorParser;
|
||||||
|
|
||||||
|
use Aws\Api\Parser\JsonParser;
|
||||||
|
use Aws\Api\Service;
|
||||||
|
use Aws\CommandInterface;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parsers JSON-RPC errors.
|
||||||
|
*/
|
||||||
|
class JsonRpcErrorParser extends AbstractErrorParser
|
||||||
|
{
|
||||||
|
use JsonParserTrait;
|
||||||
|
|
||||||
|
private $parser;
|
||||||
|
|
||||||
|
public function __construct(?Service $api = null, ?JsonParser $parser = null)
|
||||||
|
{
|
||||||
|
parent::__construct($api);
|
||||||
|
$this->parser = $parser ?: new JsonParser();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __invoke(
|
||||||
|
ResponseInterface $response,
|
||||||
|
?CommandInterface $command = null
|
||||||
|
) {
|
||||||
|
$data = $this->genericHandler($response);
|
||||||
|
|
||||||
|
// Make the casing consistent across services.
|
||||||
|
if ($data['parsed']) {
|
||||||
|
$data['parsed'] = array_change_key_case($data['parsed']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($data['parsed']['__type'])) {
|
||||||
|
if (!isset($data['code'])) {
|
||||||
|
$parts = explode('#', $data['parsed']['__type']);
|
||||||
|
$data['code'] = isset($parts[1]) ? $parts[1] : $parts[0];
|
||||||
|
}
|
||||||
|
$data['message'] = isset($data['parsed']['message'])
|
||||||
|
? $data['parsed']['message']
|
||||||
|
: null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->populateShape($data, $response, $command);
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
}
|
58
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/ErrorParser/RestJsonErrorParser.php
vendored
Normal file
58
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/ErrorParser/RestJsonErrorParser.php
vendored
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api\ErrorParser;
|
||||||
|
|
||||||
|
use Aws\Api\Parser\JsonParser;
|
||||||
|
use Aws\Api\Service;
|
||||||
|
use Aws\Api\StructureShape;
|
||||||
|
use Aws\CommandInterface;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses JSON-REST errors.
|
||||||
|
*/
|
||||||
|
class RestJsonErrorParser extends AbstractErrorParser
|
||||||
|
{
|
||||||
|
use JsonParserTrait;
|
||||||
|
|
||||||
|
private $parser;
|
||||||
|
|
||||||
|
public function __construct(?Service $api = null, ?JsonParser $parser = null)
|
||||||
|
{
|
||||||
|
parent::__construct($api);
|
||||||
|
$this->parser = $parser ?: new JsonParser();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __invoke(
|
||||||
|
ResponseInterface $response,
|
||||||
|
?CommandInterface $command = null
|
||||||
|
) {
|
||||||
|
$data = $this->genericHandler($response);
|
||||||
|
|
||||||
|
// Merge in error data from the JSON body
|
||||||
|
if ($json = $data['parsed']) {
|
||||||
|
$data = array_replace($data, $json);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Correct error type from services like Amazon Glacier
|
||||||
|
if (!empty($data['type'])) {
|
||||||
|
$data['type'] = strtolower($data['type']);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Retrieve the error code from services like Amazon Elastic Transcoder
|
||||||
|
if ($code = $response->getHeaderLine('x-amzn-errortype')) {
|
||||||
|
$colon = strpos($code, ':');
|
||||||
|
$data['code'] = $colon ? substr($code, 0, $colon) : $code;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Retrieve error message directly
|
||||||
|
$data['message'] = isset($data['parsed']['message'])
|
||||||
|
? $data['parsed']['message']
|
||||||
|
: (isset($data['parsed']['Message'])
|
||||||
|
? $data['parsed']['Message']
|
||||||
|
: null);
|
||||||
|
|
||||||
|
$this->populateShape($data, $response, $command);
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
}
|
111
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/ErrorParser/XmlErrorParser.php
vendored
Normal file
111
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/ErrorParser/XmlErrorParser.php
vendored
Normal file
|
@ -0,0 +1,111 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api\ErrorParser;
|
||||||
|
|
||||||
|
use Aws\Api\Parser\PayloadParserTrait;
|
||||||
|
use Aws\Api\Parser\XmlParser;
|
||||||
|
use Aws\Api\Service;
|
||||||
|
use Aws\Api\StructureShape;
|
||||||
|
use Aws\CommandInterface;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses XML errors.
|
||||||
|
*/
|
||||||
|
class XmlErrorParser extends AbstractErrorParser
|
||||||
|
{
|
||||||
|
use PayloadParserTrait;
|
||||||
|
|
||||||
|
protected $parser;
|
||||||
|
|
||||||
|
public function __construct(?Service $api = null, ?XmlParser $parser = null)
|
||||||
|
{
|
||||||
|
parent::__construct($api);
|
||||||
|
$this->parser = $parser ?: new XmlParser();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __invoke(
|
||||||
|
ResponseInterface $response,
|
||||||
|
?CommandInterface $command = null
|
||||||
|
) {
|
||||||
|
$code = (string) $response->getStatusCode();
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'type' => $code[0] == '4' ? 'client' : 'server',
|
||||||
|
'request_id' => null,
|
||||||
|
'code' => null,
|
||||||
|
'message' => null,
|
||||||
|
'parsed' => null
|
||||||
|
];
|
||||||
|
|
||||||
|
$body = $response->getBody();
|
||||||
|
if ($body->getSize() > 0) {
|
||||||
|
$this->parseBody($this->parseXml($body, $response), $data);
|
||||||
|
} else {
|
||||||
|
$this->parseHeaders($response, $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->populateShape($data, $response, $command);
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function parseHeaders(ResponseInterface $response, array &$data)
|
||||||
|
{
|
||||||
|
if ($response->getStatusCode() == '404') {
|
||||||
|
$data['code'] = 'NotFound';
|
||||||
|
}
|
||||||
|
|
||||||
|
$data['message'] = $response->getStatusCode() . ' '
|
||||||
|
. $response->getReasonPhrase();
|
||||||
|
|
||||||
|
if ($requestId = $response->getHeaderLine('x-amz-request-id')) {
|
||||||
|
$data['request_id'] = $requestId;
|
||||||
|
$data['message'] .= " (Request-ID: $requestId)";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function parseBody(\SimpleXMLElement $body, array &$data)
|
||||||
|
{
|
||||||
|
$data['parsed'] = $body;
|
||||||
|
$prefix = $this->registerNamespacePrefix($body);
|
||||||
|
|
||||||
|
if ($tempXml = $body->xpath("//{$prefix}Code[1]")) {
|
||||||
|
$data['code'] = (string) $tempXml[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($tempXml = $body->xpath("//{$prefix}Message[1]")) {
|
||||||
|
$data['message'] = (string) $tempXml[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
$tempXml = $body->xpath("//{$prefix}RequestId[1]");
|
||||||
|
if (isset($tempXml[0])) {
|
||||||
|
$data['request_id'] = (string)$tempXml[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function registerNamespacePrefix(\SimpleXMLElement $element)
|
||||||
|
{
|
||||||
|
$namespaces = $element->getDocNamespaces();
|
||||||
|
if (!isset($namespaces[''])) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Account for the default namespace being defined and PHP not
|
||||||
|
// being able to handle it :(.
|
||||||
|
$element->registerXPathNamespace('ns', $namespaces['']);
|
||||||
|
return 'ns:';
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function payload(
|
||||||
|
ResponseInterface $response,
|
||||||
|
StructureShape $member
|
||||||
|
) {
|
||||||
|
$xmlBody = $this->parseXml($response->getBody(), $response);
|
||||||
|
$prefix = $this->registerNamespacePrefix($xmlBody);
|
||||||
|
$errorBody = $xmlBody->xpath("//{$prefix}Error");
|
||||||
|
|
||||||
|
if (is_array($errorBody) && !empty($errorBody[0])) {
|
||||||
|
return $this->parser->parse($member, $errorBody[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
35
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/ListShape.php
vendored
Normal file
35
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/ListShape.php
vendored
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a list shape.
|
||||||
|
*/
|
||||||
|
class ListShape extends Shape
|
||||||
|
{
|
||||||
|
private $member;
|
||||||
|
|
||||||
|
public function __construct(array $definition, ShapeMap $shapeMap)
|
||||||
|
{
|
||||||
|
$definition['type'] = 'list';
|
||||||
|
parent::__construct($definition, $shapeMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Shape
|
||||||
|
* @throws \RuntimeException if no member is specified
|
||||||
|
*/
|
||||||
|
public function getMember()
|
||||||
|
{
|
||||||
|
if (!$this->member) {
|
||||||
|
if (!isset($this->definition['member'])) {
|
||||||
|
throw new \RuntimeException('No member attribute specified');
|
||||||
|
}
|
||||||
|
$this->member = Shape::create(
|
||||||
|
$this->definition['member'],
|
||||||
|
$this->shapeMap
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->member;
|
||||||
|
}
|
||||||
|
}
|
54
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/MapShape.php
vendored
Normal file
54
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/MapShape.php
vendored
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a map shape.
|
||||||
|
*/
|
||||||
|
class MapShape extends Shape
|
||||||
|
{
|
||||||
|
/** @var Shape */
|
||||||
|
private $value;
|
||||||
|
|
||||||
|
/** @var Shape */
|
||||||
|
private $key;
|
||||||
|
|
||||||
|
public function __construct(array $definition, ShapeMap $shapeMap)
|
||||||
|
{
|
||||||
|
$definition['type'] = 'map';
|
||||||
|
parent::__construct($definition, $shapeMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Shape
|
||||||
|
* @throws \RuntimeException if no value is specified
|
||||||
|
*/
|
||||||
|
public function getValue()
|
||||||
|
{
|
||||||
|
if (!$this->value) {
|
||||||
|
if (!isset($this->definition['value'])) {
|
||||||
|
throw new \RuntimeException('No value specified');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->value = Shape::create(
|
||||||
|
$this->definition['value'],
|
||||||
|
$this->shapeMap
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Shape
|
||||||
|
*/
|
||||||
|
public function getKey()
|
||||||
|
{
|
||||||
|
if (!$this->key) {
|
||||||
|
$this->key = isset($this->definition['key'])
|
||||||
|
? Shape::create($this->definition['key'], $this->shapeMap)
|
||||||
|
: new Shape(['type' => 'string'], $this->shapeMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->key;
|
||||||
|
}
|
||||||
|
}
|
158
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Operation.php
vendored
Normal file
158
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Operation.php
vendored
Normal file
|
@ -0,0 +1,158 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents an API operation.
|
||||||
|
*/
|
||||||
|
class Operation extends AbstractModel
|
||||||
|
{
|
||||||
|
private $input;
|
||||||
|
private $output;
|
||||||
|
private $errors;
|
||||||
|
private $staticContextParams = [];
|
||||||
|
private $contextParams;
|
||||||
|
private $operationContextParams = [];
|
||||||
|
|
||||||
|
public function __construct(array $definition, ShapeMap $shapeMap)
|
||||||
|
{
|
||||||
|
$definition['type'] = 'structure';
|
||||||
|
|
||||||
|
if (!isset($definition['http']['method'])) {
|
||||||
|
$definition['http']['method'] = 'POST';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($definition['http']['requestUri'])) {
|
||||||
|
$definition['http']['requestUri'] = '/';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($definition['staticContextParams'])) {
|
||||||
|
$this->staticContextParams = $definition['staticContextParams'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($definition['operationContextParams'])) {
|
||||||
|
$this->operationContextParams = $definition['operationContextParams'];
|
||||||
|
}
|
||||||
|
|
||||||
|
parent::__construct($definition, $shapeMap);
|
||||||
|
$this->contextParams = $this->setContextParams();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an associative array of the HTTP attribute of the operation:
|
||||||
|
*
|
||||||
|
* - method: HTTP method of the operation
|
||||||
|
* - requestUri: URI of the request (can include URI template placeholders)
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getHttp()
|
||||||
|
{
|
||||||
|
return $this->definition['http'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the input shape of the operation.
|
||||||
|
*
|
||||||
|
* @return StructureShape
|
||||||
|
*/
|
||||||
|
public function getInput()
|
||||||
|
{
|
||||||
|
if (!$this->input) {
|
||||||
|
if ($input = $this['input']) {
|
||||||
|
$this->input = $this->shapeFor($input);
|
||||||
|
} else {
|
||||||
|
$this->input = new StructureShape([], $this->shapeMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->input;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the output shape of the operation.
|
||||||
|
*
|
||||||
|
* @return StructureShape
|
||||||
|
*/
|
||||||
|
public function getOutput()
|
||||||
|
{
|
||||||
|
if (!$this->output) {
|
||||||
|
if ($output = $this['output']) {
|
||||||
|
$this->output = $this->shapeFor($output);
|
||||||
|
} else {
|
||||||
|
$this->output = new StructureShape([], $this->shapeMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->output;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get an array of operation error shapes.
|
||||||
|
*
|
||||||
|
* @return Shape[]
|
||||||
|
*/
|
||||||
|
public function getErrors()
|
||||||
|
{
|
||||||
|
if ($this->errors === null) {
|
||||||
|
if ($errors = $this['errors']) {
|
||||||
|
foreach ($errors as $key => $error) {
|
||||||
|
$errors[$key] = $this->shapeFor($error);
|
||||||
|
}
|
||||||
|
$this->errors = $errors;
|
||||||
|
} else {
|
||||||
|
$this->errors = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->errors;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets static modeled static values used for
|
||||||
|
* endpoint resolution.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getStaticContextParams()
|
||||||
|
{
|
||||||
|
return $this->staticContextParams;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets definition of modeled dynamic values used
|
||||||
|
* for endpoint resolution
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getContextParams()
|
||||||
|
{
|
||||||
|
return $this->contextParams;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets definition of modeled dynamic values used
|
||||||
|
* for endpoint resolution
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getOperationContextParams(): array
|
||||||
|
{
|
||||||
|
return $this->operationContextParams;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function setContextParams()
|
||||||
|
{
|
||||||
|
$members = $this->getInput()->getMembers();
|
||||||
|
$contextParams = [];
|
||||||
|
|
||||||
|
foreach($members as $name => $shape) {
|
||||||
|
if (!empty($contextParam = $shape->getContextParam())) {
|
||||||
|
$contextParams[$contextParam['name']] = [
|
||||||
|
'shape' => $name,
|
||||||
|
'type' => $shape->getType()
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $contextParams;
|
||||||
|
}
|
||||||
|
}
|
46
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/AbstractParser.php
vendored
Normal file
46
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/AbstractParser.php
vendored
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api\Parser;
|
||||||
|
|
||||||
|
use Aws\Api\Service;
|
||||||
|
use Aws\Api\StructureShape;
|
||||||
|
use Aws\CommandInterface;
|
||||||
|
use Aws\ResultInterface;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
use Psr\Http\Message\StreamInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
abstract class AbstractParser
|
||||||
|
{
|
||||||
|
/** @var \Aws\Api\Service Representation of the service API*/
|
||||||
|
protected $api;
|
||||||
|
|
||||||
|
/** @var callable */
|
||||||
|
protected $parser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Service $api Service description.
|
||||||
|
*/
|
||||||
|
public function __construct(Service $api)
|
||||||
|
{
|
||||||
|
$this->api = $api;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param CommandInterface $command Command that was executed.
|
||||||
|
* @param ResponseInterface $response Response that was received.
|
||||||
|
*
|
||||||
|
* @return ResultInterface
|
||||||
|
*/
|
||||||
|
abstract public function __invoke(
|
||||||
|
CommandInterface $command,
|
||||||
|
ResponseInterface $response
|
||||||
|
);
|
||||||
|
|
||||||
|
abstract public function parseMemberFromStream(
|
||||||
|
StreamInterface $stream,
|
||||||
|
StructureShape $member,
|
||||||
|
$response
|
||||||
|
);
|
||||||
|
}
|
184
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/AbstractRestParser.php
vendored
Normal file
184
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/AbstractRestParser.php
vendored
Normal file
|
@ -0,0 +1,184 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api\Parser;
|
||||||
|
|
||||||
|
use Aws\Api\DateTimeResult;
|
||||||
|
use Aws\Api\Shape;
|
||||||
|
use Aws\Api\StructureShape;
|
||||||
|
use Aws\Result;
|
||||||
|
use Aws\CommandInterface;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
abstract class AbstractRestParser extends AbstractParser
|
||||||
|
{
|
||||||
|
use PayloadParserTrait;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses a payload from a response.
|
||||||
|
*
|
||||||
|
* @param ResponseInterface $response Response to parse.
|
||||||
|
* @param StructureShape $member Member to parse
|
||||||
|
* @param array $result Result value
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
abstract protected function payload(
|
||||||
|
ResponseInterface $response,
|
||||||
|
StructureShape $member,
|
||||||
|
array &$result
|
||||||
|
);
|
||||||
|
|
||||||
|
public function __invoke(
|
||||||
|
CommandInterface $command,
|
||||||
|
ResponseInterface $response
|
||||||
|
) {
|
||||||
|
$output = $this->api->getOperation($command->getName())->getOutput();
|
||||||
|
$result = [];
|
||||||
|
|
||||||
|
if ($payload = $output['payload']) {
|
||||||
|
$this->extractPayload($payload, $output, $response, $result);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($output->getMembers() as $name => $member) {
|
||||||
|
switch ($member['location']) {
|
||||||
|
case 'header':
|
||||||
|
$this->extractHeader($name, $member, $response, $result);
|
||||||
|
break;
|
||||||
|
case 'headers':
|
||||||
|
$this->extractHeaders($name, $member, $response, $result);
|
||||||
|
break;
|
||||||
|
case 'statusCode':
|
||||||
|
$this->extractStatus($name, $response, $result);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$payload
|
||||||
|
&& $response->getBody()->getSize() > 0
|
||||||
|
&& count($output->getMembers()) > 0
|
||||||
|
) {
|
||||||
|
// if no payload was found, then parse the contents of the body
|
||||||
|
$this->payload($response, $output, $result);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Result($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function extractPayload(
|
||||||
|
$payload,
|
||||||
|
StructureShape $output,
|
||||||
|
ResponseInterface $response,
|
||||||
|
array &$result
|
||||||
|
) {
|
||||||
|
$member = $output->getMember($payload);
|
||||||
|
|
||||||
|
if (!empty($member['eventstream'])) {
|
||||||
|
$result[$payload] = new EventParsingIterator(
|
||||||
|
$response->getBody(),
|
||||||
|
$member,
|
||||||
|
$this
|
||||||
|
);
|
||||||
|
} else if ($member instanceof StructureShape) {
|
||||||
|
// Structure members parse top-level data into a specific key.
|
||||||
|
$result[$payload] = [];
|
||||||
|
$this->payload($response, $member, $result[$payload]);
|
||||||
|
} else {
|
||||||
|
// Streaming data is just the stream from the response body.
|
||||||
|
$result[$payload] = $response->getBody();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extract a single header from the response into the result.
|
||||||
|
*/
|
||||||
|
private function extractHeader(
|
||||||
|
$name,
|
||||||
|
Shape $shape,
|
||||||
|
ResponseInterface $response,
|
||||||
|
&$result
|
||||||
|
) {
|
||||||
|
$value = $response->getHeaderLine($shape['locationName'] ?: $name);
|
||||||
|
|
||||||
|
switch ($shape->getType()) {
|
||||||
|
case 'float':
|
||||||
|
case 'double':
|
||||||
|
$value = (float) $value;
|
||||||
|
break;
|
||||||
|
case 'long':
|
||||||
|
$value = (int) $value;
|
||||||
|
break;
|
||||||
|
case 'boolean':
|
||||||
|
$value = filter_var($value, FILTER_VALIDATE_BOOLEAN);
|
||||||
|
break;
|
||||||
|
case 'blob':
|
||||||
|
$value = base64_decode($value);
|
||||||
|
break;
|
||||||
|
case 'timestamp':
|
||||||
|
try {
|
||||||
|
$value = DateTimeResult::fromTimestamp(
|
||||||
|
$value,
|
||||||
|
!empty($shape['timestampFormat']) ? $shape['timestampFormat'] : null
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
// If the value cannot be parsed, then do not add it to the
|
||||||
|
// output structure.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
case 'string':
|
||||||
|
try {
|
||||||
|
if ($shape['jsonvalue']) {
|
||||||
|
$value = $this->parseJson(base64_decode($value), $response);
|
||||||
|
}
|
||||||
|
|
||||||
|
// If value is not set, do not add to output structure.
|
||||||
|
if (!isset($value)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
//If the value cannot be parsed, then do not add it to the
|
||||||
|
//output structure.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$result[$name] = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extract a map of headers with an optional prefix from the response.
|
||||||
|
*/
|
||||||
|
private function extractHeaders(
|
||||||
|
$name,
|
||||||
|
Shape $shape,
|
||||||
|
ResponseInterface $response,
|
||||||
|
&$result
|
||||||
|
) {
|
||||||
|
// Check if the headers are prefixed by a location name
|
||||||
|
$result[$name] = [];
|
||||||
|
$prefix = $shape['locationName'];
|
||||||
|
$prefixLen = $prefix !== null ? strlen($prefix) : 0;
|
||||||
|
|
||||||
|
foreach ($response->getHeaders() as $k => $values) {
|
||||||
|
if (!$prefixLen) {
|
||||||
|
$result[$name][$k] = implode(', ', $values);
|
||||||
|
} elseif (stripos($k, $prefix) === 0) {
|
||||||
|
$result[$name][substr($k, $prefixLen)] = implode(', ', $values);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Places the status code of the response into the result array.
|
||||||
|
*/
|
||||||
|
private function extractStatus(
|
||||||
|
$name,
|
||||||
|
ResponseInterface $response,
|
||||||
|
array &$result
|
||||||
|
) {
|
||||||
|
$result[$name] = (int) $response->getStatusCode();
|
||||||
|
}
|
||||||
|
}
|
54
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/Crc32ValidatingParser.php
vendored
Normal file
54
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/Crc32ValidatingParser.php
vendored
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api\Parser;
|
||||||
|
|
||||||
|
use Aws\Api\StructureShape;
|
||||||
|
use Aws\CommandInterface;
|
||||||
|
use Aws\Exception\AwsException;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
use Psr\Http\Message\StreamInterface;
|
||||||
|
use GuzzleHttp\Psr7;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal Decorates a parser and validates the x-amz-crc32 header.
|
||||||
|
*/
|
||||||
|
class Crc32ValidatingParser extends AbstractParser
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param callable $parser Parser to wrap.
|
||||||
|
*/
|
||||||
|
public function __construct(callable $parser)
|
||||||
|
{
|
||||||
|
$this->parser = $parser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __invoke(
|
||||||
|
CommandInterface $command,
|
||||||
|
ResponseInterface $response
|
||||||
|
) {
|
||||||
|
if ($expected = $response->getHeaderLine('x-amz-crc32')) {
|
||||||
|
$hash = hexdec(Psr7\Utils::hash($response->getBody(), 'crc32b'));
|
||||||
|
if ($expected != $hash) {
|
||||||
|
throw new AwsException(
|
||||||
|
"crc32 mismatch. Expected {$expected}, found {$hash}.",
|
||||||
|
$command,
|
||||||
|
[
|
||||||
|
'code' => 'ClientChecksumMismatch',
|
||||||
|
'connection_error' => true,
|
||||||
|
'response' => $response
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$fn = $this->parser;
|
||||||
|
return $fn($command, $response);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function parseMemberFromStream(
|
||||||
|
StreamInterface $stream,
|
||||||
|
StructureShape $member,
|
||||||
|
$response
|
||||||
|
) {
|
||||||
|
return $this->parser->parseMemberFromStream($stream, $member, $response);
|
||||||
|
}
|
||||||
|
}
|
347
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/DecodingEventStreamIterator.php
vendored
Normal file
347
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/DecodingEventStreamIterator.php
vendored
Normal file
|
@ -0,0 +1,347 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Aws\Api\Parser;
|
||||||
|
|
||||||
|
use \Iterator;
|
||||||
|
use Aws\Api\DateTimeResult;
|
||||||
|
use GuzzleHttp\Psr7;
|
||||||
|
use Psr\Http\Message\StreamInterface;
|
||||||
|
use Aws\Api\Parser\Exception\ParserException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal Implements a decoder for a binary encoded event stream that will
|
||||||
|
* decode, validate, and provide individual events from the stream.
|
||||||
|
*/
|
||||||
|
class DecodingEventStreamIterator implements Iterator
|
||||||
|
{
|
||||||
|
const HEADERS = 'headers';
|
||||||
|
const PAYLOAD = 'payload';
|
||||||
|
|
||||||
|
const LENGTH_TOTAL = 'total_length';
|
||||||
|
const LENGTH_HEADERS = 'headers_length';
|
||||||
|
|
||||||
|
const CRC_PRELUDE = 'prelude_crc';
|
||||||
|
|
||||||
|
const BYTES_PRELUDE = 12;
|
||||||
|
const BYTES_TRAILING = 4;
|
||||||
|
|
||||||
|
private static $preludeFormat = [
|
||||||
|
self::LENGTH_TOTAL => 'decodeUint32',
|
||||||
|
self::LENGTH_HEADERS => 'decodeUint32',
|
||||||
|
self::CRC_PRELUDE => 'decodeUint32',
|
||||||
|
];
|
||||||
|
|
||||||
|
private static $lengthFormatMap = [
|
||||||
|
1 => 'decodeUint8',
|
||||||
|
2 => 'decodeUint16',
|
||||||
|
4 => 'decodeUint32',
|
||||||
|
8 => 'decodeUint64',
|
||||||
|
];
|
||||||
|
|
||||||
|
private static $headerTypeMap = [
|
||||||
|
0 => 'decodeBooleanTrue',
|
||||||
|
1 => 'decodeBooleanFalse',
|
||||||
|
2 => 'decodeInt8',
|
||||||
|
3 => 'decodeInt16',
|
||||||
|
4 => 'decodeInt32',
|
||||||
|
5 => 'decodeInt64',
|
||||||
|
6 => 'decodeBytes',
|
||||||
|
7 => 'decodeString',
|
||||||
|
8 => 'decodeTimestamp',
|
||||||
|
9 => 'decodeUuid',
|
||||||
|
];
|
||||||
|
|
||||||
|
/** @var StreamInterface Stream of eventstream shape to parse. */
|
||||||
|
protected $stream;
|
||||||
|
|
||||||
|
/** @var array Currently parsed event. */
|
||||||
|
protected $currentEvent;
|
||||||
|
|
||||||
|
/** @var int Current in-order event key. */
|
||||||
|
protected $key;
|
||||||
|
|
||||||
|
/** @var resource|\HashContext CRC32 hash context for event validation */
|
||||||
|
protected $hashContext;
|
||||||
|
|
||||||
|
/** @var int $currentPosition */
|
||||||
|
protected $currentPosition;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DecodingEventStreamIterator constructor.
|
||||||
|
*
|
||||||
|
* @param StreamInterface $stream
|
||||||
|
*/
|
||||||
|
public function __construct(StreamInterface $stream)
|
||||||
|
{
|
||||||
|
$this->stream = $stream;
|
||||||
|
$this->rewind();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function parseHeaders($headerBytes)
|
||||||
|
{
|
||||||
|
$headers = [];
|
||||||
|
$bytesRead = 0;
|
||||||
|
|
||||||
|
while ($bytesRead < $headerBytes) {
|
||||||
|
list($key, $numBytes) = $this->decodeString(1);
|
||||||
|
$bytesRead += $numBytes;
|
||||||
|
|
||||||
|
list($type, $numBytes) = $this->decodeUint8();
|
||||||
|
$bytesRead += $numBytes;
|
||||||
|
|
||||||
|
$f = self::$headerTypeMap[$type];
|
||||||
|
list($value, $numBytes) = $this->{$f}();
|
||||||
|
$bytesRead += $numBytes;
|
||||||
|
|
||||||
|
if (isset($headers[$key])) {
|
||||||
|
throw new ParserException('Duplicate key in event headers.');
|
||||||
|
}
|
||||||
|
$headers[$key] = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return [$headers, $bytesRead];
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function parsePrelude()
|
||||||
|
{
|
||||||
|
$prelude = [];
|
||||||
|
$bytesRead = 0;
|
||||||
|
|
||||||
|
$calculatedCrc = null;
|
||||||
|
foreach (self::$preludeFormat as $key => $decodeFunction) {
|
||||||
|
if ($key === self::CRC_PRELUDE) {
|
||||||
|
$hashCopy = hash_copy($this->hashContext);
|
||||||
|
$calculatedCrc = hash_final($this->hashContext, true);
|
||||||
|
$this->hashContext = $hashCopy;
|
||||||
|
}
|
||||||
|
list($value, $numBytes) = $this->{$decodeFunction}();
|
||||||
|
$bytesRead += $numBytes;
|
||||||
|
|
||||||
|
$prelude[$key] = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (unpack('N', $calculatedCrc)[1] !== $prelude[self::CRC_PRELUDE]) {
|
||||||
|
throw new ParserException('Prelude checksum mismatch.');
|
||||||
|
}
|
||||||
|
|
||||||
|
return [$prelude, $bytesRead];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method decodes an event from the stream.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected function parseEvent()
|
||||||
|
{
|
||||||
|
$event = [];
|
||||||
|
|
||||||
|
if ($this->stream->tell() < $this->stream->getSize()) {
|
||||||
|
$this->hashContext = hash_init('crc32b');
|
||||||
|
|
||||||
|
$bytesLeft = $this->stream->getSize() - $this->stream->tell();
|
||||||
|
list($prelude, $numBytes) = $this->parsePrelude();
|
||||||
|
if ($prelude[self::LENGTH_TOTAL] > $bytesLeft) {
|
||||||
|
throw new ParserException('Message length too long.');
|
||||||
|
}
|
||||||
|
$bytesLeft -= $numBytes;
|
||||||
|
|
||||||
|
if ($prelude[self::LENGTH_HEADERS] > $bytesLeft) {
|
||||||
|
throw new ParserException('Headers length too long.');
|
||||||
|
}
|
||||||
|
|
||||||
|
list(
|
||||||
|
$event[self::HEADERS],
|
||||||
|
$numBytes
|
||||||
|
) = $this->parseHeaders($prelude[self::LENGTH_HEADERS]);
|
||||||
|
|
||||||
|
$event[self::PAYLOAD] = Psr7\Utils::streamFor(
|
||||||
|
$this->readAndHashBytes(
|
||||||
|
$prelude[self::LENGTH_TOTAL] - self::BYTES_PRELUDE
|
||||||
|
- $numBytes - self::BYTES_TRAILING
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$calculatedCrc = hash_final($this->hashContext, true);
|
||||||
|
$messageCrc = $this->stream->read(4);
|
||||||
|
if ($calculatedCrc !== $messageCrc) {
|
||||||
|
throw new ParserException('Message checksum mismatch.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $event;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Iterator Functionality
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
|
public function current()
|
||||||
|
{
|
||||||
|
return $this->currentEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
|
public function key()
|
||||||
|
{
|
||||||
|
return $this->key;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
|
public function next()
|
||||||
|
{
|
||||||
|
$this->currentPosition = $this->stream->tell();
|
||||||
|
if ($this->valid()) {
|
||||||
|
$this->key++;
|
||||||
|
$this->currentEvent = $this->parseEvent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
|
public function rewind()
|
||||||
|
{
|
||||||
|
$this->stream->rewind();
|
||||||
|
$this->key = 0;
|
||||||
|
$this->currentPosition = 0;
|
||||||
|
$this->currentEvent = $this->parseEvent();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
|
public function valid()
|
||||||
|
{
|
||||||
|
return $this->currentPosition < $this->stream->getSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Decoding Utilities
|
||||||
|
|
||||||
|
protected function readAndHashBytes($num)
|
||||||
|
{
|
||||||
|
$bytes = $this->stream->read($num);
|
||||||
|
hash_update($this->hashContext, $bytes);
|
||||||
|
return $bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function decodeBooleanTrue()
|
||||||
|
{
|
||||||
|
return [true, 0];
|
||||||
|
}
|
||||||
|
|
||||||
|
private function decodeBooleanFalse()
|
||||||
|
{
|
||||||
|
return [false, 0];
|
||||||
|
}
|
||||||
|
|
||||||
|
private function uintToInt($val, $size)
|
||||||
|
{
|
||||||
|
$signedCap = pow(2, $size - 1);
|
||||||
|
if ($val > $signedCap) {
|
||||||
|
$val -= (2 * $signedCap);
|
||||||
|
}
|
||||||
|
return $val;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function decodeInt8()
|
||||||
|
{
|
||||||
|
$val = (int)unpack('C', $this->readAndHashBytes(1))[1];
|
||||||
|
return [$this->uintToInt($val, 8), 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
private function decodeUint8()
|
||||||
|
{
|
||||||
|
return [unpack('C', $this->readAndHashBytes(1))[1], 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
private function decodeInt16()
|
||||||
|
{
|
||||||
|
$val = (int)unpack('n', $this->readAndHashBytes(2))[1];
|
||||||
|
return [$this->uintToInt($val, 16), 2];
|
||||||
|
}
|
||||||
|
|
||||||
|
private function decodeUint16()
|
||||||
|
{
|
||||||
|
return [unpack('n', $this->readAndHashBytes(2))[1], 2];
|
||||||
|
}
|
||||||
|
|
||||||
|
private function decodeInt32()
|
||||||
|
{
|
||||||
|
$val = (int)unpack('N', $this->readAndHashBytes(4))[1];
|
||||||
|
return [$this->uintToInt($val, 32), 4];
|
||||||
|
}
|
||||||
|
|
||||||
|
private function decodeUint32()
|
||||||
|
{
|
||||||
|
return [unpack('N', $this->readAndHashBytes(4))[1], 4];
|
||||||
|
}
|
||||||
|
|
||||||
|
private function decodeInt64()
|
||||||
|
{
|
||||||
|
$val = $this->unpackInt64($this->readAndHashBytes(8))[1];
|
||||||
|
return [$this->uintToInt($val, 64), 8];
|
||||||
|
}
|
||||||
|
|
||||||
|
private function decodeUint64()
|
||||||
|
{
|
||||||
|
return [$this->unpackInt64($this->readAndHashBytes(8))[1], 8];
|
||||||
|
}
|
||||||
|
|
||||||
|
private function unpackInt64($bytes)
|
||||||
|
{
|
||||||
|
return unpack('J', $bytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function decodeBytes($lengthBytes=2)
|
||||||
|
{
|
||||||
|
if (!isset(self::$lengthFormatMap[$lengthBytes])) {
|
||||||
|
throw new ParserException('Undefined variable length format.');
|
||||||
|
}
|
||||||
|
$f = self::$lengthFormatMap[$lengthBytes];
|
||||||
|
list($len, $bytes) = $this->{$f}();
|
||||||
|
return [$this->readAndHashBytes($len), $len + $bytes];
|
||||||
|
}
|
||||||
|
|
||||||
|
private function decodeString($lengthBytes=2)
|
||||||
|
{
|
||||||
|
if (!isset(self::$lengthFormatMap[$lengthBytes])) {
|
||||||
|
throw new ParserException('Undefined variable length format.');
|
||||||
|
}
|
||||||
|
$f = self::$lengthFormatMap[$lengthBytes];
|
||||||
|
list($len, $bytes) = $this->{$f}();
|
||||||
|
return [$this->readAndHashBytes($len), $len + $bytes];
|
||||||
|
}
|
||||||
|
|
||||||
|
private function decodeTimestamp()
|
||||||
|
{
|
||||||
|
list($val, $bytes) = $this->decodeInt64();
|
||||||
|
return [
|
||||||
|
DateTimeResult::createFromFormat('U.u', $val / 1000),
|
||||||
|
$bytes
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
private function decodeUuid()
|
||||||
|
{
|
||||||
|
$val = unpack('H32', $this->readAndHashBytes(16))[1];
|
||||||
|
return [
|
||||||
|
substr($val, 0, 8) . '-'
|
||||||
|
. substr($val, 8, 4) . '-'
|
||||||
|
. substr($val, 12, 4) . '-'
|
||||||
|
. substr($val, 16, 4) . '-'
|
||||||
|
. substr($val, 20, 12),
|
||||||
|
16
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
211
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/EventParsingIterator.php
vendored
Normal file
211
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/EventParsingIterator.php
vendored
Normal file
|
@ -0,0 +1,211 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Aws\Api\Parser;
|
||||||
|
|
||||||
|
use \Iterator;
|
||||||
|
use Aws\Exception\EventStreamDataException;
|
||||||
|
use Aws\Api\Parser\Exception\ParserException;
|
||||||
|
use Aws\Api\StructureShape;
|
||||||
|
use Psr\Http\Message\StreamInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal Implements a decoder for a binary encoded event stream that will
|
||||||
|
* decode, validate, and provide individual events from the stream.
|
||||||
|
*/
|
||||||
|
class EventParsingIterator implements Iterator
|
||||||
|
{
|
||||||
|
/** @var StreamInterface */
|
||||||
|
private $decodingIterator;
|
||||||
|
|
||||||
|
/** @var StructureShape */
|
||||||
|
private $shape;
|
||||||
|
|
||||||
|
/** @var AbstractParser */
|
||||||
|
private $parser;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
StreamInterface $stream,
|
||||||
|
StructureShape $shape,
|
||||||
|
AbstractParser $parser
|
||||||
|
) {
|
||||||
|
$this->decodingIterator = $this->chooseDecodingIterator($stream);
|
||||||
|
$this->shape = $shape;
|
||||||
|
$this->parser = $parser;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method choose a decoding iterator implementation based on if the stream
|
||||||
|
* is seekable or not.
|
||||||
|
*
|
||||||
|
* @param $stream
|
||||||
|
*
|
||||||
|
* @return Iterator
|
||||||
|
*/
|
||||||
|
private function chooseDecodingIterator($stream)
|
||||||
|
{
|
||||||
|
if ($stream->isSeekable()) {
|
||||||
|
return new DecodingEventStreamIterator($stream);
|
||||||
|
} else {
|
||||||
|
return new NonSeekableStreamDecodingEventStreamIterator($stream);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
|
public function current()
|
||||||
|
{
|
||||||
|
return $this->parseEvent($this->decodingIterator->current());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
|
public function key()
|
||||||
|
{
|
||||||
|
return $this->decodingIterator->key();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
|
public function next()
|
||||||
|
{
|
||||||
|
$this->decodingIterator->next();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
|
public function rewind()
|
||||||
|
{
|
||||||
|
$this->decodingIterator->rewind();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
|
public function valid()
|
||||||
|
{
|
||||||
|
return $this->decodingIterator->valid();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function parseEvent(array $event)
|
||||||
|
{
|
||||||
|
if (!empty($event['headers'][':message-type'])) {
|
||||||
|
if ($event['headers'][':message-type'] === 'error') {
|
||||||
|
return $this->parseError($event);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($event['headers'][':message-type'] === 'exception') {
|
||||||
|
return $this->parseException($event);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($event['headers'][':message-type'] !== 'event') {
|
||||||
|
throw new ParserException('Failed to parse unknown message type.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$eventType = $event['headers'][':event-type'] ?? null;
|
||||||
|
if (empty($eventType)) {
|
||||||
|
throw new ParserException('Failed to parse without event type.');
|
||||||
|
}
|
||||||
|
|
||||||
|
$eventPayload = $event['payload'];
|
||||||
|
if ($eventType === 'initial-response') {
|
||||||
|
return $this->parseInitialResponseEvent($eventPayload);
|
||||||
|
}
|
||||||
|
|
||||||
|
$eventShape = $this->shape->getMember($eventType);
|
||||||
|
|
||||||
|
return [
|
||||||
|
$eventType => array_merge(
|
||||||
|
$this->parseEventHeaders($event['headers'], $eventShape),
|
||||||
|
$this->parseEventPayload($eventPayload, $eventShape)
|
||||||
|
)
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $headers
|
||||||
|
* @param $eventShape
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
private function parseEventHeaders($headers, $eventShape): array
|
||||||
|
{
|
||||||
|
$parsedHeaders = [];
|
||||||
|
foreach ($eventShape->getMembers() as $memberName => $memberProps) {
|
||||||
|
if (isset($memberProps['eventheader'])) {
|
||||||
|
$parsedHeaders[$memberName] = $headers[$memberName];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $parsedHeaders;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $payload
|
||||||
|
* @param $eventShape
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
private function parseEventPayload($payload, $eventShape): array
|
||||||
|
{
|
||||||
|
$parsedPayload = [];
|
||||||
|
foreach ($eventShape->getMembers() as $memberName => $memberProps) {
|
||||||
|
$memberShape = $eventShape->getMember($memberName);
|
||||||
|
if (isset($memberProps['eventpayload'])) {
|
||||||
|
if ($memberShape->getType() === 'blob') {
|
||||||
|
$parsedPayload[$memberName] = $payload;
|
||||||
|
} else {
|
||||||
|
$parsedPayload[$memberName] = $this->parser->parseMemberFromStream(
|
||||||
|
$payload,
|
||||||
|
$memberShape,
|
||||||
|
null
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($parsedPayload) && !empty($payload->getContents())) {
|
||||||
|
/**
|
||||||
|
* If we did not find a member with an eventpayload trait, then we should deserialize the payload
|
||||||
|
* using the event's shape.
|
||||||
|
*/
|
||||||
|
$parsedPayload = $this->parser->parseMemberFromStream($payload, $eventShape, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $parsedPayload;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function parseError(array $event)
|
||||||
|
{
|
||||||
|
throw new EventStreamDataException(
|
||||||
|
$event['headers'][':error-code'],
|
||||||
|
$event['headers'][':error-message']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function parseException(array $event) {
|
||||||
|
$payload = $event['payload']?->getContents();
|
||||||
|
$parsedPayload = json_decode($payload, true);
|
||||||
|
|
||||||
|
throw new EventStreamDataException(
|
||||||
|
$event['headers'][':exception-type'] ?? 'Unknown',
|
||||||
|
$parsedPayload['message'] ?? $payload,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function parseInitialResponseEvent($payload): array
|
||||||
|
{
|
||||||
|
return ['initial-response' => json_decode($payload, true)];
|
||||||
|
}
|
||||||
|
}
|
56
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/Exception/ParserException.php
vendored
Normal file
56
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/Exception/ParserException.php
vendored
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api\Parser\Exception;
|
||||||
|
|
||||||
|
use Aws\HasMonitoringEventsTrait;
|
||||||
|
use Aws\MonitoringEventsInterface;
|
||||||
|
use Aws\ResponseContainerInterface;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
|
class ParserException extends \RuntimeException implements
|
||||||
|
MonitoringEventsInterface,
|
||||||
|
ResponseContainerInterface
|
||||||
|
{
|
||||||
|
use HasMonitoringEventsTrait;
|
||||||
|
|
||||||
|
private $errorCode;
|
||||||
|
private $requestId;
|
||||||
|
private $response;
|
||||||
|
|
||||||
|
public function __construct($message = '', $code = 0, $previous = null, array $context = [])
|
||||||
|
{
|
||||||
|
$this->errorCode = isset($context['error_code']) ? $context['error_code'] : null;
|
||||||
|
$this->requestId = isset($context['request_id']) ? $context['request_id'] : null;
|
||||||
|
$this->response = isset($context['response']) ? $context['response'] : null;
|
||||||
|
parent::__construct($message, $code, $previous);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the error code, if any.
|
||||||
|
*
|
||||||
|
* @return string|null
|
||||||
|
*/
|
||||||
|
public function getErrorCode()
|
||||||
|
{
|
||||||
|
return $this->errorCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the request ID, if any.
|
||||||
|
*
|
||||||
|
* @return string|null
|
||||||
|
*/
|
||||||
|
public function getRequestId()
|
||||||
|
{
|
||||||
|
return $this->requestId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the received HTTP response if any.
|
||||||
|
*
|
||||||
|
* @return ResponseInterface|null
|
||||||
|
*/
|
||||||
|
public function getResponse()
|
||||||
|
{
|
||||||
|
return $this->response;
|
||||||
|
}
|
||||||
|
}
|
71
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/JsonParser.php
vendored
Normal file
71
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/JsonParser.php
vendored
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api\Parser;
|
||||||
|
|
||||||
|
use Aws\Api\DateTimeResult;
|
||||||
|
use Aws\Api\Shape;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal Implements standard JSON parsing.
|
||||||
|
*/
|
||||||
|
class JsonParser
|
||||||
|
{
|
||||||
|
public function parse(Shape $shape, $value)
|
||||||
|
{
|
||||||
|
if ($value === null) {
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ($shape['type']) {
|
||||||
|
case 'structure':
|
||||||
|
if (isset($shape['document']) && $shape['document']) {
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
$target = [];
|
||||||
|
foreach ($shape->getMembers() as $name => $member) {
|
||||||
|
$locationName = $member['locationName'] ?: $name;
|
||||||
|
if (isset($value[$locationName])) {
|
||||||
|
$target[$name] = $this->parse($member, $value[$locationName]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isset($shape['union'])
|
||||||
|
&& $shape['union']
|
||||||
|
&& is_array($value)
|
||||||
|
&& empty($target)
|
||||||
|
) {
|
||||||
|
foreach ($value as $key => $val) {
|
||||||
|
$target['Unknown'][$key] = $val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $target;
|
||||||
|
|
||||||
|
case 'list':
|
||||||
|
$member = $shape->getMember();
|
||||||
|
$target = [];
|
||||||
|
foreach ($value as $v) {
|
||||||
|
$target[] = $this->parse($member, $v);
|
||||||
|
}
|
||||||
|
return $target;
|
||||||
|
|
||||||
|
case 'map':
|
||||||
|
$values = $shape->getValue();
|
||||||
|
$target = [];
|
||||||
|
foreach ($value as $k => $v) {
|
||||||
|
$target[$k] = $this->parse($values, $v);
|
||||||
|
}
|
||||||
|
return $target;
|
||||||
|
|
||||||
|
case 'timestamp':
|
||||||
|
return DateTimeResult::fromTimestamp(
|
||||||
|
$value,
|
||||||
|
!empty($shape['timestampFormat']) ? $shape['timestampFormat'] : null
|
||||||
|
);
|
||||||
|
|
||||||
|
case 'blob':
|
||||||
|
return base64_decode($value);
|
||||||
|
|
||||||
|
default:
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
82
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/JsonRpcParser.php
vendored
Normal file
82
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/JsonRpcParser.php
vendored
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api\Parser;
|
||||||
|
|
||||||
|
use Aws\Api\Operation;
|
||||||
|
use Aws\Api\StructureShape;
|
||||||
|
use Aws\Api\Service;
|
||||||
|
use Aws\Result;
|
||||||
|
use Aws\CommandInterface;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
use Psr\Http\Message\StreamInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal Implements JSON-RPC parsing (e.g., DynamoDB)
|
||||||
|
*/
|
||||||
|
class JsonRpcParser extends AbstractParser
|
||||||
|
{
|
||||||
|
use PayloadParserTrait;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Service $api Service description
|
||||||
|
* @param JsonParser $parser JSON body builder
|
||||||
|
*/
|
||||||
|
public function __construct(Service $api, ?JsonParser $parser = null)
|
||||||
|
{
|
||||||
|
parent::__construct($api);
|
||||||
|
$this->parser = $parser ?: new JsonParser();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __invoke(
|
||||||
|
CommandInterface $command,
|
||||||
|
ResponseInterface $response
|
||||||
|
) {
|
||||||
|
$operation = $this->api->getOperation($command->getName());
|
||||||
|
|
||||||
|
return $this->parseResponse($response, $operation);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method parses a response based on JSON RPC protocol.
|
||||||
|
*
|
||||||
|
* @param ResponseInterface $response the response to parse.
|
||||||
|
* @param Operation $operation the operation which holds information for
|
||||||
|
* parsing the response.
|
||||||
|
*
|
||||||
|
* @return Result
|
||||||
|
*/
|
||||||
|
private function parseResponse(ResponseInterface $response, Operation $operation)
|
||||||
|
{
|
||||||
|
if (null === $operation['output']) {
|
||||||
|
return new Result([]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$outputShape = $operation->getOutput();
|
||||||
|
foreach ($outputShape->getMembers() as $memberName => $memberProps) {
|
||||||
|
if (!empty($memberProps['eventstream'])) {
|
||||||
|
return new Result([
|
||||||
|
$memberName => new EventParsingIterator(
|
||||||
|
$response->getBody(),
|
||||||
|
$outputShape->getMember($memberName),
|
||||||
|
$this
|
||||||
|
)
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = $this->parseMemberFromStream(
|
||||||
|
$response->getBody(),
|
||||||
|
$operation->getOutput(),
|
||||||
|
$response
|
||||||
|
);
|
||||||
|
|
||||||
|
return new Result(is_null($result) ? [] : $result);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function parseMemberFromStream(
|
||||||
|
StreamInterface $stream,
|
||||||
|
StructureShape $member,
|
||||||
|
$response
|
||||||
|
) {
|
||||||
|
return $this->parser->parse($member, $this->parseJson($stream, $response));
|
||||||
|
}
|
||||||
|
}
|
90
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/MetadataParserTrait.php
vendored
Normal file
90
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/MetadataParserTrait.php
vendored
Normal file
|
@ -0,0 +1,90 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api\Parser;
|
||||||
|
|
||||||
|
use Aws\Api\DateTimeResult;
|
||||||
|
use Aws\Api\Shape;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
|
trait MetadataParserTrait
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Extract a single header from the response into the result.
|
||||||
|
*/
|
||||||
|
protected function extractHeader(
|
||||||
|
$name,
|
||||||
|
Shape $shape,
|
||||||
|
ResponseInterface $response,
|
||||||
|
&$result
|
||||||
|
) {
|
||||||
|
$value = $response->getHeaderLine($shape['locationName'] ?: $name);
|
||||||
|
|
||||||
|
switch ($shape->getType()) {
|
||||||
|
case 'float':
|
||||||
|
case 'double':
|
||||||
|
$value = (float) $value;
|
||||||
|
break;
|
||||||
|
case 'long':
|
||||||
|
$value = (int) $value;
|
||||||
|
break;
|
||||||
|
case 'boolean':
|
||||||
|
$value = filter_var($value, FILTER_VALIDATE_BOOLEAN);
|
||||||
|
break;
|
||||||
|
case 'blob':
|
||||||
|
$value = base64_decode($value);
|
||||||
|
break;
|
||||||
|
case 'timestamp':
|
||||||
|
try {
|
||||||
|
$value = DateTimeResult::fromTimestamp(
|
||||||
|
$value,
|
||||||
|
!empty($shape['timestampFormat']) ? $shape['timestampFormat'] : null
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
// If the value cannot be parsed, then do not add it to the
|
||||||
|
// output structure.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
case 'string':
|
||||||
|
if ($shape['jsonvalue']) {
|
||||||
|
$value = $this->parseJson(base64_decode($value), $response);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$result[$name] = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extract a map of headers with an optional prefix from the response.
|
||||||
|
*/
|
||||||
|
protected function extractHeaders(
|
||||||
|
$name,
|
||||||
|
Shape $shape,
|
||||||
|
ResponseInterface $response,
|
||||||
|
&$result
|
||||||
|
) {
|
||||||
|
// Check if the headers are prefixed by a location name
|
||||||
|
$result[$name] = [];
|
||||||
|
$prefix = $shape['locationName'];
|
||||||
|
$prefixLen = strlen($prefix);
|
||||||
|
|
||||||
|
foreach ($response->getHeaders() as $k => $values) {
|
||||||
|
if (!$prefixLen) {
|
||||||
|
$result[$name][$k] = implode(', ', $values);
|
||||||
|
} elseif (stripos($k, $prefix) === 0) {
|
||||||
|
$result[$name][substr($k, $prefixLen)] = implode(', ', $values);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Places the status code of the response into the result array.
|
||||||
|
*/
|
||||||
|
protected function extractStatus(
|
||||||
|
$name,
|
||||||
|
ResponseInterface $response,
|
||||||
|
array &$result
|
||||||
|
) {
|
||||||
|
$result[$name] = (int) $response->getStatusCode();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,101 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Aws\Api\Parser;
|
||||||
|
|
||||||
|
use GuzzleHttp\Psr7;
|
||||||
|
use Psr\Http\Message\StreamInterface;
|
||||||
|
use Aws\Api\Parser\Exception\ParserException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*/
|
||||||
|
class NonSeekableStreamDecodingEventStreamIterator extends DecodingEventStreamIterator
|
||||||
|
{
|
||||||
|
/** @var array $tempBuffer */
|
||||||
|
private $tempBuffer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NonSeekableStreamDecodingEventStreamIterator constructor.
|
||||||
|
*
|
||||||
|
* @param StreamInterface $stream
|
||||||
|
*/
|
||||||
|
public function __construct(StreamInterface $stream)
|
||||||
|
{
|
||||||
|
$this->stream = $stream;
|
||||||
|
if ($this->stream->isSeekable()) {
|
||||||
|
throw new \InvalidArgumentException('The stream provided must be not seekable.');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->tempBuffer = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected function parseEvent(): array
|
||||||
|
{
|
||||||
|
$event = [];
|
||||||
|
$this->hashContext = hash_init('crc32b');
|
||||||
|
$prelude = $this->parsePrelude()[0];
|
||||||
|
list(
|
||||||
|
$event[self::HEADERS],
|
||||||
|
$numBytes
|
||||||
|
) = $this->parseHeaders($prelude[self::LENGTH_HEADERS]);
|
||||||
|
$event[self::PAYLOAD] = Psr7\Utils::streamFor(
|
||||||
|
$this->readAndHashBytes(
|
||||||
|
$prelude[self::LENGTH_TOTAL] - self::BYTES_PRELUDE
|
||||||
|
- $numBytes - self::BYTES_TRAILING
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$calculatedCrc = hash_final($this->hashContext, true);
|
||||||
|
$messageCrc = $this->stream->read(4);
|
||||||
|
if ($calculatedCrc !== $messageCrc) {
|
||||||
|
throw new ParserException('Message checksum mismatch.');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $event;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function readAndHashBytes($num): string
|
||||||
|
{
|
||||||
|
$bytes = '';
|
||||||
|
while (!empty($this->tempBuffer) && $num > 0) {
|
||||||
|
$byte = array_shift($this->tempBuffer);
|
||||||
|
$bytes .= $byte;
|
||||||
|
$num = $num - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$bytes = $bytes . $this->stream->read($num);
|
||||||
|
hash_update($this->hashContext, $bytes);
|
||||||
|
|
||||||
|
return $bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Iterator Functionality
|
||||||
|
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
|
public function rewind()
|
||||||
|
{
|
||||||
|
$this->currentEvent = $this->parseEvent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function next()
|
||||||
|
{
|
||||||
|
$this->tempBuffer[] = $this->stream->read(1);
|
||||||
|
if ($this->valid()) {
|
||||||
|
$this->key++;
|
||||||
|
$this->currentEvent = $this->parseEvent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
|
public function valid()
|
||||||
|
{
|
||||||
|
return !$this->stream->eof();
|
||||||
|
}
|
||||||
|
}
|
61
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/PayloadParserTrait.php
vendored
Normal file
61
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/PayloadParserTrait.php
vendored
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api\Parser;
|
||||||
|
|
||||||
|
use Aws\Api\Parser\Exception\ParserException;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
|
||||||
|
trait PayloadParserTrait
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param string $json
|
||||||
|
*
|
||||||
|
* @throws ParserException
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
private function parseJson($json, $response)
|
||||||
|
{
|
||||||
|
$jsonPayload = json_decode($json, true);
|
||||||
|
|
||||||
|
if (JSON_ERROR_NONE !== json_last_error()) {
|
||||||
|
throw new ParserException(
|
||||||
|
'Error parsing JSON: ' . json_last_error_msg(),
|
||||||
|
0,
|
||||||
|
null,
|
||||||
|
['response' => $response]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $jsonPayload;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $xml
|
||||||
|
*
|
||||||
|
* @throws ParserException
|
||||||
|
*
|
||||||
|
* @return \SimpleXMLElement
|
||||||
|
*/
|
||||||
|
protected function parseXml($xml, $response)
|
||||||
|
{
|
||||||
|
$priorSetting = libxml_use_internal_errors(true);
|
||||||
|
try {
|
||||||
|
libxml_clear_errors();
|
||||||
|
$xmlPayload = new \SimpleXMLElement($xml);
|
||||||
|
if ($error = libxml_get_last_error()) {
|
||||||
|
throw new \RuntimeException($error->message);
|
||||||
|
}
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
throw new ParserException(
|
||||||
|
"Error parsing XML: {$e->getMessage()}",
|
||||||
|
0,
|
||||||
|
$e,
|
||||||
|
['response' => $response]
|
||||||
|
);
|
||||||
|
} finally {
|
||||||
|
libxml_use_internal_errors($priorSetting);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $xmlPayload;
|
||||||
|
}
|
||||||
|
}
|
60
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/QueryParser.php
vendored
Normal file
60
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/QueryParser.php
vendored
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api\Parser;
|
||||||
|
|
||||||
|
use Aws\Api\Service;
|
||||||
|
use Aws\Api\StructureShape;
|
||||||
|
use Aws\Result;
|
||||||
|
use Aws\CommandInterface;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
use Psr\Http\Message\StreamInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal Parses query (XML) responses (e.g., EC2, SQS, and many others)
|
||||||
|
*/
|
||||||
|
class QueryParser extends AbstractParser
|
||||||
|
{
|
||||||
|
use PayloadParserTrait;
|
||||||
|
|
||||||
|
/** @var bool */
|
||||||
|
private $honorResultWrapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Service $api Service description
|
||||||
|
* @param XmlParser $xmlParser Optional XML parser
|
||||||
|
* @param bool $honorResultWrapper Set to false to disable the peeling
|
||||||
|
* back of result wrappers from the
|
||||||
|
* output structure.
|
||||||
|
*/
|
||||||
|
public function __construct(
|
||||||
|
Service $api,
|
||||||
|
?XmlParser $xmlParser = null,
|
||||||
|
$honorResultWrapper = true
|
||||||
|
) {
|
||||||
|
parent::__construct($api);
|
||||||
|
$this->parser = $xmlParser ?: new XmlParser();
|
||||||
|
$this->honorResultWrapper = $honorResultWrapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __invoke(
|
||||||
|
CommandInterface $command,
|
||||||
|
ResponseInterface $response
|
||||||
|
) {
|
||||||
|
$output = $this->api->getOperation($command->getName())->getOutput();
|
||||||
|
$xml = $this->parseXml($response->getBody(), $response);
|
||||||
|
|
||||||
|
if ($this->honorResultWrapper && $output['resultWrapper']) {
|
||||||
|
$xml = $xml->{$output['resultWrapper']};
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Result($this->parser->parse($output, $xml));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function parseMemberFromStream(
|
||||||
|
StreamInterface $stream,
|
||||||
|
StructureShape $member,
|
||||||
|
$response
|
||||||
|
) {
|
||||||
|
$xml = $this->parseXml($stream, $response);
|
||||||
|
return $this->parser->parse($member, $xml);
|
||||||
|
}
|
||||||
|
}
|
49
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/RestJsonParser.php
vendored
Normal file
49
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/RestJsonParser.php
vendored
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api\Parser;
|
||||||
|
|
||||||
|
use Aws\Api\Service;
|
||||||
|
use Aws\Api\StructureShape;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
use Psr\Http\Message\StreamInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal Implements REST-JSON parsing (e.g., Glacier, Elastic Transcoder)
|
||||||
|
*/
|
||||||
|
class RestJsonParser extends AbstractRestParser
|
||||||
|
{
|
||||||
|
use PayloadParserTrait;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Service $api Service description
|
||||||
|
* @param JsonParser $parser JSON body builder
|
||||||
|
*/
|
||||||
|
public function __construct(Service $api, ?JsonParser $parser = null)
|
||||||
|
{
|
||||||
|
parent::__construct($api);
|
||||||
|
$this->parser = $parser ?: new JsonParser();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function payload(
|
||||||
|
ResponseInterface $response,
|
||||||
|
StructureShape $member,
|
||||||
|
array &$result
|
||||||
|
) {
|
||||||
|
$jsonBody = $this->parseJson($response->getBody(), $response);
|
||||||
|
|
||||||
|
if ($jsonBody) {
|
||||||
|
$result += $this->parser->parse($member, $jsonBody);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function parseMemberFromStream(
|
||||||
|
StreamInterface $stream,
|
||||||
|
StructureShape $member,
|
||||||
|
$response
|
||||||
|
) {
|
||||||
|
$jsonBody = $this->parseJson($stream, $response);
|
||||||
|
if ($jsonBody) {
|
||||||
|
return $this->parser->parse($member, $jsonBody);
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
42
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/RestXmlParser.php
vendored
Normal file
42
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/RestXmlParser.php
vendored
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api\Parser;
|
||||||
|
|
||||||
|
use Aws\Api\StructureShape;
|
||||||
|
use Aws\Api\Service;
|
||||||
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
use Psr\Http\Message\StreamInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal Implements REST-XML parsing (e.g., S3, CloudFront, etc...)
|
||||||
|
*/
|
||||||
|
class RestXmlParser extends AbstractRestParser
|
||||||
|
{
|
||||||
|
use PayloadParserTrait;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Service $api Service description
|
||||||
|
* @param XmlParser $parser XML body parser
|
||||||
|
*/
|
||||||
|
public function __construct(Service $api, ?XmlParser $parser = null)
|
||||||
|
{
|
||||||
|
parent::__construct($api);
|
||||||
|
$this->parser = $parser ?: new XmlParser();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function payload(
|
||||||
|
ResponseInterface $response,
|
||||||
|
StructureShape $member,
|
||||||
|
array &$result
|
||||||
|
) {
|
||||||
|
$result += $this->parseMemberFromStream($response->getBody(), $member, $response);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function parseMemberFromStream(
|
||||||
|
StreamInterface $stream,
|
||||||
|
StructureShape $member,
|
||||||
|
$response
|
||||||
|
) {
|
||||||
|
$xml = $this->parseXml($stream, $response);
|
||||||
|
return $this->parser->parse($member, $xml);
|
||||||
|
}
|
||||||
|
}
|
179
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/XmlParser.php
vendored
Normal file
179
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Parser/XmlParser.php
vendored
Normal file
|
@ -0,0 +1,179 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api\Parser;
|
||||||
|
|
||||||
|
use Aws\Api\DateTimeResult;
|
||||||
|
use Aws\Api\ListShape;
|
||||||
|
use Aws\Api\MapShape;
|
||||||
|
use Aws\Api\Parser\Exception\ParserException;
|
||||||
|
use Aws\Api\Shape;
|
||||||
|
use Aws\Api\StructureShape;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal Implements standard XML parsing for REST-XML and Query protocols.
|
||||||
|
*/
|
||||||
|
class XmlParser
|
||||||
|
{
|
||||||
|
public function parse(StructureShape $shape, \SimpleXMLElement $value)
|
||||||
|
{
|
||||||
|
return $this->dispatch($shape, $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function dispatch($shape, \SimpleXMLElement $value)
|
||||||
|
{
|
||||||
|
static $methods = [
|
||||||
|
'structure' => 'parse_structure',
|
||||||
|
'list' => 'parse_list',
|
||||||
|
'map' => 'parse_map',
|
||||||
|
'blob' => 'parse_blob',
|
||||||
|
'boolean' => 'parse_boolean',
|
||||||
|
'integer' => 'parse_integer',
|
||||||
|
'float' => 'parse_float',
|
||||||
|
'double' => 'parse_float',
|
||||||
|
'timestamp' => 'parse_timestamp',
|
||||||
|
];
|
||||||
|
|
||||||
|
$type = $shape['type'];
|
||||||
|
if (isset($methods[$type])) {
|
||||||
|
return $this->{$methods[$type]}($shape, $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (string) $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function parse_structure(
|
||||||
|
StructureShape $shape,
|
||||||
|
\SimpleXMLElement $value
|
||||||
|
) {
|
||||||
|
$target = [];
|
||||||
|
|
||||||
|
foreach ($shape->getMembers() as $name => $member) {
|
||||||
|
// Extract the name of the XML node
|
||||||
|
$node = $this->memberKey($member, $name);
|
||||||
|
if (isset($value->{$node})) {
|
||||||
|
$target[$name] = $this->dispatch($member, $value->{$node});
|
||||||
|
} else {
|
||||||
|
$memberShape = $shape->getMember($name);
|
||||||
|
if (!empty($memberShape['xmlAttribute'])) {
|
||||||
|
$target[$name] = $this->parse_xml_attribute(
|
||||||
|
$shape,
|
||||||
|
$memberShape,
|
||||||
|
$value
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isset($shape['union'])
|
||||||
|
&& $shape['union']
|
||||||
|
&& empty($target)
|
||||||
|
) {
|
||||||
|
foreach ($value as $key => $val) {
|
||||||
|
$name = $val->children()->getName();
|
||||||
|
$target['Unknown'][$name] = $val->$name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $target;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function memberKey(Shape $shape, $name)
|
||||||
|
{
|
||||||
|
if (null !== $shape['locationName']) {
|
||||||
|
return $shape['locationName'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($shape instanceof ListShape && $shape['flattened']) {
|
||||||
|
return $shape->getMember()['locationName'] ?: $name;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $name;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function parse_list(ListShape $shape, \SimpleXMLElement $value)
|
||||||
|
{
|
||||||
|
$target = [];
|
||||||
|
$member = $shape->getMember();
|
||||||
|
|
||||||
|
if (!$shape['flattened']) {
|
||||||
|
$value = $value->{$member['locationName'] ?: 'member'};
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($value as $v) {
|
||||||
|
$target[] = $this->dispatch($member, $v);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $target;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function parse_map(MapShape $shape, \SimpleXMLElement $value)
|
||||||
|
{
|
||||||
|
$target = [];
|
||||||
|
|
||||||
|
if (!$shape['flattened']) {
|
||||||
|
$value = $value->entry;
|
||||||
|
}
|
||||||
|
|
||||||
|
$mapKey = $shape->getKey();
|
||||||
|
$mapValue = $shape->getValue();
|
||||||
|
$keyName = $shape->getKey()['locationName'] ?: 'key';
|
||||||
|
$valueName = $shape->getValue()['locationName'] ?: 'value';
|
||||||
|
|
||||||
|
foreach ($value as $node) {
|
||||||
|
$key = $this->dispatch($mapKey, $node->{$keyName});
|
||||||
|
$value = $this->dispatch($mapValue, $node->{$valueName});
|
||||||
|
$target[$key] = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $target;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function parse_blob(Shape $shape, $value)
|
||||||
|
{
|
||||||
|
return base64_decode((string) $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function parse_float(Shape $shape, $value)
|
||||||
|
{
|
||||||
|
return (float) (string) $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function parse_integer(Shape $shape, $value)
|
||||||
|
{
|
||||||
|
return (int) (string) $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function parse_boolean(Shape $shape, $value)
|
||||||
|
{
|
||||||
|
return $value == 'true';
|
||||||
|
}
|
||||||
|
|
||||||
|
private function parse_timestamp(Shape $shape, $value)
|
||||||
|
{
|
||||||
|
if (is_string($value)
|
||||||
|
|| is_int($value)
|
||||||
|
|| (is_object($value)
|
||||||
|
&& method_exists($value, '__toString'))
|
||||||
|
) {
|
||||||
|
return DateTimeResult::fromTimestamp(
|
||||||
|
(string) $value,
|
||||||
|
!empty($shape['timestampFormat']) ? $shape['timestampFormat'] : null
|
||||||
|
);
|
||||||
|
}
|
||||||
|
throw new ParserException('Invalid timestamp value passed to XmlParser::parse_timestamp');
|
||||||
|
}
|
||||||
|
|
||||||
|
private function parse_xml_attribute(Shape $shape, Shape $memberShape, $value)
|
||||||
|
{
|
||||||
|
$namespace = $shape['xmlNamespace']['uri']
|
||||||
|
? $shape['xmlNamespace']['uri']
|
||||||
|
: '';
|
||||||
|
$prefix = $shape['xmlNamespace']['prefix']
|
||||||
|
? $shape['xmlNamespace']['prefix']
|
||||||
|
: '';
|
||||||
|
if (!empty($prefix)) {
|
||||||
|
$prefix .= ':';
|
||||||
|
}
|
||||||
|
$key = str_replace($prefix, '', $memberShape['locationName']);
|
||||||
|
|
||||||
|
$attributes = $value->attributes($namespace);
|
||||||
|
return isset($attributes[$key]) ? (string) $attributes[$key] : null;
|
||||||
|
}
|
||||||
|
}
|
38
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Serializer/Ec2ParamBuilder.php
vendored
Normal file
38
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Serializer/Ec2ParamBuilder.php
vendored
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api\Serializer;
|
||||||
|
|
||||||
|
use Aws\Api\Shape;
|
||||||
|
use Aws\Api\ListShape;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
class Ec2ParamBuilder extends QueryParamBuilder
|
||||||
|
{
|
||||||
|
protected function queryName(Shape $shape, $default = null)
|
||||||
|
{
|
||||||
|
return ($shape['queryName']
|
||||||
|
?: ucfirst(@$shape['locationName'] ?: ""))
|
||||||
|
?: $default;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function isFlat(Shape $shape)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function format_list(
|
||||||
|
ListShape $shape,
|
||||||
|
array $value,
|
||||||
|
$prefix,
|
||||||
|
&$query
|
||||||
|
) {
|
||||||
|
// Handle empty list serialization
|
||||||
|
if (!empty($value)) {
|
||||||
|
$items = $shape->getMember();
|
||||||
|
foreach ($value as $k => $v) {
|
||||||
|
$this->format($items, $v, $prefix . '.' . ($k + 1), $query);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
108
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Serializer/JsonBody.php
vendored
Normal file
108
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Serializer/JsonBody.php
vendored
Normal file
|
@ -0,0 +1,108 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api\Serializer;
|
||||||
|
|
||||||
|
use Aws\Api\Service;
|
||||||
|
use Aws\Api\Shape;
|
||||||
|
use Aws\Api\TimestampShape;
|
||||||
|
use Aws\Exception\InvalidJsonException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Formats the JSON body of a JSON-REST or JSON-RPC operation.
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
class JsonBody
|
||||||
|
{
|
||||||
|
private $api;
|
||||||
|
|
||||||
|
public function __construct(Service $api)
|
||||||
|
{
|
||||||
|
$this->api = $api;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the JSON Content-Type header for a service API
|
||||||
|
*
|
||||||
|
* @param Service $service
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function getContentType(Service $service)
|
||||||
|
{
|
||||||
|
if ($service->getMetadata('protocol') === 'rest-json') {
|
||||||
|
return 'application/json';
|
||||||
|
}
|
||||||
|
|
||||||
|
$jsonVersion = $service->getMetadata('jsonVersion');
|
||||||
|
if (empty($jsonVersion)) {
|
||||||
|
throw new \InvalidArgumentException('invalid json');
|
||||||
|
} else {
|
||||||
|
return 'application/x-amz-json-'
|
||||||
|
. @number_format($service->getMetadata('jsonVersion'), 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Builds the JSON body based on an array of arguments.
|
||||||
|
*
|
||||||
|
* @param Shape $shape Operation being constructed
|
||||||
|
* @param array $args Associative array of arguments
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function build(Shape $shape, array $args)
|
||||||
|
{
|
||||||
|
$result = json_encode($this->format($shape, $args));
|
||||||
|
return $result == '[]' ? '{}' : $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function format(Shape $shape, $value)
|
||||||
|
{
|
||||||
|
switch ($shape['type']) {
|
||||||
|
case 'structure':
|
||||||
|
$data = [];
|
||||||
|
if (isset($shape['document']) && $shape['document']) {
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
foreach ($value as $k => $v) {
|
||||||
|
if ($v !== null && $shape->hasMember($k)) {
|
||||||
|
$valueShape = $shape->getMember($k);
|
||||||
|
$data[$valueShape['locationName'] ?: $k]
|
||||||
|
= $this->format($valueShape, $v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (empty($data)) {
|
||||||
|
return new \stdClass;
|
||||||
|
}
|
||||||
|
return $data;
|
||||||
|
|
||||||
|
case 'list':
|
||||||
|
$items = $shape->getMember();
|
||||||
|
foreach ($value as $k => $v) {
|
||||||
|
$value[$k] = $this->format($items, $v);
|
||||||
|
}
|
||||||
|
return $value;
|
||||||
|
|
||||||
|
case 'map':
|
||||||
|
if (empty($value)) {
|
||||||
|
return new \stdClass;
|
||||||
|
}
|
||||||
|
$values = $shape->getValue();
|
||||||
|
foreach ($value as $k => $v) {
|
||||||
|
$value[$k] = $this->format($values, $v);
|
||||||
|
}
|
||||||
|
return $value;
|
||||||
|
|
||||||
|
case 'blob':
|
||||||
|
return base64_encode($value);
|
||||||
|
|
||||||
|
case 'timestamp':
|
||||||
|
$timestampFormat = !empty($shape['timestampFormat'])
|
||||||
|
? $shape['timestampFormat']
|
||||||
|
: 'unixTimestamp';
|
||||||
|
return TimestampShape::format($value, $timestampFormat);
|
||||||
|
|
||||||
|
default:
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
84
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Serializer/JsonRpcSerializer.php
vendored
Normal file
84
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Serializer/JsonRpcSerializer.php
vendored
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api\Serializer;
|
||||||
|
|
||||||
|
use Aws\Api\Service;
|
||||||
|
use Aws\CommandInterface;
|
||||||
|
use Aws\EndpointV2\EndpointV2SerializerTrait;
|
||||||
|
use Aws\EndpointV2\Ruleset\RulesetEndpoint;
|
||||||
|
use GuzzleHttp\Psr7\Request;
|
||||||
|
use Psr\Http\Message\RequestInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prepares a JSON-RPC request for transfer.
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
class JsonRpcSerializer
|
||||||
|
{
|
||||||
|
use EndpointV2SerializerTrait;
|
||||||
|
|
||||||
|
/** @var JsonBody */
|
||||||
|
private $jsonFormatter;
|
||||||
|
|
||||||
|
/** @var string */
|
||||||
|
private $endpoint;
|
||||||
|
|
||||||
|
/** @var Service */
|
||||||
|
private $api;
|
||||||
|
|
||||||
|
/** @var string */
|
||||||
|
private $contentType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Service $api Service description
|
||||||
|
* @param string $endpoint Endpoint to connect to
|
||||||
|
* @param JsonBody $jsonFormatter Optional JSON formatter to use
|
||||||
|
*/
|
||||||
|
public function __construct(
|
||||||
|
Service $api,
|
||||||
|
$endpoint,
|
||||||
|
?JsonBody $jsonFormatter = null
|
||||||
|
) {
|
||||||
|
$this->endpoint = $endpoint;
|
||||||
|
$this->api = $api;
|
||||||
|
$this->jsonFormatter = $jsonFormatter ?: new JsonBody($this->api);
|
||||||
|
$this->contentType = JsonBody::getContentType($api);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When invoked with an AWS command, returns a serialization array
|
||||||
|
* containing "method", "uri", "headers", and "body" key value pairs.
|
||||||
|
*
|
||||||
|
* @param CommandInterface $command Command to serialize into a request.
|
||||||
|
* @param $endpointProvider Provider used for dynamic endpoint resolution.
|
||||||
|
* @param $clientArgs Client arguments used for dynamic endpoint resolution.
|
||||||
|
*
|
||||||
|
* @return RequestInterface
|
||||||
|
*/
|
||||||
|
public function __invoke(
|
||||||
|
CommandInterface $command,
|
||||||
|
$endpoint = null
|
||||||
|
)
|
||||||
|
{
|
||||||
|
$operationName = $command->getName();
|
||||||
|
$operation = $this->api->getOperation($operationName);
|
||||||
|
$commandArgs = $command->toArray();
|
||||||
|
$headers = [
|
||||||
|
'X-Amz-Target' => $this->api->getMetadata('targetPrefix') . '.' . $operationName,
|
||||||
|
'Content-Type' => $this->contentType
|
||||||
|
];
|
||||||
|
|
||||||
|
if ($endpoint instanceof RulesetEndpoint) {
|
||||||
|
$this->setEndpointV2RequestOptions($endpoint, $headers);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Request(
|
||||||
|
$operation['http']['method'],
|
||||||
|
$this->endpoint,
|
||||||
|
$headers,
|
||||||
|
$this->jsonFormatter->build(
|
||||||
|
$operation->getInput(),
|
||||||
|
$commandArgs
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
157
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Serializer/QueryParamBuilder.php
vendored
Normal file
157
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Serializer/QueryParamBuilder.php
vendored
Normal file
|
@ -0,0 +1,157 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api\Serializer;
|
||||||
|
|
||||||
|
use Aws\Api\StructureShape;
|
||||||
|
use Aws\Api\ListShape;
|
||||||
|
use Aws\Api\MapShape;
|
||||||
|
use Aws\Api\Shape;
|
||||||
|
use Aws\Api\TimestampShape;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
class QueryParamBuilder
|
||||||
|
{
|
||||||
|
private $methods;
|
||||||
|
|
||||||
|
protected function queryName(Shape $shape, $default = null)
|
||||||
|
{
|
||||||
|
if (null !== $shape['queryName']) {
|
||||||
|
return $shape['queryName'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null !== $shape['locationName']) {
|
||||||
|
return $shape['locationName'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->isFlat($shape) && !empty($shape['member']['locationName'])) {
|
||||||
|
return $shape['member']['locationName'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $default;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function isFlat(Shape $shape)
|
||||||
|
{
|
||||||
|
return $shape['flattened'] === true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __invoke(StructureShape $shape, array $params)
|
||||||
|
{
|
||||||
|
if (!$this->methods) {
|
||||||
|
$this->methods = array_fill_keys(get_class_methods($this), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = [];
|
||||||
|
$this->format_structure($shape, $params, '', $query);
|
||||||
|
|
||||||
|
return $query;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function format(Shape $shape, $value, $prefix, array &$query)
|
||||||
|
{
|
||||||
|
$type = 'format_' . $shape['type'];
|
||||||
|
if (isset($this->methods[$type])) {
|
||||||
|
$this->{$type}($shape, $value, $prefix, $query);
|
||||||
|
} else {
|
||||||
|
$query[$prefix] = (string) $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function format_structure(
|
||||||
|
StructureShape $shape,
|
||||||
|
array $value,
|
||||||
|
$prefix,
|
||||||
|
&$query
|
||||||
|
) {
|
||||||
|
if ($prefix) {
|
||||||
|
$prefix .= '.';
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($value as $k => $v) {
|
||||||
|
if ($shape->hasMember($k)) {
|
||||||
|
$member = $shape->getMember($k);
|
||||||
|
$this->format(
|
||||||
|
$member,
|
||||||
|
$v,
|
||||||
|
$prefix . $this->queryName($member, $k),
|
||||||
|
$query
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function format_list(
|
||||||
|
ListShape $shape,
|
||||||
|
array $value,
|
||||||
|
$prefix,
|
||||||
|
&$query
|
||||||
|
) {
|
||||||
|
// Handle empty list serialization
|
||||||
|
if (!$value) {
|
||||||
|
$query[$prefix] = '';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$items = $shape->getMember();
|
||||||
|
|
||||||
|
if (!$this->isFlat($shape)) {
|
||||||
|
$locationName = $shape->getMember()['locationName'] ?: 'member';
|
||||||
|
$prefix .= ".$locationName";
|
||||||
|
} elseif ($name = $this->queryName($items)) {
|
||||||
|
$parts = explode('.', $prefix);
|
||||||
|
$parts[count($parts) - 1] = $name;
|
||||||
|
$prefix = implode('.', $parts);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($value as $k => $v) {
|
||||||
|
$this->format($items, $v, $prefix . '.' . ($k + 1), $query);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function format_map(
|
||||||
|
MapShape $shape,
|
||||||
|
array $value,
|
||||||
|
$prefix,
|
||||||
|
array &$query
|
||||||
|
) {
|
||||||
|
$vals = $shape->getValue();
|
||||||
|
$keys = $shape->getKey();
|
||||||
|
|
||||||
|
if (!$this->isFlat($shape)) {
|
||||||
|
$prefix .= '.entry';
|
||||||
|
}
|
||||||
|
|
||||||
|
$i = 0;
|
||||||
|
$keyName = '%s.%d.' . $this->queryName($keys, 'key');
|
||||||
|
$valueName = '%s.%s.' . $this->queryName($vals, 'value');
|
||||||
|
|
||||||
|
foreach ($value as $k => $v) {
|
||||||
|
$i++;
|
||||||
|
$this->format($keys, $k, sprintf($keyName, $prefix, $i), $query);
|
||||||
|
$this->format($vals, $v, sprintf($valueName, $prefix, $i), $query);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function format_blob(Shape $shape, $value, $prefix, array &$query)
|
||||||
|
{
|
||||||
|
$query[$prefix] = base64_encode($value);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function format_timestamp(
|
||||||
|
TimestampShape $shape,
|
||||||
|
$value,
|
||||||
|
$prefix,
|
||||||
|
array &$query
|
||||||
|
) {
|
||||||
|
$timestampFormat = !empty($shape['timestampFormat'])
|
||||||
|
? $shape['timestampFormat']
|
||||||
|
: 'iso8601';
|
||||||
|
$query[$prefix] = TimestampShape::format($value, $timestampFormat);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function format_boolean(Shape $shape, $value, $prefix, array &$query)
|
||||||
|
{
|
||||||
|
$query[$prefix] = ($value) ? 'true' : 'false';
|
||||||
|
}
|
||||||
|
}
|
81
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Serializer/QuerySerializer.php
vendored
Normal file
81
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Serializer/QuerySerializer.php
vendored
Normal file
|
@ -0,0 +1,81 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api\Serializer;
|
||||||
|
|
||||||
|
use Aws\Api\Service;
|
||||||
|
use Aws\CommandInterface;
|
||||||
|
use Aws\EndpointV2\EndpointProviderV2;
|
||||||
|
use Aws\EndpointV2\EndpointV2SerializerTrait;
|
||||||
|
use Aws\EndpointV2\Ruleset\RulesetEndpoint;
|
||||||
|
use GuzzleHttp\Psr7\Request;
|
||||||
|
use Psr\Http\Message\RequestInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serializes a query protocol request.
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
class QuerySerializer
|
||||||
|
{
|
||||||
|
use EndpointV2SerializerTrait;
|
||||||
|
|
||||||
|
private $endpoint;
|
||||||
|
private $api;
|
||||||
|
private $paramBuilder;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
Service $api,
|
||||||
|
$endpoint,
|
||||||
|
?callable $paramBuilder = null
|
||||||
|
) {
|
||||||
|
$this->api = $api;
|
||||||
|
$this->endpoint = $endpoint;
|
||||||
|
$this->paramBuilder = $paramBuilder ?: new QueryParamBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When invoked with an AWS command, returns a serialization array
|
||||||
|
* containing "method", "uri", "headers", and "body" key value pairs.
|
||||||
|
*
|
||||||
|
* @param CommandInterface $command Command to serialize into a request.
|
||||||
|
* @param $endpointProvider Provider used for dynamic endpoint resolution.
|
||||||
|
* @param $clientArgs Client arguments used for dynamic endpoint resolution.
|
||||||
|
*
|
||||||
|
* @return RequestInterface
|
||||||
|
*/
|
||||||
|
public function __invoke(
|
||||||
|
CommandInterface $command,
|
||||||
|
$endpoint = null
|
||||||
|
)
|
||||||
|
{
|
||||||
|
$operation = $this->api->getOperation($command->getName());
|
||||||
|
$body = [
|
||||||
|
'Action' => $command->getName(),
|
||||||
|
'Version' => $this->api->getMetadata('apiVersion')
|
||||||
|
];
|
||||||
|
$commandArgs = $command->toArray();
|
||||||
|
|
||||||
|
// Only build up the parameters when there are parameters to build
|
||||||
|
if ($commandArgs) {
|
||||||
|
$body += call_user_func(
|
||||||
|
$this->paramBuilder,
|
||||||
|
$operation->getInput(),
|
||||||
|
$commandArgs
|
||||||
|
);
|
||||||
|
}
|
||||||
|
$body = http_build_query($body, '', '&', PHP_QUERY_RFC3986);
|
||||||
|
$headers = [
|
||||||
|
'Content-Length' => strlen($body),
|
||||||
|
'Content-Type' => 'application/x-www-form-urlencoded'
|
||||||
|
];
|
||||||
|
|
||||||
|
if ($endpoint instanceof RulesetEndpoint) {
|
||||||
|
$this->setEndpointV2RequestOptions($endpoint, $headers);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Request(
|
||||||
|
'POST',
|
||||||
|
$this->endpoint,
|
||||||
|
$headers,
|
||||||
|
$body
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
42
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Serializer/RestJsonSerializer.php
vendored
Normal file
42
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Serializer/RestJsonSerializer.php
vendored
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api\Serializer;
|
||||||
|
|
||||||
|
use Aws\Api\Service;
|
||||||
|
use Aws\Api\StructureShape;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serializes requests for the REST-JSON protocol.
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
class RestJsonSerializer extends RestSerializer
|
||||||
|
{
|
||||||
|
/** @var JsonBody */
|
||||||
|
private $jsonFormatter;
|
||||||
|
|
||||||
|
/** @var string */
|
||||||
|
private $contentType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Service $api Service API description
|
||||||
|
* @param string $endpoint Endpoint to connect to
|
||||||
|
* @param JsonBody $jsonFormatter Optional JSON formatter to use
|
||||||
|
*/
|
||||||
|
public function __construct(
|
||||||
|
Service $api,
|
||||||
|
$endpoint,
|
||||||
|
?JsonBody $jsonFormatter = null
|
||||||
|
) {
|
||||||
|
parent::__construct($api, $endpoint);
|
||||||
|
$this->contentType = JsonBody::getContentType($api);
|
||||||
|
$this->jsonFormatter = $jsonFormatter ?: new JsonBody($api);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function payload(StructureShape $member, array $value, array &$opts)
|
||||||
|
{
|
||||||
|
$body = isset($value) ?
|
||||||
|
((string) $this->jsonFormatter->build($member, $value))
|
||||||
|
: "{}";
|
||||||
|
$opts['headers']['Content-Type'] = $this->contentType;
|
||||||
|
$opts['body'] = $body;
|
||||||
|
}
|
||||||
|
}
|
330
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Serializer/RestSerializer.php
vendored
Normal file
330
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Serializer/RestSerializer.php
vendored
Normal file
|
@ -0,0 +1,330 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api\Serializer;
|
||||||
|
|
||||||
|
use Aws\Api\MapShape;
|
||||||
|
use Aws\Api\Service;
|
||||||
|
use Aws\Api\Operation;
|
||||||
|
use Aws\Api\Shape;
|
||||||
|
use Aws\Api\StructureShape;
|
||||||
|
use Aws\Api\TimestampShape;
|
||||||
|
use Aws\CommandInterface;
|
||||||
|
use Aws\EndpointV2\EndpointV2SerializerTrait;
|
||||||
|
use Aws\EndpointV2\Ruleset\RulesetEndpoint;
|
||||||
|
use GuzzleHttp\Psr7;
|
||||||
|
use GuzzleHttp\Psr7\Request;
|
||||||
|
use GuzzleHttp\Psr7\Uri;
|
||||||
|
use GuzzleHttp\Psr7\UriResolver;
|
||||||
|
use Psr\Http\Message\RequestInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serializes HTTP locations like header, uri, payload, etc...
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
abstract class RestSerializer
|
||||||
|
{
|
||||||
|
use EndpointV2SerializerTrait;
|
||||||
|
|
||||||
|
/** @var Service */
|
||||||
|
private $api;
|
||||||
|
|
||||||
|
/** @var Uri */
|
||||||
|
private $endpoint;
|
||||||
|
|
||||||
|
/** @var bool */
|
||||||
|
private $isUseEndpointV2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Service $api Service API description
|
||||||
|
* @param string $endpoint Endpoint to connect to
|
||||||
|
*/
|
||||||
|
public function __construct(Service $api, $endpoint)
|
||||||
|
{
|
||||||
|
$this->api = $api;
|
||||||
|
$this->endpoint = Psr7\Utils::uriFor($endpoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param CommandInterface $command Command to serialize into a request.
|
||||||
|
* @param $clientArgs Client arguments used for dynamic endpoint resolution.
|
||||||
|
*
|
||||||
|
* @return RequestInterface
|
||||||
|
*/
|
||||||
|
public function __invoke(
|
||||||
|
CommandInterface $command,
|
||||||
|
$endpoint = null
|
||||||
|
)
|
||||||
|
{
|
||||||
|
$operation = $this->api->getOperation($command->getName());
|
||||||
|
$commandArgs = $command->toArray();
|
||||||
|
$opts = $this->serialize($operation, $commandArgs);
|
||||||
|
$headers = isset($opts['headers']) ? $opts['headers'] : [];
|
||||||
|
|
||||||
|
if ($endpoint instanceof RulesetEndpoint) {
|
||||||
|
$this->isUseEndpointV2 = true;
|
||||||
|
$this->setEndpointV2RequestOptions($endpoint, $headers);
|
||||||
|
}
|
||||||
|
|
||||||
|
$uri = $this->buildEndpoint($operation, $commandArgs, $opts);
|
||||||
|
|
||||||
|
return new Request(
|
||||||
|
$operation['http']['method'],
|
||||||
|
$uri,
|
||||||
|
$headers,
|
||||||
|
isset($opts['body']) ? $opts['body'] : null
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Modifies a hash of request options for a payload body.
|
||||||
|
*
|
||||||
|
* @param StructureShape $member Member to serialize
|
||||||
|
* @param array $value Value to serialize
|
||||||
|
* @param array $opts Request options to modify.
|
||||||
|
*/
|
||||||
|
abstract protected function payload(
|
||||||
|
StructureShape $member,
|
||||||
|
array $value,
|
||||||
|
array &$opts
|
||||||
|
);
|
||||||
|
|
||||||
|
private function serialize(Operation $operation, array $args)
|
||||||
|
{
|
||||||
|
$opts = [];
|
||||||
|
$input = $operation->getInput();
|
||||||
|
|
||||||
|
// Apply the payload trait if present
|
||||||
|
if ($payload = $input['payload']) {
|
||||||
|
$this->applyPayload($input, $payload, $args, $opts);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($args as $name => $value) {
|
||||||
|
if ($input->hasMember($name)) {
|
||||||
|
$member = $input->getMember($name);
|
||||||
|
$location = $member['location'];
|
||||||
|
if (!$payload && !$location) {
|
||||||
|
$bodyMembers[$name] = $value;
|
||||||
|
} elseif ($location == 'header') {
|
||||||
|
$this->applyHeader($name, $member, $value, $opts);
|
||||||
|
} elseif ($location == 'querystring') {
|
||||||
|
$this->applyQuery($name, $member, $value, $opts);
|
||||||
|
} elseif ($location == 'headers') {
|
||||||
|
$this->applyHeaderMap($name, $member, $value, $opts);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($bodyMembers)) {
|
||||||
|
$this->payload($operation->getInput(), $bodyMembers, $opts);
|
||||||
|
} else if (!isset($opts['body']) && $this->hasPayloadParam($input, $payload)) {
|
||||||
|
$this->payload($operation->getInput(), [], $opts);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $opts;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function applyPayload(StructureShape $input, $name, array $args, array &$opts)
|
||||||
|
{
|
||||||
|
if (!isset($args[$name])) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$m = $input->getMember($name);
|
||||||
|
|
||||||
|
if ($m['streaming'] ||
|
||||||
|
($m['type'] == 'string' || $m['type'] == 'blob')
|
||||||
|
) {
|
||||||
|
// Streaming bodies or payloads that are strings are
|
||||||
|
// always just a stream of data.
|
||||||
|
$opts['body'] = Psr7\Utils::streamFor($args[$name]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->payload($m, $args[$name], $opts);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function applyHeader($name, Shape $member, $value, array &$opts)
|
||||||
|
{
|
||||||
|
if ($member->getType() === 'timestamp') {
|
||||||
|
$timestampFormat = !empty($member['timestampFormat'])
|
||||||
|
? $member['timestampFormat']
|
||||||
|
: 'rfc822';
|
||||||
|
$value = TimestampShape::format($value, $timestampFormat);
|
||||||
|
} elseif ($member->getType() === 'boolean') {
|
||||||
|
$value = $value ? 'true' : 'false';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($member['jsonvalue']) {
|
||||||
|
$value = json_encode($value);
|
||||||
|
if (empty($value) && JSON_ERROR_NONE !== json_last_error()) {
|
||||||
|
throw new \InvalidArgumentException('Unable to encode the provided value'
|
||||||
|
. ' with \'json_encode\'. ' . json_last_error_msg());
|
||||||
|
}
|
||||||
|
|
||||||
|
$value = base64_encode($value);
|
||||||
|
}
|
||||||
|
|
||||||
|
$opts['headers'][$member['locationName'] ?: $name] = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Note: This is currently only present in the Amazon S3 model.
|
||||||
|
*/
|
||||||
|
private function applyHeaderMap($name, Shape $member, array $value, array &$opts)
|
||||||
|
{
|
||||||
|
$prefix = $member['locationName'];
|
||||||
|
foreach ($value as $k => $v) {
|
||||||
|
$opts['headers'][$prefix . $k] = $v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function applyQuery($name, Shape $member, $value, array &$opts)
|
||||||
|
{
|
||||||
|
if ($member instanceof MapShape) {
|
||||||
|
$opts['query'] = isset($opts['query']) && is_array($opts['query'])
|
||||||
|
? $opts['query'] + $value
|
||||||
|
: $value;
|
||||||
|
} elseif ($value !== null) {
|
||||||
|
$type = $member->getType();
|
||||||
|
if ($type === 'boolean') {
|
||||||
|
$value = $value ? 'true' : 'false';
|
||||||
|
} elseif ($type === 'timestamp') {
|
||||||
|
$timestampFormat = !empty($member['timestampFormat'])
|
||||||
|
? $member['timestampFormat']
|
||||||
|
: 'iso8601';
|
||||||
|
$value = TimestampShape::format($value, $timestampFormat);
|
||||||
|
}
|
||||||
|
|
||||||
|
$opts['query'][$member['locationName'] ?: $name] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function buildEndpoint(Operation $operation, array $args, array $opts)
|
||||||
|
{
|
||||||
|
$serviceName = $this->api->getServiceName();
|
||||||
|
// Create an associative array of variable definitions used in expansions
|
||||||
|
$varDefinitions = $this->getVarDefinitions($operation, $args);
|
||||||
|
|
||||||
|
$relative = preg_replace_callback(
|
||||||
|
'/\{([^\}]+)\}/',
|
||||||
|
function (array $matches) use ($varDefinitions) {
|
||||||
|
$isGreedy = substr($matches[1], -1, 1) == '+';
|
||||||
|
$k = $isGreedy ? substr($matches[1], 0, -1) : $matches[1];
|
||||||
|
if (!isset($varDefinitions[$k])) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($isGreedy) {
|
||||||
|
return str_replace('%2F', '/', rawurlencode($varDefinitions[$k]));
|
||||||
|
}
|
||||||
|
|
||||||
|
return rawurlencode($varDefinitions[$k]);
|
||||||
|
},
|
||||||
|
$operation['http']['requestUri']
|
||||||
|
);
|
||||||
|
|
||||||
|
// Add the query string variables or appending to one if needed.
|
||||||
|
if (!empty($opts['query'])) {
|
||||||
|
$relative = $this->appendQuery($opts['query'], $relative);
|
||||||
|
}
|
||||||
|
|
||||||
|
$path = $this->endpoint->getPath();
|
||||||
|
|
||||||
|
if ($this->isUseEndpointV2 && $serviceName === 's3') {
|
||||||
|
if (substr($path, -1) === '/' && $relative[0] === '/') {
|
||||||
|
$path = rtrim($path, '/');
|
||||||
|
}
|
||||||
|
$relative = $path . $relative;
|
||||||
|
|
||||||
|
if (strpos($relative, '../') !== false
|
||||||
|
|| substr($relative, -2) === '..'
|
||||||
|
) {
|
||||||
|
if ($relative[0] !== '/') {
|
||||||
|
$relative = '/' . $relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Uri($this->endpoint->withPath('') . $relative);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (((!empty($relative) && $relative !== '/')
|
||||||
|
&& !$this->isUseEndpointV2)
|
||||||
|
|| (isset($serviceName) && str_starts_with($serviceName, 'geo-'))
|
||||||
|
) {
|
||||||
|
$this->normalizePath($path);
|
||||||
|
}
|
||||||
|
|
||||||
|
// If endpoint has path, remove leading '/' to preserve URI resolution.
|
||||||
|
if ($path && $relative[0] === '/') {
|
||||||
|
$relative = substr($relative, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Append path to endpoint when leading '//...'
|
||||||
|
// present as uri cannot be properly resolved
|
||||||
|
if ($this->isUseEndpointV2 && strpos($relative, '//') === 0) {
|
||||||
|
return new Uri($this->endpoint . $relative);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Expand path place holders using Amazon's slightly different URI
|
||||||
|
// template syntax.
|
||||||
|
return UriResolver::resolve($this->endpoint, new Uri($relative));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param StructureShape $input
|
||||||
|
*/
|
||||||
|
private function hasPayloadParam(StructureShape $input, $payload)
|
||||||
|
{
|
||||||
|
if ($payload) {
|
||||||
|
$potentiallyEmptyTypes = ['blob','string'];
|
||||||
|
if ($this->api->getMetadata('protocol') == 'rest-xml') {
|
||||||
|
$potentiallyEmptyTypes[] = 'structure';
|
||||||
|
}
|
||||||
|
$payloadMember = $input->getMember($payload);
|
||||||
|
if (in_array($payloadMember['type'], $potentiallyEmptyTypes)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach ($input->getMembers() as $member) {
|
||||||
|
if (!isset($member['location'])) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function appendQuery($query, $endpoint)
|
||||||
|
{
|
||||||
|
$append = Psr7\Query::build($query);
|
||||||
|
return $endpoint .= strpos($endpoint, '?') !== false ? "&{$append}" : "?{$append}";
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getVarDefinitions($command, $args)
|
||||||
|
{
|
||||||
|
$varDefinitions = [];
|
||||||
|
|
||||||
|
foreach ($command->getInput()->getMembers() as $name => $member) {
|
||||||
|
if ($member['location'] == 'uri') {
|
||||||
|
$varDefinitions[$member['locationName'] ?: $name] =
|
||||||
|
isset($args[$name])
|
||||||
|
? $args[$name]
|
||||||
|
: null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $varDefinitions;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Appends trailing slash to non-empty paths with at least one segment
|
||||||
|
* to ensure proper URI resolution
|
||||||
|
*
|
||||||
|
* @param string $path
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private function normalizePath(string $path): void
|
||||||
|
{
|
||||||
|
if (!empty($path) && $path !== '/' && substr($path, -1) !== '/') {
|
||||||
|
$this->endpoint = $this->endpoint->withPath($path . '/');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
48
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Serializer/RestXmlSerializer.php
vendored
Normal file
48
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Serializer/RestXmlSerializer.php
vendored
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api\Serializer;
|
||||||
|
|
||||||
|
use Aws\Api\StructureShape;
|
||||||
|
use Aws\Api\Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
class RestXmlSerializer extends RestSerializer
|
||||||
|
{
|
||||||
|
/** @var XmlBody */
|
||||||
|
private $xmlBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Service $api Service API description
|
||||||
|
* @param string $endpoint Endpoint to connect to
|
||||||
|
* @param XmlBody $xmlBody Optional XML formatter to use
|
||||||
|
*/
|
||||||
|
public function __construct(
|
||||||
|
Service $api,
|
||||||
|
$endpoint,
|
||||||
|
?XmlBody $xmlBody = null
|
||||||
|
) {
|
||||||
|
parent::__construct($api, $endpoint);
|
||||||
|
$this->xmlBody = $xmlBody ?: new XmlBody($api);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function payload(StructureShape $member, array $value, array &$opts)
|
||||||
|
{
|
||||||
|
$opts['headers']['Content-Type'] = 'application/xml';
|
||||||
|
$opts['body'] = $this->getXmlBody($member, $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param StructureShape $member
|
||||||
|
* @param array $value
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
private function getXmlBody(StructureShape $member, array $value)
|
||||||
|
{
|
||||||
|
$xmlBody = (string)$this->xmlBody->build($member, $value);
|
||||||
|
$xmlBody = str_replace("'", "'", $xmlBody);
|
||||||
|
$xmlBody = str_replace('\r', " ", $xmlBody);
|
||||||
|
$xmlBody = str_replace('\n', " ", $xmlBody);
|
||||||
|
return $xmlBody;
|
||||||
|
}
|
||||||
|
}
|
220
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Serializer/XmlBody.php
vendored
Normal file
220
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Serializer/XmlBody.php
vendored
Normal file
|
@ -0,0 +1,220 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api\Serializer;
|
||||||
|
|
||||||
|
use Aws\Api\MapShape;
|
||||||
|
use Aws\Api\Service;
|
||||||
|
use Aws\Api\Shape;
|
||||||
|
use Aws\Api\StructureShape;
|
||||||
|
use Aws\Api\ListShape;
|
||||||
|
use Aws\Api\TimestampShape;
|
||||||
|
use XMLWriter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal Formats the XML body of a REST-XML services.
|
||||||
|
*/
|
||||||
|
class XmlBody
|
||||||
|
{
|
||||||
|
/** @var \Aws\Api\Service */
|
||||||
|
private $api;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Service $api API being used to create the XML body.
|
||||||
|
*/
|
||||||
|
public function __construct(Service $api)
|
||||||
|
{
|
||||||
|
$this->api = $api;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Builds the XML body based on an array of arguments.
|
||||||
|
*
|
||||||
|
* @param Shape $shape Operation being constructed
|
||||||
|
* @param array $args Associative array of arguments
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function build(Shape $shape, array $args)
|
||||||
|
{
|
||||||
|
$xml = new XMLWriter();
|
||||||
|
$xml->openMemory();
|
||||||
|
$xml->startDocument('1.0', 'UTF-8');
|
||||||
|
$this->format($shape, $shape['locationName'] ?: $shape['name'], $args, $xml);
|
||||||
|
$xml->endDocument();
|
||||||
|
|
||||||
|
return $xml->outputMemory();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function startElement(Shape $shape, $name, XMLWriter $xml)
|
||||||
|
{
|
||||||
|
$xml->startElement($name);
|
||||||
|
|
||||||
|
if ($ns = $shape['xmlNamespace']) {
|
||||||
|
$xml->writeAttribute(
|
||||||
|
isset($ns['prefix']) ? "xmlns:{$ns['prefix']}" : 'xmlns',
|
||||||
|
$shape['xmlNamespace']['uri']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function format(Shape $shape, $name, $value, XMLWriter $xml)
|
||||||
|
{
|
||||||
|
// Any method mentioned here has a custom serialization handler.
|
||||||
|
static $methods = [
|
||||||
|
'add_structure' => true,
|
||||||
|
'add_list' => true,
|
||||||
|
'add_blob' => true,
|
||||||
|
'add_timestamp' => true,
|
||||||
|
'add_boolean' => true,
|
||||||
|
'add_map' => true,
|
||||||
|
'add_string' => true
|
||||||
|
];
|
||||||
|
|
||||||
|
$type = 'add_' . $shape['type'];
|
||||||
|
if (isset($methods[$type])) {
|
||||||
|
$this->{$type}($shape, $name, $value, $xml);
|
||||||
|
} else {
|
||||||
|
$this->defaultShape($shape, $name, $value, $xml);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function defaultShape(Shape $shape, $name, $value, XMLWriter $xml)
|
||||||
|
{
|
||||||
|
$this->startElement($shape, $name, $xml);
|
||||||
|
$xml->text($value);
|
||||||
|
$xml->endElement();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function add_structure(
|
||||||
|
StructureShape $shape,
|
||||||
|
$name,
|
||||||
|
array $value,
|
||||||
|
\XMLWriter $xml
|
||||||
|
) {
|
||||||
|
$this->startElement($shape, $name, $xml);
|
||||||
|
|
||||||
|
foreach ($this->getStructureMembers($shape, $value) as $k => $definition) {
|
||||||
|
$this->format(
|
||||||
|
$definition['member'],
|
||||||
|
$definition['member']['locationName'] ?: $k,
|
||||||
|
$definition['value'],
|
||||||
|
$xml
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$xml->endElement();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getStructureMembers(StructureShape $shape, array $value)
|
||||||
|
{
|
||||||
|
$members = [];
|
||||||
|
|
||||||
|
foreach ($value as $k => $v) {
|
||||||
|
if ($v !== null && $shape->hasMember($k)) {
|
||||||
|
$definition = [
|
||||||
|
'member' => $shape->getMember($k),
|
||||||
|
'value' => $v,
|
||||||
|
];
|
||||||
|
|
||||||
|
if ($definition['member']['xmlAttribute']) {
|
||||||
|
// array_unshift_associative
|
||||||
|
$members = [$k => $definition] + $members;
|
||||||
|
} else {
|
||||||
|
$members[$k] = $definition;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $members;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function add_list(
|
||||||
|
ListShape $shape,
|
||||||
|
$name,
|
||||||
|
array $value,
|
||||||
|
XMLWriter $xml
|
||||||
|
) {
|
||||||
|
$items = $shape->getMember();
|
||||||
|
|
||||||
|
if ($shape['flattened']) {
|
||||||
|
$elementName = $name;
|
||||||
|
} else {
|
||||||
|
$this->startElement($shape, $name, $xml);
|
||||||
|
$elementName = $items['locationName'] ?: 'member';
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($value as $v) {
|
||||||
|
$this->format($items, $elementName, $v, $xml);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$shape['flattened']) {
|
||||||
|
$xml->endElement();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function add_map(
|
||||||
|
MapShape $shape,
|
||||||
|
$name,
|
||||||
|
array $value,
|
||||||
|
XMLWriter $xml
|
||||||
|
) {
|
||||||
|
$xmlEntry = $shape['flattened'] ? $shape['locationName'] : 'entry';
|
||||||
|
$xmlKey = $shape->getKey()['locationName'] ?: 'key';
|
||||||
|
$xmlValue = $shape->getValue()['locationName'] ?: 'value';
|
||||||
|
|
||||||
|
$this->startElement($shape, $name, $xml);
|
||||||
|
|
||||||
|
foreach ($value as $key => $v) {
|
||||||
|
$this->startElement($shape, $xmlEntry, $xml);
|
||||||
|
$this->format($shape->getKey(), $xmlKey, $key, $xml);
|
||||||
|
$this->format($shape->getValue(), $xmlValue, $v, $xml);
|
||||||
|
$xml->endElement();
|
||||||
|
}
|
||||||
|
|
||||||
|
$xml->endElement();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function add_blob(Shape $shape, $name, $value, XMLWriter $xml)
|
||||||
|
{
|
||||||
|
$this->startElement($shape, $name, $xml);
|
||||||
|
$xml->writeRaw(base64_encode($value));
|
||||||
|
$xml->endElement();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function add_timestamp(
|
||||||
|
TimestampShape $shape,
|
||||||
|
$name,
|
||||||
|
$value,
|
||||||
|
XMLWriter $xml
|
||||||
|
) {
|
||||||
|
$this->startElement($shape, $name, $xml);
|
||||||
|
$timestampFormat = !empty($shape['timestampFormat'])
|
||||||
|
? $shape['timestampFormat']
|
||||||
|
: 'iso8601';
|
||||||
|
$xml->writeRaw(TimestampShape::format($value, $timestampFormat));
|
||||||
|
$xml->endElement();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function add_boolean(
|
||||||
|
Shape $shape,
|
||||||
|
$name,
|
||||||
|
$value,
|
||||||
|
XMLWriter $xml
|
||||||
|
) {
|
||||||
|
$this->startElement($shape, $name, $xml);
|
||||||
|
$xml->writeRaw($value ? 'true' : 'false');
|
||||||
|
$xml->endElement();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function add_string(
|
||||||
|
Shape $shape,
|
||||||
|
$name,
|
||||||
|
$value,
|
||||||
|
XMLWriter $xml
|
||||||
|
) {
|
||||||
|
if ($shape['xmlAttribute']) {
|
||||||
|
$xml->writeAttribute($shape['locationName'] ?: $name, $value);
|
||||||
|
} else {
|
||||||
|
$this->defaultShape($shape, $name, $value, $xml);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
564
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Service.php
vendored
Normal file
564
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Service.php
vendored
Normal file
|
@ -0,0 +1,564 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a web service API model.
|
||||||
|
*/
|
||||||
|
class Service extends AbstractModel
|
||||||
|
{
|
||||||
|
/** @var callable */
|
||||||
|
private $apiProvider;
|
||||||
|
|
||||||
|
/** @var string */
|
||||||
|
private $serviceName;
|
||||||
|
|
||||||
|
/** @var string */
|
||||||
|
private $apiVersion;
|
||||||
|
|
||||||
|
/** @var array */
|
||||||
|
private $clientContextParams = [];
|
||||||
|
|
||||||
|
/** @var Operation[] */
|
||||||
|
private $operations = [];
|
||||||
|
|
||||||
|
/** @var array */
|
||||||
|
private $paginators = null;
|
||||||
|
|
||||||
|
/** @var array */
|
||||||
|
private $waiters = null;
|
||||||
|
|
||||||
|
/** @var boolean */
|
||||||
|
private $modifiedModel = false;
|
||||||
|
|
||||||
|
/** @var string */
|
||||||
|
private $protocol;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array $definition
|
||||||
|
* @param callable $provider
|
||||||
|
*
|
||||||
|
* @internal param array $definition Service description
|
||||||
|
*/
|
||||||
|
public function __construct(array $definition, callable $provider)
|
||||||
|
{
|
||||||
|
static $defaults = [
|
||||||
|
'operations' => [],
|
||||||
|
'shapes' => [],
|
||||||
|
'metadata' => [],
|
||||||
|
'clientContextParams' => []
|
||||||
|
], $defaultMeta = [
|
||||||
|
'apiVersion' => null,
|
||||||
|
'serviceFullName' => null,
|
||||||
|
'serviceId' => null,
|
||||||
|
'endpointPrefix' => null,
|
||||||
|
'signingName' => null,
|
||||||
|
'signatureVersion' => null,
|
||||||
|
'protocol' => null,
|
||||||
|
'uid' => null
|
||||||
|
];
|
||||||
|
|
||||||
|
$definition += $defaults;
|
||||||
|
$definition['metadata'] += $defaultMeta;
|
||||||
|
$this->definition = $definition;
|
||||||
|
$this->apiProvider = $provider;
|
||||||
|
parent::__construct($definition, new ShapeMap($definition['shapes']));
|
||||||
|
|
||||||
|
if (isset($definition['metadata']['serviceIdentifier'])) {
|
||||||
|
$this->serviceName = $this->getServiceName();
|
||||||
|
} else {
|
||||||
|
$this->serviceName = $this->getEndpointPrefix();
|
||||||
|
}
|
||||||
|
$this->apiVersion = $this->getApiVersion();
|
||||||
|
if (isset($definition['clientContextParams'])) {
|
||||||
|
$this->clientContextParams = $definition['clientContextParams'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->protocol = $this->selectProtocol($definition);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a request serializer for the provided API object.
|
||||||
|
*
|
||||||
|
* @param Service $api API that contains a protocol.
|
||||||
|
* @param string $endpoint Endpoint to send requests to.
|
||||||
|
*
|
||||||
|
* @return callable
|
||||||
|
* @throws \UnexpectedValueException
|
||||||
|
*/
|
||||||
|
public static function createSerializer(Service $api, $endpoint)
|
||||||
|
{
|
||||||
|
static $mapping = [
|
||||||
|
'json' => Serializer\JsonRpcSerializer::class,
|
||||||
|
'query' => Serializer\QuerySerializer::class,
|
||||||
|
'rest-json' => Serializer\RestJsonSerializer::class,
|
||||||
|
'rest-xml' => Serializer\RestXmlSerializer::class
|
||||||
|
];
|
||||||
|
|
||||||
|
$proto = $api->getProtocol();
|
||||||
|
|
||||||
|
if (isset($mapping[$proto])) {
|
||||||
|
return new $mapping[$proto]($api, $endpoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($proto == 'ec2') {
|
||||||
|
return new Serializer\QuerySerializer($api, $endpoint, new Serializer\Ec2ParamBuilder());
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new \UnexpectedValueException(
|
||||||
|
'Unknown protocol: ' . $api->getProtocol()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an error parser for the given protocol.
|
||||||
|
*
|
||||||
|
* Redundant method signature to preserve backwards compatibility.
|
||||||
|
*
|
||||||
|
* @param string $protocol Protocol to parse (e.g., query, json, etc.)
|
||||||
|
*
|
||||||
|
* @return callable
|
||||||
|
* @throws \UnexpectedValueException
|
||||||
|
*/
|
||||||
|
public static function createErrorParser($protocol, ?Service $api = null)
|
||||||
|
{
|
||||||
|
static $mapping = [
|
||||||
|
'json' => ErrorParser\JsonRpcErrorParser::class,
|
||||||
|
'query' => ErrorParser\XmlErrorParser::class,
|
||||||
|
'rest-json' => ErrorParser\RestJsonErrorParser::class,
|
||||||
|
'rest-xml' => ErrorParser\XmlErrorParser::class,
|
||||||
|
'ec2' => ErrorParser\XmlErrorParser::class
|
||||||
|
];
|
||||||
|
|
||||||
|
if (isset($mapping[$protocol])) {
|
||||||
|
return new $mapping[$protocol]($api);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new \UnexpectedValueException("Unknown protocol: $protocol");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Applies the listeners needed to parse client models.
|
||||||
|
*
|
||||||
|
* @param Service $api API to create a parser for
|
||||||
|
* @return callable
|
||||||
|
* @throws \UnexpectedValueException
|
||||||
|
*/
|
||||||
|
public static function createParser(Service $api)
|
||||||
|
{
|
||||||
|
static $mapping = [
|
||||||
|
'json' => Parser\JsonRpcParser::class,
|
||||||
|
'query' => Parser\QueryParser::class,
|
||||||
|
'rest-json' => Parser\RestJsonParser::class,
|
||||||
|
'rest-xml' => Parser\RestXmlParser::class
|
||||||
|
];
|
||||||
|
|
||||||
|
$proto = $api->getProtocol();
|
||||||
|
if (isset($mapping[$proto])) {
|
||||||
|
return new $mapping[$proto]($api);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($proto == 'ec2') {
|
||||||
|
return new Parser\QueryParser($api, null, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new \UnexpectedValueException(
|
||||||
|
'Unknown protocol: ' . $api->getProtocol()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the full name of the service
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getServiceFullName()
|
||||||
|
{
|
||||||
|
return $this->definition['metadata']['serviceFullName'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the service id
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getServiceId()
|
||||||
|
{
|
||||||
|
return $this->definition['metadata']['serviceId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the API version of the service
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getApiVersion()
|
||||||
|
{
|
||||||
|
return $this->definition['metadata']['apiVersion'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the API version of the service
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getEndpointPrefix()
|
||||||
|
{
|
||||||
|
return $this->definition['metadata']['endpointPrefix'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the signing name used by the service.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getSigningName()
|
||||||
|
{
|
||||||
|
return $this->definition['metadata']['signingName']
|
||||||
|
?: $this->definition['metadata']['endpointPrefix'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the service name.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getServiceName()
|
||||||
|
{
|
||||||
|
return $this->definition['metadata']['serviceIdentifier'] ?? null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the default signature version of the service.
|
||||||
|
*
|
||||||
|
* Note: this method assumes "v4" when not specified in the model.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getSignatureVersion()
|
||||||
|
{
|
||||||
|
return $this->definition['metadata']['signatureVersion'] ?: 'v4';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the protocol used by the service.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getProtocol()
|
||||||
|
{
|
||||||
|
return $this->protocol;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the uid string used by the service
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getUid()
|
||||||
|
{
|
||||||
|
return $this->definition['metadata']['uid'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the description has a specific operation by name.
|
||||||
|
*
|
||||||
|
* @param string $name Operation to check by name
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function hasOperation($name)
|
||||||
|
{
|
||||||
|
return isset($this['operations'][$name]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get an operation by name.
|
||||||
|
*
|
||||||
|
* @param string $name Operation to retrieve by name
|
||||||
|
*
|
||||||
|
* @return Operation
|
||||||
|
* @throws \InvalidArgumentException If the operation is not found
|
||||||
|
*/
|
||||||
|
public function getOperation($name)
|
||||||
|
{
|
||||||
|
if (!isset($this->operations[$name])) {
|
||||||
|
if (!isset($this->definition['operations'][$name])) {
|
||||||
|
throw new \InvalidArgumentException("Unknown operation: $name");
|
||||||
|
}
|
||||||
|
$this->operations[$name] = new Operation(
|
||||||
|
$this->definition['operations'][$name],
|
||||||
|
$this->shapeMap
|
||||||
|
);
|
||||||
|
} elseif ($this->modifiedModel) {
|
||||||
|
$this->operations[$name] = new Operation(
|
||||||
|
$this->definition['operations'][$name],
|
||||||
|
$this->shapeMap
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->operations[$name];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all of the operations of the description.
|
||||||
|
*
|
||||||
|
* @return Operation[]
|
||||||
|
*/
|
||||||
|
public function getOperations()
|
||||||
|
{
|
||||||
|
$result = [];
|
||||||
|
foreach ($this->definition['operations'] as $name => $definition) {
|
||||||
|
$result[$name] = $this->getOperation($name);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all of the error shapes of the service
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getErrorShapes()
|
||||||
|
{
|
||||||
|
$result = [];
|
||||||
|
foreach ($this->definition['shapes'] as $name => $definition) {
|
||||||
|
if (!empty($definition['exception'])) {
|
||||||
|
$definition['name'] = $name;
|
||||||
|
$result[] = new StructureShape($definition, $this->getShapeMap());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all of the service metadata or a specific metadata key value.
|
||||||
|
*
|
||||||
|
* @param string|null $key Key to retrieve or null to retrieve all metadata
|
||||||
|
*
|
||||||
|
* @return mixed Returns the result or null if the key is not found
|
||||||
|
*/
|
||||||
|
public function getMetadata($key = null)
|
||||||
|
{
|
||||||
|
if (!$key) {
|
||||||
|
return $this['metadata'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($this->definition['metadata'][$key])) {
|
||||||
|
return $this->definition['metadata'][$key];
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets an associative array of available paginator configurations where
|
||||||
|
* the key is the name of the paginator, and the value is the paginator
|
||||||
|
* configuration.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
* @unstable The configuration format of paginators may change in the future
|
||||||
|
*/
|
||||||
|
public function getPaginators()
|
||||||
|
{
|
||||||
|
if (!isset($this->paginators)) {
|
||||||
|
$res = call_user_func(
|
||||||
|
$this->apiProvider,
|
||||||
|
'paginator',
|
||||||
|
$this->serviceName,
|
||||||
|
$this->apiVersion
|
||||||
|
);
|
||||||
|
$this->paginators = isset($res['pagination'])
|
||||||
|
? $res['pagination']
|
||||||
|
: [];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->paginators;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines if the service has a paginator by name.
|
||||||
|
*
|
||||||
|
* @param string $name Name of the paginator.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function hasPaginator($name)
|
||||||
|
{
|
||||||
|
return isset($this->getPaginators()[$name]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve a paginator by name.
|
||||||
|
*
|
||||||
|
* @param string $name Paginator to retrieve by name. This argument is
|
||||||
|
* typically the operation name.
|
||||||
|
* @return array
|
||||||
|
* @throws \UnexpectedValueException if the paginator does not exist.
|
||||||
|
* @unstable The configuration format of paginators may change in the future
|
||||||
|
*/
|
||||||
|
public function getPaginatorConfig($name)
|
||||||
|
{
|
||||||
|
static $defaults = [
|
||||||
|
'input_token' => null,
|
||||||
|
'output_token' => null,
|
||||||
|
'limit_key' => null,
|
||||||
|
'result_key' => null,
|
||||||
|
'more_results' => null,
|
||||||
|
];
|
||||||
|
|
||||||
|
if ($this->hasPaginator($name)) {
|
||||||
|
return $this->paginators[$name] + $defaults;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new \UnexpectedValueException("There is no {$name} "
|
||||||
|
. "paginator defined for the {$this->serviceName} service.");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets an associative array of available waiter configurations where the
|
||||||
|
* key is the name of the waiter, and the value is the waiter
|
||||||
|
* configuration.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getWaiters()
|
||||||
|
{
|
||||||
|
if (!isset($this->waiters)) {
|
||||||
|
$res = call_user_func(
|
||||||
|
$this->apiProvider,
|
||||||
|
'waiter',
|
||||||
|
$this->serviceName,
|
||||||
|
$this->apiVersion
|
||||||
|
);
|
||||||
|
$this->waiters = isset($res['waiters'])
|
||||||
|
? $res['waiters']
|
||||||
|
: [];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->waiters;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines if the service has a waiter by name.
|
||||||
|
*
|
||||||
|
* @param string $name Name of the waiter.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function hasWaiter($name)
|
||||||
|
{
|
||||||
|
return isset($this->getWaiters()[$name]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a waiter configuration by name.
|
||||||
|
*
|
||||||
|
* @param string $name Name of the waiter by name.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
* @throws \UnexpectedValueException if the waiter does not exist.
|
||||||
|
*/
|
||||||
|
public function getWaiterConfig($name)
|
||||||
|
{
|
||||||
|
// Error if the waiter is not defined
|
||||||
|
if ($this->hasWaiter($name)) {
|
||||||
|
return $this->waiters[$name];
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new \UnexpectedValueException("There is no {$name} waiter "
|
||||||
|
. "defined for the {$this->serviceName} service.");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the shape map used by the API.
|
||||||
|
*
|
||||||
|
* @return ShapeMap
|
||||||
|
*/
|
||||||
|
public function getShapeMap()
|
||||||
|
{
|
||||||
|
return $this->shapeMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all the context params of the description.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getClientContextParams()
|
||||||
|
{
|
||||||
|
return $this->clientContextParams;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the service's api provider.
|
||||||
|
*
|
||||||
|
* @return callable
|
||||||
|
*/
|
||||||
|
public function getProvider()
|
||||||
|
{
|
||||||
|
return $this->apiProvider;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the service's definition.
|
||||||
|
*
|
||||||
|
* @return callable
|
||||||
|
*/
|
||||||
|
public function getDefinition()
|
||||||
|
{
|
||||||
|
return $this->definition;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the service's api definition.
|
||||||
|
* Intended for internal use only.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
public function setDefinition($definition)
|
||||||
|
{
|
||||||
|
$this->definition = $definition;
|
||||||
|
$this->shapeMap = new ShapeMap($definition['shapes']);
|
||||||
|
$this->modifiedModel = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Denotes whether or not a service's definition has
|
||||||
|
* been modified. Intended for internal use only.
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
public function isModifiedModel()
|
||||||
|
{
|
||||||
|
return $this->modifiedModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Accepts a list of protocols derived from the service model.
|
||||||
|
* Returns the highest priority compatible auth scheme if the `protocols` trait is present.
|
||||||
|
* Otherwise, returns the value of the `protocol` field, if set, or null.
|
||||||
|
*
|
||||||
|
* @param array $definition
|
||||||
|
*
|
||||||
|
* @return string|null
|
||||||
|
*/
|
||||||
|
private function selectProtocol(array $definition): string | null
|
||||||
|
{
|
||||||
|
$modeledProtocols = $definition['metadata']['protocols'] ?? null;
|
||||||
|
if (!empty($modeledProtocols)) {
|
||||||
|
foreach(SupportedProtocols::cases() as $protocol) {
|
||||||
|
if (in_array($protocol->value, $modeledProtocols)) {
|
||||||
|
return $protocol->value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $definition['metadata']['protocol'] ?? null;
|
||||||
|
}
|
||||||
|
}
|
77
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Shape.php
vendored
Normal file
77
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Shape.php
vendored
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base class representing a modeled shape.
|
||||||
|
*/
|
||||||
|
class Shape extends AbstractModel
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Get a concrete shape for the given definition.
|
||||||
|
*
|
||||||
|
* @param array $definition
|
||||||
|
* @param ShapeMap $shapeMap
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
* @throws \RuntimeException if the type is invalid
|
||||||
|
*/
|
||||||
|
public static function create(array $definition, ShapeMap $shapeMap)
|
||||||
|
{
|
||||||
|
static $map = [
|
||||||
|
'structure' => StructureShape::class,
|
||||||
|
'map' => MapShape::class,
|
||||||
|
'list' => ListShape::class,
|
||||||
|
'timestamp' => TimestampShape::class,
|
||||||
|
'integer' => Shape::class,
|
||||||
|
'double' => Shape::class,
|
||||||
|
'float' => Shape::class,
|
||||||
|
'long' => Shape::class,
|
||||||
|
'string' => Shape::class,
|
||||||
|
'byte' => Shape::class,
|
||||||
|
'character' => Shape::class,
|
||||||
|
'blob' => Shape::class,
|
||||||
|
'boolean' => Shape::class
|
||||||
|
];
|
||||||
|
|
||||||
|
if (isset($definition['shape'])) {
|
||||||
|
return $shapeMap->resolve($definition);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($map[$definition['type']])) {
|
||||||
|
throw new \RuntimeException('Invalid type: '
|
||||||
|
. print_r($definition, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
$type = $map[$definition['type']];
|
||||||
|
|
||||||
|
return new $type($definition, $shapeMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the type of the shape
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getType()
|
||||||
|
{
|
||||||
|
return $this->definition['type'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the name of the shape
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getName()
|
||||||
|
{
|
||||||
|
return $this->definition['name'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a context param definition.
|
||||||
|
*/
|
||||||
|
public function getContextParam()
|
||||||
|
{
|
||||||
|
return $this->contextParam;
|
||||||
|
}
|
||||||
|
}
|
68
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/ShapeMap.php
vendored
Normal file
68
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/ShapeMap.php
vendored
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Builds shape based on shape references.
|
||||||
|
*/
|
||||||
|
class ShapeMap
|
||||||
|
{
|
||||||
|
/** @var array */
|
||||||
|
private $definitions;
|
||||||
|
|
||||||
|
/** @var Shape[] */
|
||||||
|
private $simple;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array $shapeModels Associative array of shape definitions.
|
||||||
|
*/
|
||||||
|
public function __construct(array $shapeModels)
|
||||||
|
{
|
||||||
|
$this->definitions = $shapeModels;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get an array of shape names.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getShapeNames()
|
||||||
|
{
|
||||||
|
return array_keys($this->definitions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resolve a shape reference
|
||||||
|
*
|
||||||
|
* @param array $shapeRef Shape reference shape
|
||||||
|
*
|
||||||
|
* @return Shape
|
||||||
|
* @throws \InvalidArgumentException
|
||||||
|
*/
|
||||||
|
public function resolve(array $shapeRef)
|
||||||
|
{
|
||||||
|
$shape = $shapeRef['shape'];
|
||||||
|
|
||||||
|
if (!isset($this->definitions[$shape])) {
|
||||||
|
throw new \InvalidArgumentException('Shape not found: ' . $shape);
|
||||||
|
}
|
||||||
|
|
||||||
|
$isSimple = count($shapeRef) == 1;
|
||||||
|
if ($isSimple && isset($this->simple[$shape])) {
|
||||||
|
return $this->simple[$shape];
|
||||||
|
}
|
||||||
|
|
||||||
|
$definition = $shapeRef + $this->definitions[$shape];
|
||||||
|
$definition['name'] = $definition['shape'];
|
||||||
|
if (isset($definition['shape'])) {
|
||||||
|
unset($definition['shape']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = Shape::create($definition, $this);
|
||||||
|
|
||||||
|
if ($isSimple) {
|
||||||
|
$this->simple[$shape] = $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
}
|
79
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/StructureShape.php
vendored
Normal file
79
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/StructureShape.php
vendored
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a structure shape and resolve member shape references.
|
||||||
|
*/
|
||||||
|
class StructureShape extends Shape
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var Shape[]
|
||||||
|
*/
|
||||||
|
private $members;
|
||||||
|
|
||||||
|
public function __construct(array $definition, ShapeMap $shapeMap)
|
||||||
|
{
|
||||||
|
$definition['type'] = 'structure';
|
||||||
|
|
||||||
|
if (!isset($definition['members'])) {
|
||||||
|
$definition['members'] = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
parent::__construct($definition, $shapeMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a list of all members
|
||||||
|
*
|
||||||
|
* @return Shape[]
|
||||||
|
*/
|
||||||
|
public function getMembers()
|
||||||
|
{
|
||||||
|
if (empty($this->members)) {
|
||||||
|
$this->generateMembersHash();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->members;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a specific member exists by name.
|
||||||
|
*
|
||||||
|
* @param string $name Name of the member to check
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function hasMember($name)
|
||||||
|
{
|
||||||
|
return isset($this->definition['members'][$name]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve a member by name.
|
||||||
|
*
|
||||||
|
* @param string $name Name of the member to retrieve
|
||||||
|
*
|
||||||
|
* @return Shape
|
||||||
|
* @throws \InvalidArgumentException if the member is not found.
|
||||||
|
*/
|
||||||
|
public function getMember($name)
|
||||||
|
{
|
||||||
|
$members = $this->getMembers();
|
||||||
|
|
||||||
|
if (!isset($members[$name])) {
|
||||||
|
throw new \InvalidArgumentException('Unknown member ' . $name);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $members[$name];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private function generateMembersHash()
|
||||||
|
{
|
||||||
|
$this->members = [];
|
||||||
|
|
||||||
|
foreach ($this->definition['members'] as $name => $definition) {
|
||||||
|
$this->members[$name] = $this->shapeFor($definition);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
26
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/SupportedProtocols.php
vendored
Normal file
26
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/SupportedProtocols.php
vendored
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Aws\Api;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Priority ordered collection of supported AWS protocols.
|
||||||
|
*/
|
||||||
|
enum SupportedProtocols: string
|
||||||
|
{
|
||||||
|
case JSON = 'json';
|
||||||
|
case REST_JSON = 'rest-json';
|
||||||
|
case REST_XML = 'rest-xml';
|
||||||
|
case QUERY = 'query';
|
||||||
|
case EC2 = 'ec2';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a protocol is valid.
|
||||||
|
*
|
||||||
|
* @param string $protocol
|
||||||
|
* @return bool True if the protocol is supported, otherwise false.
|
||||||
|
*/
|
||||||
|
public static function isSupported(string $protocol): bool
|
||||||
|
{
|
||||||
|
return self::tryFrom($protocol) !== null;
|
||||||
|
}
|
||||||
|
}
|
48
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/TimestampShape.php
vendored
Normal file
48
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/TimestampShape.php
vendored
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a timestamp shape.
|
||||||
|
*/
|
||||||
|
class TimestampShape extends Shape
|
||||||
|
{
|
||||||
|
public function __construct(array $definition, ShapeMap $shapeMap)
|
||||||
|
{
|
||||||
|
$definition['type'] = 'timestamp';
|
||||||
|
parent::__construct($definition, $shapeMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Formats a timestamp value for a service.
|
||||||
|
*
|
||||||
|
* @param mixed $value Value to format
|
||||||
|
* @param string $format Format used to serialize the value
|
||||||
|
*
|
||||||
|
* @return int|string
|
||||||
|
* @throws \UnexpectedValueException if the format is unknown.
|
||||||
|
* @throws \InvalidArgumentException if the value is an unsupported type.
|
||||||
|
*/
|
||||||
|
public static function format($value, $format)
|
||||||
|
{
|
||||||
|
if ($value instanceof \DateTimeInterface) {
|
||||||
|
$value = $value->getTimestamp();
|
||||||
|
} elseif (is_string($value)) {
|
||||||
|
$value = strtotime($value);
|
||||||
|
} elseif (!is_int($value)) {
|
||||||
|
throw new \InvalidArgumentException('Unable to handle the provided'
|
||||||
|
. ' timestamp type: ' . gettype($value));
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ($format) {
|
||||||
|
case 'iso8601':
|
||||||
|
return gmdate('Y-m-d\TH:i:s\Z', $value);
|
||||||
|
case 'rfc822':
|
||||||
|
return gmdate('D, d M Y H:i:s \G\M\T', $value);
|
||||||
|
case 'unixTimestamp':
|
||||||
|
return $value;
|
||||||
|
default:
|
||||||
|
throw new \UnexpectedValueException('Unknown timestamp format: '
|
||||||
|
. $format);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
346
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Validator.php
vendored
Normal file
346
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Api/Validator.php
vendored
Normal file
|
@ -0,0 +1,346 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Api;
|
||||||
|
|
||||||
|
use Aws;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validates a schema against a hash of input.
|
||||||
|
*/
|
||||||
|
class Validator
|
||||||
|
{
|
||||||
|
private $path = [];
|
||||||
|
private $errors = [];
|
||||||
|
private $constraints = [];
|
||||||
|
|
||||||
|
private static $defaultConstraints = [
|
||||||
|
'required' => true,
|
||||||
|
'min' => true,
|
||||||
|
'max' => false,
|
||||||
|
'pattern' => false
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array $constraints Associative array of constraints to enforce.
|
||||||
|
* Accepts the following keys: "required", "min",
|
||||||
|
* "max", and "pattern". If a key is not
|
||||||
|
* provided, the constraint will assume false.
|
||||||
|
*/
|
||||||
|
public function __construct(?array $constraints = null)
|
||||||
|
{
|
||||||
|
static $assumedFalseValues = [
|
||||||
|
'required' => false,
|
||||||
|
'min' => false,
|
||||||
|
'max' => false,
|
||||||
|
'pattern' => false
|
||||||
|
];
|
||||||
|
$this->constraints = empty($constraints)
|
||||||
|
? self::$defaultConstraints
|
||||||
|
: $constraints + $assumedFalseValues;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validates the given input against the schema.
|
||||||
|
*
|
||||||
|
* @param string $name Operation name
|
||||||
|
* @param Shape $shape Shape to validate
|
||||||
|
* @param array $input Input to validate
|
||||||
|
*
|
||||||
|
* @throws \InvalidArgumentException if the input is invalid.
|
||||||
|
*/
|
||||||
|
public function validate($name, Shape $shape, array $input)
|
||||||
|
{
|
||||||
|
$this->dispatch($shape, $input);
|
||||||
|
|
||||||
|
if ($this->errors) {
|
||||||
|
$message = sprintf(
|
||||||
|
"Found %d error%s while validating the input provided for the "
|
||||||
|
. "%s operation:\n%s",
|
||||||
|
count($this->errors),
|
||||||
|
count($this->errors) > 1 ? 's' : '',
|
||||||
|
$name,
|
||||||
|
implode("\n", $this->errors)
|
||||||
|
);
|
||||||
|
$this->errors = [];
|
||||||
|
|
||||||
|
throw new \InvalidArgumentException($message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function dispatch(Shape $shape, $value)
|
||||||
|
{
|
||||||
|
static $methods = [
|
||||||
|
'structure' => 'check_structure',
|
||||||
|
'list' => 'check_list',
|
||||||
|
'map' => 'check_map',
|
||||||
|
'blob' => 'check_blob',
|
||||||
|
'boolean' => 'check_boolean',
|
||||||
|
'integer' => 'check_numeric',
|
||||||
|
'float' => 'check_numeric',
|
||||||
|
'long' => 'check_numeric',
|
||||||
|
'string' => 'check_string',
|
||||||
|
'byte' => 'check_string',
|
||||||
|
'char' => 'check_string'
|
||||||
|
];
|
||||||
|
|
||||||
|
$type = $shape->getType();
|
||||||
|
if (isset($methods[$type])) {
|
||||||
|
$this->{$methods[$type]}($shape, $value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function check_structure(StructureShape $shape, $value)
|
||||||
|
{
|
||||||
|
$isDocument = (isset($shape['document']) && $shape['document']);
|
||||||
|
$isUnion = (isset($shape['union']) && $shape['union']);
|
||||||
|
if ($isDocument) {
|
||||||
|
if (!$this->checkDocumentType($value)) {
|
||||||
|
$this->addError("is not a valid document type");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} elseif ($isUnion) {
|
||||||
|
if (!$this->checkUnion($value)) {
|
||||||
|
$this->addError("is a union type and must have exactly one non null value");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} elseif (!$this->checkAssociativeArray($value)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->constraints['required'] && $shape['required']) {
|
||||||
|
foreach ($shape['required'] as $req) {
|
||||||
|
if (!isset($value[$req])) {
|
||||||
|
$this->path[] = $req;
|
||||||
|
$this->addError('is missing and is a required parameter');
|
||||||
|
array_pop($this->path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!$isDocument) {
|
||||||
|
foreach ($value as $name => $v) {
|
||||||
|
if ($shape->hasMember($name)) {
|
||||||
|
$this->path[] = $name;
|
||||||
|
$this->dispatch(
|
||||||
|
$shape->getMember($name),
|
||||||
|
isset($value[$name]) ? $value[$name] : null
|
||||||
|
);
|
||||||
|
array_pop($this->path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function check_list(ListShape $shape, $value)
|
||||||
|
{
|
||||||
|
if (!is_array($value)) {
|
||||||
|
$this->addError('must be an array. Found '
|
||||||
|
. Aws\describe_type($value));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->validateRange($shape, count($value), "list element count");
|
||||||
|
|
||||||
|
$items = $shape->getMember();
|
||||||
|
foreach ($value as $index => $v) {
|
||||||
|
$this->path[] = $index;
|
||||||
|
$this->dispatch($items, $v);
|
||||||
|
array_pop($this->path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function check_map(MapShape $shape, $value)
|
||||||
|
{
|
||||||
|
if (!$this->checkAssociativeArray($value)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$values = $shape->getValue();
|
||||||
|
foreach ($value as $key => $v) {
|
||||||
|
$this->path[] = $key;
|
||||||
|
$this->dispatch($values, $v);
|
||||||
|
array_pop($this->path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function check_blob(Shape $shape, $value)
|
||||||
|
{
|
||||||
|
static $valid = [
|
||||||
|
'string' => true,
|
||||||
|
'integer' => true,
|
||||||
|
'double' => true,
|
||||||
|
'resource' => true
|
||||||
|
];
|
||||||
|
|
||||||
|
$type = gettype($value);
|
||||||
|
if (!isset($valid[$type])) {
|
||||||
|
if ($type != 'object' || !method_exists($value, '__toString')) {
|
||||||
|
$this->addError('must be an fopen resource, a '
|
||||||
|
. 'GuzzleHttp\Stream\StreamInterface object, or something '
|
||||||
|
. 'that can be cast to a string. Found '
|
||||||
|
. Aws\describe_type($value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function check_numeric(Shape $shape, $value)
|
||||||
|
{
|
||||||
|
if (!is_numeric($value)) {
|
||||||
|
$this->addError('must be numeric. Found '
|
||||||
|
. Aws\describe_type($value));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->validateRange($shape, $value, "numeric value");
|
||||||
|
}
|
||||||
|
|
||||||
|
private function check_boolean(Shape $shape, $value)
|
||||||
|
{
|
||||||
|
if (!is_bool($value)) {
|
||||||
|
$this->addError('must be a boolean. Found '
|
||||||
|
. Aws\describe_type($value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function check_string(Shape $shape, $value)
|
||||||
|
{
|
||||||
|
if ($shape['jsonvalue']) {
|
||||||
|
if (!self::canJsonEncode($value)) {
|
||||||
|
$this->addError('must be a value encodable with \'json_encode\'.'
|
||||||
|
. ' Found ' . Aws\describe_type($value));
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$this->checkCanString($value)) {
|
||||||
|
$this->addError('must be a string or an object that implements '
|
||||||
|
. '__toString(). Found ' . Aws\describe_type($value));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$value = isset($value) ? $value : '';
|
||||||
|
$this->validateRange($shape, strlen($value), "string length");
|
||||||
|
|
||||||
|
if ($this->constraints['pattern']) {
|
||||||
|
$pattern = $shape['pattern'];
|
||||||
|
if ($pattern && !preg_match("/$pattern/", $value)) {
|
||||||
|
$this->addError("Pattern /$pattern/ failed to match '$value'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function validateRange(Shape $shape, $length, $descriptor)
|
||||||
|
{
|
||||||
|
if ($this->constraints['min']) {
|
||||||
|
$min = $shape['min'];
|
||||||
|
if ($min && $length < $min) {
|
||||||
|
$this->addError("expected $descriptor to be >= $min, but "
|
||||||
|
. "found $descriptor of $length");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->constraints['max']) {
|
||||||
|
$max = $shape['max'];
|
||||||
|
if ($max && $length > $max) {
|
||||||
|
$this->addError("expected $descriptor to be <= $max, but "
|
||||||
|
. "found $descriptor of $length");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function checkArray($arr)
|
||||||
|
{
|
||||||
|
return $this->isIndexed($arr) || $this->isAssociative($arr);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function isAssociative($arr)
|
||||||
|
{
|
||||||
|
return count(array_filter(array_keys($arr), "is_string")) == count($arr);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function isIndexed(array $arr)
|
||||||
|
{
|
||||||
|
return $arr == array_values($arr);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function checkCanString($value)
|
||||||
|
{
|
||||||
|
static $valid = [
|
||||||
|
'string' => true,
|
||||||
|
'integer' => true,
|
||||||
|
'double' => true,
|
||||||
|
'NULL' => true,
|
||||||
|
];
|
||||||
|
|
||||||
|
$type = gettype($value);
|
||||||
|
|
||||||
|
return isset($valid[$type]) ||
|
||||||
|
($type == 'object' && method_exists($value, '__toString'));
|
||||||
|
}
|
||||||
|
|
||||||
|
private function checkAssociativeArray($value)
|
||||||
|
{
|
||||||
|
$isAssociative = false;
|
||||||
|
|
||||||
|
if (is_array($value)) {
|
||||||
|
$expectedIndex = 0;
|
||||||
|
$key = key($value);
|
||||||
|
|
||||||
|
do {
|
||||||
|
$isAssociative = $key !== $expectedIndex++;
|
||||||
|
next($value);
|
||||||
|
$key = key($value);
|
||||||
|
} while (!$isAssociative && null !== $key);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$isAssociative) {
|
||||||
|
$this->addError('must be an associative array. Found '
|
||||||
|
. Aws\describe_type($value));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function checkDocumentType($value)
|
||||||
|
{
|
||||||
|
if (is_array($value)) {
|
||||||
|
$typeOfFirstKey = gettype(key($value));
|
||||||
|
foreach ($value as $key => $val) {
|
||||||
|
if (!$this->checkDocumentType($val) || gettype($key) != $typeOfFirstKey) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->checkArray($value);
|
||||||
|
}
|
||||||
|
return is_null($value)
|
||||||
|
|| is_numeric($value)
|
||||||
|
|| is_string($value)
|
||||||
|
|| is_bool($value);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function checkUnion($value)
|
||||||
|
{
|
||||||
|
if (is_array($value)) {
|
||||||
|
$nonNullCount = 0;
|
||||||
|
foreach ($value as $key => $val) {
|
||||||
|
if (!is_null($val) && !(strpos($key, "@") === 0)) {
|
||||||
|
$nonNullCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $nonNullCount == 1;
|
||||||
|
}
|
||||||
|
return !is_null($value);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function addError($message)
|
||||||
|
{
|
||||||
|
$this->errors[] =
|
||||||
|
implode('', array_map(function ($s) { return "[{$s}]"; }, $this->path))
|
||||||
|
. ' '
|
||||||
|
. $message;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function canJsonEncode($data)
|
||||||
|
{
|
||||||
|
return !is_resource($data);
|
||||||
|
}
|
||||||
|
}
|
66
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/AccessPointArn.php
vendored
Normal file
66
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/AccessPointArn.php
vendored
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Arn;
|
||||||
|
|
||||||
|
use Aws\Arn\Exception\InvalidArnException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
class AccessPointArn extends Arn implements AccessPointArnInterface
|
||||||
|
{
|
||||||
|
use ResourceTypeAndIdTrait;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AccessPointArn constructor
|
||||||
|
*
|
||||||
|
* @param $data
|
||||||
|
*/
|
||||||
|
public function __construct($data)
|
||||||
|
{
|
||||||
|
parent::__construct($data);
|
||||||
|
static::validate($this->data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function parse($string)
|
||||||
|
{
|
||||||
|
$data = parent::parse($string);
|
||||||
|
$data = self::parseResourceTypeAndId($data);
|
||||||
|
$data['accesspoint_name'] = $data['resource_id'];
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAccesspointName()
|
||||||
|
{
|
||||||
|
return $this->data['accesspoint_name'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validation specific to AccessPointArn
|
||||||
|
*
|
||||||
|
* @param array $data
|
||||||
|
*/
|
||||||
|
protected static function validate(array $data)
|
||||||
|
{
|
||||||
|
self::validateRegion($data, 'access point ARN');
|
||||||
|
self::validateAccountId($data, 'access point ARN');
|
||||||
|
|
||||||
|
if ($data['resource_type'] !== 'accesspoint') {
|
||||||
|
throw new InvalidArnException("The 6th component of an access point ARN"
|
||||||
|
. " represents the resource type and must be 'accesspoint'.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($data['resource_id'])) {
|
||||||
|
throw new InvalidArnException("The 7th component of an access point ARN"
|
||||||
|
. " represents the resource ID and must not be empty.");
|
||||||
|
}
|
||||||
|
if (strpos($data['resource_id'], ':') !== false) {
|
||||||
|
throw new InvalidArnException("The resource ID component of an access"
|
||||||
|
. " point ARN must not contain additional components"
|
||||||
|
. " (delimited by ':').");
|
||||||
|
}
|
||||||
|
if (!self::isValidHostLabel($data['resource_id'])) {
|
||||||
|
throw new InvalidArnException("The resource ID in an access point ARN"
|
||||||
|
. " must be a valid host label value.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
10
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/AccessPointArnInterface.php
vendored
Normal file
10
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/AccessPointArnInterface.php
vendored
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Arn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
interface AccessPointArnInterface extends ArnInterface
|
||||||
|
{
|
||||||
|
public function getAccesspointName();
|
||||||
|
}
|
188
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/Arn.php
vendored
Normal file
188
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/Arn.php
vendored
Normal file
|
@ -0,0 +1,188 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Arn;
|
||||||
|
|
||||||
|
use Aws\Arn\Exception\InvalidArnException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Amazon Resource Names (ARNs) uniquely identify AWS resources. The Arn class
|
||||||
|
* parses and stores a generic ARN object representation that can apply to any
|
||||||
|
* service resource.
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
class Arn implements ArnInterface
|
||||||
|
{
|
||||||
|
protected $data;
|
||||||
|
protected $string;
|
||||||
|
|
||||||
|
public static function parse($string)
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'arn' => null,
|
||||||
|
'partition' => null,
|
||||||
|
'service' => null,
|
||||||
|
'region' => null,
|
||||||
|
'account_id' => null,
|
||||||
|
'resource' => null,
|
||||||
|
];
|
||||||
|
|
||||||
|
$length = strlen($string);
|
||||||
|
$lastDelim = 0;
|
||||||
|
$numComponents = 0;
|
||||||
|
for ($i = 0; $i < $length; $i++) {
|
||||||
|
|
||||||
|
if (($numComponents < 5 && $string[$i] === ':')) {
|
||||||
|
// Split components between delimiters
|
||||||
|
$data[key($data)] = substr($string, $lastDelim, $i - $lastDelim);
|
||||||
|
|
||||||
|
// Do not include delimiter character itself
|
||||||
|
$lastDelim = $i + 1;
|
||||||
|
next($data);
|
||||||
|
$numComponents++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($i === $length - 1) {
|
||||||
|
// Put the remainder in the last component.
|
||||||
|
if (in_array($numComponents, [5])) {
|
||||||
|
$data['resource'] = substr($string, $lastDelim);
|
||||||
|
} else {
|
||||||
|
// If there are < 5 components, put remainder in current
|
||||||
|
// component.
|
||||||
|
$data[key($data)] = substr($string, $lastDelim);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __construct($data)
|
||||||
|
{
|
||||||
|
if (is_array($data)) {
|
||||||
|
$this->data = $data;
|
||||||
|
} elseif (is_string($data)) {
|
||||||
|
$this->data = static::parse($data);
|
||||||
|
} else {
|
||||||
|
throw new InvalidArnException('Constructor accepts a string or an'
|
||||||
|
. ' array as an argument.');
|
||||||
|
}
|
||||||
|
|
||||||
|
static::validate($this->data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __toString()
|
||||||
|
{
|
||||||
|
if (!isset($this->string)) {
|
||||||
|
$components = [
|
||||||
|
$this->getPrefix(),
|
||||||
|
$this->getPartition(),
|
||||||
|
$this->getService(),
|
||||||
|
$this->getRegion(),
|
||||||
|
$this->getAccountId(),
|
||||||
|
$this->getResource(),
|
||||||
|
];
|
||||||
|
|
||||||
|
$this->string = implode(':', $components);
|
||||||
|
}
|
||||||
|
return $this->string;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getPrefix()
|
||||||
|
{
|
||||||
|
return $this->data['arn'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getPartition()
|
||||||
|
{
|
||||||
|
return $this->data['partition'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getService()
|
||||||
|
{
|
||||||
|
return $this->data['service'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRegion()
|
||||||
|
{
|
||||||
|
return $this->data['region'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAccountId()
|
||||||
|
{
|
||||||
|
return $this->data['account_id'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getResource()
|
||||||
|
{
|
||||||
|
return $this->data['resource'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function toArray()
|
||||||
|
{
|
||||||
|
return $this->data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Minimally restrictive generic ARN validation
|
||||||
|
*
|
||||||
|
* @param array $data
|
||||||
|
*/
|
||||||
|
protected static function validate(array $data)
|
||||||
|
{
|
||||||
|
if ($data['arn'] !== 'arn') {
|
||||||
|
throw new InvalidArnException("The 1st component of an ARN must be"
|
||||||
|
. " 'arn'.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($data['partition'])) {
|
||||||
|
throw new InvalidArnException("The 2nd component of an ARN"
|
||||||
|
. " represents the partition and must not be empty.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($data['service'])) {
|
||||||
|
throw new InvalidArnException("The 3rd component of an ARN"
|
||||||
|
. " represents the service and must not be empty.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($data['resource'])) {
|
||||||
|
throw new InvalidArnException("The 6th component of an ARN"
|
||||||
|
. " represents the resource information and must not be empty."
|
||||||
|
. " Individual service ARNs may include additional delimiters"
|
||||||
|
. " to further qualify resources.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static function validateAccountId($data, $arnName)
|
||||||
|
{
|
||||||
|
if (!self::isValidHostLabel($data['account_id'])) {
|
||||||
|
throw new InvalidArnException("The 5th component of a {$arnName}"
|
||||||
|
. " is required, represents the account ID, and"
|
||||||
|
. " must be a valid host label.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static function validateRegion($data, $arnName)
|
||||||
|
{
|
||||||
|
if (empty($data['region'])) {
|
||||||
|
throw new InvalidArnException("The 4th component of a {$arnName}"
|
||||||
|
. " represents the region and must not be empty.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validates whether a string component is a valid host label
|
||||||
|
*
|
||||||
|
* @param $string
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
protected static function isValidHostLabel($string)
|
||||||
|
{
|
||||||
|
if (empty($string) || strlen($string) > 63) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if ($value = preg_match("/^[a-zA-Z0-9-]+$/", $string)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
37
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/ArnInterface.php
vendored
Normal file
37
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/ArnInterface.php
vendored
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Arn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Amazon Resource Names (ARNs) uniquely identify AWS resources. Classes
|
||||||
|
* implementing ArnInterface parse and store an ARN object representation.
|
||||||
|
*
|
||||||
|
* Valid ARN formats include:
|
||||||
|
*
|
||||||
|
* arn:partition:service:region:account-id:resource-id
|
||||||
|
* arn:partition:service:region:account-id:resource-type/resource-id
|
||||||
|
* arn:partition:service:region:account-id:resource-type:resource-id
|
||||||
|
*
|
||||||
|
* Some components may be omitted, depending on the service and resource type.
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
interface ArnInterface
|
||||||
|
{
|
||||||
|
public static function parse($string);
|
||||||
|
|
||||||
|
public function __toString();
|
||||||
|
|
||||||
|
public function getPrefix();
|
||||||
|
|
||||||
|
public function getPartition();
|
||||||
|
|
||||||
|
public function getService();
|
||||||
|
|
||||||
|
public function getRegion();
|
||||||
|
|
||||||
|
public function getAccountId();
|
||||||
|
|
||||||
|
public function getResource();
|
||||||
|
|
||||||
|
public function toArray();
|
||||||
|
}
|
69
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/ArnParser.php
vendored
Normal file
69
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/ArnParser.php
vendored
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Arn;
|
||||||
|
|
||||||
|
use Aws\Arn\S3\AccessPointArn as S3AccessPointArn;
|
||||||
|
use Aws\Arn\ObjectLambdaAccessPointArn;
|
||||||
|
use Aws\Arn\S3\MultiRegionAccessPointArn;
|
||||||
|
use Aws\Arn\S3\OutpostsBucketArn;
|
||||||
|
use Aws\Arn\S3\RegionalBucketArn;
|
||||||
|
use Aws\Arn\S3\OutpostsAccessPointArn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class provides functionality to parse ARN strings and return a
|
||||||
|
* corresponding ARN object. ARN-parsing logic may be subject to change in the
|
||||||
|
* future, so this should not be relied upon for external customer usage.
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
class ArnParser
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param $string
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function isArn($string)
|
||||||
|
{
|
||||||
|
return $string !== null && strpos($string, 'arn:') === 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses a string and returns an instance of ArnInterface. Returns a
|
||||||
|
* specific type of Arn object if it has a specific class representation
|
||||||
|
* or a generic Arn object if not.
|
||||||
|
*
|
||||||
|
* @param $string
|
||||||
|
* @return ArnInterface
|
||||||
|
*/
|
||||||
|
public static function parse($string)
|
||||||
|
{
|
||||||
|
$data = Arn::parse($string);
|
||||||
|
if ($data['service'] === 's3-object-lambda') {
|
||||||
|
return new ObjectLambdaAccessPointArn($string);
|
||||||
|
}
|
||||||
|
$resource = self::explodeResourceComponent($data['resource']);
|
||||||
|
if ($resource[0] === 'outpost') {
|
||||||
|
if (isset($resource[2]) && $resource[2] === 'bucket') {
|
||||||
|
return new OutpostsBucketArn($string);
|
||||||
|
}
|
||||||
|
if (isset($resource[2]) && $resource[2] === 'accesspoint') {
|
||||||
|
return new OutpostsAccessPointArn($string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (empty($data['region'])) {
|
||||||
|
return new MultiRegionAccessPointArn($string);
|
||||||
|
}
|
||||||
|
if ($resource[0] === 'accesspoint') {
|
||||||
|
if ($data['service'] === 's3') {
|
||||||
|
return new S3AccessPointArn($string);
|
||||||
|
}
|
||||||
|
return new AccessPointArn($string);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Arn($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function explodeResourceComponent($resource)
|
||||||
|
{
|
||||||
|
return preg_split("/[\/:]/", $resource);
|
||||||
|
}
|
||||||
|
}
|
7
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/Exception/InvalidArnException.php
vendored
Normal file
7
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/Exception/InvalidArnException.php
vendored
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Arn\Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a failed attempt to construct an Arn
|
||||||
|
*/
|
||||||
|
class InvalidArnException extends \RuntimeException {}
|
35
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/ObjectLambdaAccessPointArn.php
vendored
Normal file
35
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/ObjectLambdaAccessPointArn.php
vendored
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Arn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class represents an S3 Object bucket ARN, which is in the
|
||||||
|
* following format:
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
class ObjectLambdaAccessPointArn extends AccessPointArn
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Parses a string into an associative array of components that represent
|
||||||
|
* a ObjectLambdaAccessPointArn
|
||||||
|
*
|
||||||
|
* @param $string
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public static function parse($string)
|
||||||
|
{
|
||||||
|
$data = parent::parse($string);
|
||||||
|
return parent::parseResourceTypeAndId($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param array $data
|
||||||
|
*/
|
||||||
|
protected static function validate(array $data)
|
||||||
|
{
|
||||||
|
parent::validate($data);
|
||||||
|
self::validateRegion($data, 'S3 Object Lambda ARN');
|
||||||
|
self::validateAccountId($data, 'S3 Object Lambda ARN');
|
||||||
|
}
|
||||||
|
}
|
30
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/ResourceTypeAndIdTrait.php
vendored
Normal file
30
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/ResourceTypeAndIdTrait.php
vendored
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Arn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
trait ResourceTypeAndIdTrait
|
||||||
|
{
|
||||||
|
public function getResourceType()
|
||||||
|
{
|
||||||
|
return $this->data['resource_type'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getResourceId()
|
||||||
|
{
|
||||||
|
return $this->data['resource_id'];
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static function parseResourceTypeAndId(array $data)
|
||||||
|
{
|
||||||
|
$resourceData = preg_split("/[\/:]/", $data['resource'], 2);
|
||||||
|
$data['resource_type'] = isset($resourceData[0])
|
||||||
|
? $resourceData[0]
|
||||||
|
: null;
|
||||||
|
$data['resource_id'] = isset($resourceData[1])
|
||||||
|
? $resourceData[1]
|
||||||
|
: null;
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
}
|
27
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/S3/AccessPointArn.php
vendored
Normal file
27
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/S3/AccessPointArn.php
vendored
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Arn\S3;
|
||||||
|
|
||||||
|
use Aws\Arn\AccessPointArn as BaseAccessPointArn;
|
||||||
|
use Aws\Arn\AccessPointArnInterface;
|
||||||
|
use Aws\Arn\ArnInterface;
|
||||||
|
use Aws\Arn\Exception\InvalidArnException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
class AccessPointArn extends BaseAccessPointArn implements AccessPointArnInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Validation specific to AccessPointArn
|
||||||
|
*
|
||||||
|
* @param array $data
|
||||||
|
*/
|
||||||
|
public static function validate(array $data)
|
||||||
|
{
|
||||||
|
parent::validate($data);
|
||||||
|
if ($data['service'] !== 's3') {
|
||||||
|
throw new InvalidArnException("The 3rd component of an S3 access"
|
||||||
|
. " point ARN represents the region and must be 's3'.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
12
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/S3/BucketArnInterface.php
vendored
Normal file
12
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/S3/BucketArnInterface.php
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Arn\S3;
|
||||||
|
|
||||||
|
use Aws\Arn\ArnInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
interface BucketArnInterface extends ArnInterface
|
||||||
|
{
|
||||||
|
public function getBucketName();
|
||||||
|
}
|
38
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/S3/MultiRegionAccessPointArn.php
vendored
Normal file
38
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/S3/MultiRegionAccessPointArn.php
vendored
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Arn\S3;
|
||||||
|
|
||||||
|
use Aws\Arn\Arn;
|
||||||
|
use Aws\Arn\ResourceTypeAndIdTrait;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class represents an S3 multi-region bucket ARN, which is in the
|
||||||
|
* following format:
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
class MultiRegionAccessPointArn extends AccessPointArn
|
||||||
|
{
|
||||||
|
use ResourceTypeAndIdTrait;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses a string into an associative array of components that represent
|
||||||
|
* a MultiRegionArn
|
||||||
|
*
|
||||||
|
* @param $string
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public static function parse($string)
|
||||||
|
{
|
||||||
|
return parent::parse($string);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param array $data
|
||||||
|
*/
|
||||||
|
public static function validate(array $data)
|
||||||
|
{
|
||||||
|
Arn::validate($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
110
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/S3/OutpostsAccessPointArn.php
vendored
Normal file
110
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/S3/OutpostsAccessPointArn.php
vendored
Normal file
|
@ -0,0 +1,110 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Arn\S3;
|
||||||
|
|
||||||
|
use Aws\Arn\AccessPointArn as BaseAccessPointArn;
|
||||||
|
use Aws\Arn\AccessPointArnInterface;
|
||||||
|
use Aws\Arn\Arn;
|
||||||
|
use Aws\Arn\Exception\InvalidArnException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class represents an S3 Outposts access point ARN, which is in the
|
||||||
|
* following format:
|
||||||
|
*
|
||||||
|
* arn:{partition}:s3-outposts:{region}:{accountId}:outpost:{outpostId}:accesspoint:{accesspointName}
|
||||||
|
*
|
||||||
|
* ':' and '/' can be used interchangeably as delimiters for components after
|
||||||
|
* the account ID.
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
class OutpostsAccessPointArn extends BaseAccessPointArn implements
|
||||||
|
AccessPointArnInterface,
|
||||||
|
OutpostsArnInterface
|
||||||
|
{
|
||||||
|
public static function parse($string)
|
||||||
|
{
|
||||||
|
$data = parent::parse($string);
|
||||||
|
return self::parseOutpostData($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getOutpostId()
|
||||||
|
{
|
||||||
|
return $this->data['outpost_id'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAccesspointName()
|
||||||
|
{
|
||||||
|
return $this->data['accesspoint_name'];
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function parseOutpostData(array $data)
|
||||||
|
{
|
||||||
|
$resourceData = preg_split("/[\/:]/", $data['resource_id']);
|
||||||
|
|
||||||
|
$data['outpost_id'] = isset($resourceData[0])
|
||||||
|
? $resourceData[0]
|
||||||
|
: null;
|
||||||
|
$data['accesspoint_type'] = isset($resourceData[1])
|
||||||
|
? $resourceData[1]
|
||||||
|
: null;
|
||||||
|
$data['accesspoint_name'] = isset($resourceData[2])
|
||||||
|
? $resourceData[2]
|
||||||
|
: null;
|
||||||
|
if (isset($resourceData[3])) {
|
||||||
|
$data['resource_extra'] = implode(':', array_slice($resourceData, 3));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validation specific to OutpostsAccessPointArn. Note this uses the base Arn
|
||||||
|
* class validation instead of the direct parent due to it having slightly
|
||||||
|
* differing requirements from its parent.
|
||||||
|
*
|
||||||
|
* @param array $data
|
||||||
|
*/
|
||||||
|
public static function validate(array $data)
|
||||||
|
{
|
||||||
|
Arn::validate($data);
|
||||||
|
|
||||||
|
if (($data['service'] !== 's3-outposts')) {
|
||||||
|
throw new InvalidArnException("The 3rd component of an S3 Outposts"
|
||||||
|
. " access point ARN represents the service and must be"
|
||||||
|
. " 's3-outposts'.");
|
||||||
|
}
|
||||||
|
|
||||||
|
self::validateRegion($data, 'S3 Outposts access point ARN');
|
||||||
|
self::validateAccountId($data, 'S3 Outposts access point ARN');
|
||||||
|
|
||||||
|
if (($data['resource_type'] !== 'outpost')) {
|
||||||
|
throw new InvalidArnException("The 6th component of an S3 Outposts"
|
||||||
|
. " access point ARN represents the resource type and must be"
|
||||||
|
. " 'outpost'.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!self::isValidHostLabel($data['outpost_id'])) {
|
||||||
|
throw new InvalidArnException("The 7th component of an S3 Outposts"
|
||||||
|
. " access point ARN is required, represents the outpost ID, and"
|
||||||
|
. " must be a valid host label.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($data['accesspoint_type'] !== 'accesspoint') {
|
||||||
|
throw new InvalidArnException("The 8th component of an S3 Outposts"
|
||||||
|
. " access point ARN must be 'accesspoint'");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!self::isValidHostLabel($data['accesspoint_name'])) {
|
||||||
|
throw new InvalidArnException("The 9th component of an S3 Outposts"
|
||||||
|
. " access point ARN is required, represents the accesspoint name,"
|
||||||
|
. " and must be a valid host label.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['resource_extra'])) {
|
||||||
|
throw new InvalidArnException("An S3 Outposts access point ARN"
|
||||||
|
. " should only have 9 components, delimited by the characters"
|
||||||
|
. " ':' and '/'. '{$data['resource_extra']}' was found after the"
|
||||||
|
. " 9th component.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
12
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/S3/OutpostsArnInterface.php
vendored
Normal file
12
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/S3/OutpostsArnInterface.php
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Arn\S3;
|
||||||
|
|
||||||
|
use Aws\Arn\ArnInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
interface OutpostsArnInterface extends ArnInterface
|
||||||
|
{
|
||||||
|
public function getOutpostId();
|
||||||
|
}
|
99
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/S3/OutpostsBucketArn.php
vendored
Normal file
99
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Arn/S3/OutpostsBucketArn.php
vendored
Normal file
|
@ -0,0 +1,99 @@
|
||||||
|
<?php
|
||||||
|
namespace Aws\Arn\S3;
|
||||||
|
|
||||||
|
use Aws\Arn\Arn;
|
||||||
|
use Aws\Arn\Exception\InvalidArnException;
|
||||||
|
use Aws\Arn\ResourceTypeAndIdTrait;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class represents an S3 Outposts bucket ARN, which is in the
|
||||||
|
* following format:
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
class OutpostsBucketArn extends Arn implements
|
||||||
|
BucketArnInterface,
|
||||||
|
OutpostsArnInterface
|
||||||
|
{
|
||||||
|
use ResourceTypeAndIdTrait;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses a string into an associative array of components that represent
|
||||||
|
* a OutpostsBucketArn
|
||||||
|
*
|
||||||
|
* @param $string
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public static function parse($string)
|
||||||
|
{
|
||||||
|
$data = parent::parse($string);
|
||||||
|
$data = self::parseResourceTypeAndId($data);
|
||||||
|
return self::parseOutpostData($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBucketName()
|
||||||
|
{
|
||||||
|
return $this->data['bucket_name'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getOutpostId()
|
||||||
|
{
|
||||||
|
return $this->data['outpost_id'];
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function parseOutpostData(array $data)
|
||||||
|
{
|
||||||
|
$resourceData = preg_split("/[\/:]/", $data['resource_id'], 3);
|
||||||
|
|
||||||
|
$data['outpost_id'] = isset($resourceData[0])
|
||||||
|
? $resourceData[0]
|
||||||
|
: null;
|
||||||
|
$data['bucket_label'] = isset($resourceData[1])
|
||||||
|
? $resourceData[1]
|
||||||
|
: null;
|
||||||
|
$data['bucket_name'] = isset($resourceData[2])
|
||||||
|
? $resourceData[2]
|
||||||
|
: null;
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param array $data
|
||||||
|
*/
|
||||||
|
public static function validate(array $data)
|
||||||
|
{
|
||||||
|
Arn::validate($data);
|
||||||
|
|
||||||
|
if (($data['service'] !== 's3-outposts')) {
|
||||||
|
throw new InvalidArnException("The 3rd component of an S3 Outposts"
|
||||||
|
. " bucket ARN represents the service and must be 's3-outposts'.");
|
||||||
|
}
|
||||||
|
|
||||||
|
self::validateRegion($data, 'S3 Outposts bucket ARN');
|
||||||
|
self::validateAccountId($data, 'S3 Outposts bucket ARN');
|
||||||
|
|
||||||
|
if (($data['resource_type'] !== 'outpost')) {
|
||||||
|
throw new InvalidArnException("The 6th component of an S3 Outposts"
|
||||||
|
. " bucket ARN represents the resource type and must be"
|
||||||
|
. " 'outpost'.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!self::isValidHostLabel($data['outpost_id'])) {
|
||||||
|
throw new InvalidArnException("The 7th component of an S3 Outposts"
|
||||||
|
. " bucket ARN is required, represents the outpost ID, and"
|
||||||
|
. " must be a valid host label.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($data['bucket_label'] !== 'bucket') {
|
||||||
|
throw new InvalidArnException("The 8th component of an S3 Outposts"
|
||||||
|
. " bucket ARN must be 'bucket'");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($data['bucket_name'])) {
|
||||||
|
throw new InvalidArnException("The 9th component of an S3 Outposts"
|
||||||
|
. " bucket ARN represents the bucket name and must not be empty.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
181
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Auth/AuthSchemeResolver.php
vendored
Normal file
181
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Auth/AuthSchemeResolver.php
vendored
Normal file
|
@ -0,0 +1,181 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Aws\Auth;
|
||||||
|
|
||||||
|
use Aws\Auth\Exception\UnresolvedAuthSchemeException;
|
||||||
|
use Aws\Exception\CredentialsException;
|
||||||
|
use Aws\Exception\TokenException;
|
||||||
|
use Aws\Identity\AwsCredentialIdentity;
|
||||||
|
use Aws\Identity\BearerTokenIdentity;
|
||||||
|
use GuzzleHttp\Promise\PromiseInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Houses logic for selecting an auth scheme modeled in a service's `auth` trait.
|
||||||
|
* The `auth` trait can be modeled either in a service's metadata, or at the operation level.
|
||||||
|
*/
|
||||||
|
class AuthSchemeResolver implements AuthSchemeResolverInterface
|
||||||
|
{
|
||||||
|
const UNSIGNED_BODY = '-unsigned-body';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string[] Default mapping of modeled auth trait auth schemes
|
||||||
|
* to the SDK's supported signature versions.
|
||||||
|
*/
|
||||||
|
private static $defaultAuthSchemeMap = [
|
||||||
|
'aws.auth#sigv4' => 'v4',
|
||||||
|
'aws.auth#sigv4a' => 'v4a',
|
||||||
|
'smithy.api#httpBearerAuth' => 'bearer',
|
||||||
|
'smithy.api#noAuth' => 'anonymous'
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array Mapping of auth schemes to signature versions used in
|
||||||
|
* resolving a signature version.
|
||||||
|
*/
|
||||||
|
private $authSchemeMap;
|
||||||
|
private $tokenProvider;
|
||||||
|
private $credentialProvider;
|
||||||
|
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
callable $credentialProvider,
|
||||||
|
?callable $tokenProvider = null,
|
||||||
|
array $authSchemeMap = []
|
||||||
|
){
|
||||||
|
$this->credentialProvider = $credentialProvider;
|
||||||
|
$this->tokenProvider = $tokenProvider;
|
||||||
|
$this->authSchemeMap = empty($authSchemeMap)
|
||||||
|
? self::$defaultAuthSchemeMap
|
||||||
|
: $authSchemeMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Accepts a priority-ordered list of auth schemes and an Identity
|
||||||
|
* and selects the first compatible auth schemes, returning a normalized
|
||||||
|
* signature version. For example, based on the default auth scheme mapping,
|
||||||
|
* if `aws.auth#sigv4` is selected, `v4` will be returned.
|
||||||
|
*
|
||||||
|
* @param array $authSchemes
|
||||||
|
* @param $identity
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
* @throws UnresolvedAuthSchemeException
|
||||||
|
*/
|
||||||
|
public function selectAuthScheme(
|
||||||
|
array $authSchemes,
|
||||||
|
array $args = []
|
||||||
|
): string
|
||||||
|
{
|
||||||
|
$failureReasons = [];
|
||||||
|
|
||||||
|
foreach($authSchemes as $authScheme) {
|
||||||
|
$normalizedAuthScheme = $this->authSchemeMap[$authScheme] ?? $authScheme;
|
||||||
|
|
||||||
|
if ($this->isCompatibleAuthScheme($normalizedAuthScheme)) {
|
||||||
|
if ($normalizedAuthScheme === 'v4' && !empty($args['unsigned_payload'])) {
|
||||||
|
return $normalizedAuthScheme . self::UNSIGNED_BODY;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $normalizedAuthScheme;
|
||||||
|
} else {
|
||||||
|
$failureReasons[] = $this->getIncompatibilityMessage($normalizedAuthScheme);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new UnresolvedAuthSchemeException(
|
||||||
|
'Could not resolve an authentication scheme: '
|
||||||
|
. implode('; ', $failureReasons)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines compatibility based on either Identity or the availability
|
||||||
|
* of the CRT extension.
|
||||||
|
*
|
||||||
|
* @param $authScheme
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
private function isCompatibleAuthScheme($authScheme): bool
|
||||||
|
{
|
||||||
|
switch ($authScheme) {
|
||||||
|
case 'v4':
|
||||||
|
case 'anonymous':
|
||||||
|
return $this->hasAwsCredentialIdentity();
|
||||||
|
case 'v4a':
|
||||||
|
return extension_loaded('awscrt') && $this->hasAwsCredentialIdentity();
|
||||||
|
case 'bearer':
|
||||||
|
return $this->hasBearerTokenIdentity();
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides incompatibility messages in the event an incompatible auth scheme
|
||||||
|
* is encountered.
|
||||||
|
*
|
||||||
|
* @param $authScheme
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
private function getIncompatibilityMessage($authScheme): string
|
||||||
|
{
|
||||||
|
switch ($authScheme) {
|
||||||
|
case 'v4':
|
||||||
|
return 'Signature V4 requires AWS credentials for request signing';
|
||||||
|
case 'anonymous':
|
||||||
|
return 'Anonymous signatures require AWS credentials for request signing';
|
||||||
|
case 'v4a':
|
||||||
|
return 'The aws-crt-php extension and AWS credentials are required to use Signature V4A';
|
||||||
|
case 'bearer':
|
||||||
|
return 'Bearer token credentials must be provided to use Bearer authentication';
|
||||||
|
default:
|
||||||
|
return "The service does not support `{$authScheme}` authentication.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
private function hasAwsCredentialIdentity(): bool
|
||||||
|
{
|
||||||
|
$fn = $this->credentialProvider;
|
||||||
|
$result = $fn();
|
||||||
|
|
||||||
|
if ($result instanceof PromiseInterface) {
|
||||||
|
try {
|
||||||
|
$resolved = $result->wait();
|
||||||
|
return $resolved instanceof AwsCredentialIdentity;
|
||||||
|
} catch (CredentialsException $e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result instanceof AwsCredentialIdentity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
private function hasBearerTokenIdentity(): bool
|
||||||
|
{
|
||||||
|
if ($this->tokenProvider) {
|
||||||
|
$fn = $this->tokenProvider;
|
||||||
|
$result = $fn();
|
||||||
|
|
||||||
|
if ($result instanceof PromiseInterface) {
|
||||||
|
try {
|
||||||
|
$resolved = $result->wait();
|
||||||
|
return $resolved instanceof BearerTokenIdentity;
|
||||||
|
} catch (TokenException $e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result instanceof BearerTokenIdentity;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
24
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Auth/AuthSchemeResolverInterface.php
vendored
Normal file
24
lam/lib/3rdParty/composer/aws/aws-sdk-php/src/Auth/AuthSchemeResolverInterface.php
vendored
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Aws\Auth;
|
||||||
|
|
||||||
|
use Aws\Identity\IdentityInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An AuthSchemeResolver object determines which auth scheme will be used for request signing.
|
||||||
|
*/
|
||||||
|
interface AuthSchemeResolverInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Selects an auth scheme for request signing.
|
||||||
|
*
|
||||||
|
* @param array $authSchemes a priority-ordered list of authentication schemes.
|
||||||
|
* @param IdentityInterface $identity Credentials to be used in request signing.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function selectAuthScheme(
|
||||||
|
array $authSchemes,
|
||||||
|
array $args
|
||||||
|
): ?string;
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue