How did officials justify such snooping? By asserting in an FBI affidavit, according to The Post, that Rosen broke the law “at the very least, either as an aider, abettor and/or co-conspirator.”

In other words, since there is no law that makes publishing this classified information illegal, the Justice Department claims that obtaining the information was a violation of the Espionage Act.

Rosen has not been charged. Every investigative reporter, however, has been put on notice.

If this had been the view of prior administrations, surely Bob Woodward would be a lifer in some federal prison. The cell next door might be occupied by my Post colleague Dana Priest, who disclosed the CIA’s network of secret prisons. Or by the New York Times’ James Risen and Eric Lichtblau, who revealed the National Security Agency’s eavesdropping program.

A federal “shield” law protecting reporters from having to divulge their sources means nothing if it includes an exception for cases involving national security, as Obama favors. The president needs to understand that behavior commonly known as “whistleblowing” and “journalism” must not be construed as espionage.