1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-28 16:20:57 -05:00
Commit graph

10499 commits

Author SHA1 Message Date
Matt Mastracci
5d7ebea99f
fix(cli): harden permission stdio check (#21778)
Harden the code that does permission checks to protect against
re-opening of stdin.

Code that runs FFI is vulnerable to an attack where fd 0 is closed
during a permission check and re-opened with a file that contains a
positive response (ie: `y` or `A`). While FFI code is dangerous in
general, we can make it more difficult for FFI-enabled code to bypass
additional permission checks.

- Checks to see if the underlying file for stdin has changed from the
start to the end of the permission check (detects races)
- Checks to see if the message is excessively long (lowering the window
for races)
- Checks to see if stdin and stderr are still terminals at the end of
the function (making races more difficult)
2024-01-04 20:34:54 +01:00
Bartek Iwańczuk
1aea7a3e1a
chore: make test server less noisy (#21782)
Test server was printing a lot of "early eof" messages eg when running
`cargo test integration::npm`. This commit filters out these messages.
2024-01-04 20:34:54 +01:00
Nayeem Rahman
69ad4918e5
fix(lsp): support test code lens for Deno.test.{ignore,only}() (#21775) 2024-01-04 20:34:54 +01:00
David Sherret
38dda38a3b
fix(jupyter): error message when install fails due to jupyter command not being on PATH (#21767)
We were failing silently in this scenario.
2024-01-04 20:34:54 +01:00
Matt Mastracci
cf148779f0
fix(cli): make signals tests more reliable (#21772)
Delivering POSIX signals too quickly may result in signal coalescing.
2024-01-04 20:34:54 +01:00
Jovi De Croock
53c876ffd3
fix(node/zlib): accept dataview and buffer in zlib bindings (#21756)
Fixes #20516 
Follow up to #21747 and #21746

This tackles the last point of #20516 where certain inputs weren't
accepted in the other zlib methods

This adds the `toU8` conversion of `_brotli` to `_zlib.mjs`, when we
create the ZLibBuffer, we'll sanitize the input. I noticed that the
async had no handler for `string` input so I added that as well.
2024-01-04 20:34:54 +01:00
Nayeem Rahman
2d561a8cf3
chore: ignore hanging lsp jsx test (#21771) 2024-01-04 20:34:53 +01:00
Bartek Iwańczuk
2eb2d109ef
chore: upgrade deno_core to 0.241.0 (#21765) 2024-01-04 20:34:53 +01:00
Nayeem Rahman
04c9c6c1c6
feat(lsp): cache jsxImportSource automatically (#21687) 2024-01-04 20:34:53 +01:00
Bartek Iwańczuk
fbeb45b37e
chore: update SECURITY.md (#21766) 2024-01-04 20:34:53 +01:00
Matt Mastracci
c1c7bd8cfe
chore(ext/net): bump rustls-tokio-stream to fix panic (#21763)
Pull in https://github.com/denoland/rustls-tokio-stream/pull/22 to fix
https://github.com/denoland/deno/issues/21762
2024-01-04 20:34:53 +01:00
Divy Srivastava
63ae014dcc
fix(ext/node): use node:process in _streams.mjs (#21755)
Fixes https://github.com/denoland/deno/issues/21644

`next build` works:
```
~/gh/deno/target/debug/deno run -A --unstable-byonm ./node_modules/.bin/next build
Warning: Not implemented: process.on("rejectionHandled")
   ▲ Next.js 14.0.4

 ✓ Creating an optimized production build
 ✓ Compiled successfully
 ✓ Linting and checking validity of types
   Collecting page data  ..Warning: Not implemented: process.on("rejectionHandled")
Warning: Not implemented: process.on("rejectionHandled")
Warning: Not implemented: process.on("rejectionHandled")
Warning: Not implemented: process.on("rejectionHandled")
Warning: Not implemented: process.on("rejectionHandled")
 ✓ Collecting page data
   Generating static pages (0/5)  [    ]Warning: Not implemented: process.on("rejectionHandled")
Warning: Not implemented: process.on("rejectionHandled")
Warning: Not implemented: process.on("rejectionHandled")
Warning: Not implemented: process.on("rejectionHandled")
Warning: Not implemented: process.on("rejectionHandled")
 ✓ Generating static pages (5/5)
 ✓ Collecting build traces
 ✓ Finalizing page optimization

Route (app)                              Size     First Load JS
┌ ○ /                                    5.32 kB        87.4 kB
└ ○ /_not-found                          875 B            83 kB
+ First Load JS shared by all            82.1 kB
  ├ chunks/938-5e061ba0d46125b1.js       26.8 kB
  ├ chunks/fd9d1056-735d320b4b8745cb.js  53.5 kB
  ├ chunks/main-app-2945f337109ea73c.js  220 B
  └ chunks/webpack-e3c6517d4ab8d680.js   1.68 kB


○  (Static)  prerendered as static content
```
2024-01-04 20:34:53 +01:00
Bartek Iwańczuk
31318e9ae0
chore: increase unit test timeout to 3m (#21760)
Alternative to #21758 to fix timing out tests on Windows.
2024-01-04 20:34:53 +01:00
Divy Srivastava
551140e475
fix(ext/node): implement os.machine (#21751) 2024-01-04 20:34:52 +01:00
Divy Srivastava
4fa779f220
fix(ext/http): use arraybuffer binaryType for server websocket (#21741)
Ref
https://github.com/denoland/deno/issues/15340#issuecomment-1872353134
2024-01-04 20:34:52 +01:00
Divy Srivastava
eb8bf806b3
fix(ext/node): querystring stringify without encode callback (#21740)
Fixes https://github.com/denoland/deno/issues/21734

Changes:
- Use default encode when options do not provide a encode callback.
- Remove internal TS for `node:querystring`. Its not helping catching
bugs like this because of invalid type assumptions and use of `any`,
more of a maintenance burden.
2024-01-04 20:34:52 +01:00
Divy Srivastava
97604ef522
Revert "fix(runtime): Make native modal keyboard interaction consistent with browsers" (#21739)
Reverts denoland/deno#18453

Fixes https://github.com/denoland/deno/issues/21602
https://github.com/denoland/deno/issues/21631
https://github.com/denoland/deno/issues/21641

Reasons for revert:
- alert() and confirm() swallowed ^C with raw mode.
- prompt() did not re-raise the interrupt signal from rustyline. 
- Default 'Y' on confirm() is a bad default and breaking change.

cc @lionel-rowe
2024-01-04 20:34:52 +01:00
林炳权
217b9ecb20
chore: update to Rust 1.75 (#21731) 2024-01-04 20:34:52 +01:00
David Sherret
21dd7f8a7f
chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
Raashid Anwar
857cf1f154
fix(http_client): Fix Deno.createHttpClient to accept poolIdleTimeout parameter (#21603)
Fixed the bug `Deno.createHttpClient` to accept `poolIdleTimeout` parameter.

Fixes https://github.com/denoland/deno/issues/21546
2024-01-04 20:34:51 +01:00
Jovi De Croock
ce539e9189
fix(node/zlib): consistently return buffer (#21747)
This fixes point 3 of https://github.com/denoland/deno/issues/20516

This PR creates consistency between the sync and async versions of the
brotli compress where we will always return a buffer like Node.
2024-01-04 20:34:51 +01:00
Jovi De Croock
2319c51dc0
fix(node/zlib): cast Dataview and Buffer to uint8 (#21746)
This fixes point 2 of #20516 

This adds a conversion from Dataview/Buffer by returning `obj.buffer`
which can be converted to a `UInt8Array`.

Question: Regarding point 4 of the mentioned issue would it be
appropriate to copy the toU8 helper to the `zlib.mjs` methods?
2024-01-04 20:34:51 +01:00
Divy Srivastava
73b703213e
fix(ext/node): add process.abort() (#21742) 2024-01-04 20:34:51 +01:00
Divy Srivastava
d3ef599c8f
chore(runtime): internalize pipe fd for ext/node (#21570)
Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-01-04 20:34:50 +01:00
Leo Kettmeir
491f8e9731
chore: update deno_doc to 0.85.0 (#21678) 2024-01-04 20:34:50 +01:00
Joel Walker
a267225a17
fix: Object.groupBy return type should be a partial (#21680)
Signed-off-by: Joel Walker <joelwalker1995@gmail.com>
2024-01-04 20:34:50 +01:00
Bartek Iwańczuk
f9df3833c7
chore: disable PTR_HOST dns test for Node compat (#21735)
These tests started failing on CI on Dec 28th, 2023 returning
ENOTFOUND. It's unclear what's going on, since `dig -x
8.8.8.8.in-addr.arpa`.

It needs a deeper investigation, but I want to unblock main branch
in the meantime.
2024-01-04 20:34:50 +01:00
Bartek Iwańczuk
b7f2bff5e3
fix(node): support nested tests in "node:test" (#21717)
Closes https://github.com/denoland/deno/issues/21679
2024-01-04 20:34:50 +01:00
Bartek Iwańczuk
53d33490b4
fix: allow npm: specifiers in import.meta.resolve (#21716)
Closes https://github.com/denoland/deno/issues/21298.

"npm:" specifiers are matched against import map entries
and if no match is found they are passed through.
2024-01-04 20:34:50 +01:00
Bartek Iwańczuk
38fa2dbc1e
chore: update deno_core to 0.240.0 (#21726) 2024-01-04 20:34:49 +01:00
Divy Srivastava
2df2cd10d2
fix(node): Implement os.cpus() (#21697)
Fixes https://github.com/denoland/deno/issues/21666

Zero added dependency and tries to match the libuv implementation
2024-01-04 20:34:49 +01:00
Nayeem Rahman
730835498c
perf(lsp): use LanguageServiceHost::getProjectVersion() (#21719) 2024-01-04 20:34:49 +01:00
Bartek Iwańczuk
69cc117015
refactor: simplify hyper, http, h2 deps (#21715)
Main change is that:
- "hyper" has been renamed to "hyper_v014" to signal that it's legacy
- "hyper1" has been renamed to "hyper" and should be the default
2024-01-04 20:34:49 +01:00
Bartek Iwańczuk
c73abff4af
refactor: finish test_util server cleanup, simplify dependencies (#21714)
Closes https://github.com/denoland/deno/issues/21578
2024-01-04 20:34:49 +01:00
Lino Le Van
5efae447a4
fix(ext/node): Implement aes-192-ecb and aes-256-ecb (#21710) 2024-01-04 20:34:49 +01:00
Bartek Iwańczuk
7a90ea3053
refactor: rewrite remaining test server to Hyper 1.1 (#21708)
Ref https://github.com/denoland/deno/issues/21578
2024-01-04 20:34:48 +01:00
Matt Mastracci
936d265f8a
perf: remove opAsync (#21690)
`opAsync` requires a lookup by name on each async call. This is a
mechanical translation of all opAsync calls to ensureFastOps.

The `opAsync` API on Deno.core will be removed at a later time.
2024-01-04 20:34:48 +01:00
Bartek Iwańczuk
0f9056974f
refactor: fastwebsockets renames (#21707)
We now use only a single version of "fastwebsockets" crate, so we no
longer need to have an alias.
2024-01-04 20:34:48 +01:00
Bartek Iwańczuk
69bb85ce0d
refactor: change cli/ to use hyper 1.1 (#21705) 2024-01-04 20:34:48 +01:00
Bartek Iwańczuk
0533ae4380
refactor: migrate ext/websocket to hyper 1.1 (#21699) 2024-01-04 20:34:48 +01:00
Bartek Iwańczuk
e7dedb8036
refactor: use hyper 1.0 in WS test server (#21698) 2024-01-04 20:34:48 +01:00
Divy Srivastava
1149ec8848
fix(ext/node): add ClientRequest#setNoDelay (#21694)
Fixes https://github.com/denoland/deno/issues/18316
2024-01-04 20:34:47 +01:00
Matt Mastracci
375164c51b
chore: bump deno_core (#21675) 2024-01-04 20:34:47 +01:00
Bartek Iwańczuk
3123634e91
refactor: use hyper 1.0 in grpc test server (#21584)
Ref https://github.com/denoland/deno/issues/21578
2024-01-04 20:34:47 +01:00
Matt Mastracci
841b758d0d
chore: ensure that each op provided to ensureFastOps is only used once (#21689)
When we migrate to op-import-per-extension, we will want to ensure that
ops have one and only one place where they are imported. This tackles
the ops that are imported via `ensureFastOps`, but does not yet tackle
direct `ops` imports.

Landing ahead of https://github.com/denoland/deno_core/pull/393
2024-01-04 20:34:47 +01:00
Matt Mastracci
2b4307af35
chore(ext/node): use BufView natively in http2 (#21688)
Node HTTP/2 was using the default h2 `Bytes` datatype when we can be
making using of `BufView` like we do in `Deno.serve`.

`fetch` and `Deno.serverHttp` can't make use of `BufView` because they
are using `reqwest` which is stuck on hyper 0.x at this time.
2024-01-04 20:34:47 +01:00
Bartek Iwańczuk
ff8abc50f9
refactor: upgrade inspector server to Hyper 1.1 (#21599)
This commit rewrites "runtime/inspector_server.rs" to use Hyper 1.1.

Now "deno_runtime" crate depends on both Hyper 1.x and 0.y versions.
2024-01-04 20:34:47 +01:00
Heyang Zhou
16550f0825
feat(unstable): only allow http2 for kv remote backend (#21616) 2024-01-04 20:34:46 +01:00
Bartek Iwańczuk
fa60ed1a8d
feat(lsp): allow to connect V8 inspector (#21482)
This commit adds a way to connect to the TS compiler host that is run
as part of the "deno lsp" subcommand. This can be done by specifying 
"DENO_LSP_INSPECTOR" variable.

---------

Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
2024-01-04 20:34:46 +01:00
Bartek Iwańczuk
c2446697f8
chore: update ext/http to hyper 1.0.1 and http 1.0 (#21588)
Closes https://github.com/denoland/deno/issues/21583.
2024-01-04 20:34:46 +01:00