class wfJWT { private $claims; const JWT_TTL = 600; const ISSUER = 600; public static function extractTokenContents($token) { if (!is_string($token)) { throw new InvalidArgumentException('Token is not a string. ' . gettype($token) . ' given.'); } // Verify the token matches the JWT format. if (!preg_match('/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?$/', $token)) { throw new wfJWTException('Invalid token format.'); } list($header, $body, $signature) = explode('.', $token); // Test that the token is valid and not expired. $decodedHeader = base64_decode($header); if (!(is_string($decodedHeader) && $decodedHeader)) { throw new wfJWTException('Token header is invalid.'); } $header = json_decode($decodedHeader, true); if (!is_array($header)) { throw new wfJWTException('Token header is invalid.'); } $decodedBody = base64_decode($body); if (!(is_string($decodedBody) && $decodedBody)) { throw new wfJWTException('Token body is invalid.'); } $body = json_decode($decodedBody, true); if (!is_array($body)) { throw new wfJWTException('Token body is invalid.'); } return array( 'header' => $header, 'body' => $body, 'signature' => $signature, ); } /** * @param mixed $subject */ public function __construct($subject = null) { $this->claims = $this->getClaimDefaults(); $this->claims['sub'] = $subject; } /** * @return string */ public function encode() { $header = $this->encodeString($this->buildHeader()); $body = $this->encodeString($this->buildBody()); return sprintf('%s.%s.%s', $header, $body, $this->encodeString($this->sign(sprintf('%s.%s', $header, $body)))); } /** * @param string $token * @return array * @throws wfJWTException|InvalidArgumentException */ public function decode($token) { if (!is_string($token)) { throw new InvalidArgumentException('Token is not a string. ' . gettype($token) . ' given.'); } // Verify the token matches the JWT format. if (!preg_match('/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?$/', $token)) { throw new wfJWTException('Invalid token format.'); } list($header, $body, $signature) = explode('.', $token); // Verify signature matches the supplied payload. if (!$this->verifySignature($this->decodeString($signature), sprintf('%s.%s', $header, $body))) { throw new wfJWTException('Invalid signature.'); } // Test that the token is valid and not expired. $decodedHeader = base64_decode($header); if (!(is_string($decodedHeader) && $decodedHeader)) { throw new wfJWTException('Token header is invalid.'); } $header = json_decode($decodedHeader, true); if (!( is_array($header) && array_key_exists('alg', $header) && $header['alg'] === 'HS256' && $header['typ'] === 'JWT' )) { throw new wfJWTException('Token header is invalid.'); } $decodedBody = base64_decode($body); if (!(is_string($decodedBody) && $decodedBody)) { throw new wfJWTException('Token body is invalid.'); } $body = json_decode($decodedBody, true); if (!( is_array($body) && // Check the token not before now timestamp. array_key_exists('nbf', $body) && is_numeric($body['nbf']) && $body['nbf'] <= time() && // Check the token is not expired. array_key_exists('exp', $body) && is_numeric($body['exp']) && $body['exp'] >= time() && // Check the issuer and audience is ours. $body['iss'] === 'Wordfence ' . WORDFENCE_VERSION && $body['aud'] === 'Wordfence Central' )) { throw new wfJWTException('Token is invalid or expired.'); } return array( 'header' => $header, 'body' => $body, ); } /** * @param string $string * @return string */ public function sign($string) { $salt = wp_salt('auth'); return hash_hmac('sha256', $string, $salt, true); } /** * @param string $signature * @param string $message * @return bool */ public function verifySignature($signature, $message) { return hash_equals($this->sign($message), $signature); } /** * @return string */ public function __toString() { return $this->encode(); } /** * @param string $data * @return string */ public function encodeString($data) { return rtrim(strtr(base64_encode($data), '+/', '-_'), '='); } /** * @param string $data * @return bool|string */ public function decodeString($data) { return base64_decode(strtr($data, '-_', '+/')); } /** * @return mixed|string */ protected function buildHeader() { return '{"alg":"HS256","typ":"JWT"}'; } /** * @return mixed|string */ protected function buildBody() { return json_encode($this->getClaims()); } /** * @return array */ protected function getClaimDefaults() { $now = time(); return array( 'iss' => 'Wordfence ' . WORDFENCE_VERSION, 'aud' => 'Wordfence Central', 'nbf' => $now, 'iat' => $now, 'exp' => $now + self::JWT_TTL, ); } /** * @param array $claims */ public function addClaims($claims) { if (!is_array($claims)) { throw new InvalidArgumentException(__METHOD__ . ' expects argument 1 to be array.'); } $this->setClaims(array_merge($this->getClaims(), $claims)); } /** * @return array */ public function getClaims() { return $this->claims; } /** * @param array $claims */ public function setClaims($claims) { $this->claims = $claims; } } class wfJWTException extends Exception { } Matt Gaetz’s Nomination To Be Attorney General May Already Be Doomed | Right Tactics
HomeLatest NewsMatt Gaetz's Nomination To Be Attorney General May Already Be Doomed

Matt Gaetz’s Nomination To Be Attorney General May Already Be Doomed

Published on

spot_img

Last updated on November 16th, 2024 at 12:56 pm

Trump’s nomination of Rep. Matt Gaetz (R-FL) to be Attorney General may be doomed to fail before it is even official.

Trump posted on Truth Social:

It is my Great Honor to announce that Congressman Matt Gaetz, of Florida, is hereby nominated to be The Attorney General of the United States. Matt is a deeply gifted and tenacious attorney, trained at the William & Mary College of Law, who has distinguished himself in Congress through his focus on achieving desperately needed reform at the Department of Justice. Few issues in America are more important than ending the partisan Weaponization of our Justice System. Matt will end Weaponized Government, protect our Borders, dismantle Criminal Organizations and restore Americans’ badly-shattered Faith and Confidence in the Justice Department. On the House Judiciary Committee, which performs oversight of DOJ, Matt played a key role in defeating the Russia, Russia, Russia Hoax, and exposing alarming and systemic Government Corruption and Weaponization. He is a Champion for the Constitution and the Rule of Law.

Matt Gaetz is currently under House Ethics Committee investigation for illicit drug use and other infractions that could lead to a recommendation that he be removed from the House.

Former Sen. Claire McCaskill said on MSNBC that the Gaetz nomination has a lot of Republican opposition:
I have to think that there are more than four votes that would not show up for Matt Gaetz in the Republican caucus. I did a quick rundown of the Republican Senate and I came up with 11 names that I think would likely oppose a Matt Gaetz. Now, you know, half or more of those could disappoint America and vote for someone who is so wholly unqualified for this job, uh, in so many ways, but I, I is Donald Trump nominating him so that he can get Tulsi Gabbard through or maybe this Fox News contributor.

We’ve gone from only hiring the best people to only hiring people that are completely unqualified for the jobs that they are being nominated for. The, the Fox News guy, he’s never run anything and this is a huge enterprise,
the Department of Defense. Matt Gaetz has no experience that would lend itself towards running the Department of Justice and everything that’s involved there and, and people think the Department of Justice is just about, you know, who’s getting prosecuted that we’re talking about on national news.

We’re talking about a huge swath of criminals in this country and running a department with integrity going after bad guys that are breaking the law, whether it’s drugs or bank robberies or, um, other serious crimes, criminal enterprises that are complex and difficult. I mean, Andrew can tell you all this. It is shocking. I, I mean, I guess I shouldn’t be shocked but it sure is Nervy, um, for somebody who has the own, his own ethical problems to be nominated for a job that has had really some stellar men and women running that department in my lifetime.

Video:

Most of Trump’s nominations for positions in his administration are people who are unqualified, but loyal to him. If Trump is allowed to put this administration together, it will be a completely dysfunctional disaster. The DOJ plays an important national security role, and if Gaetz were to be confirmed, American lives would be at risk.

Trump clearly wants a loyalist who hates DOJ as much as he does running the department. Matt Gaetz is completely unqualified in every way, and he immediately replaces RFK Jr., as the most likely Trump nominee to crash and burn in the Senate.

Jason Easley
Latest posts by Jason Easley (see all)

Latest articles

Understanding Trenbolone Enanthate 200 Dosage

Trenbolone Enanthate is a powerful anabolic steroid that is widely used by athletes and...

Games, Bonuses, Mobile App, and Login Ways

Put out within the January 2006, Mister Cash is indeed one of the earliest...

The Understanding of Wagering Requirements in Casino Promotions: Why They Keep Players Coming Back

Casino bonuses appeal to millions of players worldwide, yet few understand how online casinos...

Mastering the basics A beginner's guide to understanding gambling principles

Mastering the basics A beginner's guide to understanding gambling principles Understanding Gambling Fundamentals Gambling is an...

More like this

Understanding Trenbolone Enanthate 200 Dosage

Trenbolone Enanthate is a powerful anabolic steroid that is widely used by athletes and...

Games, Bonuses, Mobile App, and Login Ways

Put out within the January 2006, Mister Cash is indeed one of the earliest...

The Understanding of Wagering Requirements in Casino Promotions: Why They Keep Players Coming Back

Casino bonuses appeal to millions of players worldwide, yet few understand how online casinos...