cryptoe commented on code in PR #12339: URL: https://github.com/apache/druid/pull/12339#discussion_r841373219
########## extensions-core/s3-extensions/src/main/java/org/apache/druid/data/input/s3/S3InputSourceConfig.java: ########## @@ -90,6 +91,24 @@ public boolean isCredentialsConfigured() secretAccessKey != null; } + @JsonIgnore + public boolean isAssumeRoleArnConfigured() + { + return assumeRoleArn != null && !assumeRoleArn.trim().isEmpty(); + } + + @JsonIgnore + public boolean isAssumeRoleArnEnvConfigured() + { + return !System.getenv(SDKGlobalConfiguration.AWS_ROLE_ARN_ENV_VAR).trim().isEmpty(); Review Comment: ``` /** * Gets the value of the specified environment variable. An * environment variable is a system-dependent external named * value. * * <p>If a security manager exists, its * {@link SecurityManager#checkPermission checkPermission} * method is called with a * <code>{@link RuntimePermission}("getenv."+name)</code> * permission. This may result in a {@link SecurityException} * being thrown. If no exception is thrown the value of the * variable <code>name</code> is returned. * * <p><a name="EnvironmentVSSystemProperties"><i>System * properties</i> and <i>environment variables</i></a> are both * conceptually mappings between names and values. Both * mechanisms can be used to pass user-defined information to a * Java process. Environment variables have a more global effect, * because they are visible to all descendants of the process * which defines them, not just the immediate Java subprocess. * They can have subtly different semantics, such as case * insensitivity, on different operating systems. For these * reasons, environment variables are more likely to have * unintended side effects. It is best to use system properties * where possible. Environment variables should be used when a * global effect is desired, or when an external system interface * requires an environment variable (such as <code>PATH</code>). * * <p>On UNIX systems the alphabetic case of <code>name</code> is * typically significant, while on Microsoft Windows systems it is * typically not. For example, the expression * <code>System.getenv("FOO").equals(System.getenv("foo"))</code> * is likely to be true on Microsoft Windows. * * @param name the name of the environment variable * @return the string value of the variable, or <code>null</code> * if the variable is not defined in the system environment * @throws NullPointerException if <code>name</code> is <code>null</code> * @throws SecurityException * if a security manager exists and its * {@link SecurityManager#checkPermission checkPermission} * method doesn't allow access to the environment variable * <code>name</code> * @see #getenv() * @see ProcessBuilder#environment() */ public static String getenv(String name) { SecurityMana ``` So yeah System.getEnv can return a null -- 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: dev-unsubscr...@druid.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@druid.apache.org For additional commands, e-mail: dev-h...@druid.apache.org