A federal judge handed a former Iran-contra prosecutor and his publisher a victory yesterday in their battle to publish a behind-the-scenes account of the investigation before it is complete.

U.S. District Judge John F. Keenan of New York said he had carefully reviewed the manuscript, "Opening Arguments: A Young Lawyer's First Case -- United States v. Oliver North," and found no secrets in it that deserved protection under the law.

Keenan rejected Independent Counsel Lawrence E. Walsh's objections to the book and instead accused Walsh of trying to build "new realms of secrecy" out of the federal court rule prohibiting disclosure of "matters occurring before the grand jury."

Brushing aside Walsh's complaints that the book could impede his remaining inquiries, the judge gave author Jeffrey R. Toobin and his publisher, Penguin Books USA Inc., the declaratory judgments they had been seeking since November to clear the manuscript for publication.

Penguin lawyer Martin Garbus called the ruling "a landmark decision." He said it was the first time a court had given a publisher what amounted to "a seal of approval" before publication.

Walsh said in a brief statement that he would appeal the decision "because it is important to have an appellate resolution as to the protection to be accorded grand jury proceedings in the ongoing investigations of this office."

Toobin and his publisher said publication would proceed and the book could be on sale by mid-February. "Enough is enough," Toobin said of his almost two-year struggle to get Walsh's office to clear the book. "Let them try to get prior restraint at this point."

For Toobin, the only downside in the 44-page ruling was the judge's declaration that there is nothing new in the book. The 30-year-old author took the point philosophically. "It's really meant to be the story of a young lawyer's first case," he said.

Toobin left Walsh's office in May 1989, with thousands of pages of documents, including notes from Walsh, records dealing with possible criminal charges and 22 spiral-bound notebooks reflecting internal meetings and discussions about the investigation. Toobin told Walsh he planned to write a book and under agreements he had signed would try to obtain his clearance for it.

That led to months of inconclusive dickering, largely between Toobin and Walsh's lawyer in the case, Guy M. Struve. Now a federal prosecutor in Brooklyn, Toobin, and Penguin, filed suit in November, complaining that Walsh had threatened criminal prosecution and civil penalties if they published the book before Walsh's investigation was concluded.

Toobin insisted that he had agreed to wait only until the fall of 1990. Walsh, who sources say is more concerned about the timing of the book than what it says, is not expected to wind up his grand jury inquiries and issue his final report until this spring or summer.

As the lawsuit progressed, Walsh and his office denied threatening Toobin and said they had simply refused to tell him what they would do if the book were published. Keenan rejected that distinction and said correspondence between the two sides showed Toobin "has been threatened, albeit subtly." In fact, the judge held, the vagueness of Walsh's stance made it "more threatening for the absence of particularity."

Walsh contended the grand jury secrecy rule, known in the courts as "6(e)," extended to the disclosure not only of matters before the grand jury but to discussions by prosecutors outside the grand jury room that might reveal "the strategy of the direction of the investigation."

Keenan rejected that claim. "The rule does not stretch that far," he said. The judge said he was especially "perplexed" by Struve's designation of an entire chapter as "6(e) material" when "most if not all of the information {in the chapter} has been revealed" in the reports of the Senate-House Iran-contra investigation, not to mention two previously published books.

Noting that it has become common practice in recent decades for prosecutors to write books about celebrated cases, Keenan said this might not be "a wise course for them to follow, but the wisdom of the practice is not what is at issue. Rather, it clearly indicates that there is no permanent 'gag' on prosecutors" from talking or writing about their work.

The Penguin catalog bills the book as "an insider's blow-by-blow account" and says it will tell "why {former national security adviser} Robert McFarlane was allowed to plea bargain" and "why {former assistant secretary of state} Elliott Abrams wasn't charged with a crime."

Walsh had argued that Toobin, as a former Iran-contra prosecutor, also had contractual and fiduciary obligations not to disclose "nonpublic" information about the office, but Keenan said such claims amounted to an attempt "to preclude Toobin from revealing practically all information, however trivial, he absorbed while employed by defendants."