nassh: streams: fix onDataAvailable callback

Add a stub onDataAvailable to the Stream base class.  Every Stream
implementation assumes this function exists, so providing an abstract
that throws an error is equiv to not defining it.  This allows us to
add typing info which in turn catches 2 bad callers.

The RelayCorpXhrStream implementation isn't actively used by anyone
as Googlers long ago switched to the WebSocket (Ws) variant which is
why no one noticed.

The SshAgentStream code path worked with the NaCl implementation as
the callback accepted by strings & array buffers automatically, but
the WASM implementation only accepts array buffers.  This code isn't
heavily used by Googlers, but we've had a few reports of breakage.
This fix was originally proposed by Eric Severance, but was caught up
in fixing WASM at the expense of breaking NaCl support which is no
longer a concern (see https://crrev.com/c/6232681).

Bug: b/390673981
Bug: b/470114260
Change-Id: I9ee316f8415295a7a8a59c8cf4aeebdba2db2b32
Reviewed-on: https://chromium-review.googlesource.com/c/apps/libapps/+/7374902
Reviewed-by: Joel Hockey <joelhockey@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
3 files changed
tree: 4c7456a4ff62c62796584010d636bf6fed2ab562
  1. hterm/
  2. kokoro/
  3. libdot/
  4. nassh/
  5. ssh_client/
  6. terminal/
  7. wasi-js-bindings/
  8. wassh/
  9. .clang-format
  10. .gitignore
  11. .markdownlintrc
  12. .pylintrc
  13. CPPLINT.cfg
  14. DIR_METADATA
  15. Dockerfile
  16. eslint.config.js
  17. HACK.md
  18. LICENSE
  19. METADATA
  20. navbar.md
  21. OWNERS
  22. package.json
  23. PRESUBMIT.cfg
  24. pyproject.toml
  25. README.md
  26. unblocked_terms.txt
README.md

Hello

This repository contains the libdot JavaScript library and some web applications that make use of it.

The official copy of this repository is hosted at https://chromium.googlesource.com/apps/libapps.

There is also a mirror on github at https://github.com/libapps/libapps-mirror. A few subprojects are also extracted out into their own git repo and mirrored. Keep in mind that these mirrors may occasionally be behind the official repository.

All changes must go through the Gerrit code review server on https://chromium-review.googlesource.com. Github pull requests cannot be accepted. Please see the HACK.md document in this directory for the details.

Top level directories

  • libdot/ is a small set of JS libraries initially developed as part of hterm, now available as shared code.

  • hterm/ is a JS library that provides a terminal emulator. It is reasonably fast, reasonably correct, and reasonably portable across browsers.

  • nassh/ is the Chrome Secure Shell extension that combines hterm with a build of OpenSSH to provide a PuTTY-like app for Chrome users.

  • ssh_client/ is the WASM port of OpenSSH.

  • terminal/ is the ChromeOS Terminal application.

  • wassh/ is the JS part of the WASM OpenSSH port.

  • wasi-js-bindings/ provides JS bindings for WASI which is used by the WASM port.