/**
* Checks if a command requires HMAC protection based on ancillary data in the MDB.
*
* @param pc The prepared command
* @return true if the command should be protected with HMAC
*/
private boolean commandRequiresHmac(PreparedCommand pc) {
// Check for ancillary data flag in the command definition
String ancillaryValue = pc.getMetaCommand().getAncillaryData("HMAC");
if (ancillaryValue != null) {
// If the flag exists, check if it's set to true
return "true".equalsIgnoreCase(ancillaryValue) ||
"yes".equalsIgnoreCase(ancillaryValue) ||
"1".equals(ancillaryValue);
}
// If no flag is specified, default behavior (can be configured)
// Return false to require explicit opt-in, or true for opt-out behavior
return false;
}