In recent weeks, a number of U.S. visa and green-card holders have recounted harrowing ordeals at the hands of authorities.