feat: integrate ZYT admin with IAM Hub

This commit is contained in:
2026-09-08 13:26:41 +08:00
parent cf3fbdc5ef
commit a5f4c4472d
856 changed files with 3585 additions and 2371 deletions
@@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
namespace app\adminapi\controller;
use app\common\service\iam\IamHubException;
use app\common\service\iam\IamRevocationService;
use think\facade\Log;
class IamController extends BaseAdminController
{
public array $notNeedLogin = ['revocation'];
public function revocation()
{
try {
(new IamRevocationService())->apply(
(string) $this->request->getContent(),
(string) $this->request->header('X-IAM-Signature', ''),
(string) $this->request->header('X-IAM-Event-ID', '')
);
return response('', 204);
} catch (IamHubException $error) {
return json([
'code' => 0,
'show' => 0,
'msg' => $error->getMessage(),
'data' => [],
], $error->httpStatus());
} catch (\Throwable $error) {
Log::error('IAM Hub revocation failed: ' . get_class($error));
return json([
'code' => 0,
'show' => 0,
'msg' => 'IAM Hub revocation failed',
'data' => [],
], 500);
}
}
}