Skip to content

Commit

Permalink
Fix wrong spelling in className
Browse files Browse the repository at this point in the history
While considered a BC break this class should not be catch-ed directly
  • Loading branch information
sstok committed Dec 22, 2023
1 parent 940e8f7 commit f71a97a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions Resources/translations/validators+intl-icu.en.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@
<source>it is known or suspected that aspects of the AA validated in the attribute certificate have been compromised.</source>
<target>it is known or suspected that aspects of the AA validated in the attribute certificate have been compromised.</target>
</trans-unit>

<trans-unit id="22">
<source>Too many CAs were provided. A maximum of 4 is accepted.</source>
<target>Too many CAs were provided. A maximum of 4 is accepted.</target>
</trans-unit>
</body>
</file>
</xliff>
4 changes: 2 additions & 2 deletions src/CAResolverImpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Rollerworks\Component\X509Validator;

use Rollerworks\Component\X509Validator\Violation\MissingCAExtension;
use Rollerworks\Component\X509Validator\Violation\ToManyCAsProvided;
use Rollerworks\Component\X509Validator\Violation\TooManyCAsProvided;
use Rollerworks\Component\X509Validator\Violation\UnableToResolveParent;

class CAResolverImpl implements CAResolver
Expand All @@ -36,7 +36,7 @@ public function resolve(string $certificate, array $caList): ?CA
// Safety check to prevent DoS attacks
// Normally only two parents are used, more than three is exceptional
if (\count($caList) > 4) {
throw new ToManyCAsProvided();
throw new TooManyCAsProvided();
}

$certData = $this->extractor->extractRawData($certificate, '', true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@

use Rollerworks\Component\X509Validator\Violation;

final class ToManyCAsProvided extends Violation
final class TooManyCAsProvided extends Violation
{
public function __construct()
{
parent::__construct('To many CAs were provided. A maximum of 3 is accepted.');
parent::__construct('Too many CAs were provided. A maximum of 4 is accepted.');
}

public function getTranslatorMsg(): string
{
return 'tls.violation.to_many_ca_provided';
return 'Too many CAs were provided. A maximum of 4 is accepted.';
}
}
4 changes: 2 additions & 2 deletions tests/CAResolverImplTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use Rollerworks\Component\X509Validator\CA;
use Rollerworks\Component\X509Validator\CAResolverImpl as CAResolver;
use Rollerworks\Component\X509Validator\Violation\MissingCAExtension;
use Rollerworks\Component\X509Validator\Violation\ToManyCAsProvided;
use Rollerworks\Component\X509Validator\Violation\TooManyCAsProvided;
use Rollerworks\Component\X509Validator\Violation\UnableToResolveParent;
use Rollerworks\Component\X509Validator\Violation\UnprocessablePEM;

Expand Down Expand Up @@ -98,7 +98,7 @@ public function it_fails_with_to_many_cas_provided(): void
{
$resolver = new CAResolver();

$this->expectException(ToManyCAsProvided::class);
$this->expectException(TooManyCAsProvided::class);

$resolver->resolve(
<<<'CERT'
Expand Down

0 comments on commit f71a97a

Please sign in to comment.