Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Cloudflare Access for wrangler dev #1982

Merged
merged 6 commits into from
Nov 3, 2022
Merged

Support Cloudflare Access for wrangler dev #1982

merged 6 commits into from
Nov 3, 2022

Conversation

penalosa
Copy link
Contributor

@penalosa penalosa commented Oct 5, 2022

Enable support for wrangler dev on Workers behind Cloudflare Access, utilising cloudflared. If you don't have cloudflared installed, Wrangler will prompt you to install it. If you do, then the first time you start developing using wrangler dev your default browser will open with a Cloudflare Access prompt.

@changeset-bot
Copy link

changeset-bot bot commented Oct 5, 2022

🦋 Changeset detected

Latest commit: 6c02ccc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
wrangler Minor

Not sure what this means? Click here to learn what changesets are.

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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2022

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/3387184900/npm-package-wrangler-1982

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

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

Or you can use npx with this latest build directly:

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

@codecov
Copy link

codecov bot commented Oct 5, 2022

Codecov Report

Merging #1982 (6c02ccc) into main (0d2d6bf) will decrease coverage by 0.20%.
The diff coverage is 48.19%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1982      +/-   ##
==========================================
- Coverage   73.17%   72.97%   -0.21%     
==========================================
  Files         128      131       +3     
  Lines        8631     8747     +116     
  Branches     2264     2284      +20     
==========================================
+ Hits         6316     6383      +67     
- Misses       2315     2364      +49     
Impacted Files Coverage Δ
packages/wrangler/src/dev/remote.tsx 6.47% <0.00%> (-0.04%) ⬇️
packages/wrangler/src/proxy.ts 13.89% <5.00%> (-0.57%) ⬇️
packages/wrangler/src/inspect.ts 5.74% <11.11%> (+0.21%) ⬆️
packages/wrangler/src/create-worker-preview.ts 9.72% <20.00%> (+0.76%) ⬆️
packages/wrangler/src/user/access.ts 73.17% <73.17%> (ø)
...ngler/src/__tests__/helpers/msw/handlers/access.ts 100.00% <100.00%> (ø)
...ckages/wrangler/src/__tests__/helpers/msw/index.ts 100.00% <100.00%> (ø)
packages/wrangler/src/is-interactive.ts 85.71% <0.00%> (-14.29%) ⬇️
packages/wrangler/src/d1/execute.tsx 14.87% <0.00%> (-1.65%) ⬇️
packages/wrangler/src/pages/upload.tsx 84.47% <0.00%> (-0.67%) ⬇️
... and 6 more

@penalosa penalosa linked an issue Oct 5, 2022 that may be closed by this pull request
Copy link
Contributor

@JacobMGEvans JacobMGEvans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very interested in getting this in, is there any particular reason there is no testing around it?

@penalosa
Copy link
Contributor Author

penalosa commented Nov 2, 2022

I'm not entirely sure how this could be tested in an automated way. It requires a domain set up for Access, as well as cloudflared installed.

@JacobMGEvans
Copy link
Contributor

I'm not entirely sure how this could be tested in an automated way. It requires a domain set up for Access, as well as cloudflared installed.

Hmmmm, I don't know how I feel pushing this up without testing. We may need to think about a minimal testing for the code (implementation details) or behavior.

@penalosa
Copy link
Contributor Author

penalosa commented Nov 3, 2022

@JacobMGEvans I've added a couple unit tests

@JacobMGEvans
Copy link
Contributor

@JacobMGEvans I've added a couple unit tests

I appreciate the effort in figuring out a way to test this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 BUG: Wrangler dev fails when CF Access is enabled on *.domain.tld
2 participants