Added property endpoint (#76)
This commit is contained in:
parent
eeaa02e7ea
commit
1c5ef179ef
|
|
@ -8,6 +8,7 @@ import software.amazon.awssdk.auth.credentials.AwsBasicCredentials
|
|||
import software.amazon.awssdk.regions.Region
|
||||
import software.amazon.awssdk.services.s3.S3Client
|
||||
import software.amazon.awssdk.services.s3.presigner.S3Presigner
|
||||
import java.net.URI
|
||||
|
||||
@ComponentScan("ru.touchin.s3.storage")
|
||||
@ConfigurationPropertiesScan("ru.touchin.s3.storage")
|
||||
|
|
@ -20,6 +21,7 @@ class S3Configuration(private val s3Properties: S3Properties) {
|
|||
return S3Client.builder()
|
||||
.region(region)
|
||||
.credentialsProvider { getCredentialsProvider() }
|
||||
.apply { if (s3Properties.endpoint != null) endpointOverride(URI.create(s3Properties.endpoint)) }
|
||||
.build()
|
||||
}
|
||||
|
||||
|
|
@ -28,6 +30,7 @@ class S3Configuration(private val s3Properties: S3Properties) {
|
|||
return S3Presigner.builder()
|
||||
.region(region)
|
||||
.credentialsProvider { getCredentialsProvider() }
|
||||
.apply { if (s3Properties.endpoint != null) endpointOverride(URI.create(s3Properties.endpoint)) }
|
||||
.build()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,5 +11,6 @@ data class S3Properties(
|
|||
val region: String,
|
||||
val bucket: String,
|
||||
val folder: String,
|
||||
val endpoint: String?,
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue