sign list of ids in better download list

This commit is contained in:
Spine
2024-09-22 09:01:50 +00:00
parent 2cb4d59f7f
commit bc0abd7d38
8 changed files with 70 additions and 30 deletions

View File

@@ -507,4 +507,15 @@ class UserTest extends TestCase {
$this->assertEquals(0, $rank->score(), 'userrank-score');
$this->assertEquals(1, $rank->rank('downloaded'), 'userrank-rank');
}
public function testUserHash(): void {
// ensure the same text hashed by two users is different
$second = \GazelleUnitTest\Helper::makeUser('user.' . randomString(6), 'user');
$this->assertNotEquals(
$this->user->hashHmac('topic', 'phpunit'),
$second->hashHmac('topic', 'phpunit'),
'user-hash-user-distinct'
);
$second->remove();
}
}