Alex Wong via Getty Images Richard Cordray, who leads the Consumer Financial Protection Bureau, could soon be fired by Donald Trump if an importnat ruling is allowed to stand.

A week ahead of the deadline, the Consumer Financial Protection Bureau on Friday appealed a court ruling that could leave the independent watchdog vulnerable to the whims of President-elect Donald Trump.

The financial agency had until next Friday to contest an October decision that essentially left its director, Richard Cordray, at the mercy of the president. As written, the law that created the bureau largely insulates its director from the White House.

But Trump’s transition team has already threatened do “dismantle” the 2010 Dodd-Frank Act ― enacted in the wake of the Wall Street financial crisis to protect consumers from abusive financial practices.

The CFPB, championed by Sen. Elizabeth Warren (D-Mass.), also is in the crosshairs of Senate Republicans, who are seizing on Trump’s victory to drain the agency of funding and curtail its authority. Sen. Richard Shelby (R-Ala.) told The Huffington Post this week he wouldn’t mind seeing the CFPB completely eliminated.

Warren, for her part, is sounding the alarm about GOP plans to defang the agency.

The real reason Wall St & their @GOP allies are going after the @CFPB is because it’s working too darn well for consumers & must be stopped. — Elizabeth Warren (@SenWarren) November 14, 2016

In the appeal filed Friday, the CFPB asked the full U.S. Court of Appeals for the D.C. Circuit in Washington to set aside its earlier ruling that found the bureau’s single-director structure unconstitutional. That decision was rendered by a three-judge panel that partly split 2-to-1.

Lawyers for the agency called that ruling “dramatic and unprecedented,” and urged the D.C. Circuit to vacate it because it misinterpreted Supreme Court precedent on the power of Congress to set up independent agencies. The lawyers said the case “may be the most important separation-of-powers case in a generation.”

If a majority of the active judges on the D.C. Circuit agrees to rehear the case ― Chief Judge Merrick Garland has recused himself during the pendency of his Supreme Court nomination ― the October ruling would be null and the CFPB and consumer advocates would score an early win.

A chorus of civil rights, financial reform and legal advocacy organizations praised the CFPB’s decision to appeal ― and Cordray for his leadership since taking office.

This may be the most important separation-of-powers case in a generation. Lawyers for the Consumer Financial Protection Bureau

“Director Cordray has led the Bureau with a steady hand and worked tirelessly with his staff to return billions of dollars back to hardworking people across the country harmed by abusive financial practices,” Mike Calhoun of the Center for Responsible Lending said in a statement.

Perhaps the highest-profile enforcement action by the CFPB in recent memory was its record-setting $100 million fine against Wells Fargo for creating hundreds of thousands of scam accounts for unsuspecting customers. The bank had to pony up an additional $85 million in related sanctions.

“Today’s action should serve notice to the entire industry that financial incentive programs, if not monitored carefully, carry serious risks that can have serious legal consequences,” Cordray said in a statement at the time.

Trump’s transition team is reportedly brainstorming Cordray’s replacement.

Deepak Gupta, a consumer rights lawyer who formerly worked at the CFPB, told Reuters last week that the bureau’s strong work has exposed it to wrath from conservatives.

“It’s a very fragile thing,” Gupta said. “It was birthed in controversy and is under constant attack. It may not survive the way we know it through this administration.”