Skip to content

IdentityAuditActorResolver

Rasuvaeff\Yii3McpAuditLogBridge\IdentityAuditActorResolver

ClassRasuvaeff\Yii3McpAuditLogBridgeSource

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()

php
resolve(
    Interceptor\ToolCallContext $context,
    ?string $sessionId,
    ?string $clientName,
): Rasuvaeff\Yii3AuditLog\AuditActor