-
Notifications
You must be signed in to change notification settings - Fork 548
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
Add private host option for private networks support in hyperdrive #4932
Conversation
🦋 Changeset detectedLatest commit: 4cd9083 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
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 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.
Please ensure constraints are pinned, and |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ 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
|
5b407dd
to
b332cfc
Compare
|
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
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- 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
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 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!
b332cfc
to
7fcdadd
Compare
7fcdadd
to
fa49152
Compare
Documents the new flag in cloudflare/workers-sdk#4932
Docs PR: cloudflare/cloudflare-docs#13654 |
fa49152
to
59d05c7
Compare
4262bad
to
5f218bf
Compare
@@ -116,6 +122,7 @@ export async function handler( | |||
database: args.database, | |||
user: args.originUser, | |||
password: args.originPassword, | |||
privateHost: args.privateHost, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
privateHost: args.privateHost, | |
private_host: args.privateHost, |
@@ -91,6 +97,7 @@ export async function handler( | |||
database: decodeURIComponent(url.pathname.replace("/", "")), | |||
user: decodeURIComponent(url.username), | |||
password: decodeURIComponent(url.password), | |||
privateHost: args.privateHost ?? false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
privateHost: args.privateHost ?? false, | |
private_host: args.privateHost ?? false, |
@@ -18,6 +18,7 @@ export type PublicOrigin = Origin & { | |||
scheme?: string; | |||
database?: string; | |||
user?: string; | |||
privateHost?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
privateHost?: boolean; | |
private_host?: boolean; |
@@ -503,6 +567,7 @@ function mockHyperdriveRequest() { | |||
port: 3211, | |||
database: "mydb", | |||
user: "dbuser", | |||
privateHost: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
privateHost: false, | |
private_host: false, |
@@ -473,6 +536,7 @@ function mockHyperdriveRequest() { | |||
port: reqBody.origin.port, | |||
database: reqBody.origin.database, | |||
user: reqBody.origin.user, | |||
privateHost: reqBody.origin.privateHost, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
privateHost: reqBody.origin.privateHost, | |
privateHost: reqBody.origin.private_host, |
user: "test", | ||
privateHost: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
privateHost: false, | |
private_host: false, |
\\"user\\": \\"test\\" | ||
\\"database\\": \\"database\\", | ||
\\"user\\": \\"test\\", | ||
\\"privateHost\\": false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\\"privateHost\\": false | |
\\"private_host\\": false |
@@ -447,6 +509,7 @@ function mockHyperdriveRequest() { | |||
database: reqBody.origin.database, | |||
scheme: reqBody.origin.protocol, | |||
user: reqBody.origin.user, | |||
privateHost: reqBody.origin.privateHost, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
privateHost: reqBody.origin.privateHost, | |
private_host: reqBody.origin.private_host, |
\\"user\\": \\"test\\" | ||
\\"database\\": \\"database\\", | ||
\\"user\\": \\"test\\", | ||
\\"privateHost\\": false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\\"privateHost\\": false | |
\\"private_host\\": false |
\\"user\\": \\"test\\" | ||
\\"database\\": \\"database\\", | ||
\\"user\\": \\"test\\", | ||
\\"privateHost\\": false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\\"privateHost\\": false | |
\\"private_host\\": false |
\\"port\\": 1234, | ||
\\"database\\": \\"mydb\\", | ||
\\"user\\": \\"newuser\\", | ||
\\"privateHost\\": true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\\"privateHost\\": true | |
\\"private_host\\": true |
\\"user\\": \\"test\\" | ||
\\"database\\": \\"database\\", | ||
\\"user\\": \\"test\\", | ||
\\"privateHost\\": false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\\"privateHost\\": false | |
\\"private_host\\": false |
@@ -309,7 +341,33 @@ describe("hyperdrive commands", () => { | |||
\\"host\\": \\"example.com\\", | |||
\\"port\\": 1234, | |||
\\"database\\": \\"mydb\\", | |||
\\"user\\": \\"newuser\\" | |||
\\"user\\": \\"newuser\\", | |||
\\"privateHost\\": false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\\"privateHost\\": false | |
\\"private_host\\": false |
@@ -241,7 +271,8 @@ describe("hyperdrive commands", () => { | |||
\\"host\\": \\"example.com\\", | |||
\\"port\\": 5432, | |||
\\"database\\": \\"/\\"weird/\\" dbname\\", | |||
\\"user\\": \\"test\\" | |||
\\"user\\": \\"test\\", | |||
\\"privateHost\\": false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\\"privateHost\\": false | |
\\"private_host\\": false |
@@ -217,7 +246,8 @@ describe("hyperdrive commands", () => { | |||
\\"host\\": \\"example.com\\", | |||
\\"port\\": 5432, | |||
\\"database\\": \\"neondb\\", | |||
\\"user\\": \\"test\\" | |||
\\"user\\": \\"test\\", | |||
\\"privateHost\\": false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\\"privateHost\\": false | |
\\"private_host\\": false |
@@ -193,7 +221,8 @@ describe("hyperdrive commands", () => { | |||
\\"host\\": \\"example.com\\", | |||
\\"port\\": 5432, | |||
\\"database\\": \\"neondb\\", | |||
\\"user\\": \\"user:name\\" | |||
\\"user\\": \\"user:name\\", | |||
\\"privateHost\\": false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\\"privateHost\\": false | |
\\"private_host\\": false |
\\"port\\": 12345, | ||
\\"database\\": \\"database\\", | ||
\\"user\\": \\"test\\", | ||
\\"privateHost\\": true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\\"privateHost\\": true | |
\\"private_host\\": true |
\\"user\\": \\"test\\" | ||
\\"database\\": \\"database\\", | ||
\\"user\\": \\"test\\", | ||
\\"privateHost\\": false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\\"privateHost\\": false | |
\\"private_host\\": false |
\\"user\\": \\"test\\" | ||
\\"database\\": \\"database\\", | ||
\\"user\\": \\"test\\", | ||
\\"privateHost\\": false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\\"privateHost\\": false | |
\\"private_host\\": false |
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