push
github
feat(xds): Implement CheckRequestBuilder for external authorization (#12493) This PR sits on top of #12492, so only the last commit + any fixups need to be reviewed. This commit introduces the `CheckRequestBuilder` library, which is responsible for constructing the `CheckRequest` message sent to the external authorization service. The `CheckRequestBuilder` gathers information from various sources, including: - `ServerCall` attributes (local and remote addresses, SSL session). - `MethodDescriptor` (full method name). - Request headers. It uses this information to populate the `AttributeContext` of the `CheckRequest` message, which provides the authorization service with the necessary context to make an authorization decision. This commit also introduces the `ExtAuthzCertificateProvider`, a helper class for extracting certificate information, such as the principal and PEM-encoded certificate. The relevant section of the spec is: https://github.com/grpc/proposal/pull/481/files#diff-6bb76a24ad2fd8849f164244e68cd54eaR196-R250 Unit tests for the new components are also included.
38780 of 43451 relevant lines covered (89.25%)
0.89 hits per line