feat(iam): add guarded identity management and ERP launch source

This commit is contained in:
2026-10-29 17:34:55 +08:00
parent bcd42a5c39
commit dcb0db8275
26 changed files with 1827 additions and 5 deletions
@@ -36,6 +36,10 @@ final class IamAccountProvisioner
public function resolve(IamOidcClient $client, array $config, string $subject): int
{
if (\app\adminapi\service\iam\v2\IamV2Client::enabled()) {
$tombstone = Db::name('iam_v2_binding')->where('subject', $subject)->where('state', 'revoked')->find();
if ($tombstone) { throw new RuntimeException('IAM_BINDING_REVOKED'); }
}
$context = $client->provisioning($subject);
self::validateContext($context, $subject, $config['application_id']);
if (($context['shouldCreateLocalAccount'] ?? null) !== true) {