Commit Graph

930 Commits

Author SHA1 Message Date
pro-wh e11903b337
GrpcWebClientReadableStream: keep falsy data (#1230) 2022-10-25 00:49:54 -07:00
Eryu Xia b0ea9c7c45
1.4.1 Post-release updates (incl. release notes) (#1290) 2022-09-30 16:39:48 -07:00
Eryu Xia 4974a7b5a9
Expose getName() in MethodDescriptor and fix TS definitions. (#1289) 2022-09-30 16:28:51 -07:00
Eryu Xia ac17547d78
Bump version to 1.4.1 (#1287) 2022-09-27 22:04:46 -07:00
Eryu Xia 8a123090f8
Fix duplicate dot in enum name (#1286) 2022-09-26 17:00:57 -07:00
Eryu Xia d1d99eb80b
Internal code sync (#1280) 2022-09-26 14:12:01 -07:00
Eryu Xia 17e6a81709
Bump protoc plugin version to `1.4.0` (#1282) 2022-09-23 13:07:22 -07:00
Eryu Xia 1e8e8c926b
Bump version to 1.4.0 (#1281) 2022-09-22 16:45:44 -07:00
Chandraaditya 903601a426
fixes the status codes ordering (#1279)
in the grpc-web package the status codes are in the wrong order causing them to be interpreted differently, so when comparing status codes that we get from a service it is not the same, this commit fixes that
2022-09-19 15:58:02 -07:00
Eryu Xia b3d7dbdd5e
Fix Enum with module in generated TS interface. (#1278)
Verified with the example in https://github.com/grpc/grpc-web/issues/1271

// enum.proto
```proto
syntax = "proto3";

enum DocEnum {
    DOC_ENUM_PDF = 0;
    DOC_ENUM_HTML = 1;
}
```

// test.proto
```proto
syntax = "proto3";

import "enum.proto";

package Test;

message HelloRequest {
    DocEnum doc = 1;
}
```

generate:
```
protoc --proto_path=. --js_out=import_style=commonjs,binary:. --grpc-web_out=import_style=typescript,mode=grpcwebtext:. *.proto
```
2022-09-16 16:26:10 -07:00
Kiryl Valkovich 94a98d7ced
Add Tonic framework to README.md (#1273) 2022-09-06 13:52:44 -07:00
Eryu Xia a5bd765d1d
Fix code and documentation to pass `deadline` metadata as a String. (#1269)
- As Metadata is a <string, string> map per Closure and TS definition.
2022-08-30 16:08:35 -07:00
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