Skip to content

Commit

Permalink
Merge pull request #17 from jrushlow/remove/get-signature-lifetime
Browse files Browse the repository at this point in the history
removed helper method to get the expected lifetime of a signature
  • Loading branch information
jrushlow committed May 15, 2020
2 parents 8582be5 + 13f3c53 commit c708640
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 20 deletions.
8 changes: 0 additions & 8 deletions src/VerifyEmailHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,4 @@ public function isSignedUrlValid(string $signedUrl, string $userId, string $user

return $this->uriSigner->check($signedUrl);
}

/**
* {@inheritdoc}
*/
public function getSignatureLifetime(): int
{
return $this->lifetime;
}
}
7 changes: 1 addition & 6 deletions src/VerifyEmailHelperInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface VerifyEmailHelperInterface
* @param string $userEmail the email that is being verified
* @param array $extraParams any additional parameters (route wildcards or query parameters)
* that will be used when generating the route for
* signed URL.
* signed URL
*/
public function generateSignature(string $routeName, string $userId, string $userEmail, array $extraParams = []): VerifyEmailSignatureComponents;

Expand Down Expand Up @@ -57,9 +57,4 @@ public function generateSignature(string $routeName, string $userId, string $use
* @throws ExpiredSignatureException
*/
public function isSignedUrlValid(string $signedUrl, string $userId, string $userEmail): bool;

/**
* Get the length of time in seconds that a signed uri is valid.
*/
public function getSignatureLifetime(): int;
}
6 changes: 0 additions & 6 deletions tests/UnitTests/VerifyEmailHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,6 @@ public function testExceptionThrownWithExpiredSignature(): void
$helper->isSignedUrlValid($signature, '1234', 'jr@rushlow.dev');
}

public function testGetLifetimeReturnsIntFromLifetimeProperty(): void
{
$helper = $this->getHelper();
self::assertSame(3600, $helper->getSignatureLifetime());
}

private function getHelper(): VerifyEmailHelperInterface
{
return new VerifyEmailHelper($this->mockRouter, $this->mockSigner, $this->mockQueryUtility, $this->tokenGenerator, 3600);
Expand Down

0 comments on commit c708640

Please sign in to comment.