update spomky-labs/otphp

This commit is contained in:
Mario
2024-09-30 07:11:05 +00:00
parent 5782a674b0
commit 3f411787c1
10 changed files with 57 additions and 58 deletions

22
composer.lock generated
View File

@@ -1972,16 +1972,16 @@
},
{
"name": "spomky-labs/otphp",
"version": "11.2.0",
"version": "11.2.2",
"source": {
"type": "git",
"url": "https://github.com/Spomky-Labs/otphp.git",
"reference": "9a1569038bb1c8e98040b14b8bcbba54f25e7795"
"reference": "b737d1c6330beae7c0bc225d3e848805b352fe42"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Spomky-Labs/otphp/zipball/9a1569038bb1c8e98040b14b8bcbba54f25e7795",
"reference": "9a1569038bb1c8e98040b14b8bcbba54f25e7795",
"url": "https://api.github.com/repos/Spomky-Labs/otphp/zipball/b737d1c6330beae7c0bc225d3e848805b352fe42",
"reference": "b737d1c6330beae7c0bc225d3e848805b352fe42",
"shasum": ""
},
"require": {
@@ -1991,17 +1991,17 @@
},
"require-dev": {
"ekino/phpstan-banned-code": "^1.0",
"infection/infection": "^0.26",
"infection/infection": "^0.26|^0.27|^0.28",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-strict-rules": "^1.0",
"phpunit/phpunit": "^9.5.26",
"phpunit/phpunit": "^9.5.26|^10.0|^11.0",
"qossmic/deptrac-shim": "^1.0",
"rector/rector": "^0.15",
"symfony/phpunit-bridge": "^6.1",
"symplify/easy-coding-standard": "^11.0"
"rector/rector": "1.0",
"symfony/phpunit-bridge": "^6.1|^7.0",
"symplify/easy-coding-standard": "^12.0"
},
"type": "library",
"autoload": {
@@ -2036,7 +2036,7 @@
],
"support": {
"issues": "https://github.com/Spomky-Labs/otphp/issues",
"source": "https://github.com/Spomky-Labs/otphp/tree/11.2.0"
"source": "https://github.com/Spomky-Labs/otphp/tree/11.2.2"
},
"funding": [
{
@@ -2048,7 +2048,7 @@
"type": "patreon"
}
],
"time": "2023-03-16T19:16:25+00:00"
"time": "2024-04-15T07:35:15+00:00"
},
{
"name": "stephenhill/base58",

View File

@@ -2045,17 +2045,17 @@
},
{
"name": "spomky-labs/otphp",
"version": "11.2.0",
"version_normalized": "11.2.0.0",
"version": "11.2.2",
"version_normalized": "11.2.2.0",
"source": {
"type": "git",
"url": "https://github.com/Spomky-Labs/otphp.git",
"reference": "9a1569038bb1c8e98040b14b8bcbba54f25e7795"
"reference": "b737d1c6330beae7c0bc225d3e848805b352fe42"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Spomky-Labs/otphp/zipball/9a1569038bb1c8e98040b14b8bcbba54f25e7795",
"reference": "9a1569038bb1c8e98040b14b8bcbba54f25e7795",
"url": "https://api.github.com/repos/Spomky-Labs/otphp/zipball/b737d1c6330beae7c0bc225d3e848805b352fe42",
"reference": "b737d1c6330beae7c0bc225d3e848805b352fe42",
"shasum": ""
},
"require": {
@@ -2065,19 +2065,19 @@
},
"require-dev": {
"ekino/phpstan-banned-code": "^1.0",
"infection/infection": "^0.26",
"infection/infection": "^0.26|^0.27|^0.28",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-strict-rules": "^1.0",
"phpunit/phpunit": "^9.5.26",
"phpunit/phpunit": "^9.5.26|^10.0|^11.0",
"qossmic/deptrac-shim": "^1.0",
"rector/rector": "^0.15",
"symfony/phpunit-bridge": "^6.1",
"symplify/easy-coding-standard": "^11.0"
"rector/rector": "1.0",
"symfony/phpunit-bridge": "^6.1|^7.0",
"symplify/easy-coding-standard": "^12.0"
},
"time": "2023-03-16T19:16:25+00:00",
"time": "2024-04-15T07:35:15+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -2112,7 +2112,7 @@
],
"support": {
"issues": "https://github.com/Spomky-Labs/otphp/issues",
"source": "https://github.com/Spomky-Labs/otphp/tree/11.2.0"
"source": "https://github.com/Spomky-Labs/otphp/tree/11.2.2"
},
"funding": [
{

View File

@@ -3,7 +3,7 @@
'name' => 'zotlabs/hubzilla',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => 'fc79e47d88f36709f680d2111035fd123203ce0b',
'reference' => '5782a674b0cb490f1e3544e5dcb0f7e969361df3',
'type' => 'application',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -278,9 +278,9 @@
'dev_requirement' => false,
),
'spomky-labs/otphp' => array(
'pretty_version' => '11.2.0',
'version' => '11.2.0.0',
'reference' => '9a1569038bb1c8e98040b14b8bcbba54f25e7795',
'pretty_version' => '11.2.2',
'version' => '11.2.2.0',
'reference' => 'b737d1c6330beae7c0bc225d3e848805b352fe42',
'type' => 'library',
'install_path' => __DIR__ . '/../spomky-labs/otphp',
'aliases' => array(),
@@ -349,7 +349,7 @@
'zotlabs/hubzilla' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => 'fc79e47d88f36709f680d2111035fd123203ce0b',
'reference' => '5782a674b0cb490f1e3544e5dcb0f7e969361df3',
'type' => 'application',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),

View File

@@ -2,6 +2,7 @@ TOTP / HOTP library in PHP
==========================
![Build Status](https://github.com/spomky-labs/otphp/workflows/Integrate/badge.svg)
![Build Status](https://github.com/spomky-labs/otphp/workflows/Infection/badge.svg)
[![Latest Stable Version](https://poser.pugx.org/spomky-labs/otphp/v/stable.png)](https://packagist.org/packages/spomky-labs/otphp)
[![Total Downloads](https://poser.pugx.org/spomky-labs/otphp/downloads.png)](https://packagist.org/packages/spomky-labs/otphp)

View File

@@ -22,17 +22,17 @@
},
"require-dev": {
"ekino/phpstan-banned-code": "^1.0",
"infection/infection": "^0.26",
"infection/infection": "^0.26|^0.27|^0.28",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-strict-rules": "^1.0",
"phpunit/phpunit": "^9.5.26",
"phpunit/phpunit": "^9.5.26|^10.0|^11.0",
"qossmic/deptrac-shim": "^1.0",
"rector/rector": "^0.15",
"symfony/phpunit-bridge": "^6.1",
"symplify/easy-coding-standard": "^11.0"
"rector/rector": "1.0",
"symfony/phpunit-bridge": "^6.1|^7.0",
"symplify/easy-coding-standard": "^12.0"
},
"autoload": {
"psr-4": { "OTPHP\\": "src/" }

View File

@@ -4,10 +4,10 @@ declare(strict_types=1);
namespace OTPHP;
use function assert;
use function count;
use InvalidArgumentException;
use Throwable;
use function assert;
use function count;
/**
* This class is used to load OTP object from a provisioning Uri.

View File

@@ -4,14 +4,14 @@ declare(strict_types=1);
namespace OTPHP;
use Exception;
use InvalidArgumentException;
use ParagonIE\ConstantTime\Base32;
use RuntimeException;
use function assert;
use function chr;
use function count;
use Exception;
use InvalidArgumentException;
use function is_string;
use ParagonIE\ConstantTime\Base32;
use RuntimeException;
use const STR_PAD_LEFT;
abstract class OTP implements OTPInterface
@@ -100,7 +100,7 @@ abstract class OTP implements OTPInterface
$this->hasColon($label) === false || throw new InvalidArgumentException('Label must not contain a colon.');
$options = [...$options, ...$this->getParameters()];
$this->filterOptions($options);
$params = str_replace(['+', '%7E'], ['%20', '~'], http_build_query($options));
$params = str_replace(['+', '%7E'], ['%20', '~'], http_build_query($options, '', '&'));
return sprintf(
'otpauth://%s/%s?%s',

View File

@@ -4,10 +4,10 @@ declare(strict_types=1);
namespace OTPHP;
use InvalidArgumentException;
use function array_key_exists;
use function assert;
use function in_array;
use InvalidArgumentException;
use function is_int;
use function is_string;

View File

@@ -4,8 +4,8 @@ declare(strict_types=1);
namespace OTPHP;
use function assert;
use InvalidArgumentException;
use function assert;
use function is_int;
/**
@@ -133,23 +133,21 @@ final class TOTP extends OTP implements TOTPInterface
*/
protected function getParameterMap(): array
{
return array_merge(
parent::getParameterMap(),
[
'period' => static function ($value): int {
(int) $value > 0 || throw new InvalidArgumentException('Period must be at least 1.');
return [
...parent::getParameterMap(),
'period' => static function ($value): int {
(int) $value > 0 || throw new InvalidArgumentException('Period must be at least 1.');
return (int) $value;
},
'epoch' => static function ($value): int {
(int) $value >= 0 || throw new InvalidArgumentException(
'Epoch must be greater than or equal to 0.'
);
return (int) $value;
},
'epoch' => static function ($value): int {
(int) $value >= 0 || throw new InvalidArgumentException(
'Epoch must be greater than or equal to 0.'
);
return (int) $value;
},
]
);
return (int) $value;
},
];
}
/**

View File

@@ -4,8 +4,8 @@ declare(strict_types=1);
namespace OTPHP;
use function array_key_exists;
use InvalidArgumentException;
use function array_key_exists;
use function is_string;
/**