Skip to content

Commit

Permalink
master synced with v1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Spomky committed Aug 21, 2018
2 parents 3aa869b + ddb6b49 commit 237792f
Show file tree
Hide file tree
Showing 577 changed files with 10,749 additions and 10,883 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
.phpunit.result.cache
.travis/phar-private.pem
jose.phar
jose.phar.pubkey
Expand Down
34 changes: 32 additions & 2 deletions .gitsplit.yml
@@ -1,5 +1,3 @@
cache_dir: "/cache/gitsplit"

splits:
- prefix: "src/Component/Core"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-core.git"
Expand All @@ -15,6 +13,38 @@ splits:
target: "https://${GH_TOKEN}@github.com/web-token/jwt-console.git"
- prefix: "src/Bundle/JoseFramework"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-bundle.git"
- prefix: "src/EncryptionAlgorithm/ContentEncryption/AESCBC"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption-algorithm-aescbc.git"
- prefix: "src/EncryptionAlgorithm/ContentEncryption/AESGCM"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption-algorithm-aesgcm.git"
- prefix: "src/EncryptionAlgorithm/KeyEncryption/AESGCMKW"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption-algorithm-aesgcmkw.git"
- prefix: "src/EncryptionAlgorithm/KeyEncryption/AESKW"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption-algorithm-aeskw.git"
- prefix: "src/EncryptionAlgorithm/KeyEncryption/Direct"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption-algorithm-dir.git"
- prefix: "src/EncryptionAlgorithm/KeyEncryption/ECDHES"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption-algorithm-ecdh-es.git"
- prefix: "src/EncryptionAlgorithm/KeyEncryption/PBES2"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption-algorithm-pbes2.git"
- prefix: "src/EncryptionAlgorithm/KeyEncryption/RSA"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption-algorithm-rsa.git"
- prefix: "src/SignatureAlgorithm/ECDSA"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-signature-algorithm-ecdsa.git"
- prefix: "src/SignatureAlgorithm/EdDSA"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-signature-algorithm-eddsa.git"
- prefix: "src/SignatureAlgorithm/None"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-signature-algorithm-none.git"
- prefix: "src/SignatureAlgorithm/HMAC"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-signature-algorithm-hmac.git"
- prefix: "src/SignatureAlgorithm/RSA"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-signature-algorithm-rsa.git"
- prefix: "src/SignatureAlgorithm/Experimental"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-signature-algorithm-experimental.git"
- prefix: "src/EncryptionAlgorithm/Experimental"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-encryption-algorithm-experimental.git"
- prefix: "src/Ecc"
target: "https://${GH_TOKEN}@github.com/web-token/jwt-util-ecc.git"

origins:
- ^master$
Expand Down
62 changes: 62 additions & 0 deletions .php_cs.dist
@@ -0,0 +1,62 @@
<?php

$header = 'The MIT License (MIT)
Copyright (c) 2014-2018 Spomky-Labs
This software may be modified and distributed under the terms
of the MIT license. See the LICENSE file for details.';

$finder = PhpCsFixer\Finder::create()
->in(__DIR__.'/src')
->in(__DIR__.'/performance')
->in(__DIR__.'/tests')
;

return PhpCsFixer\Config::create()
->setRules([
'@PSR1' => true,
'@PSR2' => true,
'@Symfony' => true,
'@DoctrineAnnotation' => true,
'@PHP70Migration' => true,
'@PHP71Migration' => true,
'strict_param' => true,
'strict_comparison' => true,
'array_syntax' => ['syntax' => 'short'],
'array_indentation' => true,
'ordered_imports' => true,
'protected_to_private' => true,
'declare_strict_types' => true,
'native_function_invocation' => [
'include' => ['@compiler_optimized'],
'scope' => 'namespaced',
],
'mb_str_functions' => true,
'method_chaining_indentation' => true,
'linebreak_after_opening_tag' => true,
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'compact_nullable_typehint' => true,
'no_superfluous_phpdoc_tags' => true,
'no_superfluous_elseif' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'phpdoc_order' => true,
'pow_to_exponentiation' => true,
'simplified_null_return' => true,
'header_comment' => [
'header' => $header,
],
'align_multiline_comment' => [
'comment_type' => 'all_multiline',
],
'php_unit_test_annotation' => [
'case' => 'snake',
'style' => 'annotation',
],
'php_unit_test_case_static_method_calls' => true,
])
->setRiskyAllowed(true)
->setUsingCache(true)
->setFinder($finder)
;
6 changes: 5 additions & 1 deletion .travis.yml
Expand Up @@ -15,14 +15,18 @@ matrix:
- php: 7.1
env: deps=low
- php: 7.1
- php: nightly
emv: SYMFONY_DEPRECATIONS_HELPER=weak
- php: 7.2
emv: SYMFONY_DEPRECATIONS_HELPER=weak
- php: nightly
emv: SYMFONY_DEPRECATIONS_HELPER=weak

before_script:
- chmod +x ./tests/install_php_ext.sh
- if [ "$TRAVIS_PHP_VERSION" = '7.1' ]; then ./tests/install_php_ext.sh; fi
- composer self-update
- mkdir -p build/logs
- composer require --no-update --dev phpunit/phpunit:"^6.0|^7.0" phpstan/phpstan:"^0.9|^0.10"
- if [[ $deps = low ]]; then composer update --no-interaction --prefer-lowest ; fi
- if [[ !$deps ]]; then composer install --no-interaction ; fi

Expand Down
1 change: 0 additions & 1 deletion README.md
Expand Up @@ -9,7 +9,6 @@ If you really love that project, then you can help me out for a couple of :beers

[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/web-token/jwt-framework/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/web-token/jwt-framework/?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/web-token/jwt-framework/badge.svg?branch=master)](https://coveralls.io/github/web-token/jwt-framework?branch=master)
[![Dependency Status](https://beta.gemnasium.com/badges/github.com/web-token/jwt-framework.svg)](https://beta.gemnasium.com/projects/github.com/web-token/jwt-framework)

[![Build Status](https://travis-ci.org/web-token/jwt-framework.svg?branch=master)](https://travis-ci.org/web-token/jwt-framework)

Expand Down
80 changes: 61 additions & 19 deletions composer.json
Expand Up @@ -16,7 +16,34 @@
],
"autoload": {
"psr-4": {
"Jose\\": "src/"
"Jose\\": "src/",
"Jose\\Tests\\": "test/",
"Jose\\Component\\Signature\\Algorithm\\": [
"src/SignatureAlgorithm/ECDSA",
"src/SignatureAlgorithm/EdDSA",
"src/SignatureAlgorithm/HMAC",
"src/SignatureAlgorithm/None",
"src/SignatureAlgorithm/RSA",
"src/SignatureAlgorithm/Experimental"
],
"Jose\\Component\\Core\\Util\\Ecc\\": [
"src/Ecc"
],
"Jose\\Component\\Encryption\\Algorithm\\": [
"src/EncryptionAlgorithm/Experimental"
],
"Jose\\Component\\Encryption\\Algorithm\\KeyEncryption\\": [
"src/EncryptionAlgorithm/KeyEncryption/AESGCMKW",
"src/EncryptionAlgorithm/KeyEncryption/AESKW",
"src/EncryptionAlgorithm/KeyEncryption/Direct",
"src/EncryptionAlgorithm/KeyEncryption/ECDHES",
"src/EncryptionAlgorithm/KeyEncryption/PBES2",
"src/EncryptionAlgorithm/KeyEncryption/RSA"
],
"Jose\\Component\\Encryption\\Algorithm\\ContentEncryption\\": [
"src/EncryptionAlgorithm/ContentEncryption/AESGCM",
"src/EncryptionAlgorithm/ContentEncryption/AESCBC"
]
}
},
"autoload-dev": {
Expand All @@ -32,28 +59,27 @@
"lib-openssl": "*",
"fgrosse/phpasn1": "^2.0",
"paragonie/sodium_compat": "^1.2",
"spomky-labs/aes-key-wrap": "^4.0.1",
"spomky-labs/base64url": "^1.0",
"symfony/config": "^3.3|^4.0",
"symfony/console": "^3.3|^4.0",
"symfony/dependency-injection": "^3.3|^4.0",
"symfony/framework-bundle": "^3.3|^4.0",
"symfony/http-kernel": "^3.3|^4.0"
"spomky-labs/aes-key-wrap": "^4.0.1|^5.0",
"spomky-labs/base64url": "^1.0|^2.0",
"symfony/config": "^3.4|^4.0",
"symfony/console": "^3.4|^4.0",
"symfony/dependency-injection": "^3.4|^4.0",
"symfony/framework-bundle": "^3.4|^4.0",
"symfony/http-kernel": "^3.4|^4.0"
},
"require-dev": {
"ext-curl": "*",
"bjeavons/zxcvbn-php": "^0.3.0",
"bjeavons/zxcvbn-php": "^0.4.0",
"blackfire/php-sdk": "^1.14",
"guzzlehttp/psr7": "^1.4",
"matthiasnoback/symfony-config-test": "^3.1",
"matthiasnoback/symfony-config-test": "^3.1|^4.0",
"php-coveralls/php-coveralls": "^2.0",
"php-http/httplug-bundle": "^1.7",
"php-http/mock-client": "^1.0",
"phpstan/phpstan": "^0.9.2",
"phpunit/phpunit": "^6.0",
"satooshi/php-coveralls": "^1.0",
"symfony/browser-kit": "^3.3|^4.0",
"symfony/finder": "^3.3|^4.0",
"symfony/phpunit-bridge": "^3.3|^4.0",
"symfony/yaml": "^3.3|^4.0"
"symfony/browser-kit": "^3.4|^4.0",
"symfony/finder": "^3.4|^4.0",
"symfony/phpunit-bridge": "^3.4|^4.0",
"symfony/yaml": "^3.4|^4.0"
},
"replace": {
"web-token/jwt-core": "self.version",
Expand All @@ -62,7 +88,23 @@
"web-token/jwt-encryption": "self.version",
"web-token/jwt-key-mgmt": "self.version",
"web-token/jwt-console": "self.version",
"web-token/jwt-bundle": "self.version"
"web-token/jwt-bundle": "self.version",
"web-token/jwt-encryption-algorithm-aescbc": "self.version",
"web-token/jwt-encryption-algorithm-aesgcm": "self.version",
"web-token/jwt-encryption-algorithm-aesgcmkw": "self.version",
"web-token/jwt-encryption-algorithm-aeskw": "self.version",
"web-token/jwt-encryption-algorithm-dir": "self.version",
"web-token/jwt-encryption-algorithm-ecdh-es": "self.version",
"web-token/jwt-encryption-algorithm-pbes2": "self.version",
"web-token/jwt-encryption-algorithm-rsa": "self.version",
"web-token/jwt-signature-algorithm-ecdsa": "self.version",
"web-token/jwt-signature-algorithm-eddsa": "self.version",
"web-token/jwt-signature-algorithm-none": "self.version",
"web-token/jwt-signature-algorithm-hmac": "self.version",
"web-token/jwt-signature-algorithm-rsa": "self.version",
"web-token/jwt-util-ecc": "self.version",
"web-token/jwt-signature-algorithm-experimental": "self.version",
"web-token/jwt-encryption-algorithm-experimental": "self.version"
},
"suggest":{
"bjeavons/zxcvbn-php": "Adds key quality check for oct keys.",
Expand All @@ -72,7 +114,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
"dev-master": "1.2.x-dev"
}
},
"conflict": {
Expand Down
12 changes: 11 additions & 1 deletion infection.json.dist
Expand Up @@ -6,7 +6,17 @@
],
"exclude": [
"Bundle\/*\/Tests",
"Component\/*\/Tests"
"Component\/*\/Tests",
"Ecc\/*\/Tests",
"EncryptionAlgorithm\/ContentEncryption\/*\/Tests",
"EncryptionAlgorithm\/KeyEncryption\/*\/Tests",
"EncryptionAlgorithm\/Experimental\/*\/Tests",
"Signaturelgorithm\/ECDSA\/*\/Tests",
"Signaturelgorithm\/EdDSA\/*\/Tests",
"Signaturelgorithm\/HMAC\/*\/Tests",
"Signaturelgorithm\/None\/*\/Tests",
"Signaturelgorithm\/RSA\/*\/Tests",
"Signaturelgorithm\/Experimental\/*\/Tests"
]
},
"logs": {
Expand Down
45 changes: 16 additions & 29 deletions performance/JWE/A128GCMKWBench.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* The MIT License (MIT)
*
Expand All @@ -17,88 +19,73 @@
*/
final class A128GCMKWBench extends EncryptionBench
{
/**
* @return array
*/
public function dataHeadersAndAlgorithms(): array
{
return [
[
'shared_protected_header' => ['alg' => 'A128GCMKW', 'enc' => 'A128CBC-HS256'],
'shared_header' => [],
'recipient_header' => [],
'shared_header' => [],
'recipient_header' => [],
],
[
'shared_protected_header' => ['alg' => 'A128GCMKW', 'enc' => 'A192CBC-HS384'],
'shared_header' => [],
'recipient_header' => [],
'shared_header' => [],
'recipient_header' => [],
],
[
'shared_protected_header' => ['alg' => 'A128GCMKW', 'enc' => 'A256CBC-HS512'],
'shared_header' => [],
'recipient_header' => [],
'shared_header' => [],
'recipient_header' => [],
],
[
'shared_protected_header' => ['alg' => 'A128GCMKW', 'enc' => 'A128GCM'],
'shared_header' => [],
'recipient_header' => [],
'shared_header' => [],
'recipient_header' => [],
],
[
'shared_protected_header' => ['alg' => 'A128GCMKW', 'enc' => 'A192GCM'],
'shared_header' => [],
'recipient_header' => [],
'shared_header' => [],
'recipient_header' => [],
],
[
'shared_protected_header' => ['alg' => 'A128GCMKW', 'enc' => 'A256GCM'],
'shared_header' => [],
'recipient_header' => [],
'shared_header' => [],
'recipient_header' => [],
],
];
}

/**
* {@inheritdoc}
*/
protected function getAAD(): ?string
{
return 'A,B,C,D';
}

/**
* {@inheritdoc}
*/
public function dataInputs(): array
{
return [
['input' => '{"ciphertext":"crbOdBQqlc8WJZ9ZTb42xYoy2i5_KBoSOeJSg_6aeG0V1gxfVqe_AIkS9Nv8Vmil785R909ntom9Fo1GPZnt9mv-UfBeON7V1shRYjtOog6KouOvnA0YROvNr32AhE_tVrxzFyFVLRwJE0kfXvG29GhwTxhz2ugCqNZdIPJL5awM5BXosxlSiZRsHRMYSsULvfOTPqb2JkWbT1Z7bgCmm885-U01uaA","iv":"RUYx0bI8ywiHbgOI","tag":"rRPgmpp8UvOOhT_SVOGaIg","aad":"QSxCLEMsRA","protected":"eyJpdiI6Ikd4V1R2ZG96Zk1KZUcxQmMiLCJ0YWciOiJXYlM1Nk93NnUwUl9oZDZJQzZaZU9RIiwiYWxnIjoiQTEyOEdDTUtXIiwiZW5jIjoiQTI1NkdDTSJ9","encrypted_key":"r3zhEPolUXhQ0kHvg-wyxOYDDilfL4WJWAlfxlwIIm4"}'],
];
}

/**
* {@inheritdoc}
*/
public function dataPrivateKeys(): array
{
return [
[
'recipient_keys' => ['keys' => [[
'kty' => 'oct',
'k' => 'GZy6sIZ6wl9NJOKB-jnmVQ',
'k' => 'GZy6sIZ6wl9NJOKB-jnmVQ',
]]],
],
];
}

/**
* {@inheritdoc}
*/
public function dataRecipientPublicKeys(): array
{
return [
[
'recipient_key' => [
'kty' => 'oct',
'k' => 'GZy6sIZ6wl9NJOKB-jnmVQ',
'k' => 'GZy6sIZ6wl9NJOKB-jnmVQ',
],
],
];
Expand Down

0 comments on commit 237792f

Please sign in to comment.