-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Description
This is a meta-issue to track all the things that we need to fix (or add new functionality) with respect to how :authority is used in gRPC-Go.
-
Determining
:authorityfrom the target URI must be the responsibility of the name resolver. See: HTTP2 authority header is not set to resolver.Address.ServerName (?) #4516- Add an optional interface, to be implemented by name resolvers or their builders, that contains a single method to return the channel’s authority.
- This method must not perform any I/O, be non-blocking and the return value must not change over time.
- This value will be used to populate the
:authoritypseudo-header, andserverNamefor TLS handshake by default. - gRPC will provide an implementation which conforms to RFC 3986 and returns the path portion of the target, after stripping query parameters. This will be used if the scheme’s name resolver does not provide a custom one.
- grpcutil.ParseTarget will be enhanced for this purpose.
- This parsed target will be passed to load balancers in their BuildOptions, with the correct
authorityset.
- Add an optional interface, to be implemented by name resolvers or their builders, that contains a single method to return the channel’s authority.
-
Add a call option to override the
:authorityheader on a per-RPC basis. client: Add CallOption for setting authority; allow even without WithInsecure #3444- An optional interface will be added, to be implemented by
AuthInfoimplementations, to validate this override.- Implementations will need to perform a hostname validation check on the peer certificate, received during the handshake, to validate this override.
- RPCs will fail if this call option is set, but:
AuthInfofor the subChannel does not implement this interface- validation by
AuthInfofails
- Existing TLS based credentials implementations will be enhanced to support this.
- Insecure credentials will allow for any authority value.
- An optional interface will be added, to be implemented by
-
Continue to support the per-address serverName override in the addresses returned by the name resolver.
- This field represents a security risk, since an attacker can specify both the addresses and the
serverNameto be used and can direct traffic to balancers/hosts controlled by them. This is addressed by the use of theWithAuthoritydial option. - This override should affect both the
:authorityheader sent in theHEADERSframe and theserverNameused for the TLS handshake.
- This field represents a security risk, since an attacker can specify both the addresses and the
-
Make the
WithAuthoritydial option work for secure credentials as well.- Currently this is supported only for
insecurecredentials. - This needs to influence both, the
:authorityheader and theserverName. - This override also disables any per-address overrides specified by the name resolver above.
- Currently this is supported only for
-
Deprecate the
OverrideServerName()method oncredentials.TransportCredentialsinterface.
#RouteLookupService