mirror of https://github.com/grpc/grpc-java.git
example-xds: Change arg from --secure to --xds-creds
The xds creds don't actually guarantee anything is secure. We don't want to give new users a false impression.
This commit is contained in:
parent
0be12b40c3
commit
902cc019fa
|
|
@ -71,12 +71,14 @@ public class XdsHelloWorldClient {
|
||||||
ChannelCredentials credentials = InsecureChannelCredentials.create();
|
ChannelCredentials credentials = InsecureChannelCredentials.create();
|
||||||
if (args.length > 0) {
|
if (args.length > 0) {
|
||||||
if ("--help".equals(args[0])) {
|
if ("--help".equals(args[0])) {
|
||||||
System.out.println("Usage: [--secure] [NAME [TARGET]]\n");
|
System.out.println("Usage: [--xds-creds] [NAME [TARGET]]");
|
||||||
System.err.println(" --secure Use credentials provided by xDS. Defaults to insecure");
|
System.out.println("");
|
||||||
|
System.err.println(" --xds-creds Use credentials provided by xDS. Defaults to insecure");
|
||||||
|
System.out.println("");
|
||||||
System.err.println(" NAME The name you wish to be greeted by. Defaults to " + user);
|
System.err.println(" NAME The name you wish to be greeted by. Defaults to " + user);
|
||||||
System.err.println(" TARGET The server to connect to. Defaults to " + target);
|
System.err.println(" TARGET The server to connect to. Defaults to " + target);
|
||||||
System.exit(1);
|
System.exit(1);
|
||||||
} else if ("--secure".equals(args[0])) {
|
} else if ("--xds-creds".equals(args[0])) {
|
||||||
// The xDS credentials use the security configured by the xDS server when available. When
|
// The xDS credentials use the security configured by the xDS server when available. When
|
||||||
// xDS is not used or when xDS does not provide security configuration, the xDS credentials
|
// xDS is not used or when xDS does not provide security configuration, the xDS credentials
|
||||||
// fall back to other credentials (in this case, InsecureChannelCredentials).
|
// fall back to other credentials (in this case, InsecureChannelCredentials).
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ public class XdsHelloWorldServer {
|
||||||
int port = 50051;
|
int port = 50051;
|
||||||
String hostname = null;
|
String hostname = null;
|
||||||
ServerCredentials credentials = InsecureServerCredentials.create();
|
ServerCredentials credentials = InsecureServerCredentials.create();
|
||||||
if (args.length >= 1 && "--secure".equals(args[0])) {
|
if (args.length >= 1 && "--xds-creds".equals(args[0])) {
|
||||||
// The xDS credentials use the security configured by the xDS server when available. When xDS
|
// The xDS credentials use the security configured by the xDS server when available. When xDS
|
||||||
// is not used or when xDS does not provide security configuration, the xDS credentials fall
|
// is not used or when xDS does not provide security configuration, the xDS credentials fall
|
||||||
// back to other credentials (in this case, InsecureServerCredentials).
|
// back to other credentials (in this case, InsecureServerCredentials).
|
||||||
|
|
@ -47,9 +47,10 @@ public class XdsHelloWorldServer {
|
||||||
try {
|
try {
|
||||||
port = Integer.parseInt(args[0]);
|
port = Integer.parseInt(args[0]);
|
||||||
} catch (NumberFormatException ex) {
|
} catch (NumberFormatException ex) {
|
||||||
System.err.println("Usage: [--secure] [PORT [HOSTNAME]]");
|
System.err.println("Usage: [--xds-creds] [PORT [HOSTNAME]]");
|
||||||
|
System.err.println("");
|
||||||
|
System.err.println(" --xds-creds Use credentials provided by xDS. Defaults to insecure");
|
||||||
System.err.println("");
|
System.err.println("");
|
||||||
System.err.println(" --secure Use credentials provided by xDS. Defaults to insecure");
|
|
||||||
System.err.println(" PORT The listen port. Defaults to " + port);
|
System.err.println(" PORT The listen port. Defaults to " + port);
|
||||||
System.err.println(" HOSTNAME The name clients will see in greet responses. ");
|
System.err.println(" HOSTNAME The name clients will see in greet responses. ");
|
||||||
System.err.println(" Defaults to the machine's hostname");
|
System.err.println(" Defaults to the machine's hostname");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue