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 { } Trump Expected To Make It Harder For Workers To Get Overtime Pay And Benefits | Right Tactics
HomeLatest NewsTrump Expected To Make It Harder For Workers To Get Overtime Pay...

Trump Expected To Make It Harder For Workers To Get Overtime Pay And Benefits

Published on

spot_img

Last updated on November 14th, 2024 at 03:00 pm

The incoming Trump administration is expected to change rules and make it more difficult for workers to receive overtime pay and benefits.

The New York Times reported:

“There will be a concerted effort to repeal pro-worker N.L.R.B. precedents,” said Heidi Shierholz, a senior Labor Department official during the Obama administration, referring to the National Labor Relations Board.

Experts like Ms. Shierholz, who is now president of the liberal Economic Policy Institute, said they also expected the Trump administration to ease up on enforcing safety rules, to narrow eligibility for overtime pay and to make it harder for gig workers to gain status as employees.

The reason why blue-collar workers should never vote for Trump can be seen in his first-term record on labor.

Trump Is An Extremely Anti-Worker President

As I wrote in our newsletter The Daily:

Donald Trump rolled back the Obama administration’s overtime rules and made 8.2 million workers ineligible for overtime pay. Trump stacked the National Labor Relations Board with people hostile to collective bargaining who then issued a series of rules that made it more difficult for workers to organize.

Trump used his presidency to make sure that workers were paid less and faced more hurdles to organizing, but if there is one action that stands out above all of the others, it is how Trump tried to change tipping.

According to the Economic Policy Institute,One of the Trump DOL’s most egregious rulemakings was the proposed “tip stealing” rule, which would allow employers to pocket the tips of their employees, as long as workers are paid the minimum wage. EPI’s estimates showed that, if finalized, the rule would have resulted in $5.8 billion in lost wages of tipped workers each year. However, before the rule was finalized, reports found that the Secretary of Labor went to great lengths to hide DOL’s economic analysis that showed the rule would have been costly to workers. In the wake of this news, Congress added a section to the Fair Labor Standards Act that prohibits employers from keeping tips received by employees, ultimately making the proposed rule invalid.”

When Trump promised not to tax overtime pay, he left out a key detail. He is going to make it impossible for many workers to earn overtime pay, so it doesn’t matter if it’s not taxed. Millions of workers won’t be getting it.

Workers had a great for years under Joe Biden, but all of that progress will be erased once Trump takes office.

Trump is the most hostile president toward workers in a century, and yet some people didn’t seem to know what they were voting for and sent him back to the White House.

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...