fix(iam): align cross-app proofs and add native IAM target launch

This commit is contained in:
2026-10-29 18:49:32 +08:00
parent dcb0db8275
commit 7cbc679287
25 changed files with 837 additions and 99 deletions
@@ -36,15 +36,16 @@ 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) {
return IamLoginService::boundAdminId($context, $subject, $config['application_id']);
}
// A local tombstone blocks auto-creation, not an explicitly reviewed newer central binding.
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'); }
}
if (($context['externalAccountId'] ?? null) !== '') {
throw new RuntimeException('统一账号绑定状态不一致');
}