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
@@ -14,6 +14,13 @@ final class IamOidcClient
private array $config;
private $transport;
private ?array $discovery = null;
private ?string $verifiedToken = null;
public function verifiedIdToken(): string
{
if ($this->verifiedToken === null) { throw new RuntimeException("IAM token not verified"); }
return $this->verifiedToken;
}
/** Transport signature: (method, url, headers, body): ['status'=>int, 'body'=>string]. */
public function __construct(array $config, ?callable $transport = null)
@@ -102,6 +109,7 @@ final class IamOidcClient
|| (isset($claims['nbf']) && (!is_int($claims['nbf']) || $claims['nbf'] > $now))) {
throw new RuntimeException('IAM ID token claims are invalid');
}
$this->verifiedToken = $response['id_token'];
return $claims;
}