Last week, it was reported that Apple had gained a number of allies in its battle against the US government over the San Bernardino iPhone. Many giants of the tech world, including big rivals Microsoft, are planning on filing a joint amicus brief supporting Apple in court. Yesterday, the Cupertino company got another boost when, in a similar case, a New York judge ruled that authorities can’t force Apple to unlock a suspect's iPhone.

The ruling, by US Magistrate Judge James Orenstein, comes as part of a separate trial that has been ongoing for the last few months. It involves Queens resident Jun Feng, who pleaded guilty to drug charges and had his iPhone 5s taken by DEA agents. Apple feared that the Department of Justice would invoke the All Writs Act to break Feng’s passcode, much like it intends to do in the San Bernardino case, but the judge ruled otherwise.

“This matter [involving the San Bernardino shooter] is therefore one of a dozen pending cases in which the government and Apple disagree as to the court’s authority to command Apple to assist the government in defeating the passcode security of devices Apple has manufactured,” Judge Orenstein wrote.

Echoing the views of Tim Cook and the many other tech names that are standing side-by-side with Apple, Judge Orenstein warned of the dangerous precedent that would be set if the DoJ did get its way. He also warned of the privacy issues that could arise in today’s connected society.

In a world in which so many devices, not just smartphones, will be connected to the Internet of Things, the government’s theory that a licensing agreement allows it to compel the manufacturers of such products to help it surveil the products’ users will result in a virtually limitless expansion of the government’s legal authority to surreptitiously intrude on personal privacy.

Orenstein also rejected claims that Apple’s only concern in the case was public relations. He added that he found no limit on how far the government would go to require a person or company to violate the most deeply-rooted values.

The US government was, as you would expect, “disappointed” with the ruling. "Apple expressly agreed to assist the government in accessing the data on this iPhone — as it had many times before in similar circumstances — and only changed course when the government's application for assistance was made public by the court," said Justice Department spokesperson Emily Pierce in a statement, quoted by USA today.

While the San Bernardino case won’t be bound by the New York ruling, Judge Orenstein’s decision will no doubt have a huge influence on proceedings.