Editor's Note: (Yashar Ali is a contributor to HuffPost and New York Magazine. Follow him @yashar. The opinions expressed in this commentary are solely those of the author. View more opinion articles at CNN. )

(CNN) On May 10, San Francisco police officers carrying a sledge hammer, and with their guns drawn, raided the home of a journalist named Bryan Carmody. They handcuffed him for six hours and seized tens of thousands of dollars of his equipment along with his confidential work material. They had one goal: to learn who had leaked a police report to him about the death of longtime San Francisco public defender Jeffrey Adachi.

Carmody had refused weeks earlier to reveal his source to the police department's internal affairs division. Because he had promised the source confidentiality, he was ethically bound to keep that pledge. Journalists protect their sources with virtually no exceptions, even if it means going to prison.

The San Francisco raid was a stunning intrusion on press freedom, similar to what we see in autocratic regimes. Legal experts believe it is also a violation of the California shield law, which protects journalists from being forced to reveal confidential sources. What happened Friday threatens to have a chilling effect on confidential sources who share critical, newsworthy information with reporters.

This story has received national press attention but not enough public outrage. It is essentially seen as a local story about a local politician.

But what the San Francisco Police Department did was unconscionable. And they did it with the consent of two San Francisco Superior Court judges, Victor Hwang and Gail Dekreon, who signed the warrant. There had been some speculation that the judges had not been told that Carmody was a journalist protected by California's shield law, but according to San Francisco Supervisor Sandra Fewer, quoted in the San Francisco Examiner, Police Chief William Scott told her that the judges knew Carmody was a credentialed member of the media. In fact, Carmody has a press pass issued by the San Francisco Police Department, which is not easy to obtain. The details of the warrant and what information the Police Department learned from the raid remain under seal.

Disclosure: I once served as Deputy Chief of Staff to Mayor Gavin Newsom (now California Governor) and knew Adachi, whom I often found to be gracious and helpful.

Adachi's untimely death at 59, after serving as San Francisco's public defender for 17 years, shocked the city.

The day after his death, on the afternoon of Feb. 23, I received a text message from a source I trust. The text offered information about the circumstances surrounding Adachi's death. The source, to whom I promised confidentiality, told me that critical details had been left out of reports describing Adachi's death and statements released by San Francisco government officials, including the Mayor's office. Those statements said that Adachi had been feeling unwell while at dinner with a friend in San Francisco's North Beach neighborhood when he had trouble breathing and emergency crews were called.

Indeed, the circumstances behind Adachi's death were more complicated than originally reported. The coroner's office, CNN-affiliate KPIX reported, said Adachi died from a mix of alcohol consumption and cocaine and, according to the police report, he was found at a friend's apartment.

Other journalists in San Francisco were hearing similar things, including Carmody, who has been an independent journalist for years, often as a freelancer.

Carmody obtained a copy of the confidential police report from a source and then sold it to three Bay Area television stations. These transactions are not the same as when a source provides information to a news organization -- Carmody is a freelance journalist who was being paid for his investigative work.

The leaked report caused a firestorm in San Francisco city politics. City leaders and Adachi's widow, Mutsuko, demanded an investigation. Adachi had had a famously contentious relationship with the San Francisco Police Department, leading many to suspect that the report had been leaked to exact revenge against his name and legacy.

Adachi's widow, colleagues and friends were surely feeling anger, frustration and pain. But that was no excuse for violating press freedoms and likely breaking California law by seizing a journalist's equipment and notes.

San Francisco government leaders like Mayor London Breed regularly condemn the Trump administration for what they say are egregious civil-liberties violations. But in the case of Carmody, they have either remained silent or -- as Mayor Breed did -- offered an endorsement of their actions. Thursday, in a statement, Ms. Breed said: "As part of this investigation, the [police] Department went through the appropriate legal process to request a search warrant... I believe that someone from within the Department needs to be held accountable for the release of this information."

Breed's failure to stand up for the legal rights of a reporter is a hypocritical example of "do as I say, not as I do."

Fewer, the San Francisco County Supervisor, who was a close friend of Adachi's, said of Carmody, "If he were obtaining this information to write a story, it still is illegal to obtain a police report unless it has been officially released." That is not true. It is perfectly legal for a journalist to obtain a police report, leaked or not. And earlier this week, Fewer walked back on her incorrect statement by saying, "The truth is, I'm not a legal expert."

Reporters often receive leaks from people who are violating the law by revealing confidential or classified information. It is generally accepted for law enforcement agencies to try to discover who leaked information. But law enforcement agencies, particularly in states with shield laws, have sought to track down the leakers through internal investigations, not by seizing reporters' equipment and notes.

Even without federal shield laws, longtime Justice Department policy has been to take the same approach, investigating the leakers, not the journalists.

Reporters in the United States are more and more the targets of local and state law enforcement. Last year, documentarian Nora Donaghy, a journalist and producer, had her cell phone seized by Los Angeles Police Department officers who had a warrant. Donaghy is producing a docu-series about former hip-hop mogul Suge Knight and her phone contained highly sensitive information about her reporting and sources.

Earlier this year, two reporters who had received confidential data about police officers' arrests and convictions through a public records request were threatened with legal action by California Attorney General Xavier Becerra. He said the information had been inadvertently released and they had to destroy it.

President Trump's rhetoric against the press, including calling members "the enemy of the people," has rightly been criticized. But if there isn't more outrage and accountability around the San Francisco raid, other local law enforcement agencies will feel free to engage in the same dangerous conduct.

Shield laws are similar to those protecting attorney-client communications. It's clear why such laws are important. If clients can't trust that conversations with attorneys remain confidential, they can't seek the best defense. And a source must be able to trust that a reporter won't be forced to reveal his or her identity and won't reveal it willingly. Otherwise, important, newsworthy information might not be revealed.

Confidential sources are critical to a lifeblood of a true democracy, particularly when they reveal the truth about our governments and people in power. They and their journalistic conduits must be protected at all costs.

Carmody's equipment and confidential work material must be returned, details on how the San Francisco Police Department obtained the warrant must be unsealed, and San Francisco government officials must unreservedly condemn these actions.