It's a federal law. It's been legal since the constitution was written. There have been numerous court hearings stating it's legal.
You might want to reread the 4th again. The supreme court has ruled international boarder crossing as a reaonable search, thus no warrant, RAS, or PC needed.