Commit Graph

868 Commits

Author SHA1 Message Date
Eryu Xia ccef7bd239
Mention supported streaming modes. (#1265) 2022-08-19 11:58:38 -07:00
Eryu Xia 39200f6cb0
Point to the new `/protocolbuffers/protobuf-javascript` protoc and add note (#1263) 2022-08-10 12:17:12 -07:00
Eryu Xia 056a1c652f
Add new "ecosystem" section. (#1261) 2022-08-02 14:22:40 -07:00
Eryu Xia e1660d71b4
Mention Apache APISIX as a proxy with grpc-web support. (#1260) 2022-07-20 17:07:07 -07:00
River 7fe18d1e08
Remove Trailing Slashes from Hostname (#1254)
Hostnames can be passed in with trailing slashes. Since we blindly concat a path with a leading slash, paths like http://hostname//$rpc/path (note the double slash before $rpc) are possible. The duplicated slash can cause issues down the line, especially if the path is separated from the host in requests.

Browsers/servers generally allow double slashes, and while they are valid syntactically under the RFC spec, there is no specified semantic meaning. So a server could interpret a path like http://hostname//$rpc/path as equivalent to http://hostname/$rpc/path (most common), as a separate path with an empty path component before /$rpc, or as something else. The problem is several interpretations are equally valid under the spec and it's implementation-dependent which is used.

Additionally, the path can be separate from the host in a request depending on whether it's in origin form versus absolute form (see https://datatracker.ietf.org/doc/html/rfc7230#section-5.3). In absolute form (GET http://hostname//$rpc/path), the path and host are clear. In origin form (GET //$rpc/path, Host: hostname), it is still clear to us looking at it, but may not be clear to a server. For example the server may think the //$rpc/path is in absolute form due to the double slash, and thus parse it as host: $rpc, path: /path. This is especially problematic as https://datatracker.ietf.org/doc/html/rfc7230#section-5.4 says:

"When a proxy receives a request with an absolute-form of request-target, the proxy MUST ignore the received Host header field (if any) and instead replace it with the host information of the request-target. A proxy that forwards such a request MUST generate a new Host field-value based on the received request-target rather than forward the received Host field-value."

Which means a proxy would corrupt the request when in this format by overwriting the old host value with $rpc

This parsing concern is not idle speculation either. Java's main URI class (https://docs.oracle.com/javase/8/docs/api/java/net/URI.html), parses a URI of the form //$rpc/path as having host/authority $rpc and path /path. Real bugs are observed from usage of this in commonly used libraries such as Netty, and various proxies.

Basically, this doesn't cause issues in the most common cases, but is a bug waiting to happen in many other edge cases, and affects widely used infrastructure.
2022-06-28 15:30:43 -07:00
Zhao e5ebedd3b4
fix Zig setup step in CI (#1252) 2022-06-13 11:43:40 -07:00
Zhao 3ca2e70edf
Use Zig to build aarch64 binaries (#1249) 2022-06-06 12:20:21 -07:00
Eryu Xia 012b226922
Update async to `3.2.3` (fix vulnerability) (#1247) 2022-05-24 14:57:09 -07:00
ericb-summit ef287fa478
make sure envoy is pid 1 (#1246)
This ensures signals are handled properly so docker stop respond quickly and properly and don't need to wait for time out (10s by default)
2022-05-24 14:22:12 -07:00
Hein Meling 1779661dde
Add version flag and version info in generated code (#1231)
Example output (edited):

```javascript
"use strict";
/**
 * @fileoverview gRPC-Web generated client stub for ag
 * @enhanceable
 * @public
 */
exports.__esModule = true;
exports.AutograderServiceClient = void 0;
// Code generated by protoc-gen-grpc-web. DO NOT EDIT.
// versions:
//  protoc-gen-grpc-web v1.3.1
//  protoc              v3.19.4
// source: ag/ag.proto
/* eslint-disable */
// @ts-nocheck
```
2022-04-29 16:36:38 -07:00
Eryu Xia 35284bfe15
Add npm badge to main README :) (#1226) 2022-04-21 16:28:27 -07:00
Eryu Xia a1b706ade0
Internal code sync (#1225) 2022-04-21 16:18:19 -07:00
Eryu Xia 176e831b07
Move node-client.js to avoid confusion. (#1224) 2022-04-21 16:02:12 -07:00
Eryu Xia c6ef0a55b6
Fixing Envoy config yaml formatting (#1223) 2022-04-21 15:52:46 -07:00
tomk9 58e8c1574f
Update envoy version to 1.22 (with config updates) (#1222)
Update envoy version to 1.22 (with config updates)
2022-04-21 12:12:54 -07:00
Aapeli Vuorinen 8c55021864
Upgrade protobuf and grpc deps (#1211)
* Upgrade protobuf and grpc deps

* Update protobuf version in prereqs dockerfile

Co-authored-by: Eryu Xia <eryu@google.com>
2022-03-08 13:40:04 -08:00
j-k 78313a239a
Make the static flag overridable (#1210) 2022-03-01 20:44:51 -08:00
Eryu Xia 0fe8d4d586
Mention Java in-process proxy is now "on hold". (#1208) 2022-02-18 13:43:44 -08:00
Eryu Xia 3102383234
Add Github Actions (workflows) for building grpc-web protoc plugins. (#1203) 2022-02-18 11:40:04 -08:00
Eryu Xia ce7d734e8a
Update references to version 1.3.1 (#1198) 2022-02-08 11:32:09 -08:00
Eryu Xia 173cb546b7
Fix release notes script to handle empty PR descriptions. (#1196) 2022-02-08 11:21:45 -08:00
Eryu Xia 81ce4c52ff
Revert "Expose MethodDescriptor's public methods (#1160)" (#1199)
This reverts commit 97baed4dbe.
2022-01-31 17:50:44 -08:00
Eryu Xia 454fe5f458
Bump version to 1.3.1 (#1195) 2022-01-29 00:02:14 -08:00
Eryu Xia 11370185b6
Internal code sync (#1194) 2022-01-28 23:35:44 -08:00
Eryu Xia 4dbd519bc8
Disable caching of local generated main.js file (#1193) 2022-01-28 21:47:21 -08:00
Matt Nathan eb313c1f3d
Correctly support proto3 optional fields in commonjs+dts .d.ts output (#1184)
* Correctly support proto3 optional fields in commonjs+dts .d.ts output

Fixes #1072

* Use has_optional_keyword instead of is_optional

* Improve the readability of the condition guarding hasXxx .d.ts field generation.
2022-01-28 12:41:59 -08:00
Stanley Cheung 3fcc2a2a8a
Update envoy version to 1.20 (#1173) 2021-11-19 15:25:35 -08:00
Lukas Möller 6b1d1e97a9
Fix missing TypeScript return type for `serverStreaming` calls. (#1167)
* Add strongly types to MethodDescriptor constructor
* Adds return type declaration to server streaming call

Co-authored-by: Eryu Xia <eryu@google.com>
2021-11-19 15:15:34 -08:00
Cirillo Ferreira 97baed4dbe
Expose MethodDescriptor's public methods (#1160)
Co-authored-by: Eryu Xia <eryu@google.com>
2021-11-19 01:44:39 -08:00
Eryu Xia cc1a135855
Fix issue where no RPC is issued when `deadline` is specified. (#1172) 2021-11-19 01:01:18 -08:00
Eryu Xia b849db4dfa
Use latest typescript and manually move `*_pb.js` files for the echo client (#1171) 2021-11-18 11:32:55 -08:00
Eryu Xia f1d863f2dc
Pin typescript to @4.4.4 to fix CI (#1170) 2021-11-18 10:34:01 -08:00
Eryu Xia 9f76a56ac9
Update Echo App instructions to pull `prereqs` (#1149)
.. as it's currently specified as a runtime dependency (in docker-compose.yml), even tho it's technically only needed at build time.

(Ideas needed: Anyone has idea on how to specify an image to only be needed at build time? 😃)
2021-11-17 13:59:47 -08:00
Eryu Xia 1efe741695
Add missing exports from RpcError and add test. (#1166) 2021-11-12 11:55:38 -08:00
Tin Rabzelj 53964f3668
Add missing class exports (#1164) 2021-11-10 10:32:48 -08:00
Eryu Xia 5831a96b56
Update generator to stop mentioning methodInfo (in TS files) (#1152) 2021-10-20 16:21:17 -07:00
Eryu Xia 0368e31aaa
Update references to version 1.3.0 (#1148) 2021-10-14 14:30:22 -07:00
Eryu Xia 4835cb6df8
Update g++ flags based on MacOS v.s. Linux (#1147) 2021-10-13 20:27:55 -07:00
Eryu Xia 4676d14333
Adding `-static` to generator g++ build flag (#1146) 2021-10-13 18:25:59 -07:00
Eryu Xia 7f70efec6e
Bump version to 1.3.0 (#1145) 2021-10-13 16:52:01 -07:00
Rohit Joshi 541e3aed20
document stream cancel function (#1081)
Co-authored-by: Eryu Xia <eryu@google.com>
2021-10-07 17:21:01 -07:00
Michal Augustýn 41f7cc71cf
docs: example showing binary format generation fixed (#1135)
Co-authored-by: Eryu Xia <eryu@google.com>
2021-10-07 13:31:56 -07:00
Eryu Xia 3956560ad0
Redo #1063 - Also set timeout on HTTP request if deadline for grpc call is set. (#1142) 2021-09-28 18:44:18 -07:00
Eryu Xia a992d943f8
Pin chrome version to `93.0.4577.63` (as in the Docker image) (#1143) 2021-09-28 14:53:27 -07:00
Eryu Xia f1fe57473f
Internal code sync (#1140) 2021-09-28 10:48:20 -07:00
Eryu Xia 627e33718d
Internal code sync (#1139)
- Internal code sync (up to Aug 4, 2021 for now..) & relevant improvements. :)
- Updated Closure dependency to 20210808.0.0 (necessary dependency)
2021-09-22 16:53:00 -07:00
Eryu Xia 78ddf996d8
Clean up Javascript-related Bazel rules. (#1138) 2021-09-21 23:16:28 -07:00
Eryu Xia 32fe12459b
Revamp Closure JsUnit tests runtime and optimize test/build flows. (#1137) 2021-09-21 15:27:21 -07:00
Ola Flisbäck d9a6c7a738
Require assert in hello world README example (#1116) 2021-09-08 01:29:54 -07:00
Eryu Xia a489de6f9e Replace use of `third_party/closure-library` submodule
... in favor of `google-closure-library` npm package.

Removed the third_party/closure-library submodule following the instructions here:
https://git.wiki.kernel.org/index.php/GitSubmoduleTutorial#Removal

Tested:
- Verified that `npm run build` inside `packages/grpc-web` generates
  exactly the same output as before.
- Test ran closure client: `docker-compose up --build node-server envoy closure-client`
2021-09-01 18:17:14 -07:00