Texas’ attorney general threatened a lawsuit if the Trump administration does not end a federal program allowing work permits to undocumented immigrants.