workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

(WIP) fix(upload): add helper to check for expired JWT

Open ElijahKotyluk opened this issue 3 years ago • 3 comments
trafficstars

This is changing the way JWT Expiration errors are checked during the pages direct upload process. Previously the error was being checked for a specific error code that does not exist on the ParseError being thrown in the case the JWT has expired while uploading. This adds a second condition that decodes the current JWT and validates that token has not expired.

ElijahKotyluk avatar Jul 06 '22 15:07 ElijahKotyluk

⚠️ No Changeset found

Latest commit: ded1df370b653907d89b243f6845a9c4af3e1ba7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Jul 06 '22 15:07 changeset-bot[bot]

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/3373132464/npm-package-wrangler-1417

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/1417/npm-package-wrangler-1417

Or you can use npx with this latest build directly:

npx https://prerelease-registry.developers.workers.dev/runs/3373132464/npm-package-wrangler-1417 dev path/to/script.js
Additional artifacts:
npm install https://prerelease-registry.developers.workers.dev/runs/3373132464/npm-package-cloudflare-pages-shared-1417

github-actions[bot] avatar Jul 06 '22 17:07 github-actions[bot]

marking as a draft till it's ready for review

threepointone avatar Jul 11 '22 09:07 threepointone

Codecov Report

:exclamation: No coverage uploaded for pull request base (main@eab9542). Click here to learn what that means. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1417   +/-   ##
=======================================
  Coverage        ?   73.17%           
=======================================
  Files           ?      128           
  Lines           ?     8638           
  Branches        ?     2265           
=======================================
  Hits            ?     6321           
  Misses          ?     2317           
  Partials        ?        0           

codecov[bot] avatar Nov 02 '22 13:11 codecov[bot]

Thanks @ElijahKotyluk !

jrf0110 avatar Nov 02 '22 22:11 jrf0110