The public and press recently won an important battle when the California Supreme Court rejected the Long Beach police union's argument that the names of officers involved in on-duty shootings should be kept secret.
For years, many police organizations have refused to release the names of officers, arguing that doing so posed a safety threat to the officers and their families.
The pat response was often nonsense, not backed up by any specific risk, and the court called the union on it.
Recently retired Justice Joyce Kennard, writing for the 6-1 majority, noted that police wear badges precisely because the public needs to know who serves the community.
But just as free-press advocates were high-fiving, the U.S. Supreme Court issued a devastating decision. The court rejected a reporter's appeal for protection from testifying about a confidential source.
Such sources are often the ones who help reporters expose corruption or civil rights violations.
Both cases are a reminder of the unrelenting challenges that reporters face when attempting to write about government abuses of power, both big and small.
In the latter case, James Risen, a New York Times reporter and author of the 2006 book "State of War: Secret History of the CIA and the Bush Administration," was subpoenaed by federal prosecutors to testify against a former Central Intelligence Agency operative charged with leaking him classified information for the book.
Risen, a Pulitzer-Prize winner who has written on warrantless wiretapping, has refused and now faces jail.
Last week Attorney General Eric Holder suggested that it might not come to that, telling The New York Times, "As long as I'm attorney general, no reporter who is doing his job is going to go to jail."
That may be the case, but further protections are needed, especially after the administration has shown limited tolerance for reporting on national security. That's clear by the administration's crackdown on government leakers, its secret subpoenas of phone records of Associated Press reporters and editors, and a 2011 subpoena of a Fox News reporter's notes for a story on several Somali-Americans in Minneapolis who were secretly indicted for joining an Islamic extremist group in Somalia.
As Risen himself has pointed out, the administration has signaled that it wants to narrow the field of national security reporting.
Shutting out scrutiny is dangerous and not good for Americans who care about their civil rights.
Last week, the U.S. House of Representatives began work on a broadly worded amendment that would protect journalists from being forced to name confidential sources. That is a start. But as these cases show, it's only one small tool for journalists to push back against powerful government officials who try to conduct the people's business in the dark.