Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
RequireParticipantUuid
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 3
12
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 skipIfAuthenticated
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 allowIdDocs
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3declare(strict_types=1);
4/**
5 * SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
6 * SPDX-License-Identifier: AGPL-3.0-or-later
7 */
8
9namespace OCA\Libresign\Middleware\Attribute;
10
11use Attribute;
12
13/**
14 * Authorize any participant UUID (signer or observer) for read-only access.
15 *
16 * Use this for document/PDF viewing. Signing and other write endpoints must keep
17 * {@see RequireSignRequestUuid}, which rejects observers.
18 */
19#[Attribute(Attribute::TARGET_METHOD)]
20class RequireParticipantUuid {
21    public function __construct(
22        protected bool $skipIfAuthenticated = false,
23        protected bool $allowIdDocs = false,
24    ) {
25    }
26
27    public function skipIfAuthenticated(): bool {
28        return $this->skipIfAuthenticated;
29    }
30
31    public function allowIdDocs(): bool {
32        return $this->allowIdDocs;
33    }
34}