Implement email blur

Signed-off-by: Vitor Mattos <vitor@php.rio>
This commit is contained in:
Vitor Mattos 2024-01-05 01:02:38 -03:00
parent b048c91620
commit 2135172aa9
No known key found for this signature in database
GPG key ID: B7AB4B76A7CA7318
3 changed files with 46 additions and 3 deletions

View file

@ -11,7 +11,8 @@
"pagerfanta/pagerfanta": "^3.6",
"smalot/pdfparser": "^2.4",
"symfony/console": "^5.4",
"tecnickcom/tcpdf": "^6.4"
"tecnickcom/tcpdf": "^6.4",
"wobeto/email-blur": "^1.0"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8",

42
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "9a4964d68f929a2d16fe32025a170fc5",
"content-hash": "e680dc2da1aee7d230b344aa0367ca37",
"packages": [
{
"name": "bacon/bacon-qr-code",
@ -1650,6 +1650,46 @@
}
],
"time": "2023-09-06T15:09:26+00:00"
},
{
"name": "wobeto/email-blur",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/fernandowobeto/email-blur.git",
"reference": "8b5dde08cad6655eeadb982fed3619d72cbc809d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fernandowobeto/email-blur/zipball/8b5dde08cad6655eeadb982fed3619d72cbc809d",
"reference": "8b5dde08cad6655eeadb982fed3619d72cbc809d",
"shasum": ""
},
"require-dev": {
"phpunit/phpunit": "^9.5"
},
"type": "library",
"autoload": {
"psr-4": {
"Wobeto\\EmailBlur\\": "Wobeto/EmailBlur/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fernando WObeto",
"email": "fernandowobeto@gmail.com"
}
],
"description": "A library to e-mail blur",
"support": {
"issues": "https://github.com/fernandowobeto/email-blur/issues",
"source": "https://github.com/fernandowobeto/email-blur/tree/1.0.0"
},
"time": "2021-06-05T01:11:18+00:00"
}
],
"packages-dev": [

View file

@ -41,6 +41,7 @@ use OCP\IConfig;
use OCP\IL10N;
use OCP\IUser;
use Psr\Log\LoggerInterface;
use Wobeto\EmailBlur\Blur;
abstract class AbstractIdentifyMethod implements IIdentifyMethod {
protected IdentifyMethod $entity;
@ -167,6 +168,7 @@ abstract class AbstractIdentifyMethod implements IIdentifyMethod {
]);
if ($lastActionDate + $renewalInterval < $now) {
$this->logger->debug('AbstractIdentifyMethod::throwIfRenewalIntervalExpired Exception');
$blur = new Blur($this->getEntity()->getIdentifierValue());
throw new LibresignException(json_encode([
'action' => JSActions::ACTION_RENEW_EMAIL,
// TRANSLATORS title that is displayed at screen to notify the signer that the link to sign the document expired
@ -176,7 +178,7 @@ abstract class AbstractIdentifyMethod implements IIdentifyMethod {
We will send a new link to the email %1$s.
Click below to receive the new link and be able to sign the document.
BODY,
[$this->getEntity()->getIdentifierValue()]
[$blur->make()]
),
'uuid' => $signRequest->getUuid(),
// TRANSLATORS Button to renew the link to sign the document. Renew is the action to generate a new sign link when the link expired.