Skip to content
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

add IIO_S3_AWS_FORCE_PATH_STYLE environment variable to support minio s3 server #309

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ public static S3AsyncClient getS3Client(S3ConfigurationProperties configProps) {
getExecutor(configProps)
));

builder.forcePathStyle(configProps.getForcePathStyle());

S3AsyncClient s3AsyncClient = builder.build();
s3AsyncClients.put(region, s3AsyncClient);
return s3AsyncClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ class S3Parser extends S3ConfigurationProperties.S3URIParser {
private int corePoolSize;
private int maxPoolSize;
private int keepAliveTime;
private boolean forcePathStyle;

public final String AWS_S3_USER_KEY;
public final String AWS_S3_PASSWORD_KEY;
Expand All @@ -167,6 +168,7 @@ class S3Parser extends S3ConfigurationProperties.S3URIParser {
public final String AWS_S3_CORE_POOL_SIZE_KEY;
public final String AWS_S3_MAX_POOL_SIZE_KEY;
public final String AWS_S3_KEEP_ALIVE_TIME;
public final String AWS_S3_FORCE_PATH_STYLE;

private final static Logger LOGGER = Logger.getLogger(S3ConfigurationProperties.class.getName());

Expand All @@ -179,6 +181,7 @@ public S3ConfigurationProperties(String alias, BasicAuthURI cogUri) {
AWS_S3_CORE_POOL_SIZE_KEY = "IIO_" + this.alias + "_AWS_CORE_POOL_SIZE";
AWS_S3_MAX_POOL_SIZE_KEY = "IIO_" + this.alias + "_AWS_MAX_POOL_SIZE";
AWS_S3_KEEP_ALIVE_TIME = "IIO_" + this.alias + "_AWS_KEEP_ALIVE_TIME";
AWS_S3_FORCE_PATH_STYLE = "IIO_" + this.alias + "_AWS_FORCE_PATH_STYLE";

user = PropertyLocator.getEnvironmentValue(AWS_S3_USER_KEY, null);
password = PropertyLocator.getEnvironmentValue(AWS_S3_PASSWORD_KEY, null);
Expand All @@ -190,6 +193,8 @@ public S3ConfigurationProperties(String alias, BasicAuthURI cogUri) {
PropertyLocator.getEnvironmentValue(AWS_S3_MAX_POOL_SIZE_KEY, "128"));
keepAliveTime = Integer.parseInt(
PropertyLocator.getEnvironmentValue(AWS_S3_KEEP_ALIVE_TIME, "10"));
forcePathStyle = Boolean.parseBoolean(
PropertyLocator.getEnvironmentValue(AWS_S3_FORCE_PATH_STYLE, "false"));

if (cogUri.getUser() != null && cogUri.getPassword()!= null) {
user = cogUri.getUser();
Expand Down Expand Up @@ -300,4 +305,8 @@ public int getMaxPoolSize() {
public int getKeepAliveTime() {
return keepAliveTime;
}

public boolean getForcePathStyle() {
return forcePathStyle;
}
}