private String getCurrentPrincipal(final ProceedingJoinPoint joinPoint, final Audits audits, final Object retVal) {
        String currentPrincipal = null;
        for (var i = 0; i < audits.value().length; i++) {
            var resolverName = audits.value()[i].principalResolverName();
            if (!resolverName.trim().isEmpty()) {
                val resolver = this.auditPrincipalResolvers.get(resolverName);
                currentPrincipal = resolver.resolveFrom(joinPoint, retVal);
            }
        }

        if (currentPrincipal == null) {
            currentPrincipal = this.defaultAuditPrincipalResolver.resolveFrom(joinPoint, retVal);
        }
        return currentPrincipal;
    }
Handle audit trail.

@param joinPoint the join point
@param audit     the audit
@return the object
@throws Throwable the throwable
core/cas-server-core-audit-api/src/main/java/org/apereo/inspektr/audit/AuditTrailManagementAspect.java