mirror of
https://github.com/LibreSign/libresign.git
synced 2025-12-18 05:20:45 +01:00
fix: use enum
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
This commit is contained in:
parent
d725cc2a41
commit
d69708abdb
2 changed files with 4 additions and 2 deletions
|
|
@ -88,6 +88,7 @@ class Revoke extends Command {
|
||||||
}
|
}
|
||||||
|
|
||||||
$reason = CRLReason::from($reasonCode);
|
$reason = CRLReason::from($reasonCode);
|
||||||
|
assert($reason instanceof CRLReason);
|
||||||
$reasonDescription = $reason->getDescription();
|
$reasonDescription = $reason->getDescription();
|
||||||
|
|
||||||
$io->section('Revocation Details');
|
$io->section('Revocation Details');
|
||||||
|
|
@ -145,7 +146,7 @@ class Revoke extends Command {
|
||||||
try {
|
try {
|
||||||
$success = $this->crlService->revokeCertificate(
|
$success = $this->crlService->revokeCertificate(
|
||||||
$serialNumber,
|
$serialNumber,
|
||||||
$reason->value,
|
$reason,
|
||||||
$reasonText,
|
$reasonText,
|
||||||
'cli-admin'
|
'cli-admin'
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -111,6 +111,7 @@ class CrlApiController extends AEnvironmentAwareController {
|
||||||
'message' => "Invalid reason code: {$reasonCode}. Must be between 0-10 (excluding 7).",
|
'message' => "Invalid reason code: {$reasonCode}. Must be between 0-10 (excluding 7).",
|
||||||
], Http::STATUS_BAD_REQUEST);
|
], Http::STATUS_BAD_REQUEST);
|
||||||
}
|
}
|
||||||
|
assert($reason instanceof CRLReason);
|
||||||
|
|
||||||
$user = $this->userSession->getUser();
|
$user = $this->userSession->getUser();
|
||||||
$revokedBy = $user ? $user->getUID() : 'system';
|
$revokedBy = $user ? $user->getUID() : 'system';
|
||||||
|
|
@ -118,7 +119,7 @@ class CrlApiController extends AEnvironmentAwareController {
|
||||||
try {
|
try {
|
||||||
$success = $this->crlService->revokeCertificate(
|
$success = $this->crlService->revokeCertificate(
|
||||||
$serialNumber,
|
$serialNumber,
|
||||||
$reason->value,
|
$reason,
|
||||||
$reasonText,
|
$reasonText,
|
||||||
$revokedBy
|
$revokedBy
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue