시큐리티 설정
유저 API - 로그인, 회원가입, 계정정보 추가
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package kr.co.vividnext.sodalive.configs
|
||||
|
||||
import com.amazonaws.auth.AWSStaticCredentialsProvider
|
||||
import com.amazonaws.auth.BasicAWSCredentials
|
||||
import com.amazonaws.services.s3.AmazonS3Client
|
||||
import com.amazonaws.services.s3.AmazonS3ClientBuilder
|
||||
import org.springframework.beans.factory.annotation.Value
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.springframework.context.annotation.Configuration
|
||||
|
||||
@Configuration
|
||||
class AmazonS3Config(
|
||||
@Value("\${cloud.aws.credentials.access-key}")
|
||||
private val accessKey: String,
|
||||
@Value("\${cloud.aws.credentials.secret-key}")
|
||||
private val secretKey: String,
|
||||
@Value("\${cloud.aws.region.static}")
|
||||
private val region: String
|
||||
) {
|
||||
|
||||
@Bean
|
||||
fun amazonS3Client(): AmazonS3Client {
|
||||
val awsCredentials = BasicAWSCredentials(accessKey, secretKey)
|
||||
return AmazonS3ClientBuilder.standard()
|
||||
.withRegion(region)
|
||||
.withCredentials(AWSStaticCredentialsProvider(awsCredentials))
|
||||
.build() as AmazonS3Client
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user