mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
Added vendor directory to source control
This commit is contained in:
parent
16534d4217
commit
d2589e176f
3049 changed files with 249997 additions and 395005 deletions
14
vendor/abraham/twitteroauth/.github/dependabot.yml
vendored
Normal file
14
vendor/abraham/twitteroauth/.github/dependabot.yml
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: npm
|
||||
directory: '/'
|
||||
schedule:
|
||||
interval: daily
|
||||
time: '11:00'
|
||||
open-pull-requests-limit: 10
|
||||
- package-ecosystem: composer
|
||||
directory: '/'
|
||||
schedule:
|
||||
interval: daily
|
||||
time: '11:00'
|
||||
open-pull-requests-limit: 10
|
12
vendor/abraham/twitteroauth/.github/workflows/lint.yaml
vendored
Normal file
12
vendor/abraham/twitteroauth/.github/workflows/lint.yaml
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
name: Lint
|
||||
on: push
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12
|
||||
- run: npm ci
|
||||
- run: npm run lint
|
18
vendor/abraham/twitteroauth/.github/workflows/test.yaml
vendored
Normal file
18
vendor/abraham/twitteroauth/.github/workflows/test.yaml
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
name: Test
|
||||
on: push
|
||||
jobs:
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-versions: ['7.2', '7.3', '7.4']
|
||||
name: PHP ${{ matrix.php-versions }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
- run: composer validate --no-interaction --strict
|
||||
- run: composer install --no-interaction --prefer-dist
|
||||
- run: npm test
|
5
vendor/abraham/twitteroauth/.gitignore
vendored
Normal file
5
vendor/abraham/twitteroauth/.gitignore
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
.DS_Store
|
||||
vendor
|
||||
env
|
||||
*.cache
|
||||
node_modules
|
6
vendor/abraham/twitteroauth/.prettierignore
vendored
6
vendor/abraham/twitteroauth/.prettierignore
vendored
|
@ -1,3 +1,3 @@
|
|||
vendor
|
||||
composer.lock
|
||||
tests/fixtures
|
||||
vendor
|
||||
composer.lock
|
||||
tests/fixtures
|
||||
|
|
12
vendor/abraham/twitteroauth/.prettierrc.json
vendored
12
vendor/abraham/twitteroauth/.prettierrc.json
vendored
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"singleQuote": true,
|
||||
"phpVersion": "7.2",
|
||||
"trailingCommaPHP": true,
|
||||
"braceStyle": "psr-2"
|
||||
}
|
||||
{
|
||||
"singleQuote": true,
|
||||
"phpVersion": "7.2",
|
||||
"trailingCommaPHP": true,
|
||||
"braceStyle": "psr-2"
|
||||
}
|
||||
|
|
92
vendor/abraham/twitteroauth/CODE_OF_CONDUCT.md
vendored
92
vendor/abraham/twitteroauth/CODE_OF_CONDUCT.md
vendored
|
@ -1,46 +1,46 @@
|
|||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment include:
|
||||
|
||||
- Using welcoming and inclusive language
|
||||
- Being respectful of differing viewpoints and experiences
|
||||
- Gracefully accepting constructive criticism
|
||||
- Focusing on what is best for the community
|
||||
- Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
- The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||
- Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
- Public or private harassment
|
||||
- Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||
- Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at abraham@abrah.am. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment include:
|
||||
|
||||
- Using welcoming and inclusive language
|
||||
- Being respectful of differing viewpoints and experiences
|
||||
- Gracefully accepting constructive criticism
|
||||
- Focusing on what is best for the community
|
||||
- Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
- The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||
- Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
- Public or private harassment
|
||||
- Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||
- Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at abraham@abrah.am. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
|
|
42
vendor/abraham/twitteroauth/CONTRIBUTING.md
vendored
42
vendor/abraham/twitteroauth/CONTRIBUTING.md
vendored
|
@ -1,21 +1,21 @@
|
|||
# Contributing to TwitterOAuth
|
||||
|
||||
## 👏 Thanks!
|
||||
|
||||
Thanks for your interest in contributing to TwitterOAuth. We appreciate contributions small and large.
|
||||
|
||||
## 🌱 Grow
|
||||
|
||||
If you have an idea for something new or would like to improve something. Please [open a quick issue](https://github.com/abraham/twitteroauth/issues/new) explaining the changes and the reasons for them. Everyone's time is important and we don't want you duplicating work someone else might already be working on.
|
||||
|
||||
GitHub has [outlined instructions](https://help.github.com/articles/fork-a-repo/) for forking a repo. To work on an update to this repo, you will:
|
||||
|
||||
- Fork the repo
|
||||
- Make the changes
|
||||
- Submit a pull request
|
||||
|
||||
Once the [pull request](https://help.github.com/articles/about-pull-requests/) is reviewed, if the changes are approved they will be merged in to the project.
|
||||
|
||||
## 🐛 Bugs
|
||||
|
||||
Please [open a new issue](https://github.com/abraham/twitteroauth/issues/new) and details what you are trying to do, what is happening, and what you expect to happen. Err on the side of providing more details.
|
||||
# Contributing to TwitterOAuth
|
||||
|
||||
## 👏 Thanks!
|
||||
|
||||
Thanks for your interest in contributing to TwitterOAuth. We appreciate contributions small and large.
|
||||
|
||||
## 🌱 Grow
|
||||
|
||||
If you have an idea for something new or would like to improve something. Please [open a quick issue](https://github.com/abraham/twitteroauth/issues/new) explaining the changes and the reasons for them. Everyone's time is important and we don't want you duplicating work someone else might already be working on.
|
||||
|
||||
GitHub has [outlined instructions](https://help.github.com/articles/fork-a-repo/) for forking a repo. To work on an update to this repo, you will:
|
||||
|
||||
- Fork the repo
|
||||
- Make the changes
|
||||
- Submit a pull request
|
||||
|
||||
Once the [pull request](https://help.github.com/articles/about-pull-requests/) is reviewed, if the changes are approved they will be merged in to the project.
|
||||
|
||||
## 🐛 Bugs
|
||||
|
||||
Please [open a new issue](https://github.com/abraham/twitteroauth/issues/new) and details what you are trying to do, what is happening, and what you expect to happen. Err on the side of providing more details.
|
||||
|
|
44
vendor/abraham/twitteroauth/LICENSE.md
vendored
44
vendor/abraham/twitteroauth/LICENSE.md
vendored
|
@ -1,22 +1,22 @@
|
|||
Copyright (c) 2009 Abraham Williams - http://abrah.am - abraham@abrah.am
|
||||
|
||||
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.
|
||||
Copyright (c) 2009 Abraham Williams - http://abrah.am - abraham@abrah.am
|
||||
|
||||
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.
|
||||
|
|
22
vendor/abraham/twitteroauth/README.md
vendored
22
vendor/abraham/twitteroauth/README.md
vendored
|
@ -1,11 +1,11 @@
|
|||
<span itemprop="name">TwitterOAuth</span> [](https://github.com/abraham/twitteroauth/actions) [](https://scrutinizer-ci.com/g/abraham/twitteroauth/?branch=master) [](https://github.com/abraham/twitteroauth/issues) [](https://packagist.org/packages/abraham/twitteroauth) [](https://packagist.org/packages/abraham/twitteroauth)
|
||||
|
||||
---
|
||||
|
||||
<p itemprop="description">The most popular PHP library for Twitter's OAuth REST API.</p>
|
||||
|
||||
See documentation at https://twitteroauth.com.
|
||||
|
||||
PHP versions [listed](https://secure.php.net/supported-versions.php) as "active support" or "security fixes only" are supported.
|
||||
|
||||
<img src="https://raw.githubusercontent.com/abraham/twitteroauth-com/master/images/twitter-logo-blue.png" itemprop="image" alt="Twitter bird" width="200px">
|
||||
<span itemprop="name">TwitterOAuth</span> [](https://github.com/abraham/twitteroauth/actions) [](https://scrutinizer-ci.com/g/abraham/twitteroauth/?branch=master) [](https://github.com/abraham/twitteroauth/issues) [](https://packagist.org/packages/abraham/twitteroauth) [](https://packagist.org/packages/abraham/twitteroauth)
|
||||
|
||||
---
|
||||
|
||||
<p itemprop="description">The most popular PHP library for Twitter's OAuth REST API.</p>
|
||||
|
||||
See documentation at https://twitteroauth.com.
|
||||
|
||||
PHP versions [listed](https://secure.php.net/supported-versions.php) as "active support" or "security fixes only" are supported.
|
||||
|
||||
<img src="https://raw.githubusercontent.com/abraham/twitteroauth-com/master/images/twitter-logo-blue.png" itemprop="image" alt="Twitter bird" width="200px">
|
||||
|
|
70
vendor/abraham/twitteroauth/autoload.php
vendored
70
vendor/abraham/twitteroauth/autoload.php
vendored
|
@ -1,35 +1,35 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Use to autoload needed classes without Composer.
|
||||
*
|
||||
* @param string $class The fully-qualified class name.
|
||||
* @return void
|
||||
*/
|
||||
spl_autoload_register(function ($class) {
|
||||
// project-specific namespace prefix
|
||||
$prefix = 'Abraham\\TwitterOAuth\\';
|
||||
|
||||
// base directory for the namespace prefix
|
||||
$base_dir = __DIR__ . '/src/';
|
||||
|
||||
// does the class use the namespace prefix?
|
||||
$len = strlen($prefix);
|
||||
if (strncmp($prefix, $class, $len) !== 0) {
|
||||
// no, move to the next registered autoloader
|
||||
return;
|
||||
}
|
||||
|
||||
// get the relative class name
|
||||
$relative_class = substr($class, $len);
|
||||
|
||||
// replace the namespace prefix with the base directory, replace namespace
|
||||
// separators with directory separators in the relative class name, append
|
||||
// with .php
|
||||
$file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';
|
||||
|
||||
// if the file exists, require it
|
||||
if (file_exists($file)) {
|
||||
require $file;
|
||||
}
|
||||
});
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Use to autoload needed classes without Composer.
|
||||
*
|
||||
* @param string $class The fully-qualified class name.
|
||||
* @return void
|
||||
*/
|
||||
spl_autoload_register(function ($class) {
|
||||
// project-specific namespace prefix
|
||||
$prefix = 'Abraham\\TwitterOAuth\\';
|
||||
|
||||
// base directory for the namespace prefix
|
||||
$base_dir = __DIR__ . '/src/';
|
||||
|
||||
// does the class use the namespace prefix?
|
||||
$len = strlen($prefix);
|
||||
if (strncmp($prefix, $class, $len) !== 0) {
|
||||
// no, move to the next registered autoloader
|
||||
return;
|
||||
}
|
||||
|
||||
// get the relative class name
|
||||
$relative_class = substr($class, $len);
|
||||
|
||||
// replace the namespace prefix with the base directory, replace namespace
|
||||
// separators with directory separators in the relative class name, append
|
||||
// with .php
|
||||
$file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';
|
||||
|
||||
// if the file exists, require it
|
||||
if (file_exists($file)) {
|
||||
require $file;
|
||||
}
|
||||
});
|
||||
|
|
102
vendor/abraham/twitteroauth/composer.json
vendored
102
vendor/abraham/twitteroauth/composer.json
vendored
|
@ -1,51 +1,51 @@
|
|||
{
|
||||
"name": "abraham/twitteroauth",
|
||||
"type": "library",
|
||||
"description": "The most popular PHP library for use with the Twitter OAuth REST API.",
|
||||
"keywords": [
|
||||
"twitter",
|
||||
"api",
|
||||
"oauth",
|
||||
"rest",
|
||||
"social",
|
||||
"twitter api",
|
||||
"twitter oauth"
|
||||
],
|
||||
"license": "MIT",
|
||||
"homepage": "https://twitteroauth.com",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Abraham Williams",
|
||||
"email": "abraham@abrah.am",
|
||||
"homepage": "https://abrah.am",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/abraham/twitteroauth",
|
||||
"issues": "https://github.com/abraham/twitteroauth/issues"
|
||||
},
|
||||
"repositories": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://github.com/morozov/php-vcr"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": "^7.2 || ^7.3 || ^7.4",
|
||||
"ext-curl": "*",
|
||||
"composer/ca-bundle": "^1.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^8",
|
||||
"squizlabs/php_codesniffer": "^3",
|
||||
"phpmd/phpmd": "^2",
|
||||
"php-vcr/php-vcr": "^1",
|
||||
"php-vcr/phpunit-testlistener-vcr": "^3"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Abraham\\TwitterOAuth\\": "src"
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
"name": "abraham/twitteroauth",
|
||||
"type": "library",
|
||||
"description": "The most popular PHP library for use with the Twitter OAuth REST API.",
|
||||
"keywords": [
|
||||
"twitter",
|
||||
"api",
|
||||
"oauth",
|
||||
"rest",
|
||||
"social",
|
||||
"twitter api",
|
||||
"twitter oauth"
|
||||
],
|
||||
"license": "MIT",
|
||||
"homepage": "https://twitteroauth.com",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Abraham Williams",
|
||||
"email": "abraham@abrah.am",
|
||||
"homepage": "https://abrah.am",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/abraham/twitteroauth",
|
||||
"issues": "https://github.com/abraham/twitteroauth/issues"
|
||||
},
|
||||
"repositories": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://github.com/morozov/php-vcr"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": "^7.2 || ^7.3 || ^7.4",
|
||||
"ext-curl": "*",
|
||||
"composer/ca-bundle": "^1.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^8",
|
||||
"squizlabs/php_codesniffer": "^3",
|
||||
"phpmd/phpmd": "^2",
|
||||
"php-vcr/php-vcr": "^1",
|
||||
"php-vcr/phpunit-testlistener-vcr": "^3"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Abraham\\TwitterOAuth\\": "src"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
5370
vendor/abraham/twitteroauth/composer.lock
generated
vendored
5370
vendor/abraham/twitteroauth/composer.lock
generated
vendored
File diff suppressed because it is too large
Load diff
1008
vendor/abraham/twitteroauth/package-lock.json
generated
vendored
1008
vendor/abraham/twitteroauth/package-lock.json
generated
vendored
File diff suppressed because it is too large
Load diff
86
vendor/abraham/twitteroauth/package.json
vendored
86
vendor/abraham/twitteroauth/package.json
vendored
|
@ -1,43 +1,43 @@
|
|||
{
|
||||
"name": "twitteroauth",
|
||||
"version": "0.0.0",
|
||||
"description": "The most popular PHP library for use with the Twitter OAuth REST API.",
|
||||
"directories": {
|
||||
"test": "tests"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@prettier/plugin-php": "^0.14.3",
|
||||
"concurrently": "^5.3.0",
|
||||
"prettier": "^2.1.2"
|
||||
},
|
||||
"scripts": {
|
||||
"fix:phpcbf": "./vendor/bin/phpcbf src tests --standard=PSR12",
|
||||
"fix:prettier": "prettier . --write",
|
||||
"fix": "concurrently npm:fix:*",
|
||||
"lint:phpcs": "./vendor/bin/phpcs src tests --standard=PSR12",
|
||||
"lint:prettier": "prettier . --check",
|
||||
"lint": "concurrently npm:lint:*",
|
||||
"postinstall": "composer install --no-interaction",
|
||||
"test": "./vendor/bin/phpunit"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/abraham/twitteroauth.git"
|
||||
},
|
||||
"keywords": [
|
||||
"twitter",
|
||||
"api",
|
||||
"oauth",
|
||||
"rest",
|
||||
"social",
|
||||
"twitter-api",
|
||||
"twitter-oauth"
|
||||
],
|
||||
"author": "Abraham Williams <abraham@abrah.am>",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/abraham/twitteroauth/issues"
|
||||
},
|
||||
"homepage": "https://github.com/abraham/twitteroauth#readme"
|
||||
}
|
||||
{
|
||||
"name": "twitteroauth",
|
||||
"version": "0.0.0",
|
||||
"description": "The most popular PHP library for use with the Twitter OAuth REST API.",
|
||||
"directories": {
|
||||
"test": "tests"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@prettier/plugin-php": "^0.14.3",
|
||||
"concurrently": "^5.3.0",
|
||||
"prettier": "^2.1.2"
|
||||
},
|
||||
"scripts": {
|
||||
"fix:phpcbf": "./vendor/bin/phpcbf src tests --standard=PSR12",
|
||||
"fix:prettier": "prettier . --write",
|
||||
"fix": "concurrently npm:fix:*",
|
||||
"lint:phpcs": "./vendor/bin/phpcs src tests --standard=PSR12",
|
||||
"lint:prettier": "prettier . --check",
|
||||
"lint": "concurrently npm:lint:*",
|
||||
"postinstall": "composer install --no-interaction",
|
||||
"test": "./vendor/bin/phpunit"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/abraham/twitteroauth.git"
|
||||
},
|
||||
"keywords": [
|
||||
"twitter",
|
||||
"api",
|
||||
"oauth",
|
||||
"rest",
|
||||
"social",
|
||||
"twitter-api",
|
||||
"twitter-oauth"
|
||||
],
|
||||
"author": "Abraham Williams <abraham@abrah.am>",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/abraham/twitteroauth/issues"
|
||||
},
|
||||
"homepage": "https://github.com/abraham/twitteroauth#readme"
|
||||
}
|
||||
|
|
30
vendor/abraham/twitteroauth/phpmd.xml
vendored
30
vendor/abraham/twitteroauth/phpmd.xml
vendored
|
@ -1,15 +1,15 @@
|
|||
<?xml version="1.0"?>
|
||||
<ruleset name="My first PHPMD rule set"
|
||||
xmlns="http://pmd.sf.net/ruleset/1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
|
||||
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
|
||||
<description>Keep TwitterOAuth source code clean.</description>
|
||||
|
||||
<!-- <rule ref="rulesets/cleancode.xml" /> -->
|
||||
<rule ref="rulesets/codesize.xml" />
|
||||
<rule ref="rulesets/controversial.xml" />
|
||||
<rule ref="rulesets/design.xml" />
|
||||
<rule ref="rulesets/naming.xml" />
|
||||
<rule ref="rulesets/unusedcode.xml" />
|
||||
</ruleset>
|
||||
<?xml version="1.0"?>
|
||||
<ruleset name="My first PHPMD rule set"
|
||||
xmlns="http://pmd.sf.net/ruleset/1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
|
||||
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
|
||||
<description>Keep TwitterOAuth source code clean.</description>
|
||||
|
||||
<!-- <rule ref="rulesets/cleancode.xml" /> -->
|
||||
<rule ref="rulesets/codesize.xml" />
|
||||
<rule ref="rulesets/controversial.xml" />
|
||||
<rule ref="rulesets/design.xml" />
|
||||
<rule ref="rulesets/naming.xml" />
|
||||
<rule ref="rulesets/unusedcode.xml" />
|
||||
</ruleset>
|
||||
|
|
36
vendor/abraham/twitteroauth/phpunit.xml
vendored
36
vendor/abraham/twitteroauth/phpunit.xml
vendored
|
@ -1,18 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit
|
||||
colors="true"
|
||||
bootstrap="tests/bootstrap.php"
|
||||
testdox="true">
|
||||
|
||||
<testsuites>
|
||||
<testsuite name="TwitterOAuth Test Suite">
|
||||
<directory>./tests/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<listeners>
|
||||
<listener
|
||||
class="VCR\PHPUnit\TestListener\VCRTestListener"
|
||||
file="vendor/php-vcr/phpunit-testlistener-vcr/src/VCRTestListener.php" />
|
||||
</listeners>
|
||||
</phpunit>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit
|
||||
colors="true"
|
||||
bootstrap="tests/bootstrap.php"
|
||||
testdox="true">
|
||||
|
||||
<testsuites>
|
||||
<testsuite name="TwitterOAuth Test Suite">
|
||||
<directory>./tests/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<listeners>
|
||||
<listener
|
||||
class="VCR\PHPUnit\TestListener\VCRTestListener"
|
||||
file="vendor/php-vcr/phpunit-testlistener-vcr/src/VCRTestListener.php" />
|
||||
</listeners>
|
||||
</phpunit>
|
||||
|
|
218
vendor/abraham/twitteroauth/src/Config.php
vendored
218
vendor/abraham/twitteroauth/src/Config.php
vendored
|
@ -1,109 +1,109 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth;
|
||||
|
||||
/**
|
||||
* Handle setting and storing config for TwitterOAuth.
|
||||
*
|
||||
* @author Abraham Williams <abraham@abrah.am>
|
||||
*/
|
||||
class Config
|
||||
{
|
||||
/** @var int How long to wait for a response from the API */
|
||||
protected $timeout = 5;
|
||||
/** @var int how long to wait while connecting to the API */
|
||||
protected $connectionTimeout = 5;
|
||||
/** @var int How many times we retry request when API is down */
|
||||
protected $maxRetries = 0;
|
||||
/** @var int Delay in seconds before we retry the request */
|
||||
protected $retriesDelay = 1;
|
||||
|
||||
/**
|
||||
* Decode JSON Response as associative Array
|
||||
*
|
||||
* @see http://php.net/manual/en/function.json-decode.php
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $decodeJsonAsArray = false;
|
||||
/** @var string User-Agent header */
|
||||
protected $userAgent = 'TwitterOAuth (+https://twitteroauth.com)';
|
||||
/** @var array Store proxy connection details */
|
||||
protected $proxy = [];
|
||||
|
||||
/** @var bool Whether to encode the curl requests with gzip or not */
|
||||
protected $gzipEncoding = true;
|
||||
|
||||
/** @var integer Size for Chunked Uploads */
|
||||
protected $chunkSize = 250000; // 0.25 MegaByte
|
||||
|
||||
/**
|
||||
* Set the connection and response timeouts.
|
||||
*
|
||||
* @param int $connectionTimeout
|
||||
* @param int $timeout
|
||||
*/
|
||||
public function setTimeouts(int $connectionTimeout, int $timeout): void
|
||||
{
|
||||
$this->connectionTimeout = $connectionTimeout;
|
||||
$this->timeout = $timeout;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the number of times to retry on error and how long between each.
|
||||
*
|
||||
* @param int $maxRetries
|
||||
* @param int $retriesDelay
|
||||
*/
|
||||
public function setRetries(int $maxRetries, int $retriesDelay): void
|
||||
{
|
||||
$this->maxRetries = $maxRetries;
|
||||
$this->retriesDelay = $retriesDelay;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $value
|
||||
*/
|
||||
public function setDecodeJsonAsArray(bool $value): void
|
||||
{
|
||||
$this->decodeJsonAsArray = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $userAgent
|
||||
*/
|
||||
public function setUserAgent(string $userAgent): void
|
||||
{
|
||||
$this->userAgent = $userAgent;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $proxy
|
||||
*/
|
||||
public function setProxy(array $proxy): void
|
||||
{
|
||||
$this->proxy = $proxy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to encode the curl requests with gzip or not.
|
||||
*
|
||||
* @param boolean $gzipEncoding
|
||||
*/
|
||||
public function setGzipEncoding(bool $gzipEncoding): void
|
||||
{
|
||||
$this->gzipEncoding = $gzipEncoding;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the size of each part of file for chunked media upload.
|
||||
*
|
||||
* @param int $value
|
||||
*/
|
||||
public function setChunkSize(int $value): void
|
||||
{
|
||||
$this->chunkSize = $value;
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth;
|
||||
|
||||
/**
|
||||
* Handle setting and storing config for TwitterOAuth.
|
||||
*
|
||||
* @author Abraham Williams <abraham@abrah.am>
|
||||
*/
|
||||
class Config
|
||||
{
|
||||
/** @var int How long to wait for a response from the API */
|
||||
protected $timeout = 5;
|
||||
/** @var int how long to wait while connecting to the API */
|
||||
protected $connectionTimeout = 5;
|
||||
/** @var int How many times we retry request when API is down */
|
||||
protected $maxRetries = 0;
|
||||
/** @var int Delay in seconds before we retry the request */
|
||||
protected $retriesDelay = 1;
|
||||
|
||||
/**
|
||||
* Decode JSON Response as associative Array
|
||||
*
|
||||
* @see http://php.net/manual/en/function.json-decode.php
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $decodeJsonAsArray = false;
|
||||
/** @var string User-Agent header */
|
||||
protected $userAgent = 'TwitterOAuth (+https://twitteroauth.com)';
|
||||
/** @var array Store proxy connection details */
|
||||
protected $proxy = [];
|
||||
|
||||
/** @var bool Whether to encode the curl requests with gzip or not */
|
||||
protected $gzipEncoding = true;
|
||||
|
||||
/** @var integer Size for Chunked Uploads */
|
||||
protected $chunkSize = 250000; // 0.25 MegaByte
|
||||
|
||||
/**
|
||||
* Set the connection and response timeouts.
|
||||
*
|
||||
* @param int $connectionTimeout
|
||||
* @param int $timeout
|
||||
*/
|
||||
public function setTimeouts(int $connectionTimeout, int $timeout): void
|
||||
{
|
||||
$this->connectionTimeout = $connectionTimeout;
|
||||
$this->timeout = $timeout;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the number of times to retry on error and how long between each.
|
||||
*
|
||||
* @param int $maxRetries
|
||||
* @param int $retriesDelay
|
||||
*/
|
||||
public function setRetries(int $maxRetries, int $retriesDelay): void
|
||||
{
|
||||
$this->maxRetries = $maxRetries;
|
||||
$this->retriesDelay = $retriesDelay;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $value
|
||||
*/
|
||||
public function setDecodeJsonAsArray(bool $value): void
|
||||
{
|
||||
$this->decodeJsonAsArray = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $userAgent
|
||||
*/
|
||||
public function setUserAgent(string $userAgent): void
|
||||
{
|
||||
$this->userAgent = $userAgent;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $proxy
|
||||
*/
|
||||
public function setProxy(array $proxy): void
|
||||
{
|
||||
$this->proxy = $proxy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to encode the curl requests with gzip or not.
|
||||
*
|
||||
* @param boolean $gzipEncoding
|
||||
*/
|
||||
public function setGzipEncoding(bool $gzipEncoding): void
|
||||
{
|
||||
$this->gzipEncoding = $gzipEncoding;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the size of each part of file for chunked media upload.
|
||||
*
|
||||
* @param int $value
|
||||
*/
|
||||
public function setChunkSize(int $value): void
|
||||
{
|
||||
$this->chunkSize = $value;
|
||||
}
|
||||
}
|
||||
|
|
86
vendor/abraham/twitteroauth/src/Consumer.php
vendored
86
vendor/abraham/twitteroauth/src/Consumer.php
vendored
|
@ -1,43 +1,43 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* The MIT License
|
||||
* Copyright (c) 2007 Andy Smith
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth;
|
||||
|
||||
class Consumer
|
||||
{
|
||||
/** @var string */
|
||||
public $key;
|
||||
/** @var string */
|
||||
public $secret;
|
||||
/** @var string|null */
|
||||
public $callbackUrl;
|
||||
|
||||
/**
|
||||
* @param string|null $key
|
||||
* @param string|null $secret
|
||||
* @param null $callbackUrl
|
||||
*/
|
||||
public function __construct(
|
||||
?string $key,
|
||||
?string $secret,
|
||||
?string $callbackUrl = null
|
||||
) {
|
||||
$this->key = $key;
|
||||
$this->secret = $secret;
|
||||
$this->callbackUrl = $callbackUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return "Consumer[key=$this->key,secret=$this->secret]";
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* The MIT License
|
||||
* Copyright (c) 2007 Andy Smith
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth;
|
||||
|
||||
class Consumer
|
||||
{
|
||||
/** @var string */
|
||||
public $key;
|
||||
/** @var string */
|
||||
public $secret;
|
||||
/** @var string|null */
|
||||
public $callbackUrl;
|
||||
|
||||
/**
|
||||
* @param string|null $key
|
||||
* @param string|null $secret
|
||||
* @param null $callbackUrl
|
||||
*/
|
||||
public function __construct(
|
||||
?string $key,
|
||||
?string $secret,
|
||||
?string $callbackUrl = null
|
||||
) {
|
||||
$this->key = $key;
|
||||
$this->secret = $secret;
|
||||
$this->callbackUrl = $callbackUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return "Consumer[key=$this->key,secret=$this->secret]";
|
||||
}
|
||||
}
|
||||
|
|
92
vendor/abraham/twitteroauth/src/HmacSha1.php
vendored
92
vendor/abraham/twitteroauth/src/HmacSha1.php
vendored
|
@ -1,46 +1,46 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* The MIT License
|
||||
* Copyright (c) 2007 Andy Smith
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth;
|
||||
|
||||
/**
|
||||
* The HMAC-SHA1 signature method uses the HMAC-SHA1 signature algorithm as defined in [RFC2104]
|
||||
* where the Signature Base String is the text and the key is the concatenated values (each first
|
||||
* encoded per Parameter Encoding) of the Consumer Secret and Token Secret, separated by an '&'
|
||||
* character (ASCII code 38) even if empty.
|
||||
* - Chapter 9.2 ("HMAC-SHA1")
|
||||
*/
|
||||
class HmacSha1 extends SignatureMethod
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'HMAC-SHA1';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function buildSignature(
|
||||
Request $request,
|
||||
Consumer $consumer,
|
||||
Token $token = null
|
||||
): string {
|
||||
$signatureBase = $request->getSignatureBaseString();
|
||||
|
||||
$parts = [$consumer->secret, null !== $token ? $token->secret : ''];
|
||||
|
||||
$parts = Util::urlencodeRfc3986($parts);
|
||||
$key = implode('&', $parts);
|
||||
|
||||
return base64_encode(hash_hmac('sha1', $signatureBase, $key, true));
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* The MIT License
|
||||
* Copyright (c) 2007 Andy Smith
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth;
|
||||
|
||||
/**
|
||||
* The HMAC-SHA1 signature method uses the HMAC-SHA1 signature algorithm as defined in [RFC2104]
|
||||
* where the Signature Base String is the text and the key is the concatenated values (each first
|
||||
* encoded per Parameter Encoding) of the Consumer Secret and Token Secret, separated by an '&'
|
||||
* character (ASCII code 38) even if empty.
|
||||
* - Chapter 9.2 ("HMAC-SHA1")
|
||||
*/
|
||||
class HmacSha1 extends SignatureMethod
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'HMAC-SHA1';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function buildSignature(
|
||||
Request $request,
|
||||
Consumer $consumer,
|
||||
Token $token = null
|
||||
): string {
|
||||
$signatureBase = $request->getSignatureBaseString();
|
||||
|
||||
$parts = [$consumer->secret, null !== $token ? $token->secret : ''];
|
||||
|
||||
$parts = Util::urlencodeRfc3986($parts);
|
||||
$key = implode('&', $parts);
|
||||
|
||||
return base64_encode(hash_hmac('sha1', $signatureBase, $key, true));
|
||||
}
|
||||
}
|
||||
|
|
578
vendor/abraham/twitteroauth/src/Request.php
vendored
578
vendor/abraham/twitteroauth/src/Request.php
vendored
|
@ -1,289 +1,289 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* The MIT License
|
||||
* Copyright (c) 2007 Andy Smith
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth;
|
||||
|
||||
class Request
|
||||
{
|
||||
protected $parameters;
|
||||
protected $httpMethod;
|
||||
protected $httpUrl;
|
||||
protected $json;
|
||||
public static $version = '1.0';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string $httpMethod
|
||||
* @param string $httpUrl
|
||||
* @param array|null $parameters
|
||||
*/
|
||||
public function __construct(
|
||||
string $httpMethod,
|
||||
string $httpUrl,
|
||||
?array $parameters = []
|
||||
) {
|
||||
$parameters = array_merge(
|
||||
Util::parseParameters(parse_url($httpUrl, PHP_URL_QUERY)),
|
||||
$parameters
|
||||
);
|
||||
$this->parameters = $parameters;
|
||||
$this->httpMethod = $httpMethod;
|
||||
$this->httpUrl = $httpUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* pretty much a helper function to set up the request
|
||||
*
|
||||
* @param Consumer $consumer
|
||||
* @param Token $token
|
||||
* @param string $httpMethod
|
||||
* @param string $httpUrl
|
||||
* @param array $parameters
|
||||
*
|
||||
* @return Request
|
||||
*/
|
||||
public static function fromConsumerAndToken(
|
||||
Consumer $consumer,
|
||||
Token $token = null,
|
||||
string $httpMethod,
|
||||
string $httpUrl,
|
||||
array $parameters = [],
|
||||
$json = false
|
||||
) {
|
||||
$defaults = [
|
||||
'oauth_version' => Request::$version,
|
||||
'oauth_nonce' => Request::generateNonce(),
|
||||
'oauth_timestamp' => time(),
|
||||
'oauth_consumer_key' => $consumer->key,
|
||||
];
|
||||
if (null !== $token) {
|
||||
$defaults['oauth_token'] = $token->key;
|
||||
}
|
||||
|
||||
// The json payload is not included in the signature on json requests,
|
||||
// therefore it shouldn't be included in the parameters array.
|
||||
if ($json) {
|
||||
$parameters = $defaults;
|
||||
} else {
|
||||
$parameters = array_merge($defaults, $parameters);
|
||||
}
|
||||
|
||||
return new Request($httpMethod, $httpUrl, $parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @param string $value
|
||||
*/
|
||||
public function setParameter(string $name, string $value)
|
||||
{
|
||||
$this->parameters[$name] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getParameter(string $name): ?string
|
||||
{
|
||||
return isset($this->parameters[$name])
|
||||
? $this->parameters[$name]
|
||||
: null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getParameters(): array
|
||||
{
|
||||
return $this->parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*/
|
||||
public function removeParameter(string $name): void
|
||||
{
|
||||
unset($this->parameters[$name]);
|
||||
}
|
||||
|
||||
/**
|
||||
* The request parameters, sorted and concatenated into a normalized string.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSignableParameters(): string
|
||||
{
|
||||
// Grab all parameters
|
||||
$params = $this->parameters;
|
||||
|
||||
// Remove oauth_signature if present
|
||||
// Ref: Spec: 9.1.1 ("The oauth_signature parameter MUST be excluded.")
|
||||
if (isset($params['oauth_signature'])) {
|
||||
unset($params['oauth_signature']);
|
||||
}
|
||||
|
||||
return Util::buildHttpQuery($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the base string of this request
|
||||
*
|
||||
* The base string defined as the method, the url
|
||||
* and the parameters (normalized), each urlencoded
|
||||
* and the concated with &.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSignatureBaseString(): string
|
||||
{
|
||||
$parts = [
|
||||
$this->getNormalizedHttpMethod(),
|
||||
$this->getNormalizedHttpUrl(),
|
||||
$this->getSignableParameters(),
|
||||
];
|
||||
|
||||
$parts = Util::urlencodeRfc3986($parts);
|
||||
|
||||
return implode('&', $parts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the HTTP Method in uppercase
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNormalizedHttpMethod(): string
|
||||
{
|
||||
return strtoupper($this->httpMethod);
|
||||
}
|
||||
|
||||
/**
|
||||
* parses the url and rebuilds it to be
|
||||
* scheme://host/path
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNormalizedHttpUrl(): string
|
||||
{
|
||||
$parts = parse_url($this->httpUrl);
|
||||
|
||||
$scheme = $parts['scheme'];
|
||||
$host = strtolower($parts['host']);
|
||||
$path = $parts['path'];
|
||||
|
||||
return "$scheme://$host$path";
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a url usable for a GET request
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toUrl(): string
|
||||
{
|
||||
$postData = $this->toPostdata();
|
||||
$out = $this->getNormalizedHttpUrl();
|
||||
if ($postData) {
|
||||
$out .= '?' . $postData;
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the data one would send in a POST request
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toPostdata(): string
|
||||
{
|
||||
return Util::buildHttpQuery($this->parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the Authorization: header
|
||||
*
|
||||
* @return string
|
||||
* @throws TwitterOAuthException
|
||||
*/
|
||||
public function toHeader(): string
|
||||
{
|
||||
$first = true;
|
||||
$out = 'Authorization: OAuth';
|
||||
foreach ($this->parameters as $k => $v) {
|
||||
if (substr($k, 0, 5) != 'oauth') {
|
||||
continue;
|
||||
}
|
||||
if (is_array($v)) {
|
||||
throw new TwitterOAuthException(
|
||||
'Arrays not supported in headers'
|
||||
);
|
||||
}
|
||||
$out .= $first ? ' ' : ', ';
|
||||
$out .=
|
||||
Util::urlencodeRfc3986($k) .
|
||||
'="' .
|
||||
Util::urlencodeRfc3986($v) .
|
||||
'"';
|
||||
$first = false;
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->toUrl();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param SignatureMethod $signatureMethod
|
||||
* @param Consumer $consumer
|
||||
* @param Token $token
|
||||
*/
|
||||
public function signRequest(
|
||||
SignatureMethod $signatureMethod,
|
||||
Consumer $consumer,
|
||||
Token $token = null
|
||||
) {
|
||||
$this->setParameter(
|
||||
'oauth_signature_method',
|
||||
$signatureMethod->getName()
|
||||
);
|
||||
$signature = $this->buildSignature($signatureMethod, $consumer, $token);
|
||||
$this->setParameter('oauth_signature', $signature);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param SignatureMethod $signatureMethod
|
||||
* @param Consumer $consumer
|
||||
* @param Token $token
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function buildSignature(
|
||||
SignatureMethod $signatureMethod,
|
||||
Consumer $consumer,
|
||||
Token $token = null
|
||||
): string {
|
||||
return $signatureMethod->buildSignature($this, $consumer, $token);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function generateNonce(): string
|
||||
{
|
||||
return md5(microtime() . mt_rand());
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* The MIT License
|
||||
* Copyright (c) 2007 Andy Smith
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth;
|
||||
|
||||
class Request
|
||||
{
|
||||
protected $parameters;
|
||||
protected $httpMethod;
|
||||
protected $httpUrl;
|
||||
protected $json;
|
||||
public static $version = '1.0';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string $httpMethod
|
||||
* @param string $httpUrl
|
||||
* @param array|null $parameters
|
||||
*/
|
||||
public function __construct(
|
||||
string $httpMethod,
|
||||
string $httpUrl,
|
||||
?array $parameters = []
|
||||
) {
|
||||
$parameters = array_merge(
|
||||
Util::parseParameters(parse_url($httpUrl, PHP_URL_QUERY)),
|
||||
$parameters
|
||||
);
|
||||
$this->parameters = $parameters;
|
||||
$this->httpMethod = $httpMethod;
|
||||
$this->httpUrl = $httpUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* pretty much a helper function to set up the request
|
||||
*
|
||||
* @param Consumer $consumer
|
||||
* @param Token $token
|
||||
* @param string $httpMethod
|
||||
* @param string $httpUrl
|
||||
* @param array $parameters
|
||||
*
|
||||
* @return Request
|
||||
*/
|
||||
public static function fromConsumerAndToken(
|
||||
Consumer $consumer,
|
||||
Token $token = null,
|
||||
string $httpMethod,
|
||||
string $httpUrl,
|
||||
array $parameters = [],
|
||||
$json = false
|
||||
) {
|
||||
$defaults = [
|
||||
'oauth_version' => Request::$version,
|
||||
'oauth_nonce' => Request::generateNonce(),
|
||||
'oauth_timestamp' => time(),
|
||||
'oauth_consumer_key' => $consumer->key,
|
||||
];
|
||||
if (null !== $token) {
|
||||
$defaults['oauth_token'] = $token->key;
|
||||
}
|
||||
|
||||
// The json payload is not included in the signature on json requests,
|
||||
// therefore it shouldn't be included in the parameters array.
|
||||
if ($json) {
|
||||
$parameters = $defaults;
|
||||
} else {
|
||||
$parameters = array_merge($defaults, $parameters);
|
||||
}
|
||||
|
||||
return new Request($httpMethod, $httpUrl, $parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @param string $value
|
||||
*/
|
||||
public function setParameter(string $name, string $value)
|
||||
{
|
||||
$this->parameters[$name] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getParameter(string $name): ?string
|
||||
{
|
||||
return isset($this->parameters[$name])
|
||||
? $this->parameters[$name]
|
||||
: null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getParameters(): array
|
||||
{
|
||||
return $this->parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*/
|
||||
public function removeParameter(string $name): void
|
||||
{
|
||||
unset($this->parameters[$name]);
|
||||
}
|
||||
|
||||
/**
|
||||
* The request parameters, sorted and concatenated into a normalized string.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSignableParameters(): string
|
||||
{
|
||||
// Grab all parameters
|
||||
$params = $this->parameters;
|
||||
|
||||
// Remove oauth_signature if present
|
||||
// Ref: Spec: 9.1.1 ("The oauth_signature parameter MUST be excluded.")
|
||||
if (isset($params['oauth_signature'])) {
|
||||
unset($params['oauth_signature']);
|
||||
}
|
||||
|
||||
return Util::buildHttpQuery($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the base string of this request
|
||||
*
|
||||
* The base string defined as the method, the url
|
||||
* and the parameters (normalized), each urlencoded
|
||||
* and the concated with &.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSignatureBaseString(): string
|
||||
{
|
||||
$parts = [
|
||||
$this->getNormalizedHttpMethod(),
|
||||
$this->getNormalizedHttpUrl(),
|
||||
$this->getSignableParameters(),
|
||||
];
|
||||
|
||||
$parts = Util::urlencodeRfc3986($parts);
|
||||
|
||||
return implode('&', $parts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the HTTP Method in uppercase
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNormalizedHttpMethod(): string
|
||||
{
|
||||
return strtoupper($this->httpMethod);
|
||||
}
|
||||
|
||||
/**
|
||||
* parses the url and rebuilds it to be
|
||||
* scheme://host/path
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNormalizedHttpUrl(): string
|
||||
{
|
||||
$parts = parse_url($this->httpUrl);
|
||||
|
||||
$scheme = $parts['scheme'];
|
||||
$host = strtolower($parts['host']);
|
||||
$path = $parts['path'];
|
||||
|
||||
return "$scheme://$host$path";
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a url usable for a GET request
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toUrl(): string
|
||||
{
|
||||
$postData = $this->toPostdata();
|
||||
$out = $this->getNormalizedHttpUrl();
|
||||
if ($postData) {
|
||||
$out .= '?' . $postData;
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the data one would send in a POST request
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toPostdata(): string
|
||||
{
|
||||
return Util::buildHttpQuery($this->parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the Authorization: header
|
||||
*
|
||||
* @return string
|
||||
* @throws TwitterOAuthException
|
||||
*/
|
||||
public function toHeader(): string
|
||||
{
|
||||
$first = true;
|
||||
$out = 'Authorization: OAuth';
|
||||
foreach ($this->parameters as $k => $v) {
|
||||
if (substr($k, 0, 5) != 'oauth') {
|
||||
continue;
|
||||
}
|
||||
if (is_array($v)) {
|
||||
throw new TwitterOAuthException(
|
||||
'Arrays not supported in headers'
|
||||
);
|
||||
}
|
||||
$out .= $first ? ' ' : ', ';
|
||||
$out .=
|
||||
Util::urlencodeRfc3986($k) .
|
||||
'="' .
|
||||
Util::urlencodeRfc3986($v) .
|
||||
'"';
|
||||
$first = false;
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->toUrl();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param SignatureMethod $signatureMethod
|
||||
* @param Consumer $consumer
|
||||
* @param Token $token
|
||||
*/
|
||||
public function signRequest(
|
||||
SignatureMethod $signatureMethod,
|
||||
Consumer $consumer,
|
||||
Token $token = null
|
||||
) {
|
||||
$this->setParameter(
|
||||
'oauth_signature_method',
|
||||
$signatureMethod->getName()
|
||||
);
|
||||
$signature = $this->buildSignature($signatureMethod, $consumer, $token);
|
||||
$this->setParameter('oauth_signature', $signature);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param SignatureMethod $signatureMethod
|
||||
* @param Consumer $consumer
|
||||
* @param Token $token
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function buildSignature(
|
||||
SignatureMethod $signatureMethod,
|
||||
Consumer $consumer,
|
||||
Token $token = null
|
||||
): string {
|
||||
return $signatureMethod->buildSignature($this, $consumer, $token);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function generateNonce(): string
|
||||
{
|
||||
return md5(microtime() . mt_rand());
|
||||
}
|
||||
}
|
||||
|
|
218
vendor/abraham/twitteroauth/src/Response.php
vendored
218
vendor/abraham/twitteroauth/src/Response.php
vendored
|
@ -1,109 +1,109 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth;
|
||||
|
||||
/**
|
||||
* The result of the most recent API request.
|
||||
*
|
||||
* @author Abraham Williams <abraham@abrah.am>
|
||||
*/
|
||||
class Response
|
||||
{
|
||||
/** @var string|null API path from the most recent request */
|
||||
private $apiPath;
|
||||
/** @var int HTTP status code from the most recent request */
|
||||
private $httpCode = 0;
|
||||
/** @var array HTTP headers from the most recent request */
|
||||
private $headers = [];
|
||||
/** @var array|object Response body from the most recent request */
|
||||
private $body = [];
|
||||
/** @var array HTTP headers from the most recent request that start with X */
|
||||
private $xHeaders = [];
|
||||
|
||||
/**
|
||||
* @param string $apiPath
|
||||
*/
|
||||
public function setApiPath(string $apiPath): void
|
||||
{
|
||||
$this->apiPath = $apiPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getApiPath(): ?string
|
||||
{
|
||||
return $this->apiPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|object $body
|
||||
*/
|
||||
public function setBody($body)
|
||||
{
|
||||
$this->body = $body;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array|object|string
|
||||
*/
|
||||
public function getBody()
|
||||
{
|
||||
return $this->body;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $httpCode
|
||||
*/
|
||||
public function setHttpCode(int $httpCode): void
|
||||
{
|
||||
$this->httpCode = $httpCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getHttpCode(): int
|
||||
{
|
||||
return $this->httpCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $headers
|
||||
*/
|
||||
public function setHeaders(array $headers): void
|
||||
{
|
||||
foreach ($headers as $key => $value) {
|
||||
if (substr($key, 0, 1) == 'x') {
|
||||
$this->xHeaders[$key] = $value;
|
||||
}
|
||||
}
|
||||
$this->headers = $headers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getsHeaders(): array
|
||||
{
|
||||
return $this->headers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $xHeaders
|
||||
*/
|
||||
public function setXHeaders(array $xHeaders = []): void
|
||||
{
|
||||
$this->xHeaders = $xHeaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getXHeaders(): array
|
||||
{
|
||||
return $this->xHeaders;
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth;
|
||||
|
||||
/**
|
||||
* The result of the most recent API request.
|
||||
*
|
||||
* @author Abraham Williams <abraham@abrah.am>
|
||||
*/
|
||||
class Response
|
||||
{
|
||||
/** @var string|null API path from the most recent request */
|
||||
private $apiPath;
|
||||
/** @var int HTTP status code from the most recent request */
|
||||
private $httpCode = 0;
|
||||
/** @var array HTTP headers from the most recent request */
|
||||
private $headers = [];
|
||||
/** @var array|object Response body from the most recent request */
|
||||
private $body = [];
|
||||
/** @var array HTTP headers from the most recent request that start with X */
|
||||
private $xHeaders = [];
|
||||
|
||||
/**
|
||||
* @param string $apiPath
|
||||
*/
|
||||
public function setApiPath(string $apiPath): void
|
||||
{
|
||||
$this->apiPath = $apiPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getApiPath(): ?string
|
||||
{
|
||||
return $this->apiPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|object $body
|
||||
*/
|
||||
public function setBody($body)
|
||||
{
|
||||
$this->body = $body;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array|object|string
|
||||
*/
|
||||
public function getBody()
|
||||
{
|
||||
return $this->body;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $httpCode
|
||||
*/
|
||||
public function setHttpCode(int $httpCode): void
|
||||
{
|
||||
$this->httpCode = $httpCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getHttpCode(): int
|
||||
{
|
||||
return $this->httpCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $headers
|
||||
*/
|
||||
public function setHeaders(array $headers): void
|
||||
{
|
||||
foreach ($headers as $key => $value) {
|
||||
if (substr($key, 0, 1) == 'x') {
|
||||
$this->xHeaders[$key] = $value;
|
||||
}
|
||||
}
|
||||
$this->headers = $headers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getsHeaders(): array
|
||||
{
|
||||
return $this->headers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $xHeaders
|
||||
*/
|
||||
public function setXHeaders(array $xHeaders = []): void
|
||||
{
|
||||
$this->xHeaders = $xHeaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getXHeaders(): array
|
||||
{
|
||||
return $this->xHeaders;
|
||||
}
|
||||
}
|
||||
|
|
156
vendor/abraham/twitteroauth/src/SignatureMethod.php
vendored
156
vendor/abraham/twitteroauth/src/SignatureMethod.php
vendored
|
@ -1,78 +1,78 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* The MIT License
|
||||
* Copyright (c) 2007 Andy Smith
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth;
|
||||
|
||||
/**
|
||||
* A class for implementing a Signature Method
|
||||
* See section 9 ("Signing Requests") in the spec
|
||||
*/
|
||||
abstract class SignatureMethod
|
||||
{
|
||||
/**
|
||||
* Needs to return the name of the Signature Method (ie HMAC-SHA1)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract public function getName();
|
||||
|
||||
/**
|
||||
* Build up the signature
|
||||
* NOTE: The output of this function MUST NOT be urlencoded.
|
||||
* the encoding is handled in OAuthRequest when the final
|
||||
* request is serialized
|
||||
*
|
||||
* @param Request $request
|
||||
* @param Consumer $consumer
|
||||
* @param Token $token
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract public function buildSignature(
|
||||
Request $request,
|
||||
Consumer $consumer,
|
||||
Token $token = null
|
||||
);
|
||||
|
||||
/**
|
||||
* Verifies that a given signature is correct
|
||||
*
|
||||
* @param Request $request
|
||||
* @param Consumer $consumer
|
||||
* @param Token $token
|
||||
* @param string $signature
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function checkSignature(
|
||||
Request $request,
|
||||
Consumer $consumer,
|
||||
Token $token,
|
||||
string $signature
|
||||
): bool {
|
||||
$built = $this->buildSignature($request, $consumer, $token);
|
||||
|
||||
// Check for zero length, although unlikely here
|
||||
if (strlen($built) == 0 || strlen($signature) == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (strlen($built) != strlen($signature)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Avoid a timing leak with a (hopefully) time insensitive compare
|
||||
$result = 0;
|
||||
for ($i = 0; $i < strlen($signature); $i++) {
|
||||
$result |= ord($built[$i]) ^ ord($signature[$i]);
|
||||
}
|
||||
|
||||
return $result == 0;
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* The MIT License
|
||||
* Copyright (c) 2007 Andy Smith
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth;
|
||||
|
||||
/**
|
||||
* A class for implementing a Signature Method
|
||||
* See section 9 ("Signing Requests") in the spec
|
||||
*/
|
||||
abstract class SignatureMethod
|
||||
{
|
||||
/**
|
||||
* Needs to return the name of the Signature Method (ie HMAC-SHA1)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract public function getName();
|
||||
|
||||
/**
|
||||
* Build up the signature
|
||||
* NOTE: The output of this function MUST NOT be urlencoded.
|
||||
* the encoding is handled in OAuthRequest when the final
|
||||
* request is serialized
|
||||
*
|
||||
* @param Request $request
|
||||
* @param Consumer $consumer
|
||||
* @param Token $token
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract public function buildSignature(
|
||||
Request $request,
|
||||
Consumer $consumer,
|
||||
Token $token = null
|
||||
);
|
||||
|
||||
/**
|
||||
* Verifies that a given signature is correct
|
||||
*
|
||||
* @param Request $request
|
||||
* @param Consumer $consumer
|
||||
* @param Token $token
|
||||
* @param string $signature
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function checkSignature(
|
||||
Request $request,
|
||||
Consumer $consumer,
|
||||
Token $token,
|
||||
string $signature
|
||||
): bool {
|
||||
$built = $this->buildSignature($request, $consumer, $token);
|
||||
|
||||
// Check for zero length, although unlikely here
|
||||
if (strlen($built) == 0 || strlen($signature) == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (strlen($built) != strlen($signature)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Avoid a timing leak with a (hopefully) time insensitive compare
|
||||
$result = 0;
|
||||
for ($i = 0; $i < strlen($signature); $i++) {
|
||||
$result |= ord($built[$i]) ^ ord($signature[$i]);
|
||||
}
|
||||
|
||||
return $result == 0;
|
||||
}
|
||||
}
|
||||
|
|
86
vendor/abraham/twitteroauth/src/Token.php
vendored
86
vendor/abraham/twitteroauth/src/Token.php
vendored
|
@ -1,43 +1,43 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* The MIT License
|
||||
* Copyright (c) 2007 Andy Smith
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth;
|
||||
|
||||
class Token
|
||||
{
|
||||
/** @var string */
|
||||
public $key;
|
||||
/** @var string */
|
||||
public $secret;
|
||||
|
||||
/**
|
||||
* @param string $key The OAuth Token
|
||||
* @param string $secret The OAuth Token Secret
|
||||
*/
|
||||
public function __construct(?string $key, ?string $secret)
|
||||
{
|
||||
$this->key = $key;
|
||||
$this->secret = $secret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the basic string serialization of a token that a server
|
||||
* would respond to request_token and access_token calls with
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return sprintf(
|
||||
'oauth_token=%s&oauth_token_secret=%s',
|
||||
Util::urlencodeRfc3986($this->key),
|
||||
Util::urlencodeRfc3986($this->secret)
|
||||
);
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* The MIT License
|
||||
* Copyright (c) 2007 Andy Smith
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth;
|
||||
|
||||
class Token
|
||||
{
|
||||
/** @var string */
|
||||
public $key;
|
||||
/** @var string */
|
||||
public $secret;
|
||||
|
||||
/**
|
||||
* @param string $key The OAuth Token
|
||||
* @param string $secret The OAuth Token Secret
|
||||
*/
|
||||
public function __construct(?string $key, ?string $secret)
|
||||
{
|
||||
$this->key = $key;
|
||||
$this->secret = $secret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the basic string serialization of a token that a server
|
||||
* would respond to request_token and access_token calls with
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return sprintf(
|
||||
'oauth_token=%s&oauth_token_secret=%s',
|
||||
Util::urlencodeRfc3986($this->key),
|
||||
Util::urlencodeRfc3986($this->secret)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
1454
vendor/abraham/twitteroauth/src/TwitterOAuth.php
vendored
1454
vendor/abraham/twitteroauth/src/TwitterOAuth.php
vendored
File diff suppressed because it is too large
Load diff
|
@ -1,12 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth;
|
||||
|
||||
/**
|
||||
* @author Abraham Williams <abraham@abrah.am>
|
||||
*/
|
||||
class TwitterOAuthException extends \Exception
|
||||
{
|
||||
}
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth;
|
||||
|
||||
/**
|
||||
* @author Abraham Williams <abraham@abrah.am>
|
||||
*/
|
||||
class TwitterOAuthException extends \Exception
|
||||
{
|
||||
}
|
||||
|
|
244
vendor/abraham/twitteroauth/src/Util.php
vendored
244
vendor/abraham/twitteroauth/src/Util.php
vendored
|
@ -1,122 +1,122 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* The MIT License
|
||||
* Copyright (c) 2007 Andy Smith
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth;
|
||||
|
||||
class Util
|
||||
{
|
||||
/**
|
||||
* @param mixed $input
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function urlencodeRfc3986($input)
|
||||
{
|
||||
$output = '';
|
||||
if (is_array($input)) {
|
||||
$output = array_map(
|
||||
[__NAMESPACE__ . '\Util', 'urlencodeRfc3986'],
|
||||
$input
|
||||
);
|
||||
} elseif (is_scalar($input)) {
|
||||
$output = rawurlencode((string) $input);
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function urldecodeRfc3986($string): string
|
||||
{
|
||||
return urldecode($string);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function takes a input like a=b&a=c&d=e and returns the parsed
|
||||
* parameters like this
|
||||
* array('a' => array('b','c'), 'd' => 'e')
|
||||
*
|
||||
* @param string $input
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function parseParameters($input): array
|
||||
{
|
||||
if (!is_string($input)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$pairs = explode('&', $input);
|
||||
|
||||
$parameters = [];
|
||||
foreach ($pairs as $pair) {
|
||||
$split = explode('=', $pair, 2);
|
||||
$parameter = Util::urldecodeRfc3986($split[0]);
|
||||
$value = isset($split[1]) ? Util::urldecodeRfc3986($split[1]) : '';
|
||||
|
||||
if (isset($parameters[$parameter])) {
|
||||
// We have already recieved parameter(s) with this name, so add to the list
|
||||
// of parameters with this name
|
||||
|
||||
if (is_scalar($parameters[$parameter])) {
|
||||
// This is the first duplicate, so transform scalar (string) into an array
|
||||
// so we can add the duplicates
|
||||
$parameters[$parameter] = [$parameters[$parameter]];
|
||||
}
|
||||
|
||||
$parameters[$parameter][] = $value;
|
||||
} else {
|
||||
$parameters[$parameter] = $value;
|
||||
}
|
||||
}
|
||||
return $parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function buildHttpQuery(array $params): string
|
||||
{
|
||||
if (empty($params)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
// Urlencode both keys and values
|
||||
$keys = Util::urlencodeRfc3986(array_keys($params));
|
||||
$values = Util::urlencodeRfc3986(array_values($params));
|
||||
$params = array_combine($keys, $values);
|
||||
|
||||
// Parameters are sorted by name, using lexicographical byte value ordering.
|
||||
// Ref: Spec: 9.1.1 (1)
|
||||
uksort($params, 'strcmp');
|
||||
|
||||
$pairs = [];
|
||||
foreach ($params as $parameter => $value) {
|
||||
if (is_array($value)) {
|
||||
// If two or more parameters share the same name, they are sorted by their value
|
||||
// Ref: Spec: 9.1.1 (1)
|
||||
// June 12th, 2010 - changed to sort because of issue 164 by hidetaka
|
||||
sort($value, SORT_STRING);
|
||||
foreach ($value as $duplicateValue) {
|
||||
$pairs[] = $parameter . '=' . $duplicateValue;
|
||||
}
|
||||
} else {
|
||||
$pairs[] = $parameter . '=' . $value;
|
||||
}
|
||||
}
|
||||
// For each parameter, the name is separated from the corresponding value by an '=' character (ASCII code 61)
|
||||
// Each name-value pair is separated by an '&' character (ASCII code 38)
|
||||
return implode('&', $pairs);
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* The MIT License
|
||||
* Copyright (c) 2007 Andy Smith
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth;
|
||||
|
||||
class Util
|
||||
{
|
||||
/**
|
||||
* @param mixed $input
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function urlencodeRfc3986($input)
|
||||
{
|
||||
$output = '';
|
||||
if (is_array($input)) {
|
||||
$output = array_map(
|
||||
[__NAMESPACE__ . '\Util', 'urlencodeRfc3986'],
|
||||
$input
|
||||
);
|
||||
} elseif (is_scalar($input)) {
|
||||
$output = rawurlencode((string) $input);
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function urldecodeRfc3986($string): string
|
||||
{
|
||||
return urldecode($string);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function takes a input like a=b&a=c&d=e and returns the parsed
|
||||
* parameters like this
|
||||
* array('a' => array('b','c'), 'd' => 'e')
|
||||
*
|
||||
* @param string $input
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function parseParameters($input): array
|
||||
{
|
||||
if (!is_string($input)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$pairs = explode('&', $input);
|
||||
|
||||
$parameters = [];
|
||||
foreach ($pairs as $pair) {
|
||||
$split = explode('=', $pair, 2);
|
||||
$parameter = Util::urldecodeRfc3986($split[0]);
|
||||
$value = isset($split[1]) ? Util::urldecodeRfc3986($split[1]) : '';
|
||||
|
||||
if (isset($parameters[$parameter])) {
|
||||
// We have already recieved parameter(s) with this name, so add to the list
|
||||
// of parameters with this name
|
||||
|
||||
if (is_scalar($parameters[$parameter])) {
|
||||
// This is the first duplicate, so transform scalar (string) into an array
|
||||
// so we can add the duplicates
|
||||
$parameters[$parameter] = [$parameters[$parameter]];
|
||||
}
|
||||
|
||||
$parameters[$parameter][] = $value;
|
||||
} else {
|
||||
$parameters[$parameter] = $value;
|
||||
}
|
||||
}
|
||||
return $parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function buildHttpQuery(array $params): string
|
||||
{
|
||||
if (empty($params)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
// Urlencode both keys and values
|
||||
$keys = Util::urlencodeRfc3986(array_keys($params));
|
||||
$values = Util::urlencodeRfc3986(array_values($params));
|
||||
$params = array_combine($keys, $values);
|
||||
|
||||
// Parameters are sorted by name, using lexicographical byte value ordering.
|
||||
// Ref: Spec: 9.1.1 (1)
|
||||
uksort($params, 'strcmp');
|
||||
|
||||
$pairs = [];
|
||||
foreach ($params as $parameter => $value) {
|
||||
if (is_array($value)) {
|
||||
// If two or more parameters share the same name, they are sorted by their value
|
||||
// Ref: Spec: 9.1.1 (1)
|
||||
// June 12th, 2010 - changed to sort because of issue 164 by hidetaka
|
||||
sort($value, SORT_STRING);
|
||||
foreach ($value as $duplicateValue) {
|
||||
$pairs[] = $parameter . '=' . $duplicateValue;
|
||||
}
|
||||
} else {
|
||||
$pairs[] = $parameter . '=' . $value;
|
||||
}
|
||||
}
|
||||
// For each parameter, the name is separated from the corresponding value by an '=' character (ASCII code 61)
|
||||
// Each name-value pair is separated by an '&' character (ASCII code 38)
|
||||
return implode('&', $pairs);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace Abraham\TwitterOAuth\Util;
|
||||
|
||||
/**
|
||||
* @author louis <louis@systemli.org>
|
||||
*/
|
||||
class JsonDecoder
|
||||
{
|
||||
/**
|
||||
* Decodes a JSON string to stdObject or associative array
|
||||
*
|
||||
* @param string $string
|
||||
* @param bool $asArray
|
||||
*
|
||||
* @return array|object
|
||||
*/
|
||||
public static function decode(string $string, bool $asArray)
|
||||
{
|
||||
if (
|
||||
version_compare(PHP_VERSION, '5.4.0', '>=') &&
|
||||
!(defined('JSON_C_VERSION') && PHP_INT_SIZE > 4)
|
||||
) {
|
||||
return json_decode($string, $asArray, 512, JSON_BIGINT_AS_STRING);
|
||||
}
|
||||
|
||||
return json_decode($string, $asArray);
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace Abraham\TwitterOAuth\Util;
|
||||
|
||||
/**
|
||||
* @author louis <louis@systemli.org>
|
||||
*/
|
||||
class JsonDecoder
|
||||
{
|
||||
/**
|
||||
* Decodes a JSON string to stdObject or associative array
|
||||
*
|
||||
* @param string $string
|
||||
* @param bool $asArray
|
||||
*
|
||||
* @return array|object
|
||||
*/
|
||||
public static function decode(string $string, bool $asArray)
|
||||
{
|
||||
if (
|
||||
version_compare(PHP_VERSION, '5.4.0', '>=') &&
|
||||
!(defined('JSON_C_VERSION') && PHP_INT_SIZE > 4)
|
||||
) {
|
||||
return json_decode($string, $asArray, 512, JSON_BIGINT_AS_STRING);
|
||||
}
|
||||
|
||||
return json_decode($string, $asArray);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,60 +1,60 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth\Tests;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Abraham\TwitterOAuth\SignatureMethod;
|
||||
|
||||
abstract class AbstractSignatureMethodTest extends TestCase
|
||||
{
|
||||
protected $name;
|
||||
|
||||
/**
|
||||
* @return SignatureMethod
|
||||
*/
|
||||
abstract public function getClass();
|
||||
|
||||
abstract protected function signatureDataProvider();
|
||||
|
||||
public function testGetName()
|
||||
{
|
||||
$this->assertEquals($this->name, $this->getClass()->getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider signatureDataProvider
|
||||
*/
|
||||
public function testBuildSignature($expected, $request, $consumer, $token)
|
||||
{
|
||||
$this->assertEquals(
|
||||
$expected,
|
||||
$this->getClass()->buildSignature($request, $consumer, $token)
|
||||
);
|
||||
}
|
||||
|
||||
protected function getRequest()
|
||||
{
|
||||
return $this->getMockBuilder('Abraham\TwitterOAuth\Request')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
}
|
||||
|
||||
protected function getConsumer(
|
||||
$key = null,
|
||||
$secret = null,
|
||||
$callbackUrl = null
|
||||
) {
|
||||
return $this->getMockBuilder('Abraham\TwitterOAuth\Consumer')
|
||||
->setConstructorArgs([$key, $secret, $callbackUrl])
|
||||
->getMock();
|
||||
}
|
||||
|
||||
protected function getToken($key = null, $secret = null)
|
||||
{
|
||||
return $this->getMockBuilder('Abraham\TwitterOAuth\Token')
|
||||
->setConstructorArgs([$key, $secret])
|
||||
->getMock();
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth\Tests;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Abraham\TwitterOAuth\SignatureMethod;
|
||||
|
||||
abstract class AbstractSignatureMethodTest extends TestCase
|
||||
{
|
||||
protected $name;
|
||||
|
||||
/**
|
||||
* @return SignatureMethod
|
||||
*/
|
||||
abstract public function getClass();
|
||||
|
||||
abstract protected function signatureDataProvider();
|
||||
|
||||
public function testGetName()
|
||||
{
|
||||
$this->assertEquals($this->name, $this->getClass()->getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider signatureDataProvider
|
||||
*/
|
||||
public function testBuildSignature($expected, $request, $consumer, $token)
|
||||
{
|
||||
$this->assertEquals(
|
||||
$expected,
|
||||
$this->getClass()->buildSignature($request, $consumer, $token)
|
||||
);
|
||||
}
|
||||
|
||||
protected function getRequest()
|
||||
{
|
||||
return $this->getMockBuilder('Abraham\TwitterOAuth\Request')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
}
|
||||
|
||||
protected function getConsumer(
|
||||
$key = null,
|
||||
$secret = null,
|
||||
$callbackUrl = null
|
||||
) {
|
||||
return $this->getMockBuilder('Abraham\TwitterOAuth\Consumer')
|
||||
->setConstructorArgs([$key, $secret, $callbackUrl])
|
||||
->getMock();
|
||||
}
|
||||
|
||||
protected function getToken($key = null, $secret = null)
|
||||
{
|
||||
return $this->getMockBuilder('Abraham\TwitterOAuth\Token')
|
||||
->setConstructorArgs([$key, $secret])
|
||||
->getMock();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth\Tests;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Abraham\TwitterOAuth\Consumer;
|
||||
|
||||
class ConsumerTest extends TestCase
|
||||
{
|
||||
public function testToString()
|
||||
{
|
||||
$key = uniqid();
|
||||
$secret = uniqid();
|
||||
$consumer = new Consumer($key, $secret);
|
||||
|
||||
$this->assertEquals(
|
||||
"Consumer[key=$key,secret=$secret]",
|
||||
$consumer->__toString()
|
||||
);
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth\Tests;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Abraham\TwitterOAuth\Consumer;
|
||||
|
||||
class ConsumerTest extends TestCase
|
||||
{
|
||||
public function testToString()
|
||||
{
|
||||
$key = uniqid();
|
||||
$secret = uniqid();
|
||||
$consumer = new Consumer($key, $secret);
|
||||
|
||||
$this->assertEquals(
|
||||
"Consumer[key=$key,secret=$secret]",
|
||||
$consumer->__toString()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,47 +1,47 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth\Tests;
|
||||
|
||||
use Abraham\TwitterOAuth\HmacSha1;
|
||||
|
||||
class HmacSha1Test extends AbstractSignatureMethodTest
|
||||
{
|
||||
protected $name = 'HMAC-SHA1';
|
||||
|
||||
public function getClass()
|
||||
{
|
||||
return new HmacSha1();
|
||||
}
|
||||
|
||||
public function signatureDataProvider()
|
||||
{
|
||||
return [
|
||||
[
|
||||
'5CoEcoq7XoKFjwYCieQvuzadeUA=',
|
||||
$this->getRequest(),
|
||||
$this->getConsumer(),
|
||||
$this->getToken(),
|
||||
],
|
||||
[
|
||||
'EBw0gHngam3BTx8kfPfNNSyKem4=',
|
||||
$this->getRequest(),
|
||||
$this->getConsumer('key', 'secret'),
|
||||
$this->getToken(),
|
||||
],
|
||||
[
|
||||
'kDsHFZzws2a5M6cAQjfpdNBo+v8=',
|
||||
$this->getRequest(),
|
||||
$this->getConsumer('key', 'secret'),
|
||||
$this->getToken('key', 'secret'),
|
||||
],
|
||||
[
|
||||
'EBw0gHngam3BTx8kfPfNNSyKem4=',
|
||||
$this->getRequest(),
|
||||
$this->getConsumer('key', 'secret'),
|
||||
null,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth\Tests;
|
||||
|
||||
use Abraham\TwitterOAuth\HmacSha1;
|
||||
|
||||
class HmacSha1Test extends AbstractSignatureMethodTest
|
||||
{
|
||||
protected $name = 'HMAC-SHA1';
|
||||
|
||||
public function getClass()
|
||||
{
|
||||
return new HmacSha1();
|
||||
}
|
||||
|
||||
public function signatureDataProvider()
|
||||
{
|
||||
return [
|
||||
[
|
||||
'5CoEcoq7XoKFjwYCieQvuzadeUA=',
|
||||
$this->getRequest(),
|
||||
$this->getConsumer(),
|
||||
$this->getToken(),
|
||||
],
|
||||
[
|
||||
'EBw0gHngam3BTx8kfPfNNSyKem4=',
|
||||
$this->getRequest(),
|
||||
$this->getConsumer('key', 'secret'),
|
||||
$this->getToken(),
|
||||
],
|
||||
[
|
||||
'kDsHFZzws2a5M6cAQjfpdNBo+v8=',
|
||||
$this->getRequest(),
|
||||
$this->getConsumer('key', 'secret'),
|
||||
$this->getToken('key', 'secret'),
|
||||
],
|
||||
[
|
||||
'EBw0gHngam3BTx8kfPfNNSyKem4=',
|
||||
$this->getRequest(),
|
||||
$this->getConsumer('key', 'secret'),
|
||||
null,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
76
vendor/abraham/twitteroauth/tests/TokenTest.php
vendored
76
vendor/abraham/twitteroauth/tests/TokenTest.php
vendored
|
@ -1,38 +1,38 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth\Tests;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Abraham\TwitterOAuth\Token;
|
||||
|
||||
class TokenTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider tokenProvider
|
||||
*/
|
||||
public function testToString($expected, $key, $secret)
|
||||
{
|
||||
$token = new Token($key, $secret);
|
||||
|
||||
$this->assertEquals($expected, $token->__toString());
|
||||
}
|
||||
|
||||
public function tokenProvider()
|
||||
{
|
||||
return [
|
||||
['oauth_token=key&oauth_token_secret=secret', 'key', 'secret'],
|
||||
[
|
||||
'oauth_token=key%2Bkey&oauth_token_secret=secret',
|
||||
'key+key',
|
||||
'secret',
|
||||
],
|
||||
[
|
||||
'oauth_token=key~key&oauth_token_secret=secret',
|
||||
'key~key',
|
||||
'secret',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth\Tests;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Abraham\TwitterOAuth\Token;
|
||||
|
||||
class TokenTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider tokenProvider
|
||||
*/
|
||||
public function testToString($expected, $key, $secret)
|
||||
{
|
||||
$token = new Token($key, $secret);
|
||||
|
||||
$this->assertEquals($expected, $token->__toString());
|
||||
}
|
||||
|
||||
public function tokenProvider()
|
||||
{
|
||||
return [
|
||||
['oauth_token=key&oauth_token_secret=secret', 'key', 'secret'],
|
||||
[
|
||||
'oauth_token=key%2Bkey&oauth_token_secret=secret',
|
||||
'key+key',
|
||||
'secret',
|
||||
],
|
||||
[
|
||||
'oauth_token=key~key&oauth_token_secret=secret',
|
||||
'key~key',
|
||||
'secret',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,397 +1,397 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* WARNING: Running tests will post and delete through the actual Twitter account when updating or saving VCR cassettes.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth\Test;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Abraham\TwitterOAuth\TwitterOAuth;
|
||||
|
||||
class TwitterOAuthTest extends TestCase
|
||||
{
|
||||
/** @var TwitterOAuth */
|
||||
protected $twitter;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->twitter = new TwitterOAuth(
|
||||
CONSUMER_KEY,
|
||||
CONSUMER_SECRET,
|
||||
ACCESS_TOKEN,
|
||||
ACCESS_TOKEN_SECRET
|
||||
);
|
||||
$this->userId = explode('-', ACCESS_TOKEN)[0];
|
||||
}
|
||||
|
||||
public function testBuildClient()
|
||||
{
|
||||
$this->assertObjectHasAttribute('consumer', $this->twitter);
|
||||
$this->assertObjectHasAttribute('token', $this->twitter);
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testSetOauthToken.json
|
||||
*/
|
||||
public function testSetOauthToken()
|
||||
{
|
||||
$twitter = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
|
||||
$twitter->setOauthToken(ACCESS_TOKEN, ACCESS_TOKEN_SECRET);
|
||||
$this->assertObjectHasAttribute('consumer', $twitter);
|
||||
$this->assertObjectHasAttribute('token', $twitter);
|
||||
$twitter->get('friendships/show', [
|
||||
'target_screen_name' => 'twitterapi',
|
||||
]);
|
||||
$this->assertEquals(200, $twitter->getLastHttpCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testOauth2Token.json
|
||||
*/
|
||||
public function testOauth2Token()
|
||||
{
|
||||
$twitter = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
|
||||
$result = $twitter->oauth2('oauth2/token', [
|
||||
'grant_type' => 'client_credentials',
|
||||
]);
|
||||
$this->assertEquals(200, $twitter->getLastHttpCode());
|
||||
$this->assertObjectHasAttribute('token_type', $result);
|
||||
$this->assertObjectHasAttribute('access_token', $result);
|
||||
$this->assertEquals('bearer', $result->token_type);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testOauth2Token
|
||||
* @vcr testOauth2BearerToken.json
|
||||
*/
|
||||
public function testOauth2BearerToken($accessToken)
|
||||
{
|
||||
$twitter = new TwitterOAuth(
|
||||
CONSUMER_KEY,
|
||||
CONSUMER_SECRET,
|
||||
null,
|
||||
$accessToken->access_token
|
||||
);
|
||||
$result = $twitter->get('statuses/user_timeline', [
|
||||
'screen_name' => 'twitterapi',
|
||||
]);
|
||||
$this->assertEquals(200, $twitter->getLastHttpCode());
|
||||
return $accessToken;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testOauth2BearerToken
|
||||
* @vcr testOauth2TokenInvalidate.json
|
||||
*/
|
||||
public function testOauth2TokenInvalidate($accessToken)
|
||||
{
|
||||
$twitter = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
|
||||
// HACK: access_token is already urlencoded but gets urlencoded again breaking the invalidate request.
|
||||
$result = $twitter->oauth2('oauth2/invalidate_token', [
|
||||
'access_token' => urldecode($accessToken->access_token),
|
||||
]);
|
||||
$this->assertEquals(200, $twitter->getLastHttpCode());
|
||||
$this->assertObjectHasAttribute('access_token', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testOauthRequestToken.json
|
||||
*/
|
||||
public function testOauthRequestToken()
|
||||
{
|
||||
$twitter = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
|
||||
$result = $twitter->oauth('oauth/request_token', [
|
||||
'oauth_callback' => OAUTH_CALLBACK,
|
||||
]);
|
||||
$this->assertEquals(200, $twitter->getLastHttpCode());
|
||||
$this->assertArrayHasKey('oauth_token', $result);
|
||||
$this->assertArrayHasKey('oauth_token_secret', $result);
|
||||
$this->assertArrayHasKey('oauth_callback_confirmed', $result);
|
||||
$this->assertEquals('true', $result['oauth_callback_confirmed']);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testOauthRequestTokenException.json
|
||||
*/
|
||||
public function testOauthRequestTokenException()
|
||||
{
|
||||
$this->expectException(
|
||||
\Abraham\TwitterOAuth\TwitterOAuthException::class
|
||||
);
|
||||
$this->expectErrorMessage('Could not authenticate you');
|
||||
$twitter = new TwitterOAuth('CONSUMER_KEY', 'CONSUMER_SECRET');
|
||||
$result = $twitter->oauth('oauth/request_token', [
|
||||
'oauth_callback' => OAUTH_CALLBACK,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testOauthRequestToken
|
||||
* @vcr testOauthAccessTokenTokenException.json
|
||||
*/
|
||||
public function testOauthAccessTokenTokenException(array $requestToken)
|
||||
{
|
||||
// Can't test this without a browser logging into Twitter so check for the correct error instead.
|
||||
$this->expectException(
|
||||
\Abraham\TwitterOAuth\TwitterOAuthException::class
|
||||
);
|
||||
$this->expectErrorMessage('Invalid oauth_verifier parameter');
|
||||
$twitter = new TwitterOAuth(
|
||||
CONSUMER_KEY,
|
||||
CONSUMER_SECRET,
|
||||
$requestToken['oauth_token'],
|
||||
$requestToken['oauth_token_secret']
|
||||
);
|
||||
$twitter->oauth('oauth/access_token', [
|
||||
'oauth_verifier' => 'fake_oauth_verifier',
|
||||
]);
|
||||
}
|
||||
|
||||
public function testUrl()
|
||||
{
|
||||
$url = $this->twitter->url('oauth/authorize', [
|
||||
'foo' => 'bar',
|
||||
'baz' => 'qux',
|
||||
]);
|
||||
$this->assertEquals(
|
||||
'https://api.twitter.com/oauth/authorize?foo=bar&baz=qux',
|
||||
$url
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testGetAccountVerifyCredentials.json
|
||||
*/
|
||||
public function testGetAccountVerifyCredentials()
|
||||
{
|
||||
$user = $this->twitter->get('account/verify_credentials', [
|
||||
'include_entities' => false,
|
||||
'include_email' => true,
|
||||
]);
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
$this->assertObjectHasAttribute('email', $user);
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testSetProxy.json
|
||||
*/
|
||||
public function testSetProxy()
|
||||
{
|
||||
$this->twitter->setProxy([
|
||||
'CURLOPT_PROXY' => PROXY,
|
||||
'CURLOPT_PROXYUSERPWD' => PROXYUSERPWD,
|
||||
'CURLOPT_PROXYPORT' => PROXYPORT,
|
||||
]);
|
||||
$this->twitter->setTimeouts(60, 60);
|
||||
$result = $this->twitter->get('account/verify_credentials');
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
$this->assertObjectHasAttribute('id', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testGetStatusesMentionsTimeline.json
|
||||
*/
|
||||
public function testGetStatusesMentionsTimeline()
|
||||
{
|
||||
$this->twitter->get('statuses/mentions_timeline');
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testGetSearchTweets.json
|
||||
*/
|
||||
public function testGetSearchTweets()
|
||||
{
|
||||
$result = $this->twitter->get('search/tweets', ['q' => 'twitter']);
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
return $result->statuses;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testGetSearchTweets
|
||||
* @vcr testGetSearchTweetsWithMaxId.json
|
||||
*/
|
||||
public function testGetSearchTweetsWithMaxId($statuses)
|
||||
{
|
||||
$maxId = array_pop($statuses)->id_str;
|
||||
$this->twitter->get('search/tweets', [
|
||||
'q' => 'twitter',
|
||||
'max_id' => $maxId,
|
||||
]);
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testPostFavoritesCreate.json
|
||||
*/
|
||||
public function testPostFavoritesCreate()
|
||||
{
|
||||
$result = $this->twitter->post('favorites/create', [
|
||||
'id' => '6242973112',
|
||||
]);
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testPostFavoritesCreate
|
||||
* @vcr testPostFavoritesDestroy.json
|
||||
*/
|
||||
public function testPostFavoritesDestroy()
|
||||
{
|
||||
$this->twitter->post('favorites/destroy', ['id' => '6242973112']);
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testPostDirectMessagesEventsNew.json
|
||||
*/
|
||||
public function testPostDirectMessagesEventsNew()
|
||||
{
|
||||
$data = [
|
||||
'event' => [
|
||||
'type' => 'message_create',
|
||||
'message_create' => [
|
||||
'target' => [
|
||||
'recipient_id' => $this->userId,
|
||||
],
|
||||
'message_data' => [
|
||||
'text' => 'Hello World!',
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
$result = $this->twitter->post(
|
||||
'direct_messages/events/new',
|
||||
$data,
|
||||
true
|
||||
);
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testPostDirectMessagesEventsNew
|
||||
* @vcr testDeleteDirectMessagesEventsDestroy.json
|
||||
*/
|
||||
public function testDeleteDirectMessagesEventsDestroy($message)
|
||||
{
|
||||
$this->twitter->delete('direct_messages/events/destroy', [
|
||||
'id' => $message->event->id,
|
||||
]);
|
||||
$this->assertEquals(204, $this->twitter->getLastHttpCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testPostStatusesUpdateWithMedia.json
|
||||
*/
|
||||
public function testPostStatusesUpdateWithMedia()
|
||||
{
|
||||
$this->twitter->setTimeouts(60, 60);
|
||||
// Image source https://www.flickr.com/photos/titrans/8548825587/
|
||||
$file_path = __DIR__ . '/kitten.jpg';
|
||||
$result = $this->twitter->upload('media/upload', [
|
||||
'media' => $file_path,
|
||||
]);
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
$this->assertObjectHasAttribute('media_id_string', $result);
|
||||
$parameters = [
|
||||
'status' => 'Hello World ' . MOCK_TIME,
|
||||
'media_ids' => $result->media_id_string,
|
||||
];
|
||||
$result = $this->twitter->post('statuses/update', $parameters);
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
$result = $this->twitter->post('statuses/destroy/' . $result->id_str);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testPostStatusUpdateWithInvalidMediaThrowsException.json
|
||||
*/
|
||||
public function testPostStatusUpdateWithInvalidMediaThrowsException()
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$file_path = __DIR__ . '/12345678900987654321.jpg';
|
||||
$this->assertFalse(\is_readable($file_path));
|
||||
$result = $this->twitter->upload('media/upload', [
|
||||
'media' => $file_path,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testPostStatusesUpdateWithMediaChunked.json
|
||||
*/
|
||||
public function testPostStatusesUpdateWithMediaChunked()
|
||||
{
|
||||
$this->twitter->setTimeouts(60, 30);
|
||||
// Video source http://www.sample-videos.com/
|
||||
$file_path = __DIR__ . '/video.mp4';
|
||||
$result = $this->twitter->upload(
|
||||
'media/upload',
|
||||
['media' => $file_path, 'media_type' => 'video/mp4'],
|
||||
true
|
||||
);
|
||||
$this->assertEquals(201, $this->twitter->getLastHttpCode());
|
||||
$this->assertObjectHasAttribute('media_id_string', $result);
|
||||
$parameters = [
|
||||
'status' => 'Hello World ' . MOCK_TIME,
|
||||
'media_ids' => $result->media_id_string,
|
||||
];
|
||||
$result = $this->twitter->post('statuses/update', $parameters);
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
$result = $this->twitter->post('statuses/destroy/' . $result->id_str);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testPostStatusesUpdateUtf8.json
|
||||
*/
|
||||
public function testPostStatusesUpdateUtf8()
|
||||
{
|
||||
$result = $this->twitter->post('statuses/update', [
|
||||
'status' => 'xこんにちは世界 ' . MOCK_TIME,
|
||||
]);
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testPostStatusesUpdateUtf8
|
||||
* @vcr testPostStatusesDestroy.json
|
||||
*/
|
||||
public function testPostStatusesDestroy($status)
|
||||
{
|
||||
$this->twitter->post('statuses/destroy/' . $status->id_str);
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testLastResult.json
|
||||
*/
|
||||
public function testLastResult()
|
||||
{
|
||||
$this->twitter->get('search/tweets', ['q' => 'twitter']);
|
||||
$this->assertEquals('search/tweets', $this->twitter->getLastApiPath());
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
$this->assertObjectHasAttribute(
|
||||
'statuses',
|
||||
$this->twitter->getLastBody()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testLastResult
|
||||
* @vcr testResetLastResponse.json
|
||||
*/
|
||||
public function testResetLastResponse()
|
||||
{
|
||||
$this->twitter->resetLastResponse();
|
||||
$this->assertEquals('', $this->twitter->getLastApiPath());
|
||||
$this->assertEquals(0, $this->twitter->getLastHttpCode());
|
||||
$this->assertEquals([], $this->twitter->getLastBody());
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* WARNING: Running tests will post and delete through the actual Twitter account when updating or saving VCR cassettes.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth\Test;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Abraham\TwitterOAuth\TwitterOAuth;
|
||||
|
||||
class TwitterOAuthTest extends TestCase
|
||||
{
|
||||
/** @var TwitterOAuth */
|
||||
protected $twitter;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->twitter = new TwitterOAuth(
|
||||
CONSUMER_KEY,
|
||||
CONSUMER_SECRET,
|
||||
ACCESS_TOKEN,
|
||||
ACCESS_TOKEN_SECRET
|
||||
);
|
||||
$this->userId = explode('-', ACCESS_TOKEN)[0];
|
||||
}
|
||||
|
||||
public function testBuildClient()
|
||||
{
|
||||
$this->assertObjectHasAttribute('consumer', $this->twitter);
|
||||
$this->assertObjectHasAttribute('token', $this->twitter);
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testSetOauthToken.json
|
||||
*/
|
||||
public function testSetOauthToken()
|
||||
{
|
||||
$twitter = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
|
||||
$twitter->setOauthToken(ACCESS_TOKEN, ACCESS_TOKEN_SECRET);
|
||||
$this->assertObjectHasAttribute('consumer', $twitter);
|
||||
$this->assertObjectHasAttribute('token', $twitter);
|
||||
$twitter->get('friendships/show', [
|
||||
'target_screen_name' => 'twitterapi',
|
||||
]);
|
||||
$this->assertEquals(200, $twitter->getLastHttpCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testOauth2Token.json
|
||||
*/
|
||||
public function testOauth2Token()
|
||||
{
|
||||
$twitter = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
|
||||
$result = $twitter->oauth2('oauth2/token', [
|
||||
'grant_type' => 'client_credentials',
|
||||
]);
|
||||
$this->assertEquals(200, $twitter->getLastHttpCode());
|
||||
$this->assertObjectHasAttribute('token_type', $result);
|
||||
$this->assertObjectHasAttribute('access_token', $result);
|
||||
$this->assertEquals('bearer', $result->token_type);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testOauth2Token
|
||||
* @vcr testOauth2BearerToken.json
|
||||
*/
|
||||
public function testOauth2BearerToken($accessToken)
|
||||
{
|
||||
$twitter = new TwitterOAuth(
|
||||
CONSUMER_KEY,
|
||||
CONSUMER_SECRET,
|
||||
null,
|
||||
$accessToken->access_token
|
||||
);
|
||||
$result = $twitter->get('statuses/user_timeline', [
|
||||
'screen_name' => 'twitterapi',
|
||||
]);
|
||||
$this->assertEquals(200, $twitter->getLastHttpCode());
|
||||
return $accessToken;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testOauth2BearerToken
|
||||
* @vcr testOauth2TokenInvalidate.json
|
||||
*/
|
||||
public function testOauth2TokenInvalidate($accessToken)
|
||||
{
|
||||
$twitter = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
|
||||
// HACK: access_token is already urlencoded but gets urlencoded again breaking the invalidate request.
|
||||
$result = $twitter->oauth2('oauth2/invalidate_token', [
|
||||
'access_token' => urldecode($accessToken->access_token),
|
||||
]);
|
||||
$this->assertEquals(200, $twitter->getLastHttpCode());
|
||||
$this->assertObjectHasAttribute('access_token', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testOauthRequestToken.json
|
||||
*/
|
||||
public function testOauthRequestToken()
|
||||
{
|
||||
$twitter = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
|
||||
$result = $twitter->oauth('oauth/request_token', [
|
||||
'oauth_callback' => OAUTH_CALLBACK,
|
||||
]);
|
||||
$this->assertEquals(200, $twitter->getLastHttpCode());
|
||||
$this->assertArrayHasKey('oauth_token', $result);
|
||||
$this->assertArrayHasKey('oauth_token_secret', $result);
|
||||
$this->assertArrayHasKey('oauth_callback_confirmed', $result);
|
||||
$this->assertEquals('true', $result['oauth_callback_confirmed']);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testOauthRequestTokenException.json
|
||||
*/
|
||||
public function testOauthRequestTokenException()
|
||||
{
|
||||
$this->expectException(
|
||||
\Abraham\TwitterOAuth\TwitterOAuthException::class
|
||||
);
|
||||
$this->expectErrorMessage('Could not authenticate you');
|
||||
$twitter = new TwitterOAuth('CONSUMER_KEY', 'CONSUMER_SECRET');
|
||||
$result = $twitter->oauth('oauth/request_token', [
|
||||
'oauth_callback' => OAUTH_CALLBACK,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testOauthRequestToken
|
||||
* @vcr testOauthAccessTokenTokenException.json
|
||||
*/
|
||||
public function testOauthAccessTokenTokenException(array $requestToken)
|
||||
{
|
||||
// Can't test this without a browser logging into Twitter so check for the correct error instead.
|
||||
$this->expectException(
|
||||
\Abraham\TwitterOAuth\TwitterOAuthException::class
|
||||
);
|
||||
$this->expectErrorMessage('Invalid oauth_verifier parameter');
|
||||
$twitter = new TwitterOAuth(
|
||||
CONSUMER_KEY,
|
||||
CONSUMER_SECRET,
|
||||
$requestToken['oauth_token'],
|
||||
$requestToken['oauth_token_secret']
|
||||
);
|
||||
$twitter->oauth('oauth/access_token', [
|
||||
'oauth_verifier' => 'fake_oauth_verifier',
|
||||
]);
|
||||
}
|
||||
|
||||
public function testUrl()
|
||||
{
|
||||
$url = $this->twitter->url('oauth/authorize', [
|
||||
'foo' => 'bar',
|
||||
'baz' => 'qux',
|
||||
]);
|
||||
$this->assertEquals(
|
||||
'https://api.twitter.com/oauth/authorize?foo=bar&baz=qux',
|
||||
$url
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testGetAccountVerifyCredentials.json
|
||||
*/
|
||||
public function testGetAccountVerifyCredentials()
|
||||
{
|
||||
$user = $this->twitter->get('account/verify_credentials', [
|
||||
'include_entities' => false,
|
||||
'include_email' => true,
|
||||
]);
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
$this->assertObjectHasAttribute('email', $user);
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testSetProxy.json
|
||||
*/
|
||||
public function testSetProxy()
|
||||
{
|
||||
$this->twitter->setProxy([
|
||||
'CURLOPT_PROXY' => PROXY,
|
||||
'CURLOPT_PROXYUSERPWD' => PROXYUSERPWD,
|
||||
'CURLOPT_PROXYPORT' => PROXYPORT,
|
||||
]);
|
||||
$this->twitter->setTimeouts(60, 60);
|
||||
$result = $this->twitter->get('account/verify_credentials');
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
$this->assertObjectHasAttribute('id', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testGetStatusesMentionsTimeline.json
|
||||
*/
|
||||
public function testGetStatusesMentionsTimeline()
|
||||
{
|
||||
$this->twitter->get('statuses/mentions_timeline');
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testGetSearchTweets.json
|
||||
*/
|
||||
public function testGetSearchTweets()
|
||||
{
|
||||
$result = $this->twitter->get('search/tweets', ['q' => 'twitter']);
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
return $result->statuses;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testGetSearchTweets
|
||||
* @vcr testGetSearchTweetsWithMaxId.json
|
||||
*/
|
||||
public function testGetSearchTweetsWithMaxId($statuses)
|
||||
{
|
||||
$maxId = array_pop($statuses)->id_str;
|
||||
$this->twitter->get('search/tweets', [
|
||||
'q' => 'twitter',
|
||||
'max_id' => $maxId,
|
||||
]);
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testPostFavoritesCreate.json
|
||||
*/
|
||||
public function testPostFavoritesCreate()
|
||||
{
|
||||
$result = $this->twitter->post('favorites/create', [
|
||||
'id' => '6242973112',
|
||||
]);
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testPostFavoritesCreate
|
||||
* @vcr testPostFavoritesDestroy.json
|
||||
*/
|
||||
public function testPostFavoritesDestroy()
|
||||
{
|
||||
$this->twitter->post('favorites/destroy', ['id' => '6242973112']);
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testPostDirectMessagesEventsNew.json
|
||||
*/
|
||||
public function testPostDirectMessagesEventsNew()
|
||||
{
|
||||
$data = [
|
||||
'event' => [
|
||||
'type' => 'message_create',
|
||||
'message_create' => [
|
||||
'target' => [
|
||||
'recipient_id' => $this->userId,
|
||||
],
|
||||
'message_data' => [
|
||||
'text' => 'Hello World!',
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
$result = $this->twitter->post(
|
||||
'direct_messages/events/new',
|
||||
$data,
|
||||
true
|
||||
);
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testPostDirectMessagesEventsNew
|
||||
* @vcr testDeleteDirectMessagesEventsDestroy.json
|
||||
*/
|
||||
public function testDeleteDirectMessagesEventsDestroy($message)
|
||||
{
|
||||
$this->twitter->delete('direct_messages/events/destroy', [
|
||||
'id' => $message->event->id,
|
||||
]);
|
||||
$this->assertEquals(204, $this->twitter->getLastHttpCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testPostStatusesUpdateWithMedia.json
|
||||
*/
|
||||
public function testPostStatusesUpdateWithMedia()
|
||||
{
|
||||
$this->twitter->setTimeouts(60, 60);
|
||||
// Image source https://www.flickr.com/photos/titrans/8548825587/
|
||||
$file_path = __DIR__ . '/kitten.jpg';
|
||||
$result = $this->twitter->upload('media/upload', [
|
||||
'media' => $file_path,
|
||||
]);
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
$this->assertObjectHasAttribute('media_id_string', $result);
|
||||
$parameters = [
|
||||
'status' => 'Hello World ' . MOCK_TIME,
|
||||
'media_ids' => $result->media_id_string,
|
||||
];
|
||||
$result = $this->twitter->post('statuses/update', $parameters);
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
$result = $this->twitter->post('statuses/destroy/' . $result->id_str);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testPostStatusUpdateWithInvalidMediaThrowsException.json
|
||||
*/
|
||||
public function testPostStatusUpdateWithInvalidMediaThrowsException()
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$file_path = __DIR__ . '/12345678900987654321.jpg';
|
||||
$this->assertFalse(\is_readable($file_path));
|
||||
$result = $this->twitter->upload('media/upload', [
|
||||
'media' => $file_path,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testPostStatusesUpdateWithMediaChunked.json
|
||||
*/
|
||||
public function testPostStatusesUpdateWithMediaChunked()
|
||||
{
|
||||
$this->twitter->setTimeouts(60, 30);
|
||||
// Video source http://www.sample-videos.com/
|
||||
$file_path = __DIR__ . '/video.mp4';
|
||||
$result = $this->twitter->upload(
|
||||
'media/upload',
|
||||
['media' => $file_path, 'media_type' => 'video/mp4'],
|
||||
true
|
||||
);
|
||||
$this->assertEquals(201, $this->twitter->getLastHttpCode());
|
||||
$this->assertObjectHasAttribute('media_id_string', $result);
|
||||
$parameters = [
|
||||
'status' => 'Hello World ' . MOCK_TIME,
|
||||
'media_ids' => $result->media_id_string,
|
||||
];
|
||||
$result = $this->twitter->post('statuses/update', $parameters);
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
$result = $this->twitter->post('statuses/destroy/' . $result->id_str);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testPostStatusesUpdateUtf8.json
|
||||
*/
|
||||
public function testPostStatusesUpdateUtf8()
|
||||
{
|
||||
$result = $this->twitter->post('statuses/update', [
|
||||
'status' => 'xこんにちは世界 ' . MOCK_TIME,
|
||||
]);
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testPostStatusesUpdateUtf8
|
||||
* @vcr testPostStatusesDestroy.json
|
||||
*/
|
||||
public function testPostStatusesDestroy($status)
|
||||
{
|
||||
$this->twitter->post('statuses/destroy/' . $status->id_str);
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* @vcr testLastResult.json
|
||||
*/
|
||||
public function testLastResult()
|
||||
{
|
||||
$this->twitter->get('search/tweets', ['q' => 'twitter']);
|
||||
$this->assertEquals('search/tweets', $this->twitter->getLastApiPath());
|
||||
$this->assertEquals(200, $this->twitter->getLastHttpCode());
|
||||
$this->assertObjectHasAttribute(
|
||||
'statuses',
|
||||
$this->twitter->getLastBody()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testLastResult
|
||||
* @vcr testResetLastResponse.json
|
||||
*/
|
||||
public function testResetLastResponse()
|
||||
{
|
||||
$this->twitter->resetLastResponse();
|
||||
$this->assertEquals('', $this->twitter->getLastApiPath());
|
||||
$this->assertEquals(0, $this->twitter->getLastHttpCode());
|
||||
$this->assertEquals([], $this->twitter->getLastBody());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,54 +1,54 @@
|
|||
<?php
|
||||
|
||||
namespace Abraham\TwitterOAuth\Tests;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Abraham\TwitterOAuth\Util\JsonDecoder;
|
||||
|
||||
class JsonDecoderTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider jsonProvider
|
||||
*/
|
||||
public function testDecode($input, $asArray, $expected)
|
||||
{
|
||||
$this->assertEquals($expected, JsonDecoder::decode($input, $asArray));
|
||||
}
|
||||
|
||||
public function jsonProvider()
|
||||
{
|
||||
return [
|
||||
['[]', true, []],
|
||||
['[1,2,3]', true, [1, 2, 3]],
|
||||
[
|
||||
'[{"id": 556179961825226750}]',
|
||||
true,
|
||||
[['id' => 556179961825226750]],
|
||||
],
|
||||
['[]', false, []],
|
||||
['[1,2,3]', false, [1, 2, 3]],
|
||||
[
|
||||
'[{"id": 556179961825226750}]',
|
||||
false,
|
||||
[
|
||||
$this->getClass(function ($object) {
|
||||
$object->id = 556179961825226750;
|
||||
return $object;
|
||||
}),
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param callable $callable
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
private function getClass(\Closure $callable)
|
||||
{
|
||||
$object = new \stdClass();
|
||||
|
||||
return $callable($object);
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace Abraham\TwitterOAuth\Tests;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Abraham\TwitterOAuth\Util\JsonDecoder;
|
||||
|
||||
class JsonDecoderTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider jsonProvider
|
||||
*/
|
||||
public function testDecode($input, $asArray, $expected)
|
||||
{
|
||||
$this->assertEquals($expected, JsonDecoder::decode($input, $asArray));
|
||||
}
|
||||
|
||||
public function jsonProvider()
|
||||
{
|
||||
return [
|
||||
['[]', true, []],
|
||||
['[1,2,3]', true, [1, 2, 3]],
|
||||
[
|
||||
'[{"id": 556179961825226750}]',
|
||||
true,
|
||||
[['id' => 556179961825226750]],
|
||||
],
|
||||
['[]', false, []],
|
||||
['[1,2,3]', false, [1, 2, 3]],
|
||||
[
|
||||
'[{"id": 556179961825226750}]',
|
||||
false,
|
||||
[
|
||||
$this->getClass(function ($object) {
|
||||
$object->id = 556179961825226750;
|
||||
return $object;
|
||||
}),
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param callable $callable
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
private function getClass(\Closure $callable)
|
||||
{
|
||||
$object = new \stdClass();
|
||||
|
||||
return $callable($object);
|
||||
}
|
||||
}
|
||||
|
|
20
vendor/abraham/twitteroauth/tests/bootstrap.php
vendored
20
vendor/abraham/twitteroauth/tests/bootstrap.php
vendored
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
require 'vars.php';
|
||||
require 'mocks.php';
|
||||
|
||||
\VCR\VCR::configure()->setStorage('json');
|
||||
\VCR\VCR::turnOn();
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
require 'vars.php';
|
||||
require 'mocks.php';
|
||||
|
||||
\VCR\VCR::configure()->setStorage('json');
|
||||
\VCR\VCR::turnOn();
|
||||
|
|
|
@ -1,40 +1,40 @@
|
|||
[{
|
||||
"request": {
|
||||
"method": "DELETE",
|
||||
"url": "https:\/\/api.twitter.com\/1.1\/direct_messages\/events\/destroy.json?id=1254206523385032714",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"dY4KEaTg5Y6Bv4JlofNCjoArx%2F4%3D\"",
|
||||
"Expect": null
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "2",
|
||||
"code": "204",
|
||||
"message": ""
|
||||
},
|
||||
"headers": {
|
||||
"cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0",
|
||||
"content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=NVQWGYLXFVSG2%3D%3D%3D&ro=false;",
|
||||
"content-type": "text\/html;charset=utf-8",
|
||||
"date": "Sun, 26 Apr 2020 00:31:52 GMT",
|
||||
"expires": "Tue, 31 Mar 1981 05:00:00 GMT",
|
||||
"last-modified": "Sun, 26 Apr 2020 00:31:52 GMT",
|
||||
"pragma": "no-cache",
|
||||
"server": "tsa_b",
|
||||
"set-cookie": "personalization_id=\"v1_asAbLVWtv6V2+ARemo0VNA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:52 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111220677678; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:52 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None",
|
||||
"status": "204 No Content",
|
||||
"strict-transport-security": "max-age=631138519",
|
||||
"x-access-level": "read-write-directmessages",
|
||||
"x-connection-hash": "5cbff6bc4105c0040c4738daac7adcf4",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-frame-options": "SAMEORIGIN",
|
||||
"x-response-time": "37",
|
||||
"x-transaction": "00f02f6c00e12e76",
|
||||
"x-twitter-response-tags": "BouncerCompliant",
|
||||
"x-xss-protection": "0"
|
||||
}
|
||||
}
|
||||
[{
|
||||
"request": {
|
||||
"method": "DELETE",
|
||||
"url": "https:\/\/api.twitter.com\/1.1\/direct_messages\/events\/destroy.json?id=1254206523385032714",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"dY4KEaTg5Y6Bv4JlofNCjoArx%2F4%3D\"",
|
||||
"Expect": null
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "2",
|
||||
"code": "204",
|
||||
"message": ""
|
||||
},
|
||||
"headers": {
|
||||
"cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0",
|
||||
"content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=NVQWGYLXFVSG2%3D%3D%3D&ro=false;",
|
||||
"content-type": "text\/html;charset=utf-8",
|
||||
"date": "Sun, 26 Apr 2020 00:31:52 GMT",
|
||||
"expires": "Tue, 31 Mar 1981 05:00:00 GMT",
|
||||
"last-modified": "Sun, 26 Apr 2020 00:31:52 GMT",
|
||||
"pragma": "no-cache",
|
||||
"server": "tsa_b",
|
||||
"set-cookie": "personalization_id=\"v1_asAbLVWtv6V2+ARemo0VNA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:52 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111220677678; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:52 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None",
|
||||
"status": "204 No Content",
|
||||
"strict-transport-security": "max-age=631138519",
|
||||
"x-access-level": "read-write-directmessages",
|
||||
"x-connection-hash": "5cbff6bc4105c0040c4738daac7adcf4",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-frame-options": "SAMEORIGIN",
|
||||
"x-response-time": "37",
|
||||
"x-transaction": "00f02f6c00e12e76",
|
||||
"x-twitter-response-tags": "BouncerCompliant",
|
||||
"x-xss-protection": "0"
|
||||
}
|
||||
}
|
||||
}]
|
|
@ -1,46 +1,46 @@
|
|||
[{
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"url": "https:\/\/api.twitter.com\/1.1\/account\/verify_credentials.json?include_email=true&include_entities=false",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"k8h8edFh9R2W3DCNJy5Nb07tWo0%3D\"",
|
||||
"Expect": null
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "2",
|
||||
"code": "200",
|
||||
"message": ""
|
||||
},
|
||||
"headers": {
|
||||
"cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0",
|
||||
"content-disposition": "attachment; filename=json.json",
|
||||
"content-encoding": "gzip",
|
||||
"content-length": "773",
|
||||
"content-type": "application\/json;charset=utf-8",
|
||||
"date": "Sun, 26 Apr 2020 00:31:11 GMT",
|
||||
"expires": "Tue, 31 Mar 1981 05:00:00 GMT",
|
||||
"last-modified": "Sun, 26 Apr 2020 00:31:11 GMT",
|
||||
"pragma": "no-cache",
|
||||
"server": "tsa_b",
|
||||
"set-cookie": "personalization_id=\"v1_PPOKPD3f\/ek9QM3+ySQxjw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786107181888587; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None",
|
||||
"status": "200 OK",
|
||||
"strict-transport-security": "max-age=631138519",
|
||||
"x-access-level": "read-write-directmessages",
|
||||
"x-connection-hash": "7509696bc24b6d9d09d283b844a3c232",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-frame-options": "SAMEORIGIN",
|
||||
"x-rate-limit-limit": "75",
|
||||
"x-rate-limit-remaining": "73",
|
||||
"x-rate-limit-reset": "1587861613",
|
||||
"x-response-time": "46",
|
||||
"x-transaction": "00cd4f6300163d67",
|
||||
"x-twitter-response-tags": "BouncerExempt, BouncerCompliant",
|
||||
"x-xss-protection": "0"
|
||||
},
|
||||
"body": "{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":5,\"lang\":null,\"status\":{\"created_at\":\"Tue Dec 01 18:38:07 +0000 2009\",\"id\":6242973112,\"id_str\":\"6242973112\",\"text\":\"Test!\",\"truncated\":false,\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2258,\"favorite_count\":75,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\",\"suspended\":false,\"needs_phone_verification\":false,\"email\":\"4braham+oauthlibtest@gmail.com\"}"
|
||||
}
|
||||
[{
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"url": "https:\/\/api.twitter.com\/1.1\/account\/verify_credentials.json?include_email=true&include_entities=false",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"k8h8edFh9R2W3DCNJy5Nb07tWo0%3D\"",
|
||||
"Expect": null
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "2",
|
||||
"code": "200",
|
||||
"message": ""
|
||||
},
|
||||
"headers": {
|
||||
"cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0",
|
||||
"content-disposition": "attachment; filename=json.json",
|
||||
"content-encoding": "gzip",
|
||||
"content-length": "773",
|
||||
"content-type": "application\/json;charset=utf-8",
|
||||
"date": "Sun, 26 Apr 2020 00:31:11 GMT",
|
||||
"expires": "Tue, 31 Mar 1981 05:00:00 GMT",
|
||||
"last-modified": "Sun, 26 Apr 2020 00:31:11 GMT",
|
||||
"pragma": "no-cache",
|
||||
"server": "tsa_b",
|
||||
"set-cookie": "personalization_id=\"v1_PPOKPD3f\/ek9QM3+ySQxjw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786107181888587; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None",
|
||||
"status": "200 OK",
|
||||
"strict-transport-security": "max-age=631138519",
|
||||
"x-access-level": "read-write-directmessages",
|
||||
"x-connection-hash": "7509696bc24b6d9d09d283b844a3c232",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-frame-options": "SAMEORIGIN",
|
||||
"x-rate-limit-limit": "75",
|
||||
"x-rate-limit-remaining": "73",
|
||||
"x-rate-limit-reset": "1587861613",
|
||||
"x-response-time": "46",
|
||||
"x-transaction": "00cd4f6300163d67",
|
||||
"x-twitter-response-tags": "BouncerExempt, BouncerCompliant",
|
||||
"x-xss-protection": "0"
|
||||
},
|
||||
"body": "{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":5,\"lang\":null,\"status\":{\"created_at\":\"Tue Dec 01 18:38:07 +0000 2009\",\"id\":6242973112,\"id_str\":\"6242973112\",\"text\":\"Test!\",\"truncated\":false,\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2258,\"favorite_count\":75,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\",\"suspended\":false,\"needs_phone_verification\":false,\"email\":\"4braham+oauthlibtest@gmail.com\"}"
|
||||
}
|
||||
}]
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,46 +1,46 @@
|
|||
[{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "https:\/\/api.twitter.com\/oauth2\/token",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "Basic YXdKZk5ENHpGR2FwR09GS2Zkamc6TGZrbU5TUlBJWHdrUWtaVUI5RE5XU3p4NUxJYWl2U2tuVjRyeG5nb2pKYw==",
|
||||
"Expect": null
|
||||
},
|
||||
"body": "grant_type=client_credentials"
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "2",
|
||||
"code": "200",
|
||||
"message": ""
|
||||
},
|
||||
"headers": {
|
||||
"cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0",
|
||||
"content-disposition": "attachment; filename=json.json",
|
||||
"content-encoding": "gzip",
|
||||
"content-length": "152",
|
||||
"content-type": "application\/json;charset=utf-8",
|
||||
"date": "Sun, 26 Apr 2020 00:31:09 GMT",
|
||||
"expires": "Tue, 31 Mar 1981 05:00:00 GMT",
|
||||
"last-modified": "Sun, 26 Apr 2020 00:31:09 GMT",
|
||||
"ml": "A",
|
||||
"pragma": "no-cache",
|
||||
"server": "tsa_b",
|
||||
"set-cookie": "personalization_id=\"v1_NF00blSG9GZe8w8KpZvUDA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, guest_id=v1%3A158786106988547101; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None",
|
||||
"status": "200 OK",
|
||||
"strict-transport-security": "max-age=631138519",
|
||||
"x-connection-hash": "34e2373c53e7f9e0e80fe6af071dd6b8",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-frame-options": "DENY",
|
||||
"x-response-time": "20",
|
||||
"x-transaction": "007d4d19009f7a59",
|
||||
"x-tsa-request-body-time": "0",
|
||||
"x-twitter-response-tags": "BouncerCompliant",
|
||||
"x-ua-compatible": "IE=edge,chrome=1",
|
||||
"x-xss-protection": "0"
|
||||
},
|
||||
"body": "{\"token_type\":\"bearer\",\"access_token\":\"AAAAAAAAAAAAAAAAAAAAAFobAAAAAAAAjPes3FlPiFKh9HaIg%2Fw80waE0s8%3DQqxjhHDgZyjihGIK7olugzbpS0R1Gg8KNhzmer58a6oVbsSGc0\"}"
|
||||
}
|
||||
[{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "https:\/\/api.twitter.com\/oauth2\/token",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "Basic YXdKZk5ENHpGR2FwR09GS2Zkamc6TGZrbU5TUlBJWHdrUWtaVUI5RE5XU3p4NUxJYWl2U2tuVjRyeG5nb2pKYw==",
|
||||
"Expect": null
|
||||
},
|
||||
"body": "grant_type=client_credentials"
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "2",
|
||||
"code": "200",
|
||||
"message": ""
|
||||
},
|
||||
"headers": {
|
||||
"cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0",
|
||||
"content-disposition": "attachment; filename=json.json",
|
||||
"content-encoding": "gzip",
|
||||
"content-length": "152",
|
||||
"content-type": "application\/json;charset=utf-8",
|
||||
"date": "Sun, 26 Apr 2020 00:31:09 GMT",
|
||||
"expires": "Tue, 31 Mar 1981 05:00:00 GMT",
|
||||
"last-modified": "Sun, 26 Apr 2020 00:31:09 GMT",
|
||||
"ml": "A",
|
||||
"pragma": "no-cache",
|
||||
"server": "tsa_b",
|
||||
"set-cookie": "personalization_id=\"v1_NF00blSG9GZe8w8KpZvUDA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, guest_id=v1%3A158786106988547101; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None",
|
||||
"status": "200 OK",
|
||||
"strict-transport-security": "max-age=631138519",
|
||||
"x-connection-hash": "34e2373c53e7f9e0e80fe6af071dd6b8",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-frame-options": "DENY",
|
||||
"x-response-time": "20",
|
||||
"x-transaction": "007d4d19009f7a59",
|
||||
"x-tsa-request-body-time": "0",
|
||||
"x-twitter-response-tags": "BouncerCompliant",
|
||||
"x-ua-compatible": "IE=edge,chrome=1",
|
||||
"x-xss-protection": "0"
|
||||
},
|
||||
"body": "{\"token_type\":\"bearer\",\"access_token\":\"AAAAAAAAAAAAAAAAAAAAAFobAAAAAAAAjPes3FlPiFKh9HaIg%2Fw80waE0s8%3DQqxjhHDgZyjihGIK7olugzbpS0R1Gg8KNhzmer58a6oVbsSGc0\"}"
|
||||
}
|
||||
}]
|
|
@ -1,46 +1,46 @@
|
|||
[{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "https:\/\/api.twitter.com\/oauth2\/invalidate_token",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "Basic YXdKZk5ENHpGR2FwR09GS2Zkamc6TGZrbU5TUlBJWHdrUWtaVUI5RE5XU3p4NUxJYWl2U2tuVjRyeG5nb2pKYw==",
|
||||
"Expect": null
|
||||
},
|
||||
"body": "access_token=AAAAAAAAAAAAAAAAAAAAAFobAAAAAAAAjPes3FlPiFKh9HaIg%2Fw80waE0s8%3DQqxjhHDgZyjihGIK7olugzbpS0R1Gg8KNhzmer58a6oVbsSGc0"
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "2",
|
||||
"code": "200",
|
||||
"message": ""
|
||||
},
|
||||
"headers": {
|
||||
"cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0",
|
||||
"content-disposition": "attachment; filename=json.json",
|
||||
"content-encoding": "gzip",
|
||||
"content-length": "135",
|
||||
"content-type": "application\/json;charset=utf-8",
|
||||
"date": "Sun, 26 Apr 2020 00:31:10 GMT",
|
||||
"expires": "Tue, 31 Mar 1981 05:00:00 GMT",
|
||||
"last-modified": "Sun, 26 Apr 2020 00:31:10 GMT",
|
||||
"ml": "A",
|
||||
"pragma": "no-cache",
|
||||
"server": "tsa_b",
|
||||
"set-cookie": "personalization_id=\"v1_8Iv+DqoXk8DVAVDoUVltSA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, guest_id=v1%3A158786107054950627; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None",
|
||||
"status": "200 OK",
|
||||
"strict-transport-security": "max-age=631138519",
|
||||
"x-connection-hash": "18b7327592f746230c1c016c344dd14d",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-frame-options": "DENY",
|
||||
"x-response-time": "19",
|
||||
"x-transaction": "00c5257f00b7d371",
|
||||
"x-tsa-request-body-time": "0",
|
||||
"x-twitter-response-tags": "BouncerCompliant",
|
||||
"x-ua-compatible": "IE=edge,chrome=1",
|
||||
"x-xss-protection": "0"
|
||||
},
|
||||
"body": "{\"access_token\":\"AAAAAAAAAAAAAAAAAAAAAFobAAAAAAAAjPes3FlPiFKh9HaIg%2Fw80waE0s8%3DQqxjhHDgZyjihGIK7olugzbpS0R1Gg8KNhzmer58a6oVbsSGc0\"}"
|
||||
}
|
||||
[{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "https:\/\/api.twitter.com\/oauth2\/invalidate_token",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "Basic YXdKZk5ENHpGR2FwR09GS2Zkamc6TGZrbU5TUlBJWHdrUWtaVUI5RE5XU3p4NUxJYWl2U2tuVjRyeG5nb2pKYw==",
|
||||
"Expect": null
|
||||
},
|
||||
"body": "access_token=AAAAAAAAAAAAAAAAAAAAAFobAAAAAAAAjPes3FlPiFKh9HaIg%2Fw80waE0s8%3DQqxjhHDgZyjihGIK7olugzbpS0R1Gg8KNhzmer58a6oVbsSGc0"
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "2",
|
||||
"code": "200",
|
||||
"message": ""
|
||||
},
|
||||
"headers": {
|
||||
"cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0",
|
||||
"content-disposition": "attachment; filename=json.json",
|
||||
"content-encoding": "gzip",
|
||||
"content-length": "135",
|
||||
"content-type": "application\/json;charset=utf-8",
|
||||
"date": "Sun, 26 Apr 2020 00:31:10 GMT",
|
||||
"expires": "Tue, 31 Mar 1981 05:00:00 GMT",
|
||||
"last-modified": "Sun, 26 Apr 2020 00:31:10 GMT",
|
||||
"ml": "A",
|
||||
"pragma": "no-cache",
|
||||
"server": "tsa_b",
|
||||
"set-cookie": "personalization_id=\"v1_8Iv+DqoXk8DVAVDoUVltSA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, guest_id=v1%3A158786107054950627; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None",
|
||||
"status": "200 OK",
|
||||
"strict-transport-security": "max-age=631138519",
|
||||
"x-connection-hash": "18b7327592f746230c1c016c344dd14d",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-frame-options": "DENY",
|
||||
"x-response-time": "19",
|
||||
"x-transaction": "00c5257f00b7d371",
|
||||
"x-tsa-request-body-time": "0",
|
||||
"x-twitter-response-tags": "BouncerCompliant",
|
||||
"x-ua-compatible": "IE=edge,chrome=1",
|
||||
"x-xss-protection": "0"
|
||||
},
|
||||
"body": "{\"access_token\":\"AAAAAAAAAAAAAAAAAAAAAFobAAAAAAAAjPes3FlPiFKh9HaIg%2Fw80waE0s8%3DQqxjhHDgZyjihGIK7olugzbpS0R1Gg8KNhzmer58a6oVbsSGc0\"}"
|
||||
}
|
||||
}]
|
|
@ -1,45 +1,45 @@
|
|||
[{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "https:\/\/api.twitter.com\/oauth\/access_token",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"CE545gAAAAAAABtaAAABcbPlJBQ\", oauth_verifier=\"fake_oauth_verifier\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"0bcdtKs3nffzbE5abwaVjCI1HPw%3D\"",
|
||||
"Expect": null
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "2",
|
||||
"code": "401",
|
||||
"message": ""
|
||||
},
|
||||
"headers": {
|
||||
"cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0",
|
||||
"content-encoding": "gzip",
|
||||
"content-length": "93",
|
||||
"content-security-policy": "default-src 'none'; connect-src 'self'; font-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com data:; frame-src 'self' twitter:; img-src https:\/\/abs.twimg.com https:\/\/*.twimg.com https:\/\/pbs.twimg.com data:; media-src 'none'; object-src 'none'; script-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com https:\/\/twitter.com https:\/\/mobile.twitter.com; style-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=NVQWGYLXFVWG6Z3JNY%3D%3D%3D%3D%3D%3D&ro=false;",
|
||||
"content-type": "text\/html;charset=utf-8",
|
||||
"date": "Sun, 26 Apr 2020 00:31:11 GMT",
|
||||
"expires": "Tue, 31 Mar 1981 05:00:00 GMT",
|
||||
"last-modified": "Sun, 26 Apr 2020 00:31:11 GMT",
|
||||
"ml": "A",
|
||||
"pragma": "no-cache",
|
||||
"server": "tsa_b",
|
||||
"set-cookie": "personalization_id=\"v1_n0ZAgT2oLIc0HI23qMIGCA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, guest_id=v1%3A158786107147893563; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None",
|
||||
"status": "401 Unauthorized",
|
||||
"strict-transport-security": "max-age=631138519",
|
||||
"www-authenticate": "OAuth realm=\"https:\/\/api.twitter.com\"",
|
||||
"x-connection-hash": "90157d4bdfce3a9b90fd408819c767bc",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-frame-options": "SAMEORIGIN",
|
||||
"x-response-time": "41",
|
||||
"x-transaction": "0080cead006a758d",
|
||||
"x-twitter-response-tags": "BouncerCompliant",
|
||||
"x-ua-compatible": "IE=edge,chrome=1",
|
||||
"x-xss-protection": "0"
|
||||
},
|
||||
"body": "Error processing your OAuth request: Invalid oauth_verifier parameter"
|
||||
}
|
||||
[{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "https:\/\/api.twitter.com\/oauth\/access_token",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"CE545gAAAAAAABtaAAABcbPlJBQ\", oauth_verifier=\"fake_oauth_verifier\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"0bcdtKs3nffzbE5abwaVjCI1HPw%3D\"",
|
||||
"Expect": null
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "2",
|
||||
"code": "401",
|
||||
"message": ""
|
||||
},
|
||||
"headers": {
|
||||
"cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0",
|
||||
"content-encoding": "gzip",
|
||||
"content-length": "93",
|
||||
"content-security-policy": "default-src 'none'; connect-src 'self'; font-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com data:; frame-src 'self' twitter:; img-src https:\/\/abs.twimg.com https:\/\/*.twimg.com https:\/\/pbs.twimg.com data:; media-src 'none'; object-src 'none'; script-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com https:\/\/twitter.com https:\/\/mobile.twitter.com; style-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=NVQWGYLXFVWG6Z3JNY%3D%3D%3D%3D%3D%3D&ro=false;",
|
||||
"content-type": "text\/html;charset=utf-8",
|
||||
"date": "Sun, 26 Apr 2020 00:31:11 GMT",
|
||||
"expires": "Tue, 31 Mar 1981 05:00:00 GMT",
|
||||
"last-modified": "Sun, 26 Apr 2020 00:31:11 GMT",
|
||||
"ml": "A",
|
||||
"pragma": "no-cache",
|
||||
"server": "tsa_b",
|
||||
"set-cookie": "personalization_id=\"v1_n0ZAgT2oLIc0HI23qMIGCA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, guest_id=v1%3A158786107147893563; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None",
|
||||
"status": "401 Unauthorized",
|
||||
"strict-transport-security": "max-age=631138519",
|
||||
"www-authenticate": "OAuth realm=\"https:\/\/api.twitter.com\"",
|
||||
"x-connection-hash": "90157d4bdfce3a9b90fd408819c767bc",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-frame-options": "SAMEORIGIN",
|
||||
"x-response-time": "41",
|
||||
"x-transaction": "0080cead006a758d",
|
||||
"x-twitter-response-tags": "BouncerCompliant",
|
||||
"x-ua-compatible": "IE=edge,chrome=1",
|
||||
"x-xss-protection": "0"
|
||||
},
|
||||
"body": "Error processing your OAuth request: Invalid oauth_verifier parameter"
|
||||
}
|
||||
}]
|
|
@ -1,44 +1,44 @@
|
|||
[{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "https:\/\/api.twitter.com\/oauth\/request_token",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_callback=\"https%3A%2F%2Ftwitteroauth.com%2Fcallback.php\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"LR7ZVqY%2Fcdisw1w3zssKI6Yjbls%3D\"",
|
||||
"Expect": null
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "2",
|
||||
"code": "200",
|
||||
"message": ""
|
||||
},
|
||||
"headers": {
|
||||
"cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0",
|
||||
"content-encoding": "gzip",
|
||||
"content-length": "127",
|
||||
"content-security-policy": "default-src 'none'; connect-src 'self'; font-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com data:; frame-src 'self' twitter:; img-src https:\/\/abs.twimg.com https:\/\/*.twimg.com https:\/\/pbs.twimg.com data:; media-src 'none'; object-src 'none'; script-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com https:\/\/twitter.com https:\/\/mobile.twitter.com; style-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=NVQWGYLXFVWG6Z3JNY%3D%3D%3D%3D%3D%3D&ro=false;",
|
||||
"content-type": "text\/html;charset=utf-8",
|
||||
"date": "Sun, 26 Apr 2020 00:31:10 GMT",
|
||||
"expires": "Tue, 31 Mar 1981 05:00:00 GMT",
|
||||
"last-modified": "Sun, 26 Apr 2020 00:31:10 GMT",
|
||||
"ml": "A",
|
||||
"pragma": "no-cache",
|
||||
"server": "tsa_b",
|
||||
"set-cookie": "personalization_id=\"v1_mrnWVDThJvkLcAe4hmX0ng==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, guest_id=v1%3A158786107085601318; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None",
|
||||
"status": "200 OK",
|
||||
"strict-transport-security": "max-age=631138519",
|
||||
"x-connection-hash": "bf00d267c647790cd34d8cd4a28f9895",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-frame-options": "SAMEORIGIN",
|
||||
"x-response-time": "24",
|
||||
"x-transaction": "0095391f006dd965",
|
||||
"x-twitter-response-tags": "BouncerCompliant",
|
||||
"x-ua-compatible": "IE=edge,chrome=1",
|
||||
"x-xss-protection": "0"
|
||||
},
|
||||
"body": "oauth_token=CE545gAAAAAAABtaAAABcbPlJBQ&oauth_token_secret=tTVYBva8AlQu0JxVudzbf9oHXAbIARg5&oauth_callback_confirmed=true"
|
||||
}
|
||||
[{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "https:\/\/api.twitter.com\/oauth\/request_token",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_callback=\"https%3A%2F%2Ftwitteroauth.com%2Fcallback.php\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"LR7ZVqY%2Fcdisw1w3zssKI6Yjbls%3D\"",
|
||||
"Expect": null
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "2",
|
||||
"code": "200",
|
||||
"message": ""
|
||||
},
|
||||
"headers": {
|
||||
"cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0",
|
||||
"content-encoding": "gzip",
|
||||
"content-length": "127",
|
||||
"content-security-policy": "default-src 'none'; connect-src 'self'; font-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com data:; frame-src 'self' twitter:; img-src https:\/\/abs.twimg.com https:\/\/*.twimg.com https:\/\/pbs.twimg.com data:; media-src 'none'; object-src 'none'; script-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com https:\/\/twitter.com https:\/\/mobile.twitter.com; style-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=NVQWGYLXFVWG6Z3JNY%3D%3D%3D%3D%3D%3D&ro=false;",
|
||||
"content-type": "text\/html;charset=utf-8",
|
||||
"date": "Sun, 26 Apr 2020 00:31:10 GMT",
|
||||
"expires": "Tue, 31 Mar 1981 05:00:00 GMT",
|
||||
"last-modified": "Sun, 26 Apr 2020 00:31:10 GMT",
|
||||
"ml": "A",
|
||||
"pragma": "no-cache",
|
||||
"server": "tsa_b",
|
||||
"set-cookie": "personalization_id=\"v1_mrnWVDThJvkLcAe4hmX0ng==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, guest_id=v1%3A158786107085601318; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None",
|
||||
"status": "200 OK",
|
||||
"strict-transport-security": "max-age=631138519",
|
||||
"x-connection-hash": "bf00d267c647790cd34d8cd4a28f9895",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-frame-options": "SAMEORIGIN",
|
||||
"x-response-time": "24",
|
||||
"x-transaction": "0095391f006dd965",
|
||||
"x-twitter-response-tags": "BouncerCompliant",
|
||||
"x-ua-compatible": "IE=edge,chrome=1",
|
||||
"x-xss-protection": "0"
|
||||
},
|
||||
"body": "oauth_token=CE545gAAAAAAABtaAAABcbPlJBQ&oauth_token_secret=tTVYBva8AlQu0JxVudzbf9oHXAbIARg5&oauth_callback_confirmed=true"
|
||||
}
|
||||
}]
|
|
@ -1,43 +1,43 @@
|
|||
[{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "https:\/\/api.twitter.com\/oauth\/request_token",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"CONSUMER_KEY\", oauth_callback=\"https%3A%2F%2Ftwitteroauth.com%2Fcallback.php\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"wOUt6ZyVGpWnQhsHNWqcr%2BpOWAw%3D\"",
|
||||
"Expect": null
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "2",
|
||||
"code": "401",
|
||||
"message": ""
|
||||
},
|
||||
"headers": {
|
||||
"cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0",
|
||||
"content-disposition": "attachment; filename=json.json",
|
||||
"content-encoding": "gzip",
|
||||
"content-length": "89",
|
||||
"content-type": "application\/json; charset=utf-8",
|
||||
"date": "Sun, 26 Apr 2020 00:31:11 GMT",
|
||||
"expires": "Tue, 31 Mar 1981 05:00:00 GMT",
|
||||
"last-modified": "Sun, 26 Apr 2020 00:31:11 GMT",
|
||||
"pragma": "no-cache",
|
||||
"server": "tsa_b",
|
||||
"set-cookie": "personalization_id=\"v1_Vz8Os736+fzUwkQGIeIKuw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, guest_id=v1%3A158786107116335546; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None",
|
||||
"status": "401 Unauthorized",
|
||||
"strict-transport-security": "max-age=631138519",
|
||||
"www-authenticate": "OAuth realm=\"https:\/\/api.twitter.com\", api_error_code=32",
|
||||
"x-connection-hash": "d620dbb5b35e124662532c3ef8e89c88",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-frame-options": "SAMEORIGIN",
|
||||
"x-response-time": "6",
|
||||
"x-transaction": "00bf1248004cdafa",
|
||||
"x-twitter-response-tags": "BouncerCompliant",
|
||||
"x-xss-protection": "0"
|
||||
},
|
||||
"body": "{\"errors\":[{\"code\":32,\"message\":\"Could not authenticate you.\"}]}"
|
||||
}
|
||||
[{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "https:\/\/api.twitter.com\/oauth\/request_token",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"CONSUMER_KEY\", oauth_callback=\"https%3A%2F%2Ftwitteroauth.com%2Fcallback.php\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"wOUt6ZyVGpWnQhsHNWqcr%2BpOWAw%3D\"",
|
||||
"Expect": null
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "2",
|
||||
"code": "401",
|
||||
"message": ""
|
||||
},
|
||||
"headers": {
|
||||
"cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0",
|
||||
"content-disposition": "attachment; filename=json.json",
|
||||
"content-encoding": "gzip",
|
||||
"content-length": "89",
|
||||
"content-type": "application\/json; charset=utf-8",
|
||||
"date": "Sun, 26 Apr 2020 00:31:11 GMT",
|
||||
"expires": "Tue, 31 Mar 1981 05:00:00 GMT",
|
||||
"last-modified": "Sun, 26 Apr 2020 00:31:11 GMT",
|
||||
"pragma": "no-cache",
|
||||
"server": "tsa_b",
|
||||
"set-cookie": "personalization_id=\"v1_Vz8Os736+fzUwkQGIeIKuw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, guest_id=v1%3A158786107116335546; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None",
|
||||
"status": "401 Unauthorized",
|
||||
"strict-transport-security": "max-age=631138519",
|
||||
"www-authenticate": "OAuth realm=\"https:\/\/api.twitter.com\", api_error_code=32",
|
||||
"x-connection-hash": "d620dbb5b35e124662532c3ef8e89c88",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-frame-options": "SAMEORIGIN",
|
||||
"x-response-time": "6",
|
||||
"x-transaction": "00bf1248004cdafa",
|
||||
"x-twitter-response-tags": "BouncerCompliant",
|
||||
"x-xss-protection": "0"
|
||||
},
|
||||
"body": "{\"errors\":[{\"code\":32,\"message\":\"Could not authenticate you.\"}]}"
|
||||
}
|
||||
}]
|
|
@ -1,46 +1,46 @@
|
|||
[{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "https:\/\/api.twitter.com\/1.1\/direct_messages\/events\/new.json",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"3457NqeumGmcalZLF091L9lt7F8%3D\"",
|
||||
"Expect": null,
|
||||
"Content-type": "application\/json"
|
||||
},
|
||||
"body": "{\"event\":{\"type\":\"message_create\",\"message_create\":{\"target\":{\"recipient_id\":\"93915746\"},\"message_data\":{\"text\":\"Hello World!\"}}}}"
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "2",
|
||||
"code": "200",
|
||||
"message": ""
|
||||
},
|
||||
"headers": {
|
||||
"cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0",
|
||||
"content-disposition": "attachment; filename=json.json",
|
||||
"content-encoding": "gzip",
|
||||
"content-length": "206",
|
||||
"content-type": "application\/json;charset=utf-8",
|
||||
"date": "Sun, 26 Apr 2020 00:31:51 GMT",
|
||||
"expires": "Tue, 31 Mar 1981 05:00:00 GMT",
|
||||
"last-modified": "Sun, 26 Apr 2020 00:31:51 GMT",
|
||||
"pragma": "no-cache",
|
||||
"server": "tsa_b",
|
||||
"set-cookie": "personalization_id=\"v1_Tfqxs0gur2QR4FFIZ3Wq6w==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111185015666; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None",
|
||||
"status": "200 OK",
|
||||
"strict-transport-security": "max-age=631138519",
|
||||
"x-access-level": "read-write-directmessages",
|
||||
"x-connection-hash": "bb4f30d1c6406b2cd5d25f20fccfdc1a",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-frame-options": "SAMEORIGIN",
|
||||
"x-response-time": "70",
|
||||
"x-transaction": "0057fa4c00fb95a1",
|
||||
"x-tsa-request-body-time": "0",
|
||||
"x-twitter-response-tags": "BouncerCompliant",
|
||||
"x-xss-protection": "0"
|
||||
},
|
||||
"body": "{\"event\":{\"type\":\"message_create\",\"id\":\"1254206523385032714\",\"created_timestamp\":\"1587861111862\",\"message_create\":{\"target\":{\"recipient_id\":\"93915746\"},\"sender_id\":\"93915746\",\"message_data\":{\"text\":\"Hello World!\",\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]}}}}}"
|
||||
}
|
||||
[{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "https:\/\/api.twitter.com\/1.1\/direct_messages\/events\/new.json",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"3457NqeumGmcalZLF091L9lt7F8%3D\"",
|
||||
"Expect": null,
|
||||
"Content-type": "application\/json"
|
||||
},
|
||||
"body": "{\"event\":{\"type\":\"message_create\",\"message_create\":{\"target\":{\"recipient_id\":\"93915746\"},\"message_data\":{\"text\":\"Hello World!\"}}}}"
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "2",
|
||||
"code": "200",
|
||||
"message": ""
|
||||
},
|
||||
"headers": {
|
||||
"cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0",
|
||||
"content-disposition": "attachment; filename=json.json",
|
||||
"content-encoding": "gzip",
|
||||
"content-length": "206",
|
||||
"content-type": "application\/json;charset=utf-8",
|
||||
"date": "Sun, 26 Apr 2020 00:31:51 GMT",
|
||||
"expires": "Tue, 31 Mar 1981 05:00:00 GMT",
|
||||
"last-modified": "Sun, 26 Apr 2020 00:31:51 GMT",
|
||||
"pragma": "no-cache",
|
||||
"server": "tsa_b",
|
||||
"set-cookie": "personalization_id=\"v1_Tfqxs0gur2QR4FFIZ3Wq6w==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111185015666; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None",
|
||||
"status": "200 OK",
|
||||
"strict-transport-security": "max-age=631138519",
|
||||
"x-access-level": "read-write-directmessages",
|
||||
"x-connection-hash": "bb4f30d1c6406b2cd5d25f20fccfdc1a",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-frame-options": "SAMEORIGIN",
|
||||
"x-response-time": "70",
|
||||
"x-transaction": "0057fa4c00fb95a1",
|
||||
"x-tsa-request-body-time": "0",
|
||||
"x-twitter-response-tags": "BouncerCompliant",
|
||||
"x-xss-protection": "0"
|
||||
},
|
||||
"body": "{\"event\":{\"type\":\"message_create\",\"id\":\"1254206523385032714\",\"created_timestamp\":\"1587861111862\",\"message_create\":{\"target\":{\"recipient_id\":\"93915746\"},\"sender_id\":\"93915746\",\"message_data\":{\"text\":\"Hello World!\",\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]}}}}}"
|
||||
}
|
||||
}]
|
|
@ -1,45 +1,45 @@
|
|||
[{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "https:\/\/api.twitter.com\/1.1\/favorites\/create.json",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"EA30eIQPgat0Aw%2F59GyltEiE4Xg%3D\"",
|
||||
"Expect": null
|
||||
},
|
||||
"body": "id=6242973112"
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "2",
|
||||
"code": "200",
|
||||
"message": ""
|
||||
},
|
||||
"headers": {
|
||||
"cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0",
|
||||
"content-disposition": "attachment; filename=json.json",
|
||||
"content-encoding": "gzip",
|
||||
"content-length": "755",
|
||||
"content-type": "application\/json;charset=utf-8",
|
||||
"date": "Sun, 26 Apr 2020 00:31:51 GMT",
|
||||
"expires": "Tue, 31 Mar 1981 05:00:00 GMT",
|
||||
"last-modified": "Sun, 26 Apr 2020 00:31:51 GMT",
|
||||
"pragma": "no-cache",
|
||||
"server": "tsa_b",
|
||||
"set-cookie": "personalization_id=\"v1_Jz87HIDSEIpDevFMBlDD7g==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111115490266; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None",
|
||||
"status": "200 OK",
|
||||
"strict-transport-security": "max-age=631138519",
|
||||
"x-access-level": "read-write-directmessages",
|
||||
"x-connection-hash": "7368af4d238e5c36df5379afb1bed3af",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-frame-options": "SAMEORIGIN",
|
||||
"x-response-time": "72",
|
||||
"x-transaction": "0012beac0086638b",
|
||||
"x-tsa-request-body-time": "0",
|
||||
"x-twitter-response-tags": "BouncerCompliant",
|
||||
"x-xss-protection": "0"
|
||||
},
|
||||
"body": "{\"created_at\":\"Tue Dec 01 18:38:07 +0000 2009\",\"id\":6242973112,\"id_str\":\"6242973112\",\"text\":\"Test!\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":1,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":5,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2258,\"favorite_count\":76,\"favorited\":true,\"retweeted\":false,\"lang\":\"en\"}"
|
||||
}
|
||||
[{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "https:\/\/api.twitter.com\/1.1\/favorites\/create.json",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"EA30eIQPgat0Aw%2F59GyltEiE4Xg%3D\"",
|
||||
"Expect": null
|
||||
},
|
||||
"body": "id=6242973112"
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "2",
|
||||
"code": "200",
|
||||
"message": ""
|
||||
},
|
||||
"headers": {
|
||||
"cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0",
|
||||
"content-disposition": "attachment; filename=json.json",
|
||||
"content-encoding": "gzip",
|
||||
"content-length": "755",
|
||||
"content-type": "application\/json;charset=utf-8",
|
||||
"date": "Sun, 26 Apr 2020 00:31:51 GMT",
|
||||
"expires": "Tue, 31 Mar 1981 05:00:00 GMT",
|
||||
"last-modified": "Sun, 26 Apr 2020 00:31:51 GMT",
|
||||
"pragma": "no-cache",
|
||||
"server": "tsa_b",
|
||||
"set-cookie": "personalization_id=\"v1_Jz87HIDSEIpDevFMBlDD7g==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111115490266; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None",
|
||||
"status": "200 OK",
|
||||
"strict-transport-security": "max-age=631138519",
|
||||
"x-access-level": "read-write-directmessages",
|
||||
"x-connection-hash": "7368af4d238e5c36df5379afb1bed3af",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-frame-options": "SAMEORIGIN",
|
||||
"x-response-time": "72",
|
||||
"x-transaction": "0012beac0086638b",
|
||||
"x-tsa-request-body-time": "0",
|
||||
"x-twitter-response-tags": "BouncerCompliant",
|
||||
"x-xss-protection": "0"
|
||||
},
|
||||
"body": "{\"created_at\":\"Tue Dec 01 18:38:07 +0000 2009\",\"id\":6242973112,\"id_str\":\"6242973112\",\"text\":\"Test!\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":1,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":5,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2258,\"favorite_count\":76,\"favorited\":true,\"retweeted\":false,\"lang\":\"en\"}"
|
||||
}
|
||||
}]
|
|
@ -1,45 +1,45 @@
|
|||
[{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "https:\/\/api.twitter.com\/1.1\/favorites\/destroy.json",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"w3Nti04O5BMi8bySXjmO8%2BW5Pus%3D\"",
|
||||
"Expect": null
|
||||
},
|
||||
"body": "id=6242973112"
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "2",
|
||||
"code": "200",
|
||||
"message": ""
|
||||
},
|
||||
"headers": {
|
||||
"cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0",
|
||||
"content-disposition": "attachment; filename=json.json",
|
||||
"content-encoding": "gzip",
|
||||
"content-length": "753",
|
||||
"content-type": "application\/json;charset=utf-8",
|
||||
"date": "Sun, 26 Apr 2020 00:31:51 GMT",
|
||||
"expires": "Tue, 31 Mar 1981 05:00:00 GMT",
|
||||
"last-modified": "Sun, 26 Apr 2020 00:31:51 GMT",
|
||||
"pragma": "no-cache",
|
||||
"server": "tsa_b",
|
||||
"set-cookie": "personalization_id=\"v1_s1J1pMUNrQO4\/v371oE9AQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111151392082; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None",
|
||||
"status": "200 OK",
|
||||
"strict-transport-security": "max-age=631138519",
|
||||
"x-access-level": "read-write-directmessages",
|
||||
"x-connection-hash": "a0dc865f09447e41b0d77e9eed981519",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-frame-options": "SAMEORIGIN",
|
||||
"x-response-time": "44",
|
||||
"x-transaction": "005d9083009bd4c9",
|
||||
"x-tsa-request-body-time": "0",
|
||||
"x-twitter-response-tags": "BouncerCompliant",
|
||||
"x-xss-protection": "0"
|
||||
},
|
||||
"body": "{\"created_at\":\"Tue Dec 01 18:38:07 +0000 2009\",\"id\":6242973112,\"id_str\":\"6242973112\",\"text\":\"Test!\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":5,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2258,\"favorite_count\":75,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"}"
|
||||
}
|
||||
[{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "https:\/\/api.twitter.com\/1.1\/favorites\/destroy.json",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"w3Nti04O5BMi8bySXjmO8%2BW5Pus%3D\"",
|
||||
"Expect": null
|
||||
},
|
||||
"body": "id=6242973112"
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "2",
|
||||
"code": "200",
|
||||
"message": ""
|
||||
},
|
||||
"headers": {
|
||||
"cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0",
|
||||
"content-disposition": "attachment; filename=json.json",
|
||||
"content-encoding": "gzip",
|
||||
"content-length": "753",
|
||||
"content-type": "application\/json;charset=utf-8",
|
||||
"date": "Sun, 26 Apr 2020 00:31:51 GMT",
|
||||
"expires": "Tue, 31 Mar 1981 05:00:00 GMT",
|
||||
"last-modified": "Sun, 26 Apr 2020 00:31:51 GMT",
|
||||
"pragma": "no-cache",
|
||||
"server": "tsa_b",
|
||||
"set-cookie": "personalization_id=\"v1_s1J1pMUNrQO4\/v371oE9AQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111151392082; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None",
|
||||
"status": "200 OK",
|
||||
"strict-transport-security": "max-age=631138519",
|
||||
"x-access-level": "read-write-directmessages",
|
||||
"x-connection-hash": "a0dc865f09447e41b0d77e9eed981519",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-frame-options": "SAMEORIGIN",
|
||||
"x-response-time": "44",
|
||||
"x-transaction": "005d9083009bd4c9",
|
||||
"x-tsa-request-body-time": "0",
|
||||
"x-twitter-response-tags": "BouncerCompliant",
|
||||
"x-xss-protection": "0"
|
||||
},
|
||||
"body": "{\"created_at\":\"Tue Dec 01 18:38:07 +0000 2009\",\"id\":6242973112,\"id_str\":\"6242973112\",\"text\":\"Test!\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":5,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2258,\"favorite_count\":75,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"}"
|
||||
}
|
||||
}]
|
|
@ -1,43 +1,43 @@
|
|||
[{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "https:\/\/api.twitter.com\/1.1\/statuses\/destroy\/1254206657548226561.json",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"kyOKi3x9Ar3foSG5%2BN9XzBbnIOw%3D\"",
|
||||
"Expect": null
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "2",
|
||||
"code": "200",
|
||||
"message": ""
|
||||
},
|
||||
"headers": {
|
||||
"cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0",
|
||||
"content-disposition": "attachment; filename=json.json",
|
||||
"content-encoding": "gzip",
|
||||
"content-length": "804",
|
||||
"content-type": "application\/json;charset=utf-8",
|
||||
"date": "Sun, 26 Apr 2020 00:32:24 GMT",
|
||||
"expires": "Tue, 31 Mar 1981 05:00:00 GMT",
|
||||
"last-modified": "Sun, 26 Apr 2020 00:32:24 GMT",
|
||||
"pragma": "no-cache",
|
||||
"server": "tsa_b",
|
||||
"set-cookie": "personalization_id=\"v1_juPKvfSeQeQoZAVeLglnhA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:24 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786114418847477; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:24 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None",
|
||||
"status": "200 OK",
|
||||
"strict-transport-security": "max-age=631138519",
|
||||
"x-access-level": "read-write-directmessages",
|
||||
"x-connection-hash": "f4375157b19d6cd139b9917a6d76d0b0",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-frame-options": "SAMEORIGIN",
|
||||
"x-response-time": "198",
|
||||
"x-transaction": "00f3e731001ccb87",
|
||||
"x-twitter-response-tags": "BouncerCompliant",
|
||||
"x-xss-protection": "0"
|
||||
},
|
||||
"body": "{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206657548226561,\"id_str\":\"1254206657548226561\",\"text\":\"x\\u3053\\u3093\\u306b\\u3061\\u306f\\u4e16\\u754c 1587861062\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/twitteroauth.com\\\" rel=\\\"nofollow\\\"\\u003eTwitterOAuth dev\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":6,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"ja\"}"
|
||||
}
|
||||
[{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "https:\/\/api.twitter.com\/1.1\/statuses\/destroy\/1254206657548226561.json",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"kyOKi3x9Ar3foSG5%2BN9XzBbnIOw%3D\"",
|
||||
"Expect": null
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "2",
|
||||
"code": "200",
|
||||
"message": ""
|
||||
},
|
||||
"headers": {
|
||||
"cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0",
|
||||
"content-disposition": "attachment; filename=json.json",
|
||||
"content-encoding": "gzip",
|
||||
"content-length": "804",
|
||||
"content-type": "application\/json;charset=utf-8",
|
||||
"date": "Sun, 26 Apr 2020 00:32:24 GMT",
|
||||
"expires": "Tue, 31 Mar 1981 05:00:00 GMT",
|
||||
"last-modified": "Sun, 26 Apr 2020 00:32:24 GMT",
|
||||
"pragma": "no-cache",
|
||||
"server": "tsa_b",
|
||||
"set-cookie": "personalization_id=\"v1_juPKvfSeQeQoZAVeLglnhA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:24 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786114418847477; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:24 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None",
|
||||
"status": "200 OK",
|
||||
"strict-transport-security": "max-age=631138519",
|
||||
"x-access-level": "read-write-directmessages",
|
||||
"x-connection-hash": "f4375157b19d6cd139b9917a6d76d0b0",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-frame-options": "SAMEORIGIN",
|
||||
"x-response-time": "198",
|
||||
"x-transaction": "00f3e731001ccb87",
|
||||
"x-twitter-response-tags": "BouncerCompliant",
|
||||
"x-xss-protection": "0"
|
||||
},
|
||||
"body": "{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206657548226561,\"id_str\":\"1254206657548226561\",\"text\":\"x\\u3053\\u3093\\u306b\\u3061\\u306f\\u4e16\\u754c 1587861062\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/twitteroauth.com\\\" rel=\\\"nofollow\\\"\\u003eTwitterOAuth dev\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":6,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"ja\"}"
|
||||
}
|
||||
}]
|
|
@ -1,45 +1,45 @@
|
|||
[{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "https:\/\/api.twitter.com\/1.1\/statuses\/update.json",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"zIzkM9jxroYElpL1fPTyYnYE%2Bys%3D\"",
|
||||
"Expect": null
|
||||
},
|
||||
"body": "status=x%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%E4%B8%96%E7%95%8C%201587861062"
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "2",
|
||||
"code": "200",
|
||||
"message": ""
|
||||
},
|
||||
"headers": {
|
||||
"cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0",
|
||||
"content-disposition": "attachment; filename=json.json",
|
||||
"content-encoding": "gzip",
|
||||
"content-length": "804",
|
||||
"content-type": "application\/json;charset=utf-8",
|
||||
"date": "Sun, 26 Apr 2020 00:32:23 GMT",
|
||||
"expires": "Tue, 31 Mar 1981 05:00:00 GMT",
|
||||
"last-modified": "Sun, 26 Apr 2020 00:32:23 GMT",
|
||||
"pragma": "no-cache",
|
||||
"server": "tsa_b",
|
||||
"set-cookie": "personalization_id=\"v1_8nFfK\/V8KyJDl1aminWCQw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:23 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786114384224672; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:23 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None",
|
||||
"status": "200 OK",
|
||||
"strict-transport-security": "max-age=631138519",
|
||||
"x-access-level": "read-write-directmessages",
|
||||
"x-connection-hash": "54c0be65e0c80b57d5b7c895e58061c8",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-frame-options": "SAMEORIGIN",
|
||||
"x-response-time": "55",
|
||||
"x-transaction": "00eb7dbc0057ef33",
|
||||
"x-tsa-request-body-time": "0",
|
||||
"x-twitter-response-tags": "BouncerCompliant",
|
||||
"x-xss-protection": "0"
|
||||
},
|
||||
"body": "{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206657548226561,\"id_str\":\"1254206657548226561\",\"text\":\"x\\u3053\\u3093\\u306b\\u3061\\u306f\\u4e16\\u754c 1587861062\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/twitteroauth.com\\\" rel=\\\"nofollow\\\"\\u003eTwitterOAuth dev\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":6,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"ja\"}"
|
||||
}
|
||||
[{
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"url": "https:\/\/api.twitter.com\/1.1\/statuses\/update.json",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"zIzkM9jxroYElpL1fPTyYnYE%2Bys%3D\"",
|
||||
"Expect": null
|
||||
},
|
||||
"body": "status=x%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%E4%B8%96%E7%95%8C%201587861062"
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "2",
|
||||
"code": "200",
|
||||
"message": ""
|
||||
},
|
||||
"headers": {
|
||||
"cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0",
|
||||
"content-disposition": "attachment; filename=json.json",
|
||||
"content-encoding": "gzip",
|
||||
"content-length": "804",
|
||||
"content-type": "application\/json;charset=utf-8",
|
||||
"date": "Sun, 26 Apr 2020 00:32:23 GMT",
|
||||
"expires": "Tue, 31 Mar 1981 05:00:00 GMT",
|
||||
"last-modified": "Sun, 26 Apr 2020 00:32:23 GMT",
|
||||
"pragma": "no-cache",
|
||||
"server": "tsa_b",
|
||||
"set-cookie": "personalization_id=\"v1_8nFfK\/V8KyJDl1aminWCQw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:23 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786114384224672; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:23 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None",
|
||||
"status": "200 OK",
|
||||
"strict-transport-security": "max-age=631138519",
|
||||
"x-access-level": "read-write-directmessages",
|
||||
"x-connection-hash": "54c0be65e0c80b57d5b7c895e58061c8",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-frame-options": "SAMEORIGIN",
|
||||
"x-response-time": "55",
|
||||
"x-transaction": "00eb7dbc0057ef33",
|
||||
"x-tsa-request-body-time": "0",
|
||||
"x-twitter-response-tags": "BouncerCompliant",
|
||||
"x-xss-protection": "0"
|
||||
},
|
||||
"body": "{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206657548226561,\"id_str\":\"1254206657548226561\",\"text\":\"x\\u3053\\u3093\\u306b\\u3061\\u306f\\u4e16\\u754c 1587861062\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/twitteroauth.com\\\" rel=\\\"nofollow\\\"\\u003eTwitterOAuth dev\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":6,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"ja\"}"
|
||||
}
|
||||
}]
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,46 +1,46 @@
|
|||
[{
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"url": "https:\/\/api.twitter.com\/1.1\/friendships\/show.json?target_screen_name=twitterapi",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"TzPCDLbvxIAlxBqg5Fpf4JZpFJo%3D\"",
|
||||
"Expect": null
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "2",
|
||||
"code": "200",
|
||||
"message": ""
|
||||
},
|
||||
"headers": {
|
||||
"cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0",
|
||||
"content-disposition": "attachment; filename=json.json",
|
||||
"content-encoding": "gzip",
|
||||
"content-length": "246",
|
||||
"content-type": "application\/json;charset=utf-8",
|
||||
"date": "Sun, 26 Apr 2020 00:31:09 GMT",
|
||||
"expires": "Tue, 31 Mar 1981 05:00:00 GMT",
|
||||
"last-modified": "Sun, 26 Apr 2020 00:31:09 GMT",
|
||||
"pragma": "no-cache",
|
||||
"server": "tsa_b",
|
||||
"set-cookie": "personalization_id=\"v1_1Yr9ogG1fxy1wdDOY63jAw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786106956820884; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None",
|
||||
"status": "200 OK",
|
||||
"strict-transport-security": "max-age=631138519",
|
||||
"x-access-level": "read-write-directmessages",
|
||||
"x-connection-hash": "e8b1e309982b5c1d1adedc814fa2e6c3",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-frame-options": "SAMEORIGIN",
|
||||
"x-rate-limit-limit": "180",
|
||||
"x-rate-limit-remaining": "178",
|
||||
"x-rate-limit-reset": "1587861610",
|
||||
"x-response-time": "20",
|
||||
"x-transaction": "0075ffd2008ff583",
|
||||
"x-twitter-response-tags": "BouncerCompliant",
|
||||
"x-xss-protection": "0"
|
||||
},
|
||||
"body": "{\"relationship\":{\"source\":{\"id\":93915746,\"id_str\":\"93915746\",\"screen_name\":\"oauthlibtest\",\"following\":false,\"followed_by\":false,\"live_following\":false,\"following_received\":false,\"following_requested\":false,\"notifications_enabled\":false,\"can_dm\":false,\"blocking\":false,\"blocked_by\":false,\"muting\":false,\"want_retweets\":false,\"all_replies\":false,\"marked_spam\":false},\"target\":{\"id\":6253282,\"id_str\":\"6253282\",\"screen_name\":\"TwitterAPI\",\"following\":false,\"followed_by\":false,\"following_received\":false,\"following_requested\":false}}}"
|
||||
}
|
||||
[{
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"url": "https:\/\/api.twitter.com\/1.1\/friendships\/show.json?target_screen_name=twitterapi",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"TzPCDLbvxIAlxBqg5Fpf4JZpFJo%3D\"",
|
||||
"Expect": null
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "2",
|
||||
"code": "200",
|
||||
"message": ""
|
||||
},
|
||||
"headers": {
|
||||
"cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0",
|
||||
"content-disposition": "attachment; filename=json.json",
|
||||
"content-encoding": "gzip",
|
||||
"content-length": "246",
|
||||
"content-type": "application\/json;charset=utf-8",
|
||||
"date": "Sun, 26 Apr 2020 00:31:09 GMT",
|
||||
"expires": "Tue, 31 Mar 1981 05:00:00 GMT",
|
||||
"last-modified": "Sun, 26 Apr 2020 00:31:09 GMT",
|
||||
"pragma": "no-cache",
|
||||
"server": "tsa_b",
|
||||
"set-cookie": "personalization_id=\"v1_1Yr9ogG1fxy1wdDOY63jAw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786106956820884; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None",
|
||||
"status": "200 OK",
|
||||
"strict-transport-security": "max-age=631138519",
|
||||
"x-access-level": "read-write-directmessages",
|
||||
"x-connection-hash": "e8b1e309982b5c1d1adedc814fa2e6c3",
|
||||
"x-content-type-options": "nosniff",
|
||||
"x-frame-options": "SAMEORIGIN",
|
||||
"x-rate-limit-limit": "180",
|
||||
"x-rate-limit-remaining": "178",
|
||||
"x-rate-limit-reset": "1587861610",
|
||||
"x-response-time": "20",
|
||||
"x-transaction": "0075ffd2008ff583",
|
||||
"x-twitter-response-tags": "BouncerCompliant",
|
||||
"x-xss-protection": "0"
|
||||
},
|
||||
"body": "{\"relationship\":{\"source\":{\"id\":93915746,\"id_str\":\"93915746\",\"screen_name\":\"oauthlibtest\",\"following\":false,\"followed_by\":false,\"live_following\":false,\"following_received\":false,\"following_requested\":false,\"notifications_enabled\":false,\"can_dm\":false,\"blocking\":false,\"blocked_by\":false,\"muting\":false,\"want_retweets\":false,\"all_replies\":false,\"marked_spam\":false},\"target\":{\"id\":6253282,\"id_str\":\"6253282\",\"screen_name\":\"TwitterAPI\",\"following\":false,\"followed_by\":false,\"following_received\":false,\"following_requested\":false}}}"
|
||||
}
|
||||
}]
|
|
@ -1,20 +1,20 @@
|
|||
[{
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"url": "https:\/\/api.twitter.com\/1.1\/account\/verify_credentials.json",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"ZN1bM0df5EPRy1d7oYcoZfj3Mpw%3D\"",
|
||||
"Expect": null
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "1.1",
|
||||
"code": "200",
|
||||
"message": "OK"
|
||||
},
|
||||
"body": "HTTP\/2 200 \r\ncache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0\r\ncontent-disposition: attachment; filename=json.json\r\ncontent-encoding: gzip\r\ncontent-length: 778\r\ncontent-type: application\/json;charset=utf-8\r\ndate: Sun, 26 Apr 2020 00:31:49 GMT\r\nexpires: Tue, 31 Mar 1981 05:00:00 GMT\r\nlast-modified: Sun, 26 Apr 2020 00:31:49 GMT\r\npragma: no-cache\r\nserver: tsa_a\r\nset-cookie: personalization_id=\"v1_hI7rl+lJjoy5n7HgyNo9LQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:49 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None\r\nset-cookie: lang=en; Path=\/\r\nset-cookie: guest_id=v1%3A158786110929931313; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:49 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None\r\nstatus: 200 OK\r\nstrict-transport-security: max-age=631138519\r\nx-access-level: read-write-directmessages\r\nx-connection-hash: 18e8b1b5df2ee964aebf8f85055ada9c\r\nx-content-type-options: nosniff\r\nx-frame-options: SAMEORIGIN\r\nx-rate-limit-limit: 75\r\nx-rate-limit-remaining: 72\r\nx-rate-limit-reset: 1587861178\r\nx-response-time: 34\r\nx-transaction: 00716cfd00f6fd8d\r\nx-twitter-response-tags: BouncerExempt\r\nx-twitter-response-tags: BouncerCompliant\r\nx-xss-protection: 0\r\n\r\n{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":1,\"lang\":null,\"status\":{\"created_at\":\"Tue Dec 01 18:38:07 +0000 2009\",\"id\":6242973112,\"id_str\":\"6242973112\",\"text\":\"Test!\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2258,\"favorite_count\":74,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\",\"suspended\":false,\"needs_phone_verification\":false}"
|
||||
}
|
||||
[{
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"url": "https:\/\/api.twitter.com\/1.1\/account\/verify_credentials.json",
|
||||
"headers": {
|
||||
"Host": "api.twitter.com",
|
||||
"Accept": "application\/json",
|
||||
"Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"ZN1bM0df5EPRy1d7oYcoZfj3Mpw%3D\"",
|
||||
"Expect": null
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": {
|
||||
"http_version": "1.1",
|
||||
"code": "200",
|
||||
"message": "OK"
|
||||
},
|
||||
"body": "HTTP\/2 200 \r\ncache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0\r\ncontent-disposition: attachment; filename=json.json\r\ncontent-encoding: gzip\r\ncontent-length: 778\r\ncontent-type: application\/json;charset=utf-8\r\ndate: Sun, 26 Apr 2020 00:31:49 GMT\r\nexpires: Tue, 31 Mar 1981 05:00:00 GMT\r\nlast-modified: Sun, 26 Apr 2020 00:31:49 GMT\r\npragma: no-cache\r\nserver: tsa_a\r\nset-cookie: personalization_id=\"v1_hI7rl+lJjoy5n7HgyNo9LQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:49 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None\r\nset-cookie: lang=en; Path=\/\r\nset-cookie: guest_id=v1%3A158786110929931313; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:49 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None\r\nstatus: 200 OK\r\nstrict-transport-security: max-age=631138519\r\nx-access-level: read-write-directmessages\r\nx-connection-hash: 18e8b1b5df2ee964aebf8f85055ada9c\r\nx-content-type-options: nosniff\r\nx-frame-options: SAMEORIGIN\r\nx-rate-limit-limit: 75\r\nx-rate-limit-remaining: 72\r\nx-rate-limit-reset: 1587861178\r\nx-response-time: 34\r\nx-transaction: 00716cfd00f6fd8d\r\nx-twitter-response-tags: BouncerExempt\r\nx-twitter-response-tags: BouncerCompliant\r\nx-xss-protection: 0\r\n\r\n{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":1,\"lang\":null,\"status\":{\"created_at\":\"Tue Dec 01 18:38:07 +0000 2009\",\"id\":6242973112,\"id_str\":\"6242973112\",\"text\":\"Test!\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2258,\"favorite_count\":74,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\",\"suspended\":false,\"needs_phone_verification\":false}"
|
||||
}
|
||||
}]
|
42
vendor/abraham/twitteroauth/tests/mocks.php
vendored
42
vendor/abraham/twitteroauth/tests/mocks.php
vendored
|
@ -1,21 +1,21 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth;
|
||||
|
||||
// Mock time and random values for consistent tests with VCR
|
||||
function time()
|
||||
{
|
||||
return MOCK_TIME;
|
||||
}
|
||||
|
||||
function microtime()
|
||||
{
|
||||
return 'FAKE_MICROTIME';
|
||||
}
|
||||
|
||||
function mt_rand()
|
||||
{
|
||||
return 123456789;
|
||||
}
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Abraham\TwitterOAuth;
|
||||
|
||||
// Mock time and random values for consistent tests with VCR
|
||||
function time()
|
||||
{
|
||||
return MOCK_TIME;
|
||||
}
|
||||
|
||||
function microtime()
|
||||
{
|
||||
return 'FAKE_MICROTIME';
|
||||
}
|
||||
|
||||
function mt_rand()
|
||||
{
|
||||
return 123456789;
|
||||
}
|
||||
|
|
64
vendor/abraham/twitteroauth/tests/vars.php
vendored
64
vendor/abraham/twitteroauth/tests/vars.php
vendored
|
@ -1,32 +1,32 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
// These keys have been revoked and are only valid for teh VCR cassettes.
|
||||
// To request new VCR cassettes please open an issue: https://github.com/abraham/twitteroauth/issues
|
||||
|
||||
// To update VCR cassettes
|
||||
// 1. Delete all `tests/fixtures/*` files
|
||||
// `rm tests/fixtures/*`
|
||||
// 2. Set application and suer authorization credentials below
|
||||
// 3. Set MOCK_TIME to current unix time
|
||||
// 4. Run PHPUnit tests
|
||||
// 5. Reset application credentials on Twitter dashboard
|
||||
// 6. Commit new cassettes and revoked credentials
|
||||
|
||||
// TwitterOAuth dev
|
||||
define('CONSUMER_KEY', 'awJfND4zFGapGOFKfdjg');
|
||||
define('CONSUMER_SECRET', 'LfkmNSRPIXwkQkZUB9DNWSzx5LIaivSknV4rxngojJc');
|
||||
define('OAUTH_CALLBACK', 'https://twitteroauth.com/callback.php');
|
||||
|
||||
// oauthlibtest
|
||||
define('ACCESS_TOKEN', '93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x');
|
||||
define('ACCESS_TOKEN_SECRET', 'vurSbgJw6nHvv7xBfqKnBLWEQekOi59KFkXDLiY3Vqn3u');
|
||||
|
||||
// Timestamp the VCR cassettes were last updated
|
||||
define('MOCK_TIME', 1587861062);
|
||||
|
||||
// https://free-proxy-list.net/
|
||||
define('PROXY', '12.218.209.130');
|
||||
define('PROXYUSERPWD', '');
|
||||
define('PROXYPORT', '53281');
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
// These keys have been revoked and are only valid for teh VCR cassettes.
|
||||
// To request new VCR cassettes please open an issue: https://github.com/abraham/twitteroauth/issues
|
||||
|
||||
// To update VCR cassettes
|
||||
// 1. Delete all `tests/fixtures/*` files
|
||||
// `rm tests/fixtures/*`
|
||||
// 2. Set application and suer authorization credentials below
|
||||
// 3. Set MOCK_TIME to current unix time
|
||||
// 4. Run PHPUnit tests
|
||||
// 5. Reset application credentials on Twitter dashboard
|
||||
// 6. Commit new cassettes and revoked credentials
|
||||
|
||||
// TwitterOAuth dev
|
||||
define('CONSUMER_KEY', 'awJfND4zFGapGOFKfdjg');
|
||||
define('CONSUMER_SECRET', 'LfkmNSRPIXwkQkZUB9DNWSzx5LIaivSknV4rxngojJc');
|
||||
define('OAUTH_CALLBACK', 'https://twitteroauth.com/callback.php');
|
||||
|
||||
// oauthlibtest
|
||||
define('ACCESS_TOKEN', '93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x');
|
||||
define('ACCESS_TOKEN_SECRET', 'vurSbgJw6nHvv7xBfqKnBLWEQekOi59KFkXDLiY3Vqn3u');
|
||||
|
||||
// Timestamp the VCR cassettes were last updated
|
||||
define('MOCK_TIME', 1587861062);
|
||||
|
||||
// https://free-proxy-list.net/
|
||||
define('PROXY', '12.218.209.130');
|
||||
define('PROXYUSERPWD', '');
|
||||
define('PROXYPORT', '53281');
|
||||
|
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
|
@ -4,4 +4,4 @@
|
|||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit51528b4a875f8e0aa6970f42ad88c832::getLoader();
|
||||
return ComposerAutoloaderInit4eca095a43f7c8c6d8c0f7669b7856c7::getLoader();
|
||||
|
|
116
vendor/aws/aws-crt-php/.clang-format
vendored
116
vendor/aws/aws-crt-php/.clang-format
vendored
|
@ -1,58 +1,58 @@
|
|||
---
|
||||
Language: Cpp
|
||||
# BasedOnStyle: Mozilla
|
||||
AlignAfterOpenBracket: AlwaysBreak
|
||||
AlignConsecutiveAssignments: false
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignEscapedNewlines: Right
|
||||
AlignOperands: true
|
||||
AlignTrailingComments: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: false
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: Inline
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
BinPackArguments: false
|
||||
BinPackParameters: false
|
||||
BreakBeforeBinaryOperators: None
|
||||
BreakBeforeBraces: Attach
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakStringLiterals: true
|
||||
ColumnLimit: 120
|
||||
ContinuationIndentWidth: 4
|
||||
DerivePointerAlignment: false
|
||||
IncludeBlocks: Preserve
|
||||
IndentCaseLabels: true
|
||||
IndentPPDirectives: AfterHash
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
MacroBlockBegin: ''
|
||||
MacroBlockEnd: ''
|
||||
MaxEmptyLinesToKeep: 1
|
||||
PenaltyBreakAssignment: 2
|
||||
PenaltyBreakBeforeFirstCallParameter: 19
|
||||
PenaltyBreakComment: 300
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyExcessCharacter: 1000000
|
||||
PenaltyReturnTypeOnItsOwnLine: 100000
|
||||
PointerAlignment: Right
|
||||
ReflowComments: true
|
||||
SortIncludes: true
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: Cpp11
|
||||
TabWidth: 4
|
||||
UseTab: Never
|
||||
...
|
||||
|
||||
---
|
||||
Language: Cpp
|
||||
# BasedOnStyle: Mozilla
|
||||
AlignAfterOpenBracket: AlwaysBreak
|
||||
AlignConsecutiveAssignments: false
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignEscapedNewlines: Right
|
||||
AlignOperands: true
|
||||
AlignTrailingComments: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: false
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: Inline
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
BinPackArguments: false
|
||||
BinPackParameters: false
|
||||
BreakBeforeBinaryOperators: None
|
||||
BreakBeforeBraces: Attach
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakStringLiterals: true
|
||||
ColumnLimit: 120
|
||||
ContinuationIndentWidth: 4
|
||||
DerivePointerAlignment: false
|
||||
IncludeBlocks: Preserve
|
||||
IndentCaseLabels: true
|
||||
IndentPPDirectives: AfterHash
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
MacroBlockBegin: ''
|
||||
MacroBlockEnd: ''
|
||||
MaxEmptyLinesToKeep: 1
|
||||
PenaltyBreakAssignment: 2
|
||||
PenaltyBreakBeforeFirstCallParameter: 19
|
||||
PenaltyBreakComment: 300
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyExcessCharacter: 1000000
|
||||
PenaltyReturnTypeOnItsOwnLine: 100000
|
||||
PointerAlignment: Right
|
||||
ReflowComments: true
|
||||
SortIncludes: true
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: Cpp11
|
||||
TabWidth: 4
|
||||
UseTab: Never
|
||||
...
|
||||
|
||||
|
|
8
vendor/aws/aws-crt-php/.clang-format-ignore
vendored
8
vendor/aws/aws-crt-php/.clang-format-ignore
vendored
|
@ -1,4 +1,4 @@
|
|||
# ignore generated files
|
||||
ext/api.h
|
||||
ext/*_arginfo.h
|
||||
src/api.h
|
||||
# ignore generated files
|
||||
ext/api.h
|
||||
ext/*_arginfo.h
|
||||
src/api.h
|
||||
|
|
36
vendor/aws/aws-crt-php/.github/ISSUE_TEMPLATE/---bug-report.md
vendored
Normal file
36
vendor/aws/aws-crt-php/.github/ISSUE_TEMPLATE/---bug-report.md
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
name: "\U0001F41B Bug report"
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: bug, needs-triage
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
Confirm by changing [ ] to [x] below to ensure that it's a bug:
|
||||
- [ ] I've gone though [Developer Guide](https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/welcome.html) and [API reference](http://sdk.amazonaws.com/cpp/api/LATEST/index.html)
|
||||
- [ ] I've searched for [previous similar issues](https://github.com/aws/aws-sdk-cpp/issues) and didn't find any solution
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**SDK version number**
|
||||
|
||||
**Platform/OS/Hardware/Device**
|
||||
What are you running the sdk on?
|
||||
|
||||
**To Reproduce (observed behavior)**
|
||||
Steps to reproduce the behavior (please share code)
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Logs/output**
|
||||
If applicable, add logs or error output.
|
||||
|
||||
*REMEMBER TO SANITIZE YOUR PERSONAL INFO*
|
||||
|
||||
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
20
vendor/aws/aws-crt-php/.github/ISSUE_TEMPLATE/---feature-request.md
vendored
Normal file
20
vendor/aws/aws-crt-php/.github/ISSUE_TEMPLATE/---feature-request.md
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
name: "\U0001F680 Feature request"
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: feature-request, needs-triage
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
23
vendor/aws/aws-crt-php/.github/ISSUE_TEMPLATE/---questions-help.md
vendored
Normal file
23
vendor/aws/aws-crt-php/.github/ISSUE_TEMPLATE/---questions-help.md
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
name: "\U0001F4AC Questions / Help"
|
||||
about: If you have questions, please check AWS Forums or StackOverflow
|
||||
title: ''
|
||||
labels: guidance, needs-triage
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
Confirm by changing [ ] to [x] below:
|
||||
- [ ] I've searched for [previous similar issues](https://github.com/awslabs/aws-crt-php/issues) and didn't find any solution
|
||||
|
||||
**Platform/OS/Hardware/Device**
|
||||
What are you running the sdk on?
|
||||
|
||||
**Describe the question**
|
||||
|
||||
|
||||
**Logs/output**
|
||||
If applicable, add logs or error output.
|
||||
|
||||
*REMEMBER TO SANITIZE YOUR PERSONAL INFO*
|
||||
|
6
vendor/aws/aws-crt-php/.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
6
vendor/aws/aws-crt-php/.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
*Issue #, if available:*
|
||||
|
||||
*Description of changes:*
|
||||
|
||||
|
||||
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
|
145
vendor/aws/aws-crt-php/.github/workflows/ci.yml
vendored
Normal file
145
vendor/aws/aws-crt-php/.github/workflows/ci.yml
vendored
Normal file
|
@ -0,0 +1,145 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '*'
|
||||
- '!main'
|
||||
|
||||
env:
|
||||
BUILDER_VERSION: v0.8.18
|
||||
BUILDER_SOURCE: releases
|
||||
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
|
||||
PACKAGE_NAME: aws-crt-php
|
||||
LINUX_BASE_IMAGE: ubuntu-16-x64
|
||||
RUN: ${{ github.run_id }}-${{ github.run_number }}
|
||||
|
||||
jobs:
|
||||
php-5_5-linux-x64:
|
||||
name: php-linux-x64 (5.5)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup PHP with Xdebug
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
coverage: xdebug
|
||||
php-version: 5.5
|
||||
ini-values: xdebug.overload_var_dump=0, memory_limit=4G, phar.readonly=false
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Install ancient PHPUnit
|
||||
run: composer require --dev --ignore-platform-reqs phpunit/phpunit "4.8.36"
|
||||
|
||||
- name: Install depedencies
|
||||
run: composer update --no-interaction
|
||||
|
||||
- name: Build for PHP 5.5
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
run: |
|
||||
phpize
|
||||
./configure
|
||||
make
|
||||
|
||||
php-linux-x64:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
version:
|
||||
- "5.6"
|
||||
- "7.0"
|
||||
- "7.1"
|
||||
- "7.2"
|
||||
- "7.3"
|
||||
- "7.4"
|
||||
- "8.0"
|
||||
steps:
|
||||
- name: Setup PHP with Xdebug
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
coverage: xdebug
|
||||
php-version: ${{matrix.version}}
|
||||
ini-values: xdebug.overload_var_dump=0, memory_limit=4G, phar.readonly=false
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Install depedencies
|
||||
run: composer update --no-interaction
|
||||
|
||||
- name: Run tests
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
run: |
|
||||
phpize
|
||||
./configure
|
||||
make
|
||||
make test
|
||||
|
||||
|
||||
# linux-arm:
|
||||
# name: ARM (${{ matrix.arch }})
|
||||
# runs-on: ubuntu-latest
|
||||
# strategy:
|
||||
# matrix:
|
||||
# arch: [armv6, armv7, arm64]
|
||||
# steps:
|
||||
# - name: Build ${{ env.PACKAGE_NAME }}
|
||||
# run: |
|
||||
# python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
|
||||
# chmod a+x builder
|
||||
# ./builder build -p ${{ env.PACKAGE_NAME }} --target=linux-${{ matrix.arch }} --spec=downstream
|
||||
|
||||
# windows-vc16:
|
||||
# runs-on: windows-latest
|
||||
# strategy:
|
||||
# matrix:
|
||||
# arch: [x64]
|
||||
# steps:
|
||||
# - uses: ilammy/msvc-dev-cmd@v1
|
||||
# with:
|
||||
# arch: ${{ matrix.arch }}
|
||||
# uwp: false
|
||||
# spectre: true
|
||||
# - name: Build ${{ env.PACKAGE_NAME }} + consumers
|
||||
# run: |
|
||||
# python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
|
||||
# python builder.pyz build -p ${{ env.PACKAGE_NAME }} --spec=downstream
|
||||
|
||||
# windows-vc14:
|
||||
# runs-on: windows-latest
|
||||
# strategy:
|
||||
# matrix:
|
||||
# arch: [x86, x64]
|
||||
# steps:
|
||||
# - uses: ilammy/msvc-dev-cmd@v1
|
||||
# with:
|
||||
# toolset: 14.0
|
||||
# arch: ${{ matrix.arch }}
|
||||
# uwp: false
|
||||
# spectre: true
|
||||
# - name: Build ${{ env.PACKAGE_NAME }} + consumers
|
||||
# run: |
|
||||
# python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
|
||||
# python builder.pyz build -p ${{ env.PACKAGE_NAME }} downstream
|
||||
|
||||
macos:
|
||||
runs-on: macos-${{ matrix.version }}
|
||||
strategy:
|
||||
matrix:
|
||||
version: [10.15]
|
||||
steps:
|
||||
- name: Build PHP 8 extension and test
|
||||
run: |
|
||||
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
|
||||
chmod a+x builder
|
||||
./builder build -p ${{ env.PACKAGE_NAME }} --spec=downstream
|
29
vendor/aws/aws-crt-php/.github/workflows/lint.yml
vendored
Normal file
29
vendor/aws/aws-crt-php/.github/workflows/lint.yml
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
name: Lint
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
clang-format:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Sources
|
||||
uses: actions/checkout@v1
|
||||
|
||||
- name: clang-format lint
|
||||
uses: DoozyX/clang-format-lint-action@v0.3.1
|
||||
with:
|
||||
# List of extensions to check
|
||||
extensions: c
|
||||
|
||||
check-submodules:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Source
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
fetch-depth: 0
|
||||
- name: Check Submodules
|
||||
uses: awslabs/aws-crt-builder/.github/actions/check-submodules@main
|
46
vendor/aws/aws-crt-php/.github/workflows/stale_issue.yml
vendored
Normal file
46
vendor/aws/aws-crt-php/.github/workflows/stale_issue.yml
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
name: "Close stale issues"
|
||||
|
||||
# Controls when the action will run.
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
|
||||
jobs:
|
||||
cleanup:
|
||||
runs-on: ubuntu-latest
|
||||
name: Stale issue job
|
||||
steps:
|
||||
- uses: aws-actions/stale-issue-cleanup@v3
|
||||
with:
|
||||
# Setting messages to an empty string will cause the automation to skip
|
||||
# that category
|
||||
ancient-issue-message: Greetings! Sorry to say but this is a very old issue that is probably not getting as much attention as it deservers. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to open a new one.
|
||||
stale-issue-message: Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one.
|
||||
stale-pr-message: Greetings! It looks like this PR hasn’t been active in longer than a week, add a comment or an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one.
|
||||
|
||||
# These labels are required
|
||||
stale-issue-label: closing-soon
|
||||
exempt-issue-label: automation-exempt
|
||||
stale-pr-label: closing-soon
|
||||
exempt-pr-label: pr/needs-review
|
||||
response-requested-label: response-requested
|
||||
|
||||
# Don't set closed-for-staleness label to skip closing very old issues
|
||||
# regardless of label
|
||||
closed-for-staleness-label: closed-for-staleness
|
||||
|
||||
# Issue timing
|
||||
days-before-stale: 7
|
||||
days-before-close: 4
|
||||
days-before-ancient: 365
|
||||
|
||||
# If you don't want to mark a issue as being ancient based on a
|
||||
# threshold of "upvotes", you can set this here. An "upvote" is
|
||||
# the total number of +1, heart, hooray, and rocket reactions
|
||||
# on an issue.
|
||||
minimum-upvotes-to-exempt: 1
|
||||
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
loglevel: DEBUG
|
||||
# Set dry-run to true to not perform label or close actions.
|
||||
dry-run: false
|
210
vendor/aws/aws-crt-php/.gitignore
vendored
Normal file
210
vendor/aws/aws-crt-php/.gitignore
vendored
Normal file
|
@ -0,0 +1,210 @@
|
|||
|
||||
# Created by https://www.toptal.com/developers/gitignore/api/autotools,cmake,phpstorm
|
||||
# Edit at https://www.toptal.com/developers/gitignore?templates=autotools,cmake,phpstorm
|
||||
|
||||
### Autotools ###
|
||||
# http://www.gnu.org/software/automake
|
||||
|
||||
Makefile.in
|
||||
/ar-lib
|
||||
/mdate-sh
|
||||
/py-compile
|
||||
/test-driver
|
||||
/ylwrap
|
||||
.deps/
|
||||
|
||||
# http://www.gnu.org/software/autoconf
|
||||
|
||||
autom4te.cache
|
||||
/autoscan.log
|
||||
/autoscan-*.log
|
||||
/aclocal.m4
|
||||
/compile
|
||||
/config.guess
|
||||
/config.h.in
|
||||
/config.log
|
||||
/config.status
|
||||
/config.sub
|
||||
/configure
|
||||
/configure.scan
|
||||
/depcomp
|
||||
/install-sh
|
||||
/missing
|
||||
/stamp-h1
|
||||
|
||||
# https://www.gnu.org/software/libtool/
|
||||
|
||||
/ltmain.sh
|
||||
|
||||
# http://www.gnu.org/software/texinfo
|
||||
|
||||
/texinfo.tex
|
||||
|
||||
# http://www.gnu.org/software/m4/
|
||||
|
||||
m4/libtool.m4
|
||||
m4/ltoptions.m4
|
||||
m4/ltsugar.m4
|
||||
m4/ltversion.m4
|
||||
m4/lt~obsolete.m4
|
||||
|
||||
# Generated Makefile
|
||||
# (meta build system like autotools,
|
||||
# can automatically generate from config.status script
|
||||
# (which is called by configure script))
|
||||
Makefile
|
||||
|
||||
### Autotools Patch ###
|
||||
|
||||
### CMake ###
|
||||
CMakeLists.txt.user
|
||||
CMakeCache.txt
|
||||
CMakeFiles
|
||||
CMakeScripts
|
||||
Testing
|
||||
cmake_install.cmake
|
||||
install_manifest.txt
|
||||
compile_commands.json
|
||||
CTestTestfile.cmake
|
||||
_deps
|
||||
|
||||
### CMake Patch ###
|
||||
# External projects
|
||||
*-prefix/
|
||||
|
||||
### PhpStorm ###
|
||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
|
||||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||
|
||||
# User-specific stuff
|
||||
.idea/**/workspace.xml
|
||||
.idea/**/tasks.xml
|
||||
.idea/**/usage.statistics.xml
|
||||
.idea/**/dictionaries
|
||||
.idea/**/shelf
|
||||
.idea/
|
||||
# Generated files
|
||||
.idea/**/contentModel.xml
|
||||
|
||||
# Sensitive or high-churn files
|
||||
.idea/**/dataSources/
|
||||
.idea/**/dataSources.ids
|
||||
.idea/**/dataSources.local.xml
|
||||
.idea/**/sqlDataSources.xml
|
||||
.idea/**/dynamic.xml
|
||||
.idea/**/uiDesigner.xml
|
||||
.idea/**/dbnavigator.xml
|
||||
|
||||
# Gradle
|
||||
.idea/**/gradle.xml
|
||||
.idea/**/libraries
|
||||
|
||||
# Gradle and Maven with auto-import
|
||||
# When using Gradle or Maven with auto-import, you should exclude module files,
|
||||
# since they will be recreated, and may cause churn. Uncomment if using
|
||||
# auto-import.
|
||||
# .idea/artifacts
|
||||
# .idea/compiler.xml
|
||||
# .idea/jarRepositories.xml
|
||||
# .idea/modules.xml
|
||||
# .idea/*.iml
|
||||
# .idea/modules
|
||||
# *.iml
|
||||
# *.ipr
|
||||
|
||||
# CMake
|
||||
cmake-build-*/
|
||||
|
||||
# Mongo Explorer plugin
|
||||
.idea/**/mongoSettings.xml
|
||||
|
||||
# File-based project format
|
||||
*.iws
|
||||
|
||||
# IntelliJ
|
||||
out/
|
||||
|
||||
# mpeltonen/sbt-idea plugin
|
||||
.idea_modules/
|
||||
|
||||
# JIRA plugin
|
||||
atlassian-ide-plugin.xml
|
||||
|
||||
# Cursive Clojure plugin
|
||||
.idea/replstate.xml
|
||||
|
||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
fabric.properties
|
||||
|
||||
# Editor-based Rest Client
|
||||
.idea/httpRequests
|
||||
|
||||
# Android studio 3.1+ serialized cache file
|
||||
.idea/caches/build_file_checksums.ser
|
||||
|
||||
### PhpStorm Patch ###
|
||||
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
|
||||
|
||||
# *.iml
|
||||
# modules.xml
|
||||
# .idea/misc.xml
|
||||
# *.ipr
|
||||
|
||||
# Sonarlint plugin
|
||||
# https://plugins.jetbrains.com/plugin/7973-sonarlint
|
||||
.idea/**/sonarlint/
|
||||
|
||||
# SonarQube Plugin
|
||||
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
|
||||
.idea/**/sonarIssues.xml
|
||||
|
||||
# Markdown Navigator plugin
|
||||
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
|
||||
.idea/**/markdown-navigator.xml
|
||||
.idea/**/markdown-navigator-enh.xml
|
||||
.idea/**/markdown-navigator/
|
||||
|
||||
# Cache file creation bug
|
||||
# See https://youtrack.jetbrains.com/issue/JBR-2257
|
||||
.idea/$CACHE_FILE$
|
||||
|
||||
# CodeStream plugin
|
||||
# https://plugins.jetbrains.com/plugin/12206-codestream
|
||||
.idea/codestream.xml
|
||||
|
||||
# End of https://www.toptal.com/developers/gitignore/api/autotools,cmake,phpstorm
|
||||
|
||||
.deps
|
||||
.libs/
|
||||
build/
|
||||
configure.in
|
||||
configure.ac
|
||||
mkinstalldirs
|
||||
run-tests.php
|
||||
Makefile.global
|
||||
acinclude.m4
|
||||
libtool
|
||||
modules/
|
||||
*.lo
|
||||
config.h
|
||||
config.nice
|
||||
*.la
|
||||
Makefile*
|
||||
!Makefile.am
|
||||
!Makefile.frag
|
||||
!Makefile.frag.w32
|
||||
/vendor/
|
||||
.idea/
|
||||
.DS_Store
|
||||
composer.lock
|
||||
PHP-Parser*/
|
||||
src/*.so
|
||||
src/*.dylib
|
||||
src/*.dll
|
||||
|
||||
# ignoring output of package.xml as it needs to be generated from ./prepare_release.sh in each publishing
|
||||
package.xml
|
||||
*.tgz
|
3
vendor/aws/aws-crt-php/.gitmodules
vendored
Normal file
3
vendor/aws/aws-crt-php/.gitmodules
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
[submodule "crt/aws-crt-ffi"]
|
||||
path = crt/aws-crt-ffi
|
||||
url = https://github.com/awslabs/aws-crt-ffi.git
|
8
vendor/aws/aws-crt-php/CODE_OF_CONDUCT.md
vendored
8
vendor/aws/aws-crt-php/CODE_OF_CONDUCT.md
vendored
|
@ -1,4 +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.
|
||||
## 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.
|
||||
|
|
122
vendor/aws/aws-crt-php/CONTRIBUTING.md
vendored
122
vendor/aws/aws-crt-php/CONTRIBUTING.md
vendored
|
@ -1,61 +1,61 @@
|
|||
# Contributing Guidelines
|
||||
|
||||
Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
|
||||
documentation, we greatly value feedback and contributions from our community.
|
||||
|
||||
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
|
||||
information to effectively respond to your bug report or contribution.
|
||||
|
||||
|
||||
## Reporting Bugs/Feature Requests
|
||||
|
||||
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
|
||||
|
||||
When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already
|
||||
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
|
||||
|
||||
* A reproducible test case or series of steps
|
||||
* The version of our code being used
|
||||
* Any modifications you've made relevant to the bug
|
||||
* Anything unusual about your environment or deployment
|
||||
|
||||
|
||||
## Contributing via Pull Requests
|
||||
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
|
||||
|
||||
1. You are working against the latest source on the *master* branch.
|
||||
2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
|
||||
3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
|
||||
|
||||
To send us a pull request, please:
|
||||
|
||||
1. Fork the repository.
|
||||
2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
|
||||
3. Ensure local tests pass.
|
||||
4. Commit to your fork using clear commit messages.
|
||||
5. Send us a pull request, answering any default questions in the pull request interface.
|
||||
6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
|
||||
|
||||
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
|
||||
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
|
||||
|
||||
|
||||
## Finding contributions to work on
|
||||
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.
|
||||
|
||||
|
||||
## 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.
|
||||
|
||||
|
||||
## Security issue notifications
|
||||
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
|
||||
|
||||
|
||||
## Licensing
|
||||
|
||||
See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
|
||||
|
||||
We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes.
|
||||
# Contributing Guidelines
|
||||
|
||||
Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
|
||||
documentation, we greatly value feedback and contributions from our community.
|
||||
|
||||
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
|
||||
information to effectively respond to your bug report or contribution.
|
||||
|
||||
|
||||
## Reporting Bugs/Feature Requests
|
||||
|
||||
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
|
||||
|
||||
When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already
|
||||
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
|
||||
|
||||
* A reproducible test case or series of steps
|
||||
* The version of our code being used
|
||||
* Any modifications you've made relevant to the bug
|
||||
* Anything unusual about your environment or deployment
|
||||
|
||||
|
||||
## Contributing via Pull Requests
|
||||
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
|
||||
|
||||
1. You are working against the latest source on the *master* branch.
|
||||
2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
|
||||
3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
|
||||
|
||||
To send us a pull request, please:
|
||||
|
||||
1. Fork the repository.
|
||||
2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
|
||||
3. Ensure local tests pass.
|
||||
4. Commit to your fork using clear commit messages.
|
||||
5. Send us a pull request, answering any default questions in the pull request interface.
|
||||
6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
|
||||
|
||||
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
|
||||
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
|
||||
|
||||
|
||||
## Finding contributions to work on
|
||||
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.
|
||||
|
||||
|
||||
## 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.
|
||||
|
||||
|
||||
## Security issue notifications
|
||||
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
|
||||
|
||||
|
||||
## Licensing
|
||||
|
||||
See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
|
||||
|
||||
We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes.
|
||||
|
|
350
vendor/aws/aws-crt-php/LICENSE
vendored
350
vendor/aws/aws-crt-php/LICENSE
vendored
|
@ -1,175 +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.
|
||||
|
||||
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.
|
||||
|
|
144
vendor/aws/aws-crt-php/Makefile.frag
vendored
144
vendor/aws/aws-crt-php/Makefile.frag
vendored
|
@ -1,72 +1,72 @@
|
|||
|
||||
INT_DIR=build/install
|
||||
GENERATE_STUBS=$(shell expr `php --version | head -1 | cut -f 2 -d' '` \>= 7.1)
|
||||
|
||||
CMAKE = cmake3
|
||||
ifeq (, $(shell which cmake3))
|
||||
CMAKE = cmake
|
||||
endif
|
||||
|
||||
# default to using system OpenSSL, if disabled aws-lc will be used
|
||||
USE_OPENSSL ?= ON
|
||||
ifneq (OFF,$(USE_OPENSSL))
|
||||
CMAKE_USE_OPENSSL=-DUSE_OPENSSL=ON
|
||||
# if a path was provided, add it to CMAKE_PREFIX_PATH
|
||||
ifneq (ON,$(USE_OPENSSL))
|
||||
CMAKE_PREFIX_PATH=-DCMAKE_PREFIX_PATH=$(USE_OPENSSL)
|
||||
endif
|
||||
endif
|
||||
|
||||
CMAKE_CONFIGURE = $(CMAKE) \
|
||||
-DCMAKE_INSTALL_PREFIX=$(INT_DIR) \
|
||||
-DBUILD_TESTING=OFF \
|
||||
-DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) \
|
||||
$(CMAKE_USE_OPENSSL) \
|
||||
$(CMAKE_PREFIX_PATH)
|
||||
CMAKE_BUILD = CMAKE_BUILD_PARALLEL_LEVEL='' $(CMAKE) --build
|
||||
CMAKE_BUILD_TYPE ?= RelWithDebInfo
|
||||
CMAKE_TARGET = --config $(CMAKE_BUILD_TYPE) --target install
|
||||
|
||||
all: extension
|
||||
.PHONY: all extension
|
||||
|
||||
# configure for static aws-crt-ffi.a
|
||||
build/aws-crt-ffi-static/CMakeCache.txt:
|
||||
$(CMAKE_CONFIGURE) -Hcrt/aws-crt-ffi -Bbuild/aws-crt-ffi-static -DBUILD_SHARED_LIBS=OFF
|
||||
|
||||
# build static libaws-crt-ffi.a
|
||||
build/aws-crt-ffi-static/libaws-crt-ffi.a: build/aws-crt-ffi-static/CMakeCache.txt
|
||||
$(CMAKE_BUILD) build/aws-crt-ffi-static $(CMAKE_TARGET)
|
||||
|
||||
# PHP extension target
|
||||
extension: ext/awscrt.lo
|
||||
|
||||
# Force the crt object target to depend on the CRT static library
|
||||
ext/awscrt.lo: ext/awscrt.c
|
||||
|
||||
ext/awscrt.c: build/aws-crt-ffi-static/libaws-crt-ffi.a ext/api.h ext/awscrt_arginfo.h
|
||||
|
||||
ext/awscrt_arginfo.h: ext/awscrt.stub.php gen_stub.php
|
||||
ifeq ($(GENERATE_STUBS),1)
|
||||
# generate awscrt_arginfo.h
|
||||
php gen_stub.php --minimal-arginfo ext/awscrt.stub.php
|
||||
endif
|
||||
|
||||
# transform/install api.h from FFI lib
|
||||
src/api.h: crt/aws-crt-ffi/src/api.h
|
||||
php gen_api.php crt/aws-crt-ffi/src/api.h > src/api.h
|
||||
|
||||
# install api.h to ext/ as well
|
||||
ext/api.h : src/api.h
|
||||
cp -v src/api.h ext/api.h
|
||||
|
||||
ext/php_aws_crt.h: ext/awscrt_arginfo.h ext/api.h
|
||||
|
||||
vendor/bin/phpunit:
|
||||
composer update
|
||||
|
||||
test-extension: vendor/bin/phpunit extension
|
||||
composer run test-extension
|
||||
|
||||
# Use PHPUnit to run tests
|
||||
test: test-extension
|
||||
|
||||
INT_DIR=build/install
|
||||
GENERATE_STUBS=$(shell expr `php --version | head -1 | cut -f 2 -d' '` \>= 7.1)
|
||||
|
||||
CMAKE = cmake3
|
||||
ifeq (, $(shell which cmake3))
|
||||
CMAKE = cmake
|
||||
endif
|
||||
|
||||
# default to using system OpenSSL, if disabled aws-lc will be used
|
||||
USE_OPENSSL ?= ON
|
||||
ifneq (OFF,$(USE_OPENSSL))
|
||||
CMAKE_USE_OPENSSL=-DUSE_OPENSSL=ON
|
||||
# if a path was provided, add it to CMAKE_PREFIX_PATH
|
||||
ifneq (ON,$(USE_OPENSSL))
|
||||
CMAKE_PREFIX_PATH=-DCMAKE_PREFIX_PATH=$(USE_OPENSSL)
|
||||
endif
|
||||
endif
|
||||
|
||||
CMAKE_CONFIGURE = $(CMAKE) \
|
||||
-DCMAKE_INSTALL_PREFIX=$(INT_DIR) \
|
||||
-DBUILD_TESTING=OFF \
|
||||
-DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) \
|
||||
$(CMAKE_USE_OPENSSL) \
|
||||
$(CMAKE_PREFIX_PATH)
|
||||
CMAKE_BUILD = CMAKE_BUILD_PARALLEL_LEVEL='' $(CMAKE) --build
|
||||
CMAKE_BUILD_TYPE ?= RelWithDebInfo
|
||||
CMAKE_TARGET = --config $(CMAKE_BUILD_TYPE) --target install
|
||||
|
||||
all: extension
|
||||
.PHONY: all extension
|
||||
|
||||
# configure for static aws-crt-ffi.a
|
||||
build/aws-crt-ffi-static/CMakeCache.txt:
|
||||
$(CMAKE_CONFIGURE) -Hcrt/aws-crt-ffi -Bbuild/aws-crt-ffi-static -DBUILD_SHARED_LIBS=OFF
|
||||
|
||||
# build static libaws-crt-ffi.a
|
||||
build/aws-crt-ffi-static/libaws-crt-ffi.a: build/aws-crt-ffi-static/CMakeCache.txt
|
||||
$(CMAKE_BUILD) build/aws-crt-ffi-static $(CMAKE_TARGET)
|
||||
|
||||
# PHP extension target
|
||||
extension: ext/awscrt.lo
|
||||
|
||||
# Force the crt object target to depend on the CRT static library
|
||||
ext/awscrt.lo: ext/awscrt.c
|
||||
|
||||
ext/awscrt.c: build/aws-crt-ffi-static/libaws-crt-ffi.a ext/api.h ext/awscrt_arginfo.h
|
||||
|
||||
ext/awscrt_arginfo.h: ext/awscrt.stub.php gen_stub.php
|
||||
ifeq ($(GENERATE_STUBS),1)
|
||||
# generate awscrt_arginfo.h
|
||||
php gen_stub.php --minimal-arginfo ext/awscrt.stub.php
|
||||
endif
|
||||
|
||||
# transform/install api.h from FFI lib
|
||||
src/api.h: crt/aws-crt-ffi/src/api.h
|
||||
php gen_api.php crt/aws-crt-ffi/src/api.h > src/api.h
|
||||
|
||||
# install api.h to ext/ as well
|
||||
ext/api.h : src/api.h
|
||||
cp -v src/api.h ext/api.h
|
||||
|
||||
ext/php_aws_crt.h: ext/awscrt_arginfo.h ext/api.h
|
||||
|
||||
vendor/bin/phpunit:
|
||||
composer update
|
||||
|
||||
test-extension: vendor/bin/phpunit extension
|
||||
composer run test-extension
|
||||
|
||||
# Use PHPUnit to run tests
|
||||
test: test-extension
|
||||
|
|
70
vendor/aws/aws-crt-php/Makefile.frag.w32
vendored
70
vendor/aws/aws-crt-php/Makefile.frag.w32
vendored
|
@ -1,35 +1,35 @@
|
|||
|
||||
CMAKE=cmake.exe
|
||||
COMPOSER_PHAR=C:\ProgramData\ComposerSetup\bin\composer.phar
|
||||
PHP_BINARY=$(PHP_PREFIX)\php.exe
|
||||
|
||||
CMAKE_CONFIGURE = $(CMAKE) -DCMAKE_INSTALL_PREFIX=$(AWSCRT_DIR)\build\install -DCMAKE_PREFIX_PATH=$(AWSCRT_DIR)\build\install -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE)
|
||||
CMAKE_BUILD = $(CMAKE) --build
|
||||
CMAKE_BUILD_TYPE = Release
|
||||
CMAKE_TARGET = --config $(CMAKE_BUILD_TYPE) --target install
|
||||
|
||||
# configure for static aws-crt-ffi.lib
|
||||
$(AWSCRT_DIR)\build\CMakeCache.txt:
|
||||
$(CMAKE_CONFIGURE) -H$(AWSCRT_DIR)\crt\aws-crt-ffi -B$(AWSCRT_DIR)\build -DBUILD_SHARED_LIBS=OFF
|
||||
|
||||
# build static libaws-crt-ffi.lib
|
||||
$(AWSCRT_DIR)\build\libaws-crt-ffi.lib: $(AWSCRT_DIR)\build\CMakeCache.txt
|
||||
$(CMAKE_BUILD) $(AWSCRT_DIR)\build $(CMAKE_TARGET)
|
||||
|
||||
# Force the awscrt extension DLL target to depend on the extension src
|
||||
$(BUILD_DIR)\php_awscrt.dll: $(AWSCRT_DIR)\ext\awscrt.c
|
||||
|
||||
$(AWSCRT_DIR)\ext\awscrt.c: $(AWSCRT_DIR)\build\libaws-crt-ffi.lib $(AWSCRT_DIR)\ext\api.h $(AWSCRT_DIR)\ext\awscrt_arginfo.h
|
||||
|
||||
# transform\install api.h from FFI lib
|
||||
$(AWSCRT_DIR)\src\api.h: $(AWSCRT_DIR)\crt\aws-crt-ffi\src\api.h
|
||||
php $(AWSCRT_DIR)\gen_api.php $(AWSCRT_DIR)\crt\aws-crt-ffi\src\api.h > $(AWSCRT_DIR)\src\api.h
|
||||
|
||||
# install api.h to ext/ as well
|
||||
$(AWSCRT_DIR)\ext\api.h : $(AWSCRT_DIR)\src\api.h
|
||||
copy $(AWSCRT_DIR)\src\api.h $(AWSCRT_DIR)\ext\api.h
|
||||
|
||||
# Use PHPUnit to run tests
|
||||
test-awscrt: install $(AWSCRT_DIR)\src\api.h $(BUILD_DIR)\php_awscrt.dll
|
||||
$(PHP_BINARY) -c $(AWSCRT_DIR)\php-win.ini $(COMPOSER_PHAR) --working-dir=$(AWSCRT_DIR) update
|
||||
$(PHP_BINARY) -c $(AWSCRT_DIR)\php-win.ini $(COMPOSER_PHAR) --working-dir=$(AWSCRT_DIR) run test-win
|
||||
|
||||
CMAKE=cmake.exe
|
||||
COMPOSER_PHAR=C:\ProgramData\ComposerSetup\bin\composer.phar
|
||||
PHP_BINARY=$(PHP_PREFIX)\php.exe
|
||||
|
||||
CMAKE_CONFIGURE = $(CMAKE) -DCMAKE_INSTALL_PREFIX=$(AWSCRT_DIR)\build\install -DCMAKE_PREFIX_PATH=$(AWSCRT_DIR)\build\install -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE)
|
||||
CMAKE_BUILD = $(CMAKE) --build
|
||||
CMAKE_BUILD_TYPE = Release
|
||||
CMAKE_TARGET = --config $(CMAKE_BUILD_TYPE) --target install
|
||||
|
||||
# configure for static aws-crt-ffi.lib
|
||||
$(AWSCRT_DIR)\build\CMakeCache.txt:
|
||||
$(CMAKE_CONFIGURE) -H$(AWSCRT_DIR)\crt\aws-crt-ffi -B$(AWSCRT_DIR)\build -DBUILD_SHARED_LIBS=OFF
|
||||
|
||||
# build static libaws-crt-ffi.lib
|
||||
$(AWSCRT_DIR)\build\libaws-crt-ffi.lib: $(AWSCRT_DIR)\build\CMakeCache.txt
|
||||
$(CMAKE_BUILD) $(AWSCRT_DIR)\build $(CMAKE_TARGET)
|
||||
|
||||
# Force the awscrt extension DLL target to depend on the extension src
|
||||
$(BUILD_DIR)\php_awscrt.dll: $(AWSCRT_DIR)\ext\awscrt.c
|
||||
|
||||
$(AWSCRT_DIR)\ext\awscrt.c: $(AWSCRT_DIR)\build\libaws-crt-ffi.lib $(AWSCRT_DIR)\ext\api.h $(AWSCRT_DIR)\ext\awscrt_arginfo.h
|
||||
|
||||
# transform\install api.h from FFI lib
|
||||
$(AWSCRT_DIR)\src\api.h: $(AWSCRT_DIR)\crt\aws-crt-ffi\src\api.h
|
||||
php $(AWSCRT_DIR)\gen_api.php $(AWSCRT_DIR)\crt\aws-crt-ffi\src\api.h > $(AWSCRT_DIR)\src\api.h
|
||||
|
||||
# install api.h to ext/ as well
|
||||
$(AWSCRT_DIR)\ext\api.h : $(AWSCRT_DIR)\src\api.h
|
||||
copy $(AWSCRT_DIR)\src\api.h $(AWSCRT_DIR)\ext\api.h
|
||||
|
||||
# Use PHPUnit to run tests
|
||||
test-awscrt: install $(AWSCRT_DIR)\src\api.h $(BUILD_DIR)\php_awscrt.dll
|
||||
$(PHP_BINARY) -c $(AWSCRT_DIR)\php-win.ini $(COMPOSER_PHAR) --working-dir=$(AWSCRT_DIR) update
|
||||
$(PHP_BINARY) -c $(AWSCRT_DIR)\php-win.ini $(COMPOSER_PHAR) --working-dir=$(AWSCRT_DIR) run test-win
|
||||
|
|
2
vendor/aws/aws-crt-php/NOTICE
vendored
2
vendor/aws/aws-crt-php/NOTICE
vendored
|
@ -1 +1 @@
|
|||
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
|
|
74
vendor/aws/aws-crt-php/builder.json
vendored
74
vendor/aws/aws-crt-php/builder.json
vendored
|
@ -1,37 +1,37 @@
|
|||
{
|
||||
"name": "aws-crt-php",
|
||||
"hosts": {
|
||||
"ubuntu": {
|
||||
"pkg_setup": [
|
||||
"add-apt-repository -y ppa:ondrej/php"
|
||||
],
|
||||
"packages": [
|
||||
"autotools-dev",
|
||||
"autoconf",
|
||||
"libtool",
|
||||
"clang",
|
||||
"php5.6-dev"
|
||||
]
|
||||
},
|
||||
"al2": {
|
||||
"packages": [
|
||||
"autoconf",
|
||||
"automake",
|
||||
"libtool",
|
||||
"clang",
|
||||
"php-devel"
|
||||
]
|
||||
}
|
||||
},
|
||||
"build_steps": [
|
||||
["phpize"],
|
||||
["./configure"],
|
||||
["make"]
|
||||
],
|
||||
"test_env": {
|
||||
"NO_INTERACTION": "1"
|
||||
},
|
||||
"test_steps": [
|
||||
["./run_tests"]
|
||||
]
|
||||
}
|
||||
{
|
||||
"name": "aws-crt-php",
|
||||
"hosts": {
|
||||
"ubuntu": {
|
||||
"pkg_setup": [
|
||||
"add-apt-repository -y ppa:ondrej/php"
|
||||
],
|
||||
"packages": [
|
||||
"autotools-dev",
|
||||
"autoconf",
|
||||
"libtool",
|
||||
"clang",
|
||||
"php5.6-dev"
|
||||
]
|
||||
},
|
||||
"al2": {
|
||||
"packages": [
|
||||
"autoconf",
|
||||
"automake",
|
||||
"libtool",
|
||||
"clang",
|
||||
"php-devel"
|
||||
]
|
||||
}
|
||||
},
|
||||
"build_steps": [
|
||||
["phpize"],
|
||||
["./configure"],
|
||||
["make"]
|
||||
],
|
||||
"test_env": {
|
||||
"NO_INTERACTION": "1"
|
||||
},
|
||||
"test_steps": [
|
||||
["./run_tests"]
|
||||
]
|
||||
}
|
||||
|
|
68
vendor/aws/aws-crt-php/composer.json
vendored
68
vendor/aws/aws-crt-php/composer.json
vendored
|
@ -1,34 +1,34 @@
|
|||
{
|
||||
"name": "aws/aws-crt-php",
|
||||
"homepage": "http://aws.amazon.com/sdkforphp",
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"config": {
|
||||
"platform": {"php": "5.6"}
|
||||
},
|
||||
"minimum-stability": "alpha",
|
||||
"require": {
|
||||
"php": ">=5.5"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit":"^4.8.35|^5.4.3"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"src/"
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"test": "./run_tests",
|
||||
"test-extension": "@test",
|
||||
"test-win": "run_tests"
|
||||
},
|
||||
"license": "Apache-2.0"
|
||||
}
|
||||
{
|
||||
"name": "aws/aws-crt-php",
|
||||
"homepage": "http://aws.amazon.com/sdkforphp",
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"config": {
|
||||
"platform": {"php": "5.6"}
|
||||
},
|
||||
"minimum-stability": "alpha",
|
||||
"require": {
|
||||
"php": ">=5.5"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit":"^4.8.35|^5.4.3"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"src/"
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"test": "./run_tests",
|
||||
"test-extension": "@test",
|
||||
"test-win": "run_tests"
|
||||
},
|
||||
"license": "Apache-2.0"
|
||||
}
|
||||
|
|
60
vendor/aws/aws-crt-php/config.m4
vendored
60
vendor/aws/aws-crt-php/config.m4
vendored
|
@ -1,30 +1,30 @@
|
|||
dnl
|
||||
dnl * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
dnl * SPDX-License-Identifier: Apache-2.0.
|
||||
dnl
|
||||
|
||||
PHP_ARG_WITH(awscrt, for AWS Common Runtime support,
|
||||
[ --with-awscrt Include awscrt support])
|
||||
|
||||
if test "$PHP_AWSCRT" != "no"; then
|
||||
# force lib paths to be absolute, or PHP will mangle them
|
||||
cwd=`pwd`
|
||||
# Enable s2n and libcrypto for non-darwin UNIX
|
||||
if uname -a | grep -i darwin > /dev/null 2>&1; then
|
||||
platform_tls_libs=""
|
||||
else
|
||||
platform_tls_libs="-ls2n -lcrypto"
|
||||
fi
|
||||
CRT_LIBPATHS="-L${cwd}/build/install/lib -L${cwd}/build/install/lib64"
|
||||
CRT_LIBS="-laws-crt-ffi -laws-c-auth -laws-c-http -laws-c-io -laws-c-cal -laws-c-compression -laws-checksums -laws-c-common ${platform_tls_libs}"
|
||||
PHP_ADD_INCLUDE(${cwd}/build/install/include)
|
||||
PHP_EVAL_LIBLINE([$CRT_LIBPATHS $CRT_LIBS], AWSCRT_SHARED_LIBADD)
|
||||
|
||||
# Shoves the linker line into the Makefile
|
||||
PHP_SUBST(AWSCRT_SHARED_LIBADD)
|
||||
|
||||
# Sources for the PHP extension itself
|
||||
AWSCRT_SOURCES=ext/awscrt.c
|
||||
PHP_NEW_EXTENSION(awscrt, $AWSCRT_SOURCES, $ext_shared)
|
||||
PHP_ADD_MAKEFILE_FRAGMENT
|
||||
fi
|
||||
dnl
|
||||
dnl * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
dnl * SPDX-License-Identifier: Apache-2.0.
|
||||
dnl
|
||||
|
||||
PHP_ARG_WITH(awscrt, for AWS Common Runtime support,
|
||||
[ --with-awscrt Include awscrt support])
|
||||
|
||||
if test "$PHP_AWSCRT" != "no"; then
|
||||
# force lib paths to be absolute, or PHP will mangle them
|
||||
cwd=`pwd`
|
||||
# Enable s2n and libcrypto for non-darwin UNIX
|
||||
if uname -a | grep -i darwin > /dev/null 2>&1; then
|
||||
platform_tls_libs=""
|
||||
else
|
||||
platform_tls_libs="-ls2n -lcrypto"
|
||||
fi
|
||||
CRT_LIBPATHS="-L${cwd}/build/install/lib -L${cwd}/build/install/lib64"
|
||||
CRT_LIBS="-laws-crt-ffi -laws-c-auth -laws-c-http -laws-c-io -laws-c-cal -laws-c-compression -laws-checksums -laws-c-common ${platform_tls_libs}"
|
||||
PHP_ADD_INCLUDE(${cwd}/build/install/include)
|
||||
PHP_EVAL_LIBLINE([$CRT_LIBPATHS $CRT_LIBS], AWSCRT_SHARED_LIBADD)
|
||||
|
||||
# Shoves the linker line into the Makefile
|
||||
PHP_SUBST(AWSCRT_SHARED_LIBADD)
|
||||
|
||||
# Sources for the PHP extension itself
|
||||
AWSCRT_SOURCES=ext/awscrt.c
|
||||
PHP_NEW_EXTENSION(awscrt, $AWSCRT_SOURCES, $ext_shared)
|
||||
PHP_ADD_MAKEFILE_FRAGMENT
|
||||
fi
|
||||
|
|
26
vendor/aws/aws-crt-php/config.w32
vendored
26
vendor/aws/aws-crt-php/config.w32
vendored
|
@ -1,13 +1,13 @@
|
|||
// vim:ft=javascript
|
||||
|
||||
ARG_ENABLE("awscrt", "Include AWS Common Runtime support", "yes");
|
||||
|
||||
if (PHP_AWSCRT != "no") {
|
||||
ADD_MAKEFILE_FRAGMENT();
|
||||
DEFINE('CFLAGS_AWSCRT', '/I ' + configure_module_dirname + '\\build\\install\\include');
|
||||
DEFINE('LIBS_AWSCRT', '/LIBPATH:' + configure_module_dirname + '\\build\\install\\lib ' +
|
||||
'aws-crt-ffi.lib aws-c-auth.lib aws-c-http.lib aws-c-io.lib aws-c-cal.lib aws-c-compression.lib aws-c-common.lib ' +
|
||||
'ncrypt.lib Secur32.lib Crypt32.lib Shlwapi.lib');
|
||||
DEFINE('AWSCRT_DIR', configure_module_dirname);
|
||||
EXTENSION("awscrt", "ext\\awscrt.c", PHP_AWSCRT_SHARED);
|
||||
}
|
||||
// vim:ft=javascript
|
||||
|
||||
ARG_ENABLE("awscrt", "Include AWS Common Runtime support", "yes");
|
||||
|
||||
if (PHP_AWSCRT != "no") {
|
||||
ADD_MAKEFILE_FRAGMENT();
|
||||
DEFINE('CFLAGS_AWSCRT', '/I ' + configure_module_dirname + '\\build\\install\\include');
|
||||
DEFINE('LIBS_AWSCRT', '/LIBPATH:' + configure_module_dirname + '\\build\\install\\lib ' +
|
||||
'aws-crt-ffi.lib aws-c-auth.lib aws-c-http.lib aws-c-io.lib aws-c-cal.lib aws-c-compression.lib aws-c-common.lib ' +
|
||||
'ncrypt.lib Secur32.lib Crypt32.lib Shlwapi.lib');
|
||||
DEFINE('AWSCRT_DIR', configure_module_dirname);
|
||||
EXTENSION("awscrt", "ext\\awscrt.c", PHP_AWSCRT_SHARED);
|
||||
}
|
||||
|
|
2
vendor/aws/aws-crt-php/ext/.gitignore
vendored
Normal file
2
vendor/aws/aws-crt-php/ext/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
*.so
|
||||
api.h
|
34
vendor/aws/aws-crt-php/ext/awscrt.c
vendored
34
vendor/aws/aws-crt-php/ext/awscrt.c
vendored
|
@ -1,17 +1,17 @@
|
|||
/**
|
||||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0.
|
||||
*/
|
||||
|
||||
/* This is a unity-build style source file, as PHP's build system is simplest with 1 source file per extension */
|
||||
|
||||
#include "credentials.c"
|
||||
#include "crt.c"
|
||||
#include "event_loop.c"
|
||||
#include "http.c"
|
||||
#include "signing.c"
|
||||
#include "stream.c"
|
||||
// #include "hash.c"
|
||||
#include "crc.c"
|
||||
#include "logging.c"
|
||||
#include "php_util.c"
|
||||
/**
|
||||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0.
|
||||
*/
|
||||
|
||||
/* This is a unity-build style source file, as PHP's build system is simplest with 1 source file per extension */
|
||||
|
||||
#include "credentials.c"
|
||||
#include "crt.c"
|
||||
#include "event_loop.c"
|
||||
#include "http.c"
|
||||
#include "signing.c"
|
||||
#include "stream.c"
|
||||
// #include "hash.c"
|
||||
#include "crc.c"
|
||||
#include "logging.c"
|
||||
#include "php_util.c"
|
||||
|
|
176
vendor/aws/aws-crt-php/ext/awscrt.stub.php
vendored
176
vendor/aws/aws-crt-php/ext/awscrt.stub.php
vendored
|
@ -1,88 +1,88 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @generate-class-entries
|
||||
* @generate-function-entries
|
||||
*/
|
||||
|
||||
function aws_crt_last_error(): int {}
|
||||
function aws_crt_error_name(int $error_code): string {}
|
||||
function aws_crt_error_str(int $error_code): string {}
|
||||
function aws_crt_error_debug_str(int $error_code): string {}
|
||||
|
||||
function aws_crt_log_to_stdout(): void {}
|
||||
function aws_crt_log_to_stderr(): void {}
|
||||
function aws_crt_log_to_file(string $filename): void {}
|
||||
function aws_crt_log_to_stream(object $stream): void {}
|
||||
function aws_crt_log_stop(): void {}
|
||||
function aws_crt_log_set_level(int $level): void {}
|
||||
function aws_crt_log_message(string $message): void {}
|
||||
|
||||
function aws_crt_event_loop_group_options_new(): int {}
|
||||
function aws_crt_event_loop_group_options_release(int $elg_options): void {}
|
||||
function aws_crt_event_loop_group_options_set_max_threads(int $elg_options, int $max_threads): void {}
|
||||
function aws_crt_event_loop_group_new(object $options): object {}
|
||||
function aws_crt_event_loop_group_release(object $event_loop_group): void {}
|
||||
|
||||
function aws_crt_input_stream_options_new(): object {}
|
||||
function aws_crt_input_stream_options_release(object $options): void {}
|
||||
function aws_crt_input_stream_options_set_user_data(object $options, object $user_data): void {}
|
||||
function aws_crt_input_stream_new(object $options): object {}
|
||||
function aws_crt_input_stream_release(int $stream): void {}
|
||||
function aws_crt_input_stream_seek(int $stream, int $offset, int $basis): int {}
|
||||
function aws_crt_input_stream_read(int $stream, int $length): string {}
|
||||
function aws_crt_input_stream_eof(int $stream): bool {}
|
||||
function aws_crt_input_stream_get_length(int $stream): int {}
|
||||
|
||||
function aws_crt_http_message_new_from_blob(string $blob): int {}
|
||||
function aws_crt_http_message_to_blob(int $message): string {}
|
||||
function aws_crt_http_message_release(int $message): void {}
|
||||
|
||||
function aws_crt_credentials_options_new(): object {}
|
||||
function aws_crt_credentials_options_release(object $options): void {}
|
||||
function aws_crt_credentials_options_set_access_key_id(object $options, string $access_key_id): void {}
|
||||
function aws_crt_credentials_options_set_secret_access_key(object $options, string $secret_access_key): void {}
|
||||
function aws_crt_credentials_options_set_session_token(object $options, string $session_token): void {}
|
||||
function aws_crt_credentials_options_set_expiration_timepoint_seconds(object $options, int $expiration_timepoint_seconds): void {}
|
||||
|
||||
function aws_crt_credentials_new(object $options): object {}
|
||||
function aws_crt_credentials_release(object $credentials): void {}
|
||||
|
||||
function aws_crt_credentials_provider_release(int $credentials): void {}
|
||||
|
||||
function aws_crt_credentials_provider_static_options_new(): object {}
|
||||
function aws_crt_credentials_provider_static_options_release(object $options): void {}
|
||||
function aws_crt_credentials_provider_static_options_set_access_key_id(object $options, string $access_key_id): void {}
|
||||
function aws_crt_credentials_provider_static_options_set_secret_access_key(object $options, string $secret_access_key): void {}
|
||||
function aws_crt_credentials_provider_static_options_set_session_token(object $options, string $session_token): void {}
|
||||
function aws_crt_credentials_provider_static_new(object $options): object {}
|
||||
|
||||
function aws_crt_signing_config_aws_new(): int {}
|
||||
function aws_crt_signing_config_aws_release(int $config): void {}
|
||||
function aws_crt_signing_config_aws_set_algorithm(int $config, int $algorithm): void {}
|
||||
function aws_crt_signing_config_aws_set_signature_type(int $config, int $signature_type): void {}
|
||||
function aws_crt_signing_config_aws_set_credentials_provider(int $config, int $credentials_provider): void {}
|
||||
function aws_crt_signing_config_aws_set_region(int $config, string $region): void {}
|
||||
function aws_crt_signing_config_aws_set_service(int $config, string $service): void {}
|
||||
function aws_crt_signing_config_aws_set_use_double_uri_encode(int $config, bool $use_double_uri_encode): void {}
|
||||
function aws_crt_signing_config_aws_set_should_normalize_uri_path(int $config, bool $should_normalize_uri_path): void {}
|
||||
function aws_crt_signing_config_aws_set_omit_session_token(int $config, bool $omit_session_token): void {}
|
||||
function aws_crt_signing_config_aws_set_signed_body_value(int $config, string $signed_body_value): void {}
|
||||
function aws_crt_signing_config_aws_set_signed_body_header_type(int $config, int $signed_body_header_type): void {}
|
||||
function aws_crt_signing_config_aws_set_expiration_in_seconds(int $config, int $expiration_in_seconds): void {}
|
||||
function aws_crt_signing_config_aws_set_date(int $config, int $timestamp): void {}
|
||||
function aws_crt_signing_config_aws_set_should_sign_header_fn(int $config, object $should_sign_header): void {}
|
||||
|
||||
function aws_crt_signable_new_from_http_request(int $http_message): int {}
|
||||
function aws_crt_signable_new_from_chunk(int $input_stream, string $previous_signature): int {}
|
||||
function aws_crt_signable_new_from_canonical_request(string $request): int {}
|
||||
function aws_crt_signable_release(int $signable): void {}
|
||||
|
||||
function aws_crt_signing_result_release(int $signing_result): void {}
|
||||
function aws_crt_signing_result_apply_to_http_request(object $signing_result, object $http_request): void {}
|
||||
|
||||
function aws_crt_sign_request_aws(int $signable, int $signing_config, object $on_complete, object $user_data): int {}
|
||||
function aws_crt_test_verify_sigv4a_signing(int $signable, int $signing_config, string $expected_canonical_request, string $signature, string $ecc_key_pub_x, string $ecc_key_pub_y): bool {}
|
||||
|
||||
function aws_crt_crc32(string $input, int $prev): int {}
|
||||
function aws_crt_crc32c(string $input, int $prev): int {}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @generate-class-entries
|
||||
* @generate-function-entries
|
||||
*/
|
||||
|
||||
function aws_crt_last_error(): int {}
|
||||
function aws_crt_error_name(int $error_code): string {}
|
||||
function aws_crt_error_str(int $error_code): string {}
|
||||
function aws_crt_error_debug_str(int $error_code): string {}
|
||||
|
||||
function aws_crt_log_to_stdout(): void {}
|
||||
function aws_crt_log_to_stderr(): void {}
|
||||
function aws_crt_log_to_file(string $filename): void {}
|
||||
function aws_crt_log_to_stream(object $stream): void {}
|
||||
function aws_crt_log_stop(): void {}
|
||||
function aws_crt_log_set_level(int $level): void {}
|
||||
function aws_crt_log_message(string $message): void {}
|
||||
|
||||
function aws_crt_event_loop_group_options_new(): int {}
|
||||
function aws_crt_event_loop_group_options_release(int $elg_options): void {}
|
||||
function aws_crt_event_loop_group_options_set_max_threads(int $elg_options, int $max_threads): void {}
|
||||
function aws_crt_event_loop_group_new(object $options): object {}
|
||||
function aws_crt_event_loop_group_release(object $event_loop_group): void {}
|
||||
|
||||
function aws_crt_input_stream_options_new(): object {}
|
||||
function aws_crt_input_stream_options_release(object $options): void {}
|
||||
function aws_crt_input_stream_options_set_user_data(object $options, object $user_data): void {}
|
||||
function aws_crt_input_stream_new(object $options): object {}
|
||||
function aws_crt_input_stream_release(int $stream): void {}
|
||||
function aws_crt_input_stream_seek(int $stream, int $offset, int $basis): int {}
|
||||
function aws_crt_input_stream_read(int $stream, int $length): string {}
|
||||
function aws_crt_input_stream_eof(int $stream): bool {}
|
||||
function aws_crt_input_stream_get_length(int $stream): int {}
|
||||
|
||||
function aws_crt_http_message_new_from_blob(string $blob): int {}
|
||||
function aws_crt_http_message_to_blob(int $message): string {}
|
||||
function aws_crt_http_message_release(int $message): void {}
|
||||
|
||||
function aws_crt_credentials_options_new(): object {}
|
||||
function aws_crt_credentials_options_release(object $options): void {}
|
||||
function aws_crt_credentials_options_set_access_key_id(object $options, string $access_key_id): void {}
|
||||
function aws_crt_credentials_options_set_secret_access_key(object $options, string $secret_access_key): void {}
|
||||
function aws_crt_credentials_options_set_session_token(object $options, string $session_token): void {}
|
||||
function aws_crt_credentials_options_set_expiration_timepoint_seconds(object $options, int $expiration_timepoint_seconds): void {}
|
||||
|
||||
function aws_crt_credentials_new(object $options): object {}
|
||||
function aws_crt_credentials_release(object $credentials): void {}
|
||||
|
||||
function aws_crt_credentials_provider_release(int $credentials): void {}
|
||||
|
||||
function aws_crt_credentials_provider_static_options_new(): object {}
|
||||
function aws_crt_credentials_provider_static_options_release(object $options): void {}
|
||||
function aws_crt_credentials_provider_static_options_set_access_key_id(object $options, string $access_key_id): void {}
|
||||
function aws_crt_credentials_provider_static_options_set_secret_access_key(object $options, string $secret_access_key): void {}
|
||||
function aws_crt_credentials_provider_static_options_set_session_token(object $options, string $session_token): void {}
|
||||
function aws_crt_credentials_provider_static_new(object $options): object {}
|
||||
|
||||
function aws_crt_signing_config_aws_new(): int {}
|
||||
function aws_crt_signing_config_aws_release(int $config): void {}
|
||||
function aws_crt_signing_config_aws_set_algorithm(int $config, int $algorithm): void {}
|
||||
function aws_crt_signing_config_aws_set_signature_type(int $config, int $signature_type): void {}
|
||||
function aws_crt_signing_config_aws_set_credentials_provider(int $config, int $credentials_provider): void {}
|
||||
function aws_crt_signing_config_aws_set_region(int $config, string $region): void {}
|
||||
function aws_crt_signing_config_aws_set_service(int $config, string $service): void {}
|
||||
function aws_crt_signing_config_aws_set_use_double_uri_encode(int $config, bool $use_double_uri_encode): void {}
|
||||
function aws_crt_signing_config_aws_set_should_normalize_uri_path(int $config, bool $should_normalize_uri_path): void {}
|
||||
function aws_crt_signing_config_aws_set_omit_session_token(int $config, bool $omit_session_token): void {}
|
||||
function aws_crt_signing_config_aws_set_signed_body_value(int $config, string $signed_body_value): void {}
|
||||
function aws_crt_signing_config_aws_set_signed_body_header_type(int $config, int $signed_body_header_type): void {}
|
||||
function aws_crt_signing_config_aws_set_expiration_in_seconds(int $config, int $expiration_in_seconds): void {}
|
||||
function aws_crt_signing_config_aws_set_date(int $config, int $timestamp): void {}
|
||||
function aws_crt_signing_config_aws_set_should_sign_header_fn(int $config, object $should_sign_header): void {}
|
||||
|
||||
function aws_crt_signable_new_from_http_request(int $http_message): int {}
|
||||
function aws_crt_signable_new_from_chunk(int $input_stream, string $previous_signature): int {}
|
||||
function aws_crt_signable_new_from_canonical_request(string $request): int {}
|
||||
function aws_crt_signable_release(int $signable): void {}
|
||||
|
||||
function aws_crt_signing_result_release(int $signing_result): void {}
|
||||
function aws_crt_signing_result_apply_to_http_request(object $signing_result, object $http_request): void {}
|
||||
|
||||
function aws_crt_sign_request_aws(int $signable, int $signing_config, object $on_complete, object $user_data): int {}
|
||||
function aws_crt_test_verify_sigv4a_signing(int $signable, int $signing_config, string $expected_canonical_request, string $signature, string $ecc_key_pub_x, string $ecc_key_pub_y): bool {}
|
||||
|
||||
function aws_crt_crc32(string $input, int $prev): int {}
|
||||
function aws_crt_crc32c(string $input, int $prev): int {}
|
||||
|
|
826
vendor/aws/aws-crt-php/ext/awscrt_arginfo.h
vendored
826
vendor/aws/aws-crt-php/ext/awscrt_arginfo.h
vendored
|
@ -1,413 +1,413 @@
|
|||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: 344f9d59b85697b80bb6808ac7d5eb7c1d07c03f */
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_last_error, 0, 0, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_error_name, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, error_code)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_aws_crt_error_str arginfo_aws_crt_error_name
|
||||
|
||||
#define arginfo_aws_crt_error_debug_str arginfo_aws_crt_error_name
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_log_to_stdout, 0, 0, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_aws_crt_log_to_stderr arginfo_aws_crt_log_to_stdout
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_log_to_file, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, filename)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_log_to_stream, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, stream)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_aws_crt_log_stop arginfo_aws_crt_log_to_stdout
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_log_set_level, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, level)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_log_message, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, message)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_aws_crt_event_loop_group_options_new arginfo_aws_crt_last_error
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_event_loop_group_options_release, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, elg_options)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_event_loop_group_options_set_max_threads, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, elg_options)
|
||||
ZEND_ARG_INFO(0, max_threads)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_event_loop_group_new, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, options)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_event_loop_group_release, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, event_loop_group)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_input_stream_options_new, 0, 0, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_input_stream_options_release, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, options)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_input_stream_options_set_user_data, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, options)
|
||||
ZEND_ARG_INFO(0, user_data)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_aws_crt_input_stream_new arginfo_aws_crt_event_loop_group_new
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_input_stream_release, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, stream)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_input_stream_seek, 0, 0, 3)
|
||||
ZEND_ARG_INFO(0, stream)
|
||||
ZEND_ARG_INFO(0, offset)
|
||||
ZEND_ARG_INFO(0, basis)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_input_stream_read, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, stream)
|
||||
ZEND_ARG_INFO(0, length)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_input_stream_eof, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, stream)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_input_stream_get_length, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, stream)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_http_message_new_from_blob, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, blob)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_http_message_to_blob, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, message)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_http_message_release, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, message)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_aws_crt_credentials_options_new arginfo_aws_crt_input_stream_options_new
|
||||
|
||||
#define arginfo_aws_crt_credentials_options_release arginfo_aws_crt_input_stream_options_release
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_credentials_options_set_access_key_id, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, options)
|
||||
ZEND_ARG_INFO(0, access_key_id)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_credentials_options_set_secret_access_key, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, options)
|
||||
ZEND_ARG_INFO(0, secret_access_key)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_credentials_options_set_session_token, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, options)
|
||||
ZEND_ARG_INFO(0, session_token)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_credentials_options_set_expiration_timepoint_seconds, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, options)
|
||||
ZEND_ARG_INFO(0, expiration_timepoint_seconds)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_aws_crt_credentials_new arginfo_aws_crt_event_loop_group_new
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_credentials_release, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, credentials)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_credentials_provider_release, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, credentials)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_aws_crt_credentials_provider_static_options_new arginfo_aws_crt_input_stream_options_new
|
||||
|
||||
#define arginfo_aws_crt_credentials_provider_static_options_release arginfo_aws_crt_input_stream_options_release
|
||||
|
||||
#define arginfo_aws_crt_credentials_provider_static_options_set_access_key_id arginfo_aws_crt_credentials_options_set_access_key_id
|
||||
|
||||
#define arginfo_aws_crt_credentials_provider_static_options_set_secret_access_key arginfo_aws_crt_credentials_options_set_secret_access_key
|
||||
|
||||
#define arginfo_aws_crt_credentials_provider_static_options_set_session_token arginfo_aws_crt_credentials_options_set_session_token
|
||||
|
||||
#define arginfo_aws_crt_credentials_provider_static_new arginfo_aws_crt_event_loop_group_new
|
||||
|
||||
#define arginfo_aws_crt_signing_config_aws_new arginfo_aws_crt_last_error
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_release, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_algorithm, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_ARG_INFO(0, algorithm)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_signature_type, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_ARG_INFO(0, signature_type)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_credentials_provider, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_ARG_INFO(0, credentials_provider)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_region, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_ARG_INFO(0, region)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_service, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_ARG_INFO(0, service)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_use_double_uri_encode, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_ARG_INFO(0, use_double_uri_encode)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_should_normalize_uri_path, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_ARG_INFO(0, should_normalize_uri_path)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_omit_session_token, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_ARG_INFO(0, omit_session_token)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_signed_body_value, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_ARG_INFO(0, signed_body_value)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_signed_body_header_type, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_ARG_INFO(0, signed_body_header_type)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_expiration_in_seconds, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_ARG_INFO(0, expiration_in_seconds)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_date, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_ARG_INFO(0, timestamp)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_should_sign_header_fn, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_ARG_INFO(0, should_sign_header)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signable_new_from_http_request, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, http_message)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signable_new_from_chunk, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, input_stream)
|
||||
ZEND_ARG_INFO(0, previous_signature)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signable_new_from_canonical_request, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, request)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signable_release, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, signable)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_result_release, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, signing_result)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_result_apply_to_http_request, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, signing_result)
|
||||
ZEND_ARG_INFO(0, http_request)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_sign_request_aws, 0, 0, 4)
|
||||
ZEND_ARG_INFO(0, signable)
|
||||
ZEND_ARG_INFO(0, signing_config)
|
||||
ZEND_ARG_INFO(0, on_complete)
|
||||
ZEND_ARG_INFO(0, user_data)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_test_verify_sigv4a_signing, 0, 0, 6)
|
||||
ZEND_ARG_INFO(0, signable)
|
||||
ZEND_ARG_INFO(0, signing_config)
|
||||
ZEND_ARG_INFO(0, expected_canonical_request)
|
||||
ZEND_ARG_INFO(0, signature)
|
||||
ZEND_ARG_INFO(0, ecc_key_pub_x)
|
||||
ZEND_ARG_INFO(0, ecc_key_pub_y)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_crc32, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, input)
|
||||
ZEND_ARG_INFO(0, prev)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_aws_crt_crc32c arginfo_aws_crt_crc32
|
||||
|
||||
|
||||
ZEND_FUNCTION(aws_crt_last_error);
|
||||
ZEND_FUNCTION(aws_crt_error_name);
|
||||
ZEND_FUNCTION(aws_crt_error_str);
|
||||
ZEND_FUNCTION(aws_crt_error_debug_str);
|
||||
ZEND_FUNCTION(aws_crt_log_to_stdout);
|
||||
ZEND_FUNCTION(aws_crt_log_to_stderr);
|
||||
ZEND_FUNCTION(aws_crt_log_to_file);
|
||||
ZEND_FUNCTION(aws_crt_log_to_stream);
|
||||
ZEND_FUNCTION(aws_crt_log_stop);
|
||||
ZEND_FUNCTION(aws_crt_log_set_level);
|
||||
ZEND_FUNCTION(aws_crt_log_message);
|
||||
ZEND_FUNCTION(aws_crt_event_loop_group_options_new);
|
||||
ZEND_FUNCTION(aws_crt_event_loop_group_options_release);
|
||||
ZEND_FUNCTION(aws_crt_event_loop_group_options_set_max_threads);
|
||||
ZEND_FUNCTION(aws_crt_event_loop_group_new);
|
||||
ZEND_FUNCTION(aws_crt_event_loop_group_release);
|
||||
ZEND_FUNCTION(aws_crt_input_stream_options_new);
|
||||
ZEND_FUNCTION(aws_crt_input_stream_options_release);
|
||||
ZEND_FUNCTION(aws_crt_input_stream_options_set_user_data);
|
||||
ZEND_FUNCTION(aws_crt_input_stream_new);
|
||||
ZEND_FUNCTION(aws_crt_input_stream_release);
|
||||
ZEND_FUNCTION(aws_crt_input_stream_seek);
|
||||
ZEND_FUNCTION(aws_crt_input_stream_read);
|
||||
ZEND_FUNCTION(aws_crt_input_stream_eof);
|
||||
ZEND_FUNCTION(aws_crt_input_stream_get_length);
|
||||
ZEND_FUNCTION(aws_crt_http_message_new_from_blob);
|
||||
ZEND_FUNCTION(aws_crt_http_message_to_blob);
|
||||
ZEND_FUNCTION(aws_crt_http_message_release);
|
||||
ZEND_FUNCTION(aws_crt_credentials_options_new);
|
||||
ZEND_FUNCTION(aws_crt_credentials_options_release);
|
||||
ZEND_FUNCTION(aws_crt_credentials_options_set_access_key_id);
|
||||
ZEND_FUNCTION(aws_crt_credentials_options_set_secret_access_key);
|
||||
ZEND_FUNCTION(aws_crt_credentials_options_set_session_token);
|
||||
ZEND_FUNCTION(aws_crt_credentials_options_set_expiration_timepoint_seconds);
|
||||
ZEND_FUNCTION(aws_crt_credentials_new);
|
||||
ZEND_FUNCTION(aws_crt_credentials_release);
|
||||
ZEND_FUNCTION(aws_crt_credentials_provider_release);
|
||||
ZEND_FUNCTION(aws_crt_credentials_provider_static_options_new);
|
||||
ZEND_FUNCTION(aws_crt_credentials_provider_static_options_release);
|
||||
ZEND_FUNCTION(aws_crt_credentials_provider_static_options_set_access_key_id);
|
||||
ZEND_FUNCTION(aws_crt_credentials_provider_static_options_set_secret_access_key);
|
||||
ZEND_FUNCTION(aws_crt_credentials_provider_static_options_set_session_token);
|
||||
ZEND_FUNCTION(aws_crt_credentials_provider_static_new);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_new);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_release);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_set_algorithm);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_set_signature_type);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_set_credentials_provider);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_set_region);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_set_service);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_set_use_double_uri_encode);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_set_should_normalize_uri_path);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_set_omit_session_token);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_set_signed_body_value);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_set_signed_body_header_type);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_set_expiration_in_seconds);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_set_date);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_set_should_sign_header_fn);
|
||||
ZEND_FUNCTION(aws_crt_signable_new_from_http_request);
|
||||
ZEND_FUNCTION(aws_crt_signable_new_from_chunk);
|
||||
ZEND_FUNCTION(aws_crt_signable_new_from_canonical_request);
|
||||
ZEND_FUNCTION(aws_crt_signable_release);
|
||||
ZEND_FUNCTION(aws_crt_signing_result_release);
|
||||
ZEND_FUNCTION(aws_crt_signing_result_apply_to_http_request);
|
||||
ZEND_FUNCTION(aws_crt_sign_request_aws);
|
||||
ZEND_FUNCTION(aws_crt_test_verify_sigv4a_signing);
|
||||
ZEND_FUNCTION(aws_crt_crc32);
|
||||
ZEND_FUNCTION(aws_crt_crc32c);
|
||||
|
||||
|
||||
static const zend_function_entry ext_functions[] = {
|
||||
ZEND_FE(aws_crt_last_error, arginfo_aws_crt_last_error)
|
||||
ZEND_FE(aws_crt_error_name, arginfo_aws_crt_error_name)
|
||||
ZEND_FE(aws_crt_error_str, arginfo_aws_crt_error_str)
|
||||
ZEND_FE(aws_crt_error_debug_str, arginfo_aws_crt_error_debug_str)
|
||||
ZEND_FE(aws_crt_log_to_stdout, arginfo_aws_crt_log_to_stdout)
|
||||
ZEND_FE(aws_crt_log_to_stderr, arginfo_aws_crt_log_to_stderr)
|
||||
ZEND_FE(aws_crt_log_to_file, arginfo_aws_crt_log_to_file)
|
||||
ZEND_FE(aws_crt_log_to_stream, arginfo_aws_crt_log_to_stream)
|
||||
ZEND_FE(aws_crt_log_stop, arginfo_aws_crt_log_stop)
|
||||
ZEND_FE(aws_crt_log_set_level, arginfo_aws_crt_log_set_level)
|
||||
ZEND_FE(aws_crt_log_message, arginfo_aws_crt_log_message)
|
||||
ZEND_FE(aws_crt_event_loop_group_options_new, arginfo_aws_crt_event_loop_group_options_new)
|
||||
ZEND_FE(aws_crt_event_loop_group_options_release, arginfo_aws_crt_event_loop_group_options_release)
|
||||
ZEND_FE(aws_crt_event_loop_group_options_set_max_threads, arginfo_aws_crt_event_loop_group_options_set_max_threads)
|
||||
ZEND_FE(aws_crt_event_loop_group_new, arginfo_aws_crt_event_loop_group_new)
|
||||
ZEND_FE(aws_crt_event_loop_group_release, arginfo_aws_crt_event_loop_group_release)
|
||||
ZEND_FE(aws_crt_input_stream_options_new, arginfo_aws_crt_input_stream_options_new)
|
||||
ZEND_FE(aws_crt_input_stream_options_release, arginfo_aws_crt_input_stream_options_release)
|
||||
ZEND_FE(aws_crt_input_stream_options_set_user_data, arginfo_aws_crt_input_stream_options_set_user_data)
|
||||
ZEND_FE(aws_crt_input_stream_new, arginfo_aws_crt_input_stream_new)
|
||||
ZEND_FE(aws_crt_input_stream_release, arginfo_aws_crt_input_stream_release)
|
||||
ZEND_FE(aws_crt_input_stream_seek, arginfo_aws_crt_input_stream_seek)
|
||||
ZEND_FE(aws_crt_input_stream_read, arginfo_aws_crt_input_stream_read)
|
||||
ZEND_FE(aws_crt_input_stream_eof, arginfo_aws_crt_input_stream_eof)
|
||||
ZEND_FE(aws_crt_input_stream_get_length, arginfo_aws_crt_input_stream_get_length)
|
||||
ZEND_FE(aws_crt_http_message_new_from_blob, arginfo_aws_crt_http_message_new_from_blob)
|
||||
ZEND_FE(aws_crt_http_message_to_blob, arginfo_aws_crt_http_message_to_blob)
|
||||
ZEND_FE(aws_crt_http_message_release, arginfo_aws_crt_http_message_release)
|
||||
ZEND_FE(aws_crt_credentials_options_new, arginfo_aws_crt_credentials_options_new)
|
||||
ZEND_FE(aws_crt_credentials_options_release, arginfo_aws_crt_credentials_options_release)
|
||||
ZEND_FE(aws_crt_credentials_options_set_access_key_id, arginfo_aws_crt_credentials_options_set_access_key_id)
|
||||
ZEND_FE(aws_crt_credentials_options_set_secret_access_key, arginfo_aws_crt_credentials_options_set_secret_access_key)
|
||||
ZEND_FE(aws_crt_credentials_options_set_session_token, arginfo_aws_crt_credentials_options_set_session_token)
|
||||
ZEND_FE(aws_crt_credentials_options_set_expiration_timepoint_seconds, arginfo_aws_crt_credentials_options_set_expiration_timepoint_seconds)
|
||||
ZEND_FE(aws_crt_credentials_new, arginfo_aws_crt_credentials_new)
|
||||
ZEND_FE(aws_crt_credentials_release, arginfo_aws_crt_credentials_release)
|
||||
ZEND_FE(aws_crt_credentials_provider_release, arginfo_aws_crt_credentials_provider_release)
|
||||
ZEND_FE(aws_crt_credentials_provider_static_options_new, arginfo_aws_crt_credentials_provider_static_options_new)
|
||||
ZEND_FE(aws_crt_credentials_provider_static_options_release, arginfo_aws_crt_credentials_provider_static_options_release)
|
||||
ZEND_FE(aws_crt_credentials_provider_static_options_set_access_key_id, arginfo_aws_crt_credentials_provider_static_options_set_access_key_id)
|
||||
ZEND_FE(aws_crt_credentials_provider_static_options_set_secret_access_key, arginfo_aws_crt_credentials_provider_static_options_set_secret_access_key)
|
||||
ZEND_FE(aws_crt_credentials_provider_static_options_set_session_token, arginfo_aws_crt_credentials_provider_static_options_set_session_token)
|
||||
ZEND_FE(aws_crt_credentials_provider_static_new, arginfo_aws_crt_credentials_provider_static_new)
|
||||
ZEND_FE(aws_crt_signing_config_aws_new, arginfo_aws_crt_signing_config_aws_new)
|
||||
ZEND_FE(aws_crt_signing_config_aws_release, arginfo_aws_crt_signing_config_aws_release)
|
||||
ZEND_FE(aws_crt_signing_config_aws_set_algorithm, arginfo_aws_crt_signing_config_aws_set_algorithm)
|
||||
ZEND_FE(aws_crt_signing_config_aws_set_signature_type, arginfo_aws_crt_signing_config_aws_set_signature_type)
|
||||
ZEND_FE(aws_crt_signing_config_aws_set_credentials_provider, arginfo_aws_crt_signing_config_aws_set_credentials_provider)
|
||||
ZEND_FE(aws_crt_signing_config_aws_set_region, arginfo_aws_crt_signing_config_aws_set_region)
|
||||
ZEND_FE(aws_crt_signing_config_aws_set_service, arginfo_aws_crt_signing_config_aws_set_service)
|
||||
ZEND_FE(aws_crt_signing_config_aws_set_use_double_uri_encode, arginfo_aws_crt_signing_config_aws_set_use_double_uri_encode)
|
||||
ZEND_FE(aws_crt_signing_config_aws_set_should_normalize_uri_path, arginfo_aws_crt_signing_config_aws_set_should_normalize_uri_path)
|
||||
ZEND_FE(aws_crt_signing_config_aws_set_omit_session_token, arginfo_aws_crt_signing_config_aws_set_omit_session_token)
|
||||
ZEND_FE(aws_crt_signing_config_aws_set_signed_body_value, arginfo_aws_crt_signing_config_aws_set_signed_body_value)
|
||||
ZEND_FE(aws_crt_signing_config_aws_set_signed_body_header_type, arginfo_aws_crt_signing_config_aws_set_signed_body_header_type)
|
||||
ZEND_FE(aws_crt_signing_config_aws_set_expiration_in_seconds, arginfo_aws_crt_signing_config_aws_set_expiration_in_seconds)
|
||||
ZEND_FE(aws_crt_signing_config_aws_set_date, arginfo_aws_crt_signing_config_aws_set_date)
|
||||
ZEND_FE(aws_crt_signing_config_aws_set_should_sign_header_fn, arginfo_aws_crt_signing_config_aws_set_should_sign_header_fn)
|
||||
ZEND_FE(aws_crt_signable_new_from_http_request, arginfo_aws_crt_signable_new_from_http_request)
|
||||
ZEND_FE(aws_crt_signable_new_from_chunk, arginfo_aws_crt_signable_new_from_chunk)
|
||||
ZEND_FE(aws_crt_signable_new_from_canonical_request, arginfo_aws_crt_signable_new_from_canonical_request)
|
||||
ZEND_FE(aws_crt_signable_release, arginfo_aws_crt_signable_release)
|
||||
ZEND_FE(aws_crt_signing_result_release, arginfo_aws_crt_signing_result_release)
|
||||
ZEND_FE(aws_crt_signing_result_apply_to_http_request, arginfo_aws_crt_signing_result_apply_to_http_request)
|
||||
ZEND_FE(aws_crt_sign_request_aws, arginfo_aws_crt_sign_request_aws)
|
||||
ZEND_FE(aws_crt_test_verify_sigv4a_signing, arginfo_aws_crt_test_verify_sigv4a_signing)
|
||||
ZEND_FE(aws_crt_crc32, arginfo_aws_crt_crc32)
|
||||
ZEND_FE(aws_crt_crc32c, arginfo_aws_crt_crc32c)
|
||||
ZEND_FE_END
|
||||
};
|
||||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: 344f9d59b85697b80bb6808ac7d5eb7c1d07c03f */
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_last_error, 0, 0, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_error_name, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, error_code)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_aws_crt_error_str arginfo_aws_crt_error_name
|
||||
|
||||
#define arginfo_aws_crt_error_debug_str arginfo_aws_crt_error_name
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_log_to_stdout, 0, 0, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_aws_crt_log_to_stderr arginfo_aws_crt_log_to_stdout
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_log_to_file, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, filename)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_log_to_stream, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, stream)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_aws_crt_log_stop arginfo_aws_crt_log_to_stdout
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_log_set_level, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, level)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_log_message, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, message)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_aws_crt_event_loop_group_options_new arginfo_aws_crt_last_error
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_event_loop_group_options_release, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, elg_options)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_event_loop_group_options_set_max_threads, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, elg_options)
|
||||
ZEND_ARG_INFO(0, max_threads)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_event_loop_group_new, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, options)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_event_loop_group_release, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, event_loop_group)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_input_stream_options_new, 0, 0, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_input_stream_options_release, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, options)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_input_stream_options_set_user_data, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, options)
|
||||
ZEND_ARG_INFO(0, user_data)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_aws_crt_input_stream_new arginfo_aws_crt_event_loop_group_new
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_input_stream_release, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, stream)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_input_stream_seek, 0, 0, 3)
|
||||
ZEND_ARG_INFO(0, stream)
|
||||
ZEND_ARG_INFO(0, offset)
|
||||
ZEND_ARG_INFO(0, basis)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_input_stream_read, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, stream)
|
||||
ZEND_ARG_INFO(0, length)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_input_stream_eof, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, stream)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_input_stream_get_length, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, stream)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_http_message_new_from_blob, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, blob)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_http_message_to_blob, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, message)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_http_message_release, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, message)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_aws_crt_credentials_options_new arginfo_aws_crt_input_stream_options_new
|
||||
|
||||
#define arginfo_aws_crt_credentials_options_release arginfo_aws_crt_input_stream_options_release
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_credentials_options_set_access_key_id, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, options)
|
||||
ZEND_ARG_INFO(0, access_key_id)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_credentials_options_set_secret_access_key, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, options)
|
||||
ZEND_ARG_INFO(0, secret_access_key)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_credentials_options_set_session_token, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, options)
|
||||
ZEND_ARG_INFO(0, session_token)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_credentials_options_set_expiration_timepoint_seconds, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, options)
|
||||
ZEND_ARG_INFO(0, expiration_timepoint_seconds)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_aws_crt_credentials_new arginfo_aws_crt_event_loop_group_new
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_credentials_release, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, credentials)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_credentials_provider_release, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, credentials)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_aws_crt_credentials_provider_static_options_new arginfo_aws_crt_input_stream_options_new
|
||||
|
||||
#define arginfo_aws_crt_credentials_provider_static_options_release arginfo_aws_crt_input_stream_options_release
|
||||
|
||||
#define arginfo_aws_crt_credentials_provider_static_options_set_access_key_id arginfo_aws_crt_credentials_options_set_access_key_id
|
||||
|
||||
#define arginfo_aws_crt_credentials_provider_static_options_set_secret_access_key arginfo_aws_crt_credentials_options_set_secret_access_key
|
||||
|
||||
#define arginfo_aws_crt_credentials_provider_static_options_set_session_token arginfo_aws_crt_credentials_options_set_session_token
|
||||
|
||||
#define arginfo_aws_crt_credentials_provider_static_new arginfo_aws_crt_event_loop_group_new
|
||||
|
||||
#define arginfo_aws_crt_signing_config_aws_new arginfo_aws_crt_last_error
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_release, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_algorithm, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_ARG_INFO(0, algorithm)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_signature_type, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_ARG_INFO(0, signature_type)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_credentials_provider, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_ARG_INFO(0, credentials_provider)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_region, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_ARG_INFO(0, region)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_service, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_ARG_INFO(0, service)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_use_double_uri_encode, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_ARG_INFO(0, use_double_uri_encode)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_should_normalize_uri_path, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_ARG_INFO(0, should_normalize_uri_path)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_omit_session_token, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_ARG_INFO(0, omit_session_token)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_signed_body_value, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_ARG_INFO(0, signed_body_value)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_signed_body_header_type, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_ARG_INFO(0, signed_body_header_type)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_expiration_in_seconds, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_ARG_INFO(0, expiration_in_seconds)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_date, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_ARG_INFO(0, timestamp)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_config_aws_set_should_sign_header_fn, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, config)
|
||||
ZEND_ARG_INFO(0, should_sign_header)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signable_new_from_http_request, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, http_message)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signable_new_from_chunk, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, input_stream)
|
||||
ZEND_ARG_INFO(0, previous_signature)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signable_new_from_canonical_request, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, request)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signable_release, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, signable)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_result_release, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, signing_result)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_signing_result_apply_to_http_request, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, signing_result)
|
||||
ZEND_ARG_INFO(0, http_request)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_sign_request_aws, 0, 0, 4)
|
||||
ZEND_ARG_INFO(0, signable)
|
||||
ZEND_ARG_INFO(0, signing_config)
|
||||
ZEND_ARG_INFO(0, on_complete)
|
||||
ZEND_ARG_INFO(0, user_data)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_test_verify_sigv4a_signing, 0, 0, 6)
|
||||
ZEND_ARG_INFO(0, signable)
|
||||
ZEND_ARG_INFO(0, signing_config)
|
||||
ZEND_ARG_INFO(0, expected_canonical_request)
|
||||
ZEND_ARG_INFO(0, signature)
|
||||
ZEND_ARG_INFO(0, ecc_key_pub_x)
|
||||
ZEND_ARG_INFO(0, ecc_key_pub_y)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_aws_crt_crc32, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, input)
|
||||
ZEND_ARG_INFO(0, prev)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_aws_crt_crc32c arginfo_aws_crt_crc32
|
||||
|
||||
|
||||
ZEND_FUNCTION(aws_crt_last_error);
|
||||
ZEND_FUNCTION(aws_crt_error_name);
|
||||
ZEND_FUNCTION(aws_crt_error_str);
|
||||
ZEND_FUNCTION(aws_crt_error_debug_str);
|
||||
ZEND_FUNCTION(aws_crt_log_to_stdout);
|
||||
ZEND_FUNCTION(aws_crt_log_to_stderr);
|
||||
ZEND_FUNCTION(aws_crt_log_to_file);
|
||||
ZEND_FUNCTION(aws_crt_log_to_stream);
|
||||
ZEND_FUNCTION(aws_crt_log_stop);
|
||||
ZEND_FUNCTION(aws_crt_log_set_level);
|
||||
ZEND_FUNCTION(aws_crt_log_message);
|
||||
ZEND_FUNCTION(aws_crt_event_loop_group_options_new);
|
||||
ZEND_FUNCTION(aws_crt_event_loop_group_options_release);
|
||||
ZEND_FUNCTION(aws_crt_event_loop_group_options_set_max_threads);
|
||||
ZEND_FUNCTION(aws_crt_event_loop_group_new);
|
||||
ZEND_FUNCTION(aws_crt_event_loop_group_release);
|
||||
ZEND_FUNCTION(aws_crt_input_stream_options_new);
|
||||
ZEND_FUNCTION(aws_crt_input_stream_options_release);
|
||||
ZEND_FUNCTION(aws_crt_input_stream_options_set_user_data);
|
||||
ZEND_FUNCTION(aws_crt_input_stream_new);
|
||||
ZEND_FUNCTION(aws_crt_input_stream_release);
|
||||
ZEND_FUNCTION(aws_crt_input_stream_seek);
|
||||
ZEND_FUNCTION(aws_crt_input_stream_read);
|
||||
ZEND_FUNCTION(aws_crt_input_stream_eof);
|
||||
ZEND_FUNCTION(aws_crt_input_stream_get_length);
|
||||
ZEND_FUNCTION(aws_crt_http_message_new_from_blob);
|
||||
ZEND_FUNCTION(aws_crt_http_message_to_blob);
|
||||
ZEND_FUNCTION(aws_crt_http_message_release);
|
||||
ZEND_FUNCTION(aws_crt_credentials_options_new);
|
||||
ZEND_FUNCTION(aws_crt_credentials_options_release);
|
||||
ZEND_FUNCTION(aws_crt_credentials_options_set_access_key_id);
|
||||
ZEND_FUNCTION(aws_crt_credentials_options_set_secret_access_key);
|
||||
ZEND_FUNCTION(aws_crt_credentials_options_set_session_token);
|
||||
ZEND_FUNCTION(aws_crt_credentials_options_set_expiration_timepoint_seconds);
|
||||
ZEND_FUNCTION(aws_crt_credentials_new);
|
||||
ZEND_FUNCTION(aws_crt_credentials_release);
|
||||
ZEND_FUNCTION(aws_crt_credentials_provider_release);
|
||||
ZEND_FUNCTION(aws_crt_credentials_provider_static_options_new);
|
||||
ZEND_FUNCTION(aws_crt_credentials_provider_static_options_release);
|
||||
ZEND_FUNCTION(aws_crt_credentials_provider_static_options_set_access_key_id);
|
||||
ZEND_FUNCTION(aws_crt_credentials_provider_static_options_set_secret_access_key);
|
||||
ZEND_FUNCTION(aws_crt_credentials_provider_static_options_set_session_token);
|
||||
ZEND_FUNCTION(aws_crt_credentials_provider_static_new);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_new);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_release);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_set_algorithm);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_set_signature_type);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_set_credentials_provider);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_set_region);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_set_service);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_set_use_double_uri_encode);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_set_should_normalize_uri_path);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_set_omit_session_token);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_set_signed_body_value);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_set_signed_body_header_type);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_set_expiration_in_seconds);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_set_date);
|
||||
ZEND_FUNCTION(aws_crt_signing_config_aws_set_should_sign_header_fn);
|
||||
ZEND_FUNCTION(aws_crt_signable_new_from_http_request);
|
||||
ZEND_FUNCTION(aws_crt_signable_new_from_chunk);
|
||||
ZEND_FUNCTION(aws_crt_signable_new_from_canonical_request);
|
||||
ZEND_FUNCTION(aws_crt_signable_release);
|
||||
ZEND_FUNCTION(aws_crt_signing_result_release);
|
||||
ZEND_FUNCTION(aws_crt_signing_result_apply_to_http_request);
|
||||
ZEND_FUNCTION(aws_crt_sign_request_aws);
|
||||
ZEND_FUNCTION(aws_crt_test_verify_sigv4a_signing);
|
||||
ZEND_FUNCTION(aws_crt_crc32);
|
||||
ZEND_FUNCTION(aws_crt_crc32c);
|
||||
|
||||
|
||||
static const zend_function_entry ext_functions[] = {
|
||||
ZEND_FE(aws_crt_last_error, arginfo_aws_crt_last_error)
|
||||
ZEND_FE(aws_crt_error_name, arginfo_aws_crt_error_name)
|
||||
ZEND_FE(aws_crt_error_str, arginfo_aws_crt_error_str)
|
||||
ZEND_FE(aws_crt_error_debug_str, arginfo_aws_crt_error_debug_str)
|
||||
ZEND_FE(aws_crt_log_to_stdout, arginfo_aws_crt_log_to_stdout)
|
||||
ZEND_FE(aws_crt_log_to_stderr, arginfo_aws_crt_log_to_stderr)
|
||||
ZEND_FE(aws_crt_log_to_file, arginfo_aws_crt_log_to_file)
|
||||
ZEND_FE(aws_crt_log_to_stream, arginfo_aws_crt_log_to_stream)
|
||||
ZEND_FE(aws_crt_log_stop, arginfo_aws_crt_log_stop)
|
||||
ZEND_FE(aws_crt_log_set_level, arginfo_aws_crt_log_set_level)
|
||||
ZEND_FE(aws_crt_log_message, arginfo_aws_crt_log_message)
|
||||
ZEND_FE(aws_crt_event_loop_group_options_new, arginfo_aws_crt_event_loop_group_options_new)
|
||||
ZEND_FE(aws_crt_event_loop_group_options_release, arginfo_aws_crt_event_loop_group_options_release)
|
||||
ZEND_FE(aws_crt_event_loop_group_options_set_max_threads, arginfo_aws_crt_event_loop_group_options_set_max_threads)
|
||||
ZEND_FE(aws_crt_event_loop_group_new, arginfo_aws_crt_event_loop_group_new)
|
||||
ZEND_FE(aws_crt_event_loop_group_release, arginfo_aws_crt_event_loop_group_release)
|
||||
ZEND_FE(aws_crt_input_stream_options_new, arginfo_aws_crt_input_stream_options_new)
|
||||
ZEND_FE(aws_crt_input_stream_options_release, arginfo_aws_crt_input_stream_options_release)
|
||||
ZEND_FE(aws_crt_input_stream_options_set_user_data, arginfo_aws_crt_input_stream_options_set_user_data)
|
||||
ZEND_FE(aws_crt_input_stream_new, arginfo_aws_crt_input_stream_new)
|
||||
ZEND_FE(aws_crt_input_stream_release, arginfo_aws_crt_input_stream_release)
|
||||
ZEND_FE(aws_crt_input_stream_seek, arginfo_aws_crt_input_stream_seek)
|
||||
ZEND_FE(aws_crt_input_stream_read, arginfo_aws_crt_input_stream_read)
|
||||
ZEND_FE(aws_crt_input_stream_eof, arginfo_aws_crt_input_stream_eof)
|
||||
ZEND_FE(aws_crt_input_stream_get_length, arginfo_aws_crt_input_stream_get_length)
|
||||
ZEND_FE(aws_crt_http_message_new_from_blob, arginfo_aws_crt_http_message_new_from_blob)
|
||||
ZEND_FE(aws_crt_http_message_to_blob, arginfo_aws_crt_http_message_to_blob)
|
||||
ZEND_FE(aws_crt_http_message_release, arginfo_aws_crt_http_message_release)
|
||||
ZEND_FE(aws_crt_credentials_options_new, arginfo_aws_crt_credentials_options_new)
|
||||
ZEND_FE(aws_crt_credentials_options_release, arginfo_aws_crt_credentials_options_release)
|
||||
ZEND_FE(aws_crt_credentials_options_set_access_key_id, arginfo_aws_crt_credentials_options_set_access_key_id)
|
||||
ZEND_FE(aws_crt_credentials_options_set_secret_access_key, arginfo_aws_crt_credentials_options_set_secret_access_key)
|
||||
ZEND_FE(aws_crt_credentials_options_set_session_token, arginfo_aws_crt_credentials_options_set_session_token)
|
||||
ZEND_FE(aws_crt_credentials_options_set_expiration_timepoint_seconds, arginfo_aws_crt_credentials_options_set_expiration_timepoint_seconds)
|
||||
ZEND_FE(aws_crt_credentials_new, arginfo_aws_crt_credentials_new)
|
||||
ZEND_FE(aws_crt_credentials_release, arginfo_aws_crt_credentials_release)
|
||||
ZEND_FE(aws_crt_credentials_provider_release, arginfo_aws_crt_credentials_provider_release)
|
||||
ZEND_FE(aws_crt_credentials_provider_static_options_new, arginfo_aws_crt_credentials_provider_static_options_new)
|
||||
ZEND_FE(aws_crt_credentials_provider_static_options_release, arginfo_aws_crt_credentials_provider_static_options_release)
|
||||
ZEND_FE(aws_crt_credentials_provider_static_options_set_access_key_id, arginfo_aws_crt_credentials_provider_static_options_set_access_key_id)
|
||||
ZEND_FE(aws_crt_credentials_provider_static_options_set_secret_access_key, arginfo_aws_crt_credentials_provider_static_options_set_secret_access_key)
|
||||
ZEND_FE(aws_crt_credentials_provider_static_options_set_session_token, arginfo_aws_crt_credentials_provider_static_options_set_session_token)
|
||||
ZEND_FE(aws_crt_credentials_provider_static_new, arginfo_aws_crt_credentials_provider_static_new)
|
||||
ZEND_FE(aws_crt_signing_config_aws_new, arginfo_aws_crt_signing_config_aws_new)
|
||||
ZEND_FE(aws_crt_signing_config_aws_release, arginfo_aws_crt_signing_config_aws_release)
|
||||
ZEND_FE(aws_crt_signing_config_aws_set_algorithm, arginfo_aws_crt_signing_config_aws_set_algorithm)
|
||||
ZEND_FE(aws_crt_signing_config_aws_set_signature_type, arginfo_aws_crt_signing_config_aws_set_signature_type)
|
||||
ZEND_FE(aws_crt_signing_config_aws_set_credentials_provider, arginfo_aws_crt_signing_config_aws_set_credentials_provider)
|
||||
ZEND_FE(aws_crt_signing_config_aws_set_region, arginfo_aws_crt_signing_config_aws_set_region)
|
||||
ZEND_FE(aws_crt_signing_config_aws_set_service, arginfo_aws_crt_signing_config_aws_set_service)
|
||||
ZEND_FE(aws_crt_signing_config_aws_set_use_double_uri_encode, arginfo_aws_crt_signing_config_aws_set_use_double_uri_encode)
|
||||
ZEND_FE(aws_crt_signing_config_aws_set_should_normalize_uri_path, arginfo_aws_crt_signing_config_aws_set_should_normalize_uri_path)
|
||||
ZEND_FE(aws_crt_signing_config_aws_set_omit_session_token, arginfo_aws_crt_signing_config_aws_set_omit_session_token)
|
||||
ZEND_FE(aws_crt_signing_config_aws_set_signed_body_value, arginfo_aws_crt_signing_config_aws_set_signed_body_value)
|
||||
ZEND_FE(aws_crt_signing_config_aws_set_signed_body_header_type, arginfo_aws_crt_signing_config_aws_set_signed_body_header_type)
|
||||
ZEND_FE(aws_crt_signing_config_aws_set_expiration_in_seconds, arginfo_aws_crt_signing_config_aws_set_expiration_in_seconds)
|
||||
ZEND_FE(aws_crt_signing_config_aws_set_date, arginfo_aws_crt_signing_config_aws_set_date)
|
||||
ZEND_FE(aws_crt_signing_config_aws_set_should_sign_header_fn, arginfo_aws_crt_signing_config_aws_set_should_sign_header_fn)
|
||||
ZEND_FE(aws_crt_signable_new_from_http_request, arginfo_aws_crt_signable_new_from_http_request)
|
||||
ZEND_FE(aws_crt_signable_new_from_chunk, arginfo_aws_crt_signable_new_from_chunk)
|
||||
ZEND_FE(aws_crt_signable_new_from_canonical_request, arginfo_aws_crt_signable_new_from_canonical_request)
|
||||
ZEND_FE(aws_crt_signable_release, arginfo_aws_crt_signable_release)
|
||||
ZEND_FE(aws_crt_signing_result_release, arginfo_aws_crt_signing_result_release)
|
||||
ZEND_FE(aws_crt_signing_result_apply_to_http_request, arginfo_aws_crt_signing_result_apply_to_http_request)
|
||||
ZEND_FE(aws_crt_sign_request_aws, arginfo_aws_crt_sign_request_aws)
|
||||
ZEND_FE(aws_crt_test_verify_sigv4a_signing, arginfo_aws_crt_test_verify_sigv4a_signing)
|
||||
ZEND_FE(aws_crt_crc32, arginfo_aws_crt_crc32)
|
||||
ZEND_FE(aws_crt_crc32c, arginfo_aws_crt_crc32c)
|
||||
ZEND_FE_END
|
||||
};
|
||||
|
|
64
vendor/aws/aws-crt-php/ext/crc.c
vendored
64
vendor/aws/aws-crt-php/ext/crc.c
vendored
|
@ -1,32 +1,32 @@
|
|||
/**
|
||||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0.
|
||||
*/
|
||||
|
||||
#include "php_aws_crt.h"
|
||||
|
||||
PHP_FUNCTION(aws_crt_crc32) {
|
||||
zend_ulong prev = 0;
|
||||
const char *input = NULL;
|
||||
size_t len = 0;
|
||||
|
||||
aws_php_parse_parameters("sl", &input, &len, &prev);
|
||||
|
||||
if (prev > UINT32_MAX) {
|
||||
aws_php_throw_exception("previous crc cannot be larger than UINT32_MAX");
|
||||
}
|
||||
RETURN_LONG((zend_ulong)aws_crt_crc32((const uint8_t *)input, len, prev));
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_crc32c) {
|
||||
zend_ulong prev = 0;
|
||||
const char *input = NULL;
|
||||
size_t len = 0;
|
||||
|
||||
aws_php_parse_parameters("sl", &input, &len, &prev);
|
||||
|
||||
if (prev > UINT32_MAX) {
|
||||
aws_php_throw_exception("previous crc cannot be larger than UINT32_MAX");
|
||||
}
|
||||
RETURN_LONG((zend_ulong)aws_crt_crc32c((const uint8_t *)input, len, prev));
|
||||
}
|
||||
/**
|
||||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0.
|
||||
*/
|
||||
|
||||
#include "php_aws_crt.h"
|
||||
|
||||
PHP_FUNCTION(aws_crt_crc32) {
|
||||
zend_ulong prev = 0;
|
||||
const char *input = NULL;
|
||||
size_t len = 0;
|
||||
|
||||
aws_php_parse_parameters("sl", &input, &len, &prev);
|
||||
|
||||
if (prev > UINT32_MAX) {
|
||||
aws_php_throw_exception("previous crc cannot be larger than UINT32_MAX");
|
||||
}
|
||||
RETURN_LONG((zend_ulong)aws_crt_crc32((const uint8_t *)input, len, prev));
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_crc32c) {
|
||||
zend_ulong prev = 0;
|
||||
const char *input = NULL;
|
||||
size_t len = 0;
|
||||
|
||||
aws_php_parse_parameters("sl", &input, &len, &prev);
|
||||
|
||||
if (prev > UINT32_MAX) {
|
||||
aws_php_throw_exception("previous crc cannot be larger than UINT32_MAX");
|
||||
}
|
||||
RETURN_LONG((zend_ulong)aws_crt_crc32c((const uint8_t *)input, len, prev));
|
||||
}
|
||||
|
|
308
vendor/aws/aws-crt-php/ext/credentials.c
vendored
308
vendor/aws/aws-crt-php/ext/credentials.c
vendored
|
@ -1,154 +1,154 @@
|
|||
/**
|
||||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0.
|
||||
*/
|
||||
|
||||
#include "php_aws_crt.h"
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_options_new) {
|
||||
aws_crt_credentials_options *options = aws_crt_credentials_options_new();
|
||||
RETURN_LONG((zend_ulong)options);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_options_release) {
|
||||
zend_ulong php_options = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_options);
|
||||
|
||||
aws_crt_credentials_options *options = (void *)php_options;
|
||||
aws_crt_credentials_options_release(options);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_options_set_access_key_id) {
|
||||
zend_ulong php_options = 0;
|
||||
const char *access_key_id = NULL;
|
||||
size_t access_key_id_len = 0;
|
||||
|
||||
aws_php_parse_parameters("ls", &php_options, &access_key_id, &access_key_id_len);
|
||||
|
||||
aws_crt_credentials_options *options = (void *)php_options;
|
||||
aws_crt_credentials_options_set_access_key_id(options, (uint8_t *)access_key_id, access_key_id_len);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_options_set_secret_access_key) {
|
||||
zend_ulong php_options = 0;
|
||||
const char *secret_access_key = NULL;
|
||||
size_t secret_access_key_len = 0;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &php_options, &secret_access_key, &secret_access_key_len) ==
|
||||
FAILURE) {
|
||||
RETURN_NULL();
|
||||
}
|
||||
|
||||
aws_crt_credentials_options *options = (void *)php_options;
|
||||
aws_crt_credentials_options_set_secret_access_key(options, (uint8_t *)secret_access_key, secret_access_key_len);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_options_set_session_token) {
|
||||
zend_ulong php_options = 0;
|
||||
const char *session_token = NULL;
|
||||
size_t session_token_len = 0;
|
||||
|
||||
aws_php_parse_parameters("ls", &php_options, &session_token, &session_token_len);
|
||||
|
||||
aws_crt_credentials_options *options = (void *)php_options;
|
||||
aws_crt_credentials_options_set_session_token(options, (uint8_t *)session_token, session_token_len);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_options_set_expiration_timepoint_seconds) {
|
||||
zend_ulong php_options = 0;
|
||||
zend_ulong expiration_timepoint_seconds = 0;
|
||||
aws_php_parse_parameters("ll", &php_options, &expiration_timepoint_seconds);
|
||||
|
||||
aws_crt_credentials_options *options = (void *)php_options;
|
||||
aws_crt_credentials_options_set_expiration_timepoint_seconds(options, expiration_timepoint_seconds);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_new) {
|
||||
zend_ulong php_options = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_options);
|
||||
|
||||
aws_crt_credentials_options *options = (void *)php_options;
|
||||
aws_crt_credentials *credentials = aws_crt_credentials_new(options);
|
||||
RETURN_LONG((zend_ulong)credentials);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_release) {
|
||||
zend_ulong php_credentials = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_credentials);
|
||||
|
||||
aws_crt_credentials *credentials = (void *)php_credentials;
|
||||
aws_crt_credentials_release(credentials);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_provider_release) {
|
||||
zend_ulong php_creds_provider = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_creds_provider);
|
||||
|
||||
aws_crt_credentials_provider *provider = (void *)php_creds_provider;
|
||||
aws_crt_credentials_provider_release(provider);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_provider_static_options_new) {
|
||||
aws_crt_credentials_provider_static_options *options = aws_crt_credentials_provider_static_options_new();
|
||||
RETURN_LONG((zend_ulong)options);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_provider_static_options_release) {
|
||||
zend_ulong php_options = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_options);
|
||||
|
||||
aws_crt_credentials_provider_static_options *options = (void *)php_options;
|
||||
aws_crt_credentials_provider_static_options_release(options);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_provider_static_options_set_access_key_id) {
|
||||
zend_ulong php_options = 0;
|
||||
const char *access_key_id = NULL;
|
||||
size_t access_key_id_len = 0;
|
||||
|
||||
aws_php_parse_parameters("ls", &php_options, &access_key_id, &access_key_id_len);
|
||||
|
||||
aws_crt_credentials_provider_static_options *options = (void *)php_options;
|
||||
aws_crt_credentials_provider_static_options_set_access_key_id(options, (uint8_t *)access_key_id, access_key_id_len);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_provider_static_options_set_secret_access_key) {
|
||||
zend_ulong php_options = 0;
|
||||
const char *secret_access_key = NULL;
|
||||
size_t secret_access_key_len = 0;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &php_options, &secret_access_key, &secret_access_key_len) ==
|
||||
FAILURE) {
|
||||
RETURN_NULL();
|
||||
}
|
||||
|
||||
aws_crt_credentials_provider_static_options *options = (void *)php_options;
|
||||
aws_crt_credentials_provider_static_options_set_secret_access_key(
|
||||
options, (uint8_t *)secret_access_key, secret_access_key_len);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_provider_static_options_set_session_token) {
|
||||
zend_ulong php_options = 0;
|
||||
const char *session_token = NULL;
|
||||
size_t session_token_len = 0;
|
||||
|
||||
aws_php_parse_parameters("ls", &php_options, &session_token, &session_token_len);
|
||||
|
||||
aws_crt_credentials_provider_static_options *options = (void *)php_options;
|
||||
aws_crt_credentials_provider_static_options_set_session_token(options, (uint8_t *)session_token, session_token_len);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_provider_static_new) {
|
||||
zend_ulong php_options = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_options);
|
||||
|
||||
aws_crt_credentials_provider_static_options *options = (void *)php_options;
|
||||
aws_crt_credentials_provider *provider = aws_crt_credentials_provider_static_new(options);
|
||||
RETURN_LONG((zend_ulong)provider);
|
||||
}
|
||||
/**
|
||||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0.
|
||||
*/
|
||||
|
||||
#include "php_aws_crt.h"
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_options_new) {
|
||||
aws_crt_credentials_options *options = aws_crt_credentials_options_new();
|
||||
RETURN_LONG((zend_ulong)options);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_options_release) {
|
||||
zend_ulong php_options = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_options);
|
||||
|
||||
aws_crt_credentials_options *options = (void *)php_options;
|
||||
aws_crt_credentials_options_release(options);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_options_set_access_key_id) {
|
||||
zend_ulong php_options = 0;
|
||||
const char *access_key_id = NULL;
|
||||
size_t access_key_id_len = 0;
|
||||
|
||||
aws_php_parse_parameters("ls", &php_options, &access_key_id, &access_key_id_len);
|
||||
|
||||
aws_crt_credentials_options *options = (void *)php_options;
|
||||
aws_crt_credentials_options_set_access_key_id(options, (uint8_t *)access_key_id, access_key_id_len);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_options_set_secret_access_key) {
|
||||
zend_ulong php_options = 0;
|
||||
const char *secret_access_key = NULL;
|
||||
size_t secret_access_key_len = 0;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &php_options, &secret_access_key, &secret_access_key_len) ==
|
||||
FAILURE) {
|
||||
RETURN_NULL();
|
||||
}
|
||||
|
||||
aws_crt_credentials_options *options = (void *)php_options;
|
||||
aws_crt_credentials_options_set_secret_access_key(options, (uint8_t *)secret_access_key, secret_access_key_len);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_options_set_session_token) {
|
||||
zend_ulong php_options = 0;
|
||||
const char *session_token = NULL;
|
||||
size_t session_token_len = 0;
|
||||
|
||||
aws_php_parse_parameters("ls", &php_options, &session_token, &session_token_len);
|
||||
|
||||
aws_crt_credentials_options *options = (void *)php_options;
|
||||
aws_crt_credentials_options_set_session_token(options, (uint8_t *)session_token, session_token_len);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_options_set_expiration_timepoint_seconds) {
|
||||
zend_ulong php_options = 0;
|
||||
zend_ulong expiration_timepoint_seconds = 0;
|
||||
aws_php_parse_parameters("ll", &php_options, &expiration_timepoint_seconds);
|
||||
|
||||
aws_crt_credentials_options *options = (void *)php_options;
|
||||
aws_crt_credentials_options_set_expiration_timepoint_seconds(options, expiration_timepoint_seconds);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_new) {
|
||||
zend_ulong php_options = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_options);
|
||||
|
||||
aws_crt_credentials_options *options = (void *)php_options;
|
||||
aws_crt_credentials *credentials = aws_crt_credentials_new(options);
|
||||
RETURN_LONG((zend_ulong)credentials);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_release) {
|
||||
zend_ulong php_credentials = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_credentials);
|
||||
|
||||
aws_crt_credentials *credentials = (void *)php_credentials;
|
||||
aws_crt_credentials_release(credentials);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_provider_release) {
|
||||
zend_ulong php_creds_provider = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_creds_provider);
|
||||
|
||||
aws_crt_credentials_provider *provider = (void *)php_creds_provider;
|
||||
aws_crt_credentials_provider_release(provider);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_provider_static_options_new) {
|
||||
aws_crt_credentials_provider_static_options *options = aws_crt_credentials_provider_static_options_new();
|
||||
RETURN_LONG((zend_ulong)options);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_provider_static_options_release) {
|
||||
zend_ulong php_options = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_options);
|
||||
|
||||
aws_crt_credentials_provider_static_options *options = (void *)php_options;
|
||||
aws_crt_credentials_provider_static_options_release(options);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_provider_static_options_set_access_key_id) {
|
||||
zend_ulong php_options = 0;
|
||||
const char *access_key_id = NULL;
|
||||
size_t access_key_id_len = 0;
|
||||
|
||||
aws_php_parse_parameters("ls", &php_options, &access_key_id, &access_key_id_len);
|
||||
|
||||
aws_crt_credentials_provider_static_options *options = (void *)php_options;
|
||||
aws_crt_credentials_provider_static_options_set_access_key_id(options, (uint8_t *)access_key_id, access_key_id_len);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_provider_static_options_set_secret_access_key) {
|
||||
zend_ulong php_options = 0;
|
||||
const char *secret_access_key = NULL;
|
||||
size_t secret_access_key_len = 0;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &php_options, &secret_access_key, &secret_access_key_len) ==
|
||||
FAILURE) {
|
||||
RETURN_NULL();
|
||||
}
|
||||
|
||||
aws_crt_credentials_provider_static_options *options = (void *)php_options;
|
||||
aws_crt_credentials_provider_static_options_set_secret_access_key(
|
||||
options, (uint8_t *)secret_access_key, secret_access_key_len);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_provider_static_options_set_session_token) {
|
||||
zend_ulong php_options = 0;
|
||||
const char *session_token = NULL;
|
||||
size_t session_token_len = 0;
|
||||
|
||||
aws_php_parse_parameters("ls", &php_options, &session_token, &session_token_len);
|
||||
|
||||
aws_crt_credentials_provider_static_options *options = (void *)php_options;
|
||||
aws_crt_credentials_provider_static_options_set_session_token(options, (uint8_t *)session_token, session_token_len);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_credentials_provider_static_new) {
|
||||
zend_ulong php_options = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_options);
|
||||
|
||||
aws_crt_credentials_provider_static_options *options = (void *)php_options;
|
||||
aws_crt_credentials_provider *provider = aws_crt_credentials_provider_static_new(options);
|
||||
RETURN_LONG((zend_ulong)provider);
|
||||
}
|
||||
|
|
130
vendor/aws/aws-crt-php/ext/logging.c
vendored
130
vendor/aws/aws-crt-php/ext/logging.c
vendored
|
@ -1,65 +1,65 @@
|
|||
/**
|
||||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0.
|
||||
*/
|
||||
|
||||
#include "php_aws_crt.h"
|
||||
|
||||
PHP_FUNCTION(aws_crt_log_to_stdout) {
|
||||
aws_php_parse_parameters_none();
|
||||
aws_crt_log_to_stdout();
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_log_to_stderr) {
|
||||
aws_php_parse_parameters_none();
|
||||
aws_crt_log_to_stderr();
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_log_to_file) {
|
||||
const char *filename = NULL;
|
||||
size_t filename_len = 0;
|
||||
/* read the filename as a path, which guarantees no NUL bytes */
|
||||
aws_php_parse_parameters("p", &filename, &filename_len);
|
||||
aws_crt_log_to_file(filename);
|
||||
}
|
||||
|
||||
static void php_crt_log(const char *message, size_t len, void *user_data) {
|
||||
php_stream *stream = user_data;
|
||||
php_stream_write(stream, message, len);
|
||||
php_stream_flush(stream);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_log_to_stream) {
|
||||
zval *php_log_stream = NULL;
|
||||
aws_php_parse_parameters("r", &php_log_stream);
|
||||
|
||||
if (php_log_stream) {
|
||||
php_stream *stream = NULL;
|
||||
Z_ADDREF(*php_log_stream);
|
||||
AWS_PHP_STREAM_FROM_ZVAL(stream, php_log_stream);
|
||||
aws_crt_log_to_callback((aws_crt_log_callback *)php_crt_log, stream);
|
||||
} else {
|
||||
aws_crt_log_to_callback(NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_log_set_level) {
|
||||
zend_ulong log_level = 0;
|
||||
aws_php_parse_parameters("l", &log_level);
|
||||
aws_crt_log_set_level((aws_crt_log_level)log_level);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_log_stop) {
|
||||
aws_php_parse_parameters_none();
|
||||
aws_crt_log_stop();
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_log_message) {
|
||||
zend_ulong log_level = 0;
|
||||
const char *message = NULL;
|
||||
size_t message_len = 0;
|
||||
|
||||
aws_php_parse_parameters("ls", &log_level, &message, &message_len);
|
||||
|
||||
aws_crt_log_message((aws_crt_log_level)log_level, (const uint8_t *)message, message_len);
|
||||
}
|
||||
/**
|
||||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0.
|
||||
*/
|
||||
|
||||
#include "php_aws_crt.h"
|
||||
|
||||
PHP_FUNCTION(aws_crt_log_to_stdout) {
|
||||
aws_php_parse_parameters_none();
|
||||
aws_crt_log_to_stdout();
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_log_to_stderr) {
|
||||
aws_php_parse_parameters_none();
|
||||
aws_crt_log_to_stderr();
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_log_to_file) {
|
||||
const char *filename = NULL;
|
||||
size_t filename_len = 0;
|
||||
/* read the filename as a path, which guarantees no NUL bytes */
|
||||
aws_php_parse_parameters("p", &filename, &filename_len);
|
||||
aws_crt_log_to_file(filename);
|
||||
}
|
||||
|
||||
static void php_crt_log(const char *message, size_t len, void *user_data) {
|
||||
php_stream *stream = user_data;
|
||||
php_stream_write(stream, message, len);
|
||||
php_stream_flush(stream);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_log_to_stream) {
|
||||
zval *php_log_stream = NULL;
|
||||
aws_php_parse_parameters("r", &php_log_stream);
|
||||
|
||||
if (php_log_stream) {
|
||||
php_stream *stream = NULL;
|
||||
Z_ADDREF(*php_log_stream);
|
||||
AWS_PHP_STREAM_FROM_ZVAL(stream, php_log_stream);
|
||||
aws_crt_log_to_callback((aws_crt_log_callback *)php_crt_log, stream);
|
||||
} else {
|
||||
aws_crt_log_to_callback(NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_log_set_level) {
|
||||
zend_ulong log_level = 0;
|
||||
aws_php_parse_parameters("l", &log_level);
|
||||
aws_crt_log_set_level((aws_crt_log_level)log_level);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_log_stop) {
|
||||
aws_php_parse_parameters_none();
|
||||
aws_crt_log_stop();
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_log_message) {
|
||||
zend_ulong log_level = 0;
|
||||
const char *message = NULL;
|
||||
size_t message_len = 0;
|
||||
|
||||
aws_php_parse_parameters("ls", &log_level, &message, &message_len);
|
||||
|
||||
aws_crt_log_message((aws_crt_log_level)log_level, (const uint8_t *)message, message_len);
|
||||
}
|
||||
|
|
342
vendor/aws/aws-crt-php/ext/php_aws_crt.h
vendored
342
vendor/aws/aws-crt-php/ext/php_aws_crt.h
vendored
|
@ -1,171 +1,171 @@
|
|||
|
||||
#ifndef PHP_AWS_CRT_H
|
||||
#define PHP_AWS_CRT_H
|
||||
|
||||
/**
|
||||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include "php.h"
|
||||
|
||||
#include "Zend/zend_extensions.h" /* for ZEND_EXTENSION_API_NO */
|
||||
|
||||
#include <aws/common/common.h>
|
||||
#include <aws/common/mutex.h>
|
||||
#include <aws/common/promise.h>
|
||||
#include <aws/common/thread.h>
|
||||
|
||||
/* ZEND_EXTENSION_API_NO from each branch of the PHP source */
|
||||
#define AWS_PHP_EXTENSION_API_5_5 220121212
|
||||
#define AWS_PHP_EXTENSION_API_5_6 220131226
|
||||
#define AWS_PHP_EXTENSION_API_7_0 320151012
|
||||
#define AWS_PHP_EXTENSION_API_7_1 320160303
|
||||
#define AWS_PHP_EXTENSION_API_7_2 320170718
|
||||
#define AWS_PHP_EXTENSION_API_7_3 320180731
|
||||
#define AWS_PHP_EXTENSION_API_7_4 320190902
|
||||
#define AWS_PHP_EXTENSION_API_8_0 420200930
|
||||
|
||||
#if ZEND_EXTENSION_API_NO < AWS_PHP_EXTENSION_API_5_5
|
||||
# error "PHP >= 5.5 is required"
|
||||
#endif
|
||||
|
||||
#define AWS_PHP_AT_LEAST_7 (ZEND_EXTENSION_API_NO >= AWS_PHP_EXTENSION_API_7_0)
|
||||
#define AWS_PHP_AT_LEAST_7_2 (ZEND_EXTENSION_API_NO >= AWS_PHP_EXTENSION_API_7_2)
|
||||
|
||||
ZEND_BEGIN_MODULE_GLOBALS(awscrt)
|
||||
long log_level;
|
||||
ZEND_END_MODULE_GLOBALS(awscrt)
|
||||
|
||||
ZEND_EXTERN_MODULE_GLOBALS(awscrt)
|
||||
|
||||
#define AWSCRT_GLOBAL(v) ZEND_MODULE_GLOBALS_ACCESSOR(awscrt, v)
|
||||
|
||||
#if AWS_PHP_AT_LEAST_7
|
||||
/* PHP 7 takes a zval*, PHP5 takes a zval** */
|
||||
# define AWS_PHP_STREAM_FROM_ZVAL(s, z) php_stream_from_zval(s, z)
|
||||
#define XRETURN_STRINGL RETURN_STRINGL
|
||||
#define XRETURN_STRING RETURN_STRING
|
||||
#define XRETVAL_STRINGL RETVAL_STRINGL
|
||||
#define XRETVAL_STRING RETVAL_STRING
|
||||
#else /* PHP 5.5-5.6 */
|
||||
# define AWS_PHP_STREAM_FROM_ZVAL(s, z) php_stream_from_zval(s, &z)
|
||||
#define XRETURN_STRINGL(s, l) RETURN_STRINGL(s, l, 1)
|
||||
#define XRETURN_STRING(s) RETURN_STRING(s, 1)
|
||||
#define XRETVAL_STRINGL(s, l) RETVAL_STRINGL(s, l, 1)
|
||||
#define XRETVAL_STRING(s) RETVAL_STRING(s, 1)
|
||||
#endif /* PHP 5.x */
|
||||
|
||||
#include "api.h"
|
||||
#include "awscrt_arginfo.h"
|
||||
|
||||
/* Utility macros borrowed from common */
|
||||
#define GLUE(x, y) x y
|
||||
|
||||
#define RETURN_ARG_COUNT(_1_, _2_, _3_, _4_, _5_, count, ...) count
|
||||
#define EXPAND_ARGS(args) RETURN_ARG_COUNT args
|
||||
#define COUNT_ARGS_MAX5(...) EXPAND_ARGS((__VA_ARGS__, 5, 4, 3, 2, 1, 0))
|
||||
|
||||
#define OVERLOAD_MACRO2(name, count) name##count
|
||||
#define OVERLOAD_MACRO1(name, count) OVERLOAD_MACRO2(name, count)
|
||||
#define OVERLOAD_MACRO(name, count) OVERLOAD_MACRO1(name, count)
|
||||
|
||||
#define CALL_OVERLOAD(name, ...) GLUE(OVERLOAD_MACRO(name, COUNT_ARGS_MAX5(__VA_ARGS__)), (__VA_ARGS__))
|
||||
|
||||
#define VARIABLE_LENGTH_ARRAY(type, name, length) type *name = alloca(sizeof(type) * (length))
|
||||
|
||||
/*
|
||||
* PHP utility APIs for this extension
|
||||
*/
|
||||
/*
|
||||
* Exception throwing mechanism, will never return
|
||||
*/
|
||||
#define aws_php_throw_exception(...) CALL_OVERLOAD(_AWS_PHP_THROW_EXCEPTION, __VA_ARGS__);
|
||||
#define _AWS_PHP_THROW_EXCEPTION5(format, ...) zend_error_noreturn(E_ERROR, format, __VA_ARGS__)
|
||||
#define _AWS_PHP_THROW_EXCEPTION4(format, ...) zend_error_noreturn(E_ERROR, format, __VA_ARGS__)
|
||||
#define _AWS_PHP_THROW_EXCEPTION3(format, ...) zend_error_noreturn(E_ERROR, format, __VA_ARGS__)
|
||||
#define _AWS_PHP_THROW_EXCEPTION2(format, ...) zend_error_noreturn(E_ERROR, format, __VA_ARGS__)
|
||||
#define _AWS_PHP_THROW_EXCEPTION1(format) zend_error_noreturn(E_ERROR, format)
|
||||
|
||||
/**
|
||||
* throws an exception resulting from argument parsing, notes the current function name in the exception
|
||||
*/
|
||||
#define aws_php_argparse_fail() \
|
||||
do { \
|
||||
aws_php_throw_exception("Failed to parse arguments to %s", __func__); \
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
* calls zend_parse_parameters() with the arguments and throws an exception if parsing fails
|
||||
*/
|
||||
#define aws_php_parse_parameters(type_spec, ...) \
|
||||
do { \
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), type_spec, __VA_ARGS__) == FAILURE) { \
|
||||
aws_php_argparse_fail(); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
* calls zend_parse_parameters_none() and throws an exception if parsing fails
|
||||
*/
|
||||
#define aws_php_parse_parameters_none() \
|
||||
do { \
|
||||
if (zend_parse_parameters_none() == FAILURE) { \
|
||||
aws_php_argparse_fail(); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* PHP/Zend utility functions to work across PHP versions */
|
||||
zval *aws_php_zval_new(void);
|
||||
void aws_php_zval_dtor(void *zval_ptr);
|
||||
bool aws_php_zval_as_bool(zval *z);
|
||||
void aws_php_zval_copy(zval *dest, zval *src);
|
||||
/**
|
||||
* Replacement for ZVAL_STRINGL that is PHP version agnostic
|
||||
*/
|
||||
void aws_php_zval_stringl(zval *val, const char *str, size_t len);
|
||||
|
||||
/* Thread queue functions for managing PHP's optional threading situation */
|
||||
typedef struct _aws_php_task {
|
||||
void (*callback)(void *); /* task function */
|
||||
void (*dtor)(void *); /* deletes task_data, if non-null */
|
||||
void *data;
|
||||
} aws_php_task;
|
||||
|
||||
/* maximum number of queued callbacks to execute at once. Since this is to support single-threaded usage,
|
||||
* this can be a fairly small number, as how many callbacks could we reasonably be stacking up?! */
|
||||
#define AWS_PHP_THREAD_QUEUE_MAX_DEPTH 32
|
||||
|
||||
typedef struct _aws_php_thread_queue {
|
||||
struct aws_mutex mutex;
|
||||
aws_php_task queue[AWS_PHP_THREAD_QUEUE_MAX_DEPTH];
|
||||
size_t write_slot;
|
||||
aws_thread_id_t thread_id;
|
||||
} aws_php_thread_queue;
|
||||
|
||||
extern aws_php_thread_queue s_aws_php_main_thread_queue;
|
||||
bool aws_php_is_main_thread(void);
|
||||
|
||||
void aws_php_thread_queue_init(aws_php_thread_queue *queue);
|
||||
void aws_php_thread_queue_clean_up(aws_php_thread_queue *queue);
|
||||
void aws_php_thread_queue_push(aws_php_thread_queue *queue, aws_php_task task);
|
||||
bool aws_php_thread_queue_drain(aws_php_thread_queue *queue);
|
||||
|
||||
/* called from worker thread to wait for the main thread to execute any queued work in PHP */
|
||||
void aws_php_thread_queue_yield(aws_php_thread_queue *queue);
|
||||
|
||||
/* called from PHP thread to wait on async queued jobs, one of which MUST complete the promise */
|
||||
void aws_php_thread_queue_wait(aws_php_thread_queue *queue, struct aws_promise *promise);
|
||||
|
||||
/**
|
||||
* generic dispatch mechanism to call a callback provided as a zval with arguments
|
||||
* that are converted to zvals based on the arg_types format string
|
||||
* Uses the same format string as zend_parse_parameters
|
||||
*/
|
||||
zval aws_php_invoke_callback(zval *callback, const char *arg_types, ...);
|
||||
|
||||
#endif /* PHP_AWS_CRT_H */
|
||||
|
||||
#ifndef PHP_AWS_CRT_H
|
||||
#define PHP_AWS_CRT_H
|
||||
|
||||
/**
|
||||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include "php.h"
|
||||
|
||||
#include "Zend/zend_extensions.h" /* for ZEND_EXTENSION_API_NO */
|
||||
|
||||
#include <aws/common/common.h>
|
||||
#include <aws/common/mutex.h>
|
||||
#include <aws/common/promise.h>
|
||||
#include <aws/common/thread.h>
|
||||
|
||||
/* ZEND_EXTENSION_API_NO from each branch of the PHP source */
|
||||
#define AWS_PHP_EXTENSION_API_5_5 220121212
|
||||
#define AWS_PHP_EXTENSION_API_5_6 220131226
|
||||
#define AWS_PHP_EXTENSION_API_7_0 320151012
|
||||
#define AWS_PHP_EXTENSION_API_7_1 320160303
|
||||
#define AWS_PHP_EXTENSION_API_7_2 320170718
|
||||
#define AWS_PHP_EXTENSION_API_7_3 320180731
|
||||
#define AWS_PHP_EXTENSION_API_7_4 320190902
|
||||
#define AWS_PHP_EXTENSION_API_8_0 420200930
|
||||
|
||||
#if ZEND_EXTENSION_API_NO < AWS_PHP_EXTENSION_API_5_5
|
||||
# error "PHP >= 5.5 is required"
|
||||
#endif
|
||||
|
||||
#define AWS_PHP_AT_LEAST_7 (ZEND_EXTENSION_API_NO >= AWS_PHP_EXTENSION_API_7_0)
|
||||
#define AWS_PHP_AT_LEAST_7_2 (ZEND_EXTENSION_API_NO >= AWS_PHP_EXTENSION_API_7_2)
|
||||
|
||||
ZEND_BEGIN_MODULE_GLOBALS(awscrt)
|
||||
long log_level;
|
||||
ZEND_END_MODULE_GLOBALS(awscrt)
|
||||
|
||||
ZEND_EXTERN_MODULE_GLOBALS(awscrt)
|
||||
|
||||
#define AWSCRT_GLOBAL(v) ZEND_MODULE_GLOBALS_ACCESSOR(awscrt, v)
|
||||
|
||||
#if AWS_PHP_AT_LEAST_7
|
||||
/* PHP 7 takes a zval*, PHP5 takes a zval** */
|
||||
# define AWS_PHP_STREAM_FROM_ZVAL(s, z) php_stream_from_zval(s, z)
|
||||
#define XRETURN_STRINGL RETURN_STRINGL
|
||||
#define XRETURN_STRING RETURN_STRING
|
||||
#define XRETVAL_STRINGL RETVAL_STRINGL
|
||||
#define XRETVAL_STRING RETVAL_STRING
|
||||
#else /* PHP 5.5-5.6 */
|
||||
# define AWS_PHP_STREAM_FROM_ZVAL(s, z) php_stream_from_zval(s, &z)
|
||||
#define XRETURN_STRINGL(s, l) RETURN_STRINGL(s, l, 1)
|
||||
#define XRETURN_STRING(s) RETURN_STRING(s, 1)
|
||||
#define XRETVAL_STRINGL(s, l) RETVAL_STRINGL(s, l, 1)
|
||||
#define XRETVAL_STRING(s) RETVAL_STRING(s, 1)
|
||||
#endif /* PHP 5.x */
|
||||
|
||||
#include "api.h"
|
||||
#include "awscrt_arginfo.h"
|
||||
|
||||
/* Utility macros borrowed from common */
|
||||
#define GLUE(x, y) x y
|
||||
|
||||
#define RETURN_ARG_COUNT(_1_, _2_, _3_, _4_, _5_, count, ...) count
|
||||
#define EXPAND_ARGS(args) RETURN_ARG_COUNT args
|
||||
#define COUNT_ARGS_MAX5(...) EXPAND_ARGS((__VA_ARGS__, 5, 4, 3, 2, 1, 0))
|
||||
|
||||
#define OVERLOAD_MACRO2(name, count) name##count
|
||||
#define OVERLOAD_MACRO1(name, count) OVERLOAD_MACRO2(name, count)
|
||||
#define OVERLOAD_MACRO(name, count) OVERLOAD_MACRO1(name, count)
|
||||
|
||||
#define CALL_OVERLOAD(name, ...) GLUE(OVERLOAD_MACRO(name, COUNT_ARGS_MAX5(__VA_ARGS__)), (__VA_ARGS__))
|
||||
|
||||
#define VARIABLE_LENGTH_ARRAY(type, name, length) type *name = alloca(sizeof(type) * (length))
|
||||
|
||||
/*
|
||||
* PHP utility APIs for this extension
|
||||
*/
|
||||
/*
|
||||
* Exception throwing mechanism, will never return
|
||||
*/
|
||||
#define aws_php_throw_exception(...) CALL_OVERLOAD(_AWS_PHP_THROW_EXCEPTION, __VA_ARGS__);
|
||||
#define _AWS_PHP_THROW_EXCEPTION5(format, ...) zend_error_noreturn(E_ERROR, format, __VA_ARGS__)
|
||||
#define _AWS_PHP_THROW_EXCEPTION4(format, ...) zend_error_noreturn(E_ERROR, format, __VA_ARGS__)
|
||||
#define _AWS_PHP_THROW_EXCEPTION3(format, ...) zend_error_noreturn(E_ERROR, format, __VA_ARGS__)
|
||||
#define _AWS_PHP_THROW_EXCEPTION2(format, ...) zend_error_noreturn(E_ERROR, format, __VA_ARGS__)
|
||||
#define _AWS_PHP_THROW_EXCEPTION1(format) zend_error_noreturn(E_ERROR, format)
|
||||
|
||||
/**
|
||||
* throws an exception resulting from argument parsing, notes the current function name in the exception
|
||||
*/
|
||||
#define aws_php_argparse_fail() \
|
||||
do { \
|
||||
aws_php_throw_exception("Failed to parse arguments to %s", __func__); \
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
* calls zend_parse_parameters() with the arguments and throws an exception if parsing fails
|
||||
*/
|
||||
#define aws_php_parse_parameters(type_spec, ...) \
|
||||
do { \
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), type_spec, __VA_ARGS__) == FAILURE) { \
|
||||
aws_php_argparse_fail(); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
* calls zend_parse_parameters_none() and throws an exception if parsing fails
|
||||
*/
|
||||
#define aws_php_parse_parameters_none() \
|
||||
do { \
|
||||
if (zend_parse_parameters_none() == FAILURE) { \
|
||||
aws_php_argparse_fail(); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* PHP/Zend utility functions to work across PHP versions */
|
||||
zval *aws_php_zval_new(void);
|
||||
void aws_php_zval_dtor(void *zval_ptr);
|
||||
bool aws_php_zval_as_bool(zval *z);
|
||||
void aws_php_zval_copy(zval *dest, zval *src);
|
||||
/**
|
||||
* Replacement for ZVAL_STRINGL that is PHP version agnostic
|
||||
*/
|
||||
void aws_php_zval_stringl(zval *val, const char *str, size_t len);
|
||||
|
||||
/* Thread queue functions for managing PHP's optional threading situation */
|
||||
typedef struct _aws_php_task {
|
||||
void (*callback)(void *); /* task function */
|
||||
void (*dtor)(void *); /* deletes task_data, if non-null */
|
||||
void *data;
|
||||
} aws_php_task;
|
||||
|
||||
/* maximum number of queued callbacks to execute at once. Since this is to support single-threaded usage,
|
||||
* this can be a fairly small number, as how many callbacks could we reasonably be stacking up?! */
|
||||
#define AWS_PHP_THREAD_QUEUE_MAX_DEPTH 32
|
||||
|
||||
typedef struct _aws_php_thread_queue {
|
||||
struct aws_mutex mutex;
|
||||
aws_php_task queue[AWS_PHP_THREAD_QUEUE_MAX_DEPTH];
|
||||
size_t write_slot;
|
||||
aws_thread_id_t thread_id;
|
||||
} aws_php_thread_queue;
|
||||
|
||||
extern aws_php_thread_queue s_aws_php_main_thread_queue;
|
||||
bool aws_php_is_main_thread(void);
|
||||
|
||||
void aws_php_thread_queue_init(aws_php_thread_queue *queue);
|
||||
void aws_php_thread_queue_clean_up(aws_php_thread_queue *queue);
|
||||
void aws_php_thread_queue_push(aws_php_thread_queue *queue, aws_php_task task);
|
||||
bool aws_php_thread_queue_drain(aws_php_thread_queue *queue);
|
||||
|
||||
/* called from worker thread to wait for the main thread to execute any queued work in PHP */
|
||||
void aws_php_thread_queue_yield(aws_php_thread_queue *queue);
|
||||
|
||||
/* called from PHP thread to wait on async queued jobs, one of which MUST complete the promise */
|
||||
void aws_php_thread_queue_wait(aws_php_thread_queue *queue, struct aws_promise *promise);
|
||||
|
||||
/**
|
||||
* generic dispatch mechanism to call a callback provided as a zval with arguments
|
||||
* that are converted to zvals based on the arg_types format string
|
||||
* Uses the same format string as zend_parse_parameters
|
||||
*/
|
||||
zval aws_php_invoke_callback(zval *callback, const char *arg_types, ...);
|
||||
|
||||
#endif /* PHP_AWS_CRT_H */
|
||||
|
|
66
vendor/aws/aws-crt-php/ext/php_util.c
vendored
66
vendor/aws/aws-crt-php/ext/php_util.c
vendored
|
@ -1,33 +1,33 @@
|
|||
|
||||
/**
|
||||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0.
|
||||
*/
|
||||
|
||||
#include "php_aws_crt.h"
|
||||
|
||||
zval *aws_php_zval_new(void) {
|
||||
return emalloc(sizeof(zval));
|
||||
}
|
||||
|
||||
void aws_php_zval_dtor(void *zval_ptr) {
|
||||
zval *z = zval_ptr;
|
||||
zval_dtor(z);
|
||||
efree(z);
|
||||
}
|
||||
|
||||
bool aws_php_zval_as_bool(zval *z) {
|
||||
#if AWS_PHP_AT_LEAST_7
|
||||
return (Z_TYPE_P(z) == IS_TRUE);
|
||||
#else
|
||||
return (Z_TYPE_P(z) == IS_BOOL && Z_LVAL_P(z) != 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
void aws_php_zval_copy(zval *dest, zval *src) {
|
||||
#if AWS_PHP_AT_LEAST_7
|
||||
ZVAL_COPY(dest, src);
|
||||
#else
|
||||
ZVAL_COPY_VALUE(dest, src);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0.
|
||||
*/
|
||||
|
||||
#include "php_aws_crt.h"
|
||||
|
||||
zval *aws_php_zval_new(void) {
|
||||
return emalloc(sizeof(zval));
|
||||
}
|
||||
|
||||
void aws_php_zval_dtor(void *zval_ptr) {
|
||||
zval *z = zval_ptr;
|
||||
zval_dtor(z);
|
||||
efree(z);
|
||||
}
|
||||
|
||||
bool aws_php_zval_as_bool(zval *z) {
|
||||
#if AWS_PHP_AT_LEAST_7
|
||||
return (Z_TYPE_P(z) == IS_TRUE);
|
||||
#else
|
||||
return (Z_TYPE_P(z) == IS_BOOL && Z_LVAL_P(z) != 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
void aws_php_zval_copy(zval *dest, zval *src) {
|
||||
#if AWS_PHP_AT_LEAST_7
|
||||
ZVAL_COPY(dest, src);
|
||||
#else
|
||||
ZVAL_COPY_VALUE(dest, src);
|
||||
#endif
|
||||
}
|
||||
|
|
748
vendor/aws/aws-crt-php/ext/signing.c
vendored
748
vendor/aws/aws-crt-php/ext/signing.c
vendored
|
@ -1,374 +1,374 @@
|
|||
/**
|
||||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0.
|
||||
*/
|
||||
|
||||
#include "php_aws_crt.h"
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_new) {
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
RETURN_NULL();
|
||||
}
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = aws_crt_signing_config_aws_new();
|
||||
RETURN_LONG((zend_ulong)signing_config);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_release) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_signing_config);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
aws_crt_signing_config_aws_release(signing_config);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_set_algorithm) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
zend_ulong php_algorithm = 0;
|
||||
|
||||
aws_php_parse_parameters("ll", &php_signing_config, &php_algorithm);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
aws_crt_signing_algorithm algorithm = php_algorithm;
|
||||
aws_crt_signing_config_aws_set_algorithm(signing_config, algorithm);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_set_signature_type) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
zend_ulong php_signature_type = 0;
|
||||
|
||||
aws_php_parse_parameters("ll", &php_signing_config, &php_signature_type);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
aws_crt_signature_type signature_type = php_signature_type;
|
||||
aws_crt_signing_config_aws_set_signature_type(signing_config, signature_type);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_set_credentials_provider) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
zend_ulong php_credentials_provider = 0;
|
||||
|
||||
aws_php_parse_parameters("ll", &php_signing_config, &php_credentials_provider);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
aws_crt_credentials_provider *credentials_provider = (void *)php_credentials_provider;
|
||||
aws_crt_signing_config_aws_set_credentials_provider(signing_config, credentials_provider);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_set_region) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
const char *region = NULL;
|
||||
size_t region_len = 0;
|
||||
|
||||
aws_php_parse_parameters("ls", &php_signing_config, ®ion, ®ion_len);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
aws_crt_signing_config_aws_set_region(signing_config, (uint8_t *)region, region_len);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_set_service) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
const char *service = NULL;
|
||||
size_t service_len = 0;
|
||||
|
||||
aws_php_parse_parameters("ls", &php_signing_config, &service, &service_len);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
aws_crt_signing_config_aws_set_service(signing_config, (uint8_t *)service, service_len);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_set_use_double_uri_encode) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
zend_bool php_use_double_uri_encode = 0;
|
||||
|
||||
aws_php_parse_parameters("lb", &php_signing_config, &php_use_double_uri_encode);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
aws_crt_signing_config_aws_set_use_double_uri_encode(signing_config, php_use_double_uri_encode);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_set_should_normalize_uri_path) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
zend_bool php_should_normalize_uri_path = 0;
|
||||
|
||||
aws_php_parse_parameters("lb", &php_signing_config, &php_should_normalize_uri_path);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
aws_crt_signing_config_aws_set_should_normalize_uri_path(signing_config, php_should_normalize_uri_path);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_set_omit_session_token) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
zend_bool php_omit_session_token = 0;
|
||||
|
||||
aws_php_parse_parameters("lb", &php_signing_config, &php_omit_session_token);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
aws_crt_signing_config_aws_set_omit_session_token(signing_config, php_omit_session_token);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_set_signed_body_value) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
const char *signed_body_value = NULL;
|
||||
size_t signed_body_value_len = 0;
|
||||
|
||||
aws_php_parse_parameters("ls", &php_signing_config, &signed_body_value, &signed_body_value_len);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
aws_crt_signing_config_aws_set_signed_body_value(
|
||||
signing_config, (uint8_t *)signed_body_value, signed_body_value_len);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_set_signed_body_header_type) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
zend_ulong php_signed_body_header_type = 0;
|
||||
|
||||
aws_php_parse_parameters("ll", &php_signing_config, &php_signed_body_header_type);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
aws_crt_signed_body_header_type signed_body_header_type = php_signed_body_header_type;
|
||||
aws_crt_signing_config_aws_set_signed_body_header_type(signing_config, signed_body_header_type);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_set_expiration_in_seconds) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
zend_ulong php_expiration_in_seconds = 0;
|
||||
|
||||
aws_php_parse_parameters("ll", &php_signing_config, &php_expiration_in_seconds);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
aws_crt_signing_config_aws_set_expiration_in_seconds(signing_config, php_expiration_in_seconds);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_set_date) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
zend_ulong php_timestamp = 0;
|
||||
|
||||
aws_php_parse_parameters("ll", &php_signing_config, &php_timestamp);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
aws_crt_signing_config_aws_set_date(signing_config, php_timestamp);
|
||||
}
|
||||
|
||||
typedef struct _should_sign_header_data {
|
||||
zval *should_sign_header;
|
||||
zval *header_name;
|
||||
bool result;
|
||||
} should_sign_header_data;
|
||||
|
||||
static void should_sign_header_task(void *data) {
|
||||
should_sign_header_data *task = data;
|
||||
zval result = aws_php_invoke_callback(task->should_sign_header, "z", task->header_name);
|
||||
task->result = aws_php_zval_as_bool(&result);
|
||||
zval_dtor(&result);
|
||||
}
|
||||
|
||||
static bool aws_php_should_sign_header(const char *header_name, size_t header_length, void *user_data) {
|
||||
zval php_header_name;
|
||||
aws_php_zval_stringl(&php_header_name, header_name, header_length);
|
||||
|
||||
should_sign_header_data task_data = {
|
||||
.should_sign_header = user_data,
|
||||
.header_name = &php_header_name,
|
||||
.result = false,
|
||||
};
|
||||
|
||||
aws_php_task task = {
|
||||
.callback = should_sign_header_task,
|
||||
.data = &task_data,
|
||||
};
|
||||
|
||||
aws_php_thread_queue_push(&s_aws_php_main_thread_queue, task);
|
||||
aws_php_thread_queue_yield(&s_aws_php_main_thread_queue);
|
||||
|
||||
zval_dtor(&php_header_name);
|
||||
|
||||
return task_data.result;
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_set_should_sign_header_fn) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
zval *php_should_sign_header = NULL;
|
||||
|
||||
aws_php_parse_parameters("lz", &php_signing_config, &php_should_sign_header);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
|
||||
/* copy/retain PHP callback, add as user data for signing_config resource */
|
||||
zval *should_sign_header = aws_php_zval_new();
|
||||
aws_php_zval_copy(should_sign_header, php_should_sign_header);
|
||||
aws_crt_resource_set_user_data(signing_config, should_sign_header, aws_php_zval_dtor);
|
||||
|
||||
aws_crt_signing_config_aws_set_should_sign_header_fn(
|
||||
signing_config, aws_php_should_sign_header, should_sign_header);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signable_new_from_http_request) {
|
||||
zend_ulong php_http_message = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_http_message);
|
||||
|
||||
const aws_crt_http_message *http_message = (void *)php_http_message;
|
||||
aws_crt_signable *signable = aws_crt_signable_new_from_http_request(http_message);
|
||||
RETURN_LONG((zend_ulong)signable);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signable_new_from_chunk) {
|
||||
zend_ulong php_input_stream = 0;
|
||||
const char *previous_signature = NULL;
|
||||
size_t previous_signature_len = 0;
|
||||
|
||||
aws_php_parse_parameters("ls", &php_input_stream, &previous_signature, &previous_signature_len);
|
||||
|
||||
aws_crt_input_stream *input_stream = (void *)php_input_stream;
|
||||
aws_crt_signable *signable =
|
||||
aws_crt_signable_new_from_chunk(input_stream, (uint8_t *)previous_signature, previous_signature_len);
|
||||
RETURN_LONG((zend_ulong)signable);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signable_new_from_canonical_request) {
|
||||
const char *canonical_request = NULL;
|
||||
size_t canonical_request_len = 0;
|
||||
|
||||
aws_crt_signable *signable =
|
||||
aws_crt_signable_new_from_canonical_request((uint8_t *)canonical_request, canonical_request_len);
|
||||
RETURN_LONG((zend_ulong)signable);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signable_release) {
|
||||
zend_ulong php_signable = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_signable);
|
||||
|
||||
aws_crt_signable *signable = (void *)php_signable;
|
||||
aws_crt_signable_release(signable);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_result_release) {
|
||||
zend_ulong php_signing_result = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_signing_result);
|
||||
aws_crt_signing_result *result = (void *)php_signing_result;
|
||||
aws_crt_signing_result_release(result);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_result_apply_to_http_request) {
|
||||
zend_ulong php_signing_result = 0;
|
||||
zend_ulong php_http_request = 0;
|
||||
|
||||
aws_php_parse_parameters("ll", &php_signing_result, &php_http_request);
|
||||
aws_crt_signing_result *result = (void *)php_signing_result;
|
||||
aws_crt_http_message *request = (void *)php_http_request;
|
||||
|
||||
if (aws_crt_signing_result_apply_to_http_request(result, request)) {
|
||||
aws_php_throw_exception(
|
||||
"Failed to apply signing result to HTTP request: %s", aws_crt_error_name(aws_crt_last_error()));
|
||||
}
|
||||
}
|
||||
|
||||
typedef struct _signing_state {
|
||||
struct aws_promise *promise;
|
||||
zval *on_complete;
|
||||
aws_crt_signing_result *signing_result;
|
||||
int error_code;
|
||||
} signing_state;
|
||||
|
||||
/* called on main thread to deliver result to php */
|
||||
static void s_sign_aws_complete(void *data) {
|
||||
signing_state *state = data;
|
||||
zval *on_complete = state->on_complete;
|
||||
aws_php_invoke_callback(on_complete, "ll", (zend_ulong)state->signing_result, (zend_ulong)state->error_code);
|
||||
}
|
||||
|
||||
/* called from signing process in aws_sign_request_aws */
|
||||
static void s_on_sign_request_aws_complete(aws_crt_signing_result *result, int error_code, void *user_data) {
|
||||
signing_state *state = user_data;
|
||||
struct aws_promise *promise = state->promise;
|
||||
|
||||
state->signing_result = result;
|
||||
state->error_code = error_code;
|
||||
|
||||
/*
|
||||
* Must execute PHP callback before this function returns, or signing_result will be killed
|
||||
* so the callback is queued back to the main thread and will have run when yield returns
|
||||
*/
|
||||
aws_php_task complete_callback_task = {
|
||||
.callback = s_sign_aws_complete,
|
||||
.data = state,
|
||||
};
|
||||
aws_php_thread_queue_push(&s_aws_php_main_thread_queue, complete_callback_task);
|
||||
aws_php_thread_queue_yield(&s_aws_php_main_thread_queue);
|
||||
|
||||
if (error_code) {
|
||||
aws_promise_fail(promise, error_code);
|
||||
} else {
|
||||
aws_promise_complete(promise, result, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_sign_request_aws) {
|
||||
zend_ulong php_signable = 0;
|
||||
zend_ulong php_signing_config = 0;
|
||||
zval *php_on_complete = 0;
|
||||
zend_ulong php_user_data = 0;
|
||||
|
||||
aws_php_parse_parameters("llzl", &php_signable, &php_signing_config, &php_on_complete, &php_user_data);
|
||||
|
||||
aws_crt_signable *signable = (void *)php_signable;
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
|
||||
struct aws_promise *promise = aws_promise_new(aws_crt_default_allocator());
|
||||
signing_state state = {
|
||||
.promise = promise,
|
||||
.on_complete = php_on_complete,
|
||||
};
|
||||
int ret = aws_crt_sign_request_aws(signable, signing_config, s_on_sign_request_aws_complete, &state);
|
||||
if (ret != 0) {
|
||||
int last_error = aws_crt_last_error();
|
||||
aws_promise_fail(promise, last_error);
|
||||
aws_php_throw_exception(
|
||||
"aws_crt_sign_request_aws: error starting signing process: %s", aws_crt_error_name(last_error));
|
||||
}
|
||||
|
||||
aws_php_thread_queue_wait(&s_aws_php_main_thread_queue, promise);
|
||||
|
||||
done:
|
||||
aws_promise_release(promise);
|
||||
RETURN_LONG(ret);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_test_verify_sigv4a_signing) {
|
||||
zend_ulong php_signable = 0;
|
||||
zend_ulong php_signing_config = 0;
|
||||
const char *expected_canonical_request = NULL;
|
||||
size_t expected_canonical_request_len = 0;
|
||||
const char *signature = NULL;
|
||||
size_t signature_len = 0;
|
||||
const char *ecc_key_pub_x = NULL;
|
||||
size_t ecc_key_pub_x_len = 0;
|
||||
const char *ecc_key_pub_y = NULL;
|
||||
size_t ecc_key_pub_y_len = 0;
|
||||
|
||||
aws_php_parse_parameters(
|
||||
"llssss",
|
||||
&php_signable,
|
||||
&php_signing_config,
|
||||
&expected_canonical_request,
|
||||
&expected_canonical_request_len,
|
||||
&signature,
|
||||
&signature_len,
|
||||
&ecc_key_pub_x,
|
||||
&ecc_key_pub_x_len,
|
||||
&ecc_key_pub_y,
|
||||
&ecc_key_pub_y_len);
|
||||
|
||||
const aws_crt_signable *signable = (void *)php_signable;
|
||||
const aws_crt_signing_config *signing_config = (void *)php_signing_config;
|
||||
|
||||
bool result = AWS_OP_SUCCESS ==
|
||||
aws_crt_test_verify_sigv4a_signing(
|
||||
signable, signing_config, expected_canonical_request, signature, ecc_key_pub_x, ecc_key_pub_y);
|
||||
|
||||
RETURN_BOOL(result);
|
||||
}
|
||||
/**
|
||||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0.
|
||||
*/
|
||||
|
||||
#include "php_aws_crt.h"
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_new) {
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
RETURN_NULL();
|
||||
}
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = aws_crt_signing_config_aws_new();
|
||||
RETURN_LONG((zend_ulong)signing_config);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_release) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_signing_config);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
aws_crt_signing_config_aws_release(signing_config);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_set_algorithm) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
zend_ulong php_algorithm = 0;
|
||||
|
||||
aws_php_parse_parameters("ll", &php_signing_config, &php_algorithm);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
aws_crt_signing_algorithm algorithm = php_algorithm;
|
||||
aws_crt_signing_config_aws_set_algorithm(signing_config, algorithm);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_set_signature_type) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
zend_ulong php_signature_type = 0;
|
||||
|
||||
aws_php_parse_parameters("ll", &php_signing_config, &php_signature_type);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
aws_crt_signature_type signature_type = php_signature_type;
|
||||
aws_crt_signing_config_aws_set_signature_type(signing_config, signature_type);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_set_credentials_provider) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
zend_ulong php_credentials_provider = 0;
|
||||
|
||||
aws_php_parse_parameters("ll", &php_signing_config, &php_credentials_provider);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
aws_crt_credentials_provider *credentials_provider = (void *)php_credentials_provider;
|
||||
aws_crt_signing_config_aws_set_credentials_provider(signing_config, credentials_provider);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_set_region) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
const char *region = NULL;
|
||||
size_t region_len = 0;
|
||||
|
||||
aws_php_parse_parameters("ls", &php_signing_config, ®ion, ®ion_len);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
aws_crt_signing_config_aws_set_region(signing_config, (uint8_t *)region, region_len);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_set_service) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
const char *service = NULL;
|
||||
size_t service_len = 0;
|
||||
|
||||
aws_php_parse_parameters("ls", &php_signing_config, &service, &service_len);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
aws_crt_signing_config_aws_set_service(signing_config, (uint8_t *)service, service_len);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_set_use_double_uri_encode) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
zend_bool php_use_double_uri_encode = 0;
|
||||
|
||||
aws_php_parse_parameters("lb", &php_signing_config, &php_use_double_uri_encode);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
aws_crt_signing_config_aws_set_use_double_uri_encode(signing_config, php_use_double_uri_encode);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_set_should_normalize_uri_path) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
zend_bool php_should_normalize_uri_path = 0;
|
||||
|
||||
aws_php_parse_parameters("lb", &php_signing_config, &php_should_normalize_uri_path);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
aws_crt_signing_config_aws_set_should_normalize_uri_path(signing_config, php_should_normalize_uri_path);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_set_omit_session_token) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
zend_bool php_omit_session_token = 0;
|
||||
|
||||
aws_php_parse_parameters("lb", &php_signing_config, &php_omit_session_token);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
aws_crt_signing_config_aws_set_omit_session_token(signing_config, php_omit_session_token);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_set_signed_body_value) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
const char *signed_body_value = NULL;
|
||||
size_t signed_body_value_len = 0;
|
||||
|
||||
aws_php_parse_parameters("ls", &php_signing_config, &signed_body_value, &signed_body_value_len);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
aws_crt_signing_config_aws_set_signed_body_value(
|
||||
signing_config, (uint8_t *)signed_body_value, signed_body_value_len);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_set_signed_body_header_type) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
zend_ulong php_signed_body_header_type = 0;
|
||||
|
||||
aws_php_parse_parameters("ll", &php_signing_config, &php_signed_body_header_type);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
aws_crt_signed_body_header_type signed_body_header_type = php_signed_body_header_type;
|
||||
aws_crt_signing_config_aws_set_signed_body_header_type(signing_config, signed_body_header_type);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_set_expiration_in_seconds) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
zend_ulong php_expiration_in_seconds = 0;
|
||||
|
||||
aws_php_parse_parameters("ll", &php_signing_config, &php_expiration_in_seconds);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
aws_crt_signing_config_aws_set_expiration_in_seconds(signing_config, php_expiration_in_seconds);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_set_date) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
zend_ulong php_timestamp = 0;
|
||||
|
||||
aws_php_parse_parameters("ll", &php_signing_config, &php_timestamp);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
aws_crt_signing_config_aws_set_date(signing_config, php_timestamp);
|
||||
}
|
||||
|
||||
typedef struct _should_sign_header_data {
|
||||
zval *should_sign_header;
|
||||
zval *header_name;
|
||||
bool result;
|
||||
} should_sign_header_data;
|
||||
|
||||
static void should_sign_header_task(void *data) {
|
||||
should_sign_header_data *task = data;
|
||||
zval result = aws_php_invoke_callback(task->should_sign_header, "z", task->header_name);
|
||||
task->result = aws_php_zval_as_bool(&result);
|
||||
zval_dtor(&result);
|
||||
}
|
||||
|
||||
static bool aws_php_should_sign_header(const char *header_name, size_t header_length, void *user_data) {
|
||||
zval php_header_name;
|
||||
aws_php_zval_stringl(&php_header_name, header_name, header_length);
|
||||
|
||||
should_sign_header_data task_data = {
|
||||
.should_sign_header = user_data,
|
||||
.header_name = &php_header_name,
|
||||
.result = false,
|
||||
};
|
||||
|
||||
aws_php_task task = {
|
||||
.callback = should_sign_header_task,
|
||||
.data = &task_data,
|
||||
};
|
||||
|
||||
aws_php_thread_queue_push(&s_aws_php_main_thread_queue, task);
|
||||
aws_php_thread_queue_yield(&s_aws_php_main_thread_queue);
|
||||
|
||||
zval_dtor(&php_header_name);
|
||||
|
||||
return task_data.result;
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_config_aws_set_should_sign_header_fn) {
|
||||
zend_ulong php_signing_config = 0;
|
||||
zval *php_should_sign_header = NULL;
|
||||
|
||||
aws_php_parse_parameters("lz", &php_signing_config, &php_should_sign_header);
|
||||
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
|
||||
/* copy/retain PHP callback, add as user data for signing_config resource */
|
||||
zval *should_sign_header = aws_php_zval_new();
|
||||
aws_php_zval_copy(should_sign_header, php_should_sign_header);
|
||||
aws_crt_resource_set_user_data(signing_config, should_sign_header, aws_php_zval_dtor);
|
||||
|
||||
aws_crt_signing_config_aws_set_should_sign_header_fn(
|
||||
signing_config, aws_php_should_sign_header, should_sign_header);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signable_new_from_http_request) {
|
||||
zend_ulong php_http_message = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_http_message);
|
||||
|
||||
const aws_crt_http_message *http_message = (void *)php_http_message;
|
||||
aws_crt_signable *signable = aws_crt_signable_new_from_http_request(http_message);
|
||||
RETURN_LONG((zend_ulong)signable);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signable_new_from_chunk) {
|
||||
zend_ulong php_input_stream = 0;
|
||||
const char *previous_signature = NULL;
|
||||
size_t previous_signature_len = 0;
|
||||
|
||||
aws_php_parse_parameters("ls", &php_input_stream, &previous_signature, &previous_signature_len);
|
||||
|
||||
aws_crt_input_stream *input_stream = (void *)php_input_stream;
|
||||
aws_crt_signable *signable =
|
||||
aws_crt_signable_new_from_chunk(input_stream, (uint8_t *)previous_signature, previous_signature_len);
|
||||
RETURN_LONG((zend_ulong)signable);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signable_new_from_canonical_request) {
|
||||
const char *canonical_request = NULL;
|
||||
size_t canonical_request_len = 0;
|
||||
|
||||
aws_crt_signable *signable =
|
||||
aws_crt_signable_new_from_canonical_request((uint8_t *)canonical_request, canonical_request_len);
|
||||
RETURN_LONG((zend_ulong)signable);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signable_release) {
|
||||
zend_ulong php_signable = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_signable);
|
||||
|
||||
aws_crt_signable *signable = (void *)php_signable;
|
||||
aws_crt_signable_release(signable);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_result_release) {
|
||||
zend_ulong php_signing_result = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_signing_result);
|
||||
aws_crt_signing_result *result = (void *)php_signing_result;
|
||||
aws_crt_signing_result_release(result);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_signing_result_apply_to_http_request) {
|
||||
zend_ulong php_signing_result = 0;
|
||||
zend_ulong php_http_request = 0;
|
||||
|
||||
aws_php_parse_parameters("ll", &php_signing_result, &php_http_request);
|
||||
aws_crt_signing_result *result = (void *)php_signing_result;
|
||||
aws_crt_http_message *request = (void *)php_http_request;
|
||||
|
||||
if (aws_crt_signing_result_apply_to_http_request(result, request)) {
|
||||
aws_php_throw_exception(
|
||||
"Failed to apply signing result to HTTP request: %s", aws_crt_error_name(aws_crt_last_error()));
|
||||
}
|
||||
}
|
||||
|
||||
typedef struct _signing_state {
|
||||
struct aws_promise *promise;
|
||||
zval *on_complete;
|
||||
aws_crt_signing_result *signing_result;
|
||||
int error_code;
|
||||
} signing_state;
|
||||
|
||||
/* called on main thread to deliver result to php */
|
||||
static void s_sign_aws_complete(void *data) {
|
||||
signing_state *state = data;
|
||||
zval *on_complete = state->on_complete;
|
||||
aws_php_invoke_callback(on_complete, "ll", (zend_ulong)state->signing_result, (zend_ulong)state->error_code);
|
||||
}
|
||||
|
||||
/* called from signing process in aws_sign_request_aws */
|
||||
static void s_on_sign_request_aws_complete(aws_crt_signing_result *result, int error_code, void *user_data) {
|
||||
signing_state *state = user_data;
|
||||
struct aws_promise *promise = state->promise;
|
||||
|
||||
state->signing_result = result;
|
||||
state->error_code = error_code;
|
||||
|
||||
/*
|
||||
* Must execute PHP callback before this function returns, or signing_result will be killed
|
||||
* so the callback is queued back to the main thread and will have run when yield returns
|
||||
*/
|
||||
aws_php_task complete_callback_task = {
|
||||
.callback = s_sign_aws_complete,
|
||||
.data = state,
|
||||
};
|
||||
aws_php_thread_queue_push(&s_aws_php_main_thread_queue, complete_callback_task);
|
||||
aws_php_thread_queue_yield(&s_aws_php_main_thread_queue);
|
||||
|
||||
if (error_code) {
|
||||
aws_promise_fail(promise, error_code);
|
||||
} else {
|
||||
aws_promise_complete(promise, result, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_sign_request_aws) {
|
||||
zend_ulong php_signable = 0;
|
||||
zend_ulong php_signing_config = 0;
|
||||
zval *php_on_complete = 0;
|
||||
zend_ulong php_user_data = 0;
|
||||
|
||||
aws_php_parse_parameters("llzl", &php_signable, &php_signing_config, &php_on_complete, &php_user_data);
|
||||
|
||||
aws_crt_signable *signable = (void *)php_signable;
|
||||
aws_crt_signing_config_aws *signing_config = (void *)php_signing_config;
|
||||
|
||||
struct aws_promise *promise = aws_promise_new(aws_crt_default_allocator());
|
||||
signing_state state = {
|
||||
.promise = promise,
|
||||
.on_complete = php_on_complete,
|
||||
};
|
||||
int ret = aws_crt_sign_request_aws(signable, signing_config, s_on_sign_request_aws_complete, &state);
|
||||
if (ret != 0) {
|
||||
int last_error = aws_crt_last_error();
|
||||
aws_promise_fail(promise, last_error);
|
||||
aws_php_throw_exception(
|
||||
"aws_crt_sign_request_aws: error starting signing process: %s", aws_crt_error_name(last_error));
|
||||
}
|
||||
|
||||
aws_php_thread_queue_wait(&s_aws_php_main_thread_queue, promise);
|
||||
|
||||
done:
|
||||
aws_promise_release(promise);
|
||||
RETURN_LONG(ret);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_test_verify_sigv4a_signing) {
|
||||
zend_ulong php_signable = 0;
|
||||
zend_ulong php_signing_config = 0;
|
||||
const char *expected_canonical_request = NULL;
|
||||
size_t expected_canonical_request_len = 0;
|
||||
const char *signature = NULL;
|
||||
size_t signature_len = 0;
|
||||
const char *ecc_key_pub_x = NULL;
|
||||
size_t ecc_key_pub_x_len = 0;
|
||||
const char *ecc_key_pub_y = NULL;
|
||||
size_t ecc_key_pub_y_len = 0;
|
||||
|
||||
aws_php_parse_parameters(
|
||||
"llssss",
|
||||
&php_signable,
|
||||
&php_signing_config,
|
||||
&expected_canonical_request,
|
||||
&expected_canonical_request_len,
|
||||
&signature,
|
||||
&signature_len,
|
||||
&ecc_key_pub_x,
|
||||
&ecc_key_pub_x_len,
|
||||
&ecc_key_pub_y,
|
||||
&ecc_key_pub_y_len);
|
||||
|
||||
const aws_crt_signable *signable = (void *)php_signable;
|
||||
const aws_crt_signing_config *signing_config = (void *)php_signing_config;
|
||||
|
||||
bool result = AWS_OP_SUCCESS ==
|
||||
aws_crt_test_verify_sigv4a_signing(
|
||||
signable, signing_config, expected_canonical_request, signature, ecc_key_pub_x, ecc_key_pub_y);
|
||||
|
||||
RETURN_BOOL(result);
|
||||
}
|
||||
|
|
296
vendor/aws/aws-crt-php/ext/stream.c
vendored
296
vendor/aws/aws-crt-php/ext/stream.c
vendored
|
@ -1,148 +1,148 @@
|
|||
/**
|
||||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0.
|
||||
*/
|
||||
|
||||
#include "php_aws_crt.h"
|
||||
|
||||
/* PHP streams info:
|
||||
* https://git.php.net/?p=php-src.git;a=blob;f=docs/streams.md;h=0ec3846d68bf70067297d8a6c691d2591c49b48a;hb=HEAD
|
||||
* https://github.com/php/php-src/blob/PHP-5.6.0/main/php_streams.h
|
||||
*/
|
||||
|
||||
PHP_FUNCTION(aws_crt_input_stream_options_new) {
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
aws_php_argparse_fail();
|
||||
}
|
||||
|
||||
aws_crt_input_stream_options *options = aws_crt_input_stream_options_new();
|
||||
RETURN_LONG((zend_ulong)options);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_input_stream_options_release) {
|
||||
zend_ulong php_options = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_options);
|
||||
|
||||
aws_crt_input_stream_options *options = (void *)php_options;
|
||||
aws_crt_input_stream_options_release(options);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_input_stream_options_set_user_data) {
|
||||
zend_ulong php_options = 0;
|
||||
zval *user_data = NULL;
|
||||
|
||||
aws_php_parse_parameters("lz", &php_options, &user_data);
|
||||
|
||||
aws_crt_input_stream_options *options = (void *)php_options;
|
||||
php_stream *stream = NULL;
|
||||
AWS_PHP_STREAM_FROM_ZVAL(stream, user_data);
|
||||
aws_crt_input_stream_options_set_user_data(options, stream);
|
||||
}
|
||||
|
||||
static int s_php_stream_seek(void *user_data, int64_t offset, aws_crt_input_stream_seek_basis basis) {
|
||||
php_stream *stream = user_data;
|
||||
return php_stream_seek(stream, offset, basis);
|
||||
}
|
||||
|
||||
static int s_php_stream_read(void *user_data, uint8_t *dest, size_t dest_length) {
|
||||
php_stream *stream = user_data;
|
||||
return php_stream_read(stream, (char *)dest, dest_length) != 0;
|
||||
}
|
||||
|
||||
static int s_php_stream_get_length(void *user_data, int64_t *out_length) {
|
||||
php_stream *stream = user_data;
|
||||
size_t pos = php_stream_tell(stream);
|
||||
php_stream_seek(stream, 0, SEEK_END);
|
||||
*out_length = php_stream_tell(stream);
|
||||
php_stream_seek(stream, pos, SEEK_SET);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int s_php_stream_get_status(void *user_data, aws_crt_input_stream_status *out_status) {
|
||||
php_stream *stream = user_data;
|
||||
out_status->is_valid = stream != NULL;
|
||||
/* We would like to use php_stream_eof here, but certain streams (notably php://memory)
|
||||
* are not actually capable of EOF, so we get to do it the hard way */
|
||||
int64_t length = 0;
|
||||
int64_t pos = 0;
|
||||
s_php_stream_get_length(stream, &length);
|
||||
pos = php_stream_tell(stream);
|
||||
out_status->is_end_of_stream = pos == length;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void s_php_stream_destroy(void *user_data) {
|
||||
(void)user_data;
|
||||
/* no op, stream will be freed by PHP refcount dropping from InputStream::stream */
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_input_stream_new) {
|
||||
zend_ulong php_options = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_options);
|
||||
|
||||
aws_crt_input_stream_options *options = (void *)php_options;
|
||||
aws_crt_input_stream_options_set_seek(options, s_php_stream_seek);
|
||||
aws_crt_input_stream_options_set_read(options, s_php_stream_read);
|
||||
aws_crt_input_stream_options_set_get_status(options, s_php_stream_get_status);
|
||||
aws_crt_input_stream_options_set_get_length(options, s_php_stream_get_length);
|
||||
aws_crt_input_stream_options_set_destroy(options, s_php_stream_destroy);
|
||||
aws_crt_input_stream *stream = aws_crt_input_stream_new(options);
|
||||
RETURN_LONG((zend_ulong)stream);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_input_stream_release) {
|
||||
zend_ulong php_stream = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_stream);
|
||||
|
||||
aws_crt_input_stream *stream = (void *)php_stream;
|
||||
aws_crt_input_stream_release(stream);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_input_stream_seek) {
|
||||
zend_ulong php_stream = 0;
|
||||
zend_ulong offset = 0;
|
||||
zend_ulong basis = 0;
|
||||
|
||||
aws_php_parse_parameters("lll", &php_stream, &offset, &basis);
|
||||
|
||||
aws_crt_input_stream *stream = (void *)php_stream;
|
||||
RETURN_LONG(aws_crt_input_stream_seek(stream, offset, basis));
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_input_stream_read) {
|
||||
zend_ulong php_stream = 0;
|
||||
zend_ulong length = 0;
|
||||
|
||||
aws_php_parse_parameters("ll", &php_stream, &length);
|
||||
|
||||
aws_crt_input_stream *stream = (void *)php_stream;
|
||||
uint8_t *buf = emalloc(length);
|
||||
int ret = aws_crt_input_stream_read(stream, buf, length);
|
||||
XRETVAL_STRINGL((const char *)buf, length);
|
||||
efree(buf);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_input_stream_eof) {
|
||||
zend_ulong php_stream = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_stream);
|
||||
|
||||
aws_crt_input_stream *stream = (void *)php_stream;
|
||||
aws_crt_input_stream_status status = {0};
|
||||
aws_crt_input_stream_get_status(stream, &status);
|
||||
RETURN_BOOL(status.is_end_of_stream);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_input_stream_get_length) {
|
||||
zend_ulong php_stream = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_stream);
|
||||
|
||||
aws_crt_input_stream *stream = (void *)php_stream;
|
||||
int64_t length = 0;
|
||||
aws_crt_input_stream_get_length(stream, &length);
|
||||
RETURN_LONG(length);
|
||||
}
|
||||
/**
|
||||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0.
|
||||
*/
|
||||
|
||||
#include "php_aws_crt.h"
|
||||
|
||||
/* PHP streams info:
|
||||
* https://git.php.net/?p=php-src.git;a=blob;f=docs/streams.md;h=0ec3846d68bf70067297d8a6c691d2591c49b48a;hb=HEAD
|
||||
* https://github.com/php/php-src/blob/PHP-5.6.0/main/php_streams.h
|
||||
*/
|
||||
|
||||
PHP_FUNCTION(aws_crt_input_stream_options_new) {
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
aws_php_argparse_fail();
|
||||
}
|
||||
|
||||
aws_crt_input_stream_options *options = aws_crt_input_stream_options_new();
|
||||
RETURN_LONG((zend_ulong)options);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_input_stream_options_release) {
|
||||
zend_ulong php_options = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_options);
|
||||
|
||||
aws_crt_input_stream_options *options = (void *)php_options;
|
||||
aws_crt_input_stream_options_release(options);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_input_stream_options_set_user_data) {
|
||||
zend_ulong php_options = 0;
|
||||
zval *user_data = NULL;
|
||||
|
||||
aws_php_parse_parameters("lz", &php_options, &user_data);
|
||||
|
||||
aws_crt_input_stream_options *options = (void *)php_options;
|
||||
php_stream *stream = NULL;
|
||||
AWS_PHP_STREAM_FROM_ZVAL(stream, user_data);
|
||||
aws_crt_input_stream_options_set_user_data(options, stream);
|
||||
}
|
||||
|
||||
static int s_php_stream_seek(void *user_data, int64_t offset, aws_crt_input_stream_seek_basis basis) {
|
||||
php_stream *stream = user_data;
|
||||
return php_stream_seek(stream, offset, basis);
|
||||
}
|
||||
|
||||
static int s_php_stream_read(void *user_data, uint8_t *dest, size_t dest_length) {
|
||||
php_stream *stream = user_data;
|
||||
return php_stream_read(stream, (char *)dest, dest_length) != 0;
|
||||
}
|
||||
|
||||
static int s_php_stream_get_length(void *user_data, int64_t *out_length) {
|
||||
php_stream *stream = user_data;
|
||||
size_t pos = php_stream_tell(stream);
|
||||
php_stream_seek(stream, 0, SEEK_END);
|
||||
*out_length = php_stream_tell(stream);
|
||||
php_stream_seek(stream, pos, SEEK_SET);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int s_php_stream_get_status(void *user_data, aws_crt_input_stream_status *out_status) {
|
||||
php_stream *stream = user_data;
|
||||
out_status->is_valid = stream != NULL;
|
||||
/* We would like to use php_stream_eof here, but certain streams (notably php://memory)
|
||||
* are not actually capable of EOF, so we get to do it the hard way */
|
||||
int64_t length = 0;
|
||||
int64_t pos = 0;
|
||||
s_php_stream_get_length(stream, &length);
|
||||
pos = php_stream_tell(stream);
|
||||
out_status->is_end_of_stream = pos == length;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void s_php_stream_destroy(void *user_data) {
|
||||
(void)user_data;
|
||||
/* no op, stream will be freed by PHP refcount dropping from InputStream::stream */
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_input_stream_new) {
|
||||
zend_ulong php_options = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_options);
|
||||
|
||||
aws_crt_input_stream_options *options = (void *)php_options;
|
||||
aws_crt_input_stream_options_set_seek(options, s_php_stream_seek);
|
||||
aws_crt_input_stream_options_set_read(options, s_php_stream_read);
|
||||
aws_crt_input_stream_options_set_get_status(options, s_php_stream_get_status);
|
||||
aws_crt_input_stream_options_set_get_length(options, s_php_stream_get_length);
|
||||
aws_crt_input_stream_options_set_destroy(options, s_php_stream_destroy);
|
||||
aws_crt_input_stream *stream = aws_crt_input_stream_new(options);
|
||||
RETURN_LONG((zend_ulong)stream);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_input_stream_release) {
|
||||
zend_ulong php_stream = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_stream);
|
||||
|
||||
aws_crt_input_stream *stream = (void *)php_stream;
|
||||
aws_crt_input_stream_release(stream);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_input_stream_seek) {
|
||||
zend_ulong php_stream = 0;
|
||||
zend_ulong offset = 0;
|
||||
zend_ulong basis = 0;
|
||||
|
||||
aws_php_parse_parameters("lll", &php_stream, &offset, &basis);
|
||||
|
||||
aws_crt_input_stream *stream = (void *)php_stream;
|
||||
RETURN_LONG(aws_crt_input_stream_seek(stream, offset, basis));
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_input_stream_read) {
|
||||
zend_ulong php_stream = 0;
|
||||
zend_ulong length = 0;
|
||||
|
||||
aws_php_parse_parameters("ll", &php_stream, &length);
|
||||
|
||||
aws_crt_input_stream *stream = (void *)php_stream;
|
||||
uint8_t *buf = emalloc(length);
|
||||
int ret = aws_crt_input_stream_read(stream, buf, length);
|
||||
XRETVAL_STRINGL((const char *)buf, length);
|
||||
efree(buf);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_input_stream_eof) {
|
||||
zend_ulong php_stream = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_stream);
|
||||
|
||||
aws_crt_input_stream *stream = (void *)php_stream;
|
||||
aws_crt_input_stream_status status = {0};
|
||||
aws_crt_input_stream_get_status(stream, &status);
|
||||
RETURN_BOOL(status.is_end_of_stream);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(aws_crt_input_stream_get_length) {
|
||||
zend_ulong php_stream = 0;
|
||||
|
||||
aws_php_parse_parameters("l", &php_stream);
|
||||
|
||||
aws_crt_input_stream *stream = (void *)php_stream;
|
||||
int64_t length = 0;
|
||||
aws_crt_input_stream_get_length(stream, &length);
|
||||
RETURN_LONG(length);
|
||||
}
|
||||
|
|
48
vendor/aws/aws-crt-php/format-check.sh
vendored
48
vendor/aws/aws-crt-php/format-check.sh
vendored
|
@ -1,24 +1,24 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [[ -z $CLANG_FORMAT ]] ; then
|
||||
CLANG_FORMAT=clang-format
|
||||
fi
|
||||
|
||||
if NOT type $CLANG_FORMAT 2> /dev/null ; then
|
||||
echo "No appropriate clang-format found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
FAIL=0
|
||||
SOURCE_FILES=`find src ext -type f \( -name '*.c' \)`
|
||||
for i in $SOURCE_FILES
|
||||
do
|
||||
$CLANG_FORMAT -output-replacements-xml $i | grep -c "<replacement " > /dev/null
|
||||
if [ $? -ne 1 ]
|
||||
then
|
||||
echo "$i failed clang-format check."
|
||||
FAIL=1
|
||||
fi
|
||||
done
|
||||
|
||||
exit $FAIL
|
||||
#!/bin/bash
|
||||
|
||||
if [[ -z $CLANG_FORMAT ]] ; then
|
||||
CLANG_FORMAT=clang-format
|
||||
fi
|
||||
|
||||
if NOT type $CLANG_FORMAT 2> /dev/null ; then
|
||||
echo "No appropriate clang-format found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
FAIL=0
|
||||
SOURCE_FILES=`find src ext -type f \( -name '*.c' \)`
|
||||
for i in $SOURCE_FILES
|
||||
do
|
||||
$CLANG_FORMAT -output-replacements-xml $i | grep -c "<replacement " > /dev/null
|
||||
if [ $? -ne 1 ]
|
||||
then
|
||||
echo "$i failed clang-format check."
|
||||
FAIL=1
|
||||
fi
|
||||
done
|
||||
|
||||
exit $FAIL
|
||||
|
|
48
vendor/aws/aws-crt-php/gen_api.php
vendored
48
vendor/aws/aws-crt-php/gen_api.php
vendored
|
@ -1,24 +1,24 @@
|
|||
<?php
|
||||
|
||||
$source = "php://stdin";
|
||||
if (isset($argv[1])) {
|
||||
$source = $argv[1];
|
||||
}
|
||||
|
||||
$input_lines = file($source);
|
||||
foreach ($input_lines as $line) {
|
||||
// Strip AWS_EXTERN_C_BEGIN/END
|
||||
if (preg_match('/AWS_EXTERN_C/', $line)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Strip macros/includes
|
||||
if (preg_match('/^#/', $line)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Strip visibility attributes
|
||||
$line = str_replace('AWS_CRT_API ', '', $line);
|
||||
|
||||
echo($line);
|
||||
}
|
||||
<?php
|
||||
|
||||
$source = "php://stdin";
|
||||
if (isset($argv[1])) {
|
||||
$source = $argv[1];
|
||||
}
|
||||
|
||||
$input_lines = file($source);
|
||||
foreach ($input_lines as $line) {
|
||||
// Strip AWS_EXTERN_C_BEGIN/END
|
||||
if (preg_match('/AWS_EXTERN_C/', $line)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Strip macros/includes
|
||||
if (preg_match('/^#/', $line)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Strip visibility attributes
|
||||
$line = str_replace('AWS_CRT_API ', '', $line);
|
||||
|
||||
echo($line);
|
||||
}
|
||||
|
|
3996
vendor/aws/aws-crt-php/gen_stub.php
vendored
3996
vendor/aws/aws-crt-php/gen_stub.php
vendored
File diff suppressed because it is too large
Load diff
38
vendor/aws/aws-crt-php/package.xml-template_post
vendored
38
vendor/aws/aws-crt-php/package.xml-template_post
vendored
|
@ -1,19 +1,19 @@
|
|||
</contents>
|
||||
<dependencies>
|
||||
<required>
|
||||
<php>
|
||||
<min>7.4.0</min>
|
||||
</php>
|
||||
<pearinstaller>
|
||||
<min>1.10.0</min>
|
||||
</pearinstaller>
|
||||
</required>
|
||||
</dependencies>
|
||||
<providesextension>awscrt</providesextension>
|
||||
<extsrcrelease/>
|
||||
<changelog>
|
||||
<release>
|
||||
|
||||
</release>
|
||||
</changelog>
|
||||
</package>
|
||||
</contents>
|
||||
<dependencies>
|
||||
<required>
|
||||
<php>
|
||||
<min>7.4.0</min>
|
||||
</php>
|
||||
<pearinstaller>
|
||||
<min>1.10.0</min>
|
||||
</pearinstaller>
|
||||
</required>
|
||||
</dependencies>
|
||||
<providesextension>awscrt</providesextension>
|
||||
<extsrcrelease/>
|
||||
<changelog>
|
||||
<release>
|
||||
|
||||
</release>
|
||||
</changelog>
|
||||
</package>
|
||||
|
|
48
vendor/aws/aws-crt-php/package.xml-template_pre
vendored
48
vendor/aws/aws-crt-php/package.xml-template_pre
vendored
|
@ -1,24 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<package packagerversion="1.8.1" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
|
||||
<name>awscrt</name>
|
||||
<channel>pecl.php.net</channel>
|
||||
<summary>AWS Common Runtime PHP bindings</summary>
|
||||
<description>AWS Common Runtime provides a set of low level tools as network protocols and authentication used by the AWSSDK for PHP to provide high level API to access AWS services.</description>
|
||||
<lead>
|
||||
<name>{{{NAME}}}</name>
|
||||
<user>{{{USER}}}</user>
|
||||
<email>{{{EMAIL}}}</email>
|
||||
<active>yes</active>
|
||||
</lead>
|
||||
<date>{{{TODAY}}}</date>
|
||||
<version>
|
||||
<release>{{{VERSION}}}</release>
|
||||
<api>1.0.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>devel</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="https://www.apache.org/licenses/LICENSE-2.0">Apache License Version 2.0</license>
|
||||
<notes>{{{NOTES}}}</notes>
|
||||
<contents>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<package packagerversion="1.8.1" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
|
||||
<name>awscrt</name>
|
||||
<channel>pecl.php.net</channel>
|
||||
<summary>AWS Common Runtime PHP bindings</summary>
|
||||
<description>AWS Common Runtime provides a set of low level tools as network protocols and authentication used by the AWSSDK for PHP to provide high level API to access AWS services.</description>
|
||||
<lead>
|
||||
<name>{{{NAME}}}</name>
|
||||
<user>{{{USER}}}</user>
|
||||
<email>{{{EMAIL}}}</email>
|
||||
<active>yes</active>
|
||||
</lead>
|
||||
<date>{{{TODAY}}}</date>
|
||||
<version>
|
||||
<release>{{{VERSION}}}</release>
|
||||
<api>1.0.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>devel</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="https://www.apache.org/licenses/LICENSE-2.0">Apache License Version 2.0</license>
|
||||
<notes>{{{NOTES}}}</notes>
|
||||
<contents>
|
||||
|
|
4
vendor/aws/aws-crt-php/php-win.ini
vendored
4
vendor/aws/aws-crt-php/php-win.ini
vendored
|
@ -1,2 +1,2 @@
|
|||
extension=php_awscrt.dll
|
||||
extension=php_openssl.dll
|
||||
extension=php_awscrt.dll
|
||||
extension=php_openssl.dll
|
||||
|
|
2
vendor/aws/aws-crt-php/php.ini
vendored
2
vendor/aws/aws-crt-php/php.ini
vendored
|
@ -1 +1 @@
|
|||
extension=modules/awscrt.so
|
||||
extension=modules/awscrt.so
|
||||
|
|
288
vendor/aws/aws-crt-php/prepare_package_xml.sh
vendored
288
vendor/aws/aws-crt-php/prepare_package_xml.sh
vendored
|
@ -1,144 +1,144 @@
|
|||
#!/bin/zsh
|
||||
zparseopts -A opts -name: -user: -email: -version: -notes:
|
||||
if [[ $# -lt 10 ]]
|
||||
then
|
||||
echo "Usage ${0} --name NAME, --user USER --email EMAIL --version VERSION --notes NOTES"
|
||||
exit 1
|
||||
fi
|
||||
NAME="${opts[--name]}"
|
||||
USER="${opts[--user]}"
|
||||
EMAIL="${opts[--email]}"
|
||||
VERSION="${opts[--version]}"
|
||||
NOTES="${opts[--notes]}"
|
||||
|
||||
TODAY=$(date -u +%Y-%m-%d)
|
||||
|
||||
cat package.xml-template_pre \
|
||||
| sed "s/{{{NAME}}}/$NAME/g" \
|
||||
| sed "s/{{{USER}}}/$USER/g" \
|
||||
| sed "s/{{{EMAIL}}}/$EMAIL/g" \
|
||||
| sed "s/{{{TODAY}}}/$TODAY/g" \
|
||||
| sed "s/{{{VERSION}}}/$VERSION/g" \
|
||||
| sed "s/{{{NOTES}}}/$NOTES/g"
|
||||
|
||||
source_ext='(c|cc|h|cpp|hpp|m4|w32|ini|frag|cmake|inl|in|py|gnu|yaml|def|pl|S|s|errordata|go|lds|num|asm|mod|peg|mk|rs|toml|sh)'
|
||||
doc_ext='(md|json|html|dot|graphml|png|gn|sha1|css|rst|)'
|
||||
|
||||
special_docs='(LICENSE*|NOTICE|changelog.txt|CHANGELOG|THIRD-PARTY|README*|readme|METADATA|CONTRIBUTORS|UPDATING|doc.config)'
|
||||
special_tests='(ci-test.sh|format-check.sh|run_tests*|sanitizer-blacklist.txt|run-clang-tidy.sh|benchmark-build-run.sh|break-tests.sh|generate-coverage.sh|test.xml)'
|
||||
special_src='(gen_api.php|gen_stub.php|CMakeLists.txt|post.sh|postun.sh|Makefile*|build-buildspec.sh|build-deps.sh|objects.txt|go.*|BUILD*|DEPS|install_and_run.sh|codemod.sh|requirements.txt)'
|
||||
skip_files='(package.xml*|prepare_release.sh|codereview.settings|*.o|*.a|*.obj|*.lib|break-tests-android.sh|whitespace.txt|prepare_package_xml.sh|crypto_test_data.cc|*.pdf|*.svg|*.docx|cbmc-proof.txt|codecov*|litani*|*.toml)'
|
||||
|
||||
special_scripts='(awscrt.stub.php)'
|
||||
|
||||
skip_directories='(tests|test|AWSCRTAndroidTestRunner|docker-images|codebuild|fuzz|verfication|third_party|docs|generated-src|aws-lc|aws-crt-sys)'
|
||||
|
||||
process_file() {
|
||||
if (( $# == 0 ))
|
||||
then
|
||||
echo "ERROR: filename not passed"
|
||||
exit 1
|
||||
fi
|
||||
if [[ $1 = $~skip_files ]]
|
||||
then
|
||||
# This file is not part of the release bundle
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo -n '<file name="'"$1"'" role="'
|
||||
# Special cases
|
||||
case ${a} in
|
||||
$~special_scripts)
|
||||
echo -n 'script'
|
||||
;;
|
||||
$~special_docs)
|
||||
echo -n 'doc'
|
||||
;;
|
||||
$~special_tests)
|
||||
echo -n 'test'
|
||||
;;
|
||||
$~special_src)
|
||||
echo -n 'src'
|
||||
;;
|
||||
*)
|
||||
# Extension based cases
|
||||
case ${a:t:e} in
|
||||
$~source_ext)
|
||||
echo -n 'src'
|
||||
;;
|
||||
$~doc_ext)
|
||||
echo -n 'doc'
|
||||
;;
|
||||
php)
|
||||
echo -n 'script'
|
||||
;;
|
||||
*)
|
||||
echo "${a:t:e} - ${a} - FAIL TO RECOGNIZE"
|
||||
exit 1
|
||||
esac
|
||||
esac
|
||||
echo '"/>'
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
process_dir() {
|
||||
if (( $# == 0 ))
|
||||
then
|
||||
echo "WARNING: dirname not passed"
|
||||
exit 1
|
||||
fi
|
||||
if [[ "${1}" = $~skip_directories ]]
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
echo '<dir name="'"$1"'">'
|
||||
cd "$1"
|
||||
for a in *
|
||||
do
|
||||
if [[ -f ${a} ]]
|
||||
then process_file "${a}"
|
||||
else process_dir "${a}"
|
||||
fi
|
||||
done
|
||||
# Special cases for compiler features placed in tests directories in and s2n
|
||||
if [[ "${1}" = "s2n" && -d tests ]]
|
||||
then
|
||||
echo '<dir name="tests">'
|
||||
echo '<dir name="features">'
|
||||
cd tests/features
|
||||
for a in *
|
||||
do
|
||||
process_file "${a}"
|
||||
done
|
||||
cd ../..
|
||||
echo '</dir>'
|
||||
echo '</dir>'
|
||||
fi
|
||||
echo '</dir>'
|
||||
cd ..
|
||||
return 0
|
||||
}
|
||||
|
||||
echo '<dir name="/">'
|
||||
for a in *
|
||||
do
|
||||
if [[ ${a} == 'tests' ]]
|
||||
then
|
||||
echo '<dir name="tests">'
|
||||
for b in tests/*
|
||||
do
|
||||
echo '<file name="'$( basename "${b}" )'" role="test" />'
|
||||
done
|
||||
echo '</dir>'
|
||||
continue
|
||||
fi
|
||||
if [[ -f ${a} ]]
|
||||
then process_file "${a}"
|
||||
else process_dir "${a}"
|
||||
fi
|
||||
done
|
||||
echo '</dir>'
|
||||
|
||||
cat package.xml-template_post
|
||||
|
||||
#!/bin/zsh
|
||||
zparseopts -A opts -name: -user: -email: -version: -notes:
|
||||
if [[ $# -lt 10 ]]
|
||||
then
|
||||
echo "Usage ${0} --name NAME, --user USER --email EMAIL --version VERSION --notes NOTES"
|
||||
exit 1
|
||||
fi
|
||||
NAME="${opts[--name]}"
|
||||
USER="${opts[--user]}"
|
||||
EMAIL="${opts[--email]}"
|
||||
VERSION="${opts[--version]}"
|
||||
NOTES="${opts[--notes]}"
|
||||
|
||||
TODAY=$(date -u +%Y-%m-%d)
|
||||
|
||||
cat package.xml-template_pre \
|
||||
| sed "s/{{{NAME}}}/$NAME/g" \
|
||||
| sed "s/{{{USER}}}/$USER/g" \
|
||||
| sed "s/{{{EMAIL}}}/$EMAIL/g" \
|
||||
| sed "s/{{{TODAY}}}/$TODAY/g" \
|
||||
| sed "s/{{{VERSION}}}/$VERSION/g" \
|
||||
| sed "s/{{{NOTES}}}/$NOTES/g"
|
||||
|
||||
source_ext='(c|cc|h|cpp|hpp|m4|w32|ini|frag|cmake|inl|in|py|gnu|yaml|def|pl|S|s|errordata|go|lds|num|asm|mod|peg|mk|rs|toml|sh)'
|
||||
doc_ext='(md|json|html|dot|graphml|png|gn|sha1|css|rst|)'
|
||||
|
||||
special_docs='(LICENSE*|NOTICE|changelog.txt|CHANGELOG|THIRD-PARTY|README*|readme|METADATA|CONTRIBUTORS|UPDATING|doc.config)'
|
||||
special_tests='(ci-test.sh|format-check.sh|run_tests*|sanitizer-blacklist.txt|run-clang-tidy.sh|benchmark-build-run.sh|break-tests.sh|generate-coverage.sh|test.xml)'
|
||||
special_src='(gen_api.php|gen_stub.php|CMakeLists.txt|post.sh|postun.sh|Makefile*|build-buildspec.sh|build-deps.sh|objects.txt|go.*|BUILD*|DEPS|install_and_run.sh|codemod.sh|requirements.txt)'
|
||||
skip_files='(package.xml*|prepare_release.sh|codereview.settings|*.o|*.a|*.obj|*.lib|break-tests-android.sh|whitespace.txt|prepare_package_xml.sh|crypto_test_data.cc|*.pdf|*.svg|*.docx|cbmc-proof.txt|codecov*|litani*|*.toml)'
|
||||
|
||||
special_scripts='(awscrt.stub.php)'
|
||||
|
||||
skip_directories='(tests|test|AWSCRTAndroidTestRunner|docker-images|codebuild|fuzz|verfication|third_party|docs|generated-src|aws-lc|aws-crt-sys)'
|
||||
|
||||
process_file() {
|
||||
if (( $# == 0 ))
|
||||
then
|
||||
echo "ERROR: filename not passed"
|
||||
exit 1
|
||||
fi
|
||||
if [[ $1 = $~skip_files ]]
|
||||
then
|
||||
# This file is not part of the release bundle
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo -n '<file name="'"$1"'" role="'
|
||||
# Special cases
|
||||
case ${a} in
|
||||
$~special_scripts)
|
||||
echo -n 'script'
|
||||
;;
|
||||
$~special_docs)
|
||||
echo -n 'doc'
|
||||
;;
|
||||
$~special_tests)
|
||||
echo -n 'test'
|
||||
;;
|
||||
$~special_src)
|
||||
echo -n 'src'
|
||||
;;
|
||||
*)
|
||||
# Extension based cases
|
||||
case ${a:t:e} in
|
||||
$~source_ext)
|
||||
echo -n 'src'
|
||||
;;
|
||||
$~doc_ext)
|
||||
echo -n 'doc'
|
||||
;;
|
||||
php)
|
||||
echo -n 'script'
|
||||
;;
|
||||
*)
|
||||
echo "${a:t:e} - ${a} - FAIL TO RECOGNIZE"
|
||||
exit 1
|
||||
esac
|
||||
esac
|
||||
echo '"/>'
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
process_dir() {
|
||||
if (( $# == 0 ))
|
||||
then
|
||||
echo "WARNING: dirname not passed"
|
||||
exit 1
|
||||
fi
|
||||
if [[ "${1}" = $~skip_directories ]]
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
echo '<dir name="'"$1"'">'
|
||||
cd "$1"
|
||||
for a in *
|
||||
do
|
||||
if [[ -f ${a} ]]
|
||||
then process_file "${a}"
|
||||
else process_dir "${a}"
|
||||
fi
|
||||
done
|
||||
# Special cases for compiler features placed in tests directories in and s2n
|
||||
if [[ "${1}" = "s2n" && -d tests ]]
|
||||
then
|
||||
echo '<dir name="tests">'
|
||||
echo '<dir name="features">'
|
||||
cd tests/features
|
||||
for a in *
|
||||
do
|
||||
process_file "${a}"
|
||||
done
|
||||
cd ../..
|
||||
echo '</dir>'
|
||||
echo '</dir>'
|
||||
fi
|
||||
echo '</dir>'
|
||||
cd ..
|
||||
return 0
|
||||
}
|
||||
|
||||
echo '<dir name="/">'
|
||||
for a in *
|
||||
do
|
||||
if [[ ${a} == 'tests' ]]
|
||||
then
|
||||
echo '<dir name="tests">'
|
||||
for b in tests/*
|
||||
do
|
||||
echo '<file name="'$( basename "${b}" )'" role="test" />'
|
||||
done
|
||||
echo '</dir>'
|
||||
continue
|
||||
fi
|
||||
if [[ -f ${a} ]]
|
||||
then process_file "${a}"
|
||||
else process_dir "${a}"
|
||||
fi
|
||||
done
|
||||
echo '</dir>'
|
||||
|
||||
cat package.xml-template_post
|
||||
|
||||
|
|
62
vendor/aws/aws-crt-php/prepare_release.sh
vendored
62
vendor/aws/aws-crt-php/prepare_release.sh
vendored
|
@ -1,31 +1,31 @@
|
|||
#!/bin/zsh
|
||||
zparseopts -A opts -name: -user: -email: -version: -notes:
|
||||
if [[ $# -lt 10 ]]; then
|
||||
echo "Usage ${0} --name NAME --user USER --email EMAIL --version VERSION --notes NOTES"
|
||||
exit 1
|
||||
fi
|
||||
PACKAGE='awscrt'
|
||||
NAME="${opts[--name]}"
|
||||
USER="${opts[--user]}"
|
||||
EMAIL="${opts[--email]}"
|
||||
VERSION="${opts[--version]}"
|
||||
NOTES="${opts[--notes]}"
|
||||
|
||||
./prepare_package_xml.sh --name "${NAME}" --user "${USER}" --email "${EMAIL}" --version "${VERSION}" --notes "${NOTES}" >package.xml
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "ERROR PROCESSING review package.xml"
|
||||
exit 1
|
||||
fi
|
||||
tidy -xml -m -i package.xml
|
||||
pear package-validate
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "ERROR VALIDATING review package.xml"
|
||||
exit 1
|
||||
fi
|
||||
pear package
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "ERROR PROCESSING review package.xml"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Size of ${PACKAGE}-${VERSION}.tgz: " $(du -h "${PACKAGE}-${VERSION}.tgz")
|
||||
#!/bin/zsh
|
||||
zparseopts -A opts -name: -user: -email: -version: -notes:
|
||||
if [[ $# -lt 10 ]]; then
|
||||
echo "Usage ${0} --name NAME --user USER --email EMAIL --version VERSION --notes NOTES"
|
||||
exit 1
|
||||
fi
|
||||
PACKAGE='awscrt'
|
||||
NAME="${opts[--name]}"
|
||||
USER="${opts[--user]}"
|
||||
EMAIL="${opts[--email]}"
|
||||
VERSION="${opts[--version]}"
|
||||
NOTES="${opts[--notes]}"
|
||||
|
||||
./prepare_package_xml.sh --name "${NAME}" --user "${USER}" --email "${EMAIL}" --version "${VERSION}" --notes "${NOTES}" >package.xml
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "ERROR PROCESSING review package.xml"
|
||||
exit 1
|
||||
fi
|
||||
tidy -xml -m -i package.xml
|
||||
pear package-validate
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "ERROR VALIDATING review package.xml"
|
||||
exit 1
|
||||
fi
|
||||
pear package
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "ERROR PROCESSING review package.xml"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Size of ${PACKAGE}-${VERSION}.tgz: " $(du -h "${PACKAGE}-${VERSION}.tgz")
|
||||
|
|
36
vendor/aws/aws-crt-php/run_tests
vendored
36
vendor/aws/aws-crt-php/run_tests
vendored
|
@ -1,18 +1,18 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -ex
|
||||
|
||||
launcher=
|
||||
if command -v catchsegv; then
|
||||
launcher=catchsegv
|
||||
fi
|
||||
|
||||
if [ -z $PHP_BINARY ]; then
|
||||
PHP_BINARY=$(which php)
|
||||
fi
|
||||
|
||||
if [ ! -d vendor ]; then
|
||||
composer update
|
||||
fi
|
||||
|
||||
$launcher $PHP_BINARY -c php.ini vendor/bin/phpunit tests --debug
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -ex
|
||||
|
||||
launcher=
|
||||
if command -v catchsegv; then
|
||||
launcher=catchsegv
|
||||
fi
|
||||
|
||||
if [ -z $PHP_BINARY ]; then
|
||||
PHP_BINARY=$(which php)
|
||||
fi
|
||||
|
||||
if [ ! -d vendor ]; then
|
||||
composer update
|
||||
fi
|
||||
|
||||
$launcher $PHP_BINARY -c php.ini vendor/bin/phpunit tests --debug
|
||||
|
|
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