tengqm commented on code in PR #5618:
URL: https://github.com/apache/gravitino/pull/5618#discussion_r1851207918
##########
clients/cli/src/main/java/org/apache/gravitino/cli/GravitinoCommandLine.java:
##########
@@ -554,4 +557,41 @@ public String getUrl() {
// Return the default localhost URL
return DEFAULT_URL;
}
+
+ /**
+ * Retrieves the Gravitinno authentication from the command line options or
the GRAVITINO_AUTH
+ * environment variable or the Gravitio config file.
+ *
+ * @return The Gravitinno authentication, or null if not found.
+ */
+ public String getAuth() {
+ GravitinoConfig config = new GravitinoConfig(null);
+
+ // If specified on the command line use that
+ if (line.hasOption(GravitinoOptions.SIMPLE)) {
+ return GravitinoOptions.SIMPLE;
+ }
+
+ // Cache the Gravitino URL environment variable
+ if (authEnv == null && !authSet) {
+ authEnv = System.getenv("GRAVITINO_AUTH");
+ authSet = true;
Review Comment:
isn't this decision made too early?
Move it to line before 583?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]