-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
s2a: Combine MtlsToS2ChannelCredentials and S2AChannelCredentials. #11544
Conversation
File privateKeyFile = new File(privateKeyPath); | ||
File certChainFile = new File(certChainPath); | ||
File trustBundleFile = new File(trustBundlePath); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should verify that the files exist so that you can provide a meaningful error message if they don't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 2407bb6
} | ||
|
||
public ChannelCredentials build() { | ||
public ChannelCredentials build() throws IOException { | ||
checkState(!isNullOrEmpty(s2aAddress), "S2A address must not be null or empty."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both of these are already checked in newBuilder()
. They should be verified when being set, not during build(), so even if we add set methods later, we wouldn't want them here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 36222a0
String certChainPath = "src/test/resources/client_cert.pem"; | ||
String trustBundlePath = "src/test/resources/root_cert.pem"; | ||
File privateKeyFile = new File(privateKeyPath); | ||
if (!privateKeyFile.exists()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no point to doing this in the test. TlsChannelCredentials will throw if the files don't exist. Ditto in the other test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in a81e242
…rpc#11544) * Combine MtlsToS2ChannelCredentials and S2AChannelCredentials. * Check if file exists. * S2AChannelCredentials API requires credentials used for client-s2a channel. * remove MtlsToS2A library in BUILD. * Don't check state twice. * Don't check for file existence in tests.
No description provided.