Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
1 / 1 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | /** @license For full copyright and license information, please see the LICENSE.md file. */ |
| 6 | |
| 7 | namespace App\Core\Security\Csp; |
| 8 | |
| 9 | defined('AMMONLY_APP') || exit('Direct script access is forbidden.'); |
| 10 | |
| 11 | /** |
| 12 | * CSP Nonce Manager Interface. |
| 13 | * |
| 14 | * Provides per-request cryptographically secure 128-bit random nonces for CSP Level 3. |
| 15 | * |
| 16 | * @package App\Core\Security\Csp |
| 17 | */ |
| 18 | interface CspNonceManagerInterface |
| 19 | { |
| 20 | /** |
| 21 | * Gets the active cryptographically random nonce for the current request. |
| 22 | * |
| 23 | * @return string Base64-encoded nonce string. |
| 24 | */ |
| 25 | public function getNonce(): string; |
| 26 | |
| 27 | /** |
| 28 | * Regenerates a new nonce for a fresh request lifecycle. |
| 29 | * |
| 30 | * @return string Newly generated base64-encoded nonce string. |
| 31 | */ |
| 32 | public function regenerateNonce(): string; |
| 33 | } |