cockpitTargetRefMatches function
Whether ref identifies registrationId by token prefix.
Implementation
bool cockpitTargetRefMatches(String registrationId, String ref) {
final normalized = ref.trim().toLowerCase();
return normalized.length >= cockpitTargetRefMinimumLength &&
cockpitTargetRefToken(registrationId).startsWith(normalized);
}