When shield laws for journalists sailed through federal Parliament last year, they were greeted with near universal whooping and hollering.  Whistlebowing MP Andrew Wilkie hailed the legislation, which allows journalists to protect confidential sources when called before the courts, as a “victory for freedom of speech”. The Greens, the Liberal Party and Labor — in a rare show of unity — agreed. The media, which has more than a little skin in the game, subjected the laws to far from vigorous scrutiny.

What almost no one — with the exception of journalism academic Matthew Ricketson— pointed out was that shield laws, while brilliant in theory, can be diabolically difficult to apply in the real world.

Should a journalist be allowed to protect a source if their story endangered national security? Should a source be protected even if they were seeking confidentiality for personal gain, rather than to expose wrongdoing?

These are the thorny issues that arise when shield laws get put into practice.

And so it is with the Peter Slipper case, which today provides the first test of the laws since their introduction.

The Commonwealth has demanded that News Limited journalist Steve Lewis hand over all communications with James Ashby, the former political staffer who has accused Slipper of s-xual harassment, between February and April this year. Lewis’ legal team is fighting the subpoena on the grounds that he should not have to reveal his confidential sources.

Steven Rares, the judge in the Slipper case, now has a decision to make. A decision that will prove a fascinating and, potentially, highly significant one — both for the Slipper case and for future applications of the shield laws.

The Evidence Amendment (Journalists’ Privilege) Bill requires Rares to consider whether the “public interest in the disclosure of evidence” outweighs “the public interest in the communication of facts and opinion to the public by the news media and, accordingly also, in the ability of the news media to access sources of facts”. He is also empowered to consider whether forcing Lewis to reveal his sources would have adverse effects for anyone involved.

The legislation, in its written form, gives high priority to journalists’ obligation to protect the confidentiality of their sources. According to an explanatory note, it does not matter whether the piece of journalism offers a weighty contribution to our democratic system or not: “There is no capacity for the court to consider the worth of the individual piece.”

That seems to be in Lewis’ favour. He doesn’t have to argue that exposing the allegations against Slipper was an act of Watergate-style journalistic heroism.

On the other hand, judges have not traditionally been the journalist’s best friend. And the Commonwealth, no doubt, will argue that the public interest in the administration of justice outweighs Lewis’ obligations to his sources. The correspondence between Slipper and Ashby is crucial to its argument that Ashby’s case should be thrown out of court because of his dealings with Lewis and various Liberal National Party figures.

A further complication is whether Lewis has an obligation to protect a source whose identity has already been exposed. His legal team argued this morning that the subpoenaed documents could reveal the identity of another confidential source besides James Ashby. Judge Rares said there is an argument that a journalist could be compelled to provide information if “the cat’s already out of the bag”.

The case continues.