From 1e28e4a2c7b5f350628790c0f2d704e62da3410c Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 26 Feb 2019 23:28:04 -0700 Subject: [PATCH 1/9] Update presenter components, fix missing filter on albums bug --- .../js/components/presenter/MixedAlbumPresenter.vue | 8 ++++++-- .../js/components/presenter/PhotoAlbumPresenter.vue | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/resources/assets/js/components/presenter/MixedAlbumPresenter.vue b/resources/assets/js/components/presenter/MixedAlbumPresenter.vue index 4ed828fca..f2d284b02 100644 --- a/resources/assets/js/components/presenter/MixedAlbumPresenter.vue +++ b/resources/assets/js/components/presenter/MixedAlbumPresenter.vue @@ -18,7 +18,9 @@ - +
+ +

Error: Problem rendering preview.

@@ -40,7 +42,9 @@ - +
+ +

Error: Problem rendering preview.

diff --git a/resources/assets/js/components/presenter/PhotoAlbumPresenter.vue b/resources/assets/js/components/presenter/PhotoAlbumPresenter.vue index 8e398717e..fd57dce42 100644 --- a/resources/assets/js/components/presenter/PhotoAlbumPresenter.vue +++ b/resources/assets/js/components/presenter/PhotoAlbumPresenter.vue @@ -13,7 +13,9 @@ :interval="0" > - +
+ +
@@ -27,7 +29,9 @@ :interval="0" > - +
+ +
From f7b5c209e0870e7c02020ef5802f918a36bb3376 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 27 Feb 2019 00:03:46 -0700 Subject: [PATCH 2/9] Add wip ComposeModal --- .../assets/js/components/ComposeModal.vue | 437 ++++++++++++++++++ 1 file changed, 437 insertions(+) create mode 100644 resources/assets/js/components/ComposeModal.vue diff --git a/resources/assets/js/components/ComposeModal.vue b/resources/assets/js/components/ComposeModal.vue new file mode 100644 index 000000000..edbaccf27 --- /dev/null +++ b/resources/assets/js/components/ComposeModal.vue @@ -0,0 +1,437 @@ + + + + \ No newline at end of file From ef5369fe75e4801239df39405cfd6c11efc5b2ac Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 27 Feb 2019 00:04:53 -0700 Subject: [PATCH 3/9] Add wip SearchResults component --- .../assets/js/components/SearchResults.vue | 121 +++++++++++++++++- 1 file changed, 120 insertions(+), 1 deletion(-) diff --git a/resources/assets/js/components/SearchResults.vue b/resources/assets/js/components/SearchResults.vue index e0507ddb2..b138dc0dd 100644 --- a/resources/assets/js/components/SearchResults.vue +++ b/resources/assets/js/components/SearchResults.vue @@ -1,6 +1,77 @@ @@ -10,6 +81,54 @@ \ No newline at end of file From fce6d60a7d6aefa1c3a955e3a2469d7a227a34c4 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 27 Feb 2019 12:25:28 -0700 Subject: [PATCH 4/9] Update laravel to 5.8 --- composer.json | 6 +- composer.lock | 540 +++++++++++++------------------------------------- 2 files changed, 137 insertions(+), 409 deletions(-) diff --git a/composer.json b/composer.json index ed0034209..defbeac70 100644 --- a/composer.json +++ b/composer.json @@ -18,14 +18,14 @@ "fideloper/proxy": "^4.0", "greggilbert/recaptcha": "dev-master", "intervention/image": "^2.4", - "laravel/framework": "5.7.*", + "laravel/framework": "5.8.*", "laravel/horizon": "^1.2", "laravel/passport": "^7.0", "laravel/tinker": "^1.0", "league/flysystem-aws-s3-v3": "~1.0", "league/flysystem-cached-adapter": "~1.0", "moontoast/math": "^1.1", - "pbmedia/laravel-ffmpeg": "3.0.0", + "pbmedia/laravel-ffmpeg": "4.0.0", "phpseclib/phpseclib": "~2.0", "pixelfed/bacon-qr-code": "^3.0", "pixelfed/dotenv-editor": "^2.0", @@ -33,7 +33,7 @@ "pixelfed/google2fa": "^4.0", "pixelfed/zttp": "^0.4", "predis/predis": "^1.1", - "spatie/laravel-backup": "^5.0.0", + "spatie/laravel-backup": "^6.0.0", "spatie/laravel-image-optimizer": "^1.1", "stevebauman/purify": "2.0.*" }, diff --git a/composer.lock b/composer.lock index 8f86d28ce..ed7de6af7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,11 +4,11 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d94668170067c2954b732f591151e9e7", + "content-hash": "8f9feb6f0dd669b7a0974809de05d8bd", "packages": [ { "name": "alchemy/binary-driver", - "version": "5.0.0", + "version": "v2.0.0", "source": { "type": "git", "url": "https://github.com/alchemy-fr/BinaryDriver.git", @@ -153,16 +153,16 @@ }, { "name": "beyondcode/laravel-self-diagnosis", - "version": "1.1.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/beyondcode/laravel-self-diagnosis.git", - "reference": "83239c24716971a35b8a2418c4a4424a4c7bd12d" + "reference": "57d8707e9d7110d23da7a05ae48a7c51c8778476" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/beyondcode/laravel-self-diagnosis/zipball/83239c24716971a35b8a2418c4a4424a4c7bd12d", - "reference": "83239c24716971a35b8a2418c4a4424a4c7bd12d", + "url": "https://api.github.com/repos/beyondcode/laravel-self-diagnosis/zipball/57d8707e9d7110d23da7a05ae48a7c51c8778476", + "reference": "57d8707e9d7110d23da7a05ae48a7c51c8778476", "shasum": "" }, "require": { @@ -170,12 +170,12 @@ "geerlingguy/ping": "^1.1", "illuminate/support": "5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*", "php": "^7.1", - "vlucas/phpdotenv": "~2.5" + "vlucas/phpdotenv": "~2.5|~3.3" }, "require-dev": { "larapack/dd": "^1.0", "mockery/mockery": "^1.0", - "orchestra/testbench": "~3.5", + "orchestra/testbench": "~3.5|~3.8", "phpunit/phpunit": "^7.0", "predis/predis": "^1.1", "scrutinizer/ocular": "^1.5" @@ -211,7 +211,7 @@ "beyondcode", "laravel-self-diagnosis" ], - "time": "2019-02-26T17:05:44+00:00" + "time": "2019-02-27T10:04:53+00:00" }, { "name": "bitverse/identicon", @@ -1594,45 +1594,45 @@ }, { "name": "laravel/framework", - "version": "v5.7.28", + "version": "v5.8.2", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "8e69728f1c80a024588adbd24c65c4fcf9aa9192" + "reference": "c3b7cbe700efb0f4c9a5359feaedb0a1f0a741ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/8e69728f1c80a024588adbd24c65c4fcf9aa9192", - "reference": "8e69728f1c80a024588adbd24c65c4fcf9aa9192", + "url": "https://api.github.com/repos/laravel/framework/zipball/c3b7cbe700efb0f4c9a5359feaedb0a1f0a741ca", + "reference": "c3b7cbe700efb0f4c9a5359feaedb0a1f0a741ca", "shasum": "" }, "require": { "doctrine/inflector": "^1.1", "dragonmantank/cron-expression": "^2.0", + "egulias/email-validator": "^2.0", "erusev/parsedown": "^1.7", + "ext-json": "*", "ext-mbstring": "*", "ext-openssl": "*", - "laravel/nexmo-notification-channel": "^1.0", - "laravel/slack-notification-channel": "^1.0", "league/flysystem": "^1.0.8", "monolog/monolog": "^1.12", - "nesbot/carbon": "^1.26.3", + "nesbot/carbon": "^1.26.3 || ^2.0", "opis/closure": "^3.1", "php": "^7.1.3", "psr/container": "^1.0", "psr/simple-cache": "^1.0", "ramsey/uuid": "^3.7", "swiftmailer/swiftmailer": "^6.0", - "symfony/console": "^4.1", - "symfony/debug": "^4.1", - "symfony/finder": "^4.1", - "symfony/http-foundation": "^4.1", - "symfony/http-kernel": "^4.1", - "symfony/process": "^4.1", - "symfony/routing": "^4.1", - "symfony/var-dumper": "^4.1", + "symfony/console": "^4.2", + "symfony/debug": "^4.2", + "symfony/finder": "^4.2", + "symfony/http-foundation": "^4.2", + "symfony/http-kernel": "^4.2", + "symfony/process": "^4.2", + "symfony/routing": "^4.2", + "symfony/var-dumper": "^4.2", "tijsverkoyen/css-to-inline-styles": "^2.2.1", - "vlucas/phpdotenv": "^2.2" + "vlucas/phpdotenv": "^3.3" }, "conflict": { "tightenco/collect": "<5.5.33" @@ -1675,12 +1675,12 @@ "league/flysystem-cached-adapter": "^1.0", "mockery/mockery": "^1.0", "moontoast/math": "^1.1", - "orchestra/testbench-core": "3.7.*", - "pda/pheanstalk": "^3.0|^4.0", - "phpunit/phpunit": "^7.5", + "orchestra/testbench-core": "3.8.*", + "pda/pheanstalk": "^4.0", + "phpunit/phpunit": "^7.5|^8.0", "predis/predis": "^1.1.1", - "symfony/css-selector": "^4.1", - "symfony/dom-crawler": "^4.1", + "symfony/css-selector": "^4.2", + "symfony/dom-crawler": "^4.2", "true/punycode": "^2.1" }, "suggest": { @@ -1698,17 +1698,18 @@ "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0).", "moontoast/math": "Required to use ordered UUIDs (^1.1).", "nexmo/client": "Required to use the Nexmo transport (^1.0).", - "pda/pheanstalk": "Required to use the beanstalk queue driver (^3.0|^4.0).", + "pda/pheanstalk": "Required to use the beanstalk queue driver (^4.0).", "predis/predis": "Required to use the redis cache and queue drivers (^1.0).", "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^3.0).", - "symfony/css-selector": "Required to use some of the crawler integration testing tools (^4.1).", - "symfony/dom-crawler": "Required to use most of the crawler integration testing tools (^4.1).", - "symfony/psr-http-message-bridge": "Required to psr7 bridging features (^1.0)." + "symfony/css-selector": "Required to use some of the crawler integration testing tools (^4.2).", + "symfony/dom-crawler": "Required to use most of the crawler integration testing tools (^4.2).", + "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^1.1).", + "wildbit/swiftmailer-postmark": "Required to use Postmark mail driver (^3.0)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.7-dev" + "dev-master": "5.8-dev" } }, "autoload": { @@ -1736,7 +1737,7 @@ "framework", "laravel" ], - "time": "2019-02-26T15:41:34+00:00" + "time": "2019-02-27T14:02:36+00:00" }, { "name": "laravel/horizon", @@ -1806,63 +1807,6 @@ ], "time": "2018-11-01T14:03:51+00:00" }, - { - "name": "laravel/nexmo-notification-channel", - "version": "v1.0.1", - "source": { - "type": "git", - "url": "https://github.com/laravel/nexmo-notification-channel.git", - "reference": "03edd42a55b306ff980c9950899d5a2b03260d48" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laravel/nexmo-notification-channel/zipball/03edd42a55b306ff980c9950899d5a2b03260d48", - "reference": "03edd42a55b306ff980c9950899d5a2b03260d48", - "shasum": "" - }, - "require": { - "nexmo/client": "^1.0", - "php": "^7.1.3" - }, - "require-dev": { - "illuminate/notifications": "~5.7", - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - }, - "laravel": { - "providers": [ - "Illuminate\\Notifications\\NexmoChannelServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Notifications\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "Nexmo Notification Channel for laravel.", - "keywords": [ - "laravel", - "nexmo", - "notifications" - ], - "time": "2018-12-04T12:57:08+00:00" - }, { "name": "laravel/passport", "version": "v7.2.0", @@ -1933,63 +1877,6 @@ ], "time": "2019-02-14T16:29:26+00:00" }, - { - "name": "laravel/slack-notification-channel", - "version": "v1.0.3", - "source": { - "type": "git", - "url": "https://github.com/laravel/slack-notification-channel.git", - "reference": "6e164293b754a95f246faf50ab2bbea3e4923cc9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laravel/slack-notification-channel/zipball/6e164293b754a95f246faf50ab2bbea3e4923cc9", - "reference": "6e164293b754a95f246faf50ab2bbea3e4923cc9", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "^6.0", - "php": "^7.1.3" - }, - "require-dev": { - "illuminate/notifications": "~5.7", - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - }, - "laravel": { - "providers": [ - "Illuminate\\Notifications\\SlackChannelServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Notifications\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "Slack Notification Channel for laravel.", - "keywords": [ - "laravel", - "notifications", - "slack" - ], - "time": "2018-12-12T13:12:06+00:00" - }, { "name": "laravel/tinker", "version": "v1.0.8", @@ -2600,28 +2487,30 @@ }, { "name": "nesbot/carbon", - "version": "1.36.2", + "version": "2.14.1", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "cd324b98bc30290f233dd0e75e6ce49f7ab2a6c9" + "reference": "e68f869575bd703276be8d4264799cd3cce28107" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/cd324b98bc30290f233dd0e75e6ce49f7ab2a6c9", - "reference": "cd324b98bc30290f233dd0e75e6ce49f7ab2a6c9", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/e68f869575bd703276be8d4264799cd3cce28107", + "reference": "e68f869575bd703276be8d4264799cd3cce28107", "shasum": "" }, "require": { - "php": ">=5.3.9", - "symfony/translation": "~2.6 || ~3.0 || ~4.0" + "ext-json": "*", + "php": "^7.1.8 || ^8.0", + "symfony/translation": "^3.4 || ^4.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7" - }, - "suggest": { - "friendsofphp/php-cs-fixer": "Needed for the `composer phpcs` command. Allow to automatically fix code style.", - "phpstan/phpstan": "Needed for the `composer phpstan` command. Allow to detect potential errors." + "friendsofphp/php-cs-fixer": "^2.14 || ^3.0", + "kylekatarnls/multi-tester": "^0.1", + "phpmd/phpmd": "^2.6", + "phpstan/phpstan": "^0.10.8", + "phpunit/phpunit": "^7.5 || ^8.0", + "squizlabs/php_codesniffer": "^3.4" }, "type": "library", "extra": { @@ -2633,7 +2522,7 @@ }, "autoload": { "psr-4": { - "": "src/" + "Carbon\\": "src/Carbon/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2654,7 +2543,7 @@ "datetime", "time" ], - "time": "2018-12-28T10:07:33+00:00" + "time": "2019-02-27T13:59:59+00:00" }, { "name": "neutron/temporary-filesystem", @@ -2696,54 +2585,6 @@ "description": "Symfony filesystem extension to handle temporary files", "time": "2018-02-07T21:11:57+00:00" }, - { - "name": "nexmo/client", - "version": "1.6.2", - "source": { - "type": "git", - "url": "https://github.com/Nexmo/nexmo-php.git", - "reference": "2f79f67f24225ea627ee14578e98c96276cdd4c5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Nexmo/nexmo-php/zipball/2f79f67f24225ea627ee14578e98c96276cdd4c5", - "reference": "2f79f67f24225ea627ee14578e98c96276cdd4c5", - "shasum": "" - }, - "require": { - "lcobucci/jwt": "^3.2", - "php": ">=5.6", - "php-http/client-implementation": "^1.0", - "php-http/guzzle6-adapter": "^1.0", - "zendframework/zend-diactoros": "^1.3" - }, - "require-dev": { - "estahn/phpunit-json-assertions": "^1.0.0", - "php-http/mock-client": "^0.3.0", - "phpunit/phpunit": "^5.7", - "squizlabs/php_codesniffer": "^3.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "Nexmo\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Tim Lytle", - "email": "tim@nexmo.com", - "homepage": "http://twitter.com/tjlytle", - "role": "Developer" - } - ], - "description": "PHP Client for using Nexmo's API.", - "time": "2019-02-07T11:14:34+00:00" - }, { "name": "nikic/php-parser", "version": "v4.2.1", @@ -2969,30 +2810,31 @@ }, { "name": "pbmedia/laravel-ffmpeg", - "version": "3.0.0", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/pascalbaljetmedia/laravel-ffmpeg.git", - "reference": "8310f4be71611230abc92388368173205fe6415c" + "reference": "6b7ac695b56c3847a736de614d4533245541cb6c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pascalbaljetmedia/laravel-ffmpeg/zipball/8310f4be71611230abc92388368173205fe6415c", - "reference": "8310f4be71611230abc92388368173205fe6415c", + "url": "https://api.github.com/repos/pascalbaljetmedia/laravel-ffmpeg/zipball/6b7ac695b56c3847a736de614d4533245541cb6c", + "reference": "6b7ac695b56c3847a736de614d4533245541cb6c", "shasum": "" }, "require": { - "illuminate/config": "5.7.*", - "illuminate/filesystem": "5.7.*", - "illuminate/log": "5.7.*", + "illuminate/config": "5.8.*", + "illuminate/filesystem": "5.8.*", + "illuminate/log": "5.8.*", + "illuminate/support": "5.8.*", "league/flysystem": "~1.0", - "php": "^7.1", - "php-ffmpeg/php-ffmpeg": "dev-master#c11b79ab5b0174aa1a56c54c67491169e78a4c17", + "php": "^7.1.3", + "php-ffmpeg/php-ffmpeg": "^0.13", "symfony/process": "~4.0" }, "require-dev": { "mockery/mockery": "^1.0", - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "7.5" }, "type": "library", "extra": { @@ -3028,26 +2870,26 @@ "laravel-ffmpeg", "pbmedia" ], - "time": "2018-09-06T11:52:45+00:00" + "time": "2019-02-27T17:33:08+00:00" }, { "name": "php-ffmpeg/php-ffmpeg", - "version": "dev-master", + "version": "v0.13", "source": { "type": "git", "url": "https://github.com/PHP-FFMpeg/PHP-FFMpeg.git", - "reference": "f9cc3d0c429fade5a144db674272eb8b48db8dce" + "reference": "c11b79ab5b0174aa1a56c54c67491169e78a4c17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-FFMpeg/PHP-FFMpeg/zipball/f9cc3d0c429fade5a144db674272eb8b48db8dce", - "reference": "f9cc3d0c429fade5a144db674272eb8b48db8dce", + "url": "https://api.github.com/repos/PHP-FFMpeg/PHP-FFMpeg/zipball/c11b79ab5b0174aa1a56c54c67491169e78a4c17", + "reference": "c11b79ab5b0174aa1a56c54c67491169e78a4c17", "shasum": "" }, "require": { - "alchemy/binary-driver": "^1.5 || ~2.0.0 || ^5.0", + "alchemy/binary-driver": "^1.5 || ~2.0.0", "doctrine/cache": "^1.0", - "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "evenement/evenement": "^2.0 || ^1.0", "neutron/temporary-filesystem": "^2.1.1", "php": "^5.3.9 || ^7.0" }, @@ -3112,173 +2954,57 @@ "video", "video processing" ], - "time": "2019-02-26T17:04:09+00:00" + "time": "2018-08-06T20:02:43+00:00" }, { - "name": "php-http/guzzle6-adapter", - "version": "v1.1.1", + "name": "phpoption/phpoption", + "version": "1.5.0", "source": { "type": "git", - "url": "https://github.com/php-http/guzzle6-adapter.git", - "reference": "a56941f9dc6110409cfcddc91546ee97039277ab" + "url": "https://github.com/schmittjoh/php-option.git", + "reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/guzzle6-adapter/zipball/a56941f9dc6110409cfcddc91546ee97039277ab", - "reference": "a56941f9dc6110409cfcddc91546ee97039277ab", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/94e644f7d2051a5f0fcf77d81605f152eecff0ed", + "reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed", "shasum": "" }, "require": { - "guzzlehttp/guzzle": "^6.0", - "php": ">=5.5.0", - "php-http/httplug": "^1.0" - }, - "provide": { - "php-http/async-client-implementation": "1.0", - "php-http/client-implementation": "1.0" + "php": ">=5.3.0" }, "require-dev": { - "ext-curl": "*", - "php-http/adapter-integration-tests": "^0.4" + "phpunit/phpunit": "4.7.*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "autoload": { - "psr-4": { - "Http\\Adapter\\Guzzle6\\": "src/" + "psr-0": { + "PhpOption\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "Apache2" ], "authors": [ { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - }, - { - "name": "David de Boer", - "email": "david@ddeboer.nl" + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com" } ], - "description": "Guzzle 6 HTTP Adapter", - "homepage": "http://httplug.io", + "description": "Option Type for PHP", "keywords": [ - "Guzzle", - "http" + "language", + "option", + "php", + "type" ], - "time": "2016-05-10T06:13:32+00:00" - }, - { - "name": "php-http/httplug", - "version": "v1.1.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/httplug.git", - "reference": "1c6381726c18579c4ca2ef1ec1498fdae8bdf018" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/httplug/zipball/1c6381726c18579c4ca2ef1ec1498fdae8bdf018", - "reference": "1c6381726c18579c4ca2ef1ec1498fdae8bdf018", - "shasum": "" - }, - "require": { - "php": ">=5.4", - "php-http/promise": "^1.0", - "psr/http-message": "^1.0" - }, - "require-dev": { - "henrikbjorn/phpspec-code-coverage": "^1.0", - "phpspec/phpspec": "^2.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Client\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Eric GELOEN", - "email": "geloen.eric@gmail.com" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "HTTPlug, the HTTP client abstraction for PHP", - "homepage": "http://httplug.io", - "keywords": [ - "client", - "http" - ], - "time": "2016-08-31T08:30:17+00:00" - }, - { - "name": "php-http/promise", - "version": "v1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/promise.git", - "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/promise/zipball/dc494cdc9d7160b9a09bd5573272195242ce7980", - "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980", - "shasum": "" - }, - "require-dev": { - "henrikbjorn/phpspec-code-coverage": "^1.0", - "phpspec/phpspec": "^2.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Promise\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - }, - { - "name": "Joel Wurtz", - "email": "joel.wurtz@gmail.com" - } - ], - "description": "Promise used for asynchronous HTTP requests", - "homepage": "http://httplug.io", - "keywords": [ - "promise" - ], - "time": "2016-01-26T13:27:02+00:00" + "time": "2015-07-25T16:39:46+00:00" }, { "name": "phpseclib/phpseclib", @@ -4223,38 +3949,39 @@ }, { "name": "spatie/laravel-backup", - "version": "5.12.0", + "version": "6.1.1", "source": { "type": "git", "url": "https://github.com/spatie/laravel-backup.git", - "reference": "9f6466ad6b51dedba0ceccc65aff8a613d5f4521" + "reference": "aea866d7a66b503365a3bdf07fbeea3babb87707" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-backup/zipball/9f6466ad6b51dedba0ceccc65aff8a613d5f4521", - "reference": "9f6466ad6b51dedba0ceccc65aff8a613d5f4521", + "url": "https://api.github.com/repos/spatie/laravel-backup/zipball/aea866d7a66b503365a3bdf07fbeea3babb87707", + "reference": "aea866d7a66b503365a3bdf07fbeea3babb87707", "shasum": "" }, "require": { - "illuminate/console": "~5.5.0|~5.6.0|~5.7.0", - "illuminate/contracts": "~5.5.0|~5.6.0|~5.7.0", - "illuminate/events": "~5.5.0|~5.6.0|~5.7.0", - "illuminate/filesystem": "~5.5.0|~5.6.0|~5.7.0", - "illuminate/notifications": "~5.5.0|~5.6.0|~5.7.0", - "illuminate/support": "~5.5.0|~5.6.0|~5.7.0", - "league/flysystem": "^1.0.27", - "php": "^7.1", - "spatie/db-dumper": "^2.11.1", + "illuminate/console": "~5.8.0", + "illuminate/contracts": "~5.8.0", + "illuminate/events": "~5.8.0", + "illuminate/filesystem": "~5.8.0", + "illuminate/notifications": "~5.8.0", + "illuminate/support": "~5.8.0", + "league/flysystem": "^1.0.49", + "php": "^7.2", + "spatie/db-dumper": "^2.12", "spatie/temporary-directory": "^1.1", - "symfony/finder": "^3.3|^4.0" + "symfony/finder": "^4.2" }, "require-dev": { + "laravel/slack-notification-channel": "^1.0", "mockery/mockery": "^1.0", - "orchestra/testbench": "~3.5.0|~3.6.0|~3.7.0", - "phpunit/phpunit": "^7.3" + "orchestra/testbench": "~3.8.0", + "phpunit/phpunit": "^8.0" }, "suggest": { - "guzzlehttp/guzzle": "Allows notifications to be sent via Slack" + "laravel/slack-notification-channel": "Required for sending notifications via Slack" }, "type": "library", "extra": { @@ -4284,7 +4011,7 @@ "role": "Developer" } ], - "description": "A Laravel 5 package to backup your application", + "description": "A Laravel package to backup your application", "homepage": "https://github.com/spatie/laravel-backup", "keywords": [ "backup", @@ -4292,30 +4019,30 @@ "laravel-backup", "spatie" ], - "time": "2018-12-28T07:57:48+00:00" + "time": "2019-02-27T15:34:30+00:00" }, { "name": "spatie/laravel-image-optimizer", - "version": "1.3.2", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/spatie/laravel-image-optimizer.git", - "reference": "d4c8f831d60f3a68dc5323910a6670d9819a4e3e" + "reference": "ab2f78c9ce6ddff6aad9b8e377f7e84a5906d12d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-image-optimizer/zipball/d4c8f831d60f3a68dc5323910a6670d9819a4e3e", - "reference": "d4c8f831d60f3a68dc5323910a6670d9819a4e3e", + "url": "https://api.github.com/repos/spatie/laravel-image-optimizer/zipball/ab2f78c9ce6ddff6aad9b8e377f7e84a5906d12d", + "reference": "ab2f78c9ce6ddff6aad9b8e377f7e84a5906d12d", "shasum": "" }, "require": { - "laravel/framework": "~5.5.0|~5.6.0|~5.7.0", - "php": "^7.0", + "laravel/framework": "~5.7.0|~5.8.0", + "php": "^7.2", "spatie/image-optimizer": "^1.1.0" }, "require-dev": { - "orchestra/testbench": "~3.5.0|~3.6.0|~3.7.0", - "phpunit/phpunit": "^6.3|^7.0" + "orchestra/testbench": "~3.7.0|~3.8.0", + "phpunit/phpunit": "^8.0" }, "type": "library", "extra": { @@ -4351,7 +4078,7 @@ "laravel-image-optimizer", "spatie" ], - "time": "2018-08-27T14:44:11+00:00" + "time": "2019-02-27T10:14:49+00:00" }, { "name": "spatie/temporary-directory", @@ -5691,16 +5418,16 @@ }, { "name": "tightenco/collect", - "version": "v5.7.27", + "version": "v5.8.2", "source": { "type": "git", "url": "https://github.com/tightenco/collect.git", - "reference": "c1a36a2a8a0aa731c1acdcd83f57724ffe630d00" + "reference": "9e431d3ba84ff02183bbb6da07410d59ef769f9b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tightenco/collect/zipball/c1a36a2a8a0aa731c1acdcd83f57724ffe630d00", - "reference": "c1a36a2a8a0aa731c1acdcd83f57724ffe630d00", + "url": "https://api.github.com/repos/tightenco/collect/zipball/9e431d3ba84ff02183bbb6da07410d59ef769f9b", + "reference": "9e431d3ba84ff02183bbb6da07410d59ef769f9b", "shasum": "" }, "require": { @@ -5737,7 +5464,7 @@ "collection", "laravel" ], - "time": "2019-02-13T19:40:13+00:00" + "time": "2019-02-26T18:45:33+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -5788,29 +5515,30 @@ }, { "name": "vlucas/phpdotenv", - "version": "v2.6.1", + "version": "v3.3.2", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "2a7dcf7e3e02dc5e701004e51a6f304b713107d5" + "reference": "1ee9369cfbf26cfcf1f2515d98f15fab54e9647a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/2a7dcf7e3e02dc5e701004e51a6f304b713107d5", - "reference": "2a7dcf7e3e02dc5e701004e51a6f304b713107d5", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/1ee9369cfbf26cfcf1f2515d98f15fab54e9647a", + "reference": "1ee9369cfbf26cfcf1f2515d98f15fab54e9647a", "shasum": "" }, "require": { - "php": ">=5.3.9", + "php": "^5.4 || ^7.0", + "phpoption/phpoption": "^1.5", "symfony/polyfill-ctype": "^1.9" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.0" + "phpunit/phpunit": "^4.8.35 || ^5.0 || ^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -5835,7 +5563,7 @@ "env", "environment" ], - "time": "2019-01-29T11:11:52+00:00" + "time": "2019-01-30T10:43:17+00:00" }, { "name": "zendframework/zend-diactoros", From 54d3879872362b77affe797e5aa7b138a19282bc Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 27 Feb 2019 13:01:42 -0700 Subject: [PATCH 5/9] Remove old httpsig tests --- tests/Unit/HttpSignatures/HeaderListTest.php | 20 -- tests/Unit/HttpSignatures/HmacContextTest.php | 190 ------------------ .../Unit/HttpSignatures/KeyStoreHmacTest.php | 16 -- tests/Unit/HttpSignatures/KeyStoreRsaTest.php | 114 ----------- tests/Unit/HttpSignatures/KeyStoreTest.php | 17 -- tests/Unit/HttpSignatures/RsaContextTest.php | 84 -------- tests/Unit/HttpSignatures/RsaVerifierTest.php | 156 -------------- .../SignatureParametersParserTest.php | 44 ---- .../SignatureParametersTest.php | 58 ------ .../Unit/HttpSignatures/SigningStringTest.php | 93 --------- tests/Unit/HttpSignatures/TestKeys.php | 64 ------ .../Unit/HttpSignatures/VerifierHmacTest.php | 116 ----------- 12 files changed, 972 deletions(-) delete mode 100644 tests/Unit/HttpSignatures/HeaderListTest.php delete mode 100644 tests/Unit/HttpSignatures/HmacContextTest.php delete mode 100644 tests/Unit/HttpSignatures/KeyStoreHmacTest.php delete mode 100644 tests/Unit/HttpSignatures/KeyStoreRsaTest.php delete mode 100644 tests/Unit/HttpSignatures/KeyStoreTest.php delete mode 100644 tests/Unit/HttpSignatures/RsaContextTest.php delete mode 100644 tests/Unit/HttpSignatures/RsaVerifierTest.php delete mode 100644 tests/Unit/HttpSignatures/SignatureParametersParserTest.php delete mode 100644 tests/Unit/HttpSignatures/SignatureParametersTest.php delete mode 100644 tests/Unit/HttpSignatures/SigningStringTest.php delete mode 100644 tests/Unit/HttpSignatures/TestKeys.php delete mode 100644 tests/Unit/HttpSignatures/VerifierHmacTest.php diff --git a/tests/Unit/HttpSignatures/HeaderListTest.php b/tests/Unit/HttpSignatures/HeaderListTest.php deleted file mode 100644 index 46d724eca..000000000 --- a/tests/Unit/HttpSignatures/HeaderListTest.php +++ /dev/null @@ -1,20 +0,0 @@ -assertEquals('(request-target) date', $hl->string()); - } - - public function testFromStringRoundTripNormalized() - { - $hl = HeaderList::fromString('(request-target) Accept'); - $this->assertEquals('(request-target) accept', $hl->string()); - } -} diff --git a/tests/Unit/HttpSignatures/HmacContextTest.php b/tests/Unit/HttpSignatures/HmacContextTest.php deleted file mode 100644 index d4d8cb7cc..000000000 --- a/tests/Unit/HttpSignatures/HmacContextTest.php +++ /dev/null @@ -1,190 +0,0 @@ -noDigestContext = new Context([ - 'keys' => ['pda' => 'secret'], - 'algorithm' => 'hmac-sha256', - 'headers' => ['(request-target)', 'date'], - ]); - $this->withDigestContext = new Context([ - 'keys' => ['pda' => 'secret'], - 'algorithm' => 'hmac-sha256', - 'headers' => ['(request-target)', 'date', 'digest'], - ]); - } - - public function testSignerNoDigestAction() - { - $message = new Request('GET', '/path?query=123', ['date' => 'today', 'accept' => 'llamas']); - $message = $this->noDigestContext->signer()->sign($message); - - $expectedString = implode(',', [ - 'keyId="pda"', - 'algorithm="hmac-sha256"', - 'headers="(request-target) date"', - 'signature="SFlytCGpsqb/9qYaKCQklGDvwgmrwfIERFnwt+yqPJw="', - ]); - - $this->assertEquals( - $expectedString, - $message->getHeader('Signature')[0] - ); - - $this->assertEquals( - 'Signature '.$expectedString, - $message->getHeader('Authorization')[0] - ); - } - - public function testSignerAddDigestToHeadersList() - { - $message = new Request( - 'POST', '/path/to/things?query=123', - ['date' => 'today', 'accept' => 'llamas'], - 'Thing to POST'); - $message = $this->noDigestContext->signer()->signWithDigest($message); - - $expectedString = implode(',', [ - 'keyId="pda"', - 'algorithm="hmac-sha256"', - 'headers="(request-target) date digest"', - 'signature="HH6R3OJmJbKUFqqL0tGVIIb7xi1WbbSh/HBXHUtLkUs="', ]); - $expectedDigestHeader = - 'SHA-256=rEcNhYZoBKiR29D30w1JcgArNlF8rXIXf5MnIL/4kcc='; - - $this->assertEquals( - $expectedString, - $message->getHeader('Signature')[0] - ); - - $this->assertEquals( - $expectedDigestHeader, - $message->getHeader('Digest')[0] - ); - - $this->assertEquals( - 'Signature '.$expectedString, - $message->getHeader('Authorization')[0] - ); - } - - public function testSignerReplaceDigest() - { - $message = new Request( - 'PUT', '/things/thething?query=123', - ['date' => 'today', - 'accept' => 'llamas', - 'Digest' => 'SHA-256=E/P+4y4x6EySO9qNAjCtQKxVwE1xKsNI/k+cjK+vtLU=', ], - 'Thing to PUT at /things/thething please...'); - $message = $this->noDigestContext->signer()->signWithDigest($message); - - $expectedString = implode(',', [ - 'keyId="pda"', - 'algorithm="hmac-sha256"', - 'headers="(request-target) date digest"', - 'signature="Hyatt1lSR/4XLI9Gcx8XOEKiG8LVktH7Lfr+0tmhwRU="', ]); - $expectedDigestHeader = - 'SHA-256=mulOx+77mQU1EbPET50SCGA4P/4bYxVCJA1pTwJsaMw='; - - $this->assertEquals( - $expectedString, - $message->getHeader('Signature')[0] - ); - - $this->assertEquals( - $expectedDigestHeader, - $message->getHeader('Digest')[0] - ); - - $this->assertEquals( - 'Signature '.$expectedString, - $message->getHeader('Authorization')[0] - ); - } - - public function testSignerNewDigestIsInHeaderList() - { - $message = new Request( - 'POST', '/path?query=123', - ['date' => 'today', - 'accept' => 'llamas', ], - 'Stuff that belongs in /path'); - $message = $this->withDigestContext->signer()->signWithDigest($message); - - $expectedString = implode(',', [ - 'keyId="pda"', - 'algorithm="hmac-sha256"', - 'headers="(request-target) date digest"', - 'signature="p8gQHs59X2WzQLUecfmxm1YO0OBTCNKldRZZBQsepfk="', ]); - $expectedDigestHeader = - 'SHA-256=jnSMEfBSum4Rh2k6/IVFyvLuQLmGYwMAGBS9WybyDqQ='; - - $this->assertEquals( - $expectedString, - $message->getHeader('Signature')[0] - ); - - $this->assertEquals( - $expectedDigestHeader, - $message->getHeader('Digest')[0] - ); - - $this->assertEquals( - 'Signature '.$expectedString, - $message->getHeader('Authorization')[0] - ); - } - - public function testSignerNewDigestWithoutBody() - { - $message = new Request( - 'GET', '/path?query=123', - ['date' => 'today', - 'accept' => 'llamas', ]); - $message = $this->withDigestContext->signer()->signWithDigest($message); - - $expectedString = implode(',', [ - 'keyId="pda"', - 'algorithm="hmac-sha256"', - 'headers="(request-target) date digest"', - 'signature="7iFqqryI6I9opV/Zp3eEg6PDY1tKw/3GqioOM7ACHHA="', ]); - $zeroLengthStringDigest = - 'SHA-256=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='; - - $this->assertEquals( - $expectedString, - $message->getHeader('Signature')[0] - ); - - $this->assertEquals( - $zeroLengthStringDigest, - $message->getHeader('Digest')[0] - ); - - $this->assertEquals( - 'Signature '.$expectedString, - $message->getHeader('Authorization')[0] - ); - } - - public function testVerifier() - { - $message = $this->noDigestContext->signer()->sign(new Request('GET', '/path?query=123', [ - 'Signature' => 'keyId="pda",algorithm="hmac-sha1",headers="date",signature="x"', - 'Date' => 'x', - ])); - - // assert it works without errors; correctness of results tested elsewhere. - $this->assertTrue(is_bool($this->noDigestContext->verifier()->isValid($message))); - } -} diff --git a/tests/Unit/HttpSignatures/KeyStoreHmacTest.php b/tests/Unit/HttpSignatures/KeyStoreHmacTest.php deleted file mode 100644 index 1f47a8b1f..000000000 --- a/tests/Unit/HttpSignatures/KeyStoreHmacTest.php +++ /dev/null @@ -1,16 +0,0 @@ - 'ThisIsASecretKey']); - $key = $ks->fetch('hmacsecret'); - $this->assertEquals(['hmacsecret', 'ThisIsASecretKey', 'ThisIsASecretKey', 'secret'], [ - $key->getId(), $key->getVerifyingKey(), $key->getSigningKey(), $key->getType(), ]); - } -} diff --git a/tests/Unit/HttpSignatures/KeyStoreRsaTest.php b/tests/Unit/HttpSignatures/KeyStoreRsaTest.php deleted file mode 100644 index 18302d44d..000000000 --- a/tests/Unit/HttpSignatures/KeyStoreRsaTest.php +++ /dev/null @@ -1,114 +0,0 @@ -testRsaPrivateKeyPEM - ); - $this->testRsaPublicKeyPEM = openssl_pkey_get_details( - openssl_get_publickey(TestKeys::rsaPublicKey) - )['key']; - $this->testRsaCert = TestKeys::rsaCert; - } - - public function testParseX509inObject() - { - $keySpec = ['rsaCert' => [TestKeys::rsaCert]]; - $this->assertTrue(Key::hasX509Certificate($keySpec)); - - $ks = new KeyStore($keySpec); - $publicKey = $ks->fetch('rsaCert')->getVerifyingKey(); - $this->assertEquals('asymmetric', $ks->fetch('rsaCert')->getType()); - $this->assertEquals(TestKeys::rsaPublicKey, $publicKey); - } - - public function testParseRsaPublicKeyinObject() - { - $keySpec = ['rsaPubKey' => [TestKeys::rsaPublicKey]]; - $this->assertTrue(Key::hasPublicKey($keySpec)); - - $ks = new KeyStore($keySpec); - $publicKey = $ks->fetch('rsaPubKey')->getVerifyingKey(); - $this->assertEquals('asymmetric', $ks->fetch('rsaPubKey')->getType()); - $this->assertEquals(TestKeys::rsaPublicKey, $publicKey); - } - - public function testParsePrivateKeyinObject() - { - $keySpec = ['rsaPrivKey' => [TestKeys::rsaPrivateKey]]; - $this->assertTrue(Key::hasPrivateKey($keySpec)); - - $ks = new KeyStore($keySpec); - $publicKey = $ks->fetch('rsaPrivKey')->getSigningKey(); - $this->assertEquals('asymmetric', $ks->fetch('rsaPrivKey')->getType()); - $this->assertEquals($this->testRsaPrivateKeyPEM, $publicKey); - } - - public function testFetchRsaSigningKeySuccess() - { - $ks = new KeyStore(['rsakey' => TestKeys::rsaPrivateKey]); - $key = $ks->fetch('rsakey'); - openssl_pkey_export($key->getSigningKey(), $keyStoreSigningKey); - $this->assertEquals(['rsakey', $this->testRsaPrivateKeyPEM, null, 'asymmetric'], [ - $key->getId(), $keyStoreSigningKey, $key->getVerifyingKey(), $key->getType(), ]); - } - - public function testFetchRsaVerifyingKeyFromCertificateSuccess() - { - $ks = new KeyStore(['rsacert' => TestKeys::rsaCert]); - $key = $ks->fetch('rsacert'); - $keyStoreVerifyingKey = $key->getVerifyingKey(); - $this->assertEquals(['rsacert', null, $this->testRsaPublicKeyPEM, 'asymmetric'], [ - $key->getId(), $key->getSigningKey(), $keyStoreVerifyingKey, $key->getType(), ]); - } - - public function testFetchRsaVerifyingKeyFromPublicKeySuccess() - { - $ks = new KeyStore(['rsapubkey' => TestKeys::rsaPublicKey]); - $key = $ks->fetch('rsapubkey'); - $keyStoreVerifyingKey = $key->getVerifyingKey(); - $this->assertEquals(['rsapubkey', null, $this->testRsaPublicKeyPEM, 'asymmetric'], [ - $key->getId(), $key->getSigningKey(), $keyStoreVerifyingKey, $key->getType(), ]); - } - - public function testFetchRsaBothSuccess() - { - $ks = new KeyStore(['rsaboth' => [TestKeys::rsaCert, TestKeys::rsaPrivateKey]]); - $key = $ks->fetch('rsaboth'); - $keyStoreVerifyingKey = $key->getVerifyingKey(); - $keyStoreSigningKey = $key->getSigningKey(); - $this->assertEquals(['rsaboth', $this->testRsaPrivateKeyPEM, $this->testRsaPublicKeyPEM, 'asymmetric'], [ - $key->getId(), $keyStoreSigningKey, $keyStoreVerifyingKey, $key->getType(), ]); - } - - public function testFetchRsaBothSuccessSwitched() - { - $ks = new KeyStore(['rsabothswitch' => [TestKeys::rsaPrivateKey, TestKeys::rsaCert]]); - $key = $ks->fetch('rsabothswitch'); - $keyStoreVerifyingKey = $key->getVerifyingKey(); - $keyStoreSigningKey = $key->getSigningKey(); - $this->assertEquals(['rsabothswitch', $this->testRsaPrivateKeyPEM, $this->testRsaPublicKeyPEM, 'asymmetric'], [ - $key->getId(), $keyStoreSigningKey, $keyStoreVerifyingKey, $key->getType(), ]); - } - - /** - * @expectedException \App\Util\HttpSignatures\KeyException - */ - public function testRsaMismatch() - { - $privateKey = openssl_pkey_new([ - 'private_key_type' => 'OPENSSL_KEYTYPE_RSA', - 'private_key_bits' => 1024, ] - ); - $ks = new Key('badpki', [TestKeys::rsaCert, $privateKey]); - } -} \ No newline at end of file diff --git a/tests/Unit/HttpSignatures/KeyStoreTest.php b/tests/Unit/HttpSignatures/KeyStoreTest.php deleted file mode 100644 index 1e21255a1..000000000 --- a/tests/Unit/HttpSignatures/KeyStoreTest.php +++ /dev/null @@ -1,17 +0,0 @@ - 'secret']); - $key = $ks->fetch('nope'); - } -} diff --git a/tests/Unit/HttpSignatures/RsaContextTest.php b/tests/Unit/HttpSignatures/RsaContextTest.php deleted file mode 100644 index 78396f452..000000000 --- a/tests/Unit/HttpSignatures/RsaContextTest.php +++ /dev/null @@ -1,84 +0,0 @@ -sha1context = new Context([ - 'keys' => ['rsa1' => TestKeys::rsaPrivateKey], - 'algorithm' => 'rsa-sha1', - 'headers' => ['(request-target)', 'date'], - ]); - $this->sha256context = new Context([ - 'keys' => ['rsa1' => TestKeys::rsaPrivateKey], - 'algorithm' => 'rsa-sha256', - 'headers' => ['(request-target)', 'date'], - ]); - } - - public function testSha1Signer() - { - $message = new Request('GET', '/path?query=123', ['date' => 'today', 'accept' => 'llamas']); - - $message = $this->sha1context->signer()->sign($message); - $expectedSha1String = implode(',', [ - 'keyId="rsa1"', - 'algorithm="rsa-sha1"', - 'headers="(request-target) date"', - 'signature="YIR3DteE3Jmz1VAnUMTgjTn3vTKfQuZl1CJhMBvGOZpnzwKeYBXA'. - 'H108FojnbSeVG/AXq9pcrA6AFK0peg0aueqxpaFlo+4L/q5XzJ+QoryY3dlSr'. - 'xwVnE5s5M19xmFm/6YkZR/KPeANCsG4SPL82Um/PCEMU0tmKd6sSx+IIzAYbX'. - 'G/VrFMDeQAdXqpU1EhgxopKEAapN8rChb49+1JfR/RxlSKiLukJJ6auurm2zM'. - 'n2D40fR1d2umA5LAO7vRt2iQwVbtwiFkVlRqkMvGftCNZByu8jJ6StI5H7Efu'. - 'ANSHAZXKXWNH8yxpBUW/QCHCZjPd0ugM0QJJIc7i8JbGlA=="', - ]); - - $this->assertEquals( - $expectedSha1String, - $message->getHeader('Signature')[0] - ); - } - - public function testSha256Signer() - { - $message = new Request('GET', '/path?query=123', ['date' => 'today', 'accept' => 'llamas']); - - $message = $this->sha256context->signer()->sign($message); - $expectedSha256String = implode(',', [ - 'keyId="rsa1"', - 'algorithm="rsa-sha256"', - 'headers="(request-target) date"', - 'signature="WGIegQCC3GEwxbkuXtq67CAqeDhkwblxAH2uoDx5kfWurhLRA5WB'. - 'FDA/aktsZAjuUoimG1w4CGxSecziER1ez44PBlHP2fCW4ArLgnQgcjkdN2cOf/g'. - 'j0OVL8s2usG4o4tud/+jjF3nxTxLl3HC+erBKsJakwXbw9kt4Cr028BToVfNXsW'. - 'oMFpv0IjcgBH2V41AVlX/mYBMMJAihBCIcpgAcGrrxmG2gkfvSn09wtTttkGHft'. - 'PIp3VpB53zbemlJS9Yw3tmmHr6cvWSXqQy/bTsEOoQJ2REfn5eiyzsJu3GiOpiI'. - 'LK67i/WH9moltJtlfV57TV72cgYtjWa6yqhtFg=="', - ]); - - $this->assertEquals( - $expectedSha256String, - $message->getHeader('Signature')[0] - ); - } - - /** - * @expectedException App\Util\HttpSignatures\AlgorithmException - */ - public function testRsaBadalgorithm() - { - $sha224context = new Context([ - 'keys' => ['rsa1' => TestKeys::rsaPrivateKey], - 'algorithm' => 'rsa-sha224', - 'headers' => ['(request-target)', 'date'], - ]); - } -} diff --git a/tests/Unit/HttpSignatures/RsaVerifierTest.php b/tests/Unit/HttpSignatures/RsaVerifierTest.php deleted file mode 100644 index b6e0ded45..000000000 --- a/tests/Unit/HttpSignatures/RsaVerifierTest.php +++ /dev/null @@ -1,156 +0,0 @@ -setUpRsaVerifier(); - - $sha1SignatureHeader = - 'keyId="rsa1",algorithm="rsa-sha1",headers="(request-target) date",'. - 'signature="YIR3DteE3Jmz1VAnUMTgjTn3vTKfQuZl1CJhMBvGOZpnzwKeYBXAH10'. - '8FojnbSeVG/AXq9pcrA6AFK0peg0aueqxpaFlo+4L/q5XzJ+QoryY3dlSrxwVnE5s5'. - 'M19xmFm/6YkZR/KPeANCsG4SPL82Um/PCEMU0tmKd6sSx+IIzAYbXG/VrFMDeQAdXq'. - 'pU1EhgxopKEAapN8rChb49+1JfR/RxlSKiLukJJ6auurm2zMn2D40fR1d2umA5LAO7'. - 'vRt2iQwVbtwiFkVlRqkMvGftCNZByu8jJ6StI5H7EfuANSHAZXKXWNH8yxpBUW/QCH'. - 'CZjPd0ugM0QJJIc7i8JbGlA=="'; - - $this->sha1Message = new Request('GET', '/path?query=123', [ - 'Date' => 'today', - 'Signature' => $sha1SignatureHeader, - ]); - - $sha256SignatureHeader = - 'keyId="rsa1",algorithm="rsa-sha256",headers="(request-target) date",'. - 'signature="WGIegQCC3GEwxbkuXtq67CAqeDhkwblxAH2uoDx5kfWurhLRA5WBFDA/a'. - 'ktsZAjuUoimG1w4CGxSecziER1ez44PBlHP2fCW4ArLgnQgcjkdN2cOf/gj0OVL8s2us'. - 'G4o4tud/+jjF3nxTxLl3HC+erBKsJakwXbw9kt4Cr028BToVfNXsWoMFpv0IjcgBH2V4'. - '1AVlX/mYBMMJAihBCIcpgAcGrrxmG2gkfvSn09wtTttkGHftPIp3VpB53zbemlJS9Yw3'. - 'tmmHr6cvWSXqQy/bTsEOoQJ2REfn5eiyzsJu3GiOpiILK67i/WH9moltJtlfV57TV72c'. - 'gYtjWa6yqhtFg=="'; - - $this->sha256Message = new Request('GET', '/path?query=123', [ - 'Date' => 'today', - 'Signature' => $sha256SignatureHeader, - ]); - } - - private function setUpRsaVerifier() - { - $keyStore = new KeyStore(['rsa1' => TestKeys::rsaPublicKey]); - $this->verifier = new Verifier($keyStore); - } - - public function testVerifyValidRsaMessage() - { - $this->assertTrue($this->verifier->isValid($this->sha1Message)); - $this->assertTrue($this->verifier->isValid($this->sha256Message)); - } - - public function testVerifyValidRsaMessageAuthorizationHeader() - { - $message = $this->sha1Message->withHeader( - 'Authorization', - "Signature {$this->sha1Message->getHeader('Signature')[0]}"); - $message = $this->sha1Message->withoutHeader('Signature'); - - $this->assertTrue($this->verifier->isValid($this->sha1Message)); - - $message = $this->sha256Message->withHeader( - 'Authorization', - "Signature {$this->sha256Message->getHeader('Signature')[0]}"); - $message = $this->sha256Message->withoutHeader('Signature'); - - $this->assertTrue($this->verifier->isValid($this->sha256Message)); - } - - public function testRejectTamperedRsaRequestMethod() - { - $message = $this->sha1Message->withMethod('POST'); - $this->assertFalse($this->verifier->isValid($message)); - $message = $this->sha256Message->withMethod('POST'); - $this->assertFalse($this->verifier->isValid($message)); - } - - public function testRejectTamperedRsaDate() - { - $message = $this->sha1Message->withHeader('Date', self::DATE_DIFFERENT); - $this->assertFalse($this->verifier->isValid($message)); - $message = $this->sha256Message->withHeader('Date', self::DATE_DIFFERENT); - $this->assertFalse($this->verifier->isValid($message)); - } - - public function testRejectTamperedRsaSignature() - { - $message = $this->sha1Message->withHeader( - 'Signature', - preg_replace('/signature="/', 'signature="x', $this->sha1Message->getHeader('Signature')[0]) - ); - $this->assertFalse($this->verifier->isValid($message)); - $message = $this->sha256Message->withHeader( - 'Signature', - preg_replace('/signature="/', 'signature="x', $this->sha256Message->getHeader('Signature')[0]) - ); - $this->assertFalse($this->verifier->isValid($message)); - } - - public function testRejectRsaMessageWithoutSignatureHeader() - { - $message = $this->sha1Message->withoutHeader('Signature'); - $this->assertFalse($this->verifier->isValid($message)); - $message = $this->sha256Message->withoutHeader('Signature'); - $this->assertFalse($this->verifier->isValid($message)); - } - - public function testRejectRsaMessageWithGarbageSignatureHeader() - { - $message = $this->sha1Message->withHeader('Signature', 'not="a",valid="signature"'); - $this->assertFalse($this->verifier->isValid($message)); - $message = $this->sha256Message->withHeader('Signature', 'not="a",valid="signature"'); - $this->assertFalse($this->verifier->isValid($message)); - } - - public function testRejectRsaMessageWithPartialSignatureHeader() - { - $message = $this->sha1Message->withHeader('Signature', 'keyId="aa",algorithm="bb"'); - $this->assertFalse($this->verifier->isValid($message)); - $message = $this->sha256Message->withHeader('Signature', 'keyId="aa",algorithm="bb"'); - $this->assertFalse($this->verifier->isValid($message)); - } - - public function testRejectsRsaMessageWithUnknownKeyId() - { - $keyStore = new KeyStore(['nope' => 'secret']); - $verifier = new Verifier($keyStore); - $this->assertFalse($verifier->isValid($this->sha1Message)); - $this->assertFalse($verifier->isValid($this->sha256Message)); - } - - public function testRejectsRsaMessageMissingSignedHeaders() - { - $message = $this->sha1Message->withoutHeader('Date'); - $this->assertFalse($this->verifier->isValid($message)); - $message = $this->sha256Message->withoutHeader('Date'); - $this->assertFalse($this->verifier->isValid($message)); - } -} \ No newline at end of file diff --git a/tests/Unit/HttpSignatures/SignatureParametersParserTest.php b/tests/Unit/HttpSignatures/SignatureParametersParserTest.php deleted file mode 100644 index 37655092f..000000000 --- a/tests/Unit/HttpSignatures/SignatureParametersParserTest.php +++ /dev/null @@ -1,44 +0,0 @@ -assertEquals( - [ - 'keyId' => 'example', - 'algorithm' => 'hmac-sha1', - 'headers' => '(request-target) date', - 'signature' => 'b64', - ], - $parser->parse() - ); - } - - /** - * @expectedException App\Util\HttpSignatures\SignatureParseException - */ - public function testParseThrowsTypedException() - { - $parser = new SignatureParametersParser('nope'); - $parser->parse(); - } - - /** - * @expectedException App\Util\HttpSignatures\SignatureParseException - */ - public function testParseExceptionForMissingComponents() - { - $parser = new SignatureParametersParser( - 'keyId="example",algorithm="hmac-sha1",headers="(request-target) date"' - ); - $parser->parse(); - } -} diff --git a/tests/Unit/HttpSignatures/SignatureParametersTest.php b/tests/Unit/HttpSignatures/SignatureParametersTest.php deleted file mode 100644 index 6da7252d1..000000000 --- a/tests/Unit/HttpSignatures/SignatureParametersTest.php +++ /dev/null @@ -1,58 +0,0 @@ -getMockBuilder('HttpSignatures\Signature') - ->disableOriginalConstructor() - ->getMock(); - - $signature - ->expects($this->any()) - ->method('string') - ->will($this->returnValue('thesignature')); - - $sp = new SignatureParameters($key, $algorithm, $headerList, $signature); - - $this->assertEquals( - 'keyId="pda",algorithm="hmac-sha256",headers="(request-target) date",signature="dGhlc2lnbmF0dXJl"', - $sp->string() - ); - } - - public function testRsaToString() - { - $key = new Key('pda', TestKeys::rsaPrivateKey); - $algorithm = new RsaAlgorithm('sha256'); - $headerList = new HeaderList(['(request-target)', 'date']); - - $signature = $this->getMockBuilder('HttpSignatures\Signature') - ->disableOriginalConstructor() - ->getMock(); - - $signature - ->expects($this->any()) - ->method('string') - ->will($this->returnValue('thesignature')); - - $sp = new SignatureParameters($key, $algorithm, $headerList, $signature); - - $this->assertEquals( - 'keyId="pda",algorithm="rsa-sha256",headers="(request-target) date",signature="dGhlc2lnbmF0dXJl"', - $sp->string() - ); - } -} diff --git a/tests/Unit/HttpSignatures/SigningStringTest.php b/tests/Unit/HttpSignatures/SigningStringTest.php deleted file mode 100644 index 87845a8a9..000000000 --- a/tests/Unit/HttpSignatures/SigningStringTest.php +++ /dev/null @@ -1,93 +0,0 @@ -message('/path')); - - $this->assertEquals( - '(request-target): get /path', - $ss->string() - ); - } - - public function testSigningStringWithOrderedQueryParameters() - { - $headerList = new HeaderList(['(request-target)', 'date']); - $ss = new SigningString($headerList, $this->message('/path?a=antelope&z=zebra')); - - $this->assertEquals( - "(request-target): get /path?a=antelope&z=zebra\ndate: Mon, 28 Jul 2014 15:39:13 -0700", - $ss->string() - ); - } - - public function testSigningStringWithUnorderedQueryParameters() - { - $headerList = new HeaderList(['(request-target)', 'date']); - $ss = new SigningString($headerList, $this->message('/path?z=zebra&a=antelope')); - - $this->assertEquals( - "(request-target): get /path?z=zebra&a=antelope\ndate: Mon, 28 Jul 2014 15:39:13 -0700", - $ss->string() - ); - } - - public function testSigningStringWithOrderedQueryParametersSymfonyRequest() - { - $headerList = new HeaderList(['(request-target)', 'date']); - $ss = new SigningString($headerList, $this->symfonyMessage('/path?a=antelope&z=zebra')); - - $this->assertEquals( - "(request-target): get /path?a=antelope&z=zebra\ndate: Mon, 28 Jul 2014 15:39:13 -0700", - $ss->string() - ); - } - - public function testSigningStringWithUnorderedQueryParametersSymfonyRequest() - { - $headerList = new HeaderList(['(request-target)', 'date']); - $ss = new SigningString($headerList, $this->symfonyMessage('/path?z=zebra&a=antelope')); - - $this->assertEquals( - "(request-target): get /path?z=zebra&a=antelope\ndate: Mon, 28 Jul 2014 15:39:13 -0700", - $ss->string() - ); - } - - /** - * @expectedException App\Util\HttpSignatures\Exception - */ - public function testSigningStringErrorForMissingHeader() - { - $headerList = new HeaderList(['nope']); - $ss = new SigningString($headerList, $this->message('/')); - $ss->string(); - } - - private function message($path) - { - return new Request('GET', $path, ['date' => 'Mon, 28 Jul 2014 15:39:13 -0700']); - } - - private function symfonyMessage($path) - { - $symfonyRequest = SymfonyRequest::create($path, 'GET'); - $symfonyRequest->headers->replace(['date' => 'Mon, 28 Jul 2014 15:39:13 -0700']); - - $psr7Factory = new DiactorosFactory(); - $psrRequest = $psr7Factory->createRequest($symfonyRequest)->withRequestTarget($symfonyRequest->getRequestUri()); - - return $psrRequest; - } -} diff --git a/tests/Unit/HttpSignatures/TestKeys.php b/tests/Unit/HttpSignatures/TestKeys.php deleted file mode 100644 index cc3a28492..000000000 --- a/tests/Unit/HttpSignatures/TestKeys.php +++ /dev/null @@ -1,64 +0,0 @@ -setUpHmacVerifier(); - $this->setUpValidHmacMessage(); - } - - private function setUpHmacVerifier() - { - $keyStore = new KeyStore(['secret1' => 'secret']); - $this->verifier = new Verifier($keyStore); - } - - private function setUpValidHmacMessage() - { - $signatureHeader = sprintf( - 'keyId="%s",algorithm="%s",headers="%s",signature="%s"', - 'secret1', - 'hmac-sha256', - '(request-target) date', - 'cS2VvndvReuTLy52Ggi4j6UaDqGm9hMb4z0xJZ6adqU=' - ); - - $this->message = new Request('GET', '/path?query=123', [ - 'Date' => self::DATE, - 'Signature' => $signatureHeader, - ]); - } - - public function testVerifyValidHmacMessage() - { - $this->assertTrue($this->verifier->isValid($this->message)); - } - - public function testVerifyValidHmacMessageAuthorizationHeader() - { - $message = $this->message->withHeader('Authorization', "Signature {$this->message->getHeader('Signature')[0]}"); - $message = $message->withoutHeader('Signature'); - - $this->assertTrue($this->verifier->isValid($this->message)); - } - - public function testRejectTamperedHmacRequestMethod() - { - $message = $this->message->withMethod('POST'); - $this->assertFalse($this->verifier->isValid($message)); - } - - public function testRejectTamperedHmacDate() - { - $message = $this->message->withHeader('Date', self::DATE_DIFFERENT); - $this->assertFalse($this->verifier->isValid($message)); - } - - public function testRejectTamperedHmacSignature() - { - $message = $this->message->withHeader( - 'Signature', - preg_replace('/signature="/', 'signature="x', $this->message->getHeader('Signature')[0]) - ); - $this->assertFalse($this->verifier->isValid($message)); - } - - public function testRejectHmacMessageWithoutSignatureHeader() - { - $message = $this->message->withoutHeader('Signature'); - $this->assertFalse($this->verifier->isValid($message)); - } - - public function testRejectHmacMessageWithGarbageSignatureHeader() - { - $message = $this->message->withHeader('Signature', 'not="a",valid="signature"'); - $this->assertFalse($this->verifier->isValid($message)); - } - - public function testRejectHmacMessageWithPartialSignatureHeader() - { - $message = $this->message->withHeader('Signature', 'keyId="aa",algorithm="bb"'); - $this->assertFalse($this->verifier->isValid($message)); - } - - public function testRejectsHmacMessageWithUnknownKeyId() - { - $keyStore = new KeyStore(['nope' => 'secret']); - $verifier = new Verifier($keyStore); - $this->assertFalse($verifier->isValid($this->message)); - } - - public function testRejectsHmacMessageMissingSignedHeaders() - { - $message = $this->message->withoutHeader('Date'); - $this->assertFalse($this->verifier->isValid($message)); - } -} From 0c654f5e4333c1404c769348e8ece1a565b4ee99 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 27 Feb 2019 13:04:40 -0700 Subject: [PATCH 6/9] Update tests --- tests/Unit/ActivityPub/AcceptVerbTest.php | 55 ------------------- tests/Unit/ActivityPub/AudienceScopeTest.php | 2 +- tests/Unit/ActivityPub/NoteAttachmentTest.php | 4 +- tests/Unit/ActivityPub/Verb/AnnounceTest.php | 2 +- tests/Unit/Lexer/StatusLexerTest.php | 3 +- 5 files changed, 5 insertions(+), 61 deletions(-) delete mode 100644 tests/Unit/ActivityPub/AcceptVerbTest.php diff --git a/tests/Unit/ActivityPub/AcceptVerbTest.php b/tests/Unit/ActivityPub/AcceptVerbTest.php deleted file mode 100644 index c949624db..000000000 --- a/tests/Unit/ActivityPub/AcceptVerbTest.php +++ /dev/null @@ -1,55 +0,0 @@ -validAccept = [ - '@context' => 'https://www.w3.org/ns/activitystreams', - 'id' => 'https://example.org/og/b3e4a40b-0b26-4c5a-9079-094bd633fab7', - 'type' => 'Accept', - 'actor' => 'https://example.org/u/alice', - 'object' => [ - 'id' => 'https://example.net/u/bob#follows/bb27f601-ddb9-4567-8f16-023d90605ca9', - 'type' => 'Follow', - 'actor' => 'https://example.net/u/bob', - 'object' => 'https://example.org/u/alice' - ] - ]; - $this->invalidAccept = [ - '@context' => 'https://www.w3.org/ns/activitystreams', - 'id' => 'https://example.org/og/b3e4a40b-0b26-4c5a-9079-094bd633fab7', - 'type' => 'Accept2', - 'actor' => 'https://example.org/u/alice', - 'object' => [ - 'id' => 'https://example.net/u/bob#follows/bb27f601-ddb9-4567-8f16-023d90605ca9', - 'type' => 'Follow', - 'actor' => 'https://example.net/u/bob', - 'object' => 'https://example.org/u/alice' - ] - ]; - } - - /** @test */ - public function basic_accept() - { - $this->assertTrue(Accept::validate($this->validAccept)); - } - - /** @test */ - public function invalid_accept() - { - $this->assertFalse(Accept::validate($this->invalidAccept)); - } -} diff --git a/tests/Unit/ActivityPub/AudienceScopeTest.php b/tests/Unit/ActivityPub/AudienceScopeTest.php index c7287fa1d..5ff125f1d 100644 --- a/tests/Unit/ActivityPub/AudienceScopeTest.php +++ b/tests/Unit/ActivityPub/AudienceScopeTest.php @@ -9,7 +9,7 @@ use App\Util\ActivityPub\Helpers; class AudienceScopeTest extends TestCase { - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/Unit/ActivityPub/NoteAttachmentTest.php b/tests/Unit/ActivityPub/NoteAttachmentTest.php index 7a715a285..e69539235 100644 --- a/tests/Unit/ActivityPub/NoteAttachmentTest.php +++ b/tests/Unit/ActivityPub/NoteAttachmentTest.php @@ -10,10 +10,10 @@ use Illuminate\Foundation\Testing\RefreshDatabase; class NoteAttachmentTest extends TestCase { - public function setUp() + public function setUp(): void { parent::setUp(); - $this->pleroma = json_decode('{"@context":"https://www.w3.org/ns/activitystreams","actor":"https://pleroma.site/users/pixeldev","cc":["https://pleroma.site/users/pixeldev/followers"],"context":"https://pleroma.site/contexts/cbe919c6-238e-4e5d-9065-fcb3c312b56a","context_id":8651628,"id":"https://pleroma.site/activities/65b2c43f-f33e-438e-b141-4e2047b43012","object":{"actor":"https://pleroma.site/users/pixeldev","announcement_count":2,"announcements":["https://playvicious.social/users/jalcine","https://mastodon.social/users/dansup"],"attachment":[{"mediaType":"image/png","name":"Screen Shot 2018-09-08 at 10.59.38 PM.png","type":"Document","url":"https://s3.wasabisys.com/pleroma-site/1c49e1f9-1187-404d-a063-1b37ecec44e9/Screen Shot 2018-09-08 at 10.59.38 PM.png"},{"mediaType":"image/jpeg","name":"archer-danger-zone.jpg","type":"Document","url":"https://s3.wasabisys.com/pleroma-site/cd70cdb6-0148-4dcb-bac6-11fd4aa59834/archer-danger-zone.jpg"}],"attributedTo":"https://pleroma.site/users/pixeldev","cc":["https://pleroma.site/users/pixeldev/followers"],"content":"New middleware for specific actions, acts like sudo requiring periodic password verification. #dangerZone","context":"https://pleroma.site/contexts/cbe919c6-238e-4e5d-9065-fcb3c312b56a","context_id":8651628,"conversation":"https://pleroma.site/contexts/cbe919c6-238e-4e5d-9065-fcb3c312b56a","emoji":{},"id":"https://pleroma.site/objects/b7576ec9-ae2b-4076-a426-0d8a65b23876","like_count":6,"likes":["https://crazynoisybizarre.town/users/jusdepatate","https://social.chinwag.org/users/rolaveric","https://norden.social/users/ReneHenrich","https://mastodon.ketchupma.io/users/KazukyAkayashi","https://chaos.social/users/lutoma","https://playvicious.social/users/jalcine"],"published":"2018-09-09T05:05:53.763752Z","sensitive":false,"summary":"","tag":[{"href":"https://pleroma.site/tags/dangerzone","name":"#dangerzone","type":"Hashtag"}],"to":["https://www.w3.org/ns/activitystreams#Public"],"type":"Note"},"published":"2018-09-09T05:05:53.749866Z","to":["https://www.w3.org/ns/activitystreams#Public"],"type":"Create"}', true, 9); + $this->pleroma = json_decode('{"@context":"https://www.w3.org/ns/activitystreams","actor":"https://pleroma.site/users/pixeldev","cc":["https://pleroma.site/users/pixeldev/followers"],"context":"https://pleroma.site/contexts/cbe919c6-238e-4e5d-9065-fcb3c312b56a","context_id":8651628,"id":"https://pleroma.site/activities/65b2c43f-f33e-438e-b141-4e2047b43012","object":{"actor":"https://pleroma.site/users/pixeldev","announcement_count":2,"announcements":["https://playvicious.social/users/jalcine","https://mastodon.social/users/dansup"],"attachment":[{"mediaType":"image/png","name":"Screen Shot 2018-09-08 at 10.59.38 PM.png","type":"Document","url":"https://s3.wasabisys.com/pleroma-site/1c49e1f9-1187-404d-a063-1b37ecec44e9/Screen Shot 2018-09-08 at 10.59.38 PM.png"},{"mediaType":"image/jpeg","name":"archer-danger-zone.jpg","type":"Document","url":"https://s3.wasabisys.com/pleroma-site/cd70cdb6-0148-4dcb-bac6-11fd4aa59834/archer-danger-zone.jpg"}],"attributedTo":"https://pleroma.site/users/pixeldev","cc":["https://pleroma.site/users/pixeldev/followers"],"content":"New middleware for specific actions, acts like sudo requiring periodic password verification. #dangerZone","context":"https://pleroma.site/contexts/cbe919c6-238e-4e5d-9065-fcb3c312b56a","context_id":8651628,"conversation":"https://pleroma.site/contexts/cbe919c6-238e-4e5d-9065-fcb3c312b56a","emoji":{},"id":"https://pleroma.site/objects/b7576ec9-ae2b-4076-a426-0d8a65b23876","published":"2018-09-09T05:05:53.763752Z","sensitive":false,"summary":"","tag":[{"href":"https://pleroma.site/tags/dangerzone","name":"#dangerzone","type":"Hashtag"}],"to":["https://www.w3.org/ns/activitystreams#Public"],"type":"Note"},"published":"2018-09-09T05:05:53.749866Z","to":["https://www.w3.org/ns/activitystreams#Public"],"type":"Create"}', true, 9); $this->mastodon = json_decode('{"id":"https://mastodon.social/users/dansup/statuses/100889802384218791/activity","type":"Create","actor":"https://mastodon.social/users/dansup","published":"2018-10-13T18:43:33Z","to":["https://www.w3.org/ns/activitystreams#Public"],"cc":["https://mastodon.social/users/dansup/followers"],"object":{"id":"https://mastodon.social/users/dansup/statuses/100889802384218791","type":"Note","summary":null,"inReplyTo":null,"published":"2018-10-13T18:43:33Z","url":"https://mastodon.social/@dansup/100889802384218791","attributedTo":"https://mastodon.social/users/dansup","to":["https://www.w3.org/ns/activitystreams#Public"],"cc":["https://mastodon.social/users/dansup/followers"],"sensitive":false,"atomUri":"https://mastodon.social/users/dansup/statuses/100889802384218791","inReplyToAtomUri":null,"conversation":"tag:mastodon.social,2018-10-13:objectId=59103420:objectType=Conversation","content":"

Good Morning! #coffee

","contentMap":{"en":"

Good Morning! #coffee

"},"attachment":[{"type":"Document","mediaType":"image/jpeg","url":"https://files.mastodon.social/media_attachments/files/007/110/573/original/96a196885a77c9a4.jpg","name":null}],"tag":[{"type":"Hashtag","href":"https://mastodon.social/tags/coffee","name":"#coffee"}]}}', true, 9); diff --git a/tests/Unit/ActivityPub/Verb/AnnounceTest.php b/tests/Unit/ActivityPub/Verb/AnnounceTest.php index c3e739692..7b7eef14b 100644 --- a/tests/Unit/ActivityPub/Verb/AnnounceTest.php +++ b/tests/Unit/ActivityPub/Verb/AnnounceTest.php @@ -10,7 +10,7 @@ use App\Util\ActivityPub\Validator\Announce; class AnnounceTest extends TestCase { - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/Unit/Lexer/StatusLexerTest.php b/tests/Unit/Lexer/StatusLexerTest.php index fbfa15cb7..5b0fe37de 100644 --- a/tests/Unit/Lexer/StatusLexerTest.php +++ b/tests/Unit/Lexer/StatusLexerTest.php @@ -14,7 +14,7 @@ class StatusLexerTest extends TestCase public $entities; public $autolink; - public function setUp() + public function setUp(): void { parent::setUp(); $this->status = "@pixelfed hi, really like the website! #píxelfed"; @@ -60,7 +60,6 @@ class StatusLexerTest extends TestCase public function testAutolink() { $expected = '@pixelfed hi, really like the website! #píxelfed'; - $this->assertEquals($this->autolink, $expected); } } From 5cb5b5277d1a70a3500c31940a484712f75ae6c7 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 27 Feb 2019 20:14:53 -0700 Subject: [PATCH 7/9] Add Localization Helper --- app/Util/Localization/Localization.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 app/Util/Localization/Localization.php diff --git a/app/Util/Localization/Localization.php b/app/Util/Localization/Localization.php new file mode 100644 index 000000000..4ca061525 --- /dev/null +++ b/app/Util/Localization/Localization.php @@ -0,0 +1,18 @@ +addDays(14), function() { + $dir = resource_path('lang'); + return Arr::flatten(array_diff(scandir($dir), array('..', '.', 'vendor'))); + }); + } + +} \ No newline at end of file From ca1814091add55cfc1fb8e9c69281c5b5533efd9 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 27 Feb 2019 20:15:18 -0700 Subject: [PATCH 8/9] Update SiteController --- app/Http/Controllers/SiteController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/SiteController.php b/app/Http/Controllers/SiteController.php index 2134a9424..83e18b20b 100644 --- a/app/Http/Controllers/SiteController.php +++ b/app/Http/Controllers/SiteController.php @@ -6,6 +6,7 @@ use Illuminate\Http\Request; use App, Auth, Cache, View; use App\Util\Lexer\PrettyNumber; use App\{Follower, Page, Profile, Status, User, UserFilter}; +use App\Util\Localization\Localization; class SiteController extends Controller { @@ -31,7 +32,7 @@ class SiteController extends Controller public function changeLocale(Request $request, $locale) { // todo: add other locales after pushing new l10n strings - $locales = ['en']; + $locales = Localization::languages(); if(in_array($locale, $locales)) { session()->put('locale', $locale); } From 63ba74fcee627bfd28dcb7e8ef471f0cf33f5d21 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 27 Feb 2019 20:16:09 -0700 Subject: [PATCH 9/9] Update language view --- resources/views/site/language.blade.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/resources/views/site/language.blade.php b/resources/views/site/language.blade.php index 93c4158b2..f8f6fd477 100644 --- a/resources/views/site/language.blade.php +++ b/resources/views/site/language.blade.php @@ -3,14 +3,16 @@ @section('section')
-

Language

+

{{__('site.language')}}


-
We’re still working on localization support!
-

Current Locale: {{App::getLocale()}}

-

Select from one of the supported languages:

+
{{__('site.l10nWip')}}!
+

{{__('site.currentLocale')}}: {{App::getLocale()}}

+

{{__('site.selectLocale')}}:

@endsection