Skip to content

Add private host option for private networks support in hyperdrive#4932

Merged
mrbbot merged 5 commits intocloudflare:mainfrom
xortive:malonso/private-network
Mar 28, 2024
Merged

Add private host option for private networks support in hyperdrive#4932
mrbbot merged 5 commits intocloudflare:mainfrom
xortive:malonso/private-network

Conversation

@xortive
Copy link
Copy Markdown
Contributor

@xortive xortive commented Feb 6, 2024

What this PR solves / how to test

Support for configuring hyperdrives for databases that are inside a customer's private network
LDW CR-851053

Author has addressed the following

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 6, 2024

🦋 Changeset detected

Latest commit: 4cd9083

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

This PR includes changesets to release 2 packages
Name Type
wrangler Minor
@cloudflare/vitest-pool-workers Patch

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
Copy Markdown
Contributor

github-actions Bot commented Feb 6, 2024

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

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8470404975/npm-package-wrangler-4932

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

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/4932/npm-package-wrangler-4932

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8470404975/npm-package-wrangler-4932 dev path/to/script.js
Additional artifacts:
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8470404975/npm-package-create-cloudflare-4932 --no-auto-update
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8470404975/npm-package-cloudflare-kv-asset-handler-4932
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8470404975/npm-package-miniflare-4932
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8470404975/npm-package-cloudflare-pages-shared-4932
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8470404975/npm-package-cloudflare-vitest-pool-workers-4932

Note that these links will no longer work once the GitHub Actions artifact expires.


wrangler@3.39.0 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20240320.0
workerd 1.20240320.1 1.20240320.1
workerd --version 1.20240320.1 2024-03-20

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.32%. Comparing base (fbdca7d) to head (4cd9083).
Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4932      +/-   ##
==========================================
+ Coverage   72.20%   72.32%   +0.12%     
==========================================
  Files         322      323       +1     
  Lines       16666    16690      +24     
  Branches     4258     4264       +6     
==========================================
+ Hits        12033    12071      +38     
+ Misses       4633     4619      -14     
Files Coverage Δ
packages/wrangler/src/hyperdrive/client.ts 83.33% <ø> (ø)
packages/wrangler/src/hyperdrive/create.ts 78.78% <100.00%> (+0.66%) ⬆️
packages/wrangler/src/hyperdrive/update.ts 100.00% <ø> (ø)

... and 23 files with indirect coverage changes

@gitguardian
Copy link
Copy Markdown

gitguardian Bot commented Mar 21, 2024

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
- Generic Database Assignment 5f218bf packages/wrangler/src/tests/hyperdrive.test.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

@mtlemilio mtlemilio force-pushed the malonso/private-network branch from b332cfc to 7fcdadd Compare March 21, 2024 19:33
@xortive xortive changed the title [DRAFT] Add private host option for private networks support in hyperdrive Add private host option for private networks support in hyperdrive Mar 25, 2024
@xortive xortive marked this pull request as ready for review March 25, 2024 18:47
@xortive xortive requested a review from a team as a code owner March 25, 2024 18:47
@mtlemilio mtlemilio force-pushed the malonso/private-network branch from 7fcdadd to fa49152 Compare March 27, 2024 18:47
Comment thread packages/wrangler/src/hyperdrive/update.ts Outdated
elithrar added a commit to cloudflare/cloudflare-docs that referenced this pull request Mar 27, 2024
@elithrar
Copy link
Copy Markdown
Contributor

Docs PR: cloudflare/cloudflare-docs#13654

@mtlemilio mtlemilio force-pushed the malonso/private-network branch from fa49152 to 59d05c7 Compare March 27, 2024 21:29
@mtlemilio mtlemilio force-pushed the malonso/private-network branch from 4262bad to 5f218bf Compare March 27, 2024 21:57
database: args.database,
user: args.originUser,
password: args.originPassword,
privateHost: args.privateHost,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
privateHost: args.privateHost,
private_host: args.privateHost,

database: decodeURIComponent(url.pathname.replace("/", "")),
user: decodeURIComponent(url.username),
password: decodeURIComponent(url.password),
privateHost: args.privateHost ?? false,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
privateHost: args.privateHost ?? false,
private_host: args.privateHost ?? false,

scheme?: string;
database?: string;
user?: string;
privateHost?: boolean;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
privateHost?: boolean;
private_host?: boolean;

port: 3211,
database: "mydb",
user: "dbuser",
privateHost: false,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
privateHost: false,
private_host: false,

port: reqBody.origin.port,
database: reqBody.origin.database,
user: reqBody.origin.user,
privateHost: reqBody.origin.privateHost,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
privateHost: reqBody.origin.privateHost,
privateHost: reqBody.origin.private_host,

database: "neondb",
database: "database",
user: "test",
privateHost: false,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
privateHost: false,
private_host: false,

\\"user\\": \\"test\\"
\\"database\\": \\"database\\",
\\"user\\": \\"test\\",
\\"privateHost\\": false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
\\"privateHost\\": false
\\"private_host\\": false

database: reqBody.origin.database,
scheme: reqBody.origin.protocol,
user: reqBody.origin.user,
privateHost: reqBody.origin.privateHost,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
privateHost: reqBody.origin.privateHost,
private_host: reqBody.origin.private_host,

\\"user\\": \\"test\\"
\\"database\\": \\"database\\",
\\"user\\": \\"test\\",
\\"privateHost\\": false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
\\"privateHost\\": false
\\"private_host\\": false

\\"user\\": \\"test\\"
\\"database\\": \\"database\\",
\\"user\\": \\"test\\",
\\"privateHost\\": false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
\\"privateHost\\": false
\\"private_host\\": false

\\"port\\": 1234,
\\"database\\": \\"mydb\\",
\\"user\\": \\"newuser\\",
\\"privateHost\\": true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
\\"privateHost\\": true
\\"private_host\\": true

\\"user\\": \\"test\\"
\\"database\\": \\"database\\",
\\"user\\": \\"test\\",
\\"privateHost\\": false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
\\"privateHost\\": false
\\"private_host\\": false

\\"database\\": \\"mydb\\",
\\"user\\": \\"newuser\\"
\\"user\\": \\"newuser\\",
\\"privateHost\\": false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
\\"privateHost\\": false
\\"private_host\\": false

\\"database\\": \\"/\\"weird/\\" dbname\\",
\\"user\\": \\"test\\"
\\"user\\": \\"test\\",
\\"privateHost\\": false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
\\"privateHost\\": false
\\"private_host\\": false

\\"database\\": \\"neondb\\",
\\"user\\": \\"test\\"
\\"user\\": \\"test\\",
\\"privateHost\\": false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
\\"privateHost\\": false
\\"private_host\\": false

\\"database\\": \\"neondb\\",
\\"user\\": \\"user:name\\"
\\"user\\": \\"user:name\\",
\\"privateHost\\": false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
\\"privateHost\\": false
\\"private_host\\": false

\\"port\\": 12345,
\\"database\\": \\"database\\",
\\"user\\": \\"test\\",
\\"privateHost\\": true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
\\"privateHost\\": true
\\"private_host\\": true

\\"user\\": \\"test\\"
\\"database\\": \\"database\\",
\\"user\\": \\"test\\",
\\"privateHost\\": false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
\\"privateHost\\": false
\\"private_host\\": false

\\"user\\": \\"test\\"
\\"database\\": \\"database\\",
\\"user\\": \\"test\\",
\\"privateHost\\": false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
\\"privateHost\\": false
\\"private_host\\": false

@mrbbot mrbbot added the ldw-exempt PRs marked with this label can be included in releases during LDW. label Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ldw-exempt PRs marked with this label can be included in releases during LDW.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants