Australia has approved a law which gives federal government power to veto any agreement stuck between Australian state and foreign nations.