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

LibreSign / libresign / 21479242301

29 Jan 2026 01:04PM UTC coverage: 46.511%. First build
21479242301

Pull #6635

github

web-flow
Merge 78e8c8e18 into 38508e87c
Pull Request #6635: feat: limit max upload files at api side

6 of 7 new or added lines in 1 file covered. (85.71%)

7859 of 16897 relevant lines covered (46.51%)

5.09 hits per line

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

96.43
/lib/Capabilities.php
1
<?php
2

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

9
namespace OCA\Libresign;
10

11
use OCA\Libresign\Service\Envelope\EnvelopeService;
12
use OCA\Libresign\Service\SignatureTextService;
13
use OCA\Libresign\Service\SignerElementsService;
14
use OCP\App\IAppManager;
15
use OCP\Capabilities\IPublicCapability;
16

17
/**
18
 * @psalm-import-type LibresignCapabilities from ResponseDefinitions
19
 */
20
class Capabilities implements IPublicCapability {
21
        public const FEATURES = [
22
                'customize-signature'
23
        ];
24

25
        public function __construct(
26
                protected SignerElementsService $signerElementsService,
27
                protected SignatureTextService $signatureTextService,
28
                protected IAppManager $appManager,
29
                protected EnvelopeService $envelopeService,
30
        ) {
31
        }
2✔
32

33
        /**
34
         * @return array{
35
         *      libresign?: LibresignCapabilities,
36
         * }
37
         */
38
        #[\Override]
39
        public function getCapabilities(): array {
40
                $capabilities = [
2✔
41
                        'features' => self::FEATURES,
2✔
42
                        'config' => [
2✔
43
                                'sign-elements' => [
2✔
44
                                        'is-available' => $this->signerElementsService->isSignElementsAvailable(),
2✔
45
                                        'can-create-signature' => $this->signerElementsService->canCreateSignature(),
2✔
46
                                        'full-signature-width' => $this->signatureTextService->getFullSignatureWidth(),
2✔
47
                                        'full-signature-height' => $this->signatureTextService->getFullSignatureHeight(),
2✔
48
                                        'signature-width' => $this->signatureTextService->getSignatureWidth(),
2✔
49
                                        'signature-height' => $this->signatureTextService->getSignatureHeight(),
2✔
50
                                ],
2✔
51
                                'envelope' => [
2✔
52
                                        'is-available' => $this->envelopeService->isEnabled(),
2✔
53
                                ],
2✔
54
                                'upload' => [
2✔
55
                                        'max-file-uploads' => $this->getMaxFileUploads(),
2✔
56
                                ],
2✔
57
                        ],
2✔
58
                        'version' => $this->appManager->getAppVersion('libresign'),
2✔
59
                ];
2✔
60

61
                return [
2✔
62
                        'libresign' => $capabilities,
2✔
63
                ];
2✔
64
        }
65

66
        private function getMaxFileUploads(): int {
67
                $maxFileUploads = ini_get('max_file_uploads');
2✔
68
                if (!is_numeric($maxFileUploads) || (int)$maxFileUploads <= 0) {
2✔
NEW
69
                        return 20;
×
70
                }
71
                return (int)$maxFileUploads;
2✔
72
        }
73
}
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