FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

xds: Move JwtTokenFileCallCredentials to xds.client package by kannanjgithub · Pull Request #13006 · grpc/grpc-java · GitHub

/ grpc-java Public

xds: Move JwtTokenFileCallCredentials to xds.client package - #13006

Open
kannanjgithub wants to merge 1 commit into
grpc:masterfrom
kannanjgithub:jtw-creds-move-class
Open

xds: Move JwtTokenFileCallCredentials to xds.client package#13006
kannanjgithub wants to merge 1 commit into
grpc:masterfrom
kannanjgithub:jtw-creds-move-class

Conversation

Copy link
Copy Markdown
Contributor

Move JwtTokenFileCallCredentials from io.grpc.auth to io.grpc.xds.client and make it package-private as it is only used in xds.

To support this move without breaking tests:

  • Moved JwtTokenFileCallCredentialsTest to the same package (io.grpc.xds.client).
  • Created BootstrapperImplTest in io.grpc.xds.client to test the base BootstrapperImpl parsing logic.
  • Moved call_creds parsing tests (which reference JwtTokenFileCallCredentials) from GrpcBootstrapperImplTest to the new BootstrapperImplTest.

…package-private

Move `JwtTokenFileCallCredentials` from `io.grpc.auth` to `io.grpc.xds.client` and make it package-private as it is only used in xds.

To support this move without breaking tests:
- Moved `JwtTokenFileCallCredentialsTest` to the same package (`io.grpc.xds.client`).
- Created `BootstrapperImplTest` in `io.grpc.xds.client` to test the base `BootstrapperImpl` parsing logic.
- Moved `call_creds` parsing tests (which reference `JwtTokenFileCallCredentials`) from `GrpcBootstrapperImplTest` to the new `BootstrapperImplTest`.
kannanjgithub added TODO:release blocker Issue/PR is important enough to delay the release. Removed after release issues resolved TODO:backport PR needs to be backported. Removed after backport complete labels Aug 26, 2026
kannanjgithub added this to the 1.84 milestone Aug 26, 2026
import static org.junit.Assert.fail;

import com.google.common.collect.Iterables;
import io.grpc.CallCredentials;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'm surprised there's a reference to io.grpc.CallCredentials in io.grpc.xds.client. Did we let more grpc dependencies leak into io.grpc.xds.client? Seeing cl/964373254 adds a dependency, yep, we did.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

cl/964373254 (import of #12951) introduced dependency on io.grpc.auth from io.grpc.xds.client. io.grpc.xds.client already used to depend on io.grpc classes such as Status even prior to this change.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We put in effort to make it low dependency, as it is used by non-gRPC transports. We accepted it would use SynchronizationContext, and I guess Status. But it should not contain JwtTokenFileCallCredentials or a reference to it, and we should have definitely not added a dependency to grpc-auth which itself has dependencies on the auth libraries. The JwtTokenFileCallCredentials reference should be in the grpc-specific client code in io.grpc.xds like GrpcBootstrapperImpl. io.grpc.CallCredentials is a small interface, so that by itself isn't that big of a deal, but it is only useful for gRPC, so is clearly a code smell that we're doing something wrong.

Instead of storing CallCredentials as its own field in ServerInfo, we should store it in implSpecificConfig(). I don't think there was any need to change io.grpc.xds.client, as getImplSpecificConfig() was already powerful enough to do this.

(I had argued with Larry that we shouldn't have JSON parsing in io.grpc.xds.client.BootstrapperImpl. I argued the JSON bootstrap format is grpc-specific, so it should be in GrpcBootstrapperImpl (or somewhere else in io.grpc.xds). Larry disagreed and made it "reusable," even though only gRPC uses it.)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

FYI, #12242 was pretty close to being merged, IIRC, but I got too busy and then last memory of its state.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

TODO:backport PR needs to be backported. Removed after backport complete TODO:release blocker Issue/PR is important enough to delay the release. Removed after release issues resolved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL