Vendor JWT dependency.
This allows having other apps provide a global "JWT" which then will not conflict with the "JWT" in this app.
This commit is contained in:
parent
0f974ecf17
commit
09e38bde61
13 changed files with 2436 additions and 23 deletions
18
.github/dependabot.yml
vendored
18
.github/dependabot.yml
vendored
|
|
@ -1,5 +1,23 @@
|
||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
|
- package-ecosystem: composer
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
day: saturday
|
||||||
|
time: "03:00"
|
||||||
|
timezone: Europe/Berlin
|
||||||
|
open-pull-requests-limit: 10
|
||||||
|
|
||||||
|
- package-ecosystem: composer
|
||||||
|
directory: "/vendor-bin/mozart"
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
day: saturday
|
||||||
|
time: "03:00"
|
||||||
|
timezone: Europe/Berlin
|
||||||
|
open-pull-requests-limit: 10
|
||||||
|
|
||||||
- package-ecosystem: npm
|
- package-ecosystem: npm
|
||||||
directory: /
|
directory: /
|
||||||
schedule:
|
schedule:
|
||||||
|
|
|
||||||
43
.github/workflows/composer.yml
vendored
Normal file
43
.github/workflows/composer.yml
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
name: Composer
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- '.github/workflows/composer.yml'
|
||||||
|
- 'composer.json'
|
||||||
|
- 'composer.lock'
|
||||||
|
- 'vendor-bin/**/composer.json'
|
||||||
|
- 'vendor-bin/**/composer.lock'
|
||||||
|
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- stable*
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
# do not stop on another job's failure
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
php-versions: ['7.4']
|
||||||
|
|
||||||
|
name: php${{ matrix.php-versions }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up php ${{ matrix.php-versions }}
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
coverage: none
|
||||||
|
|
||||||
|
- name: Install dependencies & build
|
||||||
|
run: composer i
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -2,6 +2,10 @@
|
||||||
3rdparty/pdfjs/
|
3rdparty/pdfjs/
|
||||||
build/
|
build/
|
||||||
js/
|
js/
|
||||||
|
lib/Vendor/
|
||||||
|
vendor/
|
||||||
|
|
||||||
|
composer.phar
|
||||||
server/config.js
|
server/config.js
|
||||||
server/docker-compose.yml
|
server/docker-compose.yml
|
||||||
translationtool.phar
|
translationtool.phar
|
||||||
|
|
|
||||||
3
.gitmodules
vendored
3
.gitmodules
vendored
|
|
@ -1,3 +0,0 @@
|
||||||
[submodule "3rdparty/php-jwt"]
|
|
||||||
path = 3rdparty/php-jwt
|
|
||||||
url = https://github.com/firebase/php-jwt.git
|
|
||||||
1
3rdparty/php-jwt
vendored
1
3rdparty/php-jwt
vendored
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit d28e6df83830252650da4623c78aaaf98fb385f3
|
|
||||||
10
Makefile
10
Makefile
|
|
@ -56,6 +56,8 @@ appstore: clean build
|
||||||
mkdir -p $(sign_dir)
|
mkdir -p $(sign_dir)
|
||||||
rsync -a \
|
rsync -a \
|
||||||
--exclude=/build \
|
--exclude=/build \
|
||||||
|
--exclude=composer.json \
|
||||||
|
--exclude=composer.lock \
|
||||||
--exclude=.eslintignore \
|
--exclude=.eslintignore \
|
||||||
--exclude=.eslintrc.yml \
|
--exclude=.eslintrc.yml \
|
||||||
--exclude=.git \
|
--exclude=.git \
|
||||||
|
|
@ -64,10 +66,18 @@ appstore: clean build
|
||||||
--exclude=.gitmodules \
|
--exclude=.gitmodules \
|
||||||
--exclude=Makefile \
|
--exclude=Makefile \
|
||||||
--exclude=node_modules \
|
--exclude=node_modules \
|
||||||
|
--exclude=package.json \
|
||||||
|
--exclude=package-lock.json \
|
||||||
--exclude=src \
|
--exclude=src \
|
||||||
--exclude=run-*lint.sh \
|
--exclude=run-*lint.sh \
|
||||||
--exclude=.stylelintrc \
|
--exclude=.stylelintrc \
|
||||||
|
--exclude=.tx \
|
||||||
|
--exclude=.l10nignore \
|
||||||
|
--exclude=translationfiles \
|
||||||
--exclude=vendors*js \
|
--exclude=vendors*js \
|
||||||
|
--exclude=vendor \
|
||||||
|
--exclude=vendor-bin \
|
||||||
|
--exclude=webpack.js \
|
||||||
$(project_dir)/ \
|
$(project_dir)/ \
|
||||||
$(sign_dir)/$(app_name)
|
$(sign_dir)/$(app_name)
|
||||||
@if [ -f $(cert_dir)/$(app_name).key ]; then \
|
@if [ -f $(cert_dir)/$(app_name).key ]; then \
|
||||||
|
|
|
||||||
|
|
@ -41,18 +41,5 @@ if (class_exists('\\OCP\\AppFramework\\Http\\EmptyContentSecurityPolicy')) {
|
||||||
return new Capabilities();
|
return new Capabilities();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!class_exists('\\Firebase\\JWT\\BeforeValidException')) {
|
// Register the composer autoloader for packages shipped by this app
|
||||||
require_once __DIR__ . "/../3rdparty/php-jwt/src/BeforeValidException.php";
|
include_once __DIR__ . '/../lib/vendor/autoload.php';
|
||||||
}
|
|
||||||
if (!class_exists('\\Firebase\\JWT\\ExpiredException')) {
|
|
||||||
require_once __DIR__ . "/../3rdparty/php-jwt/src/ExpiredException.php";
|
|
||||||
}
|
|
||||||
if (!class_exists('\\Firebase\\JWT\\SignatureInvalidException')) {
|
|
||||||
require_once __DIR__ . "/../3rdparty/php-jwt/src/SignatureInvalidException.php";
|
|
||||||
}
|
|
||||||
if (!class_exists('\\Firebase\\JWT\\JWT')) {
|
|
||||||
require_once __DIR__ . "/../3rdparty/php-jwt/src/JWT.php";
|
|
||||||
}
|
|
||||||
if (!class_exists('\\Firebase\\JWT\\Key')) {
|
|
||||||
require_once __DIR__ . "/../3rdparty/php-jwt/src/Key.php";
|
|
||||||
}
|
|
||||||
|
|
|
||||||
63
composer.json
Normal file
63
composer.json
Normal file
|
|
@ -0,0 +1,63 @@
|
||||||
|
{
|
||||||
|
"autoload-dev": {
|
||||||
|
"psr-4": {
|
||||||
|
"OCP\\": "vendor/nextcloud/ocp/OCP"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"OCA\\Pdfdraw\\": "lib/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"config": {
|
||||||
|
"allow-plugins": {
|
||||||
|
"bamarni/composer-bin-plugin": true
|
||||||
|
},
|
||||||
|
"autoloader-suffix": "Pdfdraw",
|
||||||
|
"classmap-authoritative": true,
|
||||||
|
"optimize-autoloader": true,
|
||||||
|
"platform": {
|
||||||
|
"php": "7.4"
|
||||||
|
},
|
||||||
|
"sort-packages": true
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"cs:check": "php-cs-fixer fix --dry-run --diff",
|
||||||
|
"cs:fix": "php-cs-fixer fix",
|
||||||
|
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './vendor-bin/*' -not -path './lib/Vendor/*' -not -path './build/*' -not -path './tests/integration/vendor/*' -print0 | xargs -0 -n1 php -l",
|
||||||
|
"psalm": "psalm --threads=1",
|
||||||
|
"psalm:update-baseline": "psalm --threads=1 --update-baseline --set-baseline=tests/psalm-baseline.xml",
|
||||||
|
"psalm:clear": "psalm --clear-cache && psalm --clear-global-cache",
|
||||||
|
"psalm:fix": "psalm --alter --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType",
|
||||||
|
"post-install-cmd": [
|
||||||
|
"@composer bin all install --ansi",
|
||||||
|
"\"vendor/bin/mozart\" compose",
|
||||||
|
"composer dump-autoload"
|
||||||
|
],
|
||||||
|
"post-update-cmd": [
|
||||||
|
"@composer bin all update --ansi",
|
||||||
|
"\"vendor/bin/mozart\" compose",
|
||||||
|
"composer dump-autoload"
|
||||||
|
],
|
||||||
|
"test": "cd tests/php/ && phpunit -c phpunit.xml"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"nextcloud/ocp": "dev-stable25",
|
||||||
|
"roave/security-advisories": "dev-latest"
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"bamarni/composer-bin-plugin": "^1.8",
|
||||||
|
"firebase/php-jwt": "^6.3"
|
||||||
|
},
|
||||||
|
"extra": {
|
||||||
|
"mozart": {
|
||||||
|
"dep_namespace": "OCA\\Pdfdraw\\Vendor\\",
|
||||||
|
"dep_directory": "/lib/Vendor/",
|
||||||
|
"classmap_directory": "/lib/autoload/",
|
||||||
|
"classmap_prefix": "PDFDRAW_",
|
||||||
|
"packages": [
|
||||||
|
"firebase/php-jwt"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
1113
composer.lock
generated
Normal file
1113
composer.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -24,8 +24,8 @@ declare(strict_types=1);
|
||||||
namespace OCA\Pdfdraw\Controller;
|
namespace OCA\Pdfdraw\Controller;
|
||||||
|
|
||||||
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
|
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
|
||||||
use \Firebase\JWT\JWT;
|
use OCA\Pdfdraw\Vendor\Firebase\JWT\JWT;
|
||||||
use \Firebase\JWT\Key;
|
use OCA\Pdfdraw\Vendor\Firebase\JWT\Key;
|
||||||
use OC\Files\Filesystem;
|
use OC\Files\Filesystem;
|
||||||
use OCP\AppFramework\Http;
|
use OCP\AppFramework\Http;
|
||||||
use OCP\AppFramework\Http\DataDownloadResponse;
|
use OCP\AppFramework\Http\DataDownloadResponse;
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,8 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace OCA\Pdfdraw\Controller;
|
namespace OCA\Pdfdraw\Controller;
|
||||||
|
|
||||||
use \Firebase\JWT\JWT;
|
use OCA\Pdfdraw\Vendor\Firebase\JWT\JWT;
|
||||||
use \Firebase\JWT\Key;
|
use OCA\Pdfdraw\Vendor\Firebase\JWT\Key;
|
||||||
use OCP\AppFramework\Controller;
|
use OCP\AppFramework\Controller;
|
||||||
use OCP\AppFramework\Http;
|
use OCP\AppFramework\Http;
|
||||||
use OCP\AppFramework\Http\ContentSecurityPolicy;
|
use OCP\AppFramework\Http\ContentSecurityPolicy;
|
||||||
|
|
|
||||||
11
vendor-bin/mozart/composer.json
Normal file
11
vendor-bin/mozart/composer.json
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"config": {
|
||||||
|
"platform": {
|
||||||
|
"php": "7.4"
|
||||||
|
},
|
||||||
|
"sort-packages": true
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"coenjacobs/mozart": "^0.7.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
1168
vendor-bin/mozart/composer.lock
generated
Normal file
1168
vendor-bin/mozart/composer.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue