-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cubejs-server): Integrated support for TLS (#213)
* feat(cubejs-server): Integrated support for TLS @cubejs-backend/server listen supports receiving an option object. Given env CUBEJS_ENABLE_TLS=true, the CubejsServer will use the option object in order to setup https connection. * fix(packages/cubejs-server): Fix https string for redirection * test(packages/cubejs-server): Updated snapshot test for redirector handler fn * docs(packages/cubejs-server): Updated documentation to include TLS Updated documentation to reflect changes in API and introduction of TLS support. * chore(packages/cubejs-server): Removed dependency on config/env script
- Loading branch information
1 parent
be2c7cf
commit 66fe156
Showing
10 changed files
with
3,290 additions
and
463 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const http = jest.requireActual("http"); | ||
|
||
http.__mockServer = { | ||
listen: jest.fn((opts, cb) => cb && cb(null)), | ||
close: jest.fn((cb) => cb && cb(null)), | ||
delete: jest.fn() | ||
}; | ||
|
||
http.createServer = jest.fn(() => http.__mockServer); | ||
|
||
|
||
module.exports = http; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const https = jest.requireActual("https"); | ||
|
||
https.__mockServer = { | ||
listen: jest.fn((opts, cb) => cb && cb(null)), | ||
close: jest.fn((cb) => cb && cb(null)), | ||
delete: jest.fn(), | ||
setSecureContext: jest.fn() | ||
}; | ||
|
||
https.createServer = jest.fn(() => https.__mockServer); | ||
|
||
module.exports = https; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`CubeServer listen given that CUBEJS_ENABLE_TLS is true, should create an http server listening to PORT to redirect to https 1`] = ` | ||
"(req, res) => { | ||
res.writeHead(301, { | ||
Location: \`https://\${req.headers.host}:\${TLS_PORT}\${req.url}\` | ||
}); | ||
res.end(); | ||
}" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.