- Author(s): @markdroth
- Approver: @ejona86
- Status: {Draft, In Review, Ready for Implementation, Implemented}
- Implemented in: <language, ...>
- Last updated: 2023-05-03
- Discussion at: https://groups.google.com/g/grpc-io/c/dJFBiMzs6C0
gRPC will add support for the StringMatcher
field in xDS header matching.
gRPC introduced support for xDS routing in gRFC A28. Since that
feature was implemented, however, a new StringMatcher
field was added
to the xDS HeaderMatcher
proto in
envoyproxy/envoy#17119. This provides a more
general-purpose matching API and adds the ability to make matches in a
case-insensitive way.
This proposal updates gRPC to support this new field.
gRPC will support the HeaderMatcher.string_match
field.
Note that this field is part of a oneof
, so it is an alternative to
the existing fields that gRPC already supports.
The new field provides a superset of the functionality of the existing
fields exact_match
, safe_regex_match
, prefix_match
, suffix_match
,
and contains_match
. Those fields are marked as deprecated in the
xDS proto. However, those fields are still commonly used, so gRPC will
continue to support them for the foreseeable future.
The new field provides one additional feature over the old fields, which
is the ability to ignore case in matches via the ignore_case
field.
Note that this option is ignored for regex matches.
Note that gRPC has existing code to support the StringMatcher
proto as
part of supporting RBAC, as specified in gRFC A41. If possible,
gRPC implementations should provide common code for evaluating header
matches that can be shared between the two features.
No environment variable protection is proposed for this feature, since it's a simple extension of existing header matching functionality. Unit test coverage should be sufficient to ensure that the new fields are handled correctly.
N/A
Implemented in C-core in grpc/grpc#32993.
N/A