-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
📝 resolved conflict merge at sercurity constants
- Loading branch information
Showing
102 changed files
with
3,459 additions
and
439 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.toyProject7.karrot | ||
|
||
import org.springframework.context.annotation.Bean | ||
import org.springframework.context.annotation.Configuration | ||
import software.amazon.awssdk.auth.credentials.EnvironmentVariableCredentialsProvider | ||
import software.amazon.awssdk.regions.Region | ||
import software.amazon.awssdk.services.s3.S3Client | ||
import software.amazon.awssdk.services.s3.presigner.S3Presigner | ||
|
||
@Configuration | ||
class AwsS3Config { | ||
@Bean | ||
fun s3Client(): S3Client { | ||
val regionName = System.getenv("AWS_REGION") ?: "Something went wrong" | ||
if (regionName == "Something went wrong") { | ||
throw IllegalStateException( | ||
"AWS_S3_BUCKET environment variable is missing. Please configure it.", | ||
) | ||
} | ||
|
||
return S3Client.builder() | ||
.region(Region.of(regionName)) | ||
.credentialsProvider(EnvironmentVariableCredentialsProvider.create()) | ||
.build() | ||
} | ||
|
||
@Bean | ||
fun s3Presigner(): S3Presigner { | ||
val regionName = System.getenv("AWS_REGION") ?: "Something went wrong" | ||
if (regionName == "Something went wrong") { | ||
throw IllegalStateException( | ||
"AWS_S3_BUCKET environment variable is missing. Please configure it.", | ||
) | ||
} | ||
|
||
return S3Presigner.builder() | ||
.region(Region.of(regionName)) | ||
.credentialsProvider(EnvironmentVariableCredentialsProvider.create()) | ||
.build() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.toyProject7.karrot | ||
|
||
import org.springframework.context.annotation.Configuration | ||
import org.springframework.messaging.simp.config.MessageBrokerRegistry | ||
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker | ||
import org.springframework.web.socket.config.annotation.StompEndpointRegistry | ||
import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer | ||
|
||
@Configuration | ||
@EnableWebSocketMessageBroker | ||
class WebSocketConfig : WebSocketMessageBrokerConfigurer { | ||
override fun registerStompEndpoints(registry: StompEndpointRegistry) { | ||
registry.addEndpoint("/ws").setAllowedOriginPatterns("*").withSockJS() | ||
} | ||
|
||
override fun configureMessageBroker(config: MessageBrokerRegistry) { | ||
config.enableSimpleBroker("/topic") // 구독 경로 | ||
config.setApplicationDestinationPrefixes("/app") // 전송 경로 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.