• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ericfortmeyer / activity-log / 20521974594

26 Dec 2025 11:53AM UTC coverage: 43.123% (-6.0%) from 49.13%
20521974594

push

github

web-flow
feat: add webhook for deployments (#63)

Signed-off-by: Eric Fortmeyer <e.fortmeyer01@gmail.com>

11 of 128 new or added lines in 13 files covered. (8.59%)

1 existing line in 1 file now uncovered.

348 of 807 relevant lines covered (43.12%)

1.33 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

63.64
/src/Utils/Hasher.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace EricFortmeyer\ActivityLog\Utils;
6

7
use SensitiveParameter;
8

9
use function sodium_bin2hex;
10
use function sodium_crypto_generichash;
11

12
use const SODIUM_CRYPTO_GENERICHASH_BYTES_MIN;
13

14
readonly class Hasher
15
{
16
    public function __construct(
17
        #[SensitiveParameter]
18
        private string $hashingKey,
19
        #[SensitiveParameter]
20
        private string $signingKey,
21
    ) {}
2✔
22

23
    public function hash(
24
        string $value
25
    ): string {
26
        return sodium_bin2hex(
2✔
27
            $this->hashingKey !== ""
2✔
28
                ?
2✔
29
                sodium_crypto_generichash(
1✔
30
                    message: $value,
1✔
31
                    key: $this->hashingKey,
1✔
32
                    length: SODIUM_CRYPTO_GENERICHASH_BYTES_MIN,
1✔
33
                ) :
1✔
34
                sodium_crypto_generichash(
2✔
35
                    message: $value,
2✔
36
                    length: SODIUM_CRYPTO_GENERICHASH_BYTES_MIN,
2✔
37
                )
2✔
38
        );
2✔
39
    }
40

41
    public function verify(
42
        string $data,
43
        string $signature,
44
    ): bool {
NEW
45
        return hash_equals(
×
NEW
46
            hash_hmac(
×
NEW
47
                "sha256",
×
NEW
48
                $data,
×
NEW
49
                $this->signingKey,
×
NEW
50
            ),
×
NEW
51
            $signature,
×
NEW
52
        );
×
53
    }
54
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc