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

LibreSign / libresign / 21008830184

14 Jan 2026 08:29PM UTC coverage: 44.286%. First build
21008830184

Pull #6436

github

web-flow
Merge 4bec3de23 into 9bd4c65c5
Pull Request #6436: feat: async parallel signing

390 of 923 new or added lines in 41 files covered. (42.25%)

7007 of 15822 relevant lines covered (44.29%)

4.93 hits per line

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

91.67
/lib/Service/TsaValidationService.php
1
<?php
2

3
declare(strict_types=1);
4
/**
5
 * SPDX-FileCopyrightText: 2024 LibreCode coop and contributors
6
 * SPDX-License-Identifier: AGPL-3.0-or-later
7
 */
8

9
namespace OCA\Libresign\Service;
10

11
use OCA\Libresign\AppInfo\Application;
12
use OCA\Libresign\Exception\LibresignException;
13
use OCP\IAppConfig;
14

15
class TsaValidationService {
16
        public function __construct(
17
                private IAppConfig $appConfig,
18
        ) {
19
        }
53✔
20

21
        /**
22
         * Validate TSA configuration
23
         *
24
         * @throws LibresignException if TSA is misconfigured
25
         */
26
        public function validateConfiguration(): void {
27
                $tsaUrl = $this->appConfig->getValueString(Application::APP_ID, 'tsa_url', '');
6✔
28
                if (empty($tsaUrl)) {
6✔
29
                        // TSA not configured, nothing to validate
30
                        return;
1✔
31
                }
32

33
                // Basic URL validation
34
                if (!filter_var($tsaUrl, FILTER_VALIDATE_URL)) {
5✔
35
                        throw new LibresignException('Invalid TSA URL format: ' . $tsaUrl);
2✔
36
                }
37

38
                // Check if URL is reachable
39
                $tsaUrlParsed = parse_url($tsaUrl);
3✔
40
                if (!isset($tsaUrlParsed['host'])) {
3✔
NEW
41
                        throw new LibresignException('Invalid TSA URL: ' . $tsaUrl);
×
42
                }
43

44
                // Try to resolve hostname to detect DNS/connectivity issues early
45
                $host = (string)$tsaUrlParsed['host'];
3✔
46
                if (!@gethostbyname($host) || gethostbyname($host) === $host) {
3✔
47
                        // Could not resolve hostname
48
                        throw new LibresignException('Timestamp Authority (TSA) service is unavailable or misconfigured: ' . $tsaUrl);
1✔
49
                }
50
        }
51
}
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