Proto commits in connectrpc/conformance

These 31 commits are when the Protocol Buffers files have changed:

Commit:7d90745
Author:Joshua Humphries
Committer:GitHub

Update test cases for consistency, backfill missing cancel tests (#874) After noticing some naming inconsistencies, I added a test that verifies that the embedded test files all conform to the naming conventions described in the docs. That found a few issues, so this PR fixes them all. I noticed and changed a few other things while doing this other clean-up in the tests: 1. We were being lenient with gRPC implementations regarding an unknown content-type. That's because I thought this behavior (using a 415 HTTP status code) wasn't fully specified. But it turns out that is is! So I've moved these all to a test suite that is not protocol-specific, since all three protocols now expect the same behavior. 2. I noticed a test that was commented out with a TODO. The change the TODO was contingent was on was already done, so the test could be re-enabled. 3. The new naming convention test revealed a naming issue in the cancellation tests. When I went to fix that, I also noticed there were some redundant cases in here: the `cancel-after-zero-responses` test cases are not actually different than the `cancel-after-close-send`. While the contents of the test case are slightly different, the behavior they induce in the client is the same, which is to cancel the RPC right after the request stream is closed. It seemed odd that we'd have a test for cancelling "after" receiving zero responses. That's really like a cancel before the first response is received, and that felt awkward to implement since ideally you simply check that number _after_ receiving a response (per the name of the field). So I opted to remove those and keep the `cancel-after-close-send` version. 4. The server-stream cancel tests only had the `cancel-after-zero-responses`, and no `cancel-after-close-send` version. So I "fixed" that -- to use `cancel-after-send` for consistency with the others -- only to realize that the reference clients did not actually implement it. That's when I also realized that there was no test for cancelling unary RPCs. (The reference clients also did not implement cancellation in the unary RPC flow.) The biggest changes in here were to get all of the client implementations to handle the `cancel.after_close_send_ms` field in the input.

The documentation is generated from this commit.

Commit:d43228d
Author:Joshua Humphries
Committer:GitHub

Deprecate the textpb codec (#875) I wish I had done this before v1.0 so I could have just removed it without it being a back-compat issue. Oh well 🤷

Commit:3f31e07
Author:Joshua Humphries
Committer:GitHub

Relax expectation for unspecified errors, fix expectation for cardinality violations (#833) There are numerous error conditions in gRPC where the actual behavior of a client or server in the face of such an error is unspecified. In particular, there is no specification for how a client or server should react to an invalid/unexpected HTTP method or content-type. So this adds a mechanism to supply additional acceptable error codes. One that thing that **is** specified, but was codified with the wrong expectation in these tests, is related to cardinality violations. A cardinality violation is when exactly one request or response is expected (for a unary RPC or the non-streaming half of a non-bidi streaming RPC), but there is actually zero or more than one. This is specified in a table that accompanies the docs for gRPC codes. Search for "cardinality violation" in this page: https://grpc.github.io/grpc/core/md_doc_statuscodes.html

Commit:c57e886
Author:Joshua Humphries
Committer:GitHub

Test runner generates self-signed cert that servers-under-test can use (#828) This allows servers-under-test to just use a given PEM-encoded certificate, instead of having to generate their own.

Commit:ff0bdfb
Author:Steve Ayers
Committer:GitHub

Add docs for implementing a server (#808) This adds documentation for how to implement a server for conformance tests. --------- Co-authored-by: Joshua Humphries <2035234+jhump@users.noreply.github.com>

Commit:1a64824
Author:Steve Ayers
Committer:GitHub

Add additional docs to the proto files (#792) This expands on documentation in the proto files and also adds documentation to messages where none existed. --------- Co-authored-by: Joshua Humphries <2035234+jhump@users.noreply.github.com>

Commit:926b534
Author:Steve Ayers
Committer:GitHub

Add tests for unexpected raw responses (#774) This adds tests for unexpected values such as: * Unmapped HTTP code * Nonexistent HTTP code * Invalid Content-Type * Invalid Content-Encoding --------- Co-authored-by: Josh Humphries <2035234+jhump@users.noreply.github.com>

Commit:c31206d
Author:Joshua Humphries
Committer:GitHub

Add checks in referenceclient to validate raw gRPC-Web trailers and actual HTTP trailers (#780) This adds handling of the HTTP trailers and gRPC-Web end-stream messages to the reference client. When in reference mode, it will examine them and make sure they are appropriate, using stricter checks than connect-go (so we can't just rely on the base connect-go client implementation in the reference client to raise these issues in the conformance results).

Commit:1c86931
Author:Joshua Humphries
Committer:GitHub

Remove wire details from proto model (#784) As it turns out, the wire details can all be internal implementation details in the reference client. So instead of sending any of that back, the reference client will analyze the details and send back issues in the "feedback" field. We do still need to send back the HTTP status code though. Aside: this also adds a `.gitattributes` file so that generated TS/JS files will be collapsed by default in future diffs.

Commit:bbda232
Author:Steve Ayers
Committer:GitHub

Move feedback into ClientCompatResponse (#776) This moves the `feedback` field into the `ClientCompatResponse` so that it is easier to report feedback on the client-side. This way the reference client can simply set the `Feedback` field when returning a response result, which will then be written out by the server runner.

Commit:f5edb25
Author:Steve Ayers
Committer:GitHub

Add wire tracer capabilities to reference client (#768) This piggybacks off of the tracer framework to add wire tracing to the reference client. Broadly, this implements the `Collector` interface and intercepts the `Complete` function invocation to sniff the built trace and acquire wire details. The details tracked are: - Actual HTTP status code - Actual trailers on the wire - Connect Raw Error Details (if applicable) Note that the tests to verify raw error details trailers are not yet in place to keep the complexity of this PR lower. They will be added in a follow-up PR. --------- Co-authored-by: Joshua Humphries <2035234+jhump@users.noreply.github.com>

Commit:1588ee0
Author:Steve Ayers
Committer:GitHub

Update copyright year for 2024 (#752) This adds 2024 to the copyright years for license headers.

Commit:4c7be66
Author:Steve Ayers
Committer:GitHub

Fix cancellation and timeout failures (#734) This makes various improvements to fix the failing cancellation and timeout tests: * Removes `ctx.Err()` checks in the clients since this can be an ambiguous error on the client and could potentially be unrelated to the error we received from the RPC framework. * Adds logic to immediately send response headers on server and bidi streams so that clients can be unblocked reading this data. Previously this was causing clients to block on reading this data and was preventing them from cancelling at the intended time. * Adds docs to the protos specifying the above. * Adds cancellation logic to gRPC `BidiStream` * Configures some tests with appropriate delays so that the cancellation is properly communicated. All of the tests in `bidi-cancellation.yaml` and `bidi-timeouts.yaml` have been folded into the `basic.yaml` suite of tests since these apply to and pass all permutations.

Commit:1b090e9
Author:Steve Ayers
Committer:GitHub

Add tests for Connect GET operations (#721) This adds tests to the conformance suite for Connect GET operations via a new endpoint named `IdempotentUnary`. This endpoint is annotated as `NO_SIDE_EFFECTS` and all clients and servers should use HTTP GET to communicate. --------- Co-authored-by: Joshua Humphries <2035234+jhump@users.noreply.github.com> Co-authored-by: Chris Pine <cpine@buf.build> Co-authored-by: Nick Snyder <nickdsnyder@gmail.com>

Commit:988e598
Author:Steve Ayers
Committer:GitHub

Clarify rules around response definitions (#711) This tries to clarify the rules around response definitions and how the server should behave in various scenarios where response definition is either not set at all or is partially set with various values. To complement this, it also adds tests for each RPC type that have partially-set response definitions as well as no response definition. Numerous areas in the servers had to be fixed to check for a `nil` response definition and to act accordingly. The protos have been updated to reflect the rules now and should (hopefully) be clearer and more thorough. The basic rules are: * for unary responses, if no response definition is set, then return the request info and an empty response * for server responses, if no response definition is set (or is set, but no responses are desired), do not send anything on the stream and either return without error or return an error if defined. The bidi flow has changed slightly. The basic premise for full and half duplex is 'if you have no responses to send, check to see if an error was provided. If so, throw that. Otherwise, just do nothing and return without error'. As a result, it is now possible for a full duplex call to have less responses desired than requests sent. In these cases, the flow should follow the above premise. Also, the `connect-only` and `grpc-only` test files have been merged into `basic` since those should be covered the same for all protocols now. Note: this replaces #696 since there were way too many merge conflicts with the merge of v1 into main. This should be identical to PR (just based off of main and with no merge conflicts). --------- Co-authored-by: Joshua Humphries <2035234+jhump@users.noreply.github.com> Co-authored-by: Chris Pine <cpine@buf.build> Co-authored-by: Nick Snyder <nickdsnyder@gmail.com>

Commit:61a5e7a
Author:Joshua Humphries
Committer:GitHub

Preparing for a v1.0 (#703) This merges the long-lived `v1` branch to main, replacing the interop cross-tests on main with an entirely new model that is data-driven. This lets us add test cases to this repo, in a declarative format (YAML files), and they can then easily be run against all implementations (without having to re-implement the test case in each client). Instead of docker containers, needed to ship multiple implementations with differing technology stacks, we now need only a single, statically-linked binary that is part of each release (and downloadable via GitHub release artifacts). This binary functions as a test runner and includes a reference client and reference server linked in, for evaluating other implementations. New implementations can use the conformance tests by implementing a client and/or server for the ConformanceService defined in the protos herein (https://buf.build/connectrpc/conformance). These will be data-driven programs that communicate with the test runner by receiving configuration/inputs via stdin and writing status/results to stdout. --------- Co-authored-by: Steve Ayers <sayers@buf.build>

Commit:47758ea
Author:Sam Small
Committer:GitHub

Update copyright (#559) - Update to use "The Connect Authors" instead of "Buf Technologies, Inc." - Update copyright years from 2022 to 2022-2023

Commit:56c4c70
Author:Alfred Fuller
Committer:GitHub

Add 'v1' to conformance package name (#515)

Commit:56d9214
Author:Alfred Fuller
Committer:GitHub

Move test protos into `connectrpc.conformance` package (#510) So they don't conflict with the grpc c++ library.

Commit:36ce5b0
Author:Alfred Fuller
Committer:GitHub

Use well known types in test protos (#509)

Commit:3e4b5ac
Author:Steve Ayers
Committer:GitHub

Add connect-node-fastify server (#477) This adds a new Connect server using `connect-fastify` and `connect-node`. It wires it into the docker-compose setup and allows for serving HTTP/1.1 and HTTP/2 traffic using cleartext and TLS. Fastify does not offer HTTP/3 support as of yet, so that path is not available. Note: this does not yet use TLS, but can be added as a follow-up PR. In addition, this also refactors a few things such as: * adds TypeScript support to the web portion * renames images, Dockerfiles, etc. to match the language so that adding new languages can follow one pattern. For example, `client-connect-to-server-connect-go-h2` becomes `client-connect-go-to-server-connect-go-h2` and uses `Dockerfile.crosstestgo` instead of `Dockerfile.crosstest`. * updates to connect-go v1.9.0 for https://github.com/bufbuild/connect-go/pull/528 which fixes an issue with parsing response headers from a connect-node server. * updates to connect-es v0.11.0 for https://github.com/bufbuild/connect-es/pull/695, which fixes an issue with parsing response bodies for non-JSON content types.

Commit:5384268
Author:jchadwick-buf
Committer:GitHub

Add cacheable unary test (#441) Continuing on the work in #434, but with a few notable changes: - Streaming is no longer tested. We did not ship GET requests for server streaming, so there is nothing to test here (yet?) - Server handler asserts that the call is made using GET when called via Connect client, to give some assurance that it works. - Added new test to README.md. - Avoids some unnecessary changes in generated code. --------- Co-authored-by: Alan Chiu <awlchiu@gmail.com>

Commit:18528e0
Author:Timo Stamm
Committer:GitHub

Add test case fail_server_streaming_after_response (#386)

Commit:1888390
Author:Tommy Ma
Committer:GitHub

upgrade dependencies (#308)

Commit:34bba55
Author:Tommy Ma
Committer:GitHub

add Connect-specific tests (#164)

Commit:4965463
Author:bufdev
Committer:GitHub

Cleanup (#126) * commit * commit * commit * commit * commit * commit * commit * commit * commit * commit * commit * Address TODOs * Fix crosstest.yaml * Remove `Grpc-Timeout` from CORS headers Co-authored-by: Doria Keung <doria.keung@gmail.com>

Commit:2bdf74e
Author:Doria Keung
Committer:GitHub

Add server and first draft of client binaries with server metadata proto (#10)

Commit:2a2067e
Author:Akshay Shah
Committer:GitHub

Format proto, add README (#8)

Commit:3fbf933
Author:Doria Keung
Committer:Akshay Shah

Add interop and cross tests and go tests.

Commit:92fce16
Author:Doria Keung
Committer:GitHub

Add GRPC testing protos (#2)

Commit:440dc90
Author:bufdev

Initial commit