IdentityAuditActorResolver
Rasuvaeff\Yii3McpAuditLogBridge\IdentityAuditActorResolver
Class — Rasuvaeff\Yii3McpAuditLogBridge — Source
Credits the authenticated user, taking the identity from rasuvaeff/yii3-mcp-rbac-bridge's IdentitySourceInterface — the same source its RBAC and session-binding interceptors use, so the audit trail and the access decision can never disagree about who is calling.
A guest call (no identity) falls back to the connection: type mcp-client, id = session id — exactly what ClientAuditActorResolver would have written, so a mixed authenticated/anonymous endpoint stays readable.
rasuvaeff/yii3-mcp-rbac-bridge is a suggest, not a hard dependency: install it and bind the resolver, or implement AuditActorResolverInterface against whatever identity the application already has.
Methods
resolve()
resolve(
Interceptor\ToolCallContext $context,
?string $sessionId,
?string $clientName,
): Rasuvaeff\Yii3AuditLog\AuditActor