mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 01:35:12 +00:00
report test warnings
This commit is contained in:
parent
d7b3af5810
commit
a03e422547
5 changed files with 12 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" bootstrap="tests/bootstrap.php" executionOrder="depends,defects" beStrictAboutOutputDuringTests="true" failOnRisky="true" failOnWarning="true" cacheDirectory=".phpunit.cache" requireCoverageMetadata="false" beStrictAboutCoverageMetadata="true">
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" bootstrap="tests/bootstrap.php" executionOrder="depends,defects" beStrictAboutOutputDuringTests="true" failOnRisky="true" failOnWarning="true" displayDetailsOnTestsThatTriggerWarnings="true" cacheDirectory=".phpunit.cache" requireCoverageMetadata="false" beStrictAboutCoverageMetadata="true">
|
||||
<testsuites>
|
||||
<testsuite name="default">
|
||||
<directory>tests</directory>
|
||||
|
|
|
@ -2075,6 +2075,13 @@ class Channel
|
|||
return self::getDid($channel) . '/actor';
|
||||
}
|
||||
|
||||
public static function getVerifier($channel)
|
||||
{
|
||||
$pubkey = (new Multibase())->publicKey($channel['channel_epubkey']);
|
||||
$nomadic = PConfig::Get($channel['channel_id'], 'system', 'nomadicAP');
|
||||
return (($nomadic) ? Channel::getDidResolver($channel) . '/actor' : Channel::url($channel) . '#' . $pubkey);
|
||||
}
|
||||
|
||||
public static function getDidResolver($channel)
|
||||
{
|
||||
return z_root() . '/.well-known/apresolver/' . self::getDid($channel);
|
||||
|
|
|
@ -16,14 +16,12 @@ class JcsEddsa2022
|
|||
public function sign($data, $channel): array
|
||||
{
|
||||
unset($data['proof']); // Discard any pre-existing signature if it exists
|
||||
$nomadic = (int) PConfig::Get($channel['channel_id'], 'system', 'nomadicAP');
|
||||
|
||||
$pubkey = (new Multibase())->publicKey($channel['channel_epubkey']);
|
||||
$options = [
|
||||
'type' => 'DataIntegrityProof',
|
||||
'cryptosuite' => 'eddsa-jcs-2022',
|
||||
'created' => Time::convert(format: ISO8601),
|
||||
'verificationMethod' => (($nomadic) ? Channel::getDidResolver($channel) . '/actor' : Channel::url($channel) . '#' . $pubkey),
|
||||
'verificationMethod' => Channel::getVerifier($channel),
|
||||
'proofPurpose' => 'assertionMethod',
|
||||
];
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" bootstrap="bootstrap.php" executionOrder="depends,defects" beStrictAboutOutputDuringTests="true" failOnRisky="true" failOnWarning="true" cacheDirectory=".phpunit.cache" requireCoverageMetadata="false" beStrictAboutCoverageMetadata="true">
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" bootstrap="bootstrap.php" executionOrder="depends,defects" beStrictAboutOutputDuringTests="true" failOnRisky="true" failOnWarning="true" displayDetailsOnTestsThatTriggerWarnings="true" cacheDirectory=".phpunit.cache" requireCoverageMetadata="false" beStrictAboutCoverageMetadata="true">
|
||||
<testsuites>
|
||||
<testsuite name="default">
|
||||
<directory>../tests</directory>
|
||||
|
|
|
@ -4,6 +4,7 @@ namespace Code\Tests\Unit\Lib;
|
|||
|
||||
use Code\Lib\Activity;
|
||||
use Code\Lib\JcsEddsa2022;
|
||||
use Code\Lib\PConfig;
|
||||
use Code\Tests\Unit\UnitTestCase;
|
||||
|
||||
class JcsEddsa2022Test extends UnitTestCase
|
||||
|
@ -51,6 +52,7 @@ class JcsEddsa2022Test extends UnitTestCase
|
|||
{
|
||||
$publicKey = 'z6MkfpucGTDbMZADwM6vEa8pS3s8Z9xqSEn6HihijZ4fVs9d';
|
||||
$channel = [
|
||||
'channel_id' => 1,
|
||||
'channel_url' => 'https://example.com/channel/klingon',
|
||||
'channel_epubkey' => 'FGdbYgr526Swuyya3e8epCBdHahlWNg9I0sBhMKCzpw',
|
||||
'channel_eprvkey' => 'StLRo8xb7VJ5XdR10OUYQM/uooP7D7fMlgvQFa1wrZIUZ1tiCvnbpLC7LJrd7x6kIF0dqGVY2D0jSwGEwoLOnA',
|
||||
|
|
Loading…
Reference in a new issue