feat(xds): Implement CheckRequestBuilder for external authorization #12493
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR sits on top of #12492, so only the last commit + any fixups need to be reviewed.
This commit introduces the
CheckRequestBuilderlibrary, which is responsible for constructing theCheckRequestmessage sent to the external authorization service.The
CheckRequestBuildergathers information from various sources, including:ServerCallattributes (local and remote addresses, SSL session).MethodDescriptor(full method name).It uses this information to populate the
AttributeContextof theCheckRequestmessage, 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-6bb76a24aa142cc33db9218509688f01b30c8885d2fd8849f164244e68cd54eaR196-R250
Unit tests for the new components are also included.