issue-16: variable d'environnement transposées en configuration
Some checks failed
Cadoles/hydra-sql/pipeline/pr-develop There was a failure building this commit
Cadoles/hydra-sql/pipeline/head This commit is unstable

This commit is contained in:
2023-06-14 16:22:33 +02:00
parent ba63c271f9
commit 36aaacfe26
7 changed files with 33 additions and 14 deletions

View File

@ -19,11 +19,11 @@ class PasswordEncoder implements LegacyPasswordHasherInterface
protected array $hashAlgoLegacy;
protected array $securityPattern;
public function __construct(?string $pepper, string $hashAlgoLegacy, string $securityPattern)
public function __construct(?string $pepper, array $hashAlgoLegacy, array $securityPattern)
{
$this->pepper = $pepper;
$this->hashAlgoLegacy = explode(',', $hashAlgoLegacy);
$this->securityPattern = explode(',', $securityPattern);
$this->hashAlgoLegacy = $hashAlgoLegacy;
$this->securityPattern = $securityPattern;
}
/**
@ -90,7 +90,7 @@ class PasswordEncoder implements LegacyPasswordHasherInterface
];
foreach ($this->securityPattern as $term) {
if (self::PEPPER_PATTERN !== $term && self::PASSWORD_PATTERN !== $term && self::SALT_PATTERN !== $term) {
if (!isset($arrayRef[$term])) {
throw new InvalidSQLLoginConfigurationException();
}
}