- Notifications
You must be signed in to change notification settings - Fork 68
feat: Validate the Universe Domain #2330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
558e3fb to 34e109c Compare lqiu96 commented Jan 9, 2024
gax-java/gax/src/main/java/com/google/api/gax/rpc/ApiCallContext.java Outdated Show resolved Hide resolved
lqiu96 commented Jan 9, 2024
gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java Outdated Show resolved Hide resolved
burkedavison reviewed Jan 9, 2024
...son/src/test/java/com/google/api/gax/httpjson/HttpJsonDirectServerStreamingCallableTest.java Outdated Show resolved Hide resolved
burkedavison reviewed Jan 9, 2024
gax-java/gax/src/main/java/com/google/api/gax/rpc/ApiCallContext.java Outdated Show resolved Hide resolved
blakeli0 reviewed Jan 10, 2024
gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallContext.java Outdated Show resolved Hide resolved
gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallContext.java Outdated Show resolved Hide resolved
gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallContext.java Outdated Show resolved Hide resolved
gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallContext.java Outdated Show resolved Hide resolved
gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallContext.java Outdated Show resolved Hide resolved
gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java Outdated Show resolved Hide resolved
gax-java/gax/src/main/java/com/google/api/gax/rpc/ApiCallContext.java Outdated Show resolved Hide resolved
blakeli0 reviewed Jan 11, 2024
gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallContext.java Outdated Show resolved Hide resolved
blakeli0 reviewed Jan 11, 2024
gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonClientCallsTest.java Outdated Show resolved Hide resolved
blakeli0 reviewed Jan 11, 2024
gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java Outdated Show resolved Hide resolved
blakeli0 reviewed Jan 11, 2024
gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java Outdated Show resolved Hide resolved
blakeli0 reviewed Jan 12, 2024
...ava/gax-grpc/src/test/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProviderTest.java Show resolved Hide resolved
blakeli0 reviewed Jan 12, 2024
gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonCallContext.java Show resolved Hide resolved
blakeli0 approved these changes Jan 12, 2024
|
|
lqiu96 added a commit that referenced this pull request Jan 17, 2024
* feat: Validate the universe domain * chore: Merge in from origin/main * chore: Add comments for ApiCallContext * chore: Add comments * chore: Address PR comments * chore: Merge endpoint context in both transports * chore: Use @throws for the exceptions * chore: Provide a default EndpointContext * chore: Address PR comments * chore: Update error message * chore: Address PR comments * chore: Address PR comments * chore: Address PR comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.

Universe Domain validation ensures that the user configured value matches the one set in the Credentials. If validation does not succeed, the call should not proceed. Validating the unvierse domain should occur prior to each RPC invocation.
Behavior shared between transports:
Transport Specific Behavior:
CallContext's
merge()Callables are created with the TransportCallableFactory using the defaultCallContext. The defaultCallContext is merged with the call's callcontext in a default invocation:
sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/rpc/UnaryCallable.java
Line 126 in 97ae228
GAPIC clients expose callables which invoke the
call()with a null callcontext: https://github.com/googleapis/google-cloud-java/blob/c12ae4aacc597161211d53f15c60d6ab904d19d2/java-accessapproval/google-cloud-accessapproval/src/main/java/com/google/cloud/accessapproval/v1/AccessApprovalAdminClient.java#L701-L703.Merge is not invoked and does not result in creating the EndpointContext over and over again.