well-typed / grapesy

Native Haskell gRPC client and server based on `http2`
Other
32 stars 4 forks source link

HTTP2/GRPC spec tweaks #42

Closed mstksg closed 7 months ago

mstksg commented 7 months ago

Summary:

Issues:

  1. Not sure what the best UX would be for specifying the authority -- Maybe String seems appropriate since it's expected to just be a literal header value? But it's also not obvious what's going on if you aren't already familiar with http2/grpc.
  2. Not sure if we want to also provide this ability to the TLS version, but I'm also not totally sure that that is supported in http2 in any case.
edsko commented 7 months ago

So just for reference, grpcurl takes an address as argument, documented as

The address will typically be in the form "host:port" where host can be an IP
address or a hostname and port is a numeric port or service name. If an IPv6
address is given, it must be surrounded by brackets, like "[2001:db8::1]". For
Unix variants, if a -unix=true flag is present, then the address must be the
path to the domain socket.

and then accepts an optional -authority argument:

  -authority string
        The authoritative name of the remote server. This value is passed as the
        value of the ":authority" pseudo-header in the HTTP/2 protocol. When TLS
        is used, this will also be used as the server name when verifying the
        server's certificate. It defaults to the address that is provided in the
        positional arguments.
edsko commented 7 months ago

Superseded by #46, which includes the work from this PR, cleans it up a bit, and extends it to TLS also.