Merge branch '0.13.x' into feat-storage-ui-updates
This commit is contained in:
commit
d879128744
19 changed files with 214 additions and 147 deletions
27
CHANGES.md
27
CHANGES.md
|
@ -1,3 +1,16 @@
|
||||||
|
# Version 0.12.2
|
||||||
|
|
||||||
|
## Bugs
|
||||||
|
- Fix security vulnerability in the Console (#2778)
|
||||||
|
- Fix security vulnerability in the ACME-Challenge (#2780)
|
||||||
|
|
||||||
|
## Upgrades
|
||||||
|
|
||||||
|
- Upgraded `redis` extenstion to version 5.3.6
|
||||||
|
- Upgraded `swoole` extenstion to version 4.8.6
|
||||||
|
- Upgraded `imagick` extenstion to version 3.7.0
|
||||||
|
- Upgraded GEO IP database to version February 2022
|
||||||
|
|
||||||
# Version 0.12.1
|
# Version 0.12.1
|
||||||
|
|
||||||
## Bugs
|
## Bugs
|
||||||
|
@ -84,6 +97,20 @@
|
||||||
- Upgraded InfluxDB to 1.4.0
|
- Upgraded InfluxDB to 1.4.0
|
||||||
- Upgraded Telegraf to 1.3.0
|
- Upgraded Telegraf to 1.3.0
|
||||||
|
|
||||||
|
# Version 0.11.1
|
||||||
|
|
||||||
|
## Bugs
|
||||||
|
- Fix security vulnerability in the Console (#2777)
|
||||||
|
- Fix security vulnerability in the ACME-Challenge (#2779)
|
||||||
|
|
||||||
|
## Upgrades
|
||||||
|
- Upgraded redis extenstion to version 5.3.6
|
||||||
|
- Upgraded swoole extenstion to version 4.8.6
|
||||||
|
- Upgraded imagick extenstion to version 3.7.0
|
||||||
|
- Upgraded yaml extenstion to version 2.2.2
|
||||||
|
- Upgraded maxminddb extenstion to version 1.11.0
|
||||||
|
- Upgraded GEO IP database to version February 2022
|
||||||
|
|
||||||
# Version 0.11.0
|
# Version 0.11.0
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
[English](README.md) | 简体中文
|
[English](README.md) | 简体中文
|
||||||
|
|
||||||
Appwrite是一个基于dcoker的端到端开发者平台,其容器化的微服务库可应用于网页端,移动端,以及后端。Appwrite 通过视觉化界面极简了从零编写 API 的繁琐过程,在保证软件安全的前提下为开发者创造了一个高效的开发环境。
|
Appwrite是一个基于Docker的端到端开发者平台,其容器化的微服务库可应用于网页端,移动端,以及后端。Appwrite 通过视觉化界面极简了从零编写 API 的繁琐过程,在保证软件安全的前提下为开发者创造了一个高效的开发环境。
|
||||||
|
|
||||||
Appwrite 可以提供给开发者用户验证,外部授权,用户数据读写检索,文件储存, 图像处理,云函数计算,[等多种服务](https:/ /appwrite.io/docs)。
|
Appwrite 可以提供给开发者用户验证,外部授权,用户数据读写检索,文件储存, 图像处理,云函数计算,[等多种服务](https:/ /appwrite.io/docs)。
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ docker run -it --rm \
|
||||||
--volume /var/run/docker.sock:/var/run/docker.sock \
|
--volume /var/run/docker.sock:/var/run/docker.sock \
|
||||||
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
|
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
|
||||||
--entrypoint="install" \
|
--entrypoint="install" \
|
||||||
appwrite/appwrite:0.12.1
|
appwrite/appwrite:0.12.2
|
||||||
```
|
```
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
@ -71,7 +71,7 @@ docker run -it --rm ^
|
||||||
--volume //var/run/docker.sock:/var/run/docker.sock ^
|
--volume //var/run/docker.sock:/var/run/docker.sock ^
|
||||||
--volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
|
--volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
|
||||||
--entrypoint="install" ^
|
--entrypoint="install" ^
|
||||||
appwrite/appwrite:0.12.1
|
appwrite/appwrite:0.12.2
|
||||||
```
|
```
|
||||||
|
|
||||||
#### PowerShell
|
#### PowerShell
|
||||||
|
@ -81,7 +81,7 @@ docker run -it --rm ,
|
||||||
--volume /var/run/docker.sock:/var/run/docker.sock ,
|
--volume /var/run/docker.sock:/var/run/docker.sock ,
|
||||||
--volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ,
|
--volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ,
|
||||||
--entrypoint="install" ,
|
--entrypoint="install" ,
|
||||||
appwrite/appwrite:0.12.1
|
appwrite/appwrite:0.12.2
|
||||||
```
|
```
|
||||||
|
|
||||||
运行后,可以在浏览器上访问 http://localhost 找到 Appwrite 控制台。在非 Linux 的本机主机上完成安装后,服务器可能需要几分钟才能启动。
|
运行后,可以在浏览器上访问 http://localhost 找到 Appwrite 控制台。在非 Linux 的本机主机上完成安装后,服务器可能需要几分钟才能启动。
|
||||||
|
|
|
@ -62,7 +62,7 @@ docker run -it --rm \
|
||||||
--volume /var/run/docker.sock:/var/run/docker.sock \
|
--volume /var/run/docker.sock:/var/run/docker.sock \
|
||||||
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
|
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
|
||||||
--entrypoint="install" \
|
--entrypoint="install" \
|
||||||
appwrite/appwrite:0.12.1
|
appwrite/appwrite:0.12.2
|
||||||
```
|
```
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
@ -74,7 +74,7 @@ docker run -it --rm ^
|
||||||
--volume //var/run/docker.sock:/var/run/docker.sock ^
|
--volume //var/run/docker.sock:/var/run/docker.sock ^
|
||||||
--volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
|
--volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^
|
||||||
--entrypoint="install" ^
|
--entrypoint="install" ^
|
||||||
appwrite/appwrite:0.12.1
|
appwrite/appwrite:0.12.2
|
||||||
```
|
```
|
||||||
|
|
||||||
#### PowerShell
|
#### PowerShell
|
||||||
|
@ -84,7 +84,7 @@ docker run -it --rm ,
|
||||||
--volume /var/run/docker.sock:/var/run/docker.sock ,
|
--volume /var/run/docker.sock:/var/run/docker.sock ,
|
||||||
--volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ,
|
--volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ,
|
||||||
--entrypoint="install" ,
|
--entrypoint="install" ,
|
||||||
appwrite/appwrite:0.12.1
|
appwrite/appwrite:0.12.2
|
||||||
```
|
```
|
||||||
|
|
||||||
Once the Docker installation completes, go to http://localhost to access the Appwrite console from your browser. Please note that on non-Linux native hosts, the server might take a few minutes to start after installation completes.
|
Once the Docker installation completes, go to http://localhost to access the Appwrite console from your browser. Please note that on non-Linux native hosts, the server might take a few minutes to start after installation completes.
|
||||||
|
|
|
@ -4,10 +4,9 @@
|
||||||
|
|
||||||
| Version | Supported |
|
| Version | Supported |
|
||||||
| ------- | ------------------ |
|
| ------- | ------------------ |
|
||||||
| < 0.5 | :x: |
|
| <= 0.10 | :x: |
|
||||||
| 0.6.x | :white_check_mark: |
|
| 0.11.x | :white_check_mark: |
|
||||||
| 0.7.x | :white_check_mark: |
|
| 0.12.x | :white_check_mark: |
|
||||||
| 0.8.0 | :white_check_mark: |
|
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,6 @@ $member = [
|
||||||
'documents.write',
|
'documents.write',
|
||||||
'files.read',
|
'files.read',
|
||||||
'files.write',
|
'files.write',
|
||||||
'buckets.read',
|
|
||||||
'buckets.write',
|
|
||||||
'projects.read',
|
'projects.read',
|
||||||
'projects.write',
|
'projects.write',
|
||||||
'locale.read',
|
'locale.read',
|
||||||
|
|
|
@ -152,7 +152,7 @@ return [
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'name' => '_APP_LOGGING_PROVIDER',
|
'name' => '_APP_LOGGING_PROVIDER',
|
||||||
'description' => 'This variable allows you to enable logging errors to 3rd party providers. This value is empty by default, to enable the logger set the value to one of \'sentry\', \'raygun\', \'appsignal\'',
|
'description' => 'This variable allows you to enable logging errors to 3rd party providers. This value is empty by default, to enable the logger set the value to one of \'sentry\', \'raygun\', \'appsignal\', \'logowl\'',
|
||||||
'introduction' => '0.12.0',
|
'introduction' => '0.12.0',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
|
@ -161,7 +161,7 @@ return [
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'name' => '_APP_LOGGING_CONFIG',
|
'name' => '_APP_LOGGING_CONFIG',
|
||||||
'description' => 'This variable configures authentication to 3rd party error logging providers. If using Sentry, this should be \'SENTRY_API_KEY;SENTRY_APP_ID\'. If using Raygun, this should be Raygun API key. If using AppSignal, this should be AppSignal API key.',
|
'description' => 'This variable configures authentication to 3rd party error logging providers. If using Sentry, this should be \'SENTRY_API_KEY;SENTRY_APP_ID\'. If using Raygun, this should be Raygun API key. If using AppSignal, this should be AppSignal API key. If using LogOwl, this should be LogOwl Service Ticket.',
|
||||||
'introduction' => '0.12.0',
|
'introduction' => '0.12.0',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
|
|
|
@ -358,11 +358,12 @@ App::get('/v1/health/stats') // Currently only used internally
|
||||||
->label('docs', false)
|
->label('docs', false)
|
||||||
->inject('response')
|
->inject('response')
|
||||||
->inject('register')
|
->inject('register')
|
||||||
->action(function ($response, $register) {
|
->inject('deviceFiles')
|
||||||
|
->action(function ($response, $register, $deviceFiles) {
|
||||||
/** @var Appwrite\Utopia\Response $response */
|
/** @var Appwrite\Utopia\Response $response */
|
||||||
/** @var Utopia\Registry\Registry $register */
|
/** @var Utopia\Registry\Registry $register */
|
||||||
|
/** @var Utopia\Storage\Device $deviceFiles */
|
||||||
|
|
||||||
$device = Storage::getDevice('files');
|
|
||||||
$cache = $register->get('cache');
|
$cache = $register->get('cache');
|
||||||
|
|
||||||
$cacheStats = $cache->info();
|
$cacheStats = $cache->info();
|
||||||
|
@ -370,9 +371,9 @@ App::get('/v1/health/stats') // Currently only used internally
|
||||||
$response
|
$response
|
||||||
->json([
|
->json([
|
||||||
'storage' => [
|
'storage' => [
|
||||||
'used' => Storage::human($device->getDirectorySize($device->getRoot().'/')),
|
'used' => Storage::human($deviceFiles->getDirectorySize($deviceFiles->getRoot().'/')),
|
||||||
'partitionTotal' => Storage::human($device->getPartitionTotalSpace()),
|
'partitionTotal' => Storage::human($deviceFiles->getPartitionTotalSpace()),
|
||||||
'partitionFree' => Storage::human($device->getPartitionFreeSpace()),
|
'partitionFree' => Storage::human($deviceFiles->getPartitionFreeSpace()),
|
||||||
],
|
],
|
||||||
'cache' => [
|
'cache' => [
|
||||||
'uptime' => $cacheStats['uptime_in_seconds'] ?? 0,
|
'uptime' => $cacheStats['uptime_in_seconds'] ?? 0,
|
||||||
|
|
|
@ -19,6 +19,7 @@ use Utopia\Database\Document;
|
||||||
use Utopia\Database\Query;
|
use Utopia\Database\Query;
|
||||||
use Utopia\Database\Validator\Authorization;
|
use Utopia\Database\Validator\Authorization;
|
||||||
use Appwrite\Utopia\Request\Filters\V12;
|
use Appwrite\Utopia\Request\Filters\V12;
|
||||||
|
use Utopia\Validator\Text;
|
||||||
|
|
||||||
Config::setParam('domainVerification', false);
|
Config::setParam('domainVerification', false);
|
||||||
Config::setParam('cookieDomain', 'localhost');
|
Config::setParam('cookieDomain', 'localhost');
|
||||||
|
@ -514,8 +515,25 @@ App::get('/.well-known/acme-challenge')
|
||||||
->inject('request')
|
->inject('request')
|
||||||
->inject('response')
|
->inject('response')
|
||||||
->action(function ($request, $response) {
|
->action(function ($request, $response) {
|
||||||
|
$uriChunks = \explode('/', $request->getURI());
|
||||||
|
$token = $uriChunks[\count($uriChunks) - 1];
|
||||||
|
|
||||||
|
$validator = new Text(100, [
|
||||||
|
...Text::NUMBERS,
|
||||||
|
...Text::ALPHABET_LOWER,
|
||||||
|
...Text::ALPHABET_UPPER,
|
||||||
|
'-',
|
||||||
|
'_'
|
||||||
|
]);
|
||||||
|
|
||||||
|
if (!$validator->isValid($token) || \count($uriChunks) !== 4) {
|
||||||
|
throw new Exception('Invalid challenge token.', 400);
|
||||||
|
}
|
||||||
|
|
||||||
|
$filePath = '/.well-known/acme-challenge' . $token;
|
||||||
|
|
||||||
$base = \realpath(APP_STORAGE_CERTIFICATES);
|
$base = \realpath(APP_STORAGE_CERTIFICATES);
|
||||||
$path = \str_replace('/.well-known/acme-challenge/', '', $request->getURI());
|
$path = \str_replace('/.well-known/acme-challenge/', '', $filePath);
|
||||||
$absolute = \realpath($base.'/.well-known/acme-challenge/'.$path);
|
$absolute = \realpath($base.'/.well-known/acme-challenge/'.$path);
|
||||||
|
|
||||||
if (!$base) {
|
if (!$base) {
|
||||||
|
|
|
@ -28,32 +28,6 @@ App::init(function ($utopia, $request, $response, $project, $user, $events, $aud
|
||||||
/** @var Appwrite\Event\Event $functions */
|
/** @var Appwrite\Event\Event $functions */
|
||||||
/** @var Utopia\Database\Database $dbForProject */
|
/** @var Utopia\Database\Database $dbForProject */
|
||||||
|
|
||||||
Storage::setDevice('self', new Local());
|
|
||||||
switch (App::getEnv('_APP_STORAGE_DEVICE', Storage::DEVICE_LOCAL)) {
|
|
||||||
case Storage::DEVICE_LOCAL:default:
|
|
||||||
Storage::setDevice('files', new Local(APP_STORAGE_UPLOADS . '/app-' . $project->getId()));
|
|
||||||
Storage::setDevice('functions', new Local(APP_STORAGE_FUNCTIONS . '/app-' . $project->getId()));
|
|
||||||
break;
|
|
||||||
case Storage::DEVICE_S3:
|
|
||||||
$s3AccessKey = App::getEnv('_APP_STORAGE_DEVICE_S3_ACCESS_KEY', '');
|
|
||||||
$s3SecretKey = App::getEnv('_APP_STORAGE_DEVICE_S3_SECRET', '');
|
|
||||||
$s3Region = App::getEnv('_APP_STORAGE_DEVICE_S3_REGION', '');
|
|
||||||
$s3Bucket = App::getEnv('_APP_STORAGE_DEVICE_S3_BUCKET', '');
|
|
||||||
$s3Acl = 'private';
|
|
||||||
Storage::setDevice('files', new S3(APP_STORAGE_UPLOADS . '/app-' . $project->getId(), $s3AccessKey, $s3SecretKey, $s3Bucket, $s3Region, $s3Acl));
|
|
||||||
Storage::setDevice('functions', new S3(APP_STORAGE_FUNCTIONS . '/app-' . $project->getId(), $s3AccessKey, $s3SecretKey, $s3Bucket, $s3Region, $s3Acl));
|
|
||||||
break;
|
|
||||||
case Storage::DEVICE_DO_SPACES:
|
|
||||||
$doSpacesAccessKey = App::getEnv('_APP_STORAGE_DEVICE_DO_SPACES_ACCESS_KEY', '');
|
|
||||||
$doSpacesSecretKey = App::getEnv('_APP_STORAGE_DEVICE_DO_SPACES_SECRET', '');
|
|
||||||
$doSpacesRegion = App::getEnv('_APP_STORAGE_DEVICE_DO_SPACES_REGION', '');
|
|
||||||
$doSpacesBucket = App::getEnv('_APP_STORAGE_DEVICE_DO_SPACES_BUCKET', '');
|
|
||||||
$doSpacesAcl = 'private';
|
|
||||||
Storage::setDevice('files', new DOSpaces(APP_STORAGE_UPLOADS . '/app-' . $project->getId(), $doSpacesAccessKey, $doSpacesSecretKey, $doSpacesBucket, $doSpacesRegion, $doSpacesAcl));
|
|
||||||
Storage::setDevice('functions', new DOSpaces(APP_STORAGE_FUNCTIONS . '/app-' . $project->getId(), $doSpacesAccessKey, $doSpacesSecretKey, $doSpacesBucket, $doSpacesRegion, $doSpacesAcl));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
$route = $utopia->match($request);
|
$route = $utopia->match($request);
|
||||||
|
|
||||||
if ($project->isEmpty() && $route->getLabel('abuse-limit', 0) > 0) { // Abuse limit requires an active project scope
|
if ($project->isEmpty() && $route->getLabel('abuse-limit', 0) > 0) { // Abuse limit requires an active project scope
|
||||||
|
|
|
@ -365,6 +365,10 @@ services:
|
||||||
- _APP_INFLUXDB_HOST
|
- _APP_INFLUXDB_HOST
|
||||||
- _APP_INFLUXDB_PORT
|
- _APP_INFLUXDB_PORT
|
||||||
- _APP_USAGE_AGGREGATION_INTERVAL
|
- _APP_USAGE_AGGREGATION_INTERVAL
|
||||||
|
- _APP_REDIS_HOST
|
||||||
|
- _APP_REDIS_PORT
|
||||||
|
- _APP_REDIS_USER
|
||||||
|
- _APP_REDIS_PASS
|
||||||
|
|
||||||
appwrite-schedule:
|
appwrite-schedule:
|
||||||
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
|
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
|
||||||
|
|
140
composer.lock
generated
140
composer.lock
generated
|
@ -1033,12 +1033,12 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
|
||||||
"MongoDB\\": "src/"
|
|
||||||
},
|
|
||||||
"files": [
|
"files": [
|
||||||
"src/functions.php"
|
"src/functions.php"
|
||||||
]
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"MongoDB\\": "src/"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
"license": [
|
"license": [
|
||||||
|
@ -1766,12 +1766,12 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
|
||||||
"Symfony\\Polyfill\\Php80\\": ""
|
|
||||||
},
|
|
||||||
"files": [
|
"files": [
|
||||||
"bootstrap.php"
|
"bootstrap.php"
|
||||||
],
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Polyfill\\Php80\\": ""
|
||||||
|
},
|
||||||
"classmap": [
|
"classmap": [
|
||||||
"Resources/stubs"
|
"Resources/stubs"
|
||||||
]
|
]
|
||||||
|
@ -2258,16 +2258,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "utopia-php/framework",
|
"name": "utopia-php/framework",
|
||||||
"version": "0.19.5",
|
"version": "0.19.6",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/utopia-php/framework.git",
|
"url": "https://github.com/utopia-php/framework.git",
|
||||||
"reference": "1c28ba9a5b491cf7c90c535fefee5832c7133623"
|
"reference": "7d9b28365fb794001cb34dd028659452d4e71b7d"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/utopia-php/framework/zipball/1c28ba9a5b491cf7c90c535fefee5832c7133623",
|
"url": "https://api.github.com/repos/utopia-php/framework/zipball/7d9b28365fb794001cb34dd028659452d4e71b7d",
|
||||||
"reference": "1c28ba9a5b491cf7c90c535fefee5832c7133623",
|
"reference": "7d9b28365fb794001cb34dd028659452d4e71b7d",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -2301,9 +2301,9 @@
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/utopia-php/framework/issues",
|
"issues": "https://github.com/utopia-php/framework/issues",
|
||||||
"source": "https://github.com/utopia-php/framework/tree/0.19.5"
|
"source": "https://github.com/utopia-php/framework/tree/0.19.6"
|
||||||
},
|
},
|
||||||
"time": "2022-01-04T14:40:23+00:00"
|
"time": "2022-02-10T17:05:22+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "utopia-php/image",
|
"name": "utopia-php/image",
|
||||||
|
@ -2688,16 +2688,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "utopia-php/swoole",
|
"name": "utopia-php/swoole",
|
||||||
"version": "0.3.2",
|
"version": "0.3.3",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/utopia-php/swoole.git",
|
"url": "https://github.com/utopia-php/swoole.git",
|
||||||
"reference": "2b714eddf77cd5eda1889219c9656d7c0a63ce73"
|
"reference": "8312df69233b5dcd3992de88f131f238002749de"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/utopia-php/swoole/zipball/2b714eddf77cd5eda1889219c9656d7c0a63ce73",
|
"url": "https://api.github.com/repos/utopia-php/swoole/zipball/8312df69233b5dcd3992de88f131f238002749de",
|
||||||
"reference": "2b714eddf77cd5eda1889219c9656d7c0a63ce73",
|
"reference": "8312df69233b5dcd3992de88f131f238002749de",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -2738,9 +2738,9 @@
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/utopia-php/swoole/issues",
|
"issues": "https://github.com/utopia-php/swoole/issues",
|
||||||
"source": "https://github.com/utopia-php/swoole/tree/0.3.2"
|
"source": "https://github.com/utopia-php/swoole/tree/0.3.3"
|
||||||
},
|
},
|
||||||
"time": "2021-12-13T15:37:41+00:00"
|
"time": "2022-01-20T09:58:43+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "utopia-php/system",
|
"name": "utopia-php/system",
|
||||||
|
@ -3037,12 +3037,12 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
|
||||||
"Amp\\ByteStream\\": "lib"
|
|
||||||
},
|
|
||||||
"files": [
|
"files": [
|
||||||
"lib/functions.php"
|
"lib/functions.php"
|
||||||
]
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"Amp\\ByteStream\\": "lib"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
"license": [
|
"license": [
|
||||||
|
@ -3192,23 +3192,23 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "composer/semver",
|
"name": "composer/semver",
|
||||||
"version": "3.2.7",
|
"version": "3.2.9",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/composer/semver.git",
|
"url": "https://github.com/composer/semver.git",
|
||||||
"reference": "deac27056b57e46faf136fae7b449eeaa71661ee"
|
"reference": "a951f614bd64dcd26137bc9b7b2637ddcfc57649"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/composer/semver/zipball/deac27056b57e46faf136fae7b449eeaa71661ee",
|
"url": "https://api.github.com/repos/composer/semver/zipball/a951f614bd64dcd26137bc9b7b2637ddcfc57649",
|
||||||
"reference": "deac27056b57e46faf136fae7b449eeaa71661ee",
|
"reference": "a951f614bd64dcd26137bc9b7b2637ddcfc57649",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^5.3.2 || ^7.0 || ^8.0"
|
"php": "^5.3.2 || ^7.0 || ^8.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpstan/phpstan": "^0.12.54",
|
"phpstan/phpstan": "^1.4",
|
||||||
"symfony/phpunit-bridge": "^4.2 || ^5"
|
"symfony/phpunit-bridge": "^4.2 || ^5"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
|
@ -3253,7 +3253,7 @@
|
||||||
"support": {
|
"support": {
|
||||||
"irc": "irc://irc.freenode.org/composer",
|
"irc": "irc://irc.freenode.org/composer",
|
||||||
"issues": "https://github.com/composer/semver/issues",
|
"issues": "https://github.com/composer/semver/issues",
|
||||||
"source": "https://github.com/composer/semver/tree/3.2.7"
|
"source": "https://github.com/composer/semver/tree/3.2.9"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -3269,7 +3269,7 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-01-04T09:57:54+00:00"
|
"time": "2022-02-04T13:58:43+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "composer/xdebug-handler",
|
"name": "composer/xdebug-handler",
|
||||||
|
@ -3699,12 +3699,12 @@
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
|
||||||
"DeepCopy\\": "src/DeepCopy/"
|
|
||||||
},
|
|
||||||
"files": [
|
"files": [
|
||||||
"src/DeepCopy/deep_copy.php"
|
"src/DeepCopy/deep_copy.php"
|
||||||
]
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"DeepCopy\\": "src/DeepCopy/"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
"license": [
|
"license": [
|
||||||
|
@ -3952,16 +3952,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phar-io/version",
|
"name": "phar-io/version",
|
||||||
"version": "3.1.0",
|
"version": "3.1.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/phar-io/version.git",
|
"url": "https://github.com/phar-io/version.git",
|
||||||
"reference": "bae7c545bef187884426f042434e561ab1ddb182"
|
"reference": "15a90844ad40f127afd244c0cad228de2a80052a"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182",
|
"url": "https://api.github.com/repos/phar-io/version/zipball/15a90844ad40f127afd244c0cad228de2a80052a",
|
||||||
"reference": "bae7c545bef187884426f042434e561ab1ddb182",
|
"reference": "15a90844ad40f127afd244c0cad228de2a80052a",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -3997,9 +3997,9 @@
|
||||||
"description": "Library for handling version information and constraints",
|
"description": "Library for handling version information and constraints",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/phar-io/version/issues",
|
"issues": "https://github.com/phar-io/version/issues",
|
||||||
"source": "https://github.com/phar-io/version/tree/3.1.0"
|
"source": "https://github.com/phar-io/version/tree/3.1.1"
|
||||||
},
|
},
|
||||||
"time": "2021-02-23T14:00:09+00:00"
|
"time": "2022-02-07T21:56:48+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpdocumentor/reflection-common",
|
"name": "phpdocumentor/reflection-common",
|
||||||
|
@ -4608,11 +4608,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"classmap": [
|
|
||||||
"src/"
|
|
||||||
],
|
|
||||||
"files": [
|
"files": [
|
||||||
"src/Framework/Assert/Functions.php"
|
"src/Framework/Assert/Functions.php"
|
||||||
|
],
|
||||||
|
"classmap": [
|
||||||
|
"src/"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
@ -5208,16 +5208,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "sebastian/global-state",
|
"name": "sebastian/global-state",
|
||||||
"version": "5.0.3",
|
"version": "5.0.4",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/sebastianbergmann/global-state.git",
|
"url": "https://github.com/sebastianbergmann/global-state.git",
|
||||||
"reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49"
|
"reference": "19c519631c5a511b7ed0ad64a6713fdb3fd25fe4"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49",
|
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/19c519631c5a511b7ed0ad64a6713fdb3fd25fe4",
|
||||||
"reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49",
|
"reference": "19c519631c5a511b7ed0ad64a6713fdb3fd25fe4",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -5260,7 +5260,7 @@
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/sebastianbergmann/global-state/issues",
|
"issues": "https://github.com/sebastianbergmann/global-state/issues",
|
||||||
"source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3"
|
"source": "https://github.com/sebastianbergmann/global-state/tree/5.0.4"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -5268,7 +5268,7 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2021-06-11T13:31:12+00:00"
|
"time": "2022-02-10T07:01:19+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "sebastian/lines-of-code",
|
"name": "sebastian/lines-of-code",
|
||||||
|
@ -5834,12 +5834,12 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
|
||||||
"Symfony\\Polyfill\\Intl\\Grapheme\\": ""
|
|
||||||
},
|
|
||||||
"files": [
|
"files": [
|
||||||
"bootstrap.php"
|
"bootstrap.php"
|
||||||
]
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Polyfill\\Intl\\Grapheme\\": ""
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
"license": [
|
"license": [
|
||||||
|
@ -5915,12 +5915,12 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
|
||||||
"Symfony\\Polyfill\\Intl\\Normalizer\\": ""
|
|
||||||
},
|
|
||||||
"files": [
|
"files": [
|
||||||
"bootstrap.php"
|
"bootstrap.php"
|
||||||
],
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Polyfill\\Intl\\Normalizer\\": ""
|
||||||
|
},
|
||||||
"classmap": [
|
"classmap": [
|
||||||
"Resources/stubs"
|
"Resources/stubs"
|
||||||
]
|
]
|
||||||
|
@ -6079,12 +6079,12 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
|
||||||
"Symfony\\Polyfill\\Php72\\": ""
|
|
||||||
},
|
|
||||||
"files": [
|
"files": [
|
||||||
"bootstrap.php"
|
"bootstrap.php"
|
||||||
]
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Polyfill\\Php72\\": ""
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
"license": [
|
"license": [
|
||||||
|
@ -6395,16 +6395,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "twig/twig",
|
"name": "twig/twig",
|
||||||
"version": "v2.14.10",
|
"version": "v2.14.11",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/twigphp/Twig.git",
|
"url": "https://github.com/twigphp/Twig.git",
|
||||||
"reference": "95fb194cd4dd6ac373a27af2bde2bad5d3f27aba"
|
"reference": "66baa66f29ee30e487e05f1679903e36eb01d727"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/twigphp/Twig/zipball/95fb194cd4dd6ac373a27af2bde2bad5d3f27aba",
|
"url": "https://api.github.com/repos/twigphp/Twig/zipball/66baa66f29ee30e487e05f1679903e36eb01d727",
|
||||||
"reference": "95fb194cd4dd6ac373a27af2bde2bad5d3f27aba",
|
"reference": "66baa66f29ee30e487e05f1679903e36eb01d727",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -6459,7 +6459,7 @@
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/twigphp/Twig/issues",
|
"issues": "https://github.com/twigphp/Twig/issues",
|
||||||
"source": "https://github.com/twigphp/Twig/tree/v2.14.10"
|
"source": "https://github.com/twigphp/Twig/tree/v2.14.11"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -6471,7 +6471,7 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-01-03T21:13:26+00:00"
|
"time": "2022-02-04T06:57:25+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vimeo/psalm",
|
"name": "vimeo/psalm",
|
||||||
|
@ -6550,13 +6550,13 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
|
||||||
"Psalm\\": "src/Psalm/"
|
|
||||||
},
|
|
||||||
"files": [
|
"files": [
|
||||||
"src/functions.php",
|
"src/functions.php",
|
||||||
"src/spl_object_id.php"
|
"src/spl_object_id.php"
|
||||||
]
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"Psalm\\": "src/Psalm/"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
"license": [
|
"license": [
|
||||||
|
|
|
@ -456,6 +456,10 @@ services:
|
||||||
- _APP_INFLUXDB_HOST
|
- _APP_INFLUXDB_HOST
|
||||||
- _APP_INFLUXDB_PORT
|
- _APP_INFLUXDB_PORT
|
||||||
- _APP_USAGE_SYNC_INTERVAL
|
- _APP_USAGE_SYNC_INTERVAL
|
||||||
|
- _APP_REDIS_HOST
|
||||||
|
- _APP_REDIS_PORT
|
||||||
|
- _APP_REDIS_USER
|
||||||
|
- _APP_REDIS_PASS
|
||||||
|
|
||||||
appwrite-schedule:
|
appwrite-schedule:
|
||||||
entrypoint: schedule
|
entrypoint: schedule
|
||||||
|
|
|
@ -65,7 +65,7 @@ class Bitly extends OAuth2
|
||||||
protected function getTokens(string $code): array
|
protected function getTokens(string $code): array
|
||||||
{
|
{
|
||||||
if(empty($this->tokens)) {
|
if(empty($this->tokens)) {
|
||||||
$this->tokens = \json_decode($this->request(
|
$response = $this->request(
|
||||||
'POST',
|
'POST',
|
||||||
$this->resourceEndpoint . 'oauth/access_token',
|
$this->resourceEndpoint . 'oauth/access_token',
|
||||||
["Content-Type: application/x-www-form-urlencoded"],
|
["Content-Type: application/x-www-form-urlencoded"],
|
||||||
|
@ -76,7 +76,11 @@ class Bitly extends OAuth2
|
||||||
"redirect_uri" => $this->callback,
|
"redirect_uri" => $this->callback,
|
||||||
"state" => \json_encode($this->state)
|
"state" => \json_encode($this->state)
|
||||||
])
|
])
|
||||||
), true);
|
);
|
||||||
|
|
||||||
|
$output = [];
|
||||||
|
\parse_str($response, $output);
|
||||||
|
$this->tokens = $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->tokens;
|
return $this->tokens;
|
||||||
|
@ -89,7 +93,7 @@ class Bitly extends OAuth2
|
||||||
*/
|
*/
|
||||||
public function refreshTokens(string $refreshToken):array
|
public function refreshTokens(string $refreshToken):array
|
||||||
{
|
{
|
||||||
$this->tokens = \json_decode($this->request(
|
$response = $this->request(
|
||||||
'POST',
|
'POST',
|
||||||
$this->resourceEndpoint . 'oauth/access_token',
|
$this->resourceEndpoint . 'oauth/access_token',
|
||||||
["Content-Type: application/x-www-form-urlencoded"],
|
["Content-Type: application/x-www-form-urlencoded"],
|
||||||
|
@ -99,7 +103,11 @@ class Bitly extends OAuth2
|
||||||
"refresh_token" => $refreshToken,
|
"refresh_token" => $refreshToken,
|
||||||
'grant_type' => 'refresh_token'
|
'grant_type' => 'refresh_token'
|
||||||
])
|
])
|
||||||
), true);
|
);
|
||||||
|
|
||||||
|
$output = [];
|
||||||
|
\parse_str($response, $output);
|
||||||
|
$this->tokens = $output;
|
||||||
|
|
||||||
if(empty($this->tokens['refresh_token'])) {
|
if(empty($this->tokens['refresh_token'])) {
|
||||||
$this->tokens['refresh_token'] = $refreshToken;
|
$this->tokens['refresh_token'] = $refreshToken;
|
||||||
|
|
|
@ -53,7 +53,7 @@ class Github extends OAuth2
|
||||||
protected function getTokens(string $code): array
|
protected function getTokens(string $code): array
|
||||||
{
|
{
|
||||||
if(empty($this->tokens)) {
|
if(empty($this->tokens)) {
|
||||||
$this->tokens = \json_decode($this->request(
|
$response = $this->request(
|
||||||
'POST',
|
'POST',
|
||||||
'https://github.com/login/oauth/access_token',
|
'https://github.com/login/oauth/access_token',
|
||||||
[],
|
[],
|
||||||
|
@ -63,7 +63,11 @@ class Github extends OAuth2
|
||||||
'client_secret' => $this->appSecret,
|
'client_secret' => $this->appSecret,
|
||||||
'code' => $code
|
'code' => $code
|
||||||
])
|
])
|
||||||
), true);
|
);
|
||||||
|
|
||||||
|
$output = [];
|
||||||
|
\parse_str($response, $output);
|
||||||
|
$this->tokens = $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->tokens;
|
return $this->tokens;
|
||||||
|
@ -76,7 +80,7 @@ class Github extends OAuth2
|
||||||
*/
|
*/
|
||||||
public function refreshTokens(string $refreshToken):array
|
public function refreshTokens(string $refreshToken):array
|
||||||
{
|
{
|
||||||
$this->tokens = \json_decode($this->request(
|
$response = $this->request(
|
||||||
'POST',
|
'POST',
|
||||||
'https://github.com/login/oauth/access_token',
|
'https://github.com/login/oauth/access_token',
|
||||||
[],
|
[],
|
||||||
|
@ -86,7 +90,11 @@ class Github extends OAuth2
|
||||||
'grant_type' => 'refresh_token',
|
'grant_type' => 'refresh_token',
|
||||||
'refresh_token' => $refreshToken
|
'refresh_token' => $refreshToken
|
||||||
])
|
])
|
||||||
), true);
|
);
|
||||||
|
|
||||||
|
$output = [];
|
||||||
|
\parse_str($response, $output);
|
||||||
|
$this->tokens = $output;
|
||||||
|
|
||||||
if(empty($this->tokens['refresh_token'])) {
|
if(empty($this->tokens['refresh_token'])) {
|
||||||
$this->tokens['refresh_token'] = $refreshToken;
|
$this->tokens['refresh_token'] = $refreshToken;
|
||||||
|
|
|
@ -61,18 +61,6 @@ class Bucket extends Model
|
||||||
'default' => true,
|
'default' => true,
|
||||||
'example' => false,
|
'example' => false,
|
||||||
])
|
])
|
||||||
->addRule('adapter', [
|
|
||||||
'type' => self::TYPE_STRING,
|
|
||||||
'description' => 'Storage adapter.',
|
|
||||||
'default' => '',
|
|
||||||
'example' => 'local',
|
|
||||||
])
|
|
||||||
->addRule('adapterCredentials', [
|
|
||||||
'type' => self::TYPE_JSON,
|
|
||||||
'description' => 'Storage adapter credentials.',
|
|
||||||
'default' => new \stdClass,
|
|
||||||
'example' => ['key' => 'value'],
|
|
||||||
])
|
|
||||||
->addRule('maximumFileSize', [
|
->addRule('maximumFileSize', [
|
||||||
'type' => self::TYPE_INTEGER,
|
'type' => self::TYPE_INTEGER,
|
||||||
'description' => 'Maximum file size supported.',
|
'description' => 'Maximum file size supported.',
|
||||||
|
|
|
@ -119,16 +119,24 @@ class Client
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $endpoint
|
* @param string $endpoint
|
||||||
* @return self $this
|
* @return self $this
|
||||||
*/
|
*/
|
||||||
public function setEndpoint($endpoint): self
|
public function setEndpoint(string $endpoint): self
|
||||||
{
|
{
|
||||||
$this->endpoint = $endpoint;
|
$this->endpoint = $endpoint;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getEndpoint(): string
|
||||||
|
{
|
||||||
|
return $this->endpoint;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $key
|
* @param string $key
|
||||||
* @param string $value
|
* @param string $value
|
||||||
|
@ -183,6 +191,7 @@ class Client
|
||||||
unset($headers[$i]);
|
unset($headers[$i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
curl_setopt($ch, CURLOPT_PATH_AS_IS, 1);
|
||||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
|
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||||
|
|
|
@ -94,6 +94,35 @@ class HTTPTest extends Scope
|
||||||
$this->assertStringContainsString('# robotstxt.org/', $response['body']);
|
$this->assertStringContainsString('# robotstxt.org/', $response['body']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testAcmeChallenge()
|
||||||
|
{
|
||||||
|
// Preparation
|
||||||
|
$previousEndpoint = $this->client->getEndpoint();
|
||||||
|
$this->client->setEndpoint("http://localhost");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test for SUCCESS
|
||||||
|
*/
|
||||||
|
$response = $this->client->call(Client::METHOD_GET, '/.well-known/acme-challenge/8DdIKX257k6Dih5s_saeVMpTnjPJdKO5Ase0OCiJrIg', \array_merge([
|
||||||
|
'origin' => 'http://localhost',
|
||||||
|
]), []);
|
||||||
|
|
||||||
|
$this->assertEquals(404, $response['headers']['status-code']);
|
||||||
|
// 'Unknown path', but validation passed
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test for FAILURE
|
||||||
|
*/
|
||||||
|
$response = $this->client->call(Client::METHOD_GET, '/.well-known/acme-challenge/../../../../../../../etc/passwd', \array_merge([
|
||||||
|
'origin' => 'http://localhost',
|
||||||
|
]), []);
|
||||||
|
|
||||||
|
$this->assertEquals(400, $response['headers']['status-code']);
|
||||||
|
|
||||||
|
// Cleanup
|
||||||
|
$this->client->setEndpoint($previousEndpoint);
|
||||||
|
}
|
||||||
|
|
||||||
// public function testSpecSwagger2()
|
// public function testSpecSwagger2()
|
||||||
// {
|
// {
|
||||||
// $response = $this->client->call(Client::METHOD_GET, '/specs/swagger2?platform=client', [
|
// $response = $this->client->call(Client::METHOD_GET, '/specs/swagger2?platform=client', [
|
||||||
|
|
|
@ -12,11 +12,11 @@ trait StorageBase
|
||||||
/**
|
/**
|
||||||
* Test for SUCCESS
|
* Test for SUCCESS
|
||||||
*/
|
*/
|
||||||
$bucket = $this->client->call(Client::METHOD_POST, '/storage/buckets', array_merge([
|
$bucket = $this->client->call(Client::METHOD_POST, '/storage/buckets', [
|
||||||
'content-type' => 'application/json',
|
'content-type' => 'application/json',
|
||||||
'x-appwrite-project' => $this->getProject()['$id'],
|
'x-appwrite-project' => $this->getProject()['$id'],
|
||||||
'x-appwrite-key' => $this->getProject()['apiKey'],
|
'x-appwrite-key' => $this->getProject()['apiKey'],
|
||||||
], $this->getHeaders()), [
|
], [
|
||||||
'bucketId' => 'unique()',
|
'bucketId' => 'unique()',
|
||||||
'name' => 'Test Bucket',
|
'name' => 'Test Bucket',
|
||||||
'permission' => 'file',
|
'permission' => 'file',
|
||||||
|
@ -52,11 +52,11 @@ trait StorageBase
|
||||||
* This should also validate the test for when Bucket encryption
|
* This should also validate the test for when Bucket encryption
|
||||||
* is disabled as we are using same test
|
* is disabled as we are using same test
|
||||||
*/
|
*/
|
||||||
$bucket2 = $this->client->call(Client::METHOD_POST, '/storage/buckets', array_merge([
|
$bucket2 = $this->client->call(Client::METHOD_POST, '/storage/buckets', [
|
||||||
'content-type' => 'application/json',
|
'content-type' => 'application/json',
|
||||||
'x-appwrite-project' => $this->getProject()['$id'],
|
'x-appwrite-project' => $this->getProject()['$id'],
|
||||||
'x-appwrite-key' => $this->getProject()['apiKey'],
|
'x-appwrite-key' => $this->getProject()['apiKey'],
|
||||||
], $this->getHeaders()), [
|
], [
|
||||||
'bucketId' => 'unique()',
|
'bucketId' => 'unique()',
|
||||||
'name' => 'Test Bucket 2',
|
'name' => 'Test Bucket 2',
|
||||||
'permission' => 'file',
|
'permission' => 'file',
|
||||||
|
|
|
@ -22,11 +22,11 @@ class StorageCustomClientTest extends Scope
|
||||||
/**
|
/**
|
||||||
* Test for SUCCESS
|
* Test for SUCCESS
|
||||||
*/
|
*/
|
||||||
$bucket = $this->client->call(Client::METHOD_POST, '/storage/buckets', array_merge([
|
$bucket = $this->client->call(Client::METHOD_POST, '/storage/buckets', [
|
||||||
'content-type' => 'application/json',
|
'content-type' => 'application/json',
|
||||||
'x-appwrite-project' => $this->getProject()['$id'],
|
'x-appwrite-project' => $this->getProject()['$id'],
|
||||||
'x-appwrite-key' => $this->getProject()['apiKey'],
|
'x-appwrite-key' => $this->getProject()['apiKey'],
|
||||||
], $this->getHeaders()), [
|
], [
|
||||||
'bucketId' => 'unique()',
|
'bucketId' => 'unique()',
|
||||||
'name' => 'Test Bucket',
|
'name' => 'Test Bucket',
|
||||||
'permission' => 'file',
|
'permission' => 'file',
|
||||||
|
|
Loading…
Reference in a new issue