Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
1 / 1
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3declare(strict_types=1);
4
5/** @license For full copyright and license information, please see the LICENSE.md file. */
6
7namespace App\Modules\Integrations\Domain\Contract;
8
9defined('AMMONLY_APP') || exit('Direct script access is forbidden.');
10
11/**
12 * Contract for breached / compromised password detection providers (HaveIBeenPwned, etc.).
13 *
14 * Implements NIST SP 800-63B and OWASP ASVS v5 requirements for password breach inspection.
15 */
16interface CompromisedPasswordProviderInterface
17{
18    /**
19     * Unique driver machine name matching driver in a_mod_integrations_records.
20     */
21    public function getDriver(): string;
22
23    /**
24     * Inspects whether the given password exists in known breach datasets.
25     *
26     * @param string               $password Plain text password candidate.
27     * @param string|null          $apiUrl   Optional API endpoint URL override.
28     * @param array<string, mixed> $config   Custom parameters from config_parameters JSON.
29     * @return bool True if password is known to be compromised, false otherwise.
30     */
31    public function isCompromised(string $password, ?string $apiUrl = null, array $config = []): bool;
32}