Skip to content

Commit

Permalink
feat: export S3_BUCKET from minio provider + fix S3_ENDPOINT_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
matteo-s committed Feb 14, 2025
1 parent 532fd9f commit a5688f0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion application/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ files:
s3:
access-key: ${AWS_ACCESS_KEY:}
secret-key: ${AWS_SECRET_KEY:}
endpoint: ${S3_ENDPOINT:}
endpoint: ${S3_ENDPOINT_URL:}
bucket: ${S3_BUCKET:}
signature-version: s3v4
region: ${S3_REGION:us-east-1}
Expand Down Expand Up @@ -263,6 +263,7 @@ credentials:
enable: ${MINIO_CREDENTIALS_PROVIDER:false}
endpoint: ${MINIO_CREDENTIALS_ENDPOINT:${files.store.s3.endpoint}}
region: ${MINIO_CREDENTIALS_REGION:${files.store.s3.region}}
bucket: ${MINIO_CREDENTIALS_REGION:${files.store.s3.bucket}}
claim: ${MINIO_CREDENTIALS_CLAIM:minio/policy}
policy: ${MINIO_CREDENTIALS_POLICY:readwrite}
duration: ${MINIO_CREDENTIALS_DURATION:86400}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ public class MinioProvider implements CredentialsProvider, InitializingBean {
@Value("${credentials.provider.minio.region}")
private String region;

@Value("${credentials.provider.minio.bucket}")
private String bucket;

@Value("${credentials.provider.minio.enable}")
private Boolean enabled;

Expand Down Expand Up @@ -138,6 +141,7 @@ private MinioSessionCredentials generate(@NotNull String username, @NotNull Stri
.sessionToken(response.sessionToken())
.endpoint(endpointUrl)
.region(region)
.bucket(bucket)
.signatureVersion("s3v4")
.build();
} catch (NoSuchAlgorithmException | ProviderException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class MinioSessionCredentials extends AbstractCredentials {
@JsonProperty("aws_session_token")
private String sessionToken;

@JsonProperty("s3_endpoint")
@JsonProperty("s3_endpoint_url")
private String endpoint;

@JsonProperty("s3_region")
Expand All @@ -53,6 +53,9 @@ public class MinioSessionCredentials extends AbstractCredentials {
@JsonProperty("s3_signature_version")
private String signatureVersion;

@JsonProperty("s3_bucket")
private String bucket;

@Override
public void eraseCredentials() {
//clear credentials
Expand Down

0 comments on commit a5688f0

Please sign in to comment.